[Healthcare] Fix UI (#14011)

* Fix UI

* Fix Calendar View
This commit is contained in:
Shreya Shah 2018-05-14 14:06:31 +05:30 committed by Nabin Hait
parent a7387b45ec
commit ba6cb8ae4b
2 changed files with 8 additions and 5 deletions

View File

@ -40,7 +40,7 @@ frappe.ui.form.on('Patient', {
}, },
onload: function (frm) { onload: function (frm) {
if(!frm.doc.dob){ if(!frm.doc.dob){
$(frm.fields_dict['age_html'].wrapper).html("Age not specified"); $(frm.fields_dict['age_html'].wrapper).html("");
} }
if(frm.doc.dob){ if(frm.doc.dob){
$(frm.fields_dict['age_html'].wrapper).html("AGE : " + get_age(frm.doc.dob)); $(frm.fields_dict['age_html'].wrapper).html("AGE : " + get_age(frm.doc.dob));
@ -49,7 +49,7 @@ frappe.ui.form.on('Patient', {
}); });
frappe.ui.form.on("Patient", "dob", function(frm) { frappe.ui.form.on("Patient", "dob", function(frm) {
if(frm.doc.dob){ if(frm.doc.dob) {
var today = new Date(); var today = new Date();
var birthDate = new Date(frm.doc.dob); var birthDate = new Date(frm.doc.dob);
if(today < birthDate){ if(today < birthDate){
@ -61,6 +61,9 @@ frappe.ui.form.on("Patient", "dob", function(frm) {
$(frm.fields_dict['age_html'].wrapper).html("AGE : " + age_str); $(frm.fields_dict['age_html'].wrapper).html("AGE : " + age_str);
} }
} }
else {
$(frm.fields_dict['age_html'].wrapper).html("");
}
}); });
var create_medical_record = function (frm) { var create_medical_record = function (frm) {

View File

@ -1,8 +1,8 @@
frappe.views.calendar["Patient Appointment"] = { frappe.views.calendar["Patient Appointment"] = {
field_map: { field_map: {
"start": "appointment_date", "start": "start",
"end": "appointment_datetime", "end": "end",
"id": "name", "id": "name",
"title": "patient", "title": "patient",
"allDay": "allDay", "allDay": "allDay",