From 763686fc76d65bb481a89b163e630887a53abd1b Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 9 Sep 2021 11:04:19 +0300 Subject: [PATCH] adding missing fields for medication --- .../get_medication_for_inpatient_model.dart | 23 ++++++++++++++- .../procedure/procedure_service.dart | 4 ++- .../prescription_item_in_patient_page.dart | 29 ++++++++++--------- .../prescription/prescriptions_page.dart | 2 +- 4 files changed, 41 insertions(+), 17 deletions(-) diff --git a/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart b/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart index 7c6d0db5..8ba07f2a 100644 --- a/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart +++ b/lib/core/model/Prescriptions/get_medication_for_inpatient_model.dart @@ -30,6 +30,11 @@ class GetMedicationForInPatientModel { dynamic strength; String pHRItemDescription; String pHRItemDescriptionN; + String doctorName; + String uomDescription; + String routeDescription; + String directionDescription; + String refillDescription; GetMedicationForInPatientModel( {this.setupID, @@ -62,11 +67,22 @@ class GetMedicationForInPatientModel { this.editedOn, this.strength, this.pHRItemDescription, - this.pHRItemDescriptionN}); + this.pHRItemDescriptionN, + this.doctorName, + this.uomDescription, + this.routeDescription, + this.directionDescription, + this.refillDescription}); GetMedicationForInPatientModel.fromJson(Map json) { setupID = json['SetupID']; projectID = json['ProjectID']; + doctorName = json['DoctorName']; + refillDescription = json['RefillDescription']; + directionDescription = json['DirectionDescription']; + routeDescription = json['RouteDescription']; + + uomDescription = json['UOMDescription']; admissionNo = json['AdmissionNo']; patientID = json['PatientID']; orderNo = json['OrderNo']; @@ -101,6 +117,11 @@ class GetMedicationForInPatientModel { Map toJson() { final Map data = new Map(); data['SetupID'] = this.setupID; + data['DoctorName'] = this.doctorName; + data['RefillDescription'] = this.refillDescription; + data['RouteDescription'] = this.routeDescription; + data['DirectionDescription'] = this.directionDescription; + data['UOMDescription'] = this.uomDescription; data['ProjectID'] = this.projectID; data['AdmissionNo'] = this.admissionNo; data['PatientID'] = this.patientID; diff --git a/lib/core/service/patient_medical_file/procedure/procedure_service.dart b/lib/core/service/patient_medical_file/procedure/procedure_service.dart index 16ed67fa..56a92de5 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -108,7 +108,9 @@ class ProcedureService extends BaseService { } Future getProcedure({int mrn, int appointmentNo}) async { - _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel(patientMRN: mrn, appointmentNo: appointmentNo); + _getOrderedProcedureRequestModel = GetOrderedProcedureRequestModel( + patientMRN: mrn, + ); hasError = false; _procedureList.clear(); await baseAppClient.post(GET_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/screens/prescription/prescription_item_in_patient_page.dart b/lib/screens/prescription/prescription_item_in_patient_page.dart index fce49f77..84f38748 100644 --- a/lib/screens/prescription/prescription_item_in_patient_page.dart +++ b/lib/screens/prescription/prescription_item_in_patient_page.dart @@ -91,7 +91,8 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).direction, color: Colors.grey, ), - Expanded(child: AppText(" " + prescriptions.directionID.toString() ?? '')), + Expanded( + child: AppText(" " + prescriptions.directionDescription.toString() ?? '')), ], ), Row( @@ -100,7 +101,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).route, color: Colors.grey, ), - AppText(" " + prescriptions.routeId.toString() ?? ''), + AppText(" " + prescriptions.routeDescription.toString() ?? ''), ], ), Row( @@ -109,7 +110,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).refill, color: Colors.grey, ), - Expanded(child: AppText(" " + prescriptions.refillID.toString() ?? '')), + Expanded(child: AppText(" " + prescriptions.refillDescription.toString() ?? '')), ], ), Row( @@ -150,7 +151,7 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { 'UOM', color: Colors.grey, ), - AppText(" " + prescriptions.unitofMeasurement.toString() ?? ''), + AppText(" " + prescriptions.uomDescription.toString() ?? ''), ], ), Row( @@ -177,18 +178,18 @@ class PrescriptionItemsInPatientPage extends StatelessWidget { TranslationBase.of(context).processed, color: Colors.grey, ), - // AppText(" " + prescriptions.editedBy.toString() ?? ''), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).dailyDoses, - color: Colors.grey, - ), - AppText(" " + prescriptions.dose.toString() ?? ''), + AppText(" " + prescriptions.doctorName.toString() ?? ''), ], ), + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).num, + // color: Colors.grey, + // ), + // AppText(" " + prescriptions.dose.toString() ?? ''), + // ], + // ), SizedBox( height: 12, ), diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index e7225e9a..0c3c5123 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -196,7 +196,7 @@ class PrescriptionsPage extends StatelessWidget { appointmentDate: AppDateUtils.getDateTimeFromServerFormat( model.medicationForInPatient[index].prescriptionDatetime, ), - createdBy: model.medicationForInPatient[index].createdBy.toString(), + createdBy: model.medicationForInPatient[index].doctorName.toString(), )); }), if (model.medicationForInPatient.length == 0)