Skip to content

Commit

Permalink
fix: Get Applicable Treatment Plan for new Patient Encounter
Browse files Browse the repository at this point in the history
  • Loading branch information
akashkrishna619 committed Mar 29, 2023
1 parent bb6cc4c commit 421f136
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,8 @@ frappe.ui.form.on('Patient Encounter', {
doc: frm.doc,
args: selections,
}).then(() => {
frm.refresh_field('drug_prescription');
frm.refresh_field('procedure_prescription');
frm.refresh_field('lab_test_prescription');
frm.refresh_field('therapies');
frm.refresh_fields();
frm.dirty();
});
cur_dialog.hide();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ def set_treatment_plan(self, plan):
for drug in plan_doc.drugs:
self.append("drug_prescription", (frappe.copy_doc(drug)).as_dict())

self.save()

def set_treatment_plan_item(self, plan_item):
if plan_item.type == "Clinical Procedure Template":
self.append("procedure_prescription", {"procedure": plan_item.template})
Expand All @@ -107,7 +105,10 @@ def set_treatment_plan_item(self, plan_item):
self.append("lab_test_prescription", {"lab_test_code": plan_item.template})

if plan_item.type == "Therapy Type":
self.append("therapies", {"therapy_type": plan_item.template})
self.append(
"therapies",
{"therapy_type": plan_item.template, "no_of_sessions": plan_item.qty},
)


@frappe.whitelist()
Expand Down

0 comments on commit 421f136

Please sign in to comment.