fix: change Patient Medical Record subject fieldtype to Text Editor
This commit is contained in:
parent
b30c9a5735
commit
033886ae3e
@ -248,7 +248,7 @@ def make_procedure(source_name, target_doc=None):
|
|||||||
def insert_clinical_procedure_to_medical_record(doc):
|
def insert_clinical_procedure_to_medical_record(doc):
|
||||||
subject = cstr(doc.procedure_template)
|
subject = cstr(doc.procedure_template)
|
||||||
if doc.practitioner:
|
if doc.practitioner:
|
||||||
subject += ' ' + doc.practitioner
|
subject += frappe.bold(_('Healthcare Practitioner: ')) + doc.practitioner
|
||||||
if subject and doc.notes:
|
if subject and doc.notes:
|
||||||
subject += '<br/>' + doc.notes
|
subject += '<br/>' + doc.notes
|
||||||
|
|
||||||
|
@ -288,23 +288,23 @@ def insert_lab_test_to_medical_record(doc):
|
|||||||
table_row = False
|
table_row = False
|
||||||
subject = cstr(doc.lab_test_name)
|
subject = cstr(doc.lab_test_name)
|
||||||
if doc.practitioner:
|
if doc.practitioner:
|
||||||
subject += " "+ doc.practitioner
|
subject += frappe.bold(_("Healthcare Practitioner: "))+ doc.practitioner + "<br>"
|
||||||
if doc.normal_test_items:
|
if doc.normal_test_items:
|
||||||
item = doc.normal_test_items[0]
|
item = doc.normal_test_items[0]
|
||||||
comment = ""
|
comment = ""
|
||||||
if item.lab_test_comment:
|
if item.lab_test_comment:
|
||||||
comment = str(item.lab_test_comment)
|
comment = str(item.lab_test_comment)
|
||||||
table_row = item.lab_test_name
|
table_row = frappe.bold(_("Lab Test Conducted: ")) + item.lab_test_name
|
||||||
|
|
||||||
if item.lab_test_event:
|
if item.lab_test_event:
|
||||||
table_row += " " + item.lab_test_event
|
table_row += frappe.bold(_("Lab Test Event: ")) + item.lab_test_event
|
||||||
|
|
||||||
if item.result_value:
|
if item.result_value:
|
||||||
table_row += " " + item.result_value
|
table_row += " " + frappe.bold(_("Lab Test Result: ")) + item.result_value
|
||||||
|
|
||||||
if item.normal_range:
|
if item.normal_range:
|
||||||
table_row += " normal_range("+item.normal_range+")"
|
table_row += " " + _("Normal Range:") + item.normal_range
|
||||||
table_row += " "+comment
|
table_row += " " + comment
|
||||||
|
|
||||||
elif doc.special_test_items:
|
elif doc.special_test_items:
|
||||||
item = doc.special_test_items[0]
|
item = doc.special_test_items[0]
|
||||||
@ -316,12 +316,12 @@ def insert_lab_test_to_medical_record(doc):
|
|||||||
item = doc.sensitivity_test_items[0]
|
item = doc.sensitivity_test_items[0]
|
||||||
|
|
||||||
if item.antibiotic and item.antibiotic_sensitivity:
|
if item.antibiotic and item.antibiotic_sensitivity:
|
||||||
table_row = item.antibiotic +" "+ item.antibiotic_sensitivity
|
table_row = item.antibiotic + " " + item.antibiotic_sensitivity
|
||||||
|
|
||||||
if table_row:
|
if table_row:
|
||||||
subject += "<br/>"+table_row
|
subject += "<br>" + table_row
|
||||||
if doc.lab_test_comment:
|
if doc.lab_test_comment:
|
||||||
subject += "<br/>"+ cstr(doc.lab_test_comment)
|
subject += "<br>" + cstr(doc.lab_test_comment)
|
||||||
|
|
||||||
medical_record = frappe.new_doc("Patient Medical Record")
|
medical_record = frappe.new_doc("Patient Medical Record")
|
||||||
medical_record.patient = doc.patient
|
medical_record.patient = doc.patient
|
||||||
|
@ -18,6 +18,9 @@ class PatientEncounter(Document):
|
|||||||
def after_insert(self):
|
def after_insert(self):
|
||||||
insert_encounter_to_medical_record(self)
|
insert_encounter_to_medical_record(self)
|
||||||
|
|
||||||
|
def on_submit(self):
|
||||||
|
update_encounter_medical_record(self)
|
||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
if self.appointment:
|
if self.appointment:
|
||||||
frappe.db.set_value('Patient Appointment', self.appointment, 'status', 'Open')
|
frappe.db.set_value('Patient Appointment', self.appointment, 'status', 'Open')
|
||||||
@ -66,22 +69,26 @@ def delete_medical_record(encounter):
|
|||||||
frappe.db.delete_doc_if_exists('Patient Medical Record', 'reference_name', encounter.name)
|
frappe.db.delete_doc_if_exists('Patient Medical Record', 'reference_name', encounter.name)
|
||||||
|
|
||||||
def set_subject_field(encounter):
|
def set_subject_field(encounter):
|
||||||
subject = encounter.practitioner + '\n'
|
subject = frappe.bold(_('Healthcare Practitioner: ')) + encounter.practitioner + '<br>'
|
||||||
if encounter.symptoms:
|
if encounter.symptoms:
|
||||||
subject += _('Symptoms: ') + cstr(encounter.symptoms) + '\n'
|
subject += frappe.bold(_('Symptoms: ')) + '<br>'
|
||||||
|
for entry in encounter.symptoms:
|
||||||
|
subject += cstr(entry.complaint) + '<br>'
|
||||||
else:
|
else:
|
||||||
subject += _('No Symptoms') + '\n'
|
subject += frappe.bold(_('No Symptoms')) + '<br>'
|
||||||
|
|
||||||
if encounter.diagnosis:
|
if encounter.diagnosis:
|
||||||
subject += _('Diagnosis: ') + cstr(encounter.diagnosis) + '\n'
|
subject += frappe.bold(_('Diagnosis: ')) + '<br>'
|
||||||
|
for entry in encounter.diagnosis:
|
||||||
|
subject += cstr(entry.diagnosis) + '<br>'
|
||||||
else:
|
else:
|
||||||
subject += _('No Diagnosis') + '\n'
|
subject += frappe.bold(_('No Diagnosis')) + '<br>'
|
||||||
|
|
||||||
if encounter.drug_prescription:
|
if encounter.drug_prescription:
|
||||||
subject += '\n' + _('Drug(s) Prescribed.')
|
subject += '<br>' + _('Drug(s) Prescribed.')
|
||||||
if encounter.lab_test_prescription:
|
if encounter.lab_test_prescription:
|
||||||
subject += '\n' + _('Test(s) Prescribed.')
|
subject += '<br>' + _('Test(s) Prescribed.')
|
||||||
if encounter.procedure_prescription:
|
if encounter.procedure_prescription:
|
||||||
subject += '\n' + _('Procedure(s) Prescribed.')
|
subject += '<br>' + _('Procedure(s) Prescribed.')
|
||||||
|
|
||||||
return subject
|
return subject
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "subject",
|
"fieldname": "subject",
|
||||||
"fieldtype": "Small Text",
|
"fieldtype": "Text Editor",
|
||||||
"ignore_xss_filter": 1,
|
"ignore_xss_filter": 1,
|
||||||
"label": "Subject"
|
"label": "Subject"
|
||||||
},
|
},
|
||||||
@ -125,7 +125,7 @@
|
|||||||
],
|
],
|
||||||
"in_create": 1,
|
"in_create": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2020-03-23 19:26:59.308383",
|
"modified": "2020-04-29 12:26:57.679402",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Healthcare",
|
"module": "Healthcare",
|
||||||
"name": "Patient Medical Record",
|
"name": "Patient Medical Record",
|
||||||
|
@ -35,17 +35,17 @@ def delete_vital_signs_from_medical_record(doc):
|
|||||||
|
|
||||||
def set_subject_field(doc):
|
def set_subject_field(doc):
|
||||||
subject = ''
|
subject = ''
|
||||||
if(doc.temperature):
|
if doc.temperature:
|
||||||
subject += _('Temperature: ') + '\n'+ cstr(doc.temperature) + '. '
|
subject += frappe.bold(_('Temperature: ')) + cstr(doc.temperature) + '<br>'
|
||||||
if(doc.pulse):
|
if doc.pulse:
|
||||||
subject += _('Pulse: ') + '\n' + cstr(doc.pulse) + '. '
|
subject += frappe.bold(_('Pulse: ')) + cstr(doc.pulse) + '<br>'
|
||||||
if(doc.respiratory_rate):
|
if doc.respiratory_rate:
|
||||||
subject += _('Respiratory Rate: ') + '\n' + cstr(doc.respiratory_rate) + '. '
|
subject += frappe.bold(_('Respiratory Rate: ')) + cstr(doc.respiratory_rate) + '<br>'
|
||||||
if(doc.bp):
|
if doc.bp:
|
||||||
subject += _('BP: ') + '\n' + cstr(doc.bp) + '. '
|
subject += frappe.bold(_('BP: ')) + cstr(doc.bp) + '<br>'
|
||||||
if(doc.bmi):
|
if doc.bmi:
|
||||||
subject += _('BMI: ') + '\n' + cstr(doc.bmi) + '. '
|
subject += frappe.bold(_('BMI: ')) + cstr(doc.bmi) + '<br>'
|
||||||
if(doc.nutrition_note):
|
if doc.nutrition_note:
|
||||||
subject += _('Note: ') + '\n' + cstr(doc.nutrition_note) + '. '
|
subject += frappe.bold(_('Note: ')) + cstr(doc.nutrition_note) + '<br>'
|
||||||
|
|
||||||
return subject
|
return subject
|
||||||
|
Loading…
Reference in New Issue
Block a user