Skip to content

Commit

Permalink
fix(Patient Encounter): fetch department from lab test template for n…
Browse files Browse the repository at this point in the history
…ew service request
  • Loading branch information
AravindR97 authored and Sajinsr committed Oct 23, 2024
1 parent 69f4b9d commit b5ce004
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions healthcare/public/js/healthcare_note.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,23 @@ healthcare.Orders = class Orders {
"options": "order_template_type",
"depends_on": "eval:doc.order_template_type;",
"reqd": 1,
onchange: function(frm) {
let field_name = (d.get_value("order_template_type") == "Lab Test Template") ? "department" : "medical_department";
frappe.db.get_value(d.get_value("order_template_type"), d.get_value("order_template"), field_name)
.then(r => {
if (r.message) {
d.set_value("department", r.message[field_name]);
}
});
}
},
{
"fetch_from": "order_template.medical_department",
"fieldname": "department",
"fieldtype": "Link",
"label": "Department",
"options": "Medical Department",
"depends_on": "eval:doc.order_template_type=='Clinical Procedure Template';",
"depends_on": "eval: doc.order_template",
"read_only": 1,
},
{
"fieldname": "column_break_4",
Expand Down

0 comments on commit b5ce004

Please sign in to comment.