Patient medical record and Consulatation (#12198)

* Patient Medical Record - Subject field reqd=0, Subject text formated

* Consultation - remove patient details section

* Search fields are updated for Consultation and Appointment

* Translations applied on menu
diff --git a/erpnext/config/healthcare.py b/erpnext/config/healthcare.py
index f4bf4f7..37d95ad 100644
--- a/erpnext/config/healthcare.py
+++ b/erpnext/config/healthcare.py
@@ -11,7 +11,7 @@
 				{
 					"type": "doctype",
 					"name": "Patient Appointment",
-					"description": _("Patient Appointment"),
+					"label": _("Patient Appointment"),
 				},
 				{
 					"type": "doctype",
@@ -43,7 +43,7 @@
 				{
 					"type": "doctype",
 					"name": "Lab Test",
-					"description": _("Results"),
+					"label": _("Lab Test"),
 				},
 				{
 					"type": "doctype",
@@ -53,7 +53,8 @@
 				{
 					"type": "report",
 					"name": "Lab Test Report",
-					"is_query_report": True
+					"is_query_report": True,
+					"label": _("Lab Test Report"),
 				}
 			]
 		},
@@ -69,7 +70,7 @@
 				{
 					"type": "doctype",
 					"name": "Physician",
-					"label": "Physician",
+					"label": _("Physician"),
 				},
 				{
 					"type": "doctype",
@@ -100,57 +101,57 @@
 				{
 					"type": "doctype",
 					"name": "Medical Department",
-					"label": "Medical Department"
+					"label": _("Medical Department"),
 				},
 				{
 					"type": "doctype",
 					"name": "Appointment Type",
-					"description": _("Appointment Type Master"),
+					"label": _("Appointment Type"),
 				},
 				{
 					"type": "doctype",
 					"name": "Prescription Dosage",
-					"description": _("Prescription Dosage")
+					"label": _("Prescription Dosage")
 				},
 				{
 					"type": "doctype",
 					"name": "Prescription Duration",
-					"description": _("Prescription Period")
+					"label": _("Prescription Duration")
 				},
 				{
 					"type": "doctype",
 					"name": "Complaint",
-					"description": _("Complaint")
+					"label": _("Complaint")
 				},
 				{
 					"type": "doctype",
 					"name": "Diagnosis",
-					"description": _("Diagnosis")
+					"label": _("Diagnosis")
 				},
 				{
 					"type": "doctype",
 					"name": "Lab Test Sample",
-					"description": _("Test Sample Master."),
+					"label": _("Test Sample."),
 				},
 				{
 					"type": "doctype",
 					"name": "Lab Test UOM",
-					"description": _("Lab Test UOM.")
+					"label": _("Lab Test UOM.")
 				},
 				{
 					"type": "doctype",
 					"name": "Antibiotic",
-					"description": _("Antibiotic.")
+					"label": _("Antibiotic.")
 				},
 				{
 					"type": "doctype",
 					"name": "Sensitivity",
-					"description": _("Sensitivity Naming.")
+					"label": _("Sensitivity Naming.")
 				},
 				{
 					"type": "doctype",
 					"name": "Lab Test Template",
-					"description": _("Lab Test Configurations.")
+					"label": _("Lab Test Template.")
 				}
 			]
 		}
diff --git a/erpnext/healthcare/doctype/consultation/consultation.js b/erpnext/healthcare/doctype/consultation/consultation.js
index 8ed01c3..89b8861 100644
--- a/erpnext/healthcare/doctype/consultation/consultation.js
+++ b/erpnext/healthcare/doctype/consultation/consultation.js
@@ -28,7 +28,6 @@
 						age = calculate_age(data.message.dob);
 					}
 					frappe.model.set_value(frm.doctype,frm.docname, "patient_age", age);
-					show_details(data.message);
 				}
 			});
 		}
@@ -144,58 +143,6 @@
 	frappe.new_doc("Vital Signs");
 };
 
-var show_details = function(data){
-	var personal_details = "";
-	var age = null;
-	if(data.dob){
-		age = calculate_age(data.dob);
-		personal_details += "<br><b>Age :</b> " + age;
-	}
-	if(data.sex) personal_details += "<br><b>Gender :</b> " + data.sex;
-	if(data.blood_group) personal_details += "<br><b>Blood group : </b> " + data.blood_group;
-	if(data.occupation) personal_details += "<br><b>Occupation :</b> " + data.occupation;
-	if(data.email) personal_details += "<br><b>Email :</b> " + data.email;
-	if(data.mobile) personal_details += "<br><b>Mobile :</b> " + data.mobile;
-
-	if(personal_details){
-		personal_details = "<div style='padding-left:10px; font-size:13px;' align='left'></br><b class='text-muted'>Personal Details</b>" + personal_details + "</div>";
-	}
-
-	var details = "";
-	if(data.allergies) details +=  "<br><br><b>Allergies : </b> "+  data.allergies;
-	if(data.medication) details +=  "<br><b>Medication : </b> "+  data.medication;
-	if(data.alcohol_current_use) details +=  "<br><br><b>Alcohol use : </b> "+  data.alcohol_current_use;
-	if(data.alcohol_past_use) details +=  "<br><b>Alcohol past use : </b> "+  data.alcohol_past_use;
-	if(data.tobacco_current_use) details +=  "<br><b>Tobacco use : </b> "+  data.tobacco_current_use;
-	if(data.tobacco_past_use) details +=  "<br><b>Tobacco past use : </b> "+  data.tobacco_past_use;
-	if(data.medical_history) details +=  "<br><br><b>Medical history : </b> "+  data.medical_history;
-	if(data.surgical_history) details +=  "<br><b>Surgical history : </b> "+  data.surgical_history;
-	if(data.surrounding_factors) details +=  "<br><br><b>Occupational hazards : </b> "+  data.surrounding_factors;
-	if(data.other_risk_factors) details += "<br><b>Other risk factors : </b> " + data.other_risk_factors;
-	if(data.patient_details) details += "<br><br><b>More info : </b> " + data.patient_details;
-
-	if(details){
-		details = "<div style='padding-left:10px; font-size:13px;' align='left'></br><b class='text-muted'>Patient Details</b>" + details + "</div>";
-	}
-
-	var vitals = "";
-	if(data.temperature) vitals += "<br><b>Temperature :</b> " + data.temperature;
-	if(data.pulse) vitals += ", <b>Pulse :</b> " + data.pulse;
-	if(data.respiratory_rate) vitals += ", <b>Respiratory Rate :</b> " + data.respiratory_rate;
-	if(data.bp) vitals += ", <b>BP :</b> " + data.bp;
-	if(data.bmi) vitals += "<br><b>BMI :</b> " + data.bmi;
-	if(data.nutrition_note) vitals += " (" + data.nutrition_note + ")";
-	if(data.height) vitals += ", <b>Height :</b> " + data.height;
-	if(data.weight) vitals += ", <b>Weight :</b> " + data.weight;
-	if(data.signs_date) vitals += "<br><b>Date :</b> " + data.signs_date;
-
-	if(vitals){
-		vitals = "<div style='padding-left:10px; font-size:13px;' align='left'></br><b class='text-muted'>Vital Signs</b>" + vitals + "<br></div>";
-	}
-	details = personal_details + vitals + details;
-	cur_frm.fields_dict.patient_details_html.$wrapper.html(details);
-};
-
 frappe.ui.form.on("Consultation", "appointment", function(frm){
 	if(frm.doc.appointment){
 		frappe.call({
@@ -266,7 +213,6 @@
 				}
 				frappe.model.set_value(frm.doctype,frm.docname, "patient_age", age);
 				frappe.model.set_value(frm.doctype,frm.docname, "patient_sex", data.message.sex);
-				if(frm.doc.__islocal) show_details(data.message);
 			}
 		});
 	}
diff --git a/erpnext/healthcare/doctype/consultation/consultation.json b/erpnext/healthcare/doctype/consultation/consultation.json
index 1eff21d..184f484 100644
--- a/erpnext/healthcare/doctype/consultation/consultation.json
+++ b/erpnext/healthcare/doctype/consultation/consultation.json
@@ -450,65 +450,6 @@
    "bold": 0, 
    "collapsible": 1, 
    "columns": 0, 
-   "fieldname": "patient_details", 
-   "fieldtype": "Section Break", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "label": "Patient Details", 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 0, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 1, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 0, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "patient_details_html", 
-   "fieldtype": "HTML", 
-   "hidden": 0, 
-   "ignore_user_permissions": 0, 
-   "ignore_xss_filter": 0, 
-   "in_filter": 0, 
-   "in_global_search": 0, 
-   "in_list_view": 0, 
-   "in_standard_filter": 0, 
-   "length": 0, 
-   "no_copy": 0, 
-   "permlevel": 0, 
-   "precision": "", 
-   "print_hide": 1, 
-   "print_hide_if_no_value": 0, 
-   "read_only": 0, 
-   "remember_last_selected_value": 0, 
-   "report_hide": 1, 
-   "reqd": 0, 
-   "search_index": 0, 
-   "set_only_once": 0, 
-   "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 1, 
-   "columns": 0, 
    "fieldname": "sb_symptoms", 
    "fieldtype": "Section Break", 
    "hidden": 0, 
@@ -1004,7 +945,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-11-22 14:03:30.434304", 
+ "modified": "2017-12-28 11:25:35.256848", 
  "modified_by": "Administrator", 
  "module": "Healthcare", 
  "name": "Consultation", 
@@ -1036,7 +977,7 @@
  "read_only": 0, 
  "read_only_onload": 0, 
  "restrict_to_domain": "Healthcare", 
- "search_fields": "patient, physician, visit_department", 
+ "search_fields": "patient, physician, visit_department, consultation_date, consultation_time", 
  "show_name_in_global_search": 1, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
diff --git a/erpnext/healthcare/doctype/consultation/consultation.py b/erpnext/healthcare/doctype/consultation/consultation.py
index 69d7ecb..809074e 100755
--- a/erpnext/healthcare/doctype/consultation/consultation.py
+++ b/erpnext/healthcare/doctype/consultation/consultation.py
@@ -123,10 +123,10 @@
 def set_subject_field(consultation):
 	subject = "No Diagnosis "
 	if(consultation.diagnosis):
-		subject = "Diagnosis: \n"+ str(consultation.diagnosis)+". "
+		subject = "Diagnosis: "+ str(consultation.diagnosis)+". "
 	if(consultation.drug_prescription):
 		subject +="\nDrug(s) Prescribed. "
 	if(consultation.test_prescription):
-		subject += " Test(s) Prescribed."
+		subject += "\nTest(s) Prescribed."
 
 	return subject
diff --git a/erpnext/healthcare/doctype/lab_test/lab_test.py b/erpnext/healthcare/doctype/lab_test/lab_test.py
index 6fd9535..766491d 100644
--- a/erpnext/healthcare/doctype/lab_test/lab_test.py
+++ b/erpnext/healthcare/doctype/lab_test/lab_test.py
@@ -230,7 +230,7 @@
 def insert_lab_test_to_medical_record(doc):
 	subject = str(doc.test_name)
 	if(doc.test_comment):
-		subject += ", \n"+str(doc.test_comment)
+		subject += ", "+str(doc.test_comment)
 	medical_record = frappe.new_doc("Patient Medical Record")
 	medical_record.patient = doc.patient
 	medical_record.subject = subject
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
index 14c48b8..1dcdbb5 100644
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
@@ -698,7 +698,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-11-22 16:32:57.240736", 
+ "modified": "2017-12-28 11:26:20.262978", 
  "modified_by": "Administrator", 
  "module": "Healthcare", 
  "name": "Patient Appointment", 
@@ -750,7 +750,7 @@
  "read_only": 0, 
  "read_only_onload": 0, 
  "restrict_to_domain": "Healthcare", 
- "search_fields": "patient, physician, appointment_datetime,department", 
+ "search_fields": "patient, physician, department, appointment_date, appointment_time", 
  "show_name_in_global_search": 1, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
diff --git a/erpnext/healthcare/doctype/patient_medical_record/patient_medical_record.json b/erpnext/healthcare/doctype/patient_medical_record/patient_medical_record.json
index 6edc0cc..8aa4ede 100644
--- a/erpnext/healthcare/doctype/patient_medical_record/patient_medical_record.json
+++ b/erpnext/healthcare/doctype/patient_medical_record/patient_medical_record.json
@@ -186,7 +186,7 @@
    "read_only": 0, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
-   "reqd": 1, 
+   "reqd": 0, 
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
@@ -389,7 +389,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-11-15 12:48:59.945615", 
+ "modified": "2017-12-27 14:37:40.468854", 
  "modified_by": "Administrator", 
  "module": "Healthcare", 
  "name": "Patient Medical Record", 
diff --git a/erpnext/healthcare/doctype/vital_signs/vital_signs.py b/erpnext/healthcare/doctype/vital_signs/vital_signs.py
index 436f79f..a42ff02 100644
--- a/erpnext/healthcare/doctype/vital_signs/vital_signs.py
+++ b/erpnext/healthcare/doctype/vital_signs/vital_signs.py
@@ -31,18 +31,18 @@
 		frappe.delete_doc("Patient Medical Record", medical_record_id[0][0])
 
 def set_subject_field(doc):
-	subject = " "
+	subject = ""
 	if(doc.temperature):
-		subject += "Temperature: \n"+ str(doc.temperature)+". "
+		subject += "Temperature: "+ str(doc.temperature)+".\n"
 	if(doc.pulse):
-		subject += "Pulse: \n"+ str(doc.pulse)+". "
+		subject += "Pulse: "+ str(doc.pulse)+".\n"
 	if(doc.respiratory_rate):
-		subject += "Respiratory Rate: \n"+ str(doc.respiratory_rate)+". "
+		subject += "Respiratory Rate: "+ str(doc.respiratory_rate)+".\n"
 	if(doc.bp):
-		subject += "BP: \n"+ str(doc.bp)+". "
+		subject += "BP: "+ str(doc.bp)+".\n"
 	if(doc.bmi):
-		subject += "BMI: \n"+ str(doc.bmi)+". "
+		subject += "BMI: "+ str(doc.bmi)+".\n"
 	if(doc.nutrition_note):
-		subject += "Note: \n"+ str(doc.nutrition_note)+". "
+		subject += "Note: "+ str(doc.nutrition_note)+"."
 
 	return subject