From 8541ddc0f8e2ec82b1440045aedd9ba3241ec381 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 9 May 2021 15:07:44 +0300 Subject: [PATCH] fix LabOrderResult --- lib/core/viewModel/labs_view_model.dart | 14 +++----------- .../lab_result/laboratory_result_widget.dart | 7 ++----- .../prescription/add_prescription_form.dart | 6 +++--- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index e5a2f9f1..90e9b327 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -135,17 +135,9 @@ class LabsViewModel extends BaseViewModel { .toList(); if (patientLabOrdersClinic.length != 0) { - var value = - labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] - .patientLabResultList - .where((e) => - e.sampleCollectedOn == element.sampleCollectedOn && - e.resultValue == element.resultValue) - .toList(); - if (value.isEmpty) - labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] - .patientLabResultList - .add(element); + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] + .patientLabResultList + .add(element); } else { labResultLists .add(LabResultList(filterName: element.testCode, lab: element)); diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index d9132b7a..810f025f 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -128,11 +128,8 @@ class _LaboratoryResultWidgetState extends State { model.labResultLists.length, (index) => LabResultWidget( patientLabOrder: widget.patientLabOrder, - filterName: model - .labResultLists[index].filterName, - patientLabResultList: model - .labResultLists[index] - .patientLabResultList, + filterName: model.labResultLists[index].filterName, + patientLabResultList: model.labResultLists[index].patientLabResultList, patient: widget.patient, isInpatient: widget.isInpatient, ), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index a951f480..a3c6e589 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -1430,17 +1430,17 @@ class _PrescriptionFormWidgetState extends State { // .join(' '), dose: strengthController.text, doseUnit: model.itemMedicineListUnit.length == 1 - ? model.itemMedicineListUnit[0]['parameterCode'] + ? model.itemMedicineListUnit[0]['parameterCode'].toString() : units['parameterCode'].toString(), patient: widget.patient, doseTimeIn: doseTime['id'].toString(), model: widget.model, duration: duration['id'].toString(), frequency: model.itemMedicineList.length == 1 - ? model.itemMedicineList[0]['parameterCode'] + ? model.itemMedicineList[0]['parameterCode'].toString() : frequency['parameterCode'].toString(), route: model.itemMedicineListRoute.length == 1 - ? model.itemMedicineListRoute[0]['parameterCode'] + ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), drugId: _selectedMedication.itemId.toString(), strength: strengthController.text,