Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,7 @@ frappe.ui.form.on("Patient Appointment", {
frm.add_custom_button(
__("Patient Encounter"),
function () {
frappe.model.open_mapped_doc({
method: "healthcare.healthcare.doctype.patient_appointment.patient_appointment.make_encounter",
frm: frm,
});
create_patient_encounter(frm);
},
__("Create"),
);
Expand Down Expand Up @@ -1248,6 +1245,29 @@ let reschedule_dept_or_su = function (frm) {
d.show();
};

let create_patient_encounter = function (frm) {
if (!frm.doc.patient) {
frappe.throw(__("Please select patient"));
}

frappe.route_options = {
appointment: frm.doc.name,
patient: frm.doc.patient,
practitioner: frm.doc.practitioner,
medical_department: frm.doc.department,
patient_sex: frm.doc.patient_sex,
invoiced: frm.doc.invoiced,
company: frm.doc.company,
appointment_type: frm.doc.appointment_type,
insurance_policy: frm.doc.insurance_policy,
insurance_coverage: frm.doc.insurance_coverage,
inpatient_record: frm.doc.inpatient_record,
encounter_date: frm.doc.appointment_date,
encounter_time: frm.doc.appointment_time,
};
frappe.new_doc("Patient Encounter");
};

let create_vital_signs = function (frm) {
if (!frm.doc.patient) {
frappe.throw(__("Please select patient"));
Expand Down
Loading