Skip to content

Commit

Permalink
fix: Service Request - change encounter reference to dynamic link
Browse files Browse the repository at this point in the history
  • Loading branch information
akashkrishna619 committed Oct 6, 2023
1 parent fedc181 commit 85e0815
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ def on_submit(self):

self.make_service_request()
self.make_medication_request()
# to save service_request name in prescription
self.save("Update")
self.db_set("status", "Completed")

def before_cancel(self):
orders = frappe.get_all("Service Request", {"order_group": self.name})
Expand Down Expand Up @@ -179,7 +182,8 @@ def get_order_details(self, template_doc, line_item, medication_request=False):
"status": "Draft",
"patient": self.get("patient"),
"practitioner": self.practitioner,
"order_group": self.name,
"source_doc": "Patient Encounter",
"order_group":self.name,
"sequence": line_item.get("sequence"),
"patient_care_type": template_doc.get("patient_care_type"),
"intent": line_item.get("intent"),
Expand Down
15 changes: 11 additions & 4 deletions healthcare/healthcare/doctype/service_request/service_request.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"medical_department",
"referred_to_practitioner",
"column_break_10",
"source_doc",
"order_group",
"sequence",
"order_details",
Expand Down Expand Up @@ -111,9 +112,9 @@
},
{
"fieldname": "order_group",
"fieldtype": "Link",
"label": "Order Group (Encounter)",
"options": "Patient Encounter"
"fieldtype": "Dynamic Link",
"label": "Order Group",
"options": "source_doc"
},
{
"fieldname": "column_break_9",
Expand Down Expand Up @@ -511,6 +512,12 @@
"fieldtype": "Table",
"label": "Medical Codes",
"options": "Codification Table"
},
{
"fieldname": "source_doc",
"fieldtype": "Link",
"label": "Source Doc",
"options": "DocType"
}
],
"index_web_pages_for_search": 1,
Expand All @@ -529,7 +536,7 @@
"link_fieldname": "service_request"
}
],
"modified": "2023-04-04 15:41:42.422714",
"modified": "2023-08-02 16:51:58.714707",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Service Request",
Expand Down

0 comments on commit 85e0815

Please sign in to comment.