From a61bf44328be8ef08da43bbc9841a99d35d130fd Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Wed, 26 Feb 2020 17:11:19 +0530 Subject: [PATCH] feat: capture symptoms, diagnosis in Table Multiselect instead of Small Text --- .../drug_prescription/drug_prescription.json | 8 ++--- .../lab_prescription/lab_prescription.json | 5 +-- .../patient_encounter/patient_encounter.js | 24 ------------- .../patient_encounter/patient_encounter.json | 36 +++++-------------- .../patient_encounter_diagnosis/__init__.py | 0 .../patient_encounter_diagnosis.json | 33 +++++++++++++++++ .../patient_encounter_diagnosis.py | 10 ++++++ .../patient_encounter_symptom/__init__.py | 0 .../patient_encounter_symptom.json | 33 +++++++++++++++++ .../patient_encounter_symptom.py | 10 ++++++ 10 files changed, 102 insertions(+), 57 deletions(-) create mode 100644 erpnext/healthcare/doctype/patient_encounter_diagnosis/__init__.py create mode 100644 erpnext/healthcare/doctype/patient_encounter_diagnosis/patient_encounter_diagnosis.json create mode 100644 erpnext/healthcare/doctype/patient_encounter_diagnosis/patient_encounter_diagnosis.py create mode 100644 erpnext/healthcare/doctype/patient_encounter_symptom/__init__.py create mode 100644 erpnext/healthcare/doctype/patient_encounter_symptom/patient_encounter_symptom.json create mode 100644 erpnext/healthcare/doctype/patient_encounter_symptom/patient_encounter_symptom.py diff --git a/erpnext/healthcare/doctype/drug_prescription/drug_prescription.json b/erpnext/healthcare/doctype/drug_prescription/drug_prescription.json index 30ff7810ff..5e4d59cacf 100644 --- a/erpnext/healthcare/doctype/drug_prescription/drug_prescription.json +++ b/erpnext/healthcare/doctype/drug_prescription/drug_prescription.json @@ -27,15 +27,15 @@ "ignore_user_permissions": 1, "in_list_view": 1, "label": "Drug", - "options": "Item" + "options": "Item", + "reqd": 1 }, { "fetch_from": "drug_code.item_name", "fieldname": "drug_name", "fieldtype": "Data", "in_list_view": 1, - "label": "Drug Name / Description", - "reqd": 1 + "label": "Drug Name / Description" }, { "fieldname": "dosage", @@ -104,7 +104,7 @@ ], "istable": 1, "links": [], - "modified": "2020-02-26 15:33:29.365369", + "modified": "2020-02-26 17:02:42.741338", "modified_by": "Administrator", "module": "Healthcare", "name": "Drug Prescription", diff --git a/erpnext/healthcare/doctype/lab_prescription/lab_prescription.json b/erpnext/healthcare/doctype/lab_prescription/lab_prescription.json index 8528701102..0720bb4eec 100644 --- a/erpnext/healthcare/doctype/lab_prescription/lab_prescription.json +++ b/erpnext/healthcare/doctype/lab_prescription/lab_prescription.json @@ -22,7 +22,8 @@ "ignore_user_permissions": 1, "in_list_view": 1, "label": "Lab Test", - "options": "Lab Test Template" + "options": "Lab Test Template", + "reqd": 1 }, { "fetch_from": "lab_test_code.lab_test_name", @@ -65,7 +66,7 @@ ], "istable": 1, "links": [], - "modified": "2020-02-26 15:30:29.847503", + "modified": "2020-02-26 17:03:00.255560", "modified_by": "Administrator", "module": "Healthcare", "name": "Lab Prescription", diff --git a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.js b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.js index bec0a15ecf..c4f625947e 100644 --- a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.js +++ b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.js @@ -219,30 +219,6 @@ let create_procedure = function (frm) { frappe.new_doc('Clinical Procedure'); }; -frappe.ui.form.on('Patient Encounter', 'symptoms_select', function(frm) { - if (frm.doc.symptoms_select) { - let symptoms = null; - if (frm.doc.symptoms) - symptoms = frm.doc.symptoms + '\n' +frm.doc.symptoms_select; - else - symptoms = frm.doc.symptoms_select; - frappe.model.set_value(frm.doctype,frm.docname, 'symptoms', symptoms); - frappe.model.set_value(frm.doctype,frm.docname, 'symptoms_select', null); - } -}); - -frappe.ui.form.on('Patient Encounter', 'diagnosis_select', function(frm) { - if (frm.doc.diagnosis_select) { - let diagnosis = null; - if(frm.doc.diagnosis) - diagnosis = frm.doc.diagnosis + '\n' +frm.doc.diagnosis_select; - else - diagnosis = frm.doc.diagnosis_select; - frappe.model.set_value(frm.doctype,frm.docname, 'diagnosis', diagnosis); - frappe.model.set_value(frm.doctype,frm.docname, 'diagnosis_select', null); - } -}); - frappe.ui.form.on('Drug Prescription', { dosage: function(frm, cdt, cdn){ frappe.model.set_value(cdt, cdn, 'update_schedule', 1); diff --git a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.json b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.json index 8f914530e3..0f595b926e 100644 --- a/erpnext/healthcare/doctype/patient_encounter/patient_encounter.json +++ b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.json @@ -29,11 +29,9 @@ "column_break_17", "inpatient_status", "sb_symptoms", - "symptoms_select", "symptoms", "symptoms_in_print", "physical_examination", - "diagnosis_select", "diagnosis", "diagnosis_in_print", "codification", @@ -157,21 +155,13 @@ "fieldtype": "Section Break", "label": "Encounter Impression" }, - { - "fieldname": "symptoms_select", - "fieldtype": "Link", - "ignore_user_permissions": 1, - "label": "Complaints", - "no_copy": 1, - "options": "Complaint", - "print_hide": 1, - "report_hide": 1 - }, { "fieldname": "symptoms", - "fieldtype": "Small Text", + "fieldtype": "Table MultiSelect", "ignore_xss_filter": 1, - "no_copy": 1 + "label": "Symptoms", + "no_copy": 1, + "options": "Patient Encounter Symptom" }, { "default": "0", @@ -187,20 +177,12 @@ "fieldtype": "Column Break" }, { - "fieldname": "diagnosis_select", - "fieldtype": "Link", - "ignore_user_permissions": 1, + "fieldname": "diagnosis", + "fieldtype": "Table MultiSelect", + "ignore_xss_filter": 1, "label": "Diagnosis", "no_copy": 1, - "options": "Diagnosis", - "print_hide": 1, - "report_hide": 1 - }, - { - "fieldname": "diagnosis", - "fieldtype": "Small Text", - "ignore_xss_filter": 1, - "no_copy": 1 + "options": "Patient Encounter Diagnosis" }, { "default": "1", @@ -308,7 +290,7 @@ ], "is_submittable": 1, "links": [], - "modified": "2020-02-26 15:10:33.240817", + "modified": "2020-02-26 16:50:52.141816", "modified_by": "Administrator", "module": "Healthcare", "name": "Patient Encounter", diff --git a/erpnext/healthcare/doctype/patient_encounter_diagnosis/__init__.py b/erpnext/healthcare/doctype/patient_encounter_diagnosis/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/healthcare/doctype/patient_encounter_diagnosis/patient_encounter_diagnosis.json b/erpnext/healthcare/doctype/patient_encounter_diagnosis/patient_encounter_diagnosis.json new file mode 100644 index 0000000000..00ca309d63 --- /dev/null +++ b/erpnext/healthcare/doctype/patient_encounter_diagnosis/patient_encounter_diagnosis.json @@ -0,0 +1,33 @@ +{ + "actions": [], + "beta": 1, + "creation": "2020-02-26 16:48:16.835105", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "diagnosis" + ], + "fields": [ + { + "fieldname": "diagnosis", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Diagnosis", + "options": "Diagnosis", + "reqd": 1 + } + ], + "istable": 1, + "links": [], + "modified": "2020-02-26 16:58:16.480583", + "modified_by": "Administrator", + "module": "Healthcare", + "name": "Patient Encounter Diagnosis", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/erpnext/healthcare/doctype/patient_encounter_diagnosis/patient_encounter_diagnosis.py b/erpnext/healthcare/doctype/patient_encounter_diagnosis/patient_encounter_diagnosis.py new file mode 100644 index 0000000000..34b0cf8a58 --- /dev/null +++ b/erpnext/healthcare/doctype/patient_encounter_diagnosis/patient_encounter_diagnosis.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +# import frappe +from frappe.model.document import Document + +class PatientEncounterDiagnosis(Document): + pass diff --git a/erpnext/healthcare/doctype/patient_encounter_symptom/__init__.py b/erpnext/healthcare/doctype/patient_encounter_symptom/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/healthcare/doctype/patient_encounter_symptom/patient_encounter_symptom.json b/erpnext/healthcare/doctype/patient_encounter_symptom/patient_encounter_symptom.json new file mode 100644 index 0000000000..bc92145867 --- /dev/null +++ b/erpnext/healthcare/doctype/patient_encounter_symptom/patient_encounter_symptom.json @@ -0,0 +1,33 @@ +{ + "actions": [], + "beta": 1, + "creation": "2020-02-26 16:47:00.525657", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "complaint" + ], + "fields": [ + { + "fieldname": "complaint", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Complaint", + "options": "Complaint", + "reqd": 1 + } + ], + "istable": 1, + "links": [], + "modified": "2020-02-26 16:57:37.997481", + "modified_by": "Administrator", + "module": "Healthcare", + "name": "Patient Encounter Symptom", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/erpnext/healthcare/doctype/patient_encounter_symptom/patient_encounter_symptom.py b/erpnext/healthcare/doctype/patient_encounter_symptom/patient_encounter_symptom.py new file mode 100644 index 0000000000..bdb7bb218e --- /dev/null +++ b/erpnext/healthcare/doctype/patient_encounter_symptom/patient_encounter_symptom.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +# import frappe +from frappe.model.document import Document + +class PatientEncounterSymptom(Document): + pass