From bbcd218a948e2760953e1cdbe954e02613a05ee4 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 3 Jan 2021 15:39:38 +0200 Subject: [PATCH 01/21] history delete is fixed --- lib/models/SOAP/my_selected_history.dart | 30 ++++++ .../subjective/update_history_widget.dart | 93 ++++++++++++++----- .../subjective/update_subjective_page.dart | 48 +++++++--- .../soap_update/update_soap_index.dart | 3 +- 4 files changed, 134 insertions(+), 40 deletions(-) create mode 100644 lib/models/SOAP/my_selected_history.dart diff --git a/lib/models/SOAP/my_selected_history.dart b/lib/models/SOAP/my_selected_history.dart new file mode 100644 index 00000000..11e366c2 --- /dev/null +++ b/lib/models/SOAP/my_selected_history.dart @@ -0,0 +1,30 @@ +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + +class MySelectedHistory { + MasterKeyModel selectedHistory; + String remark; + bool isChecked; + + MySelectedHistory( + { this.selectedHistory, this.remark, this.isChecked}); + + MySelectedHistory.fromJson(Map json) { + + selectedHistory = json['selectedHistory'] != null + ? new MasterKeyModel.fromJson(json['selectedHistory']) + : null; + remark = json['remark']; + remark = json['isChecked']; + } + + Map toJson() { + final Map data = new Map(); + + if (this.selectedHistory != null) { + data['selectedHistory'] = this.selectedHistory.toJson(); + } + data['remark'] = this.remark; + data['isChecked'] = this.remark; + return data; + } +} diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart index ebed11ca..9a7cba01 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart @@ -1,18 +1,15 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -20,7 +17,7 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class UpdateHistoryWidget extends StatefulWidget { - final List myHistoryList; + final List myHistoryList; const UpdateHistoryWidget({Key key, this.myHistoryList}) : super(key: key); @@ -86,19 +83,28 @@ class _UpdateHistoryWidgetState extends State children: [ Container( child: Expanded( - child: Texts(projectViewModel.isArabic?myHistory.nameAr:myHistory.nameEn, - variant: "bodyText", bold: true, color: Colors.black), + child: Texts( + projectViewModel.isArabic + ? myHistory.selectedHistory.nameAr + : myHistory.selectedHistory.nameEn, + variant: "bodyText", + textDecoration: myHistory.isChecked + ? null + : TextDecoration.lineThrough, + bold: true, + color: Colors.black), ), width: MediaQuery.of(context).size.width * 0.7, ), - InkWell( - child: Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ), - onTap: () => removeHistory(myHistory), - ) + if (myHistory.isChecked) + InkWell( + child: Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ), + onTap: () => removeHistory(myHistory.selectedHistory), + ) ], ), SizedBox( @@ -113,13 +119,24 @@ class _UpdateHistoryWidgetState extends State ); } - removeHistory(MasterKeyModel masterKey) { - Iterable history = widget.myHistoryList.where((element) => - masterKey.id == element.id && masterKey.typeId == element.typeId); + removeHistory(MasterKeyModel historyKey) { + // Iterable history = widget.myHistoryList.where((element) => + // masterKey.id == element.id && masterKey.typeId == element.typeId); + // + + List history = + // ignore: missing_return + widget.myHistoryList.where((element) => + historyKey.id == + element.selectedHistory.id && + historyKey.typeId == + element.selectedHistory.typeId + ).toList(); + if (history.length > 0) setState(() { - widget.myHistoryList.remove(history.first); + history[0].isChecked = false; }); } @@ -233,7 +250,7 @@ class _PriorityBarState extends State { class AddHistoryDialog extends StatefulWidget { final Function changePageViewIndex; final PageController controller; - final List myHistoryList; + final List myHistoryList; final Function addSelectedHistories; final Function (MasterKeyModel) removeHistory; @@ -306,7 +323,8 @@ class _AddHistoryDialogState extends State { }, addHistory: (history){ setState(() { - widget.myHistoryList.add(history); + createAndAddHistory( + history); }); }, addSelectedHistories: (){ @@ -324,7 +342,8 @@ class _AddHistoryDialogState extends State { }, addHistory: (history){ setState(() { - widget.myHistoryList.add(history); + createAndAddHistory( + history); }); }, addSelectedHistories: (){ @@ -342,7 +361,8 @@ class _AddHistoryDialogState extends State { }, addHistory: (history){ setState(() { - widget.myHistoryList.add(history); + createAndAddHistory( + history); }); }, addSelectedHistories: (){ @@ -361,12 +381,35 @@ class _AddHistoryDialogState extends State { )); } + createAndAddHistory(MasterKeyModel history) { + List myhistory = widget.myHistoryList.where((element) => + history.id == + element.selectedHistory.id && + history.typeId == + element.selectedHistory.typeId + ).toList(); + + if (myhistory.isEmpty) { + setState(() { + MySelectedHistory mySelectedHistory = MySelectedHistory( + remark: history.remarks ?? "", + selectedHistory: history, + isChecked: true); + widget.myHistoryList.add(mySelectedHistory); + }); + } else { + myhistory.first.isChecked = true; + } + } + isServiceSelected(MasterKeyModel masterKey) { - Iterable history = + Iterable history = widget .myHistoryList .where((element) => - masterKey.id == element.id && masterKey.typeId == element.typeId); + masterKey.id == element.selectedHistory.id && + masterKey.typeId == element.selectedHistory.typeId && + element.isChecked); if (history.length > 0) { return true; } diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index ddab4734..89e617d6 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; @@ -28,7 +29,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class UpdateSubjectivePage extends StatefulWidget { final Function changePageViewIndex; final List myAllergiesList; - final List myHistoryList; + final List myHistoryList; final PatiantInformtion patientInfo; UpdateSubjectivePage( @@ -90,7 +91,12 @@ class _UpdateSubjectivePageState extends State { id: element.historyId, ); if (history != null) { - widget.myHistoryList.add(history); + MySelectedHistory mySelectedHistory = MySelectedHistory( + selectedHistory: history, + isChecked: element.isChecked, + remark: element.remarks); + + widget.myHistoryList.add(mySelectedHistory); } } if (element.historyType == @@ -100,7 +106,12 @@ class _UpdateSubjectivePageState extends State { id: element.historyId, ); if (history != null) { - widget.myHistoryList.add(history); + MySelectedHistory mySelectedHistory = MySelectedHistory( + selectedHistory: history, + isChecked: element.isChecked, + remark: element.remarks); + + widget.myHistoryList.add(mySelectedHistory); } } if (element.historyType == @@ -110,7 +121,12 @@ class _UpdateSubjectivePageState extends State { id: element.historyId, ); if (history != null) { - widget.myHistoryList.add(history); + MySelectedHistory mySelectedHistory = MySelectedHistory( + selectedHistory: history, + isChecked: element.isChecked, + remark: element.remarks); + + widget.myHistoryList.add(mySelectedHistory); } } if (element.historyType == @@ -120,7 +136,12 @@ class _UpdateSubjectivePageState extends State { id: element.historyId, ); if (history != null) { - widget.myHistoryList.add(history); + MySelectedHistory mySelectedHistory = MySelectedHistory( + selectedHistory: history, + isChecked: element.isChecked, + remark: element.remarks); + + widget.myHistoryList.add(mySelectedHistory); } } }); @@ -408,10 +429,9 @@ class _UpdateSubjectivePageState extends State { ); } - addSubjectiveInfo( - {SOAPViewModel model, - List myAllergiesList, - List myHistoryList}) async { + addSubjectiveInfo({SOAPViewModel model, + List myAllergiesList, + List myHistoryList}) async { formKey.currentState.save(); formKey.currentState.validate(); @@ -488,9 +508,9 @@ class _UpdateSubjectivePageState extends State { } postHistories( - {List myHistoryList, SOAPViewModel model}) async { + {List myHistoryList, SOAPViewModel model}) async { PostHistoriesRequestModel postHistoriesRequestModel = - new PostHistoriesRequestModel(); + new PostHistoriesRequestModel(); widget.myHistoryList.forEach((history) { if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; @@ -500,9 +520,9 @@ class _UpdateSubjectivePageState extends State { episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, remarks: "", - historyId: history.id, - historyType: history.typeId, - isChecked: false, + historyId: history.selectedHistory.id, + historyType: history.selectedHistory.typeId, + isChecked: history.isChecked, )); }); diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index fee067f4..0edaaaf9 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; 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/translations_delegate_base.dart'; @@ -30,7 +31,7 @@ class _UpdateSoapIndexState extends State PageController _controller; int _currentIndex = 0; List myAllergiesList= List(); - List myHistoryList = List(); + List myHistoryList = List(); List mySelectedExamination = List(); MySelectedAssessment mySelectedAssessment = new MySelectedAssessment(); changePageViewIndex(pageIndex) { From c3bb40878768fac729f463a934119b6709ec1f1d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 4 Jan 2021 14:03:36 +0200 Subject: [PATCH 02/21] add some translations --- ios/Podfile.lock | 2 +- lib/config/localized_values.dart | 2 + lib/config/test.dart | 0 lib/util/translations_delegate_base.dart | 2 + .../subjective/update_allergies_widget.dart | 66 ++++++++++++------- .../soap_update/update_assessment_page.dart | 4 +- 6 files changed, 48 insertions(+), 28 deletions(-) delete mode 100644 lib/config/test.dart diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 62e86469..108205bf 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -190,4 +190,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.0 +COCOAPODS: 1.10.0.rc.1 diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ef5aaaa5..7dda2cdb 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -509,4 +509,6 @@ const Map> localizedValues = { 'vitalSignEmptyMsg': {'en': "There is no vital signs for this patient", 'ar':"لا توجد علامات حيوية لهذا المريض" }, 'referralEmptyMsg': {'en': "There is no referral data", 'ar':"لا توجد بيانات إحالة" }, 'referralSuccessMsg': {'en': "You make referral successfully", 'ar':"You make referral successfully" }, + 'addAssessment': {'en': "Add ASSESSMENT", 'ar':"أضف التقييم" }, + 'assessment': {'en': "ASSESSMENT", 'ar':" التقييم" }, }; diff --git a/lib/config/test.dart b/lib/config/test.dart deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 5dee728a..e850c469 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -535,6 +535,8 @@ class TranslationBase { String get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg'][locale.languageCode]; String get referralEmptyMsg => localizedValues['referralEmptyMsg'][locale.languageCode]; String get referralSuccessMsg => localizedValues['referralSuccessMsg'][locale.languageCode]; + String get addAssessment => localizedValues['addAssessment'][locale.languageCode]; + String get assessment => localizedValues['assessment'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index 1d143310..a9839a2c 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -71,41 +72,42 @@ class _UpdateAllergiesWidgetState extends State { return Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - - child: Expanded( - child: Texts( + Container( + child: Expanded( + child: Texts( + projectViewModel.isArabic + ? selectedAllergy.selectedAllergy.nameAr + : selectedAllergy.selectedAllergy.nameEn + .toUpperCase(), + variant: "bodyText", + textDecoration: selectedAllergy.isChecked + ? null + : TextDecoration.lineThrough, + bold: true, + color: Colors.black), + ), + width: MediaQuery.of(context).size.width * 0.5, + ), + Texts( projectViewModel.isArabic - ? selectedAllergy.selectedAllergy.nameAr - : selectedAllergy.selectedAllergy.nameEn + ? selectedAllergy.selectedAllergySeverity.nameAr + : selectedAllergy.selectedAllergySeverity.nameEn .toUpperCase(), variant: "bodyText", textDecoration: selectedAllergy.isChecked ? null : TextDecoration.lineThrough, bold: true, - color: Colors.black), - ), - width: MediaQuery.of(context).size.width * 0.5, - ), - Texts( - projectViewModel.isArabic ? selectedAllergy - .selectedAllergySeverity.nameAr : selectedAllergy - .selectedAllergySeverity.nameEn - .toUpperCase(), - variant: "bodyText", - textDecoration: selectedAllergy.isChecked - ? null - : TextDecoration.lineThrough, - bold: true, - color: AppGlobal.appPrimaryColor), - if(selectedAllergy.isChecked) + color: AppGlobal.appPrimaryColor), + if (selectedAllergy.isChecked) InkWell( child: Icon( FontAwesomeIcons.trash, @@ -115,6 +117,20 @@ class _UpdateAllergiesWidgetState extends State { onTap: () => removeAllergy(selectedAllergy), ) ], + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Container( + width: MediaQuery.of(context).size.width * 0.6, + child: AppText( + selectedAllergy.remark ?? '', + fontSize: 10, + color: Colors.grey, + ), + ), + ), + DividerWithSpacesAround() + ], ), SizedBox( height: 10, @@ -383,7 +399,7 @@ class _AddAllergiesState extends State { height: 10, ), AppButton( - title: "Add".toUpperCase(), + title: TranslationBase.of(context).add.toUpperCase(), onPressed: () { MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( remark: remarkController.text, diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 3eec290c..79d8878c 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -101,7 +101,7 @@ class _UpdateAssessmentPageState extends State { children: [ Row( children: [ - Texts('ASSESSMENT', + Texts(TranslationBase.of(context).assessment.toUpperCase(), variant: isAssessmentExpand ? "bodyText" : '', bold: isAssessmentExpand ? true : false, @@ -135,7 +135,7 @@ class _UpdateAssessmentPageState extends State { margin: EdgeInsets.only(left: 5, right: 5, top: 15), child: TextFields( - hintText: "Add ASSESSMENT", + hintText: TranslationBase.of(context).addAssessment, fontSize: 13.5, onTapTextFields: () { openAssessmentDialog(context); From 1be8ea7dcbee602061b680626f7003b514760e70 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 4 Jan 2021 14:07:55 +0200 Subject: [PATCH 03/21] Fix conflict --- lib/util/translations_delegate_base.dart | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 1e9cfe71..1df9f8e9 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -548,9 +548,6 @@ class TranslationBase { String get covered => localizedValues['covered'][locale.languageCode]; String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode]; String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode]; - String get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg'][locale.languageCode]; - String get referralEmptyMsg => localizedValues['referralEmptyMsg'][locale.languageCode]; - String get referralSuccessMsg => localizedValues['referralSuccessMsg'][locale.languageCode]; String get addAssessment => localizedValues['addAssessment'][locale.languageCode]; String get assessment => localizedValues['assessment'][locale.languageCode]; } From 9aa5ab4228feabc8b85063377b7c679741b529b1 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 5 Jan 2021 09:23:15 +0200 Subject: [PATCH 04/21] small changes --- lib/client/base_app_client.dart | 3 +++ .../post_chief_complaint_request_model.dart | 21 ++++++++++++------- ...et_patient_arrival_list_request_model.dart | 3 ++- .../subjective/update_subjective_page.dart | 5 +++-- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 83923ea7..e2dbfd02 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -49,6 +49,9 @@ class BaseAppClient { if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; } + if (body['DoctorID'] == '') { + body['DoctorID'] =null; + } body['TokenID'] = token ?? ''; String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart index bedf2978..ed58e58a 100644 --- a/lib/models/SOAP/post_chief_complaint_request_model.dart +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -8,17 +8,19 @@ class PostChiefComplaintRequestModel { bool ispregnant; bool isLactation; int numberOfWeeks; + dynamic doctorID; PostChiefComplaintRequestModel( {this.appointmentNo, - this.episodeID, - this.patientMRN, - this.chiefComplaint, - this.hopi, - this.currentMedication, - this.ispregnant, - this.isLactation, - this.numberOfWeeks}); + this.episodeID, + this.patientMRN, + this.chiefComplaint, + this.hopi, + this.currentMedication, + this.ispregnant, + this.isLactation, + this.doctorID, + this.numberOfWeeks}); PostChiefComplaintRequestModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; @@ -30,6 +32,7 @@ class PostChiefComplaintRequestModel { ispregnant = json['ispregnant']; isLactation = json['isLactation']; numberOfWeeks = json['numberOfWeeks']; + doctorID = json['DoctorID']; } Map toJson() { @@ -43,6 +46,8 @@ class PostChiefComplaintRequestModel { data['ispregnant'] = this.ispregnant; data['isLactation'] = this.isLactation; data['numberOfWeeks'] = this.numberOfWeeks; + data['DoctorID'] = this.doctorID; + return data; } } diff --git a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart index 393790dd..66890a8f 100644 --- a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart +++ b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart @@ -28,13 +28,14 @@ class GetPatientArrivalListRequestModel { Map toJson() { final Map data = new Map(); - data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['From'] = this.from; data['To'] = this.to; data['DoctorID'] = this.doctorID; data['PageIndex'] = this.pageIndex; data['PageSize'] = this.pageSize; data['ClinicID'] = this.clinicID; + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + return data; } } diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 89e617d6..e0d92788 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -552,8 +552,9 @@ class _UpdateSubjectivePageState extends State { currentMedication: " currentMedication ", hopi: illnessController.text, isLactation: false, - ispregnant: true, - numberOfWeeks: 22); + ispregnant: false, + doctorID: '', + numberOfWeeks: 0); if (model.patientChiefComplaintList.isEmpty) { // TODO: make it postChiefComplaint after it start to work await model.postChiefComplaint(postChiefComplaintRequestModel); From 50d7f733b638cf7c351a89e14f08f32c11963882 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 5 Jan 2021 16:25:05 +0200 Subject: [PATCH 05/21] working on UCAF datails and add patient procedure list and diagnosis --- lib/config/config.dart | 1 + lib/core/service/patient-ucaf-service.dart | 48 +++++++- .../viewModel/patient-ucaf-viewmodel.dart | 94 ++++++++++++++- lib/models/SOAP/order-procedure.dart | 110 ++++++++++++++++++ .../profile/UCAF/UCAF-detail-screen.dart | 101 +++++++++++++--- 5 files changed, 332 insertions(+), 22 deletions(-) create mode 100644 lib/models/SOAP/order-procedure.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index e3163bb2..1ac3c517 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -160,6 +160,7 @@ const GET_CHIEF_COMPLAINT = const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote'; const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment'; +const GET_ORDER_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure'; diff --git a/lib/core/service/patient-ucaf-service.dart b/lib/core/service/patient-ucaf-service.dart index 06fbce41..ac8ff300 100644 --- a/lib/core/service/patient-ucaf-service.dart +++ b/lib/core/service/patient-ucaf-service.dart @@ -1,14 +1,19 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; -class UcafService extends BaseService { +class UcafService extends LookupService { List patientChiefComplaintList = []; VitalSignData patientVitalSigns; + List patientAssessmentList = []; + List orderProcedureList = []; Future getPatientChiefComplaint(PatiantInformtion patient) async { hasError = false; @@ -55,4 +60,45 @@ class UcafService extends BaseService { body: body, ); } + + Future getPatientAssessment(PatiantInformtion patient) async { + hasError = false; + Map body = Map(); + body['PatientMRN'] = patient.patientMRN; + body['AppointmentNo'] = patient.appointmentNo; + body['EpisodeID'] = patient.episodeNo; + + await baseAppClient.post (GET_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + patientAssessmentList.clear(); + response['AssessmentList']['entityList'].forEach((v) { + patientAssessmentList.add(GetAssessmentResModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getOrderProcedures(PatiantInformtion patient) async { + hasError = false; + Map body = Map(); + body['PatientMRN'] = patient.patientMRN; + // body['AppointmentNo'] = patient.appointmentNo; + // body['EpisodeID'] = patient.episodeNo; + + await baseAppClient.post (GET_ORDER_PROCEDURE, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + orderProcedureList.clear(); + response['OrderedProcedureList']['entityList'].forEach((v) { + orderProcedureList.add(OrderProcedure.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + } \ No newline at end of file diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index c120e2ab..5586e711 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -1,19 +1,42 @@ +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient-ucaf-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; +import 'package:flutter/material.dart'; import '../../locator.dart'; class UcafViewModel extends BaseViewModel { - UcafService _ucafService = locator(); - List get patientChiefComplaintList => _ucafService.patientChiefComplaintList; + List get patientChiefComplaintList => + _ucafService.patientChiefComplaintList; + VitalSignData get patientVitalSigns => _ucafService.patientVitalSigns; + List get patientAssessmentList => + _ucafService.patientAssessmentList; + + List get diagnosisTypes => _ucafService.listOfDiagnosisType; + + List get diagnosisConditions => + _ucafService.listOfDiagnosisCondition; + + List get orderProcedures => _ucafService.orderProcedureList; + + String selectedLanguage; + + Future getLanguage() async { + selectedLanguage = await sharedPref.getString(APP_Language); + } + Future getUCAFData(PatiantInformtion patient) async { setState(ViewState.Busy); await _ucafService.getPatientVitalSign(patient); @@ -27,4 +50,69 @@ class UcafViewModel extends BaseViewModel { } } -} \ No newline at end of file + Future getPatientAssessment(PatiantInformtion patient) async { + if (patientAssessmentList.isEmpty) { + setState(ViewState.Busy); + await _ucafService.getPatientAssessment(patient); + if (_ucafService.hasError) { + error = _ucafService.error; + setState(ViewState.Error); + } else { + if (patientAssessmentList.isNotEmpty) { + if (diagnosisConditions.length == 0) { + await _ucafService + .getMasterLookup(MasterKeysService.DiagnosisCondition); + } + if (diagnosisTypes.length == 0) { + await _ucafService.getMasterLookup(MasterKeysService.DiagnosisType); + } + if (_ucafService.hasError) { + error = _ucafService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } else + setState(ViewState.Idle); // but with empty list + } + } + } + + Future getOrderProcedures(PatiantInformtion patient) async { + if (orderProcedures.isEmpty) { + setState(ViewState.Busy); + await _ucafService.getOrderProcedures(patient); + if (_ucafService.hasError) { + error = _ucafService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + } + + MasterKeyModel findMasterDataById( + {@required MasterKeysService masterKeys, dynamic id}) { + switch (masterKeys) { + case MasterKeysService.DiagnosisCondition: + List result = diagnosisConditions.where((element) { + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); + }).toList(); + if (result.isNotEmpty) { + return result.first; + } + return null; + case MasterKeysService.DiagnosisType: + List result = diagnosisTypes.where((element) { + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); + }).toList(); + if (result.isNotEmpty) { + return result.first; + } + return null; + default: + return null; + } + } +} diff --git a/lib/models/SOAP/order-procedure.dart b/lib/models/SOAP/order-procedure.dart new file mode 100644 index 00000000..4e134a07 --- /dev/null +++ b/lib/models/SOAP/order-procedure.dart @@ -0,0 +1,110 @@ +class OrderProcedure { + + String achiCode; + String appointmentDate; + int appointmentNo; + int categoryID; + String clinicDescription; + String cptCode; + int createdBy; + String createdOn; + String doctorName; + bool isApprovalCreated; + bool isApprovalRequired; + bool isCovered; + bool isInvoiced; + bool isReferralInvoiced; + bool isUncoveredByDoctor; + int lineItemNo; + String orderDate; + int orderNo; + int orderType; + String procedureId; + String procedureName; + String remarks; + String status; + String template; + + OrderProcedure( + {this.achiCode, + this.appointmentDate, + this.appointmentNo, + this.categoryID, + this.clinicDescription, + this.cptCode, + this.createdBy, + this.createdOn, + this.doctorName, + this.isApprovalCreated, + this.isApprovalRequired, + this.isCovered, + this.isInvoiced, + this.isReferralInvoiced, + this.isUncoveredByDoctor, + this.lineItemNo, + this.orderDate, + this.orderNo, + this.orderType, + this.procedureId, + this.procedureName, + this.remarks, + this.status, + this.template}); + + OrderProcedure.fromJson(Map json) { + achiCode = json['achiCode']; + appointmentDate = json['appointmentDate']; + appointmentNo = json['appointmentNo']; + categoryID = json['categoryID']; + clinicDescription = json['clinicDescription']; + cptCode = json['cptCode']; + createdBy = json['createdBy']; + createdOn = json['createdOn']; + doctorName = json['doctorName']; + isApprovalCreated = json['isApprovalCreated']; + isApprovalRequired = json['isApprovalRequired']; + isCovered = json['isCovered']; + isInvoiced = json['isInvoiced']; + isReferralInvoiced = json['isReferralInvoiced']; + isUncoveredByDoctor = json['isUncoveredByDoctor']; + lineItemNo = json['lineItemNo']; + orderDate = json['orderDate']; + orderNo = json['orderNo']; + orderType = json['orderType']; + procedureId = json['procedureId']; + procedureName = json['procedureName']; + remarks = json['remarks']; + status = json['status']; + template = json['template']; + } + + Map toJson() { + final Map data = new Map(); + data['achiCode'] = this.achiCode; + data['appointmentDate'] = this.appointmentDate; + data['appointmentNo'] = this.appointmentNo; + data['categoryID'] = this.categoryID; + data['clinicDescription'] = this.clinicDescription; + data['cptCode'] = this.cptCode; + data['createdBy'] = this.createdBy; + data['createdOn'] = this.createdOn; + data['doctorName'] = this.doctorName; + data['isApprovalCreated'] = this.isApprovalCreated; + data['isApprovalRequired'] = this.isApprovalRequired; + data['isCovered'] = this.isCovered; + data['isInvoiced'] = this.isInvoiced; + data['isReferralInvoiced'] = this.isReferralInvoiced; + data['isUncoveredByDoctor'] = this.isUncoveredByDoctor; + data['lineItemNo'] = this.lineItemNo; + data['orderDate'] = this.orderDate; + data['orderNo'] = this.orderNo; + data['orderType'] = this.orderType; + data['procedureId'] = this.procedureId; + data['procedureName'] = this.procedureName; + data['remarks'] = this.remarks; + data['status'] = this.status; + data['template'] = this.template; + return data; + } + +} \ No newline at end of file diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index f9c2470a..4428da8d 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -1,5 +1,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart'; 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/helpers.dart'; @@ -25,6 +29,10 @@ class _UcafDetailScreenState extends State { final screenSize = MediaQuery.of(context).size; return BaseView( + onModelReady: (model) async { + await model.getLanguage(); + await model.getPatientAssessment(patient); + }, builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).ucaf, @@ -42,11 +50,12 @@ class _UcafDetailScreenState extends State { EdgeInsets.symmetric(vertical: 16, horizontal: 16), child: Column( children: [ - treatmentStepsBar(context, screenSize), + treatmentStepsBar( + context, model, screenSize, patient), SizedBox( height: 16, ), - ...getSelectedTreatmentStepItem(context), + ...getSelectedTreatmentStepItem(context, model), ], ), ), @@ -57,7 +66,8 @@ class _UcafDetailScreenState extends State { )); } - Widget treatmentStepsBar(BuildContext _context, Size screenSize) { + Widget treatmentStepsBar(BuildContext _context, UcafViewModel model, + Size screenSize, PatiantInformtion patient) { List __treatmentSteps = [ TranslationBase.of(context).diagnosis.toUpperCase(), TranslationBase.of(context).medications.toUpperCase(), @@ -93,8 +103,16 @@ class _UcafDetailScreenState extends State { ), )), ), - onTap: () { + onTap: () async { print(__treatmentSteps.indexOf(item)); + if (__treatmentSteps.indexOf(item) == 0) { + await model.getPatientAssessment(patient); + } else if (__treatmentSteps.indexOf(item) == 1) { + print("call Medications"); + } + if (__treatmentSteps.indexOf(item) == 2) { + await model.getOrderProcedures(patient); + } setState(() { _activeTap = __treatmentSteps.indexOf(item); }); @@ -106,14 +124,41 @@ class _UcafDetailScreenState extends State { ); } - List getSelectedTreatmentStepItem(BuildContext _context) { + List getSelectedTreatmentStepItem( + BuildContext _context, UcafViewModel model) { switch (_activeTap) { case 0: - return [...List.generate(2, (index) => DiagnosisWidget()).toList()]; + if (model.patientAssessmentList != null) { + return [ + ...List.generate( + model.patientAssessmentList.length, + (index) => DiagnosisWidget( + model, model.patientAssessmentList[index])).toList() + ]; + } else { + return [ + Container(), + ]; + } + break; case 1: return [...List.generate(2, (index) => MedicationWidget()).toList()]; + break; case 2: - return [...List.generate(2, (index) => ProceduresWidget()).toList()]; + if (model.orderProcedures != null) { + return [ + ...List.generate( + model.orderProcedures.length, + (index) => + ProceduresWidget(model, model.orderProcedures[index])) + .toList() + ]; + } else { + return [ + Container(), + ]; + } + break; default: return [ Container(), @@ -123,8 +168,20 @@ class _UcafDetailScreenState extends State { } class DiagnosisWidget extends StatelessWidget { + final UcafViewModel model; + final GetAssessmentResModel diagnosis; + + DiagnosisWidget(this.model, this.diagnosis); + @override Widget build(BuildContext context) { + MasterKeyModel diagnosisType = model.findMasterDataById( + masterKeys: MasterKeysService.DiagnosisType, + id: diagnosis.diagnosisTypeID); + MasterKeyModel diagnosisCondition = model.findMasterDataById( + masterKeys: MasterKeysService.DiagnosisCondition, + id: diagnosis.conditionID); + return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -136,7 +193,11 @@ class DiagnosisWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "Preliminary Diagnosis", + diagnosisType != null + ? model.selectedLanguage == 'ar' + ? diagnosisType.nameAr + : diagnosisType.nameEn + : "-", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -149,7 +210,7 @@ class DiagnosisWidget extends StatelessWidget { children: [ Expanded( child: AppText( - "B34.2 | CORONA VIRUS INFECTION, UNSPECIFIED SITE", + diagnosis.asciiDesc, fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -167,7 +228,7 @@ class DiagnosisWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "174.00 Same", + "${diagnosis.icdCode10ID} ${diagnosisCondition != null ? model.selectedLanguage == 'ar' ? diagnosisCondition.nameAr : diagnosisCondition.nameEn : "-"}", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -284,6 +345,11 @@ class MedicationWidget extends StatelessWidget { } class ProceduresWidget extends StatelessWidget { + final UcafViewModel model; + final OrderProcedure procedure; + + ProceduresWidget(this.model, this.procedure); + @override Widget build(BuildContext context) { return Column( @@ -296,7 +362,7 @@ class ProceduresWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "019054846", + procedure.achiCode, fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -310,14 +376,13 @@ class ProceduresWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "1", + "${procedure.lineItemNo}", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), ], ), ), - ], ), SizedBox( @@ -327,7 +392,7 @@ class ProceduresWidget extends StatelessWidget { children: [ Expanded( child: AppText( - "SCAN - RENAL MASS PROTOCOL", + procedure.procedureName, fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -345,9 +410,9 @@ class ProceduresWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "Yes", + "${procedure.isCovered}", fontWeight: FontWeight.normal, - color: Colors.green, + color: procedure.isCovered ? Colors.green : Colors.red, fontSize: SizeConfig.textMultiplier * 2.0, ), SizedBox( @@ -359,7 +424,7 @@ class ProceduresWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "Yes", + "${procedure.isApprovalRequired}", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -376,7 +441,7 @@ class ProceduresWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "Yes", + "${procedure.isUncoveredByDoctor}", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), From a46a61c5cf4e52f03c1d0fb31c51c768c2d6b8c8 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 5 Jan 2021 18:59:32 +0200 Subject: [PATCH 06/21] fix get and post issue to make it works with vida --- lib/client/base_app_client.dart | 4 + lib/config/localized_values.dart | 3 + .../GetChiefComplaintReqModel.dart | 9 +- lib/models/SOAP/GeneralGetReqForSOAP.dart | 15 +- lib/models/SOAP/GetHistoryReqModel.dart | 7 +- lib/models/SOAP/GetPhysicalExamReqModel.dart | 21 ++- lib/models/SOAP/my_selected_allergy.dart | 9 +- lib/models/SOAP/my_selected_examination.dart | 10 +- .../SOAP/post_histories_request_model.dart | 5 +- lib/util/translations_delegate_base.dart | 3 + .../subjective/update_allergies_widget.dart | 55 ++++--- .../subjective/update_subjective_page.dart | 136 +++++++++--------- .../soap_update/update_objective_page.dart | 19 ++- .../soap_update/update_soap_index.dart | 2 +- 14 files changed, 184 insertions(+), 114 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index ea5580ca..6ab902de 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -44,6 +44,7 @@ class BaseAppClient { body['DoctorID'] = doctorProfile?.doctorID; if (body['DoctorID'] == "") body['DoctorID'] = null; + if( body['EditedBy'] ==null) body['EditedBy'] = doctorProfile?.doctorID; if (body['ProjectID'] == null) { body['ProjectID'] = doctorProfile?.projectID; @@ -54,6 +55,9 @@ class BaseAppClient { if (body['DoctorID'] == '') { body['DoctorID'] =null; } + if (body['EditedBy'] == '') { + body.remove("EditedBy"); + } body['TokenID'] = token ?? ''; String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index adca1232..4ad53ebe 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -538,4 +538,7 @@ const Map> localizedValues = { }, 'addAssessment': {'en': "Add ASSESSMENT", 'ar':"أضف التقييم" }, 'assessment': {'en': "ASSESSMENT", 'ar':" التقييم" }, + 'physicalSystemExamination': {'en': "Physical/System Examination", 'ar':" الفحص البدني / النظام" }, + 'searchExamination': {'en': "Search Examination", 'ar':"فحص البحث" }, + 'addExamination': {'en': "Add Examination", 'ar':"اضافه" }, }; diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart index 68ab6c40..80188dfe 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -3,16 +3,19 @@ class GetChiefComplaintReqModel { int appointmentNo; int episodeId; int episodeID; + dynamic doctorID; GetChiefComplaintReqModel( - {this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID}); + {this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID}); GetChiefComplaintReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; appointmentNo = json['AppointmentNo']; episodeId = json['EpisodeId']; episodeID = json['EpisodeID']; - } + doctorID = json['DoctorID']; + +} Map toJson() { final Map data = new Map(); @@ -20,6 +23,8 @@ class GetChiefComplaintReqModel { data['AppointmentNo'] = this.appointmentNo; data['EpisodeId'] = this.episodeId; data['EpisodeID'] = this.episodeID; + data['DoctorID'] = this.doctorID; + return data; } } diff --git a/lib/models/SOAP/GeneralGetReqForSOAP.dart b/lib/models/SOAP/GeneralGetReqForSOAP.dart index 488a06d4..70e76313 100644 --- a/lib/models/SOAP/GeneralGetReqForSOAP.dart +++ b/lib/models/SOAP/GeneralGetReqForSOAP.dart @@ -2,16 +2,23 @@ class GeneralGetReqForSOAP { int patientMRN; int appointmentNo; int episodeId; - String doctorID; + dynamic editedBy; + dynamic doctorID; - GeneralGetReqForSOAP( - {this.patientMRN, this.appointmentNo, this.episodeId, this.doctorID}); + GeneralGetReqForSOAP({ + this.patientMRN, + this.appointmentNo, + this.episodeId, + this.doctorID, + this.editedBy, + }); GeneralGetReqForSOAP.fromJson(Map json) { patientMRN = json['PatientMRN']; appointmentNo = json['AppointmentNo']; episodeId = json['EpisodeId']; doctorID = json['DoctorID']; + editedBy = json['EditedBy']; } Map toJson() { @@ -20,6 +27,8 @@ class GeneralGetReqForSOAP { data['AppointmentNo'] = this.appointmentNo; data['EpisodeId'] = this.episodeId; data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; + return data; } } diff --git a/lib/models/SOAP/GetHistoryReqModel.dart b/lib/models/SOAP/GetHistoryReqModel.dart index 1df26690..720b6342 100644 --- a/lib/models/SOAP/GetHistoryReqModel.dart +++ b/lib/models/SOAP/GetHistoryReqModel.dart @@ -5,8 +5,9 @@ class GetHistoryReqModel { String from; String to; int clinicID; - int doctorID; int appointmentNo; + dynamic editedBy; + dynamic doctorID; GetHistoryReqModel( {this.patientMRN, @@ -16,6 +17,7 @@ class GetHistoryReqModel { this.to, this.clinicID, this.doctorID, + this.editedBy, this.appointmentNo}); GetHistoryReqModel.fromJson(Map json) { @@ -27,6 +29,7 @@ class GetHistoryReqModel { clinicID = json['ClinicID']; doctorID = json['DoctorID']; appointmentNo = json['AppointmentNo']; + editedBy = json['EditedBy']; } @@ -40,6 +43,8 @@ class GetHistoryReqModel { data['To'] = this.to; data['ClinicID'] = this.clinicID; data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; + return data; } } diff --git a/lib/models/SOAP/GetPhysicalExamReqModel.dart b/lib/models/SOAP/GetPhysicalExamReqModel.dart index ce045c22..5145c419 100644 --- a/lib/models/SOAP/GetPhysicalExamReqModel.dart +++ b/lib/models/SOAP/GetPhysicalExamReqModel.dart @@ -4,13 +4,18 @@ class GetPhysicalExamReqModel { String episodeID; String from; String to; + dynamic editedBy; + dynamic doctorID; - GetPhysicalExamReqModel( - {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.from, - this.to}); + GetPhysicalExamReqModel({ + this.patientMRN, + this.appointmentNo, + this.episodeID, + this.from, + this.to, + this.doctorID, + this.editedBy, + }); GetPhysicalExamReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; @@ -18,6 +23,8 @@ class GetPhysicalExamReqModel { episodeID = json['EpisodeID']; from = json['From']; to = json['To']; + doctorID = json['DoctorID']; + editedBy = json['EditedBy']; } Map toJson() { @@ -27,6 +34,8 @@ class GetPhysicalExamReqModel { data['EpisodeID'] = this.episodeID; data['From'] = this.from; data['To'] = this.to; + data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; return data; } } diff --git a/lib/models/SOAP/my_selected_allergy.dart b/lib/models/SOAP/my_selected_allergy.dart index e5b45502..5a6bd749 100644 --- a/lib/models/SOAP/my_selected_allergy.dart +++ b/lib/models/SOAP/my_selected_allergy.dart @@ -5,9 +5,14 @@ class MySelectedAllergy { MasterKeyModel selectedAllergy; String remark; bool isChecked; + int createdBy; MySelectedAllergy( - {this.selectedAllergySeverity, this.selectedAllergy, this.remark, this.isChecked}); + {this.selectedAllergySeverity, + this.selectedAllergy, + this.remark, + this.isChecked, + this.createdBy}); MySelectedAllergy.fromJson(Map json) { selectedAllergySeverity = json['selectedAllergySeverity'] != null @@ -18,6 +23,7 @@ class MySelectedAllergy { : null; remark = json['remark']; remark = json['isChecked']; + createdBy = json['createdBy']; } Map toJson() { @@ -30,6 +36,7 @@ class MySelectedAllergy { } data['remark'] = this.remark; data['isChecked'] = this.remark; + data['createdBy'] = this.createdBy; return data; } } diff --git a/lib/models/SOAP/my_selected_examination.dart b/lib/models/SOAP/my_selected_examination.dart index 3b6685c8..5a717a4e 100644 --- a/lib/models/SOAP/my_selected_examination.dart +++ b/lib/models/SOAP/my_selected_examination.dart @@ -5,18 +5,23 @@ class MySelectedExamination { String remark; bool isNormal; bool isAbnormal; + int createdBy; MySelectedExamination( - {this.selectedExamination, this.remark, this.isNormal = true, this.isAbnormal = false}); + {this.selectedExamination, + this.remark, + this.isNormal = true, + this.isAbnormal = false, + this.createdBy}); MySelectedExamination.fromJson(Map json) { - selectedExamination = json['selectedExamination'] != null ? new MasterKeyModel.fromJson(json['selectedExamination']) : null; remark = json['remark']; remark = json['isNormal']; remark = json['isAbnormal']; + createdBy = json['createdBy']; } Map toJson() { @@ -28,6 +33,7 @@ class MySelectedExamination { data['remark'] = this.remark; data['isNormal'] = this.isNormal; data['isAbnormal'] = this.isAbnormal; + data['createdBy'] = this.createdBy; return data; } } diff --git a/lib/models/SOAP/post_histories_request_model.dart b/lib/models/SOAP/post_histories_request_model.dart index baa428fd..d8be3fb2 100644 --- a/lib/models/SOAP/post_histories_request_model.dart +++ b/lib/models/SOAP/post_histories_request_model.dart @@ -1,7 +1,8 @@ class PostHistoriesRequestModel { List listMedicalHistoryVM; + dynamic doctorID; - PostHistoriesRequestModel({this.listMedicalHistoryVM}); + PostHistoriesRequestModel({this.listMedicalHistoryVM, this.doctorID}); PostHistoriesRequestModel.fromJson(Map json) { if (json['listMedicalHistoryVM'] != null) { @@ -10,6 +11,7 @@ class PostHistoriesRequestModel { listMedicalHistoryVM.add(new ListMedicalHistoryVM.fromJson(v)); }); } + doctorID = json['DoctorID']; } Map toJson() { @@ -18,6 +20,7 @@ class PostHistoriesRequestModel { data['listMedicalHistoryVM'] = this.listMedicalHistoryVM.map((v) => v.toJson()).toList(); } + data['DoctorID'] = this.doctorID; return data; } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index e295266f..e6b5dbd5 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -555,6 +555,9 @@ class TranslationBase { String get addAssessment => localizedValues['addAssessment'][locale.languageCode]; String get assessment => localizedValues['assessment'][locale.languageCode]; String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; + String get physicalSystemExamination => localizedValues['physicalSystemExamination'][locale.languageCode]; + String get searchExamination => localizedValues['searchExamination'][locale.languageCode]; + String get addExamination => localizedValues['addExamination'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index a9839a2c..6de9e031 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -170,31 +170,40 @@ class _UpdateAllergiesWidgetState extends State { builder: (context) { return AddAllergies( addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { - setState(() { - List allergy = - // ignore: missing_return - widget.myAllergiesList.where((element) => - mySelectedAllergy.selectedAllergy.id == - element.selectedAllergy.id - ).toList(); - if (allergy.isEmpty) { - widget.myAllergiesList.add(mySelectedAllergy); - Navigator.of(context).pop(); - } else { - allergy.first.selectedAllergy = - mySelectedAllergy.selectedAllergy; - allergy.first.selectedAllergySeverity = - mySelectedAllergy.selectedAllergySeverity; - allergy.first.remark = mySelectedAllergy.remark; - allergy.first.isChecked = mySelectedAllergy.isChecked; - Navigator.of(context).pop(); + if (mySelectedAllergy.selectedAllergySeverity == null || + mySelectedAllergy.selectedAllergy == null) { + helpers.showErrorToast(TranslationBase + .of(context) + .requiredMsg); - // helpers.showErrorToast(TranslationBase - // .of(context) - // .itemExist); - } + } else { + setState(() { + List allergy = + // ignore: missing_return + widget.myAllergiesList + .where((element) => + mySelectedAllergy.selectedAllergy.id == + element.selectedAllergy.id) + .toList(); - }); + if (allergy.isEmpty) { + widget.myAllergiesList.add(mySelectedAllergy); + Navigator.of(context).pop(); + } else { + allergy.first.selectedAllergy = + mySelectedAllergy.selectedAllergy; + allergy.first.selectedAllergySeverity = + mySelectedAllergy.selectedAllergySeverity; + allergy.first.remark = mySelectedAllergy.remark; + allergy.first.isChecked = mySelectedAllergy.isChecked; + Navigator.of(context).pop(); + + // helpers.showErrorToast(TranslationBase + // .of(context) + // .itemExist); + } + }); + } },); }); } diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index e0d92788..4370df4f 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; @@ -12,6 +13,7 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; 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/translations_delegate_base.dart'; @@ -54,20 +56,11 @@ class _UpdateSubjectivePageState extends State { GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo.toString(), - appointmentNo: widget.patientInfo.appointmentNo); - - getHistoryReqModel.historyType = - MasterKeysService.HistoryFamily.getMasterKeyService(); - await model.getPatientHistories(getHistoryReqModel, isFirst: true); - getHistoryReqModel.historyType = - MasterKeysService.HistoryMedical.getMasterKeyService(); - await model.getPatientHistories(getHistoryReqModel); - getHistoryReqModel.historyType = - MasterKeysService.HistorySurgical.getMasterKeyService(); - await model.getPatientHistories(getHistoryReqModel); - getHistoryReqModel.historyType = - MasterKeysService.HistorySports.getMasterKeyService(); - await model.getPatientHistories(getHistoryReqModel); + appointmentNo: widget.patientInfo.appointmentNo, + doctorID: '', + editedBy: ''); + + await model.getPatientHistories(getHistoryReqModel,isFirst: true); if (model.patientHistoryList.isNotEmpty) { if (model.historyFamilyList.isEmpty) { @@ -147,58 +140,64 @@ class _UpdateSubjectivePageState extends State { }); } } + + getAllergies(SOAPViewModel model) async { + GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + doctorID: '', + editedBy: ''); + await model.getPatientAllergy(generalGetReqForSOAP); + if (model.patientAllergiesList.isNotEmpty) { + if (model.allergiesList.isEmpty) + await model.getMasterLookup(MasterKeysService.Allergies); + if (model.allergySeverityList.isEmpty) + await model.getMasterLookup(MasterKeysService.AllergySeverity); + + model.patientAllergiesList.forEach((element) { + MasterKeyModel selectedAllergy = model.getOneMasterKey( + masterKeys: MasterKeysService.Allergies, + id: element.allergyDiseaseId, + typeId: element.allergyDiseaseType); + MasterKeyModel selectedAllergySeverity = model.getOneMasterKey( + masterKeys: MasterKeysService.AllergySeverity, + id: element.severity, + ); + MySelectedAllergy mySelectedAllergy = MySelectedAllergy( + selectedAllergy: selectedAllergy, + isChecked: element.isChecked, + createdBy: element.createdBy, + selectedAllergySeverity: selectedAllergySeverity); + if (selectedAllergy != null && selectedAllergySeverity != null) + widget.myAllergiesList.add(mySelectedAllergy); + }); + } + } + @override Widget build(BuildContext context) { - - return BaseView( + return BaseView( onModelReady: (model) async { widget.myAllergiesList.clear(); widget.myHistoryList.clear(); - - GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo); GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( patientMRN: widget.patientInfo.patientMRN, appointmentNo: widget.patientInfo.appointmentNo, episodeId: widget.patientInfo.episodeNo, - episodeID: widget.patientInfo.episodeNo); + episodeID: widget.patientInfo.episodeNo, + doctorID: ''); await model.getPatientChiefComplaint(getChiefComplaintReqModel); if (model.patientChiefComplaintList.isNotEmpty) { - complaintsController.text = helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint) - ; + complaintsController.text = helpers.parseHtmlString( + model.patientChiefComplaintList[0].chiefComplaint); illnessController.text = model.patientChiefComplaintList[0].hopi; } - await model.getPatientAllergy(generalGetReqForSOAP); - if (model.patientAllergiesList.isNotEmpty) { - if (model.allergiesList.isEmpty) - await model.getMasterLookup(MasterKeysService.Allergies); - if (model.allergySeverityList.isEmpty) - await model.getMasterLookup(MasterKeysService.AllergySeverity); - - model.patientAllergiesList.forEach((element) { - MasterKeyModel selectedAllergy = model.getOneMasterKey( - masterKeys: MasterKeysService.Allergies, - id: element.allergyDiseaseId, - typeId: element.allergyDiseaseType); - MasterKeyModel selectedAllergySeverity = model.getOneMasterKey( - masterKeys: MasterKeysService.AllergySeverity, - id: element.severity, - ); - MySelectedAllergy mySelectedAllergy = MySelectedAllergy( - selectedAllergy: selectedAllergy, - isChecked: element.isChecked, - selectedAllergySeverity: selectedAllergySeverity); - if (selectedAllergy != null && selectedAllergySeverity != null) - widget.myAllergiesList.add(mySelectedAllergy); - }); - } await getHistory(model); - + await getAllergies(model); }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, @@ -472,29 +471,30 @@ class _UpdateSubjectivePageState extends State { {List myAllergiesList, SOAPViewModel model}) async { PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); + + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); widget.myAllergiesList.forEach((allergy) { if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; //TODO: make static value dynamic - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM - .add(ListHisProgNotePatientAllergyDiseaseVM( - allergyDiseaseId: allergy.selectedAllergy.id, - allergyDiseaseType: allergy.selectedAllergy.typeId, - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - severity: allergy.selectedAllergySeverity.id, - remarks: allergy.remark, - createdBy: 4709, - // - createdOn: DateTime.now().toIso8601String(), - //"2020-08-14T20:37:22.780Z", - editedBy: 4709, - editedOn: DateTime.now().toIso8601String(), - //"2020-08-14T20:37:22.780Z", - isChecked: false, - isUpdatedByNurse: false)); + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( + ListHisProgNotePatientAllergyDiseaseVM( + allergyDiseaseId: allergy.selectedAllergy.id, + allergyDiseaseType: allergy.selectedAllergy.typeId, + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + severity: allergy.selectedAllergySeverity.id, + remarks: allergy.remark, + createdBy: allergy.createdBy??doctorProfile.doctorID, + createdOn: DateTime.now().toIso8601String(), + editedBy: doctorProfile.doctorID, + editedOn: DateTime.now().toIso8601String(), + isChecked: allergy.isChecked, + isUpdatedByNurse: false)); }); if (model.patientAllergiesList.isEmpty) { await model.postAllergy(postAllergyRequestModel); @@ -510,7 +510,7 @@ class _UpdateSubjectivePageState extends State { postHistories( {List myHistoryList, SOAPViewModel model}) async { PostHistoriesRequestModel postHistoriesRequestModel = - new PostHistoriesRequestModel(); + new PostHistoriesRequestModel(doctorID: ''); widget.myHistoryList.forEach((history) { if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index 37a5d72f..0c8bece6 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; @@ -7,6 +8,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; 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/translations_delegate_base.dart'; @@ -77,6 +79,7 @@ class _UpdateObjectivePageState extends State { selectedExamination: examMaster, remark: element.remarks, isNormal: element.isNormal, + createdBy: element.createdBy, isAbnormal: element.isAbnormal); widget.mySelectedExamination.add(tempEam); }); @@ -102,7 +105,7 @@ class _UpdateObjectivePageState extends State { children: [ Row( children: [ - Texts('Physical/System Examination', + Texts(TranslationBase.of(context).physicalSystemExamination, variant: isSysExaminationExpand ? "bodyText" : '', @@ -137,7 +140,7 @@ class _UpdateObjectivePageState extends State { margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( - hintText: "Add Examination", + hintText: TranslationBase.of(context).physicalSystemExamination, fontSize: 13.5, onTapTextFields: () { openExaminationList(context); @@ -351,7 +354,11 @@ class _UpdateObjectivePageState extends State { } submitUpdateObjectivePage(SOAPViewModel model) async { + if(widget.mySelectedExamination.isNotEmpty){ + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); widget.mySelectedExamination.forEach((exam) { if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == @@ -364,9 +371,9 @@ class _UpdateObjectivePageState extends State { episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, remarks: exam.remark ?? '', - createdBy: 4709, + createdBy: exam.createdBy??doctorProfile.doctorID, createdOn: DateTime.now().toIso8601String(), - editedBy: 4709, + editedBy: doctorProfile.doctorID, editedOn: DateTime.now().toIso8601String(), examId: exam.selectedExamination.id, examType: exam.selectedExamination.typeId, @@ -505,8 +512,8 @@ class _AddExaminationDailogState extends State { baseViewModel: model, child: MasterKeyCheckboxSearchWidget( model: model, - hintSearchText: 'Search Examination', - buttonName: 'Add Examination', + hintSearchText: TranslationBase.of(context).searchExamination, + buttonName: TranslationBase.of(context).addExamination, masterList: model.physicalExaminationList, removeHistory: (history){ setState(() { diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 0edaaaf9..3b793d6a 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -33,7 +33,7 @@ class _UpdateSoapIndexState extends State List myAllergiesList= List(); List myHistoryList = List(); List mySelectedExamination = List(); - MySelectedAssessment mySelectedAssessment = new MySelectedAssessment(); + MySelectedAssessment mySelectedAssessment = MySelectedAssessment(); changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); } From 7f250baf32de6fb32c558e7ee58f3c0265362634 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 6 Jan 2021 14:07:53 +0200 Subject: [PATCH 07/21] date picker fix --- lib/screens/prescription/add_prescription_form.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index f39499e1..9c3bda7f 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -696,11 +696,11 @@ class _PrescriptionFormWidgetState extends State { selectDate(BuildContext context, PrescriptionViewModel model) async { DateTime selectedDate; - selectedDate = DateTime.now().add(Duration(hours: 10)); + selectedDate = DateTime.now().add(Duration(hours: 1)); final DateTime picked = await showDatePicker( context: context, initialDate: selectedDate, - firstDate: DateTime.now().add(Duration(hours: 15)), + firstDate: DateTime.now().add(Duration(hours: 5)), lastDate: DateTime(2040), initialEntryMode: DatePickerEntryMode.calendar, ); From 9a5cafaaf5d3cdc16357bad16bd32c3da8b982b9 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 6 Jan 2021 15:11:36 +0200 Subject: [PATCH 08/21] working on UCAF detail screen , and some cahgnes on referral list --- lib/core/service/base/base_service.dart | 8 +- .../viewModel/patient-referral-viewmodel.dart | 15 ++++ .../patient-vital-sign-viewmodel.dart | 29 ------- .../profile/UCAF/UCAF-detail-screen.dart | 80 ++++++++++++++----- .../referral/my-referral-detail-screen.dart | 32 ++++++-- .../profile/profile_medical_info_widget.dart | 3 +- 6 files changed, 109 insertions(+), 58 deletions(-) diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index d2c4eb1f..32edf34f 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -30,13 +30,19 @@ class BaseService { } } - Future getPatientArrivalList(String date,{String fromDate}) async{ + Future getPatientArrivalList(String date,{String fromDate, int patientMrn = -1, int appointmentNo = -1}) async{ hasError = false; Map body = Map(); body['From'] = fromDate == null ? date : fromDate; body['To'] = date; body['PageIndex'] = 0; body['PageSize'] = 0; + if(patientMrn == -1){ + body['PatientMRN'] = patientMrn; + } + if(appointmentNo == -1){ + body['AppointmentNo'] = appointmentNo; + } await baseAppClient.post( GET_PATIENT_ARRIVAL_LIST, diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 251407ef..35747c37 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -133,4 +133,19 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + Future getPatientDetails(String fromDate, String toDate, int patientMrn, int appointmentNo) async { + setState(ViewState.Busy); + + await _referralPatientService.getPatientArrivalList(toDate, fromDate: fromDate, patientMrn: patientMrn, appointmentNo: appointmentNo); + if (_referralPatientService.hasError) { + error = _referralPatientService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + /* + * model + .getPatientArrivalList()*/ } diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 4282141c..4f2e7e28 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -16,35 +16,6 @@ class VitalSignsViewModel extends BaseViewModel { VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns; - /*Future getPatientArrivalList(String date, PatiantInformtion patient, - {String fromDate}) async { - // TODO when arrival list work un comment below lines - *//* setState(ViewState.Busy); - await _vitalSignService.getPatientArrivalList(date, fromDate: fromDate); - if (_vitalSignService.hasError) { - error = _vitalSignService.error; - setState(ViewState.Error); - } else { - await getPatientVitalSign(patient); - }*//* - makeVitalSignDemoData(); - } - - PatientArrivalEntity getPatientAppointmentEntity(PatiantInformtion patient) { - String ffName = "${patient.firstName} ${patient.lastName}"; - String fmfName = - "${patient.firstName} ${patient.middleName} ${patient.lastName}"; - - for (var element in patientArrivalList) { - int index = patientArrivalList.indexOf(element); - if (element.patientName == ffName || element.patientName == fmfName) { - return element; - } - // print("patient index: $index"); - } - return null; - }*/ - Future getPatientVitalSign(PatiantInformtion patient) async { setState(ViewState.Busy); await _vitalSignService.getPatientVitalSign(patient); diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 4428da8d..0a655231 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -11,9 +11,12 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import '../../../../routes.dart'; + class UcafDetailScreen extends StatefulWidget { @override _UcafDetailScreenState createState() => _UcafDetailScreenState(); @@ -36,32 +39,73 @@ class _UcafDetailScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).ucaf, - body: Container( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - PatientHeaderWidgetNoAvatar(patient), - SizedBox( - height: 10, - ), - Container( - margin: - EdgeInsets.symmetric(vertical: 16, horizontal: 16), + body: Column( + children: [ + Expanded( + child: Container( + child: SingleChildScrollView( child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - treatmentStepsBar( - context, model, screenSize, patient), + PatientHeaderWidgetNoAvatar(patient), SizedBox( - height: 16, + height: 10, + ), + Container( + margin: + EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Column( + children: [ + treatmentStepsBar( + context, model, screenSize, patient), + SizedBox( + height: 16, + ), + ...getSelectedTreatmentStepItem(context, model), + ], + ), ), - ...getSelectedTreatmentStepItem(context, model), ], ), ), - ], + ), ), - ), + Container( + margin: + EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: BorderedButton( + TranslationBase.of(context).save, + hasBorder: true, + vPadding: 16, + hPadding: 8, + borderColor: HexColor("#B8382B"), + backgroundColor: HexColor("#B8382B"), + textColor: Colors.white, + fontSize: SizeConfig.textMultiplier * 2.0, + handler: () {}, + ), + ), + Container( + margin: + EdgeInsets.only(left: 16, right: 16, top: 0, bottom: 16), + child: BorderedButton( + TranslationBase.of(context).cancel, + hasBorder: true, + vPadding: 16, + hPadding: 8, + borderColor: Colors.white, + backgroundColor: Colors.white, + textColor: HexColor("#B8382B"), + fontSize: SizeConfig.textMultiplier * 2.2, + handler: () { + Navigator.of(context).popUntil((route){ + return route.settings.name == PATIENTS_PROFILE; + }); + + }, + ), + ), + ], ), )); } diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 4c9d41e0..1019ede4 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.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/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; @@ -13,6 +14,8 @@ import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../../../routes.dart'; + class MyReferralDetailScreen extends StatelessWidget { PendingReferral pendingReferral; @@ -25,6 +28,14 @@ class MyReferralDetailScreen extends StatelessWidget { pendingReferral = routeArgs['referral']; return BaseView( + onModelReady: (model) => model.getPatientDetails( + DateUtils.convertStringToDateFormat( + DateTime.now().subtract(Duration(days: 350)).toString(), + "yyyy-MM-dd"), + DateUtils.convertStringToDateFormat( + DateTime.now().toString(), "yyyy-MM-dd"), + pendingReferral.patientID, + pendingReferral.sourceAppointmentNo), builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).referPatient, @@ -63,8 +74,10 @@ class MyReferralDetailScreen extends StatelessWidget { patientName: pendingReferral.patientName, referralStatus: null, isReferredTo: false, - isSameBranch: pendingReferral.isReferralDoctorSameBranch, - referralDoctorName: pendingReferral.referredByDoctorInfo, + isSameBranch: + pendingReferral.isReferralDoctorSameBranch, + referralDoctorName: + pendingReferral.referredByDoctorInfo, clinicDescription: null, remark: pendingReferral.remarksFromSource, ), @@ -73,7 +86,8 @@ class MyReferralDetailScreen extends StatelessWidget { childAspectRatio: 1.8, crossAxisSpacing: 8, mainAxisSpacing: 10, - controller: new ScrollController(keepScrollOffset: false), + controller: + new ScrollController(keepScrollOffset: false), shrinkWrap: true, padding: const EdgeInsets.all(4.0), crossAxisCount: 2, @@ -82,8 +96,10 @@ class MyReferralDetailScreen extends StatelessWidget { key: key, // patient: patient, // route: RADIOLOGY, - nameLine1: TranslationBase.of(context).previewHealth, - nameLine2: TranslationBase.of(context).summaryReport, + nameLine1: + TranslationBase.of(context).previewHealth, + nameLine2: + TranslationBase.of(context).summaryReport, icon: 'radiology-1.png'), PatientProfileButton( key: key, @@ -95,7 +111,7 @@ class MyReferralDetailScreen extends StatelessWidget { PatientProfileButton( key: key, // patient: patient, - // route: VITAL_SIGN_DETAILS, + route: PATIENT_VITAL_SIGN, nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, icon: 'heartbeat.png'), @@ -119,7 +135,7 @@ class MyReferralDetailScreen extends StatelessWidget { fontSize: 16, hPadding: 8, vPadding: 12, - handler: (){ + handler: () { model.responseReferral(pendingReferral, true); }, ), @@ -135,7 +151,7 @@ class MyReferralDetailScreen extends StatelessWidget { fontSize: 16, hPadding: 8, vPadding: 12, - handler: (){ + handler: () { model.responseReferral(pendingReferral, false); }, ), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 8860a7dc..c39c7c95 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -44,13 +44,12 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine2: TranslationBase.of(context).episode, route: UPDATE_EPISODE, icon: 'modilfy-episode.png'), - if(selectedPatientType == 6 || selectedPatientType == 7) PatientProfileButton( key: key, patient: patient, nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, - route: PATIENT_VITAL_SIGN, + route: (selectedPatientType == 6 || selectedPatientType == 7) ? PATIENT_VITAL_SIGN : VITAL_SIGN_DETAILS, icon: 'heartbeat.png'), if(selectedPatientType != 7) PatientProfileButton( From a3fa8ef839e33c5ba40296e8d6e180bcf2ac0ff7 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 6 Jan 2021 16:14:19 +0200 Subject: [PATCH 09/21] medical file fix --- .../medical-file/medical_file_details.dart | 80 +++++++++++++++-- .../prescription/add_prescription_form.dart | 86 +++++++++++++++---- 2 files changed, 140 insertions(+), 26 deletions(-) diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index c916842c..3823a88e 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -135,7 +135,15 @@ class _MedicalFileDetailsState extends State { 'Visit Date : ', fontWeight: FontWeight.w700, ), - if (model.medicalFileList.length != 0) + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) AppText(model .medicalFileList[0] .entityList[0] @@ -160,7 +168,15 @@ class _MedicalFileDetailsState extends State { 'Doctor : '.toUpperCase(), fontWeight: FontWeight.w700, ), - if (model.medicalFileList.length != 0) + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) AppText( model .medicalFileList[0] @@ -181,7 +197,15 @@ class _MedicalFileDetailsState extends State { 'Clinic : ', fontWeight: FontWeight.w700, ), - if (model.medicalFileList.length != 0) + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) AppText( model .medicalFileList[0] @@ -199,7 +223,15 @@ class _MedicalFileDetailsState extends State { 'Episode Number : ', fontWeight: FontWeight.w700, ), - if (model.medicalFileList.length != 0) + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) AppText( model .medicalFileList[0] @@ -219,7 +251,15 @@ class _MedicalFileDetailsState extends State { color: Colors.grey.shade400, ), SizedBox(height: 25.0), - if (model.medicalFileList.length != 0) + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) HeaderBodyExpandableNotifier( headerWidget: Row( mainAxisAlignment: @@ -305,7 +345,15 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - if (model.medicalFileList.length != 0) + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) HeaderBodyExpandableNotifier( headerWidget: Row( mainAxisAlignment: @@ -463,7 +511,15 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - if (model.medicalFileList.length != 0) + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) HeaderBodyExpandableNotifier( headerWidget: Row( mainAxisAlignment: @@ -610,7 +666,15 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - if (model.medicalFileList.length != 0) + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) HeaderBodyExpandableNotifier( headerWidget: Row( mainAxisAlignment: diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 405f240b..dffcfdff 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -112,12 +112,15 @@ class _PrescriptionFormWidgetState extends State { dynamic frequency; dynamic duration; dynamic doseTime; + dynamic indication; List strengthList; List routeList; List frequencyList; List durationList; List doseTimeList; + List indicationList; + //PatiantInformtion patient; dynamic _strength; dynamic _selectedBranch; @@ -130,6 +133,7 @@ class _PrescriptionFormWidgetState extends State { frequencyList = List(); durationList = List(); doseTimeList = List(); + indicationList = List(); dynamic regularOrder = {"id": 1, "name": "regular Order"}; dynamic urgentOrder = {"id": 2, "name": "urgent Order"}; @@ -176,6 +180,30 @@ class _PrescriptionFormWidgetState extends State { dynamic doseTime10 = {"id": 10, "name": "While wake"}; dynamic doseTime11 = {"id": 12, "name": "Any Time"}; dynamic doseTime12 = {"id": 21, "name": "Bed Time"}; + dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; + dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"}; + dynamic indication3 = {"id": 547, "name": "Hypertrichosis"}; + dynamic indication4 = {"id": 548, "name": "Mild Dizziness"}; + dynamic indication5 = {"id": 549, "name": "Enlargement of Facial Features"}; + dynamic indication6 = { + "id": 550, + "name": "Phenytoin Hypersensitivity Syndrome" + }; + dynamic indication7 = {"id": 551, "name": "Asterixis"}; + dynamic indication8 = {"id": 552, "name": "Bullous Dermatitis"}; + dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"}; + dynamic indication10 = {"id": 555, "name": "Systemic Lupus Erythematosus"}; + + indicationList.add(indication1); + indicationList.add(indication2); + indicationList.add(indication3); + indicationList.add(indication4); + indicationList.add(indication5); + indicationList.add(indication6); + indicationList.add(indication7); + indicationList.add(indication8); + indicationList.add(indication9); + indicationList.add(indication10); doseTimeList.add(doseTime1); doseTimeList.add(doseTime2); @@ -521,24 +549,46 @@ class _PrescriptionFormWidgetState extends State { ), SizedBox(height: spaceBetweenTextFileds), Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: TranslationBase.of(context) - .indication, - controller: indicationController, - keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, + height: screenSize.height * 0.070, + child: InkWell( + onTap: indicationList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: indicationList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + indicationList = + selectedValue; + _selectedBranch = null; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .indication, + indication != null + ? indication['name'] + : null, + true), + enabled: false, + ), ), ), SizedBox(height: spaceBetweenTextFileds), From 34b7b4564cade3e4ae550a02371b088078675a70 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 6 Jan 2021 16:59:35 +0200 Subject: [PATCH 10/21] assessment work fine now --- lib/models/SOAP/my_selected_assement.dart | 22 +- .../soap_update/update_assessment_page.dart | 607 ++++++++++-------- .../soap_update/update_soap_index.dart | 4 +- 3 files changed, 354 insertions(+), 279 deletions(-) diff --git a/lib/models/SOAP/my_selected_assement.dart b/lib/models/SOAP/my_selected_assement.dart index b5f82379..4d4afc2d 100644 --- a/lib/models/SOAP/my_selected_assement.dart +++ b/lib/models/SOAP/my_selected_assement.dart @@ -6,12 +6,21 @@ class MySelectedAssessment { MasterKeyModel selectedDiagnosisType; String remark; int appointmentId; + int createdBy; + String createdOn; + int doctorID; + String doctorName; + String icdCode10ID; MySelectedAssessment( {this.selectedICD, this.selectedDiagnosisCondition, this.selectedDiagnosisType, - this.remark, this.appointmentId}); + this.remark, this.appointmentId, this.createdBy, + this.createdOn, + this.doctorID, + this.doctorName, + this.icdCode10ID}); MySelectedAssessment.fromJson(Map json) { selectedICD = json['selectedICD'] != null @@ -25,6 +34,11 @@ class MySelectedAssessment { : null; remark = json['remark']; appointmentId = json['appointmentId']; + createdBy = json['createdBy']; + createdOn = json['createdOn']; + doctorID = json['doctorID']; + doctorName = json['doctorName']; + icdCode10ID = json['icdCode10ID']; } Map toJson() { @@ -41,7 +55,11 @@ class MySelectedAssessment { } data['remark'] = this.remark; data['appointmentId'] = this.appointmentId; - + data['createdBy'] = this.createdBy; + data['createdOn'] = this.createdOn; + data['doctorID'] = this.doctorID; + data['doctorName'] = this.doctorName; + data['icdCode10ID'] = this.icdCode10ID; return data; } } diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 79d8878c..1a38de87 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -25,11 +25,13 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class UpdateAssessmentPage extends StatefulWidget { final Function changePageViewIndex; - final MySelectedAssessment mySelectedAssessment; + List mySelectedAssessmentList; final PatiantInformtion patientInfo; - UpdateAssessmentPage( - {Key key, this.changePageViewIndex, this.mySelectedAssessment, this.patientInfo}); + UpdateAssessmentPage({Key key, + this.changePageViewIndex, + this.mySelectedAssessmentList, + this.patientInfo}); @override _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); @@ -43,8 +45,7 @@ class _UpdateAssessmentPageState extends State { return BaseView( onModelReady: (model) async{ - - widget.mySelectedAssessment.appointmentId =widget.patientInfo.appointmentNo; + widget.mySelectedAssessmentList.clear(); GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo.toString(), @@ -60,25 +61,33 @@ class _UpdateAssessmentPageState extends State { if (model.listOfICD10.length == 0) { await model.getMasterLookup(MasterKeysService.ICD10); } + model.patientAssessmentList.forEach((element) { + MasterKeyModel diagnosisType = model.getOneMasterKey( + masterKeys: MasterKeysService.DiagnosisType, + id: element.diagnosisTypeID, + ); + MasterKeyModel selectedICD = model.getOneMasterKey( + masterKeys: MasterKeysService.ICD10, + id: element.icdCode10ID, + ); + MasterKeyModel diagnosisCondition = model.getOneMasterKey( + masterKeys: MasterKeysService.DiagnosisCondition, + id: element.conditionID, + ); + MySelectedAssessment temMySelectedAssessment = MySelectedAssessment( + appointmentId: element.appointmentNo, + remark: element.remarks, + selectedDiagnosisType: diagnosisType, + selectedDiagnosisCondition: diagnosisCondition, + selectedICD: selectedICD, + doctorID: element.doctorID, + doctorName: element.doctorName, + createdBy: element.createdBy, + icdCode10ID: element.icdCode10ID + ); - MasterKeyModel selectedICD = model.getOneMasterKey( - masterKeys: MasterKeysService.ICD10, - id: model.patientAssessmentList[0].icdCode10ID, - ); - widget.mySelectedAssessment.selectedICD= selectedICD; - MasterKeyModel diagnosisCondition = model.getOneMasterKey( - masterKeys: MasterKeysService.DiagnosisCondition, - id: model.patientAssessmentList[0].conditionID, - ); - - widget.mySelectedAssessment.selectedDiagnosisCondition = diagnosisCondition; - MasterKeyModel diagnosisType = model.getOneMasterKey( - masterKeys: MasterKeysService.DiagnosisType, - id: model.patientAssessmentList[0].diagnosisTypeID, - ); - - widget.mySelectedAssessment.selectedDiagnosisType = diagnosisType; - widget.mySelectedAssessment.remark = model.patientAssessmentList[0].remarks; + widget.mySelectedAssessmentList.add(temMySelectedAssessment); + }); } }, builder: (_, model, w) => AppScaffold( @@ -130,7 +139,6 @@ class _UpdateAssessmentPageState extends State { ), Column( children: [ - if(model.patientAssessmentList.isEmpty) Container( margin: EdgeInsets.only(left: 5, right: 5, top: 15), @@ -138,7 +146,8 @@ class _UpdateAssessmentPageState extends State { hintText: TranslationBase.of(context).addAssessment, fontSize: 13.5, onTapTextFields: () { - openAssessmentDialog(context); + openAssessmentDialog(context,isUpdate: false, + model: model); }, readOnly: true, // hintColor: Colors.black, @@ -159,266 +168,239 @@ class _UpdateAssessmentPageState extends State { SizedBox( height: 20, ), - if(widget.mySelectedAssessment != null && - widget.mySelectedAssessment - .appointmentId != - null && widget.mySelectedAssessment - .selectedDiagnosisType != null && - widget.mySelectedAssessment - .selectedDiagnosisCondition != null) - Container( - margin: EdgeInsets.only( - left: 5, right: 5, top: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment - .spaceBetween, - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment - .start, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - "12".toUpperCase(), - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - "DEC".toUpperCase(), - fontSize: 10, - color: Colors.grey, - ), - ], - ) - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Appointment #: ", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - widget.mySelectedAssessment - .appointmentId - .toString(), - fontSize: 10, - color: Colors.grey, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - widget.mySelectedAssessment - .selectedDiagnosisCondition - .nameEn, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Type : ", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - widget.mySelectedAssessment - .selectedDiagnosisType - .nameEn, - fontSize: 10, - color: Colors.grey, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Doc : ", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - "Anas Abdullah", - fontSize: 10, - color: Colors.grey, - ), - ], - ), - SizedBox( - height: 6, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - SizedBox( - height: 6, - ), - Container( - width: MediaQuery.of(context).size.width * 0.5, - child: AppText( - widget.mySelectedAssessment.remark??"", + + Column( + children: widget.mySelectedAssessmentList.map(( + assessment) { + return Container( + margin: EdgeInsets.only( + left: 5, right: 5, top: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment + .spaceBetween, + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment + .start, + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "12".toUpperCase(), + fontWeight: FontWeight + .bold, + fontSize: 16, + ), + AppText( + "DEC".toUpperCase(), fontSize: 10, color: Colors.grey, ), - ), - ], - ), - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - Row( - - children: [ - AppText( - "ICD: ".toUpperCase(), - fontWeight: FontWeight.bold, - fontSize: 16, - ), - Container( - child: AppText( - widget.mySelectedAssessment.selectedICD.code.trim().toUpperCase()??"", + ], + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Appointment #: ", + fontWeight: FontWeight + .bold, + fontSize: 16, + ), + AppText( + assessment + .appointmentId + .toString(), fontSize: 10, color: Colors.grey, ), - ), - ], - ) - ], - ), - Column( - children: [ - InkWell( - onTap: () { - openAssessmentDialog(context); - }, - child: Icon(EvaIcons - .edit2Outline), - ) - ], - ), - ], - ), - ) + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + assessment + .selectedDiagnosisCondition + .nameEn, + fontWeight: FontWeight + .bold, + fontSize: 16, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Type : ", + fontWeight: FontWeight + .bold, + fontSize: 16, + ), + AppText( + assessment + .selectedDiagnosisType + .nameEn, + fontSize: 10, + color: Colors.grey, + ), + ], + ), + if(assessment.doctorName != null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Doc : ", + fontWeight: FontWeight + .bold, + fontSize: 16, + ), + AppText( + assessment.doctorName??'', + fontSize: 10, + color: Colors.grey, + ), + ], + ), + SizedBox( + height: 6, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + SizedBox( + height: 6, + ), + Container( + width: MediaQuery + .of(context) + .size + .width * 0.5, + child: AppText( + assessment.remark ?? "", + fontSize: 10, + color: Colors.grey, + ), + ), + ], + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + Row( + + children: [ + AppText( + "ICD: ".toUpperCase(), + fontWeight: FontWeight + .bold, + fontSize: 16, + ), + Container( + child: AppText( + assessment.selectedICD + .code.trim() + .toUpperCase() ?? + "", + fontSize: 10, + color: Colors.grey, + ), + ), + ], + ) + ], + ), + Column( + children: [ + InkWell( + onTap: () { + openAssessmentDialog( + context, isUpdate: true, + assessment: assessment, + model: model); + }, + child: Icon(EvaIcons + .edit2Outline), + ) + ], + ), + ], + ), + ); + }).toList(),) ], ) ]), isExpand: isAssessmentExpand, ), - DividerWithSpacesAround( - height: 30, - ), - AppButton( - title: TranslationBase - .of(context) - .next, - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - await submitAssessment(model); - }, - ), - SizedBox( - height: 30, - ), - ], + DividerWithSpacesAround( + height: 30, ), - ), + AppButton( + title: TranslationBase + .of(context) + .next, + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + widget.changePageViewIndex(3); + }, + ), + SizedBox( + height: 30, + ), + ], ), - ))); + ), + ), + ))); } - submitAssessment(SOAPViewModel model) async { - if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && - widget.mySelectedAssessment.selectedDiagnosisType != null && widget.mySelectedAssessment.selectedICD !=null ) { - - if(model.patientAssessmentList.isEmpty){ - PostAssessmentRequestModel postAssessmentRequestModel = - new PostAssessmentRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - icdCodeDetails: [ - new IcdCodeDetails( - remarks: widget.mySelectedAssessment.remark, - complexDiagnosis: true, - conditionId: - widget.mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: - widget.mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: widget.mySelectedAssessment.selectedICD.code) - ]); - - await model.postAssessment(postAssessmentRequestModel); - } else { - PatchAssessmentReqModel patchAssessmentReqModel = - PatchAssessmentReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - remarks: widget.mySelectedAssessment.remark, - complexDiagnosis: true, - conditionId: - widget.mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: - widget.mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: widget.mySelectedAssessment.selectedICD.code, - prevIcdCode10ID: model.patientAssessmentList[0].icdCode10ID - ); - - await model.patchAssessment(patchAssessmentReqModel); - } - - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - widget.changePageViewIndex(3); - } - } else { - helpers.showErrorToast(TranslationBase.of(context).requiredMsg); + openAssessmentDialog(BuildContext context, + { + MySelectedAssessment assessment, bool isUpdate, + SOAPViewModel model + }) { + if (assessment == null) { + assessment = MySelectedAssessment( + remark: '', appointmentId: widget.patientInfo.appointmentNo); } - - widget.changePageViewIndex(3); - } - - openAssessmentDialog(BuildContext context) { showModalBottomSheet( backgroundColor: Colors.white, isScrollControlled: true, context: context, builder: (context) { return AddAssessmentDetails( - mySelectedAssessment: widget.mySelectedAssessment, - addSelectedAssessment: () { + mySelectedAssessment: assessment, + patientInfo: widget.patientInfo, + isUpdate: isUpdate, + mySelectedAssessmentList: widget.mySelectedAssessmentList, + addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, + bool isUpdate) async { setState(() { - Navigator.of(context).pop(); + }); }); }); @@ -428,32 +410,34 @@ class _UpdateAssessmentPageState extends State { class AddAssessmentDetails extends StatefulWidget { final MySelectedAssessment mySelectedAssessment; - final Function() addSelectedAssessment; + final List mySelectedAssessmentList; + final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment; final PatiantInformtion patientInfo; - const AddAssessmentDetails( - {Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo}) - : super(key: key); + final bool isUpdate; + + AddAssessmentDetails( + {Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, this.isUpdate = false, this.mySelectedAssessmentList}); + @override _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); } class _AddAssessmentDetailsState extends State { - // MasterKeyModel _selectedDiagnosisCondition; - // MasterKeyModel _selectedDiagnosisType; TextEditingController remarkController = TextEditingController(); TextEditingController appointmentIdController = TextEditingController(); GlobalKey key = new GlobalKey>(); @override Widget build(BuildContext context) { - remarkController.text = widget.mySelectedAssessment.remark??""; - appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString(); + remarkController.text = widget.mySelectedAssessment.remark ?? ""; + appointmentIdController.text = + widget.mySelectedAssessment.appointmentId.toString(); final screenSize = MediaQuery .of(context) .size; InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown,{IconData icon}) { + String selectedText, bool isDropDown, {IconData icon}) { //TODO: make one Input InputDecoration for all return InputDecoration( focusedBorder: OutlineInputBorder( @@ -686,16 +670,34 @@ class _AddAssessmentDetailsState extends State { ), AppButton( title: "Add".toUpperCase(), - onPressed: () { - setState(() { + loading: model.state == ViewState.BusyLocal, + onPressed: () async { widget.mySelectedAssessment.remark = remarkController.text; widget.mySelectedAssessment .appointmentId = int.parse( appointmentIdController.text); - - widget.addSelectedAssessment(); - }); + if (widget.mySelectedAssessment + .selectedDiagnosisCondition != + null && + widget.mySelectedAssessment + .selectedDiagnosisType != + null && + widget.mySelectedAssessment + .selectedICD != null) { + widget.addSelectedAssessment( + widget.mySelectedAssessment, + widget.isUpdate); + await submitAssessment( + isUpdate: widget.isUpdate, + model: model, + mySelectedAssessment: widget + .mySelectedAssessment); + } else { + helpers.showErrorToast(TranslationBase + .of(context) + .requiredMsg); + } }, ), ])), @@ -704,6 +706,61 @@ class _AddAssessmentDetailsState extends State { ))), ); } + + submitAssessment( + {SOAPViewModel model, MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async { + if (isUpdate) { + PatchAssessmentReqModel patchAssessmentReqModel = + PatchAssessmentReqModel( + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + remarks: mySelectedAssessment.remark, + complexDiagnosis: true, + conditionId: + mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: + mySelectedAssessment.selectedDiagnosisType.id, + icdcode10Id: mySelectedAssessment.selectedICD.code, + prevIcdCode10ID: mySelectedAssessment.icdCode10ID + ); + + await model.patchAssessment(patchAssessmentReqModel); + } else { + PostAssessmentRequestModel postAssessmentRequestModel = + new PostAssessmentRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + icdCodeDetails: [ + new IcdCodeDetails( + remarks: mySelectedAssessment.remark, + complexDiagnosis: true, + conditionId: + mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: + mySelectedAssessment.selectedDiagnosisType.id, + icdcode10Id: mySelectedAssessment.selectedICD.code) + ]); + + await model.postAssessment(postAssessmentRequestModel); + } + + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; + + if (!isUpdate) { + widget.mySelectedAssessmentList.add(mySelectedAssessment); + } + Navigator.of(context).pop(); + } + + + // widget.changePageViewIndex(3); + } } diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 3b793d6a..84b8cc61 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -33,7 +33,7 @@ class _UpdateSoapIndexState extends State List myAllergiesList= List(); List myHistoryList = List(); List mySelectedExamination = List(); - MySelectedAssessment mySelectedAssessment = MySelectedAssessment(); + List mySelectedAssessment = List(); changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); } @@ -106,7 +106,7 @@ class _UpdateSoapIndexState extends State ), UpdateAssessmentPage( changePageViewIndex: changePageViewIndex, - mySelectedAssessment: + mySelectedAssessmentList: mySelectedAssessment, patientInfo: patient, ), From caddbdb53cd3307c68a55af9254f30c921f369f0 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 6 Jan 2021 18:33:17 +0200 Subject: [PATCH 11/21] small fixes in progress note --- lib/models/SOAP/GetAssessmentReqModel.dart | 6 +++++- lib/models/SOAP/GetGetProgressNoteReqModel.dart | 7 ++++++- .../SOAP/post_chief_complaint_request_model.dart | 5 +++++ .../SOAP/post_physical_exam_request_model.dart | 2 +- .../SOAP/post_progress_note_request_model.dart | 13 ++++++++++++- .../subjective/update_subjective_page.dart | 2 ++ .../soap_update/update_assessment_page.dart | 2 ++ .../profile/soap_update/update_plan_page.dart | 14 +++++++------- 8 files changed, 40 insertions(+), 11 deletions(-) diff --git a/lib/models/SOAP/GetAssessmentReqModel.dart b/lib/models/SOAP/GetAssessmentReqModel.dart index 1085bf8c..965382b5 100644 --- a/lib/models/SOAP/GetAssessmentReqModel.dart +++ b/lib/models/SOAP/GetAssessmentReqModel.dart @@ -5,7 +5,8 @@ class GetAssessmentReqModel { String from; String to; int clinicID; - int doctorID; + dynamic doctorID; + dynamic editedBy; GetAssessmentReqModel( {this.patientMRN, @@ -14,6 +15,7 @@ class GetAssessmentReqModel { this.from, this.to, this.clinicID, + this.editedBy, this.doctorID}); GetAssessmentReqModel.fromJson(Map json) { @@ -24,6 +26,7 @@ class GetAssessmentReqModel { to = json['To']; clinicID = json['ClinicID']; doctorID = json['DoctorID']; + editedBy = json['EditedBy']; } Map toJson() { @@ -35,6 +38,7 @@ class GetAssessmentReqModel { data['To'] = this.to; data['ClinicID'] = this.clinicID; data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; return data; } } diff --git a/lib/models/SOAP/GetGetProgressNoteReqModel.dart b/lib/models/SOAP/GetGetProgressNoteReqModel.dart index 936c6f65..1da4a8bf 100644 --- a/lib/models/SOAP/GetGetProgressNoteReqModel.dart +++ b/lib/models/SOAP/GetGetProgressNoteReqModel.dart @@ -5,7 +5,8 @@ class GetGetProgressNoteReqModel { String from; String to; int clinicID; - int doctorID; + dynamic doctorID; + dynamic editedBy; GetGetProgressNoteReqModel( {this.patientMRN, @@ -14,6 +15,7 @@ class GetGetProgressNoteReqModel { this.from, this.to, this.clinicID, + this.editedBy, this.doctorID}); GetGetProgressNoteReqModel.fromJson(Map json) { @@ -24,6 +26,8 @@ class GetGetProgressNoteReqModel { to = json['To']; clinicID = json['ClinicID']; doctorID = json['DoctorID']; + editedBy = json['EditedBy']; + } Map toJson() { @@ -35,6 +39,7 @@ class GetGetProgressNoteReqModel { data['To'] = this.to; data['ClinicID'] = this.clinicID; data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; return data; } } diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart index ed58e58a..f1e9c2b4 100644 --- a/lib/models/SOAP/post_chief_complaint_request_model.dart +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -9,6 +9,8 @@ class PostChiefComplaintRequestModel { bool isLactation; int numberOfWeeks; dynamic doctorID; + dynamic editedBy; + PostChiefComplaintRequestModel( {this.appointmentNo, @@ -20,6 +22,7 @@ class PostChiefComplaintRequestModel { this.ispregnant, this.isLactation, this.doctorID, + this.editedBy, this.numberOfWeeks}); PostChiefComplaintRequestModel.fromJson(Map json) { @@ -33,6 +36,7 @@ class PostChiefComplaintRequestModel { isLactation = json['isLactation']; numberOfWeeks = json['numberOfWeeks']; doctorID = json['DoctorID']; + editedBy = json['EditedBy']; } Map toJson() { @@ -47,6 +51,7 @@ class PostChiefComplaintRequestModel { data['isLactation'] = this.isLactation; data['numberOfWeeks'] = this.numberOfWeeks; data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; return data; } diff --git a/lib/models/SOAP/post_physical_exam_request_model.dart b/lib/models/SOAP/post_physical_exam_request_model.dart index adc8daf7..46a104f1 100644 --- a/lib/models/SOAP/post_physical_exam_request_model.dart +++ b/lib/models/SOAP/post_physical_exam_request_model.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class PostPhysicalExamRequestModel { List listHisProgNotePhysicalExaminationVM; diff --git a/lib/models/SOAP/post_progress_note_request_model.dart b/lib/models/SOAP/post_progress_note_request_model.dart index 069f4dbf..2925819d 100644 --- a/lib/models/SOAP/post_progress_note_request_model.dart +++ b/lib/models/SOAP/post_progress_note_request_model.dart @@ -3,15 +3,24 @@ class PostProgressNoteRequestModel { int episodeId; int patientMRN; String planNote; + dynamic doctorID; + dynamic editedBy; PostProgressNoteRequestModel( - {this.appointmentNo, this.episodeId, this.patientMRN, this.planNote}); + {this.appointmentNo, + this.episodeId, + this.patientMRN, + this.planNote, + this.doctorID, + this.editedBy}); PostProgressNoteRequestModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; episodeId = json['EpisodeID']; patientMRN = json['PatientMRN']; planNote = json['PlanNote']; + doctorID = json['DoctorID']; + editedBy = json['EditedBy']; } Map toJson() { @@ -20,6 +29,8 @@ class PostProgressNoteRequestModel { data['EpisodeID'] = this.episodeId; data['PatientMRN'] = this.patientMRN; data['PlanNote'] = this.planNote; + data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; return data; } } diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 4370df4f..de5d2d68 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -554,9 +554,11 @@ class _UpdateSubjectivePageState extends State { isLactation: false, ispregnant: false, doctorID: '', + numberOfWeeks: 0); if (model.patientChiefComplaintList.isEmpty) { // TODO: make it postChiefComplaint after it start to work + postChiefComplaintRequestModel.editedBy=''; await model.postChiefComplaint(postChiefComplaintRequestModel); } else { await model.patchChiefComplaint(postChiefComplaintRequestModel); diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 1a38de87..10bfc120 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -49,6 +49,8 @@ class _UpdateAssessmentPageState extends State { GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: '', appointmentNo: widget.patientInfo.appointmentNo); await model.getPatientAssessment(getAssessmentReqModel); if(model.patientAssessmentList.isNotEmpty){ diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index 9c851cd5..a91447d6 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -59,7 +59,7 @@ class _UpdatePlanPageState extends State { GetGetProgressNoteReqModel( appointmentNo: widget.patientInfo.appointmentNo, patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString()); + episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: ''); await model.getPatientProgressNote(getGetProgressNoteReqModel); if (model.patientProgressNoteList.isNotEmpty) { @@ -285,15 +285,15 @@ class _UpdatePlanPageState extends State { patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, - planNote: progressNoteController.text); + planNote: progressNoteController.text, doctorID: '', editedBy: ''); - if(model.patientProgressNoteList.isEmpty){ + // if(model.patientProgressNoteList.isEmpty){ await model.postProgressNote(postProgressNoteRequestModel); - }else { - await model.patchProgressNote(postProgressNoteRequestModel); - - } + // }else { + // await model.patchProgressNote(postProgressNoteRequestModel); + // + // } if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); From bcbd091daed9e0dc6c0b7ae152e440d07f46d452 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 6 Jan 2021 18:59:20 +0200 Subject: [PATCH 12/21] ss --- lib/core/service/prescription_service.dart | 11 ++--- .../prescription/add_prescription_form.dart | 8 +-- .../prescription/prescription_screen.dart | 49 ++++++++++++------- 3 files changed, 41 insertions(+), 27 deletions(-) diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index aa881cbb..25aa98ea 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -15,12 +15,11 @@ class PrescriptionService extends BaseService { List specialityList = []; PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel( - patientMRN: 3120877, - vidaAuthTokenID: - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiNzNiNmUyZDctMjA0ZC00NzAyLTkxMDYtODE3MzI3OTZkYzI5IiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMjgwNCIsIk5hbWUiOiJNVUhBTU1BRCBBWkFNIiwiRW1wbG95ZWVJZCI6IjE0ODUiLCJGYWNpbGl0eUdyb3VwSWQiOiIwMTAyNjYiLCJGYWNpbGl0eUlkIjoiMTUiLCJQaGFyYW1jeUZhY2lsaXR5SWQiOiI1NSIsIklTX1BIQVJNQUNZX0NPTk5FQ1RFRCI6IlRydWUiLCJEb2N0b3JJZCI6IjE0ODUiLCJTRVNTSU9OSUQiOiIyMTU3NjIwOSIsIkNsaW5pY0lkIjoiMyIsInJvbGUiOlsiU0VDVVJJVFkgQURNSU5JU1RSQVRPUlMiLCJTRVRVUCBBRE1JTklTVFJBVE9SUyIsIkNFTydTIiwiRVhFQ1VUSVZFIERJUkVDVE9SUyIsIk1BTkFHRVJTIiwiU1VQRVJWSVNPUlMiLCJDTElFTlQgU0VSVklDRVMgQ09PUkRJTkFUT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIFNVUEVSVklTT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIE1BTkdFUlMiLCJIRUFEIE5VUlNFUyIsIkRPQ1RPUlMiLCJDSElFRiBPRiBNRURJQ0FMIFNUQUZGUyIsIkJJTy1NRURJQ0FMIFRFQ0hOSUNJQU5TIiwiQklPLU1FRElDQUwgRU5HSU5FRVJTIiwiQklPLU1FRElDQUwgREVQQVJUTUVOVCBIRUFEUyIsIklUIEhFTFAgREVTSyIsIkFETUlOSVNUUkFUT1JTIiwiTEFCIEFETUlOSVNUUkFUT1IiLCJMQUIgVEVDSE5JQ0lBTiIsIkJVU0lORVNTIE9GRklDRSBTVEFGRiIsIkZJTkFOQ0UgQUNDT1VOVEFOVFMiLCJQSEFSTUFDWSBTVEFGRiIsIkFDQ09VTlRTIFNUQUZGIiwiTEFCIFJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiSU5QQVRJRU5UIEJJTExJTkcgU1VQRVJWSVNPUiIsIkxEUi1PUiBOVVJTRVMiLCJBRE1JU1NJT04gU1RBRkYiLCJIRUxQIERFU0sgQURNSU4iLCJBUFBST1ZBTCBTVEFGRiIsIklOUEFUSUVOVCBCSUxMSU5HIENPT1JESU5BVE9SIiwiQklMTElORyBTVEFGRiIsIkNPTlNFTlQgIiwiQ29uc2VudCAtIERlbnRhbCIsIldFQkVNUiJdLCJuYmYiOjE2MDgyMzY2MjAsImV4cCI6MTYwOTEwMDYyMCwiaWF0IjoxNjA4MjM2NjIwfQ.z4Lh0dCRr9GWXvaTo7x5GPV7R5z8ONyh3-0uk3PXMu8", - ); + //patientMRN: 3120877, + + ); SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel( - search: ["panadol"], + search: ["Acetaminophen"], vidaAuthTokenID: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio", ); @@ -29,7 +28,7 @@ class PrescriptionService extends BaseService { PostPrescriptionReqModel(); Future getPrescription({int mrn}) async { - _prescriptionReqModel = PrescriptionReqModel(patientMRN: 3120877); + _prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn); hasError = false; _prescriptionList.clear(); await baseAppClient.post(GET_PRESCRIPTION_LIST, diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index dffcfdff..18208c7c 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -51,10 +51,10 @@ postProcedure( new PostPrescriptionReqModel(); List sss = List(); - postProcedureReqModel.appointmentNo = 2016055159; - postProcedureReqModel.clinicID = 17; - postProcedureReqModel.episodeID = 200012330; - postProcedureReqModel.patientMRN = 3120877; + postProcedureReqModel.appointmentNo = patient.appointmentNo; + postProcedureReqModel.clinicID = patient.clinicId; + postProcedureReqModel.episodeID = patient.episodeNo; + postProcedureReqModel.patientMRN = patient.patientMRN; postProcedureReqModel.vidaAuthTokenID = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY"; sss.add(PrescriptionRequestModel( diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 142f3a98..aa2de753 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -453,21 +453,30 @@ class _NewPrescriptionScreenState extends State { .edit), onTap: () { updatePrescriptionForm( - context, - model - .prescriptionList[ - 0] - .entityList[ - index] - .medicationName, - model - .prescriptionList[ - 0] - .entityList[ - index] - .medicineCode, - model, - ); + patient: + patient, + drugId: model + .prescriptionList[ + 0] + .entityList[ + index] + .medicineCode, + drugName: model + .prescriptionList[ + 0] + .entityList[ + index] + .medicationName, + remarks: model + .prescriptionList[ + 0] + .entityList[ + index] + .remarks, + model: + model, + context: + context); //model.postPrescription(); }, ), @@ -563,7 +572,12 @@ class _NewPrescriptionScreenState extends State { } void updatePrescriptionForm( - context, String drugName, int drugId, PrescriptionViewModel model) { + {context, + String drugName, + int drugId, + String remarks, + PrescriptionViewModel model, + PatiantInformtion patient}) { TextEditingController remarksController = TextEditingController(); TextEditingController doseController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); @@ -635,6 +649,7 @@ class _NewPrescriptionScreenState extends State { SizedBox( height: 12.0, ), + AppText('Remarks'), Container( decoration: BoxDecoration( borderRadius: @@ -642,7 +657,7 @@ class _NewPrescriptionScreenState extends State { border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), child: TextFields( - hintText: 'Remarks', + hintText: remarks, controller: remarksController, maxLines: 7, minLines: 4, From fd2a86dca403ef62f7432da3104027f44ef825bf Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 7 Jan 2021 11:21:43 +0200 Subject: [PATCH 13/21] some changes in patientArrivalList And make action when click on vitalSign widget inside pendingReferral --- lib/config/localized_values.dart | 4 ++++ lib/core/service/base/base_service.dart | 5 +++-- lib/core/viewModel/patient-referral-viewmodel.dart | 2 +- .../viewModel/patient-vital-sign-viewmodel.dart | 3 --- .../referral/my-referral-detail-screen.dart | 14 ++++++++++++-- lib/util/translations_delegate_base.dart | 1 + 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 3048a39d..672796a6 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -536,4 +536,8 @@ const Map> localizedValues = { 'en': "There is no Chief Complaint", 'ar': "ليس هناك شكوى رئيس" }, + 'patientNoDetailErrMsg': { + 'en': "There is no detail for this patient", + 'ar': "لا توجد تفاصيل لهذا المريض" + }, }; diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index 32edf34f..6f4c5d1e 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; @@ -12,7 +13,7 @@ class BaseService { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DoctorProfileModel doctorProfile; - List patientArrivalList = []; + List patientArrivalList = []; //TODO add the user login model when we need it Future getDoctorProfile() async { @@ -50,7 +51,7 @@ class BaseService { patientArrivalList.clear(); response['patientArrivalList']['entityList'].forEach((v) { - PatientArrivalEntity item = PatientArrivalEntity.fromJson(v); + PatiantInformtion item = PatiantInformtion.fromJson(v); patientArrivalList.add(item); }); }, diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 35747c37..028eac0d 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -27,7 +27,7 @@ class PatientReferralViewModel extends BaseViewModel { List get pendingReferral => _referralPatientService.pendingReferralList; - List get patientArrivalList => + List get patientArrivalList => _referralPatientService.patientArrivalList; Future getMasterLookup(MasterKeysService masterKeys) async { diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 4f2e7e28..5674030c 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -11,9 +11,6 @@ import '../../locator.dart'; class VitalSignsViewModel extends BaseViewModel { VitalSignsService _vitalSignService = locator(); - List get patientArrivalList => - _vitalSignService.patientArrivalList; - VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns; Future getPatientVitalSign(PatiantInformtion patient) async { diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 1019ede4..77b17e3d 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../../../../routes.dart'; @@ -39,7 +40,7 @@ class MyReferralDetailScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).referPatient, - body: Column( + body: model.patientArrivalList != null ? Column( children: [ Expanded( child: SingleChildScrollView( @@ -110,7 +111,7 @@ class MyReferralDetailScreen extends StatelessWidget { icon: 'lab.png'), PatientProfileButton( key: key, - // patient: patient, + patient: model.patientArrivalList[0], route: PATIENT_VITAL_SIGN, nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, @@ -160,6 +161,15 @@ class MyReferralDetailScreen extends StatelessWidget { ), ), ], + ) : Container( + child: Center( + child: AppText( + TranslationBase.of(context).patientNoDetailErrMsg, + color: HexColor("#B8382B"), + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), ), ), ); diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index b167b48e..8ee0dc7d 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -553,6 +553,7 @@ class TranslationBase { String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode]; String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode]; String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; + String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 4f1a892be4cfb7c6918481bea998ffc3df0bb143 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 7 Jan 2021 14:37:26 +0200 Subject: [PATCH 14/21] first step form create episode --- lib/config/config.dart | 3 + lib/config/localized_values.dart | 2 +- lib/core/service/SOAP_service.dart | 13 ++ lib/core/viewModel/SOAP_view_model.dart | 13 ++ lib/models/SOAP/PostEpisodeReqModel.dart | 28 +++ lib/screens/dashboard_screen.dart | 47 +++++ lib/screens/patients/patients_screen.dart | 9 +- .../profile/patient-page-header-widget.dart | 166 ++++++++++-------- .../profile/profile_medical_info_widget.dart | 71 +++++--- 9 files changed, 254 insertions(+), 98 deletions(-) create mode 100644 lib/models/SOAP/PostEpisodeReqModel.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index e3163bb2..e8e0f6ce 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -132,6 +132,9 @@ const GET_PATIENT_ARRIVAL_LIST = const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; + +const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode'; + const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; const POST_CHIEF_COMPLAINT = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4ad53ebe..e96daef0 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -295,7 +295,7 @@ const Map> localizedValues = { }, 'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'}, 'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'}, - "empty-message": {"en": "Please enter message", "ar": "يرجى ادخال الموضوع"}, + "empty-message": {"en": "Please enter this field", "ar": "يرجى ادخال هذا الحقل"}, 'no-sickleve-applied': { 'en': "No sick leave applied", 'ar': 'لم تطبق إجازة مرضية' diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index d1fff03b..9707dc53 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; @@ -48,6 +49,18 @@ class SOAPService extends LookupService { ); } + Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async { + hasError = false; + + await baseAppClient.post(POST_EPISODE, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: postEpisodeReqModel.toJson()); + } + Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { hasError = false; diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index fff7a239..31764c45 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; @@ -99,6 +100,17 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } + + Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async { + setState(ViewState.BusyLocal); + await _SOAPService.postEpisode(postEpisodeReqModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postAllergy(postAllergyRequestModel); @@ -222,6 +234,7 @@ class SOAPViewModel extends BaseViewModel { Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async { + setState(ViewState.Busy); await _SOAPService.getPatientAllergy(generalGetReqForSOAP); if (_SOAPService.hasError) { diff --git a/lib/models/SOAP/PostEpisodeReqModel.dart b/lib/models/SOAP/PostEpisodeReqModel.dart new file mode 100644 index 00000000..6d3ee45a --- /dev/null +++ b/lib/models/SOAP/PostEpisodeReqModel.dart @@ -0,0 +1,28 @@ +class PostEpisodeReqModel { + int appointmentNo; + int patientMRN; + int doctorID; + String vidaAuthTokenID; + + PostEpisodeReqModel( + {this.appointmentNo, + this.patientMRN, + this.doctorID, + this.vidaAuthTokenID}); + + PostEpisodeReqModel.fromJson(Map json) { + appointmentNo = json['AppointmentNo']; + patientMRN = json['PatientMRN']; + doctorID = json['DoctorID']; + vidaAuthTokenID = json['VidaAuthTokenID']; + } + + Map toJson() { + final Map data = new Map(); + data['AppointmentNo'] = this.appointmentNo; + data['PatientMRN'] = this.patientMRN; + data['DoctorID'] = this.doctorID; + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + return data; + } +} diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 20f22382..dd07f6d7 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -9,9 +9,11 @@ import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -77,6 +79,25 @@ class _DashboardScreenState extends State { if (!currentFocus.hasPrimaryFocus) { currentFocus.unfocus(); } + + var _patientSearchFormValues = PatientModel( + FirstName: "0", + MiddleName: "0", + LastName: "0", + PatientMobileNumber: "0", + PatientIdentificationID: "0", + PatientID: 0, + From: DateUtils.convertDateToFormat(DateTime. now(), 'yyyy-MM-dd').toString(), + To: DateUtils.convertDateToFormat(DateTime. now(), 'yyyy-MM-dd').toString(), + LanguageID: 2, + stamp: "2020-03-02T13:56:39.170Z", + IPAdress: "11.11.11.11", + VersionID: 1.2, + Channel: 9, + TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", + SessionID: "5G0yXn0Jnq", + IsLoginForDoctorApp: true, + PatientOutSA: false); return BaseView( onModelReady: (model) => model.getDashboard(), builder: (_, model, w) => AppScaffold( @@ -957,6 +978,8 @@ class _DashboardScreenState extends State { height: 20, ), Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, children: [ DashboardItem( child: Column( @@ -984,6 +1007,30 @@ class _DashboardScreenState extends State { ), ); }, + ), + SizedBox(width: 8,), + DashboardItem( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Icon( + DoctorApp.patient, + size: 50, + ), + AppText( + TranslationBase.of(context).arrived, + color: Colors.black, + textAlign: TextAlign.center, + ) + ], + ), + hasBorder: true, + onTap: () { + Navigator.of(context).pushNamed(PATIENTS, arguments: { + "patientSearchForm": _patientSearchFormValues, + "selectedType": "7" + }); + }, ) ], ), diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 602bd180..0c2a53d4 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -274,7 +274,8 @@ class _PatientsScreenState extends State { .then((res) { setState(() { _isLoading = false; - if (res['MessageStatus'] == 1) { + + if (res != null && res['MessageStatus'] == 1) { if (val2 == 7) { if (res[SERVICES_PATIANT2[val2]] == null) { _isError = true; @@ -282,6 +283,9 @@ class _PatientsScreenState extends State { this.error = error.toString(); } else { var localList = []; + if(res["patientArrivalList"]["entityList"] == null){ + res["patientArrivalList"]["entityList"] = []; + } res["patientArrivalList"]["entityList"].forEach((v) { Map mergedPatient = { ...v, @@ -289,7 +293,6 @@ class _PatientsScreenState extends State { }; localList.add(mergedPatient); }); - print(localList.toString()); lItems = localList; } } else { @@ -301,7 +304,7 @@ class _PatientsScreenState extends State { _isError = false; } else { _isError = true; - error = res['ErrorEndUserMessage'] ?? res['ErrorMessage']; + error = model.error; //res['ErrorEndUserMessage'] ?? res['ErrorMessage']; } }); }).catchError((error) { diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index 3e870be5..f4de0615 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -1,92 +1,112 @@ +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; 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/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; class PatientPageHeaderWidget extends StatelessWidget { final PatiantInformtion patient; - + String allergiesString=''; PatientPageHeaderWidget(this.patient); @override Widget build(BuildContext context) { - return Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - AvatarWidget( - Icon( - patient.genderDescription == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), - ), - SizedBox( - width: 20, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 5, - ), - AppText( - patient.firstName + ' ' + patient.lastName, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).age, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 20, + return BaseView( + onModelReady: (model) async { + GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( + patientMRN: patient.patientMRN, + episodeId: patient.episodeNo, + appointmentNo: patient.appointmentNo, + doctorID: '', + editedBy: ''); + await model.getPatientAllergy(generalGetReqForSOAP); + model.patientAllergiesList.forEach((element) { + allergiesString += element.allergyDiseaseName+' , '; + }); + }, + builder: (_, model, w) => Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + AvatarWidget( + Icon( + patient.genderDescription == "Male" + ? DoctorApp.male + : DoctorApp.female_icon, + size: 70, + color: Colors.white, ), - AppText( - patient.age.toString(), - color: Colors.black, - fontWeight: FontWeight.normal, + ), + SizedBox( + width: 20, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 5, + ), + AppText( + patient.firstName + ' ' + patient.lastName, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).age, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + SizedBox( + width: 20, + ), + AppText( + patient.age.toString(), + color: Colors.black, + fontWeight: FontWeight.normal, + ), + ], + ), + NetworkBaseView( + baseViewModel: model, + child: AppText( + "ALLERGIC TO: $allergiesString", + color: Color(0xFFB9382C), + fontWeight: FontWeight.bold, + ), + ), + ], ), - ], - ), - AppText( - "ALLERGIC TO: FOOD, ASPIRIN, EGG WHITE", - color: Color(0xFFB9382C), - fontWeight: FontWeight.bold, - ), - ], + ) + ], + ), + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + width: 20, ), - ) - ], - ), - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - width: 20, - ), - ], - ), - ); + ], + ), + )); } } diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 8860a7dc..34433fa7 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -1,7 +1,13 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -22,26 +28,42 @@ class ProfileMedicalInfoWidget extends StatelessWidget { String patientType; @override Widget build(BuildContext context) { - return SliverGrid.count( + return BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => SliverGrid.count( crossAxisSpacing: 10, mainAxisSpacing: 20, crossAxisCount: 2, childAspectRatio: 1.5, children: [ + if (int.parse(patientType) == 7) + PatientProfileButton( + key: key, + patient: patient, + isDisable: patient.episodeNo != 0 ? true : false, + nameLine1: TranslationBase.of(context).createNew, + nameLine2: TranslationBase.of(context).episode, + route: CREATE_EPISODE, + onTap: () async { + PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( + appointmentNo: patient.appointmentNo, + patientMRN: patient.patientMRN); + await model.postEpisode(postEpisodeReqModel); + }, + isLoading: model.state == ViewState.BusyLocal, + icon: 'create-episod.png' + ), if(int.parse(patientType) ==7) PatientProfileButton( key: key, patient: patient, - nameLine1: TranslationBase.of(context).createNew, - nameLine2: TranslationBase.of(context).episode, - route: CREATE_EPISODE, - icon: 'create-episod.png'), - if(int.parse(patientType) ==7) - PatientProfileButton( - key: key, - patient: patient, - nameLine1: TranslationBase.of(context).update, - nameLine2: TranslationBase.of(context).episode, + isDisable: patient.episodeNo == 0 ? true : false, + nameLine1: TranslationBase + .of(context) + .update, + nameLine2: TranslationBase + .of(context) + .episode, route: UPDATE_EPISODE, icon: 'modilfy-episode.png'), if(selectedPatientType == 6 || selectedPatientType == 7) @@ -146,7 +168,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { .of(context) .ucaf, icon: 'lab.png'), - ]); + ],),); } } @@ -206,20 +228,25 @@ class PatientProfileButton extends StatelessWidget { final dynamic route; final PatiantInformtion patient; final String url = "assets/images/"; - PatientProfileButton( - {Key key, - this.patient, - this.nameLine1, - this.nameLine2, - this.icon, - this.route}) + final bool isDisable; + final bool isLoading; + final Function onTap; + + + PatientProfileButton({Key key, + this.patient, + this.nameLine1, + this.nameLine2, + this.icon, + this.route, this.isDisable = false, this.onTap, this.isLoading = false}) : super(key: key); + @override Widget build(BuildContext context) { return new Container( margin: new EdgeInsets.symmetric(horizontal: 4.0), child: InkWell( - onTap: () { + onTap: isDisable?null:onTap != null ? onTap : () { navigator(context, this.route); }, child: Column(children: [ @@ -243,6 +270,8 @@ class PatientProfileButton extends StatelessWidget { textAlign: TextAlign.left, fontSize: SizeConfig.textMultiplier * 2, ), + if(isLoading) + DrAppCircularProgressIndeicator() ], ), ), @@ -261,7 +290,7 @@ class PatientProfileButton extends StatelessWidget { ), decoration: BoxDecoration( // border: Border.all(), - color: Colors.white, + color: isDisable ? Colors.grey.withOpacity(0.4) : Colors.white, borderRadius: BorderRadius.all(Radius.circular(10)), border: Border.fromBorderSide(BorderSide( color: Color(0xffBBBBBB), From 5253c28469338cf777cdc5bfbb8a9f197e5c1d42 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Fri, 8 Jan 2021 00:43:45 +0200 Subject: [PATCH 15/21] prescription form fix --- .../medical-file/medical_file_details.dart | 1336 +++++++++-------- .../prescription/add_prescription_form.dart | 938 ++++++------ .../prescription/prescription_screen.dart | 25 +- 3 files changed, 1181 insertions(+), 1118 deletions(-) diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 3823a88e..e11201e5 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -124,79 +124,142 @@ class _MedicalFileDetailsState extends State { thickness: 1.0, color: Colors.grey, ), - Padding( - padding: EdgeInsets.all(10.0), - child: Container( - child: Column( - children: [ - Row( - children: [ - AppText( - 'Visit Date : ', - fontWeight: FontWeight.w700, - ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .appointmentDate - .toString()), - SizedBox(width: 35.0), - // AppText( - // 'Appt Date : ', - // fontWeight: FontWeight.w700, - // ), - // AppText( - // '23/12/2020', - // ), - ], - ), - Row( - children: [ - AppText( - 'Doctor : '.toUpperCase(), - fontWeight: FontWeight.w700, - ), - if (model.medicalFileList.length != 0 && - model + model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0 + ? Padding( + padding: EdgeInsets.all(10.0), + child: Container( + child: Column( + children: [ + Row( + children: [ + AppText( + 'Visit Date : ', + fontWeight: FontWeight.w700, + ), + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + AppText(model .medicalFileList[0] .entityList[0] .timelines[encounterNumber] .timeLineEvents[0] - .consulations - .length != - 0) - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .doctorName - .toUpperCase(), - fontWeight: FontWeight.w700, + .consulations[0] + .appointmentDate + .toString()), + SizedBox(width: 35.0), + // AppText( + // 'Appt Date : ', + // fontWeight: FontWeight.w700, + // ), + // AppText( + // '23/12/2020', + // ), + ], ), - ], - ), - if (model.medicalFileList.length != 0) - Row( - children: [ - AppText( - 'Clinic : ', - fontWeight: FontWeight.w700, + Row( + children: [ + AppText( + 'Doctor : '.toUpperCase(), + fontWeight: FontWeight.w700, + ), + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .doctorName + .toUpperCase(), + fontWeight: FontWeight.w700, + ), + ], + ), + if (model.medicalFileList.length != 0) + Row( + children: [ + AppText( + 'Clinic : ', + fontWeight: FontWeight.w700, + ), + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .clinicName, + ), + ], + ), + Row( + children: [ + AppText( + 'Episode Number : ', + fontWeight: FontWeight.w700, + ), + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .episodeID + .toString(), + ), + ], ), + SizedBox(height: 15.0), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey.shade400, + ), + SizedBox(height: 25.0), if (model.medicalFileList.length != 0 && model .medicalFileList[0] @@ -206,111 +269,237 @@ class _MedicalFileDetailsState extends State { .consulations .length != 0) - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .clinicName, + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts( + 'History of present illness' + .toUpperCase(), + variant: isHistoryExpand + ? "bodyText" + : '', + bold: isHistoryExpand + ? true + : false, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isHistoryExpand = + !isHistoryExpand; + }); + }, + child: Icon(isHistoryExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: ListView.builder( + //physics: , + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstMedicalHistory + .length, + itemBuilder: + (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Row( + children: [ + Expanded( + child: AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstMedicalHistory[ + index] + .history + .trim(), + ), + ), + SizedBox(width: 35.0), + ], + ), + ], + ), + ), + ); + }), + isExpand: isHistoryExpand, ), - ], - ), - Row( - children: [ - AppText( - 'Episode Number : ', - fontWeight: FontWeight.w700, - ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .episodeID - .toString(), + SizedBox( + height: 30, ), - ], - ), - SizedBox(height: 15.0), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey.shade400, - ), - SizedBox(height: 25.0), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts( - 'History of present illness' - .toUpperCase(), - variant: - isHistoryExpand ? "bodyText" : '', - bold: isHistoryExpand ? true : false, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isHistoryExpand = !isHistoryExpand; - }); - }, - child: Icon(isHistoryExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: ListView.builder( - //physics: , - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstMedicalHistory - .length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( children: [ - Row( - children: [ - Expanded( - child: AppText( + Texts('assessment'.toUpperCase(), + variant: isAssessmentExpand + ? "bodyText" + : '', + bold: isAssessmentExpand + ? true + : false, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isAssessmentExpand = + !isAssessmentExpand; + }); + }, + child: Icon(isAssessmentExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: ListView.builder( + //physics: , + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments + .length, + itemBuilder: + (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Row( + children: [ + AppText( + 'ICD', + fontWeight: + FontWeight.w700, + ), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments[ + index] + .iCD10 + .trim(), + ), + SizedBox(width: 35.0), + AppText( + 'Condition: ', + fontWeight: + FontWeight.w700, + ), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments[ + index] + .condition + .trim(), + ), + ], + ), + Row( + children: [ + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments[ + index] + .description, + fontWeight: + FontWeight.w700, + ) + ], + ), + Row( + children: [ + AppText( + 'Type: ', + fontWeight: + FontWeight.w700, + ), + AppText(model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments[index] + .type), + ], + ), + SizedBox( + height: 15.0, + ), + AppText( model .medicalFileList[0] .entityList[0] @@ -318,494 +507,355 @@ class _MedicalFileDetailsState extends State { encounterNumber] .timeLineEvents[0] .consulations[0] - .lstMedicalHistory[ - index] - .history + .lstAssessments[index] + .remarks .trim(), ), - ), - SizedBox(width: 35.0), - ], + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, + ), + ], + ), ), - ], - ), - ), - ); - }), - isExpand: isHistoryExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - height: 30, - ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts('assessment'.toUpperCase(), - variant: isAssessmentExpand - ? "bodyText" - : '', - bold: - isAssessmentExpand ? true : false, - color: Colors.black), - ], + ); + }), + isExpand: isAssessmentExpand, ), - InkWell( - onTap: () { - setState(() { - isAssessmentExpand = - !isAssessmentExpand; - }); - }, - child: Icon(isAssessmentExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: ListView.builder( - //physics: , - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments - .length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( children: [ - Row( - children: [ - AppText( - 'ICD', - fontWeight: FontWeight.w700, - ), - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[index] - .iCD10 - .trim(), - ), - SizedBox(width: 35.0), - AppText( - 'Condition: ', - fontWeight: FontWeight.w700, - ), - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[index] - .condition - .trim(), - ), - ], - ), - Row( - children: [ - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[index] - .description, - fontWeight: FontWeight.w700, - ) - ], - ), - Row( - children: [ - AppText( - 'Type: ', - fontWeight: FontWeight.w700, - ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[index] - .type), - ], - ), - SizedBox( - height: 15.0, - ), - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[index] - .remarks - .trim(), - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, - ), + Texts( + 'Test / procedures' + .toUpperCase(), + variant: isProcedureExpand + ? "bodyText" + : '', + bold: isProcedureExpand + ? true + : false, + color: Colors.black), ], ), - ), - ); - }), - isExpand: isAssessmentExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - height: 30, - ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts('Test / procedures'.toUpperCase(), - variant: isProcedureExpand - ? "bodyText" - : '', - bold: - isProcedureExpand ? true : false, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isProcedureExpand = - !isProcedureExpand; - }); - }, - child: Icon(isProcedureExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: ListView.builder( - //physics: , - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure - .length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Row( - children: [ - AppText( - 'Procedure ID: ', - fontWeight: FontWeight.w700, - ), - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure[index] - .procedureId - .trim(), - ), - SizedBox(width: 35.0), - AppText( - 'Order Date: ', - fontWeight: FontWeight.w700, - ), - // AppText( - // model - // .medicalFileList[0] - // .entityList[0] - // .timelines[0] - // .timeLineEvents[0] - // .consulations[0] - // .lstProcedure[index] - // .orderDate - // .trim(), - // ), - ], - ), - Row( - children: [ - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure[index] - .procName, - fontWeight: FontWeight.w700, - ) - ], - ), - Row( - children: [ - AppText( - 'CPT Code : ', - fontWeight: FontWeight.w700, - ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure[index] - .patientID - .toString()), - ], - ), - SizedBox( - height: 15.0, - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, + InkWell( + onTap: () { + setState(() { + isProcedureExpand = + !isProcedureExpand; + }); + }, + child: Icon(isProcedureExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: ListView.builder( + //physics: , + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstProcedure + .length, + itemBuilder: + (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Row( + children: [ + AppText( + 'Procedure ID: ', + fontWeight: + FontWeight.w700, + ), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstProcedure[index] + .procedureId + .trim(), + ), + SizedBox(width: 35.0), + AppText( + 'Order Date: ', + fontWeight: + FontWeight.w700, + ), + // AppText( + // model + // .medicalFileList[0] + // .entityList[0] + // .timelines[0] + // .timeLineEvents[0] + // .consulations[0] + // .lstProcedure[index] + // .orderDate + // .trim(), + // ), + ], + ), + Row( + children: [ + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstProcedure[index] + .procName, + fontWeight: + FontWeight.w700, + ) + ], + ), + Row( + children: [ + AppText( + 'CPT Code : ', + fontWeight: + FontWeight.w700, + ), + AppText(model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstProcedure[index] + .patientID + .toString()), + ], + ), + SizedBox( + height: 15.0, + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, + ), + ], + ), ), - ], - ), - ), - ); - }), - isExpand: isProcedureExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - height: 30, - ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts('physical exam'.toUpperCase(), - variant: - isPhysicalExam ? "bodyText" : '', - bold: isPhysicalExam ? true : false, - color: Colors.black), - ], + ); + }), + isExpand: isProcedureExpand, ), - InkWell( - onTap: () { - setState(() { - isPhysicalExam = !isPhysicalExam; - }); - }, - child: Icon(isPhysicalExam - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: ListView.builder( - //physics: , - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam - .length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( children: [ - Row( - children: [ - AppText( - 'Exam Type: ', - fontWeight: FontWeight.w700, - ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[index] - .examType), - ], - ), - Row( - children: [ - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[index] - .examDesc, - fontWeight: FontWeight.w700, - ) - ], - ), - Row( - children: [ - AppText( - 'Abnormal: ', - fontWeight: FontWeight.w700, - ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[index] - .abnormal), - ], - ), - SizedBox( - height: 15.0, - ), - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[index] - .remarks, - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, - ), + Texts('physical exam'.toUpperCase(), + variant: isPhysicalExam + ? "bodyText" + : '', + bold: isPhysicalExam + ? true + : false, + color: Colors.black), ], ), - ), - ); - }), - isExpand: isPhysicalExam, + InkWell( + onTap: () { + setState(() { + isPhysicalExam = + !isPhysicalExam; + }); + }, + child: Icon(isPhysicalExam + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: ListView.builder( + //physics: , + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam + .length, + itemBuilder: + (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + children: [ + Row( + children: [ + AppText( + 'Exam Type: ', + fontWeight: + FontWeight.w700, + ), + AppText(model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam[ + index] + .examType), + ], + ), + Row( + children: [ + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam[ + index] + .examDesc, + fontWeight: + FontWeight.w700, + ) + ], + ), + Row( + children: [ + AppText( + 'Abnormal: ', + fontWeight: + FontWeight.w700, + ), + AppText(model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam[ + index] + .abnormal), + ], + ), + SizedBox( + height: 15.0, + ), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam[index] + .remarks, + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, + ), + ], + ), + ), + ); + }), + isExpand: isPhysicalExam, + ), + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + ], ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), ), - ], - ), - ), - ), + ) + : Text("There's no medical file for this patient") ], ), ), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 18208c7c..10b779e6 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -60,15 +60,15 @@ postProcedure( sss.add(PrescriptionRequestModel( covered: true, dose: 1, - itemId: int.parse(drugId), + itemId: drugId.isEmpty ? 1 : int.parse(drugId), doseUnitId: 1, - route: int.parse(route), - frequency: int.parse(frequency), + route: route.isEmpty ? 1 : int.parse(route), + frequency: frequency.isEmpty ? 1 : int.parse(frequency), remarks: instruction, approvalRequired: true, icdcode10Id: "test2", - doseTime: int.parse(doseTimeIn), - duration: int.parse(duration), + doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), + duration: duration.isEmpty ? 1 : int.parse(duration), doseStartDate: doseTime.toIso8601String())); postProcedureReqModel.prescriptionRequestModel = sss; //postProcedureReqModel.procedures = controlsProcedure; @@ -120,10 +120,9 @@ class _PrescriptionFormWidgetState extends State { List durationList; List doseTimeList; List indicationList; + String routeInatial = 'By Mouth'; //PatiantInformtion patient; - dynamic _strength; - dynamic _selectedBranch; @override void initState() { super.initState(); @@ -260,487 +259,500 @@ class _PrescriptionFormWidgetState extends State { return BaseView( onModelReady: (model) => model.getDrugs(), - builder: (BuildContext context, PrescriptionViewModel model, - Widget child) => - DraggableScrollableSheet( - initialChildSize: 0.90, - maxChildSize: 0.90, - minChildSize: 0.9, - builder: - (BuildContext context, ScrollController scrollController) { - return SingleChildScrollView( - child: Container( - height: 980, - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 12.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - AppText( - TranslationBase.of(context).medicines.toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: spaceBetweenTextFileds, - ), - Container( - child: Form( - key: formKey, - child: Column( - //mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.drugsList != null && - model.drugsList.length > 0 - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model.drugsList, - attributeName: 'GenericName', - attributeValueId: 'ItemId', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - selectedDrug = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).search, - selectedDrug != null - ? selectedDrug['GenericName'] - : null, - true), - enabled: false, - ), + builder: + (BuildContext context, PrescriptionViewModel model, Widget child) => + NetworkBaseView( + baseViewModel: model, + child: DraggableScrollableSheet( + initialChildSize: 0.90, + maxChildSize: 0.90, + minChildSize: 0.9, + builder: (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: 980, + child: Padding( + padding: + EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AppText( + TranslationBase.of(context).medicines.toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: spaceBetweenTextFileds, + ), + Container( + child: Form( + key: formKey, + child: Column( + //mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.drugsList != null && + model.drugsList.length > 0 + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: model.drugsList, + attributeName: 'GenericName', + attributeValueId: 'ItemId', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + selectedDrug = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .searchMedicine, + selectedDrug != null + ? selectedDrug['GenericName'] + : null, + true, + suffixIcon: Icon( + Icons.search, + color: Colors.black, + )), + enabled: false, ), ), - SizedBox( - height: spaceBetweenTextFileds, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: referToList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: referToList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - type = selectedValue; - _selectedBranch = null; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .orderType, - type != null ? type['name'] : null, - true), - enabled: false, + ), + SizedBox( + height: spaceBetweenTextFileds, + ), + Container( + child: Row( + children: [ + AppText('Order Type'), + Radio(), + Text('Regular'), + Radio( + value: 1, ), - ), + Text('Urgent'), + ], ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: strengthList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: strengthList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - strength = selectedValue; - _selectedBranch = null; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .strength, - strength != null - ? strength['name'] - : null, - true), - enabled: false, - ), + ), + // Container( + // height: screenSize.height * 0.070, + // child: InkWell( + // onTap: referToList != null + // ? () { + // ListSelectDialog dialog = + // ListSelectDialog( + // list: referToList, + // attributeName: 'name', + // attributeValueId: 'id', + // okText: + // TranslationBase.of(context) + // .ok, + // okFunction: (selectedValue) { + // setState(() { + // type = selectedValue; + // _selectedBranch = null; + // }); + // }, + // ); + // showDialog( + // barrierDismissible: false, + // context: context, + // builder: + // (BuildContext context) { + // return dialog; + // }, + // ); + // } + // : null, + // child: TextField( + // decoration: textFieldSelectorDecoration( + // TranslationBase.of(context) + // .orderType, + // type != null ? type['name'] : null, + // true), + // enabled: false, + // ), + // ), + // ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: strengthList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: strengthList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + strength = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).strength, + strength != null + ? strength['name'] + : null, + true), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: routeList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: routeList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - route = selectedValue; - _selectedBranch = null; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).route, - route != null - ? route['name'] - : null, - true), - enabled: false, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: routeList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: routeList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + route = selectedValue; + }); + if (route == null) { + helpers.showErrorToast( + 'plase fill'); + } + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).route, + route != null ? route['name'] : null, + true), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: frequencyList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: frequencyList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - frequency = selectedValue; - _selectedBranch = null; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .frequency, - frequency != null - ? frequency['name'] - : null, - true), - enabled: false, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: frequencyList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: frequencyList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + frequency = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).frequency, + frequency != null + ? frequency['name'] + : null, + true), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: doseTimeList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: doseTimeList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - doseTime = selectedValue; - _selectedBranch = null; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .doseTime, - doseTime != null - ? doseTime['name'] - : null, - true), - enabled: false, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: doseTimeList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: doseTimeList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + doseTime = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).doseTime, + doseTime != null + ? doseTime['name'] + : null, + true), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: indicationList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: indicationList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - indicationList = - selectedValue; - _selectedBranch = null; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .indication, - indication != null - ? indication['name'] - : null, - true), - enabled: false, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: indicationList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: indicationList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + indication = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .indication, + indication != null + ? indication['name'] + : null, + true), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: () => - selectDate(context, widget.model), - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .date, - selectedDate != null - ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), - enabled: false, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: () => + selectDate(context, widget.model), + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).date, + selectedDate != null + ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: durationList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: durationList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - duration = selectedValue; - _selectedBranch = null; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .duration, - duration != null - ? duration['name'] - : null, - true), - enabled: false, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: durationList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: durationList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + duration = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).duration, + duration != null + ? duration['name'] + : null, + true), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - maxLines: 6, - minLines: 4, - hintText: TranslationBase.of(context) - .instruction, - controller: instructionController, - //keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + maxLines: 6, + minLines: 4, + hintText: + TranslationBase.of(context).instruction, + controller: instructionController, + //keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, ), - SizedBox(height: spaceBetweenTextFileds), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context) - .addMedication, - onPressed: () { - formKey.currentState.save(); + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context) + .addMedication, + onPressed: () { + formKey.currentState.save(); - if (formKey.currentState - .validate()) { - postProcedure( - patient: widget.patient, - doseTimeIn: - doseTime['id'].toString(), - model: widget.model, - duration: - duration['id'].toString(), - frequency: frequency['id'] - .toString(), - route: route['id'].toString(), - drugId: selectedDrug['ItemId'] - .toString(), - strength: - strength['id'].toString(), - indication: - indicationController.text, - instruction: - instructionController - .text, - doseTime: selectedDate); - Navigator.pop(context); - } - { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // NewPrescriptionScreen()), - // ); - } - }, - ), - ], - ), + if (strength == null || + route == null || + frequency == null || + indication == null || + doseTime == null || + duration == null || + selectedDrug == null || + selectedDate == null) { + DrAppToastMsg.showErrorToast( + "Please Fill All Fields"); + return; + } + + if (formKey.currentState.validate()) { + postProcedure( + patient: widget.patient, + doseTimeIn: + doseTime['id'].toString(), + model: widget.model, + duration: + duration['id'].toString(), + frequency: + frequency['id'].toString(), + route: route['id'].toString(), + drugId: selectedDrug['ItemId'] + .toString(), + strength: + strength['id'].toString(), + indication: + indicationController.text, + instruction: + instructionController.text, + doseTime: selectedDate); + Navigator.pop(context); + } + { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // NewPrescriptionScreen()), + // ); + } + }, + ), + ], ), - ], - ), + ), + ], ), ), - ], - ), + ), + ], ), ), - ); - }), + ), + ); + }), + ), ); } diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index aa2de753..45e5173f 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -679,6 +679,7 @@ class _NewPrescriptionScreenState extends State { title: 'update prescription'.toUpperCase(), onPressed: () { updatePrescription( + patient: patient, model: model, drugId: drugId, remarks: remarksController.text, @@ -700,23 +701,23 @@ class _NewPrescriptionScreenState extends State { }); } - updatePrescription({ - PrescriptionViewModel model, - int drugId, - String remarks, - String dose, - String frequency, - String route, - }) async { + updatePrescription( + {PrescriptionViewModel model, + int drugId, + String remarks, + String dose, + String frequency, + String route, + PatiantInformtion patient}) async { //PrescriptionViewModel model = PrescriptionViewModel(); PostPrescriptionReqModel updatePrescriptionReqModel = new PostPrescriptionReqModel(); List sss = List(); - updatePrescriptionReqModel.appointmentNo = 2016055159; - updatePrescriptionReqModel.clinicID = 17; - updatePrescriptionReqModel.episodeID = 200012330; - updatePrescriptionReqModel.patientMRN = 3120877; + updatePrescriptionReqModel.appointmentNo = patient.appointmentNo; + updatePrescriptionReqModel.clinicID = patient.clinicId; + updatePrescriptionReqModel.episodeID = patient.episodeNo; + updatePrescriptionReqModel.patientMRN = patient.patientMRN; updatePrescriptionReqModel.vidaAuthTokenID = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY"; sss.add(PrescriptionRequestModel( From 175ba545e7cdd622af9590bbb7ef38255625073d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 10 Jan 2021 12:14:25 +0200 Subject: [PATCH 16/21] finish create episode --- lib/core/service/SOAP_service.dart | 3 +++ lib/core/viewModel/SOAP_view_model.dart | 2 ++ lib/widgets/patients/profile/profile_medical_info_widget.dart | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 9707dc53..e3ab61b2 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -32,6 +32,7 @@ class SOAPService extends LookupService { List patientProgressNoteList = []; List patientAssessmentList = []; + int episodeID; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( GET_ALLERGIES, @@ -54,7 +55,9 @@ class SOAPService extends LookupService { await baseAppClient.post(POST_EPISODE, onSuccess: (dynamic response, int statusCode) { + print("Success"); + episodeID = response['EpisodeID']; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 31764c45..ebb282ef 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -79,6 +79,8 @@ class SOAPViewModel extends BaseViewModel { List get patientAssessmentList => _SOAPService.patientAssessmentList; + int get episodeID => + _SOAPService.episodeID; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { setState(ViewState.Busy); diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 34433fa7..a614ddb4 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -49,6 +49,10 @@ class ProfileMedicalInfoWidget extends StatelessWidget { appointmentNo: patient.appointmentNo, patientMRN: patient.patientMRN); await model.postEpisode(postEpisodeReqModel); + patient.episodeNo = model.episodeID; + Navigator.of(context).pushNamed(CREATE_EPISODE, arguments: {'patient': patient}); + + }, isLoading: model.state == ViewState.BusyLocal, icon: 'create-episod.png' From 0147e7e49b5016fd6f51b05a71238864e741783f Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 10 Jan 2021 15:15:42 +0200 Subject: [PATCH 17/21] do translation, fix some bugs --- lib/config/localized_values.dart | 1 + lib/core/viewModel/SOAP_view_model.dart | 8 ++++++++ lib/util/translations_delegate_base.dart | 1 + .../patients/profile/patient-page-header-widget.dart | 11 ++++------- .../profile/profile_medical_info_widget.dart | 2 +- .../profile/soap_update/update_assessment_page.dart | 11 ++++------- .../profile/soap_update/update_objective_page.dart | 6 +++--- .../profile/soap_update/update_plan_page.dart | 12 +++++------- 8 files changed, 27 insertions(+), 25 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e96daef0..d1c52f7a 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -541,4 +541,5 @@ const Map> localizedValues = { 'physicalSystemExamination': {'en': "Physical/System Examination", 'ar':" الفحص البدني / النظام" }, 'searchExamination': {'en': "Search Examination", 'ar':"فحص البحث" }, 'addExamination': {'en': "Add Examination", 'ar':"اضافه" }, + 'doc': {'en': "Doc :", 'ar':" د: " }, }; diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index ebb282ef..e3daf6e9 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -246,6 +246,14 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } + String getAllergicNames(){ + String allergiesString=''; + patientAllergiesList.forEach((element) { + allergiesString += element.allergyDiseaseName+' , '; + }); + return allergiesString; + } + Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async { setState(ViewState.Busy); await _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: isFirst); diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index e6b5dbd5..0cfd0b6f 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -558,6 +558,7 @@ class TranslationBase { String get physicalSystemExamination => localizedValues['physicalSystemExamination'][locale.languageCode]; String get searchExamination => localizedValues['searchExamination'][locale.languageCode]; String get addExamination => localizedValues['addExamination'][locale.languageCode]; + String get doc => localizedValues['doc'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index f4de0615..a6c47a7f 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -12,7 +12,6 @@ import 'package:flutter/material.dart'; class PatientPageHeaderWidget extends StatelessWidget { final PatiantInformtion patient; - String allergiesString=''; PatientPageHeaderWidget(this.patient); @override @@ -26,9 +25,7 @@ class PatientPageHeaderWidget extends StatelessWidget { doctorID: '', editedBy: ''); await model.getPatientAllergy(generalGetReqForSOAP); - model.patientAllergiesList.forEach((element) { - allergiesString += element.allergyDiseaseName+' , '; - }); + }, builder: (_, model, w) => Container( child: Column( @@ -85,11 +82,11 @@ class PatientPageHeaderWidget extends StatelessWidget { ), NetworkBaseView( baseViewModel: model, - child: AppText( - "ALLERGIC TO: $allergiesString", + child: model.patientAllergiesList.isNotEmpty ?AppText( + "ALLERGIC TO: "+model.getAllergicNames(), color: Color(0xFFB9382C), fontWeight: FontWeight.bold, - ), + ) : AppText(''), ), ], ), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index a614ddb4..d3ea6048 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -94,7 +94,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).previewHealth, nameLine2: TranslationBase.of(context).summaryReport, icon: 'radiology-1.png'), - if (selectedPatientType != 0 && selectedPatientType != 5) + if (selectedPatientType != 0 && selectedPatientType != 5 && selectedPatientType != 7) PatientProfileButton( key: key, patient: patient, diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 10bfc120..0cec0609 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -41,7 +41,6 @@ class _UpdateAssessmentPageState extends State { bool isAssessmentExpand = false; @override Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async{ @@ -152,12 +151,10 @@ class _UpdateAssessmentPageState extends State { model: model); }, readOnly: true, - // hintColor: Colors.black, suffixIcon: EvaIcons.plusCircleOutline, suffixIconColor: AppGlobal .appPrimaryColor, fontWeight: FontWeight.w600, - // controller: messageController, validator: (value) { if (value == null) return TranslationBase @@ -217,7 +214,7 @@ class _UpdateAssessmentPageState extends State { MainAxisAlignment.start, children: [ AppText( - "Appointment #: ", + TranslationBase.of(context).appointmentNo, fontWeight: FontWeight .bold, fontSize: 16, @@ -250,7 +247,7 @@ class _UpdateAssessmentPageState extends State { MainAxisAlignment.start, children: [ AppText( - "Type : ", + TranslationBase.of(context).type +':', fontWeight: FontWeight .bold, fontSize: 16, @@ -270,7 +267,7 @@ class _UpdateAssessmentPageState extends State { MainAxisAlignment.start, children: [ AppText( - "Doc : ", + TranslationBase.of(context).doc, fontWeight: FontWeight .bold, fontSize: 16, @@ -671,7 +668,7 @@ class _AddAssessmentDetailsState extends State { height: 10, ), AppButton( - title: "Add".toUpperCase(), + title: (widget.isUpdate?TranslationBase.of(context).update:TranslationBase.of(context).add).toUpperCase(), loading: model.state == ViewState.BusyLocal, onPressed: () async { widget.mySelectedAssessment.remark = diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index 0c8bece6..550a36ca 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -397,10 +397,10 @@ class _UpdateObjectivePageState extends State { widget.changePageViewIndex(2); } } else { - helpers.showErrorToast(TranslationBase.of(context).requiredMsg); - } + widget.changePageViewIndex(2); - widget.changePageViewIndex(2); + // helpers.showErrorToast(TranslationBase.of(context).requiredMsg); + } } removeExamination(MasterKeyModel masterKey) { diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index a91447d6..b8ceea79 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -51,8 +51,6 @@ class _UpdatePlanPageState extends State { @override Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - return BaseView( onModelReady: (model) async { GetGetProgressNoteReqModel getGetProgressNoteReqModel = @@ -287,13 +285,13 @@ class _UpdatePlanPageState extends State { appointmentNo: widget.patientInfo.appointmentNo, planNote: progressNoteController.text, doctorID: '', editedBy: ''); - // if(model.patientProgressNoteList.isEmpty){ + if(model.patientProgressNoteList.isEmpty){ await model.postProgressNote(postProgressNoteRequestModel); - // }else { - // await model.patchProgressNote(postProgressNoteRequestModel); - // - // } + }else { + await model.patchProgressNote(postProgressNoteRequestModel); + + } if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); From fb035cd4c9e385325357b11def3eb2279bc19ba8 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 10 Jan 2021 17:35:40 +0200 Subject: [PATCH 18/21] fix patient_search_screen.dart --- .../patients/patient_search_screen.dart | 12 ------ lib/widgets/patients/dynamic_elements.dart | 39 ++++++++++++++++--- lib/widgets/shared/app_text_form_field.dart | 5 +-- 3 files changed, 35 insertions(+), 21 deletions(-) diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 61eb5fcf..94102b1b 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -68,21 +68,9 @@ class _PatientSearchScreenState extends State { try { - - /* Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = - new DoctorProfileModel.fromJson(profile)*/; if (_formKey.currentState.validate()) { _formKey.currentState.save(); - /* sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType); - String token = await sharedPref.getString(TOKEN); - - _patientSearchFormValues.TokenID = token; - _patientSearchFormValues.ProjectID = doctorProfile.projectID; //15 - _patientSearchFormValues.DoctorID = doctorProfile.doctorID; - _patientSearchFormValues.ClinicID = doctorProfile.clinicID;*/ - if ((_patientSearchFormValues.From == "0" || _patientSearchFormValues.To == "0") && _selectedType == "7") { diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart index 25d196d0..e6688397 100644 --- a/lib/widgets/patients/dynamic_elements.dart +++ b/lib/widgets/patients/dynamic_elements.dart @@ -59,22 +59,49 @@ class _DynamicElementsState extends State { @override Widget build(BuildContext context) { + final screenSize = MediaQuery + .of(context) + .size; + InputDecoration textFieldSelectorDecoration({String hintText, + String selectedText, bool isDropDown,IconData icon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ) + ; + } return LayoutBuilder( builder: (ctx, constraints) { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 10, + ), SizedBox( height: 10, ), AppTextFormField( - textInputType: TextInputType.number, + onTap: ()=> _presentDatePicker('_selectedFromDate'), hintText: TranslationBase.of(context).fromDate, controller: _fromDateController, inputFormatter: ONLY_DATE, - onTap: () { - _presentDatePicker('_selectedFromDate'); - }, onSaved: (value) { if (_fromDateController.text.toString().trim().isEmpty) { widget._patientSearchFormValues.From = "0"; @@ -82,12 +109,14 @@ class _DynamicElementsState extends State { widget._patientSearchFormValues.From = _fromDateController.text.replaceAll("/", "-"); } }, + readOnly: true, + ), SizedBox( height: 10, ), AppTextFormField( - textInputType: TextInputType.number, + readOnly: true, hintText: TranslationBase .of(context) .toDate, diff --git a/lib/widgets/shared/app_text_form_field.dart b/lib/widgets/shared/app_text_form_field.dart index 4c2573cd..82a273bb 100644 --- a/lib/widgets/shared/app_text_form_field.dart +++ b/lib/widgets/shared/app_text_form_field.dart @@ -4,10 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; -// OWNER : Ibrahim albitar -// DATE : 19-04-2020 -// DESCRIPTION : Custom Text Form Field for app. - class AppTextFormField extends FormField { AppTextFormField( {FormFieldSetter onSaved, @@ -41,6 +37,7 @@ class AppTextFormField extends FormField { obscureText: obscureText, focusNode: focusNode, keyboardType: textInputType, + readOnly: readOnly, inputFormatters: [ FilteringTextInputFormatter.allow( RegExp(inputFormatter)), From 90a16676db8fe07d6bc14f51a8de3ca1f47e3342 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 11 Jan 2021 13:54:57 +0200 Subject: [PATCH 19/21] fix issue related to SOAP --- .../soap_update/custom_validation_error.dart | 33 +++++ .../subjective/update_allergies_widget.dart | 42 ++++-- .../subjective/update_history_widget.dart | 121 +++++++++-------- .../soap_update/update_assessment_page.dart | 24 +++- .../soap_update/update_objective_page.dart | 2 +- .../profile/soap_update/update_plan_page.dart | 7 +- .../master_key_checkbox_search_widget.dart | 125 +++++++++--------- 7 files changed, 215 insertions(+), 139 deletions(-) create mode 100644 lib/widgets/patients/profile/soap_update/custom_validation_error.dart diff --git a/lib/widgets/patients/profile/soap_update/custom_validation_error.dart b/lib/widgets/patients/profile/soap_update/custom_validation_error.dart new file mode 100644 index 00000000..a05d52a2 --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/custom_validation_error.dart @@ -0,0 +1,33 @@ + +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +// ignore: must_be_immutable +class CustomValidationError extends StatelessWidget { + String error; + CustomValidationError({ + Key key, this.error, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + if(error == null ) + error = TranslationBase + .of(context) + .emptyMessage; + return Column( + children: [ + SizedBox( + height: 2, + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 3), + child: AppText(error, color: Theme + .of(context) + .errorColor, fontSize: 14,), + ), + ], + ); + } +} \ No newline at end of file diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index 6de9e031..38a0896b 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -19,6 +19,8 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; +import '../custom_validation_error.dart'; + class UpdateAllergiesWidget extends StatefulWidget { final List myAllergiesList; @@ -226,10 +228,11 @@ class _AddAllergiesState extends State { MasterKeyModel _selectedAllergy; TextEditingController remarkController = TextEditingController(); GlobalKey key = new GlobalKey>(); + bool isFormSubmitted = false; - - InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown,{IconData icon}) { + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {IconData icon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -328,18 +331,24 @@ class _AddAllergiesState extends State { input.toLowerCase()) || suggestion.nameEn.toLowerCase() .startsWith(input.toLowerCase()), - ):TextField( + ) : TextField( decoration: textFieldSelectorDecoration( TranslationBase .of(context) .selectAllergy, _selectedAllergy != null - ? projectViewModel.isArabic?_selectedAllergy.nameAr: _selectedAllergy.nameEn - : null, true, icon: EvaIcons.search), + ? projectViewModel.isArabic + ? _selectedAllergy.nameAr + : _selectedAllergy.nameEn + : null, + true, + icon: EvaIcons.search), enabled: false, ), ), ), + if(isFormSubmitted && _selectedAllergy == null) + CustomValidationError(), SizedBox( height: 10, ), @@ -382,6 +391,8 @@ class _AddAllergiesState extends State { ), ), ), + if(isFormSubmitted && _selectedAllergySeverity == null) + CustomValidationError(), SizedBox( height: 10, ), @@ -410,12 +421,18 @@ class _AddAllergiesState extends State { AppButton( title: TranslationBase.of(context).add.toUpperCase(), onPressed: () { - MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( - remark: remarkController.text, - selectedAllergy: _selectedAllergy, - isChecked: true, - selectedAllergySeverity: _selectedAllergySeverity,); - widget.addAllergiesFun(mySelectedAllergy); + setState(() { + isFormSubmitted = true; + }); + if(_selectedAllergy !=null && _selectedAllergySeverity !=null) { + MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( + remark: remarkController.text, + selectedAllergy: _selectedAllergy, + isChecked: true, + selectedAllergySeverity: _selectedAllergySeverity,); + widget.addAllergiesFun(mySelectedAllergy); + } + }, ), ] @@ -433,3 +450,4 @@ class _AddAllergiesState extends State { + diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart index 9a7cba01..28f9f466 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -271,6 +272,9 @@ class _AddHistoryDialogState extends State { onModelReady: (model) async { if (model.historyFamilyList.length == 0) { await model.getMasterLookup(MasterKeysService.HistoryFamily); + setState(() { + + }); } }, builder: (_, model, w) => AppScaffold( @@ -313,62 +317,71 @@ class _AddHistoryDialogState extends State { }, scrollDirection: Axis.horizontal, children: [ - MasterKeyCheckboxSearchWidget( - model: model, - masterList: model.historyFamilyList, - removeHistory: (history){ - setState(() { - widget.removeHistory(history); - }); - }, - addHistory: (history){ - setState(() { - createAndAddHistory( - history); - }); - }, - addSelectedHistories: (){ - widget.addSelectedHistories(); - }, - isServiceSelected: (master) =>isServiceSelected(master), + NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.historyFamilyList, + removeHistory: (history){ + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history){ + setState(() { + createAndAddHistory( + history); + }); + }, + addSelectedHistories: (){ + widget.addSelectedHistories(); + }, + isServiceSelected: (master) =>isServiceSelected(master), + ), ), - MasterKeyCheckboxSearchWidget( - model: model, - masterList: model.mergeHistorySurgicalWithHistorySportList, - removeHistory: (history){ - setState(() { - widget.removeHistory(history); - }); - }, - addHistory: (history){ - setState(() { - createAndAddHistory( - history); - }); - }, - addSelectedHistories: (){ - widget.addSelectedHistories(); - }, - isServiceSelected: (master) =>isServiceSelected(master), + NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.mergeHistorySurgicalWithHistorySportList, + removeHistory: (history){ + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history){ + setState(() { + createAndAddHistory( + history); + }); + }, + addSelectedHistories: (){ + widget.addSelectedHistories(); + }, + isServiceSelected: (master) =>isServiceSelected(master), + ), ), - MasterKeyCheckboxSearchWidget( - model: model, - masterList: model.historyMedicalList, - removeHistory: (history){ - setState(() { - widget.removeHistory(history); - }); - }, - addHistory: (history){ - setState(() { - createAndAddHistory( - history); - }); - }, - addSelectedHistories: (){ - widget.addSelectedHistories(); - }, - isServiceSelected: (master) =>isServiceSelected(master), + NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.historyMedicalList, + removeHistory: (history){ + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history){ + setState(() { + createAndAddHistory( + history); + }); + }, + addSelectedHistories: (){ + widget.addSelectedHistories(); + }, + isServiceSelected: (master) =>isServiceSelected(master), + ), ), ], ), diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 0cec0609..93d56af2 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -23,6 +23,8 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'custom_validation_error.dart'; + class UpdateAssessmentPage extends StatefulWidget { final Function changePageViewIndex; List mySelectedAssessmentList; @@ -399,6 +401,7 @@ class _UpdateAssessmentPageState extends State { addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, bool isUpdate) async { setState(() { + widget.mySelectedAssessmentList.add(mySelectedAssessment); }); }); @@ -413,7 +416,6 @@ class AddAssessmentDetails extends StatefulWidget { final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment; final PatiantInformtion patientInfo; final bool isUpdate; - AddAssessmentDetails( {Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, this.isUpdate = false, this.mySelectedAssessmentList}); @@ -426,6 +428,7 @@ class _AddAssessmentDetailsState extends State { TextEditingController remarkController = TextEditingController(); TextEditingController appointmentIdController = TextEditingController(); GlobalKey key = new GlobalKey>(); + bool isFormSubmitted = false; @override Widget build(BuildContext context) { @@ -549,6 +552,9 @@ class _AddAssessmentDetailsState extends State { ), ), ), + if(isFormSubmitted && widget.mySelectedAssessment + .selectedICD == null) + CustomValidationError(), SizedBox( height: 10, ), @@ -595,6 +601,9 @@ class _AddAssessmentDetailsState extends State { ), ), ), + if(isFormSubmitted && widget.mySelectedAssessment + .selectedDiagnosisCondition == null) + CustomValidationError(), SizedBox( height: 10, ), @@ -641,6 +650,9 @@ class _AddAssessmentDetailsState extends State { ), ), ), + if(isFormSubmitted && widget.mySelectedAssessment + .selectedDiagnosisType == null) + CustomValidationError(), SizedBox( height: 10, ), @@ -671,6 +683,9 @@ class _AddAssessmentDetailsState extends State { title: (widget.isUpdate?TranslationBase.of(context).update:TranslationBase.of(context).add).toUpperCase(), loading: model.state == ViewState.BusyLocal, onPressed: () async { + setState(() { + isFormSubmitted = true; + }); widget.mySelectedAssessment.remark = remarkController.text; widget.mySelectedAssessment @@ -692,10 +707,6 @@ class _AddAssessmentDetailsState extends State { model: model, mySelectedAssessment: widget .mySelectedAssessment); - } else { - helpers.showErrorToast(TranslationBase - .of(context) - .requiredMsg); } }, ), @@ -752,7 +763,8 @@ class _AddAssessmentDetailsState extends State { mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; if (!isUpdate) { - widget.mySelectedAssessmentList.add(mySelectedAssessment); + // widget.mySelectedAssessmentList.add(mySelectedAssessment); + widget.addSelectedAssessment(mySelectedAssessment,isUpdate); } Navigator.of(context).pop(); } diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index 550a36ca..9bd38666 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -315,7 +315,7 @@ class _UpdateObjectivePageState extends State { fontWeight: FontWeight.w600, maxLines: 25, minLines: 4, - controller: remarksController, + // controller: remarksController, validator: (value) { if (value == null) return TranslationBase.of(context) diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index b8ceea79..a3c2cdd2 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -113,7 +113,7 @@ class _UpdatePlanPageState extends State { ), Column( children: [ - if(model.patientProgressNoteList.isEmpty) + if(model.patientProgressNoteList.isEmpty || progressNoteController.text !='') Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), @@ -140,7 +140,7 @@ class _UpdatePlanPageState extends State { SizedBox( height: 20, ), - if (progressNoteController.text.isNotEmpty) + if (progressNoteController.text !='') Container( margin: EdgeInsets.only(left: 5, right: 5, top: 15), @@ -350,6 +350,9 @@ class _UpdatePlanPageState extends State { AppButton( title: "Add".toUpperCase(), onPressed: () { + setState(() { + print(progressNoteController.text); + }); Navigator.of(context).pop(); }, ), diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index aafb8adc..dd9e2f3d 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -53,71 +53,68 @@ class _MasterKeyCheckboxSearchWidgetState extends State Date: Mon, 11 Jan 2021 14:45:09 +0200 Subject: [PATCH 20/21] fix issue related to landing page --- lib/landing_page.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/landing_page.dart b/lib/landing_page.dart index edfc496c..c5494acf 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -64,10 +64,9 @@ class _LandingPageState extends State { ShowCaseWidget( builder: Builder(builder: (context) => DashboardScreen()), ), - MessagesScreen(), - //MyScheduleScreen(), - NewPrescriptionScreen(), - ServicesScreen() + // MessagesScreen(), + MyScheduleScreen(), + // ServicesScreen() ], ), bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab), From 2f17167e2f1025ab271ebe87b4389e9399d85a3c Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 11 Jan 2021 18:33:12 +0200 Subject: [PATCH 21/21] some design enhancments --- .../patients/profile/UCAF/UCAF-detail-screen.dart | 8 ++++---- .../profile/referral/refer-patient-screen.dart | 12 +++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 0a655231..83f2d68b 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -72,11 +72,11 @@ class _UcafDetailScreenState extends State { ), Container( margin: - EdgeInsets.symmetric(vertical: 16, horizontal: 16), + EdgeInsets.symmetric(vertical: 8, horizontal: 16), child: BorderedButton( TranslationBase.of(context).save, hasBorder: true, - vPadding: 16, + vPadding: 8, hPadding: 8, borderColor: HexColor("#B8382B"), backgroundColor: HexColor("#B8382B"), @@ -87,11 +87,11 @@ class _UcafDetailScreenState extends State { ), Container( margin: - EdgeInsets.only(left: 16, right: 16, top: 0, bottom: 16), + EdgeInsets.only(left: 16, right: 16, top: 0.0, bottom: 8), child: BorderedButton( TranslationBase.of(context).cancel, hasBorder: true, - vPadding: 16, + vPadding: 8, hPadding: 8, borderColor: Colors.white, backgroundColor: Colors.white, diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index e46ab6d5..62952108 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -40,11 +40,7 @@ class _PatientMakeReferralScreenState extends State { @override void initState() { super.initState(); - referToList = List(); - dynamic sameBranch = {"id": 1, "name": "Same Branch"}; - dynamic otherBranch = {"id": 2, "name": "Other Branch"}; - referToList.add(sameBranch); - referToList.add(otherBranch); + appointmentDate = DateTime.now(); } @@ -53,6 +49,12 @@ class _PatientMakeReferralScreenState extends State { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; + referToList = List(); + dynamic sameBranch = {"id": 1, "name": TranslationBase.of(context).sameBranch}; + dynamic otherBranch = {"id": 2, "name": TranslationBase.of(context).otherBranch}; + referToList.add(sameBranch); + referToList.add(otherBranch); + final screenSize = MediaQuery.of(context).size; return BaseView(