fix(ip): code cleanup and translations
This commit is contained in:
parent
d9d1f442df
commit
f3a2f1fe20
@ -40,7 +40,7 @@ frappe.ui.form.on('Inpatient Record', {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var discharge_patient = function(frm) {
|
let discharge_patient = function(frm) {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
doc: frm.doc,
|
doc: frm.doc,
|
||||||
method: 'discharge',
|
method: 'discharge',
|
||||||
@ -50,12 +50,12 @@ var discharge_patient = function(frm) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
freeze: true,
|
freeze: true,
|
||||||
freeze_message: 'Processing Inpatient Discharge'
|
freeze_message: __('Processing Inpatient Discharge')
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var admit_patient_dialog = function(frm){
|
let admit_patient_dialog = function(frm) {
|
||||||
var dialog = new frappe.ui.Dialog({
|
let dialog = new frappe.ui.Dialog({
|
||||||
title: 'Admit Patient',
|
title: 'Admit Patient',
|
||||||
width: 100,
|
width: 100,
|
||||||
fields: [
|
fields: [
|
||||||
@ -74,9 +74,9 @@ var admit_patient_dialog = function(frm){
|
|||||||
],
|
],
|
||||||
primary_action_label: __('Admit'),
|
primary_action_label: __('Admit'),
|
||||||
primary_action : function(){
|
primary_action : function(){
|
||||||
var service_unit = dialog.get_value('service_unit');
|
let service_unit = dialog.get_value('service_unit');
|
||||||
var check_in = dialog.get_value('check_in');
|
let check_in = dialog.get_value('check_in');
|
||||||
var expected_discharge = null;
|
let expected_discharge = null;
|
||||||
if (dialog.get_value('expected_discharge')) {
|
if (dialog.get_value('expected_discharge')) {
|
||||||
expected_discharge = dialog.get_value('expected_discharge');
|
expected_discharge = dialog.get_value('expected_discharge');
|
||||||
}
|
}
|
||||||
@ -97,7 +97,7 @@ var admit_patient_dialog = function(frm){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
freeze: true,
|
freeze: true,
|
||||||
freeze_message: 'Processing Patient Admission'
|
freeze_message: __('Processing Patient Admission')
|
||||||
});
|
});
|
||||||
frm.refresh_fields();
|
frm.refresh_fields();
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
@ -126,21 +126,21 @@ var admit_patient_dialog = function(frm){
|
|||||||
dialog.show();
|
dialog.show();
|
||||||
};
|
};
|
||||||
|
|
||||||
var transfer_patient_dialog = function(frm){
|
let transfer_patient_dialog = function(frm) {
|
||||||
var dialog = new frappe.ui.Dialog({
|
let dialog = new frappe.ui.Dialog({
|
||||||
title: 'Transfer Patient',
|
title: 'Transfer Patient',
|
||||||
width: 100,
|
width: 100,
|
||||||
fields: [
|
fields: [
|
||||||
{fieldtype: "Link", label: "Leave From", fieldname: "leave_from", options: "Healthcare Service Unit", reqd: 1, read_only:1},
|
{fieldtype: 'Link', label: 'Leave From', fieldname: 'leave_from', options: 'Healthcare Service Unit', reqd: 1, read_only:1},
|
||||||
{fieldtype: "Link", label: "Service Unit Type", fieldname: "service_unit_type", options: "Healthcare Service Unit Type"},
|
{fieldtype: 'Link', label: 'Service Unit Type', fieldname: 'service_unit_type', options: 'Healthcare Service Unit Type'},
|
||||||
{fieldtype: "Link", label: "Transfer To", fieldname: "service_unit", options: "Healthcare Service Unit", reqd: 1},
|
{fieldtype: 'Link', label: 'Transfer To', fieldname: 'service_unit', options: 'Healthcare Service Unit', reqd: 1},
|
||||||
{fieldtype: "Datetime", label: "Check In", fieldname: "check_in", reqd: 1}
|
{fieldtype: 'Datetime', label: 'Check In', fieldname: 'check_in', reqd: 1}
|
||||||
],
|
],
|
||||||
primary_action_label: __("Transfer"),
|
primary_action_label: __('Transfer'),
|
||||||
primary_action : function() {
|
primary_action : function() {
|
||||||
var service_unit = null;
|
let service_unit = null;
|
||||||
var check_in = dialog.get_value('check_in');
|
let check_in = dialog.get_value('check_in');
|
||||||
var leave_from = null;
|
let leave_from = null;
|
||||||
if(dialog.get_value('leave_from')){
|
if(dialog.get_value('leave_from')){
|
||||||
leave_from = dialog.get_value('leave_from');
|
leave_from = dialog.get_value('leave_from');
|
||||||
}
|
}
|
||||||
@ -164,40 +164,40 @@ var transfer_patient_dialog = function(frm){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
freeze: true,
|
freeze: true,
|
||||||
freeze_message: "Process Transfer"
|
freeze_message: __('Process Transfer')
|
||||||
});
|
});
|
||||||
frm.refresh_fields();
|
frm.refresh_fields();
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
dialog.fields_dict["leave_from"].get_query = function(){
|
dialog.fields_dict['leave_from'].get_query = function(){
|
||||||
return {
|
return {
|
||||||
query : "erpnext.healthcare.doctype.inpatient_record.inpatient_record.get_leave_from",
|
query : 'erpnext.healthcare.doctype.inpatient_record.inpatient_record.get_leave_from',
|
||||||
filters: {docname:frm.doc.name}
|
filters: {docname:frm.doc.name}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
dialog.fields_dict["service_unit_type"].get_query = function(){
|
dialog.fields_dict['service_unit_type'].get_query = function(){
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
"inpatient_occupancy": 1,
|
'inpatient_occupancy': 1,
|
||||||
"allow_appointments": 0
|
'allow_appointments': 0
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
dialog.fields_dict["service_unit"].get_query = function(){
|
dialog.fields_dict['service_unit'].get_query = function(){
|
||||||
return {
|
return {
|
||||||
filters: {
|
filters: {
|
||||||
"is_group": 0,
|
'is_group': 0,
|
||||||
"service_unit_type": dialog.get_value("service_unit_type"),
|
'service_unit_type': dialog.get_value('service_unit_type'),
|
||||||
"occupancy_status" : "Vacant"
|
'occupancy_status' : 'Vacant'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
dialog.show();
|
dialog.show();
|
||||||
|
|
||||||
var not_left_service_unit = null;
|
let not_left_service_unit = null;
|
||||||
for (let inpatient_occupancy in frm.doc.inpatient_occupancies) {
|
for (let inpatient_occupancy in frm.doc.inpatient_occupancies) {
|
||||||
if (frm.doc.inpatient_occupancies[inpatient_occupancy].left != 1) {
|
if (frm.doc.inpatient_occupancies[inpatient_occupancy].left != 1) {
|
||||||
not_left_service_unit = frm.doc.inpatient_occupancies[inpatient_occupancy].service_unit;
|
not_left_service_unit = frm.doc.inpatient_occupancies[inpatient_occupancy].service_unit;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user