You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a Clinical Procedure from Service Request, Clinical Procedure Template does not load.
Steps taken...
Create Patient
Create Patient Appointment
From Patient Appointment, create Patient Encounter
Select : Medical codes, Medication, Clinical Procedure, Therapy Type
Submit Patient Encounter
View Service Requests : they were created.
Select Service request for CLinical Procedure.
Goto > Create > Clinical Procedure
Goto created Clinical Procedure and view
Observation : Patient detail is fetched
Observation : procedure_template field contains data but details from template is not loaded into Clinical Procedure
When re-selecting procedure_template, then the template detail is loaded into the Clinical Procedure.
Desired outcome ; When Clinical Procedure is created from within Service Request, the all detail must be fetched from Clinical Procedure Template.
Fix suggestion:
Here is a snip of the code from "Service Request". first a snip of the JS where "make_clinical_procedure" is called, followed by "make_clinical_procedure" in the PY file.
It seems the template field is populated and yet the data is not fetched from the template. I suspect that this is due to the way the JS triggers work. When the template field is selected by hand, then the trigger fires correctly. When the field is populated by backend-server code, like in this case, it does not fire.
I fixed it by installing this little client script:
Information about bug
When creating a Clinical Procedure from Service Request, Clinical Procedure Template does not load.
Steps taken...
Desired outcome ; When Clinical Procedure is created from within Service Request, the all detail must be fetched from Clinical Procedure Template.
Fix suggestion:
Here is a snip of the code from "Service Request". first a snip of the JS where "make_clinical_procedure" is called, followed by "make_clinical_procedure" in the PY file.
It seems the template field is populated and yet the data is not fetched from the template. I suspect that this is due to the way the JS triggers work. When the template field is selected by hand, then the trigger fires correctly. When the field is populated by backend-server code, like in this case, it does not fire.
I fixed it by installing this little client script:
frappe.ui.form.on('Clinical Procedure', {
onload(frm) {
frappe.show_alert("Onload triggered");
if (frm.doc.procedure_template) {
frappe.show_alert("Triggering procedure_template fetch");
setTimeout(() => {
frm.trigger('procedure_template');
}, 500);
}
}
});
Code snip from Clinical Procedure JS and PY....
=========================================================================================
setup_create_buttons: function(frm) {
if (frm.doc.docstatus !== 1 || frm.doc.status === 'Completed') return;
==================================================================
Module
Outpatient Module
Version
ERPNext: v15.40.0 (version-15)
Frappe Framework: v15.46.0 (version-15)
Marley Health: v16.0.0-dev (develop)
Payments: v0.0.1 (develop)
Installation method
None
Relevant log output / Stack trace / Full Error Message.
Code of Conduct
The text was updated successfully, but these errors were encountered: