fix(healthcare): populate current practitioner in appointment availability popup (#29405)

* fix: Remove two-way patient fetch from inpatient_record (Lab Test, Vital Signs, Sample Collection)

* fix: Patient Appointment - practitioner field gettng cleared on Check Availability dialog, added Practitioner name in the dialog

* fix: Patient Appointment - set practitioner in check availability dialog load

Co-authored-by: Chillar Anand <chillar@avilpage.com>
This commit is contained in:
Akash Krishna
2022-01-26 14:13:40 +05:30
committed by GitHub
parent 58fd7044b5
commit d2b61bbe8a
5 changed files with 14 additions and 11 deletions

View File

@@ -99,7 +99,6 @@
"search_index": 1
},
{
"fetch_from": "inpatient_record.patient",
"fieldname": "patient",
"fieldtype": "Link",
"ignore_user_permissions": 1,
@@ -559,7 +558,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2020-11-30 11:04:17.195848",
"modified": "2022-01-20 12:37:07.943153",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Lab Test",

View File

@@ -337,9 +337,13 @@ let check_and_set_availability = function(frm) {
});
d.fields_dict['department'].df.onchange = () => {
d.set_values({
'practitioner': ''
});
if (d.get_value('department') == frm.doc.department) {
d.set_value('practitioner', frm.doc.practitioner);
} else {
d.set_value('practitioner', '');
d.fields_dict.available_slots.html('');
d.get_primary_btn().attr('disabled', true);
}
let department = d.get_value('department');
if (department) {
d.fields_dict.practitioner.get_query = function() {
@@ -426,7 +430,8 @@ let check_and_set_availability = function(frm) {
slot_details.forEach((slot_info) => {
slot_html += `<div class="slot-info">
<span> <b> ${__('Practitioner Schedule:')} </b> ${slot_info.slot_name} </span><br>
<span> <b> ${slot_info.practitioner_name} </b> </span><br>
<span> <b> ${__('Schedule:')} </b> ${slot_info.slot_name} </span><br>
<span> <b> ${__('Service Unit:')} </b> ${slot_info.service_unit} </span>`;
if (slot_info.service_unit_capacity) {

View File

@@ -388,7 +388,8 @@ def get_available_slots(practitioner_doc, date):
fields=['name', 'appointment_time', 'duration', 'status'])
slot_details.append({'slot_name': slot_name, 'service_unit': schedule_entry.service_unit, 'avail_slot': available_slots,
'appointments': appointments, 'allow_overlap': allow_overlap, 'service_unit_capacity': service_unit_capacity})
'appointments': appointments, 'allow_overlap': allow_overlap, 'service_unit_capacity': service_unit_capacity,
'practitioner_name': practitioner_doc.practitioner_name})
return slot_details

View File

@@ -66,7 +66,6 @@
"search_index": 1
},
{
"fetch_from": "inpatient_record.patient",
"fieldname": "patient",
"fieldtype": "Link",
"hide_days": 1,
@@ -224,7 +223,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2020-07-30 16:53:13.076104",
"modified": "2022-01-20 12:38:55.382621",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Sample Collection",

View File

@@ -51,7 +51,6 @@
"read_only": 1
},
{
"fetch_from": "inpatient_record.patient",
"fieldname": "patient",
"fieldtype": "Link",
"ignore_user_permissions": 1,
@@ -259,7 +258,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2020-05-17 22:23:24.632286",
"modified": "2022-01-20 12:30:07.515185",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Vital Signs",