mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-09 08:02:51 +00:00
feat: Allow selecting admission service unit in Patient Appointment for inpatients
This commit is contained in:
@@ -264,7 +264,7 @@ def get_filters(entry):
|
||||
|
||||
def get_current_healthcare_service_unit(inpatient_record):
|
||||
ip_record = frappe.get_doc('Inpatient Record', inpatient_record)
|
||||
if ip_record.inpatient_occupancies:
|
||||
if ip_record.status in ['Admitted', 'Discharge Scheduled'] and ip_record.inpatient_occupancies:
|
||||
return ip_record.inpatient_occupancies[-1].service_unit
|
||||
return
|
||||
|
||||
|
||||
@@ -31,14 +31,14 @@ frappe.ui.form.on('Patient Appointment', {
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query('service_unit', function(){
|
||||
frm.set_query('service_unit', function() {
|
||||
return {
|
||||
query: 'erpnext.controllers.queries.get_healthcare_service_units',
|
||||
filters: {
|
||||
'is_group': false,
|
||||
'allow_appointments': true,
|
||||
'company': frm.doc.company
|
||||
company: frm.doc.company,
|
||||
inpatient_record: frm.doc.inpatient_record
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
frm.set_query('therapy_plan', function() {
|
||||
|
||||
Reference in New Issue
Block a user