Skip to content

Commit 1a6c9d1

Browse files
authored
Merge pull request #889 from aakvatech/version-14-hotfix
fix: 'IndexError: List index out of range' when setting admission service
2 parents d7eb864 + 7cf2d9e commit 1a6c9d1

3 files changed

Lines changed: 15 additions & 11 deletions

File tree

hms_tz/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
33

4-
__version__ = "14.13.2"
4+
__version__ = "14.13.3"

hms_tz/nhif/api/inpatient_record.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ def validate(doc, method):
3434

3535

3636
def before_save(doc, method):
37-
last_row = doc.inpatient_occupancies[len(doc.inpatient_occupancies) - 1]
37+
if len(doc.inpatient_occupancies) == 0:
38+
return
39+
40+
last_row = doc.inpatient_occupancies[len(doc.inpatient_occupancies)]
3841
if last_row.service_unit:
3942
service_unit_type = frappe.get_cached_value(
4043
"Healthcare Service Unit", last_row.service_unit, "service_unit_type"

hms_tz/nhif/api/patient_encounter.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,16 @@ frappe.ui.form.on('Patient Encounter', {
7575

7676
// Mosaic: https://worklog.aakvatech.com/Mosaic/Task/96b2f5e26c
7777
//filter dosage based on dosage form and has restricted qty ticked
78-
frm.set_query("dosage", "drug_prescription", function (doc, cdt, cdn) {
79-
const child = locals[cdt][cdn];
80-
return {
81-
query: "hms_tz.nhif.api.patient_encounter.get_filtered_dosage",
82-
filters: {
83-
dosage_form: child.dosage_form
84-
}
85-
}
86-
});
78+
// comment this for now until further testing 13-02-2024
79+
// frm.set_query("dosage", "drug_prescription", function (doc, cdt, cdn) {
80+
// const child = locals[cdt][cdn];
81+
// return {
82+
// query: "hms_tz.nhif.api.patient_encounter.get_filtered_dosage",
83+
// filters: {
84+
// dosage_form: child.dosage_form
85+
// }
86+
// }
87+
// });
8788

8889
frm.set_query('therapy_type', 'therapies', function () {
8990
return {

0 commit comments

Comments
 (0)