From bbdc243f0ff0140ca448c628a64f065dca8d1501 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 23 Jan 2022 09:16:06 +0200 Subject: [PATCH 1/3] fix main issues --- .../profile/UCAF/UCAF-input-screen.dart | 4 +++- lib/screens/prescription/drugtodrug.dart | 20 ++++++++++--------- lib/widgets/shared/user-guid/CusomRow.dart | 1 + 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index ddad858f..88e14e7a 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -38,6 +38,8 @@ class _UCAFInputScreenState extends State { final _whereController = TextEditingController(); final _managementsLineController = TextEditingController(); final _signsController = TextEditingController(); + + ///TODO Elham* fix this List conditionsData = [ {"name": "CHRONIC", "isChecked": false}, {"name": "RTA", "isChecked": false}, @@ -383,7 +385,7 @@ class _UCAFInputScreenState extends State { error: model.patientVitalSignsHistory == null || model.patientVitalSignsHistory.length == 0 ? TranslationBase.of(context).vitalSignEmptyMsg - : TranslationBase.of(context))) + : TranslationBase.of(context).chiefComplaintEmptyMsg)) : Container(), ), ); diff --git a/lib/screens/prescription/drugtodrug.dart b/lib/screens/prescription/drugtodrug.dart index 5ecb07ce..d744dcda 100644 --- a/lib/screens/prescription/drugtodrug.dart +++ b/lib/screens/prescription/drugtodrug.dart @@ -28,6 +28,7 @@ class DrugToDrug extends StatefulWidget { class _DrugToDrug extends State { int typeID = 1; bool isLoaded = false; + /// TODO Elham* fix this List> expandableList = [ {'name': 'CRITICAL', 'level': 'LEVEL_4'}, {'name': 'HIGH', 'level': 'LEVEL_3'}, @@ -35,15 +36,7 @@ class _DrugToDrug extends State { {'name': 'LOW', 'level': 'LEVEL_1'}, {'name': 'INFO', 'level': 'INFO'}, ]; - GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: 2954208, - //widget.patient.patientMRN, - episodeId: 210011002, - //widget.patient.episodeNo, - appointmentNo: 2016055308, - //widget.patient.appointmentNo, - doctorID: '', - editedBy: ''); + VitalSignsViewModel model = new VitalSignsViewModel(); SOAPViewModel model2 = new SOAPViewModel(); @@ -115,6 +108,15 @@ class _DrugToDrug extends State { getRequestedData() async { + + GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( + /// TODO Elham* fix this today + patientMRN: widget.patient.patientMRN, + episodeId: widget.patient.episodeNo, + appointmentNo: + widget.patient.appointmentNo, + doctorID: '', + editedBy: ''); /// TODO Elham* rename model to meaning full not just modle with number await model.getPatientVitalSign(widget.patient); diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart index 21875e4d..f7181f14 100644 --- a/lib/widgets/shared/user-guid/CusomRow.dart +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -38,6 +38,7 @@ class CustomRow extends StatelessWidget { width: 1, ), Expanded( + flex: 0, child: AppText( value, fontSize: From 45f30a8d612114e712e87162c3884f5a6ab0e0ff Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 23 Jan 2022 09:49:40 +0200 Subject: [PATCH 2/3] small fixes --- .../viewModel/patient-referral-viewmodel.dart | 4 ++-- .../doctor_replay/doctor_reply_widget.dart | 5 +++-- .../profile/referral/refer-patient-screen.dart | 18 ++++++++++++++---- lib/widgets/shared/user-guid/CusomRow.dart | 4 +++- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 861c110b..42888002 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -230,12 +230,12 @@ class PatientReferralViewModel extends BaseViewModel { Future makeReferral(PatiantInformtion patient, String isoStringDate, int projectID, int clinicID, int doctorID, String remarks) async { - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _referralPatientService.makeReferral( patient, isoStringDate, projectID, clinicID, doctorID, remarks); if (_referralPatientService.hasError) { error = _referralPatientService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart index dce1d38c..e8d70786 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart @@ -207,10 +207,11 @@ class _DoctorReplyWidgetState extends State { label: TranslationBase.of(context).fileNumber, value: widget.reply.patientID.toString(), isCopyable: false, + isExpanded: false, ), CustomRow( - label: TranslationBase.of(context).age + " : ", - isCopyable: false, + label: TranslationBase.of(context).age + " : ", isCopyable: false, + isExpanded: false, value: "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", ), diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index a973d1c5..b8da5a14 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; @@ -209,19 +210,28 @@ class _PatientMakeReferralScreenState extends State { _selectedClinic == null || _selectedDoctor == null || _remarksController.text == null) return; - model + GifLoaderDialogUtils.showMyDialog(context); + await model .makeReferral( patient, appointmentDate.toIso8601String(), _selectedBranch['facilityId'], _selectedClinic['ClinicID'], _selectedDoctor['DoctorID'], - _remarksController.text) - .then((_) { + _remarksController.text); + if(model.state == ViewState.ErrorLocal) { + GifLoaderDialogUtils.hideDialog(context); + + Helpers.showErrorToast(model.error); + + } else { + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( TranslationBase.of(context).referralSuccessMsg); Navigator.pop(context); - }); + } + }, ), ) diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart index f7181f14..006e0fa4 100644 --- a/lib/widgets/shared/user-guid/CusomRow.dart +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -12,6 +12,7 @@ class CustomRow extends StatelessWidget { this.valueSize, this.width, this.isCopyable = true, + this.isExpanded = true, }) : super(key: key); final String label; @@ -20,6 +21,7 @@ class CustomRow extends StatelessWidget { final double valueSize; final double width; final bool isCopyable; + final bool isExpanded; @override Widget build(BuildContext context) { @@ -38,7 +40,7 @@ class CustomRow extends StatelessWidget { width: 1, ), Expanded( - flex: 0, + flex: isExpanded ? 1 : 0, child: AppText( value, fontSize: From 5ed3084130ec4b6efe62bd6b82c29fdbd50502f7 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Sun, 23 Jan 2022 09:55:46 +0200 Subject: [PATCH 3/3] fix clinic name --- lib/models/patient/patiant_info_model.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 9e4ebeb2..99127cc9 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -1,6 +1,7 @@ // TODO = it have to be changed. import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; class PatiantInformtion { PatiantInformtion patientDetails; @@ -199,8 +200,8 @@ class PatiantInformtion { bedId = json["BedID"] ?? json["bedID"]; nursingStationId = json["NursingStationID"] ?? json["nursingStationID"]; description = json["Description"] ?? json["description"]; - clinicDescription = - json["ClinicDescription"] ?? json["clinicDescription"]; + clinicDescription = Helpers.convertToTitleCase( + json["ClinicDescription"] ?? json["clinicDescription"]??''); clinicDescriptionN = json["ClinicDescriptionN"] ?? json["clinicDescriptionN"]; nationalityName = json["NationalityName"] ??