From 045584bb28a07e341e80e991a0f194237751d717 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 25 Apr 2021 13:19:57 +0300 Subject: [PATCH 01/50] voice feature added --- lib/config/localized_values.dart | 4 ++ .../patients/profile/note/update_note.dart | 21 ++++-- lib/util/translations_delegate_base.dart | 7 +- lib/widgets/shared/speech-text-popup.dart | 66 +++++++++++-------- 4 files changed, 64 insertions(+), 34 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 12286b64..efba9c62 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -862,4 +862,8 @@ const Map> localizedValues = { "try-saying": {"en": "Try saying something", "ar": 'حاول قول شيء ما'}, "refClinic": {"en": "Ref Clinic", "ar": "Ref Clinic"}, "acknowledged": {"en": "Acknowledged", "ar": "إقرار"}, + "didntCatch": { + "en": "Didn't catch that. Try Speaking again", + "ar": "لم يتم التقاط ذلك. حاول التحدث مرة أخرى" + }, }; diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index e555e613..207e56a6 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -65,7 +65,7 @@ class _UpdateNoteOrderState extends State { event.controller.stream.listen((p) { if (p['startPopUp'] == 'true') { if (this.mounted) { - onVoiceText(); + initSpeechState().then((value) => {onVoiceText()}); } } }); @@ -118,13 +118,13 @@ class _UpdateNoteOrderState extends State { // isTextFieldHasSuffix: true, validationError: - progressNoteController.text.isEmpty && isSubmitted + progressNoteController.text.isEmpty && + isSubmitted ? TranslationBase.of(context).emptyMessage : null, ), - Positioned( - top: 0,//MediaQuery.of(context).size.height * 0, + top: 0, //MediaQuery.of(context).size.height * 0, right: 15, child: IconButton( icon: Icon( @@ -132,7 +132,8 @@ class _UpdateNoteOrderState extends State { color: Colors.black, ), onPressed: () { - onVoiceText(); + initSpeechState() + .then((value) => {onVoiceText()}); }, ), ) @@ -235,7 +236,7 @@ class _UpdateNoteOrderState extends State { if (available) { speech.listen( onResult: resultListener, - // listenMode: ListenMode.confirmation, + listenMode: stt.ListenMode.confirmation, localeId: lang == 'en' ? 'en-US' : 'ar-SA', ); } else { @@ -266,10 +267,18 @@ class _UpdateNoteOrderState extends State { if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); + speech.stop(); progressNoteController.text = reconizedWord; }); } else { print(result.finalResult); } } + + Future initSpeechState() async { + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); + print(hasSpeech); + if (!mounted) return; + } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 505fc351..35a5233f 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -568,7 +568,8 @@ class TranslationBase { String get referTo => localizedValues['referTo'][locale.languageCode]; - String get referredFrom => localizedValues['referredFrom'][locale.languageCode]; + String get referredFrom => + localizedValues['referredFrom'][locale.languageCode]; String get refClinic => localizedValues['refClinic'][locale.languageCode]; String get branch => localizedValues['branch'][locale.languageCode]; @@ -1239,7 +1240,9 @@ class TranslationBase { String get replayBefore => localizedValues['replayBefore'][locale.languageCode]; String get trySaying => localizedValues["try-saying"][locale.languageCode]; - String get acknowledged => localizedValues['acknowledged'][locale.languageCode]; + String get acknowledged => + localizedValues['acknowledged'][locale.languageCode]; + String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/shared/speech-text-popup.dart b/lib/widgets/shared/speech-text-popup.dart index ac48c3fe..3adaaa6f 100644 --- a/lib/widgets/shared/speech-text-popup.dart +++ b/lib/widgets/shared/speech-text-popup.dart @@ -1,30 +1,22 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'dart:async'; +import 'package:speech_to_text/speech_to_text.dart' as stt; class SpeechToText { final BuildContext context; static var dialog; + static stt.SpeechToText speech = stt.SpeechToText(); SpeechToText({ @required this.context, }); showAlertDialog(BuildContext context) { - //AlertDialog alert = AlertDialog - // AlertDialog alert = AlertDialog(content: MyStatefulBuilder(dispose: () { - // print('dispose!!!!!!!!!!!!'); - // }) - // isClosed = true; - // streamSubscription.cancel(); - // }, builder: (BuildContext context, StateSetter setState) { - // //print(streamSubscription); - // }), - // ); - // show the dialog showDialog( context: context, @@ -41,6 +33,7 @@ class SpeechToText { static closeAlertDialog(BuildContext context) { Navigator.of(dialog).pop(); + speech.stop(); } } @@ -92,14 +85,16 @@ class _MyStatefulBuilderState extends State { width: SizeConfig.realScreenWidth * 0.8, child: Container( child: Column(children: [ - Expanded( - flex: 1, - child: Center( - child: Image.asset( - 'assets/images/habib-logo.png', - height: 75, - width: 75, - ))), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + IconButton( + icon: Icon(DoctorApp.close), + onPressed: () { + SpeechToText.closeAlertDialog(context); + }) + ], + ), Expanded( flex: 3, child: Center( @@ -125,19 +120,38 @@ class _MyStatefulBuilderState extends State { Expanded( flex: 1, child: Center( - child: AppText(searchText != null && searchText != 'null' - ? searchText - : TranslationBase.of(context).trySaying))), + child: AppText( + searchText == null + ? TranslationBase.of(context).trySaying + : searchText == 'null' + ? TranslationBase.of(context).didntCatch + : searchText, + fontSize: 14, + ))), searchText == 'null' ? Center( - child: RaisedButton( - child: AppText('Retry'), - onPressed: () { + child: InkWell( + child: Container( + decoration: BoxDecoration( + border: Border.all(color: Colors.grey[300])), + padding: EdgeInsets.all(5), + child: AppText( + 'Try Again', + fontSize: 13, + )), + onTap: () { SpeechToText.closeAlertDialog(context); event.setValue({'startPopUp': 'true'}); }, )) - : SizedBox() + : SizedBox(), + Row(mainAxisAlignment: MainAxisAlignment.end, children: [ + Image.asset( + 'assets/images/habib-logo.png', + height: 20, + width: 20, + ) + ]) ]), ))); From f708689d0086704a0d6018a858d4a615279cb1a7 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 25 Apr 2021 13:26:44 +0300 Subject: [PATCH 02/50] hot fixes --- lib/config/config.dart | 1 + lib/core/model/labs/patient_lab_orders.dart | 2 +- lib/core/model/radiology/final_radiology.dart | 2 +- .../service/DischargedPatientService.dart | 2 +- lib/screens/patients/patients_screen.dart | 2 +- lib/screens/procedures/procedure_screen.dart | 21 +++---------------- lib/util/date-utils.dart | 9 ++++---- ..._header_with_appointment_card_app_bar.dart | 2 +- 8 files changed, 13 insertions(+), 28 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 3d34fd7c..b89089f0 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -241,6 +241,7 @@ const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; +const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index 62eac5cc..6f989543 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -72,7 +72,7 @@ class PatientLabOrders { PatientLabOrders.fromJson(Map json) { actualDoctorRate = json['ActualDoctorRate']; - clinicDescription = json['ClinicDescription']; + clinicDescription = json['ClinicDescription']?? json['ClinicName']; clinicDescriptionEnglish = json['ClinicDescriptionEnglish']; clinicDescriptionN = json['ClinicDescriptionN']; clinicID = json['ClinicID']; diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index dcf365fe..1d406b81 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -108,7 +108,7 @@ class FinalRadiology { admissionNo = json['AdmissionNo']; isInOutPatient = json['IsInOutPatient']; actualDoctorRate = json['ActualDoctorRate']; - clinicDescription = json['ClinicDescription']; + clinicDescription = json['ClinicDescription']?? json['ClinicName']; dIAPACSURL = json['DIA_PACS_URL']; doctorImageURL = json['DoctorImageURL']; doctorName = json['DoctorName']; diff --git a/lib/core/service/DischargedPatientService.dart b/lib/core/service/DischargedPatientService.dart index 5eb0fabc..63d3f0de 100644 --- a/lib/core/service/DischargedPatientService.dart +++ b/lib/core/service/DischargedPatientService.dart @@ -28,7 +28,7 @@ class DischargedPatientService extends BaseService { body['PatientTypeID'] = 1; hasError = false; myDischargedPatients.clear(); - await baseAppClient.post(GET_MY_DISCHARGE_PATIENT, + await baseAppClient.post(GET_DISCHARGE_PATIENT, onSuccess: (dynamic response, int statusCode) { if (response['List_MyDischargePatient'] != null) { response['List_MyDischargePatient'].forEach((v) { diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 5cffe283..95cf80f5 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -386,7 +386,7 @@ class _PatientsScreenState extends State { }); }, builder: (_, model, w) => AppScaffold( - appBarTitle: patientTypeTitle, + appBarTitle: isSearch? "Search Patient": patientTypeTitle, isShowAppBar: widget.isAppbar, isLoading: _isLoading, body: _isLoading diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 2e729153..2a3a851c 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -183,23 +183,8 @@ class ProcedureScreen extends StatelessWidget { doctorName: doctorNameP, ), ), - if (model.procedureList.isEmpty) - Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText('No Procedure Found 0000'), - ) - ], - ), - ), - if (model.state == ViewState.ErrorLocal) + if (model.state == ViewState.ErrorLocal || (model.procedureList.isNotEmpty && model.procedureList[0].entityList.isEmpty)) + Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -210,7 +195,7 @@ class ProcedureScreen extends StatelessWidget { Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(22.0), - child: AppText(model.error), + child: AppText(model.procedureList.isEmpty ? model.error: 'No Procedure Found '), ) ], ), diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index fef77333..d380ee93 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -239,16 +239,15 @@ class DateUtils { static DateTime convertStringToDate(String date) { // /Date(1585774800000+0300)/ + if (date != null) { const start = "/Date("; const end = "+0300)"; final startIndex = date.indexOf(start); final endIndex = date.indexOf(end, startIndex + start.length); - return DateTime.fromMillisecondsSinceEpoch( - int.parse( - date.substring(startIndex + start.length, endIndex), - ), - ); + DateTime newDate = DateTime.fromMillisecondsSinceEpoch( + int.parse(date.substring(startIndex + start.length, endIndex),),); + return newDate; } else return DateTime.now(); } diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart index 593f18f0..4ec76475 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -367,7 +367,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget AppText(branch ?? '', fontSize: 12) ], ), - if (isPrescriptions) + if (clinic != null) Row( children: [ From 5aa333ba2c3cb468e3dc1d58d3a0e116364b4cfe Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 25 Apr 2021 14:48:10 +0300 Subject: [PATCH 03/50] fix design --- .../profile/note/progress_note_screen.dart | 689 ++++++++++-------- 1 file changed, 394 insertions(+), 295 deletions(-) diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index ca434fcf..e36fadd7 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -10,6 +10,7 @@ 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/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; @@ -105,318 +106,416 @@ class _ProgressNoteState extends State { child: ListView.builder( itemCount: model.patientProgressNoteList.length, itemBuilder: (BuildContext ctxt, int index) { - return Column( - children: [ - Container( - margin: EdgeInsets.only( - left: 10, - right: 10, - ), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(10), - ), - padding: EdgeInsets.all(15), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: model.patientProgressNoteList[index] + .status == + 1 && + authProvider.doctorProfile.doctorID != + model + .patientProgressNoteList[ + index] + .createdBy + ? Color(0xFFCC9B14):model + .patientProgressNoteList[ + index] + .status == + 4?Colors.red.shade700 + : model + .patientProgressNoteList[ + index] + .status == + 2?Colors.green[600]:Color(0xFFCC9B14), + widget: Column( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + if (model + .patientProgressNoteList[ + index] + .status == + 1 && + authProvider + .doctorProfile.doctorID != + model + .patientProgressNoteList[ + index] + .createdBy) + AppText( + 'Pending', + fontWeight: FontWeight.bold, + color: Color(0xFFCC9B14), + fontSize: 16, + ), + if (model + .patientProgressNoteList[ + index] + .status == + 4) + AppText( + 'Canceled', + fontWeight: FontWeight.bold, + color: Colors.red.shade700, + fontSize: 16, + ), + if (model + .patientProgressNoteList[ + index] + .status == + 2) + AppText( + 'Verified', + fontWeight: FontWeight.bold, + color: Colors.green[600], + fontSize: 16, + ), + if (model.patientProgressNoteList[index].status != 2 && + model + .patientProgressNoteList[ + index] + .status != + 4 && + authProvider + .doctorProfile.doctorID == + model + .patientProgressNoteList[ + index] + .createdBy) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + UpdateNoteOrder( + note: model + .patientProgressNoteList[ + index], + patientModel: + model, + patient: + patient, + visitType: widget + .visitType, + isUpdate: true, + )), + ); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], - if(model.patientProgressNoteList[index].status == 1 && authProvider.doctorProfile.doctorID != model.patientProgressNoteList[index].createdBy) - AppText( - 'In Progress',fontWeight: FontWeight.bold, color: Color(0xFFCC9B14),fontSize: 16,), - if(model.patientProgressNoteList[index].status == 4) - AppText( - 'Canceled',fontWeight: FontWeight.bold, color: Colors.red.shade700,fontSize: 16,), - if(model.patientProgressNoteList[index].status == 2) - AppText( - 'Verified',fontWeight: FontWeight.bold, color: Colors.grey.shade700,fontSize: 16,), - if (model.patientProgressNoteList[index].status != 2 && - model.patientProgressNoteList[index].status != 4 && authProvider.doctorProfile.doctorID == model.patientProgressNoteList[index].createdBy) - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - UpdateNoteOrder( - note: model.patientProgressNoteList[ - index], - patientModel: - model, - patient: patient, - visitType: widget - .visitType, - isUpdate: true, - )), - ); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.green[600], - borderRadius: - BorderRadius.circular( - 10), + child: Row( + children: [ + Icon( + DoctorApp.edit_1, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Update', + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), ), - // color:Colors.red[600], + ), + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: "verify", + confirmFun: () async { + GifLoaderDialogUtils + .showMyDialog( + context); + UpdateNoteReqModel + reqModel = + UpdateNoteReqModel( + admissionNo: int + .parse(patient + .admissionNo), + cancelledNote: + false, + lineItemNo: model + .patientProgressNoteList[ + index] + .lineItemNo, + createdBy: model + .patientProgressNoteList[ + index] + .createdBy, + notes: model + .patientProgressNoteList[ + index] + .notes, + verifiedNote: true, + patientTypeID: + patient + .patientType, + patientOutSA: false, + ); + await model + .updatePatientProgressNote( + reqModel); + await getProgressNoteList( + context, model, + isLocalBusy: + true); + GifLoaderDialogUtils + .hideDialog( + context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.green[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], - child: Row( - children: [ - Icon( - DoctorApp.edit_1, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - 'Update', - fontSize: 10, - color: Colors.white, - ), - ], + child: Row( + children: [ + Icon( + FontAwesomeIcons + .check, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Verify', + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), ), - padding: EdgeInsets.all(6), ), - ), - SizedBox( - width: 10, - ), - InkWell( - onTap: () async { - showMyDialog( - context: context, - actionName: "cancel", - confirmFun: () async { - GifLoaderDialogUtils - .showMyDialog( - context, - ); - UpdateNoteReqModel - reqModel = - UpdateNoteReqModel( - admissionNo: - int.parse(patient - .admissionNo), - cancelledNote: true, - lineItemNo: - model.patientProgressNoteList[index] - .lineItemNo, - createdBy: - model.patientProgressNoteList[index] - .createdBy, - notes: - model.patientProgressNoteList[index] - .notes, - verifiedNote: false, - patientTypeID: patient - .patientType, - patientOutSA: false, - ); - await model - .updatePatientProgressNote( - reqModel); - await getProgressNoteList( - context, model, isLocalBusy: true); - GifLoaderDialogUtils - .hideDialog( - context); - }); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.red[600], - borderRadius: - BorderRadius.circular( - 10), - ), - // color:Colors.red[600], + SizedBox( + width: 10, + ), + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: "cancel", + confirmFun: () async { + GifLoaderDialogUtils + .showMyDialog( + context, + ); + UpdateNoteReqModel + reqModel = + UpdateNoteReqModel( + admissionNo: int + .parse(patient + .admissionNo), + cancelledNote: true, + lineItemNo: model + .patientProgressNoteList[ + index] + .lineItemNo, + createdBy: model + .patientProgressNoteList[ + index] + .createdBy, + notes: model + .patientProgressNoteList[ + index] + .notes, + verifiedNote: false, + patientTypeID: + patient + .patientType, + patientOutSA: false, + ); + await model + .updatePatientProgressNote( + reqModel); + await getProgressNoteList( + context, model, + isLocalBusy: + true); + GifLoaderDialogUtils + .hideDialog( + context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.red[600], + borderRadius: + BorderRadius.circular( + 10), + ), + // color:Colors.red[600], - child: Row( - children: [ - Icon( - FontAwesomeIcons.trash, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - 'Cancel', - fontSize: 10, - color: Colors.white, - ), - ], + child: Row( + children: [ + Icon( + FontAwesomeIcons + .trash, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Cancel', + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), ), - padding: EdgeInsets.all(6), ), - ), - SizedBox( - width: 10, - ), - InkWell( - onTap: () async { - showMyDialog(context: context, actionName: "verify",confirmFun: () async{ - GifLoaderDialogUtils - .showMyDialog(context); - UpdateNoteReqModel reqModel = - UpdateNoteReqModel( - admissionNo: int.parse( - patient.admissionNo), - cancelledNote: false, - lineItemNo: model.patientProgressNoteList[index] - .lineItemNo, - createdBy: model.patientProgressNoteList[index] - .createdBy, - notes: - model.patientProgressNoteList[index].notes, - verifiedNote: true, - patientTypeID: - patient.patientType, - patientOutSA: false, - ); - await model - .updatePatientProgressNote( - reqModel); - await getProgressNoteList( - context, model, isLocalBusy: true); - GifLoaderDialogUtils - .hideDialog(context); - }); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.grey[600], - borderRadius: - BorderRadius.circular( - 10), - ), - // color:Colors.red[600], - child: Row( - children: [ - Icon( - FontAwesomeIcons.check, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - 'Verify', - fontSize: 10, - color: Colors.white, - ), - ], - ), - padding: EdgeInsets.all(6), + SizedBox( + width: 10, + ) + ], + ), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.60, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + 'Created By: ', + fontSize: 10, + ), + Expanded( + child: AppText( + model + .patientProgressNoteList[ + index] + .doctorName ?? + '', + fontWeight: + FontWeight.w600, + fontSize: 12, + ), + ), + ], + ), + ], ), ), - SizedBox( - width: 10, - ) - ], - ), - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.65, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + Column( children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - 'Created By: ', - fontSize: 10, - ), - Expanded( - child: AppText( - model.patientProgressNoteList[index].doctorName??'',fontWeight: FontWeight.w600,fontSize: 12,), - ), - ], + AppText( + model + .patientProgressNoteList[ + index] + .createdOn != + null + ? DateUtils.getDayMonthYearDateFormatted( + DateUtils.getDateTimeFromServerFormat( + model + .patientProgressNoteList[ + index] + .createdOn)) + : DateUtils + .getDayMonthYearDateFormatted( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + ), + AppText( + model + .patientProgressNoteList[ + index] + .createdOn != + null + ? DateUtils.getHour(DateUtils + .getDateTimeFromServerFormat( + model + .patientProgressNoteList[ + index] + .createdOn)) + : DateUtils.getHour( + DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, ), - ], - ), - ), - Column( + crossAxisAlignment: + CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, children: [ - AppText( - model.patientProgressNoteList[index] - .createdOn != - null - ? DateUtils - .getDayMonthYearDateFormatted( - DateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn)) - : DateUtils - .getDayMonthYearDateFormatted( - DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - ), - AppText( - model.patientProgressNoteList[index] - .createdOn != - null - ? DateUtils - .getHour( - DateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn )) - : DateUtils - .getHour( - DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - ), - ], - crossAxisAlignment: - CrossAxisAlignment.end, - ) - ], - ), - SizedBox( - height: 8, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - child: AppText( - model.patientProgressNoteList[index].notes, - fontSize: 10, + Expanded( + child: AppText( + model + .patientProgressNoteList[ + index] + .notes, + fontSize: 10, + ), ), - ), - ]) - ], - ), - ), - SizedBox( - height: 20, - + ]) + ], + ), + SizedBox( + height: 20, + ), + ], ), - ], + ), ); }), ), From 70e394cfc7eefeb3f36d0961221de4319ad34ede Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 25 Apr 2021 14:55:38 +0300 Subject: [PATCH 04/50] change font size --- lib/screens/patients/profile/note/progress_note_screen.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index e36fadd7..443bff8d 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -149,7 +149,7 @@ class _ProgressNoteState extends State { 'Pending', fontWeight: FontWeight.bold, color: Color(0xFFCC9B14), - fontSize: 16, + fontSize: 12, ), if (model .patientProgressNoteList[ @@ -160,7 +160,7 @@ class _ProgressNoteState extends State { 'Canceled', fontWeight: FontWeight.bold, color: Colors.red.shade700, - fontSize: 16, + fontSize: 12, ), if (model .patientProgressNoteList[ @@ -171,7 +171,7 @@ class _ProgressNoteState extends State { 'Verified', fontWeight: FontWeight.bold, color: Colors.green[600], - fontSize: 16, + fontSize: 12, ), if (model.patientProgressNoteList[index].status != 2 && model From ddc266416ded9fb6efde064856b6504fc21487e9 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 25 Apr 2021 15:59:24 +0300 Subject: [PATCH 05/50] some functionality and design changes --- lib/config/localized_values.dart | 5 +- lib/core/service/labs_service.dart | 2 +- lib/core/service/patient-ucaf-service.dart | 29 +++++++++++ .../service/patient-vital-signs-service.dart | 8 ++- .../viewModel/patient-ucaf-viewmodel.dart | 3 +- .../patient-vital-sign-viewmodel.dart | 11 +++-- .../profile/lab_result/FlowChartPage.dart | 3 +- .../profile/lab_result/LabResultWidget.dart | 3 +- .../referral_patient_detail_in-paint.dart | 49 +++++++++++++++---- .../referred_patient_detail_in-paint.dart | 4 +- lib/util/translations_delegate_base.dart | 1 + ..._header_with_appointment_card_app_bar.dart | 4 +- 12 files changed, 96 insertions(+), 26 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 23ff3cfb..65b82025 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -383,8 +383,8 @@ const Map> localizedValues = { 'leanBodyWeight': {'en': "Lean Body Weight", 'ar': 'وزن الجسم الهزيل'}, 'bodyMassIndex': {'en': "Body Mass Index", 'ar': 'مؤشر كتلة الجسم'}, 'yourBodyMassIndex': { - 'en': "Your Body Mass Index is", - 'ar': 'مؤشر كتلة جسمك هو' + 'en': "Body Mass Index is", + 'ar': 'مؤشر كتلة الجسم هو' }, 'bmiUnderWeight': {'en': "UnderWeight", 'ar': 'تحت الوزن'}, 'bmiHealthy': {'en': "Healthy", 'ar': 'صحي'}, @@ -867,4 +867,5 @@ const Map> localizedValues = { "ar": "لم يتم التقاط ذلك. حاول التحدث مرة أخرى" }, "showDetail": {"en": "Show Detail", "ar": "أظهر المعلومات"}, + "viewProfile": {"en": "View Profile", "ar": "إعرض الملف"}, }; diff --git a/lib/core/service/labs_service.dart b/lib/core/service/labs_service.dart index f38294b5..f2336735 100644 --- a/lib/core/service/labs_service.dart +++ b/lib/core/service/labs_service.dart @@ -132,7 +132,7 @@ class LabsService extends BaseService { body['OrderNo'] = patientLabOrder.orderNo; body['SetupID'] = patientLabOrder.setupID; body['ProjectID'] = patientLabOrder.projectID; - body['ClinicID'] = patientLabOrder.clinicID; + body['ClinicID'] = patientLabOrder.clinicID ?? 0; } body['isDentalAllowedBackend'] = false; body['Procedure'] = procedure; diff --git a/lib/core/service/patient-ucaf-service.dart b/lib/core/service/patient-ucaf-service.dart index ec2885f5..e53df1d0 100644 --- a/lib/core/service/patient-ucaf-service.dart +++ b/lib/core/service/patient-ucaf-service.dart @@ -36,6 +36,35 @@ class UcafService extends LookupService { }, body: body); } + Future getInPatientVitalSignHistory(PatiantInformtion patient, bool isInPatient) async { + hasError = false; + Map body = Map(); + body['PatientID'] = patient.patientId; + body['PatientTypeID'] = 1; + if(isInPatient){ + body['InOutPatientType'] = 1; + }else { + body['InOutPatientType'] = 2; + } + + await baseAppClient.post( + GET_PATIENT_VITAL_SIGN, + onSuccess: (dynamic response, int statusCode) { + patientVitalSignsHistory.clear(); + if (response['List_DoctorPatientVitalSign'] != null) { + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); + }); + } + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error.toString(); + }, + body: body, + ); + } + Future getPatientVitalSignsHistory( PatiantInformtion patient, String fromDate, String toDate) async { hasError = false; diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index c302dbbd..71307ddc 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -67,12 +67,16 @@ class VitalSignsService extends BaseService { ); } - Future getInPatientVitalSignHistory(PatiantInformtion patient) async { + Future getInPatientVitalSignHistory(PatiantInformtion patient, bool isInPatient) async { hasError = false; Map body = Map(); body['PatientID'] = patient.patientId; - body['InOutPatientType'] = 1; body['PatientTypeID'] = 1; + if(isInPatient){ + body['InOutPatientType'] = 1; + }else { + body['InOutPatientType'] = 2; + } await baseAppClient.post( GET_PATIENT_VITAL_SIGN, diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index 530d92f4..dc76884d 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -67,7 +67,8 @@ class UcafViewModel extends BaseViewModel { to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } - await _ucafService.getPatientVitalSignsHistory(patient, from, to); + // await _ucafService.getPatientVitalSignsHistory(patient, from, to); + await _ucafService.getInPatientVitalSignHistory(patient, false); await _ucafService.getPatientChiefComplaint(patient); if (_ucafService.hasError) { diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 06e5371a..6786ad92 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -52,11 +52,12 @@ class VitalSignsViewModel extends BaseViewModel { to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } - if (isInPatient) { - await _vitalSignService.getInPatientVitalSignHistory(patient); - } else { - await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); - } + await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient); + // if (isInPatient) { + // await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient); + // } else { + // await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); + // } if (_vitalSignService.hasError) { error = _vitalSignService.error; diff --git a/lib/screens/patients/profile/lab_result/FlowChartPage.dart b/lib/screens/patients/profile/lab_result/FlowChartPage.dart index 2f760d1f..fcc9746a 100644 --- a/lib/screens/patients/profile/lab_result/FlowChartPage.dart +++ b/lib/screens/patients/profile/lab_result/FlowChartPage.dart @@ -16,8 +16,9 @@ class FlowChartPage extends StatelessWidget { final PatientLabOrders patientLabOrder; final String filterName; final PatiantInformtion patient; + final bool isInpatient; - FlowChartPage({this.patientLabOrder, this.filterName, this.patient}); + FlowChartPage({this.patientLabOrder, this.filterName, this.patient, this.isInpatient}); @override Widget build(BuildContext context) { diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index 6c3e7fe4..0d059000 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -36,7 +36,7 @@ class LabResultWidget extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (!isInpatient) + // if (!isInpatient) Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -50,6 +50,7 @@ class LabResultWidget extends StatelessWidget { filterName: filterName, patientLabOrder: patientLabOrder, patient: patient, + isInpatient: isInpatient, ), ), ); diff --git a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart index 32d60f79..cc2c7136 100644 --- a/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referral_patient_detail_in-paint.dart @@ -90,15 +90,46 @@ class ReferralPatientDetailScreen extends StatelessWidget { Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Container( - width: 60, - height: 60, - child: Image.network( - referredPatient.doctorImageURL + Column( + children: [ + InkWell( + onTap: () { + PatiantInformtion patient = + model.getPatientFromReferralO(referredPatient); + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": patient, + "patientType": "1", + "isInpatient": true, + "arrivalType": "1", + "from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + }); + }, + child: Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + referredPatient.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), ), - ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).viewProfile, + fontWeight: FontWeight.w700, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Colors.red[700], + ) + ], ), SizedBox( width: 10, @@ -321,7 +352,7 @@ class ReferralPatientDetailScreen extends StatelessWidget { margin: EdgeInsets.only(left: 10, right: 0), child: Image.asset( - 'assets/images/patient/ic_ref_arrow_left.png', + 'assets/images/patient/ic_ref_arrow_up.png', height: 50, width: 30, ), diff --git a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart index b68eeac1..07c4b38e 100644 --- a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart @@ -127,10 +127,10 @@ class ReferredPatientDetailScreen extends StatelessWidget { height: 20, ), AppText( - TranslationBase.of(context).showDetail, + TranslationBase.of(context).viewProfile, fontWeight: FontWeight.w700, fontSize: 1.7 * SizeConfig.textMultiplier, - color: Colors.blue, + color: Colors.red[700], ) ], ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index a991c2aa..4645a5e0 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1175,6 +1175,7 @@ class TranslationBase { localizedValues['noDataAvailable'][locale.languageCode]; String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; String get showDetail => localizedValues['showDetail'][locale.languageCode]; + String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; String get fileNumber => localizedValues['fileNumber'][locale.languageCode]; String get reschedule => localizedValues['reschedule'][locale.languageCode]; diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart index 4ec76475..0adfac4d 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -328,7 +328,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget margin: EdgeInsets.only(top: 10), ), Expanded( - flex: 4, + flex: 5, child: Container( margin: EdgeInsets.all(10), child: Column( @@ -467,5 +467,5 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget } @override - Size get preferredSize => Size(double.maxFinite, 290); + Size get preferredSize => Size(double.maxFinite, 310); } From 099bf81d526541626c9cb601c9ecff03abae8710 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 25 Apr 2021 18:03:34 +0300 Subject: [PATCH 06/50] homepage and sms popup updated --- assets/fonts/DoctorApp.ttf | Bin 44716 -> 45888 bytes lib/config/config.dart | 11 +- lib/config/localized_values.dart | 4 +- lib/icons_app/config.json | 70 +- lib/icons_app/doctor_app_icons.dart | 13 +- lib/screens/home/home_page_card.dart | 2 - lib/screens/home/home_screen.dart | 77 +- .../medicine/medicine_search_screen.dart | 9 +- .../patients/patient_search_screen.dart | 921 +++++++++--------- lib/screens/sick-leave/add-sickleave.dart | 3 +- lib/widgets/otp/sms-popup.dart | 31 +- 11 files changed, 619 insertions(+), 522 deletions(-) diff --git a/assets/fonts/DoctorApp.ttf b/assets/fonts/DoctorApp.ttf index 09f492706dc8b76ca7148c6b2939b9d7126f8d0b..aa10880991963672acd2560e0c9177fe47a9defe 100644 GIT binary patch delta 1215 zcmX|Ae@q*76o2ooy}Q!m=(V)Rm~<;;t*#Unc65L6D=bT7;Lx!^%5ZLHxwg#0um#1% zq@c{iXmrcP9|@W)nK6Ptf|lqaXlDFx(PUZtLld1d8l=%bjL`(+==rWyzn9PV^WOWs z@4NTDxqIh3=GrE6F_;el;PU`5l9<${*O*gQt{ej>bCXG8N1*n+Lci=)MH%l>yE z<^6$iOp=e(6-%}4^l)JO$lfwOx6Sc7kcixsUOQU1Dq1Ind26S&R(ODW&R+Q0nPBq8 zQ2-0@Ao0lx;1uy#1@I8Dr4isXv855<46&sVKqIy^0?<_zEsX#P;_(W=V!Z;enEE5o z1(9K_Ngwp1iW4xLoYr>mwU@XE-8N3%h~= z=Yk}bIWmHg?6sT6Gm*@}{mRINrB@$2ykp89kG!Dt^tQS@b;RAJ`1;5?@TO@_uq!l( z4E3-Z+93vma6f=2)F`1>uHA#awr*^f)iB!_Qe$ntS}utB7V5qM1C3k**7^ly_v6(1nHOZ-Y?2>oh*yYN!}$1rEPLW6a>k| z&sJB@mU3#7;TB7QRgV{W(QP!T?4XU8gdN7^Shb8!rsQ&z(pHT+8Ce@r%rA=_qTC=z z0@~t^J&yPb9Zf2RMR`#S`*vQE#b4DX`UJpZe7Y~f-h%Iq+xZs57g|y<#PQx>WtI-~ z`soj{CNbU*t+<)RDlc9YL{Yek-l`#oW5^f_zwTojIj86qg?j|rom>~Ea9sd}fj3)N zOd02wuiG$%>B5l}!DbwPFW%|O=~_0Cj!x?16N!l_J?9>u$R*NRHl;_WwV4ThY9{B- Q>PbDD)iTllHLG9v2O%LFx&QzG delta 587 zcmXw$O=uHQ6ot=wGgHQC{46B({y5>oi^&I>8dWe zvx~?`)+)6SOG_aP3fo#drG#f8i6 z`n6{cP@MpbGdCLpBQ^xRr2o_R?x|RE3lS|~1s~Ram;Y<{Gn|b7)ux%7kgCd~=4@}T zxG0WzWicYMep4(9*<15YYyBBE4Wf|*(E<6gJp%EZRW+QTcDL)gs4zD>%Y$lAZ)L*} z2*4<$NlV}$Qdcik|yUF8abLH}DMFPDNk zbAod~E8PK;RDP@i=c#8qV2Y}I1X-%`5m;2^Bj9_ql#d`sRX&0l!vBpGp^Igily@~( zKW2EX=)IlC%PE-}O8pug8ofQ%H}>vC-d~NquK3ma2~F7EoBAt%^`WU7x?|5@@oJAI H)C2wlTtJyo diff --git a/lib/config/config.dart b/lib/config/config.dart index b89089f0..5c704152 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -129,7 +129,7 @@ const GET_SICKLEAVE_STATISTIC = const ARRIVED_PATIENT_URL = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; -const GET_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/GetAllSickLeaves'; +const GET_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; const GET_OFFTIME = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; @@ -238,10 +238,13 @@ const GET_BOX_QUANTITY = ///GET ECG const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; -const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; +const GET_MY_REFERRAL_INPATIENT = + "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; -const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; -const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; +const GET_MY_DISCHARGE_PATIENT = + "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; +const GET_DISCHARGE_PATIENT = + "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 23ff3cfb..b0aa05a1 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -32,7 +32,7 @@ const Map> localizedValues = { 'outPatients': {'en': 'Out Patient', 'ar': 'المريض الخارجي'}, 'myOutPatient': {'en': 'My OutPatients', 'ar': 'المريض الخارجي'}, - 'searchPatient': {'en': 'Search Patient', 'ar': 'البحث عن مريض'}, + 'searchPatient': {'en': 'Search Patients', 'ar': 'البحث عن مريض'}, 'searchAbout': {'en': 'Search', 'ar': 'البحث عن'}, 'patient': {'en': 'Patient', 'ar': ' مريض'}, 'patients': {'en': "Patient's", 'ar': ' مريض'}, @@ -50,7 +50,7 @@ const Map> localizedValues = { 'inPatient': {'en': 'My InPatients', 'ar': 'المريض الداخلي'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, - 'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'}, + 'searchMedicine': {'en': 'Search Medicines', 'ar': 'بحث عن الدواء'}, 'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'}, 'referPatient': {'en': 'Referral Patient', 'ar': 'إحالة مريض'}, 'myReferral': {'en': 'My Referral', 'ar': 'إحالة'}, diff --git a/lib/icons_app/config.json b/lib/icons_app/config.json index 2a88ccfa..a5f1b893 100644 --- a/lib/icons_app/config.json +++ b/lib/icons_app/config.json @@ -2342,34 +2342,6 @@ "123" ] }, - { - "uid": "61995ecf98bfc143fef5299e57bcc37f", - "css": "powered-by-cs-1", - "code": 59510, - "src": "custom_icons", - "selected": true, - "svg": { - "path": "M5611.5 942.8L5603.8 947.4A13.5 13.5 0 0 0 5599.7 942.5 9.5 9.5 0 0 0 5594.5 941.2 9.7 9.7 0 0 0 5587.9 943.5 6.9 6.9 0 0 0 5585.4 949C5585.4 952 5587.6 954.5 5592.2 956.3L5598.4 958.7A26.4 26.4 0 0 1 5609.6 966.3 16.8 16.8 0 0 1 5613.1 977.1 19.1 19.1 0 0 1 5607.4 991.4 19.7 19.7 0 0 1 5593 997.1 19.2 19.2 0 0 1 5579.5 992.2 22.3 22.3 0 0 1 5572.9 978.6L5582.5 976.5A16.5 16.5 0 0 0 5584.8 984.2 10.8 10.8 0 0 0 5600.7 985.3 10.2 10.2 0 0 0 5603.6 977.7 11 11 0 0 0 5603.1 974.4 9 9 0 0 0 5601.5 971.6 12.9 12.9 0 0 0 5598.7 969.2 27.3 27.3 0 0 0 5594.7 967L5588.6 964.6A17.4 17.4 0 0 1 5575.7 948.9 15.1 15.1 0 0 1 5581.1 937.1 19.5 19.5 0 0 1 5594.6 932.3 18.8 18.8 0 0 1 5611.6 942.8M5623.8 964.5A30.6 30.6 0 0 1 5633.5 941.8 31.8 31.8 0 0 1 5656.8 932.3 32.7 32.7 0 0 1 5689.3 964.9 30.8 30.8 0 0 1 5679.6 987.9 33.1 33.1 0 0 1 5634.4 988.9 30.8 30.8 0 0 1 5623.8 964.6M5633.3 964.7A23.2 23.2 0 0 0 5673 981.7 24.3 24.3 0 0 0 5673 948.1 22.2 22.2 0 0 0 5656.5 941.3 22.4 22.4 0 0 0 5640 948.1 22.6 22.6 0 0 0 5633.2 964.8M5713.1 933.5V987.3H5731.5V996.2H5703.5V933.5ZM5750.4 933.5V971.3A20.8 20.8 0 0 0 5753.1 983.1 14.1 14.1 0 0 0 5775.3 983.1 20.5 20.5 0 0 0 5777.9 971.3V933.5H5787.4V973.8A22.6 22.6 0 0 1 5781.2 990.2 23.8 23.8 0 0 1 5747.1 990.2 22.6 22.6 0 0 1 5740.9 973.8V933.5ZM5822.1 942.4V996.2H5812.6V942.4H5798.2V933.5H5836.5V942.4ZM5871.1 964.5A30.6 30.6 0 0 1 5880.8 941.8 31.8 31.8 0 0 1 5904 932.3 32.7 32.7 0 0 1 5936.6 964.9 30.8 30.8 0 0 1 5926.9 987.9 33.1 33.1 0 0 1 5881.7 988.9 30.8 30.8 0 0 1 5871 964.6M5880.6 964.7A23.2 23.2 0 0 0 5920.2 981.7 24.3 24.3 0 0 0 5920.2 948.1 22.2 22.2 0 0 0 5903.8 941.3 22.4 22.4 0 0 0 5887.2 948.1 22.6 22.6 0 0 0 5880.5 964.8M5950.9 996.2V929.2L5996.6 977.1V933.5H6006.1V1000L5960.4 952.3V996.1ZM6058.9 942.8L6051.3 947.4A13.8 13.8 0 0 0 6047.2 942.5 9.5 9.5 0 0 0 6041.9 941.2 9.7 9.7 0 0 0 6035.4 943.5 6.9 6.9 0 0 0 6032.8 949C6032.8 952 6035.1 954.5 6039.6 956.3L6045.9 958.7A26.4 26.4 0 0 1 6057 966.3 16.8 16.8 0 0 1 6060.5 977.1 19.1 19.1 0 0 1 6054.8 991.4 19.8 19.8 0 0 1 6040.4 997.1 19.2 19.2 0 0 1 6026.9 992.2 22.2 22.2 0 0 1 6020.4 978.6L6030 976.5A16.5 16.5 0 0 0 6032.2 984.2 9.9 9.9 0 0 0 6040.7 988.2 9.7 9.7 0 0 0 6048 985.3 10.1 10.1 0 0 0 6051 977.7 11 11 0 0 0 6050.5 974.4 9 9 0 0 0 6048.9 971.6 12.9 12.9 0 0 0 6046.1 969.2 27.3 27.3 0 0 0 6042 967L6036 964.6A17.4 17.4 0 0 1 6023.2 948.9 15.1 15.1 0 0 1 6028.6 937.1 19.5 19.5 0 0 1 6042 932.3 18.8 18.8 0 0 1 6059 942.8M5307.1 772.3A43.1 43.1 0 0 0 5292 754.6 42 42 0 0 0 5267.6 747.8 55.5 55.5 0 0 0 5245.7 752.3 61 61 0 0 0 5227.1 764.7 68.4 68.4 0 0 0 5213.5 783.5 71.1 71.1 0 0 0 5206.5 807.5 65.9 65.9 0 0 0 5207.7 831.8 49 49 0 0 0 5216.9 850.5 43 43 0 0 0 5232.4 862.7 49.2 49.2 0 0 0 5253.5 867 49.2 49.2 0 0 0 5279 860.1 64.7 64.7 0 0 0 5298.9 841.7L5327.2 860.1A101.6 101.6 0 0 1 5295.8 887 89.4 89.4 0 0 1 5251.4 897.6 90 90 0 0 1 5215.8 890.7 78.4 78.4 0 0 1 5188.5 871.8 75.1 75.1 0 0 1 5172.1 843.2 85.8 85.8 0 0 1 5168.8 807.5 103.1 103.1 0 0 1 5179.8 771.3 99.5 99.5 0 0 1 5201.9 742.7 102.6 102.6 0 0 1 5270.1 717.2 77.9 77.9 0 0 1 5312.2 727.9 73.7 73.7 0 0 1 5338.2 754.7ZM5455.3 892.5H5346.6L5384.6 722.3H5422.1L5391 862.4H5462.2ZM5669.4 843.6A98.2 98.2 0 0 1 5647.5 872 99.3 99.3 0 0 1 5617.3 890.8 97.5 97.5 0 0 1 5580.9 897.6 85.2 85.2 0 0 1 5546 890.6 76.5 76.5 0 0 1 5519.2 871.3 77.4 77.4 0 0 1 5503.3 842.7 83 83 0 0 1 5500.5 807.5 105.7 105.7 0 0 1 5511.2 771.6 98.4 98.4 0 0 1 5563.1 724 97 97 0 0 1 5599.5 717.2 84.4 84.4 0 0 1 5634.4 724.3 76.4 76.4 0 0 1 5677 772.4 82.7 82.7 0 0 1 5679.8 807.5 105.8 105.8 0 0 1 5669.1 843.6M5641.6 784.3A50.6 50.6 0 0 0 5633.7 765.3 40.1 40.1 0 0 0 5618.9 752.5 46.2 46.2 0 0 0 5597.4 747.8 51.9 51.9 0 0 0 5575.2 752.5 59.4 59.4 0 0 0 5557.3 765.3 66.2 66.2 0 0 0 5544.5 784.3 80.3 80.3 0 0 0 5538 807.5 69.2 69.2 0 0 0 5538.7 830.6 50.7 50.7 0 0 0 5546.7 849.5 40.2 40.2 0 0 0 5561.5 862.2 46.2 46.2 0 0 0 5582.9 866.9 52.2 52.2 0 0 0 5605.1 862.2 60.8 60.8 0 0 0 5623.1 849.5 67.1 67.1 0 0 0 5635.8 830.6 78.5 78.5 0 0 0 5642.4 807.5 70.2 70.2 0 0 0 5641.6 784.3M5864.8 834.8A84.6 84.6 0 0 1 5854.8 859.3 76.6 76.6 0 0 1 5813.5 892.7 93.5 93.5 0 0 1 5782.5 897.6 76.3 76.3 0 0 1 5751.1 891.5 62.6 62.6 0 0 1 5728.4 874.9 58.7 58.7 0 0 1 5716 850.5 64.1 64.1 0 0 1 5715.9 821.3Q5722.3 792.1 5726.2 773.1C5728.8 760.5 5730.9 750.8 5732.3 743.9S5734.8 732 5735.4 728.8 5736.4 723.4 5736.5 722.4H5774.8L5752.6 825.4A39.5 39.5 0 0 0 5752.2 840 32.9 32.9 0 0 0 5757.3 853.4 30 30 0 0 0 5768.2 863.2 33.9 33.9 0 0 0 5785 867 41.7 41.7 0 0 0 5800.7 864.1 45.6 45.6 0 0 0 5813.6 856.3 48.7 48.7 0 0 0 5823.2 845.1 42.6 42.6 0 0 0 5828.6 831.5L5853.4 722.3H5891.7ZM6063.9 842.6A90.3 90.3 0 0 1 6042.6 869.4 93.8 93.8 0 0 1 6012.6 886.4 108.4 108.4 0 0 1 5976.1 892.4H5896.7L5934.5 722.2H5993A94.2 94.2 0 0 1 6028.4 728.6 74.2 74.2 0 0 1 6055.1 746.3 71.1 71.1 0 0 1 6071.2 773.2 78.9 78.9 0 0 1 6074.4 807.3 98.4 98.4 0 0 1 6063.8 842.4M6035.4 785.5A44.4 44.4 0 0 0 6027.3 768 39.2 39.2 0 0 0 6012.6 756.4 49.2 49.2 0 0 0 5991.5 752.2H5965.3L5940.8 862.1H5976.8A55 55 0 0 0 5998.4 857.8 63.4 63.4 0 0 0 6016.7 846.1 62.3 62.3 0 0 0 6030 828.6 59.9 59.9 0 0 0 6036.5 807.3 65.7 65.7 0 0 0 6035.5 785.4M5877.9 372.8S5868.5 321.5 5791.5 321.5A102.2 102.2 0 0 0 5714.5 228.1S5701.4 135.9 5642.7 114.9L5844.1 166.3S5881.4 166.3 5877.9 231.6ZM5591.9 98.6L5226.6 0.6S5174.1-7.6 5172.9 40.2 5172.9 312.1 5172.9 312.1 5224.3 228.1 5359.7 243.9C5359.7 243.9 5384.2 98.6 5521.9 165.1A82.7 82.7 0 0 1 5591.9 98.6M5591.3 395S5599.4 347.1 5636.8 360 5739.5 403.1 5739.5 403.1A54 54 0 0 1 5766.2 460.4L5759.6 516.3A27.3 27.3 0 0 1 5719.6 537.4L5600.5 487.1A35 35 0 0 1 5586.5 448.2ZM5441.9 434.5S5448.3 407.5 5469.2 416.2 5526.2 444.5 5526.2 444.5A30.8 30.8 0 0 1 5539.4 478.1L5533.6 509.7A15.6 15.6 0 0 1 5510 520.3L5443.9 487.3A20 20 0 0 1 5437.4 464.5ZM5832.1 408.8S5838.5 381.8 5859.3 390.4 5916.3 418.8 5916.3 418.8A30.9 30.9 0 0 1 5929.5 452.4L5923.7 484A15.6 15.6 0 0 1 5900.1 494.6L5834 461.6A20 20 0 0 1 5827.5 438.8ZM5520.3 255.2S5525.7 232.5 5543.2 239.8 5591.3 263.7 5591.3 263.7A26 26 0 0 1 5602.5 292L5597.6 318.7A13.2 13.2 0 0 1 5577.7 327.6L5522 299.9A16.9 16.9 0 0 1 5516.4 280.6ZM5687.2 300.9S5691.8 281.5 5706.7 287.7 5747.5 308 5747.5 308A22.1 22.1 0 0 1 5757 332.1L5752.8 354.8A11.2 11.2 0 0 1 5735.9 362.3L5688.6 338.7A14.3 14.3 0 0 1 5683.9 322.4ZM5600.9 555S5605.4 535.7 5620.3 541.9 5661.1 562.2 5661.1 562.2A22 22 0 0 1 5670.6 586.2L5666.4 608.9A11.1 11.1 0 0 1 5649.6 616.5L5602.3 592.9A14.3 14.3 0 0 1 5597.6 576.6ZM5403.2 300.9S5407.7 281.5 5422.6 287.7 5463.4 308 5463.4 308A22.1 22.1 0 0 1 5472.9 332.1L5468.7 354.8A11.2 11.2 0 0 1 5451.9 362.3L5404.6 338.7A14.3 14.3 0 0 1 5399.9 322.4ZM5943.5 607.8S5948.1 588.5 5963 594.7 6003.8 615 6003.8 615A22.1 22.1 0 0 1 6013.3 639L6009.1 661.7A11.1 11.1 0 0 1 5992.2 669.2L5944.9 645.7A14.4 14.4 0 0 1 5940.2 629.4ZM5785 603.8S5787.7 592.4 5796.5 596.1 5820.5 608.1 5820.5 608.1A13 13 0 0 1 5826.1 622.2L5823.7 635.6A6.6 6.6 0 0 1 5813.7 640L5785.9 626.1A8.5 8.5 0 0 1 5783.1 616.5ZM5332.2 445.1S5334.9 433.7 5343.7 437.4 5367.7 449.4 5367.7 449.4A13 13 0 0 1 5373.3 463.5L5370.8 476.9A6.6 6.6 0 0 1 5360.9 481.3L5333 467.4A8.4 8.4 0 0 1 5330.3 457.7ZM5261 326.8S5263.7 315.5 5272.5 319.1 5296.5 331.1 5296.5 331.1A13 13 0 0 1 5302.1 345.2L5299.6 358.6A6.6 6.6 0 0 1 5289.7 363L5261.8 349.1A8.4 8.4 0 0 1 5259.1 339.5ZM5218.3 680.7H5212.9C5206.5 680.7 5202.4 678.7 5200.8 674.5A11.8 11.8 0 0 1 5188.6 680.7C5178.1 680.7 5172.9 673.9 5172.9 660.3 5172.9 647 5178.1 640.4 5188.6 640.4H5205.3V664.3C5205.3 670.4 5208 673.4 5213.4 673.4H5218.2ZM5197.4 647.2H5189.1A7.1 7.1 0 0 0 5182.3 650.7 20.4 20.4 0 0 0 5180.7 660.2 21.1 21.1 0 0 0 5182.3 669.7 7 7 0 0 0 5189.1 673.3 6.9 6.9 0 0 0 5195.8 669.7 21 21 0 0 0 5197.5 660.2ZM5190.1 627.8A4.5 4.5 0 0 1 5185.7 632.4 4.5 4.5 0 0 1 5181.6 627.8 4.5 4.5 0 0 1 5185.9 623.2 4.5 4.5 0 0 1 5190.3 627.8M5201.3 627.8A4.6 4.6 0 0 1 5197 632.4 4.5 4.5 0 0 1 5192.8 627.8 4.4 4.4 0 0 1 5197 623.2 4.5 4.5 0 0 1 5201.3 627.8M5238.1 664.9A15.8 15.8 0 0 1 5233.9 676.3 14.8 14.8 0 0 1 5222.6 680.7H5216.3V673.4H5222.2Q5230.3 673.4 5230.3 664.3V643L5238.1 640.5ZM5233.2 693.3A4.3 4.3 0 1 1 5224.7 693.3 4.3 4.3 0 1 1 5233.2 693.3M5268.4 680.7H5259.7A10.4 10.4 0 0 1 5248.8 669.2V625.8L5256.6 623.1V668.9C5256.6 671.8 5257.9 673.2 5260.6 673.2H5268.4ZM5321.5 680.7H5266.3V673.4H5303.3V670.2A45.7 45.7 0 0 0 5301.6 655.5 10.6 10.6 0 0 0 5290.7 647.9 16.4 16.4 0 0 0 5278.2 654.9L5272.6 649.2A24.6 24.6 0 0 1 5290.7 640.5 17.5 17.5 0 0 1 5308 650.2 46.9 46.9 0 0 1 5311.3 670.1V673.1H5321.5ZM5394.5 680.7H5319.6V673.2H5329.4V650.6L5337.2 648.2V673.2H5353.5V646.9L5361.3 644.4V673.3H5377.8V642.9L5385.6 640.5V673.3H5394.5ZM5413.5 664.9A16.2 16.2 0 0 1 5409.3 676.3 14.9 14.9 0 0 1 5398 680.7H5392.7V673.2H5397.6C5402.9 673.2 5405.7 670.2 5405.7 664.1V625.8L5413.5 623.4ZM5432 680.7H5424.2V625.8L5432 623.1ZM5527.1 678.3C5527.1 691.4 5519.8 697.8 5505 697.8A20.9 20.9 0 0 1 5487.1 690.4 40.6 40.6 0 0 1 5481.3 670L5489.2 667.2A31.6 31.6 0 0 0 5492.7 684.8 14.4 14.4 0 0 0 5505.1 689.9 18.8 18.8 0 0 0 5515.3 687.7 10.7 10.7 0 0 0 5519.2 678.4V625.9L5527 623.3ZM5578.7 680.7H5568.9A21.9 21.9 0 0 1 5563.5 692.7 15.2 15.2 0 0 1 5551.6 697.9 17 17 0 0 1 5541.9 695.4L5538.4 687.2A27 27 0 0 0 5551.4 690.4 10.4 10.4 0 0 0 5561.1 680.6H5554.7A16.3 16.3 0 0 1 5541.9 675.3 18.9 18.9 0 0 1 5537.7 662.4 25.8 25.8 0 0 1 5541.3 648.1 14.3 14.3 0 0 1 5554.1 641.5C5564.5 641.5 5569.8 648.5 5569.8 662.4 5569.8 665.2 5569.8 668.8 5569.6 673.3H5578.6ZM5562 662.5A26.2 26.2 0 0 0 5560.9 653.5 6.7 6.7 0 0 0 5554.1 649C5548.4 649 5545.6 653.5 5545.6 662.5 5545.6 669.8 5548.6 673.4 5554.7 673.4H5562ZM5611.8 680.7H5606.4A14.6 14.6 0 0 1 5594.9 675.9 14.2 14.2 0 0 1 5583.3 680.7H5576.7V673.2H5582.8C5588.3 673.2 5591 670.2 5591 664.1V625.8L5598.8 623.1V664.5C5598.8 670.3 5601.5 673.1 5606.9 673.1H5611.7ZM5653.5 680.7H5609.7V673.4H5645.6V670.2A45.5 45.5 0 0 0 5643.8 655.5 10.6 10.6 0 0 0 5633.1 647.9 16.6 16.6 0 0 0 5620.5 654.9L5614.9 649.2A24.7 24.7 0 0 1 5633.1 640.5 17.6 17.6 0 0 1 5650.3 650.2 48.7 48.7 0 0 1 5653.5 670.1ZM6139 744.3A28.9 28.9 0 0 1 6130.3 765.5 29.7 29.7 0 0 1 6088.2 765.5 29 29 0 0 1 6079.5 744.3 27.8 27.8 0 0 1 6082.3 731.7 28.9 28.9 0 0 1 6090.3 721.5 28.5 28.5 0 0 1 6109 714.6 29.2 29.2 0 0 1 6121.4 717.2 28.6 28.6 0 0 1 6134.2 728.1 29.6 29.6 0 0 1 6139 744.4M6109.1 718.9A23.5 23.5 0 0 0 6091.6 726.4 25.8 25.8 0 0 0 6091.6 762.5 24.5 24.5 0 0 0 6126.9 762.5 25.1 25.1 0 0 0 6134.2 744.3 27.6 27.6 0 0 0 6131.4 732.6 24 24 0 0 0 6123.8 723.5 24.9 24.9 0 0 0 6109.1 718.8M6112.2 747.2L6123.4 761.6H6115.4L6105.1 748V761.6H6098.6V727.2H6105.5A17.3 17.3 0 0 1 6116 729.7 9.5 9.5 0 0 1 6119.6 737.4 10.2 10.2 0 0 1 6117.7 743.4 9.4 9.4 0 0 1 6112.7 747ZM6105.1 742.4H6106.2C6110.9 742.4 6113.3 740.7 6113.3 737.5S6111 732.9 6106.5 732.9H6105Z", - "width": 6139 - }, - "search": [ - "powered-by-cs" - ] - }, - { - "uid": "bf17051ca639c4db6f66b531ae98b29e", - "css": "menu", - "code": 59565, - "src": "custom_icons", - "selected": true, - "svg": { - "path": "", - "width": 3500 - }, - "search": [ - "menu" - ] - }, { "uid": "bffd96d1421ef42e3a097855b3820d42", "css": "obese-bmi-r-1", @@ -2496,6 +2468,48 @@ "speechtotext" ] }, + { + "uid": "4c794fd235deed1e405c7a0d77262155", + "css": "search-medicines", + "code": 59748, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M299 341.8L384.4 427.2 341.6 470A60.5 60.5 0 1 1 256.1 384.6ZM384.6 256.1A60.5 60.5 0 1 1 470 341.6L427.3 384.7 341.8 299.2ZM363.2 0A362.9 362.9 0 0 1 640.3 597.5L747.7 704.9 704.9 747.7 597.5 640.3A363.1 363.1 0 1 1 363.2 0ZM213.3 512.9A121.2 121.2 0 0 0 384.6 512.9L513 384.5A121.1 121.1 0 1 0 341.8 213.3L213.4 341.9A121.2 121.2 0 0 0 213.4 513.1ZM998.2 914.4L811 727.3 725.4 812.9 912.6 1000Z", + "width": 998 + }, + "search": [ + "search-medicines" + ] + }, + { + "uid": "deaae97b03da57c5c739ce04877b4d6e", + "css": "discharge-patients", + "code": 59749, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M44.4 4.2A29.3 29.3 0 0 0 0 29.3V794.9A29.3 29.3 0 0 0 14.2 820.1L248.6 995.9A29.3 29.3 0 0 0 293 970.8V205.1A29.3 29.3 0 0 0 278.8 180ZM205 587.9A29.3 29.3 0 1 1 234.3 558.6 29.3 29.3 0 0 1 205 587.9ZM205 587.9M807.3 329.1A29.3 29.3 0 0 0 761.7 353.5V382.8H498A29.3 29.3 0 0 0 468.8 412.1V470.7A29.3 29.3 0 0 0 498 500H761.7V529.3A29.3 29.3 0 0 0 807.3 553.7L924.4 465.8A29.3 29.3 0 0 0 924.4 417.1ZM807.3 329.1M410.2 470.7V412.1A88 88 0 0 1 498 324.2H644.5V29.3A29.3 29.3 0 0 0 615.3 0H136.4L312.2 131.8A88.4 88.4 0 0 1 351.6 205.1V824.2H615.3A29.3 29.3 0 0 0 644.5 794.9V558.6H498A88 88 0 0 1 410.2 470.7ZM410.2 470.7", + "width": 938 + }, + "search": [ + "discharge-patients" + ] + }, + { + "uid": "1c6f710dc04109a0329ee1f833784815", + "css": "referral-discharge", + "code": 59750, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M681.4 793.1L735.5 860.8 683 913.3 659.1 793.7C663.5 793.4 667.9 793.1 672.4 793.1ZM791.7 793.1L758.6 834.3 725.6 793.1ZM835.9 793.1H844.8C849.3 793.1 853.7 793.4 858.1 793.7L834.2 913.3 781.7 860.8ZM913.8 655.1H912.8A154.1 154.1 0 0 0 913.8 637.9V586.2A34.5 34.5 0 0 1 913.8 655.1ZM603.4 482.7A103.6 103.6 0 0 1 706.9 379.3H810.3A103.6 103.6 0 0 1 913.8 482.8V551.7H844.8A34.5 34.5 0 0 1 810.3 517.2V448.3H775.9V465.5A86.3 86.3 0 0 1 689.7 551.7H603.5ZM603.4 655.1A34.5 34.5 0 1 1 603.4 586.2V637.9A154.1 154.1 0 0 0 604.4 655.1ZM637.9 637.9V586.2H689.6A120.4 120.4 0 0 0 781.2 543.9 69 69 0 0 0 844.7 586.2H879.2V637.9A120.6 120.6 0 0 1 637.9 637.9ZM1000 1000H517.2V948.3A155.6 155.6 0 0 1 625.2 800.5L655.4 951.7A17.3 17.3 0 0 0 667.3 964.8 17.6 17.6 0 0 0 672.3 965.5 17.3 17.3 0 0 0 684.5 960.4L758.5 886.4 832.5 960.5A17.2 17.2 0 0 0 861.7 951.7L891.9 800.5A155.6 155.6 0 0 1 999.8 948.3ZM164.1 413.8L218.3 481.5 165.7 534 141.8 414.5C146.3 414.1 150.7 413.8 155.2 413.8ZM274.5 413.8L241.4 455 208.3 413.8ZM318.6 413.8H327.6C332.1 413.8 336.5 414.1 340.9 414.4L317 534 264.5 481.5ZM396.5 275.8H395.5A154 154 0 0 0 396.5 258.6V206.9A34.5 34.5 0 0 1 396.5 275.8ZM86.2 103.5A103.6 103.6 0 0 1 189.7 0H293.1A103.6 103.6 0 0 1 396.6 103.5V172.4H327.6A34.5 34.5 0 0 1 293.1 137.9V69H258.6V86.2A86.3 86.3 0 0 1 172.4 172.4H86.2ZM86.2 275.9A34.5 34.5 0 1 1 86.2 206.9V258.6A154 154 0 0 0 87.2 275.9ZM120.6 258.6V206.9H172.4A120.4 120.4 0 0 0 264 164.6 69 69 0 0 0 327.5 206.9H362V258.6A120.6 120.6 0 1 1 120.7 258.6ZM482.8 620.7H0V569A155.6 155.6 0 0 1 107.9 421.2L138.2 572.3A17.3 17.3 0 0 0 150.1 585.5 17.6 17.6 0 0 0 155.1 586.2 17.3 17.3 0 0 0 167.3 581.1L241.3 507.1 315.3 581.2A17.2 17.2 0 0 0 344.4 572.3L374.7 421.2A155.6 155.6 0 0 1 482.6 569ZM172.4 827.6A17.2 17.2 0 0 0 155.2 810.3H127.8L206.8 731.3 286.1 810.2H258.8A17.2 17.2 0 0 0 241.6 827.4 206.9 206.9 0 0 0 333.6 999.5 172.6 172.6 0 0 1 172.4 827.6ZM816 71.1A20.5 20.5 0 0 0 784.2 88.1V108.6H599.9A20.5 20.5 0 0 0 579.5 129.1V170A20.5 20.5 0 0 0 599.9 190.5H784.2V211A20.5 20.5 0 0 0 816 228L897.9 166.6A20.5 20.5 0 0 0 897.9 132.5ZM816 71.1", + "width": 1000 + }, + "search": [ + "referral-discharge" + ] + }, { "uid": "fbbe1c278b442a4840b03064fe4a2ea4", "css": "respiration-rate-1", diff --git a/lib/icons_app/doctor_app_icons.dart b/lib/icons_app/doctor_app_icons.dart index 7ab4e306..5e5ce23a 100644 --- a/lib/icons_app/doctor_app_icons.dart +++ b/lib/icons_app/doctor_app_icons.dart @@ -131,7 +131,8 @@ class DoctorApp { IconData(0xe833, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData edit = IconData(0xe834, fontFamily: _kFontFam, fontPackage: _kFontPkg); - // static const IconData lab_results = IconData(0xe835, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData lab_results2 = + IconData(0xe835, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData leaves = IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData logout = @@ -260,8 +261,6 @@ class DoctorApp { IconData(0xe874, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData ovrweight_bmi_1 = IconData(0xe875, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData powered_by_cs_1 = - IconData(0xe876, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData qr_code_3 = IconData(0xe877, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData reschedule__1 = @@ -360,8 +359,6 @@ class DoctorApp { IconData(0xe8a6, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData obese_bmi_r_1 = IconData(0xe8a9, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu = - IconData(0xe8ad, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData inpatient = IconData(0xe959, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData discharge = @@ -378,4 +375,10 @@ class DoctorApp { IconData(0xe95f, fontFamily: _kFontFam, fontPackage: _kFontPkg); static const IconData speechtotext = IconData(0xe960, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_medicines = + IconData(0xe964, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData discharge_patients = + IconData(0xe965, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referral_discharge = + IconData(0xe966, fontFamily: _kFontFam, fontPackage: _kFontPkg); } diff --git a/lib/screens/home/home_page_card.dart b/lib/screens/home/home_page_card.dart index 4bf1e33a..216a8c3f 100644 --- a/lib/screens/home/home_page_card.dart +++ b/lib/screens/home/home_page_card.dart @@ -60,6 +60,4 @@ class HomePageCard extends StatelessWidget { ), ); } - - getDashboardWidget() {} } diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 99ca0619..39fc7a8c 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -12,9 +12,11 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/profile_req_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/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/search_medicine_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/DischargedPatientPage.dart'; import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; @@ -457,7 +459,6 @@ class _HomeScreenState extends State { SizedBox( height: 10, ), - new Container( height: 130, child: new ListView( @@ -546,13 +547,13 @@ class _HomeScreenState extends State { }, ), HomePageCard( - color: Colors.red[800], + color: Colors.black, margin: EdgeInsets.all(5), child: Column( mainAxisAlignment: - MainAxisAlignment.center, + MainAxisAlignment.center, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Padding( padding: EdgeInsets.only( @@ -586,27 +587,27 @@ class _HomeScreenState extends State { }, ), HomePageCard( - color: Colors.grey[300], + color: Colors.red[800], margin: EdgeInsets.all(5), child: Column( mainAxisAlignment: - MainAxisAlignment.center, + MainAxisAlignment.center, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Padding( padding: EdgeInsets.only( top: 10, left: 10, right: 0), child: Icon( - DoctorApp.referral_1, + DoctorApp.discharge_patients, size: 35, - color: Colors.black, + color: Colors.white, )), Container( padding: EdgeInsets.all(10), child: AppText( 'Discharged Patients', - color: Colors.black, + color: Colors.white, textAlign: TextAlign.start, fontSize: 15, )) @@ -625,27 +626,27 @@ class _HomeScreenState extends State { }, ), HomePageCard( - color: Colors.red[800], + color: Colors.grey[300], margin: EdgeInsets.all(5), child: Column( mainAxisAlignment: - MainAxisAlignment.center, + MainAxisAlignment.center, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ Padding( padding: EdgeInsets.only( top: 10, left: 10, right: 0), child: Icon( - DoctorApp.referral_1, + DoctorApp.referral_discharge, size: 35, - color: Colors.white, + color: Colors.black, )), Container( padding: EdgeInsets.all(10), child: AppText( 'Referral Discharged', - color: Colors.white, + color: Colors.black, textAlign: TextAlign.start, fontSize: 15, )) @@ -684,7 +685,7 @@ class _HomeScreenState extends State { padding: EdgeInsets.all(10), child: AppText( TranslationBase.of(context) - .searchmedicinepatient, + .searchPatient, color: Colors.white, textAlign: TextAlign.start, fontSize: 13, @@ -697,13 +698,49 @@ class _HomeScreenState extends State { context, MaterialPageRoute( builder: (context) => - SearchMedicinePatientScreen(), + PatientSearchScreen(), )); }, ), - + HomePageCard( + color: Colors.red[800], + margin: EdgeInsets.all(5), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.search_medicines, + size: 32, + color: Colors.white, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context) + .searchMedicine, + color: Colors.white, + textAlign: TextAlign.start, + fontSize: 13, + )) + ], + ), + hasBorder: false, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + MedicineSearchScreen(), + )); + }, + ) ])), - Row( // mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index f2509eeb..3ce5c1be 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -122,7 +122,7 @@ class _MedicineSearchState extends State { myController.text = model.searchText; return AppScaffold( // baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, appBarTitle: TranslationBase.of(context).searchMedicine, body: SingleChildScrollView( child: FractionallySizedBox( @@ -134,7 +134,7 @@ class _MedicineSearchState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ SizedBox( - height: SizeConfig.screenHeight * .16, + height: 20, ), FractionallySizedBox( widthFactor: 0.9, @@ -157,6 +157,9 @@ class _MedicineSearchState extends State { ), ), ), + SizedBox( + height: 20, + ), FractionallySizedBox( widthFactor: 0.9, child: Container( @@ -197,7 +200,7 @@ class _MedicineSearchState extends State { ), if (myController.text != '') Container( - height: MediaQuery.of(context).size.height * 0.5, + height: MediaQuery.of(context).size.height * 0.6, child: ListView.builder( padding: const EdgeInsets.only(top: 20), diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 273ea23f..c0541103 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -124,260 +124,240 @@ class _PatientSearchScreenState extends State { }, child: AppScaffold( appBarTitle: TranslationBase.of(context).searchPatient, - isShowAppBar: false, - body: ListView( - children: [ - RoundedContainer( - child: Column( - children: [ - Column( - children: [ - // Container( - // child: Icon( - // DoctorApp.search_patient_1, - // size: 100, - // color: Colors.black, - // ), - // margin: EdgeInsets.only(top: 10), - // ), - // Padding( - // padding: const EdgeInsets.only(top: 12.0), - // child: AppText( - // TranslationBase.of(context) - // .searchPatientImageCaptionTitle - // .toUpperCase(), - // fontWeight: FontWeight.bold, - // fontSize: SizeConfig.heightMultiplier * 2.5, - // ), - // ), - // Padding( - // padding: const EdgeInsets.only(top: 5.0), - // child: AppText( - // TranslationBase.of(context) - // .searchPatientImageCaptionBody, - // fontSize: SizeConfig.heightMultiplier * 2, - // ), - // ) - ], - ), - Container( - padding: EdgeInsets.all(15), - width: SizeConfig.screenWidth * 1, - child: Form( - key: _formKey, - autovalidate: _autoValidate, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 15, - ), - if (_selectedType != '7') - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .patpatientIDMobilenationalientID, - borderColor: Colors.white, - textInputType: TextInputType.number, - textInputAction: TextInputAction.done, - inputFormatter: ONLY_NUMBERS, - focusNode: _nodeText1, - onSaved: (value) { - if (value != null && value != '') { - if (value.length == 10 && - (value[0] == '2' || value[0] == '1')) { - _patientSearchFormValues - .IdentificationNo = value; - _patientSearchFormValues.Searchtype = 2; - _patientSearchFormValues.setPatientID = 0; - } else if ((value.length == 10 || - value.length == 9) && - ((value[0] == '0' && value[1] == '5') || - value[0] == '5')) { - _patientSearchFormValues.MobileNo = value; - _patientSearchFormValues.Searchtype = 0; - } else { - _patientSearchFormValues.setPatientID = - int.parse(value); - _patientSearchFormValues.Searchtype = 1; + isShowAppBar: true, + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + RoundedContainer( + showBorder: false, + child: Column( + children: [ + Column( + children: [ + // Container( + // child: Icon( + // DoctorApp.search_patient_1, + // size: 100, + // color: Colors.black, + // ), + // margin: EdgeInsets.only(top: 10), + // ), + // Padding( + // padding: const EdgeInsets.only(top: 12.0), + // child: AppText( + // TranslationBase.of(context) + // .searchPatientImageCaptionTitle + // .toUpperCase(), + // fontWeight: FontWeight.bold, + // fontSize: SizeConfig.heightMultiplier * 2.5, + // ), + // ), + // Padding( + // padding: const EdgeInsets.only(top: 5.0), + // child: AppText( + // TranslationBase.of(context) + // .searchPatientImageCaptionBody, + // fontSize: SizeConfig.heightMultiplier * 2, + // ), + // ) + ], + ), + Container( + padding: EdgeInsets.all(15), + width: SizeConfig.screenWidth * 1, + child: Form( + key: _formKey, + autovalidate: _autoValidate, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 15, + ), + if (_selectedType != '7') + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(10), + child: AppTextFormField( + labelText: TranslationBase.of(context) + .patpatientIDMobilenationalientID, + borderColor: Colors.white, + textInputType: TextInputType.number, + textInputAction: TextInputAction.done, + inputFormatter: ONLY_NUMBERS, + focusNode: _nodeText1, + onSaved: (value) { + if (value != null && value != '') { + if (value.length == 10 && + (value[0] == '2' || + value[0] == '1')) { + _patientSearchFormValues + .IdentificationNo = value; + _patientSearchFormValues.Searchtype = 2; + _patientSearchFormValues.setPatientID = + 0; + } else if ((value.length == 10 || + value.length == 9) && + ((value[0] == '0' && + value[1] == '5') || + value[0] == '5')) { + _patientSearchFormValues.MobileNo = + value; + _patientSearchFormValues.Searchtype = 0; + } else { + _patientSearchFormValues.setPatientID = + int.parse(value); + _patientSearchFormValues.Searchtype = 1; + } } - } - // else{ + // else{ - // } + // } - // value == null || value == '' - // ? _patientSearchFormValues.setPatientID = - // 0 - // : _patientSearchFormValues.setPatientID = - // int.parse(value); + // value == null || value == '' + // ? _patientSearchFormValues.setPatientID = + // 0 + // : _patientSearchFormValues.setPatientID = + // int.parse(value); - // if (value != null && - // value.toString().trim().isEmpty) { - // _patientSearchFormValues.setPatientID = 0; - // } - }, + // if (value != null && + // value.toString().trim().isEmpty) { + // _patientSearchFormValues.setPatientID = 0; + // } + }, + ), ), + SizedBox( + height: 10, ), - SizedBox( - height: 10, - ), - // Row( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // InkWell( - // child: this.isView == false - // ? AppText( - // TranslationBase.of(context) - // .searchWithOther, - // color: Colors.red, - // fontWeight: FontWeight.bold, - // ) - // : AppText( - // TranslationBase.of(context) - // .hideOtherCriteria, - // color: Colors.red, - // fontWeight: FontWeight.bold), - // onTap: () { - // setState(() { - // this.isView = !this.isView; - // }); - // }, - // ) - // ], - // ), - isView == true - ? Column(children: [ - SizedBox( - height: 10, - ), - Container( - height: 65.0, - decoration: ShapeDecoration( - shape: RoundedRectangleBorder( - side: BorderSide( - width: 1.0, - style: BorderStyle.solid, - color: HexColor("#CCCCCC")), - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - ), + // Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // InkWell( + // child: this.isView == false + // ? AppText( + // TranslationBase.of(context) + // .searchWithOther, + // color: Colors.red, + // fontWeight: FontWeight.bold, + // ) + // : AppText( + // TranslationBase.of(context) + // .hideOtherCriteria, + // color: Colors.red, + // fontWeight: FontWeight.bold), + // onTap: () { + // setState(() { + // this.isView = !this.isView; + // }); + // }, + // ) + // ], + // ), + isView == true + ? Column(children: [ + SizedBox( + height: 10, ), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: - SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: _selectedType, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return PATIENT_TYPE_Des.map( + Container( + height: 65.0, + decoration: ShapeDecoration( + shape: RoundedRectangleBorder( + side: BorderSide( + width: 1.0, + style: BorderStyle.solid, + color: HexColor("#CCCCCC")), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + ), + ), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only( + top: SizeConfig.widthMultiplier * + 0.9, + bottom: SizeConfig.widthMultiplier * + 0.9, + right: + SizeConfig.widthMultiplier * 3, + left: + SizeConfig.widthMultiplier * 3), + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: + DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: _selectedType, + iconSize: 25, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return PATIENT_TYPE_Des.map( + (item) { + return Row( + mainAxisSize: + MainAxisSize.max, + children: [ + !projectsProvider + .isArabic + ? AppText( + item['text'], + fontSize: SizeConfig + .textMultiplier * + 2.1, + ) + : AppText( + item['text_ar'], + fontSize: SizeConfig + .textMultiplier * + 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (String newValue) => + { + setState(() { + _selectedType = newValue; + selectedPatientType = + int.parse( + _selectedType); + }) + }, + items: PATIENT_TYPE_Des.map( (item) { - return Row( - mainAxisSize: - MainAxisSize.max, - children: [ - !projectsProvider.isArabic - ? AppText( - item['text'], - fontSize: SizeConfig - .textMultiplier * - 2.1, - ) - : AppText( - item['text_ar'], - fontSize: SizeConfig - .textMultiplier * - 2.1, - ), - ], + !projectsProvider.isArabic + ? itemText = item['text'] + : itemText = + item['text_ar']; + return DropdownMenuItem( + child: Text( + itemText, + textAlign: TextAlign.end, + ), + value: item['val'], ); - }).toList(); - }, - onChanged: (String newValue) => { - setState(() { - _selectedType = newValue; - selectedPatientType = - int.parse(_selectedType); - }) - }, - items: - PATIENT_TYPE_Des.map((item) { - !projectsProvider.isArabic - ? itemText = item['text'] - : itemText = - item['text_ar']; - return DropdownMenuItem( - child: Text( - itemText, - textAlign: TextAlign.end, - ), - value: item['val'], - ); - }).toList(), - )), - ), - ], + }).toList(), + )), + ), + ], + ), ), ), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .firstName, - borderColor: Colors.white, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setFirstName = "0" - : _patientSearchFormValues - .setFirstName = value; - - if (value != null && - value.toString().trim().isEmpty) { - _patientSearchFormValues - .setFirstName = "0"; - } - }, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_LETTERS), - ), - SizedBox( - height: 10, - ), - if (_selectedType != '7') + SizedBox( + height: 10, + ), Container( decoration: BoxDecoration( borderRadius: BorderRadius.all( @@ -387,223 +367,274 @@ class _PatientSearchScreenState extends State { color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(10), child: AppTextFormField( - labelText: TranslationBase.of(context) - .phoneNumber, - borderColor: Colors.white, - textInputType: TextInputType.number, - textInputAction: TextInputAction.done, - inputFormatter: ONLY_NUMBERS, - focusNode: _nodeText1, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setPatientMobileNumber = "0" - : _patientSearchFormValues - .setPatientMobileNumber = - value; + labelText: TranslationBase.of(context) + .firstName, + borderColor: Colors.white, + onSaved: (value) { + value == null || value == '' + ? _patientSearchFormValues + .setFirstName = "0" + : _patientSearchFormValues + .setFirstName = value; + + if (value != null && + value + .toString() + .trim() + .isEmpty) { + _patientSearchFormValues + .setFirstName = "0"; + } + }, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_LETTERS), + ), + SizedBox( + height: 10, + ), + if (_selectedType != '7') + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(10), + child: AppTextFormField( + labelText: TranslationBase.of(context) + .phoneNumber, + borderColor: Colors.white, + textInputType: TextInputType.number, + textInputAction: TextInputAction.done, + inputFormatter: ONLY_NUMBERS, + focusNode: _nodeText1, + onSaved: (value) { + value == null || value == '' + ? _patientSearchFormValues + .setPatientMobileNumber = + "0" + : _patientSearchFormValues + .setPatientMobileNumber = + value; - if (value != null && - value.toString().trim().isEmpty) { - _patientSearchFormValues - .setPatientMobileNumber = "0"; - } - }, + if (value != null && + value + .toString() + .trim() + .isEmpty) { + _patientSearchFormValues + .setPatientMobileNumber = "0"; + } + }, + ), ), + SizedBox( + height: 10, ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .middleName, - borderColor: Colors.white, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setMiddleName = "0" - : _patientSearchFormValues - .setMiddleName = value; - if (value != null && - value.toString().trim().isEmpty) { - _patientSearchFormValues - .setMiddleName = "0"; - } - }, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_LETTERS), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .lastName, - borderColor: Colors.white, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setLastName = "0" - : _patientSearchFormValues - .setLastName = value; - if (value != null && - value.toString().trim().isEmpty) { - _patientSearchFormValues - .setLastName = "0"; - } - }, - inputFormatter: ONLY_LETTERS), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(10), + child: AppTextFormField( + labelText: TranslationBase.of(context) + .middleName, + borderColor: Colors.white, + onSaved: (value) { + value == null || value == '' + ? _patientSearchFormValues + .setMiddleName = "0" + : _patientSearchFormValues + .setMiddleName = value; + if (value != null && + value + .toString() + .trim() + .isEmpty) { + _patientSearchFormValues + .setMiddleName = "0"; + } + }, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_LETTERS), + ), + SizedBox( + height: 10, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(10), + child: AppTextFormField( + labelText: TranslationBase.of(context) + .lastName, + borderColor: Colors.white, + onSaved: (value) { + value == null || value == '' + ? _patientSearchFormValues + .setLastName = "0" + : _patientSearchFormValues + .setLastName = value; + if (value != null && + value + .toString() + .trim() + .isEmpty) { + _patientSearchFormValues + .setLastName = "0"; + } + }, + inputFormatter: ONLY_LETTERS), + ), + SizedBox( + height: 10, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(10), + child: AppTextFormField( + labelText: TranslationBase.of(context) + .patientID, + borderColor: Colors.white, + textInputType: TextInputType.number, + inputFormatter: ONLY_NUMBERS, + focusNode: _nodeText2, + onSaved: (value) { + value == null || value == '' + ? _patientSearchFormValues + .setPatientID = 0 + : _patientSearchFormValues + .setPatientID = + int.parse(value); + if (value != null && + value + .trim() + .toString() + .isEmpty) { + _patientSearchFormValues + .setPatientID = 0; + } + }), + ), + SizedBox( + height: 10, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(10), + child: AppTextFormField( labelText: TranslationBase.of(context) - .patientID, + .patientFile, borderColor: Colors.white, textInputType: TextInputType.number, + focusNode: _nodeText3, inputFormatter: ONLY_NUMBERS, - focusNode: _nodeText2, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues - .setPatientID = 0 - : _patientSearchFormValues - .setPatientID = - int.parse(value); - if (value != null && - value.trim().toString().isEmpty) { - _patientSearchFormValues - .setPatientID = 0; - } - }), - ), - SizedBox( - height: 10, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(10), - child: AppTextFormField( - labelText: TranslationBase.of(context) - .patientFile, - borderColor: Colors.white, - textInputType: TextInputType.number, - focusNode: _nodeText3, - inputFormatter: ONLY_NUMBERS, - onSaved: (value) {}, + onSaved: (value) {}, + ), ), + (!(_selectedType == '2' || + _selectedType == '4')) + ? DynamicElements( + _patientSearchFormValues, + isFormSubmitted) + : SizedBox( + height: 0, + ), + SizedBox( + height: 10, + ), + Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: + HexColor("#CCCCCC"))), + height: 25, + width: 25, + child: Checkbox( + value: onlyArrived, + checkColor: HexColor("#2A930A"), + activeColor: Colors.white, + onChanged: (bool newValue) { + setState(() { + onlyArrived = newValue; + }); + }), + ), + SizedBox( + width: 12, + ), + AppText( + TranslationBase.of(context) + .onlyArrivedPatient, + fontSize: + SizeConfig.textMultiplier * + 2), + ])), + SizedBox( + height: 10, + ), + ]) + : SizedBox( + height: 0, ), - (!(_selectedType == '2' || - _selectedType == '4')) - ? DynamicElements( - _patientSearchFormValues, - isFormSubmitted) - : SizedBox( - height: 0, - ), - SizedBox( - height: 10, - ), - Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - height: 25, - width: 25, - child: Checkbox( - value: onlyArrived, - checkColor: HexColor("#2A930A"), - activeColor: Colors.white, - onChanged: (bool newValue) { - setState(() { - onlyArrived = newValue; - }); - }), - ), - SizedBox( - width: 12, - ), - AppText( - TranslationBase.of(context) - .onlyArrivedPatient, - fontSize: - SizeConfig.textMultiplier * 2), - ])), - SizedBox( - height: 10, - ), - ]) - : SizedBox( - height: SizeConfig.screenHeight * .45, - ), - ], + ], + ), ), ), + ], + ), + ), + Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context).search, + color: Colors.red[800], + onPressed: () { + _validateInputs(); + }, + ), + ], + ), ), ], ), - ), - Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context).search, - color: Colors.red[800], - onPressed: () { - _validateInputs(); - }, - ), - ], - ), - ), - ], - ), - ], - ), + ]), ), ); } diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index d182ea9e..7820b16c 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -21,7 +21,8 @@ class AddSickLeavScreen extends StatelessWidget { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getSickLeave(patient.patientMRN??patient.patientId), + onModelReady: (model) => + model.getSickLeave(patient.patientMRN ?? patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index abf907a7..6c28b488 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -55,6 +55,7 @@ class SMSOTP { displayDialog(BuildContext context) async { return showDialog( context: context, + barrierColor: Colors.black.withOpacity(0.7), builder: (context) { projectProvider = Provider.of(context); return AlertDialog( @@ -84,14 +85,14 @@ class SMSOTP { ? Padding( child: Icon( DoctorApp.verify_sms_1, - size: 40, + size: 50, ), padding: EdgeInsets.only(bottom: 20), ) : Padding( child: Icon( DoctorApp.verify_whtsapp, - size: 40, + size: 50, ), padding: EdgeInsets.only(bottom: 20), ), @@ -114,7 +115,7 @@ class SMSOTP { ) ])), Padding( - padding: EdgeInsets.only(top: 5), + padding: EdgeInsets.only(top: 5, right: 5), child: AppText( TranslationBase.of(context).verificationMessage + ' XXXXXX' + @@ -122,7 +123,9 @@ class SMSOTP { .toString() .substring(mobileNo.toString().length - 3), textAlign: TextAlign.start, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.bold, + fontSize: 14, + maxLines: 2, )), Form( key: verifyAccountForm, @@ -131,10 +134,11 @@ class SMSOTP { child: Directionality( textDirection: TextDirection.ltr, child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - width: SizeConfig.realScreenWidth * 0.15, + width: SizeConfig.realScreenWidth * 0.16, + margin: EdgeInsets.all(5), child: TextFormField( textInputAction: TextInputAction.next, style: buildTextStyle(), @@ -162,7 +166,8 @@ class SMSOTP { ), ), Container( - width: SizeConfig.realScreenWidth * 0.15, + width: SizeConfig.realScreenWidth * 0.16, + margin: EdgeInsets.all(5), child: TextFormField( focusNode: focusD2, textInputAction: TextInputAction.next, @@ -189,7 +194,8 @@ class SMSOTP { validator: validateCodeDigit), ), Container( - width: SizeConfig.realScreenWidth * 0.15, + margin: EdgeInsets.all(5), + width: SizeConfig.realScreenWidth * 0.16, child: TextFormField( focusNode: focusD3, textInputAction: TextInputAction.next, @@ -216,7 +222,8 @@ class SMSOTP { }, validator: validateCodeDigit)), Container( - width: SizeConfig.realScreenWidth * 0.15, + margin: EdgeInsets.all(5), + width: SizeConfig.realScreenWidth * 0.16, child: TextFormField( focusNode: focusD4, maxLength: 1, @@ -280,15 +287,15 @@ class SMSOTP { // contentPadding: EdgeInsets.only(top: 20, bottom: 20), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10)), - borderSide: BorderSide(color: Colors.grey[100]), + borderSide: BorderSide(color: Colors.grey[300]), ), focusedBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[100]), + borderSide: BorderSide(color: Colors.grey[300]), ), errorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), - borderSide: BorderSide(color: Colors.grey[100]), + borderSide: BorderSide(color: Colors.grey[300]), ), focusedErrorBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)), From 4e37a1621179499516c0ca561422a6662a3427f3 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 25 Apr 2021 18:09:45 +0300 Subject: [PATCH 07/50] add PatientSearchRequestModel --- lib/client/base_app_client.dart | 16 ------- lib/core/model/PatientSearchRequestModel.dart | 48 +++++++++++++++++++ 2 files changed, 48 insertions(+), 16 deletions(-) create mode 100644 lib/core/model/PatientSearchRequestModel.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 7ae40b0a..e6e6f9fc 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -15,23 +15,7 @@ import '../UpdatePage.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = new Helpers(); -//ProjectProvider projectsProvider = new ProjectProvider(); -/* - *@author: Mohammad Aljammal - *@Date:28/5/2020 - *@param: url, onSuccess callBack, onFailure callBack - *@return: - *@desc: - */ - -///Example -/* - await BaseAppClient.post('', - onSuccess: (dynamic response, int statusCode) {}, - onFailure: (String error, int statusCode) {}, - body: null); -* */ class BaseAppClient { //TODO change the post fun to nun static when you change all service post(String endPoint, diff --git a/lib/core/model/PatientSearchRequestModel.dart b/lib/core/model/PatientSearchRequestModel.dart new file mode 100644 index 00000000..72b1aa9e --- /dev/null +++ b/lib/core/model/PatientSearchRequestModel.dart @@ -0,0 +1,48 @@ +class PatientSearchRequestModel { + int doctorID; + String firstName; + String middleName; + String lastName; + String patientMobileNumber; + String patientIdentificationID; + int patientID; + String from; + String to; + + PatientSearchRequestModel( + {this.doctorID, + this.firstName, + this.middleName, + this.lastName, + this.patientMobileNumber, + this.patientIdentificationID, + this.patientID, + this.from, + this.to}); + + PatientSearchRequestModel.fromJson(Map json) { + doctorID = json['DoctorID']; + firstName = json['FirstName']; + middleName = json['MiddleName']; + lastName = json['LastName']; + patientMobileNumber = json['PatientMobileNumber']; + patientIdentificationID = json['PatientIdentificationID']; + patientID = json['PatientID']; + from = json['From']; + to = json['To']; + } + + Map toJson() { + final Map data = new Map(); + data['DoctorID'] = this.doctorID; + data['FirstName'] = this.firstName; + data['MiddleName'] = this.middleName; + data['LastName'] = this.lastName; + data['PatientMobileNumber'] = this.patientMobileNumber; + data['PatientIdentificationID'] = this.patientIdentificationID; + data['PatientID'] = this.patientID; + data['From'] = this.from; + data['To'] = this.to; + return data; + } +} From 2f01fa1b5323cc2ab3362f5d93d366e76cecf1f4 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 25 Apr 2021 18:12:03 +0300 Subject: [PATCH 08/50] add PatientSearchViewModel --- lib/core/viewModel/PatientSearchViewModel.dart | 5 +++++ lib/locator.dart | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 lib/core/viewModel/PatientSearchViewModel.dart diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart new file mode 100644 index 00000000..ea0e5cec --- /dev/null +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -0,0 +1,5 @@ +import 'base_view_model.dart'; + +class PatientSearchViewModel extends BaseViewModel{ + +} \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index a8843992..3aabd46b 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -35,6 +35,7 @@ import 'core/service/schedule_service.dart'; import 'core/viewModel/DischargedPatientViewModel.dart'; import 'core/viewModel/InsuranceViewModel.dart'; import 'core/viewModel/PatientMuseViewModel.dart'; +import 'core/viewModel/PatientSearchViewModel.dart'; import 'core/viewModel/SOAP_view_model.dart'; import 'core/viewModel/doctor_replay_view_model.dart'; import 'core/viewModel/labs_view_model.dart'; @@ -104,4 +105,5 @@ void setupLocator() { locator.registerFactory(() => RadiologyViewModel()); locator.registerFactory(() => PrescriptionsViewModel()); locator.registerFactory(() => DischargedPatientViewModel()); + locator.registerFactory(() => PatientSearchViewModel()); } From c9c18efd72bc41f93c6ff83ad64a92498a101488 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 26 Apr 2021 10:40:03 +0300 Subject: [PATCH 09/50] add in lab result get in and out patient --- lib/core/service/labs_service.dart | 2 +- .../profile/lab_result/labs_home_page.dart | 58 +++++++++++++++-- .../radiology/radiology_home_page.dart | 63 ++++++++++++++++--- lib/widgets/shared/app_texts_widget.dart | 10 ++- 4 files changed, 114 insertions(+), 19 deletions(-) diff --git a/lib/core/service/labs_service.dart b/lib/core/service/labs_service.dart index f38294b5..f89c66da 100644 --- a/lib/core/service/labs_service.dart +++ b/lib/core/service/labs_service.dart @@ -28,7 +28,7 @@ class LabsService extends BaseService { await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { - patientLabOrdersList.clear(); + patientLabOrdersList=[]; if (!isInpatient) { response['ListPLO'].forEach((hospital) { patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 02765c20..3dc771f5 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -12,18 +12,30 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class LabsHomePage extends StatelessWidget { +class LabsHomePage extends StatefulWidget { + @override + _LabsHomePageState createState() => _LabsHomePageState(); +} + +class _LabsHomePageState extends State { String patientType; + String arrivalType; + PatiantInformtion patient; + bool isInpatient; @override - Widget build(BuildContext context) { + void didChangeDependencies() { + super.didChangeDependencies(); final routeArgs = ModalRoute.of(context).settings.arguments as Map; - - PatiantInformtion patient = routeArgs['patient']; + patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; - bool isInpatient = routeArgs['isInpatient']; + isInpatient = routeArgs['isInpatient']; print(arrivalType); + } + + @override + Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getLabs(patient, isInpatient: isInpatient), builder: (context, ProcedureViewModel model, widget) => AppScaffold( @@ -93,6 +105,42 @@ class LabsHomePage extends StatelessWidget { )), ); },label: 'Apply for New Lab Order',), + if(!isInpatient) + Container( + margin: EdgeInsets.only(right: 8), + width: double.maxFinite, + child: InkWell( + onTap: (){ + setState(() { + isInpatient= true; + }); + model.getLabs(patient, isInpatient: true); + }, + child: Align( + alignment: Alignment.centerRight, + child: AppText('View Inpatient Lab Result', + textDecoration:TextDecoration.underline,color: Colors.red,), + ), + ), + ), + if(isInpatient) + Container( + width: double.maxFinite, + margin: EdgeInsets.only(right: 8), + child: InkWell( + onTap: (){ + setState(() { + isInpatient= false; + }); + model.getLabs(patient, isInpatient: false); + }, + child: Align( + alignment: Alignment.centerRight, + child: AppText('View Outpatient Lab Result', + textDecoration:TextDecoration.underline,color: Colors.red,), + ), + ), + ), ...List.generate( model.patientLabOrdersList.length, (index) => Column( diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 90d22369..ec34bcd1 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -14,16 +14,29 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -class RadiologyHomePage extends StatelessWidget { +class RadiologyHomePage extends StatefulWidget { @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); + _RadiologyHomePageState createState() => _RadiologyHomePageState(); +} + +class _RadiologyHomePageState extends State { + String patientType; + PatiantInformtion patient; + String arrivalType; + bool isInpatient; + @override + void didChangeDependencies() { + super.didChangeDependencies(); final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; - bool isInpatient = routeArgs['isInpatient']; + patient = routeArgs['patient']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + isInpatient = routeArgs['isInpatient']; + print(arrivalType); + } + @override + Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: isInpatient), @@ -99,6 +112,42 @@ class RadiologyHomePage extends StatelessWidget { }, label: 'Apply for Radiology Order', ), + if(!isInpatient) + Container( + width: double.maxFinite, + margin: EdgeInsets.only(right: 8), + child: InkWell( + onTap: (){ + setState(() { + isInpatient = true; + }); + model.getPatientRadOrders(patient, patientType: patientType, isInPatient: true); + }, + child: Align( + alignment: Alignment.centerRight, + child: AppText('View Inpatient Lab Result', + textDecoration:TextDecoration.underline,color: Colors.red,), + ), + ), + ), + if(isInpatient) + Container( + margin: EdgeInsets.only(right: 8), + width: double.maxFinite, + child: InkWell( + onTap: (){ + setState(() { + isInpatient = false; + }); + model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false); + }, + child: Align( + alignment: Alignment.centerRight, + child: AppText('View Outpatient Lab Result', + textDecoration:TextDecoration.underline,color: Colors.red,), + ), + ), + ), ...List.generate( model.radiologyList.length, (index) => InkWell( diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index d8d5a928..74acff8a 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -121,16 +121,14 @@ class _AppTextState extends State { style: widget.style != null ? _getFontStyle().copyWith( fontStyle: widget.italic ? FontStyle.italic : null, - color: widget.color != null ? widget.color : null, + color: widget.color , fontWeight: widget.fontWeight ?? _getFontWeight(), ) : TextStyle( fontStyle: widget.italic ? FontStyle.italic : null, - color: widget.textDecoration == null - ? widget.color != null - ? widget.color - : Colors.black - : null, + color: widget.color != null + ? widget.color + : Colors.black, fontSize: widget.fontSize ?? _getFontSize(), letterSpacing: widget.variant == "overline" ? 1.5 : null, From 55c63c95316654922100989b3406402defd630c5 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 26 Apr 2021 10:53:41 +0300 Subject: [PATCH 10/50] fix Discharged Patient --- lib/core/service/radiology_service.dart | 2 +- .../viewModel/DischargedPatientViewModel.dart | 16 +++++++--------- lib/screens/patients/DischargedPatientPage.dart | 2 +- .../profile/lab_result/labs_home_page.dart | 1 + lib/widgets/shared/doctor_card.dart | 5 +++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/core/service/radiology_service.dart b/lib/core/service/radiology_service.dart index b1c0fbd4..42a79098 100644 --- a/lib/core/service/radiology_service.dart +++ b/lib/core/service/radiology_service.dart @@ -39,7 +39,7 @@ class RadiologyService extends BaseService { await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { - finalRadiologyList.clear(); + finalRadiologyList = []; String label = "ListRAD"; if(isInPatient) { label ="List_GetRadOreders"; diff --git a/lib/core/viewModel/DischargedPatientViewModel.dart b/lib/core/viewModel/DischargedPatientViewModel.dart index 339e9505..1c1ed4d1 100644 --- a/lib/core/viewModel/DischargedPatientViewModel.dart +++ b/lib/core/viewModel/DischargedPatientViewModel.dart @@ -13,15 +13,12 @@ class DischargedPatientViewModel extends BaseViewModel { _dischargedPatientService.myDischargedPatients; - - List get filterData => filterData2.isNotEmpty? filterData2:myDischargedPatient; - - List filterData2 = []; + List filterData = []; searchData(String str) { var strExist = str.length > 0 ? true : false; if (strExist) { - filterData2 = []; + filterData = []; for (var i = 0; i < myDischargedPatient.length; i++) { String firstName = myDischargedPatient[i].firstName.toUpperCase(); String lastName = myDischargedPatient[i].lastName.toUpperCase(); @@ -32,12 +29,12 @@ class DischargedPatientViewModel extends BaseViewModel { lastName.contains(str.toUpperCase()) || mobile.contains(str) || patientID.contains(str)) { - filterData2.add(myDischargedPatient[i]); + filterData.add(myDischargedPatient[i]); } } notifyListeners(); } else { - filterData2 = myDischargedPatient; + filterData = myDischargedPatient; notifyListeners(); } } @@ -49,8 +46,9 @@ class DischargedPatientViewModel extends BaseViewModel { if (_dischargedPatientService.hasError) { error = _dischargedPatientService.error; setState(ViewState.Error); - } else - setState(ViewState.Idle); + } else{ + filterData = myDischargedPatient; + setState(ViewState.Idle);} } Future gtMyDischargeReferralPatient() async { diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 0ba791c6..0e61702d 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -30,7 +30,7 @@ class _DischargedPatientState extends State { backgroundColor: Colors.grey[200], isShowAppBar: true, baseViewModel: model, - body: model.filterData.isEmpty?Center( + body: model.myDischargedPatient.isEmpty?Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 3dc771f5..1cdc5987 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -168,6 +168,7 @@ class _LabsHomePageState extends State { clinic: labOrder.clinicDescription, appointmentDate: labOrder.orderDate, orderNo: labOrder.orderNo, + isShowTime: false, ); }).toList(), ), diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index a974c5f8..1c889d9d 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -19,6 +19,7 @@ class DoctorCard extends StatelessWidget { final bool isPrescriptions; final String clinic; final bool isShowEye; + final bool isShowTime; DoctorCard( {this.doctorName, @@ -30,7 +31,7 @@ class DoctorCard extends StatelessWidget { this.orderNo, this.isPrescriptions = false, this.clinic, - this.isShowEye = true}); + this.isShowEye = true, this.isShowTime= true}); @override Widget build(BuildContext context) { @@ -71,7 +72,7 @@ class DoctorCard extends StatelessWidget { fontWeight: FontWeight.w600, fontSize: 14, ), - if (!isPrescriptions) + if (!isPrescriptions&& isShowTime) AppText( '${DateUtils.getHour(appointmentDate)}', fontWeight: FontWeight.w600, From cb67dcc9e105fa649898d7f9d462985426888f9f Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 13:21:29 +0300 Subject: [PATCH 11/50] first step from search --- lib/config/config.dart | 1 + lib/core/enum/patient_type.dart | 2 + lib/core/model/PatientSearchRequestModel.dart | 27 +- .../service/patient/out_patient_service.dart | 45 ++ .../viewModel/PatientSearchViewModel.dart | 33 + lib/locator.dart | 2 + lib/screens/home/home_screen.dart | 39 + .../patient_search_screen_new.dart | 302 ++++++++ .../patient_search/patients_screen_new.dart | 732 ++++++++++++++++++ lib/widgets/patients/PatientCard.dart | 203 ++--- 10 files changed, 1276 insertions(+), 110 deletions(-) create mode 100644 lib/core/enum/patient_type.dart create mode 100644 lib/core/service/patient/out_patient_service.dart create mode 100644 lib/screens/patients/patient_search/patient_search_screen_new.dart create mode 100644 lib/screens/patients/patient_search/patients_screen_new.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 5c704152..09f4f586 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -277,6 +277,7 @@ const GET_INSURANCE_IN_PATIENT = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave"; +const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient"; var selectedPatientType = 1; diff --git a/lib/core/enum/patient_type.dart b/lib/core/enum/patient_type.dart new file mode 100644 index 00000000..efea543c --- /dev/null +++ b/lib/core/enum/patient_type.dart @@ -0,0 +1,2 @@ +enum PatientType { inPatient, OutPatient } + diff --git a/lib/core/model/PatientSearchRequestModel.dart b/lib/core/model/PatientSearchRequestModel.dart index 72b1aa9e..7691cadb 100644 --- a/lib/core/model/PatientSearchRequestModel.dart +++ b/lib/core/model/PatientSearchRequestModel.dart @@ -8,17 +8,20 @@ class PatientSearchRequestModel { int patientID; String from; String to; + int searchType; + String mobileNo; + String identificationNo; PatientSearchRequestModel( - {this.doctorID, - this.firstName, - this.middleName, - this.lastName, - this.patientMobileNumber, - this.patientIdentificationID, - this.patientID, - this.from, - this.to}); + {this.doctorID =0, + this.firstName ="0", + this.middleName="0", + this.lastName="0", + this.patientMobileNumber="0", + this.patientIdentificationID="0", + this.patientID =0, + this.from="0", + this.to="0"}); PatientSearchRequestModel.fromJson(Map json) { doctorID = json['DoctorID']; @@ -30,6 +33,9 @@ class PatientSearchRequestModel { patientID = json['PatientID']; from = json['From']; to = json['To']; + searchType = json['SearchType']; + mobileNo = json['MobileNo']; + identificationNo = json['IdentificationNo']; } Map toJson() { @@ -43,6 +49,9 @@ class PatientSearchRequestModel { data['PatientID'] = this.patientID; data['From'] = this.from; data['To'] = this.to; + data['SearchType'] = this.searchType; + data['MobileNo'] = this.mobileNo; + data['IdentificationNo'] = this.identificationNo; return data; } } diff --git a/lib/core/service/patient/out_patient_service.dart b/lib/core/service/patient/out_patient_service.dart new file mode 100644 index 00000000..606bfc5d --- /dev/null +++ b/lib/core/service/patient/out_patient_service.dart @@ -0,0 +1,45 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +class OutPatientService extends BaseService { + List _patientList = []; + List get patientList => _patientList; + + + Future getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async { + hasError = false; + await baseAppClient.post( + GET_MY_OUT_PATIENT, + onSuccess: (dynamic response, int statusCode) { + _patientList.clear(); + response['List_MyOutPatient'].forEach((v) { + _patientList.add(PatiantInformtion.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: patientSearchRequestModel.toJson(), + ); + } + Future getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel) async { + hasError = false; + await baseAppClient.post( + PRM_SEARCH_PATIENT, + onSuccess: (dynamic response, int statusCode) { + _patientList.clear(); + response['GetPatientFileInformation_PRMList'].forEach((v) { + _patientList.add(PatiantInformtion.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: patientSearchRequestModel.toJson(), + ); + } +} diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index ea0e5cec..455e8788 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -1,5 +1,38 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/service/patient/out_patient_service.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +import '../../locator.dart'; import 'base_view_model.dart'; class PatientSearchViewModel extends BaseViewModel{ + OutPatientService _outPatientService = locator(); + + List get patientList => _outPatientService.patientList; + + getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async { + setState(ViewState.Busy); + await _outPatientService.getOutPatient( + patientSearchRequestModel); + if (_outPatientService.hasError) { + error = _outPatientService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel) async { + setState(ViewState.Busy); + await _outPatientService.getPatientFileInformation( + patientSearchRequestModel); + if (_outPatientService.hasError) { + error = _outPatientService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } } \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index 3aabd46b..a52482a4 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -27,6 +27,7 @@ import 'core/service/patient-admission-request-service.dart'; import 'core/service/patient-doctor-referral-service.dart'; import 'core/service/patient-ucaf-service.dart'; import 'core/service/patient-vital-signs-service.dart'; +import 'core/service/patient/out_patient_service.dart'; import 'core/service/prescriptions_service.dart'; import 'core/service/radiology_service.dart'; import 'core/service/referral_patient_service.dart'; @@ -80,6 +81,7 @@ void setupLocator() { locator.registerLazySingleton(() => ReferralService()); locator.registerLazySingleton(() => MyReferralInPatientService()); locator.registerLazySingleton(() => DischargedPatientService()); + locator.registerLazySingleton(() => OutPatientService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 39fc7a8c..47bc1d0b 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -16,6 +16,7 @@ import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart' import 'package:doctor_app_flutter/screens/medicine/search_medicine_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/DischargedPatientPage.dart'; import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen_new.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -464,6 +465,44 @@ class _HomeScreenState extends State { child: new ListView( scrollDirection: Axis.horizontal, children: [ + HomePageCard( + color: Colors.black, + margin: EdgeInsets.all(5), + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.search, + size: 32, + color: Colors.white, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + "New:"+TranslationBase.of(context) + .searchPatient, + color: Colors.white, + textAlign: TextAlign.start, + fontSize: 13, + )) + ], + ), + hasBorder: false, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PatientSearchScreenNew(), + )); + }, + ), HomePageCard( color: Colors.red[800], margin: EdgeInsets.all(5), diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen_new.dart new file mode 100644 index 00000000..f383cf40 --- /dev/null +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -0,0 +1,302 @@ +import 'package:doctor_app_flutter/core/enum/patient_type.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.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/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class PatientSearchScreenNew extends StatefulWidget { + @override + _PatientSearchScreenNewState createState() => _PatientSearchScreenNewState(); +} + +class _PatientSearchScreenNewState extends State { + bool showOther = false; + bool isFormSubmitted = false; + TextEditingController patientFileInfoController = TextEditingController(); + TextEditingController firstNameInfoController = TextEditingController(); + TextEditingController middleNameInfoController = TextEditingController(); + TextEditingController lastNameFileInfoController = TextEditingController(); + PatientType selectedPatientType = PatientType.inPatient; + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + child: Center( + child: Column( + children: [ + BottomSheetTitle( + title: TranslationBase.of(context).searchPatient), + FractionallySizedBox( + widthFactor: 0.9, + child: Container( + color: Theme.of(context).scaffoldBackgroundColor, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + 'Patient Type', + fontWeight: FontWeight.w600, + ), + Row( + children: [ + Row( + children: [ + Radio( + activeColor: Color(0xFFB9382C), + value: PatientType.inPatient, + groupValue: selectedPatientType, + onChanged: (value) { + setState(() { + selectedPatientType = + PatientType.inPatient; + }); + }, + ), + Text('InPatient'), + ], + ), + Row( + children: [ + Radio( + activeColor: Color(0xFFB9382C), + value: PatientType.OutPatient, + groupValue: selectedPatientType, + onChanged: (value) { + setState(() { + selectedPatientType = + PatientType.OutPatient; + }); + }, + ), + Text('OutPatient'), + ], + ), + ], + ), + SizedBox( + height: 10, + ), + Container( + margin: + EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context) + .patpatientIDMobilenationalientID, + isTextFieldHasSuffix: false, + maxLines: 1, + minLines: 1, + hasBorder: true, + controller: patientFileInfoController, + validationError: (isFormSubmitted && ( + patientFileInfoController + .text.isEmpty && + firstNameInfoController + .text.isEmpty && + middleNameInfoController + .text.isEmpty && + lastNameFileInfoController + .text.isEmpty)) + ? TranslationBase.of(context).emptyMessage + : null, + ), + ), + SizedBox( + height: 5, + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + InkWell( + child: this.showOther == false + ? AppText( + TranslationBase.of(context) + .searchWithOther, + color: Colors.red, + fontWeight: FontWeight.bold, + ) + : AppText( + TranslationBase.of(context) + .hideOtherCriteria, + color: Colors.red, + fontWeight: FontWeight.bold), + onTap: () { + setState(() { + this.showOther = !this.showOther; + }); + }, + ) + ], + ), + SizedBox( + height: 30, + ), + if (showOther) + Column( + children: [ + AppTextFieldCustom( + hintText: + TranslationBase.of(context).firstName, + controller: firstNameInfoController, + maxLines: 1, + minLines: 1, + hasBorder: true, + onChanged: (_) {}, + // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + hintText: + TranslationBase.of(context).middleName, + controller: middleNameInfoController, + maxLines: 1, + minLines: 1, + onChanged: (_) {}, + hasBorder: true, + // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + hintText: + TranslationBase.of(context).lastName, + controller: lastNameFileInfoController, + maxLines: 1, + minLines: 1, + onChanged: (_) {}, + hasBorder: true, + // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , + ), + SizedBox( + height: 10, + ), + ], + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.12, + ), + ])), + ), + ], + ), + ), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + fontWeight: FontWeight.w700, + title: TranslationBase.of(context).search, + onPressed: () { + onSubmitSearch(); + }, + color: Colors.red[800], + ), + ), + ), + ), + SizedBox( + height: 5, + ), + ], + ), + ), + ), + ); + } + + onSubmitSearch() { + GifLoaderDialogUtils.showMyDialog(context); + setState(() { + isFormSubmitted = true; + }); + PatientSearchRequestModel patientSearchRequestModel = + PatientSearchRequestModel(); + if (showOther) { + patientSearchRequestModel.firstName = firstNameInfoController.text.trim().isEmpty?"0":firstNameInfoController.text.trim(); + patientSearchRequestModel.middleName = middleNameInfoController.text.trim().isEmpty?"0":middleNameInfoController.text.trim(); + patientSearchRequestModel.lastName = lastNameFileInfoController.text.isEmpty?"0":lastNameFileInfoController.text.trim(); + } + + if (patientFileInfoController.text.isNotEmpty) { + if (patientFileInfoController.text.length == 10 && + (patientFileInfoController.text[0] == '2' || + patientFileInfoController.text[0] == '1')) { + patientSearchRequestModel.identificationNo = + patientFileInfoController.text; + patientSearchRequestModel.searchType = 2; + patientSearchRequestModel.patientID = 0; + } else if ((patientFileInfoController.text.length == 10 || + patientFileInfoController.text.length == 9) && + ((patientFileInfoController.text[0] == '0' && + patientFileInfoController.text[1] == '5') || + patientFileInfoController.text[0] == '5')) { + patientSearchRequestModel.mobileNo = patientFileInfoController.text; + patientSearchRequestModel.searchType = 0; + } else { + patientSearchRequestModel.patientID = + int.parse(patientFileInfoController.text); + patientSearchRequestModel.searchType = 1; + } + } + + GifLoaderDialogUtils.hideDialog(context); + + if (patientFileInfoController.text.isNotEmpty || + firstNameInfoController.text.isNotEmpty || + middleNameInfoController.text.isNotEmpty || + lastNameFileInfoController.text.isNotEmpty) { + setState(() { + isFormSubmitted = false; + }); + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => PatientsScreenNew( + selectedPatientType: selectedPatientType, + patientSearchRequestModel: patientSearchRequestModel, + isSearchWithKeyInfo: + patientFileInfoController.text.isNotEmpty ? true : false, + ), + ), + ); + } + } +} diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart new file mode 100644 index 00000000..5b3b5a77 --- /dev/null +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -0,0 +1,732 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/patient_type.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart'; +import 'package:doctor_app_flutter/models/patient/patient_model.dart'; +import 'package:doctor_app_flutter/models/patient/topten_users_res_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/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; +import 'package:doctor_app_flutter/widgets/patients/clinic_list_dropdwon.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/dr_app_circular_progress_Indeicator.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; +import 'package:provider/provider.dart'; + +// ignore: must_be_immutable +class PatientsScreenNew extends StatefulWidget { + final patientSearchForm; + final selectedType; + final isAppbar; + final arrivalType; + final isView; + final PatientType selectedPatientType; + final PatientSearchRequestModel patientSearchRequestModel; + final bool isSearchWithKeyInfo; + + PatientsScreenNew( + {this.patientSearchForm, + this.selectedType, + this.isAppbar = true, + this.arrivalType, + this.isView, + this.selectedPatientType, + this.patientSearchRequestModel, + this.isSearchWithKeyInfo = true}); + + @override + _PatientsScreenNewState createState() => _PatientsScreenNewState(); +} + +class _PatientsScreenNewState extends State { + List lItems; + + List parsed; + + List date; + List unFilterDate; + + int clinicId; + AuthViewModel authProvider; + + Color sideColor = Colors.black; + List responseModelList; + List responseModelList2; + final String url = "assets/images/"; + final String avatarMale = "user_male.svg"; //'working_male.svg';//'user.svg'; + final String avatarFemale = 'user_female.svg'; + final String assetName = 'assets/image.svg'; + + List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; + + int _activeLocation = 0; + bool isInpatient = false; + String patientType; + bool isSearch = false; + String patientTypeTitle; + var _isLoading = true; + var selectedFilter = 1; + bool _isError = false; + String error = ""; + String arrivalType; + ProjectViewModel projectsProvider; + var isView; + final _controller = TextEditingController(); + + PatientModel patient; + 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); + + searchData(String str) { + this.responseModelList = this.responseModelList2; + var strExist = str.length > 0 ? true : false; + if (strExist) { + List filterData = []; + + for (var i = 0; i < responseModelList2.length; i++) { + String firstName = responseModelList[i].firstName.toUpperCase(); + String lastName = responseModelList[i].lastName.toUpperCase(); + String mobile = responseModelList[i].mobileNumber.toUpperCase(); + String patientID = responseModelList[i].patientId.toString(); + + if (firstName.contains(str.toUpperCase()) || + lastName.contains(str.toUpperCase()) || + mobile.contains(str) || + patientID.contains(str)) { + filterData.add(responseModelList[i]); + } + } + + setState(() { + this.responseModelList = filterData; + }); + } else { + setState(() { + this.responseModelList = this.responseModelList2; + }); + } + } + + convertDateFormat(String str) { + String timeConvert; + const start = "/Date("; + const end = "+0300)"; + + final startIndex = str.indexOf(start); + final endIndex = str.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + + "-" + + date.month.toString().padLeft(2, '0') + + "-" + + date.day.toString().padLeft(2, '0'); + + return newDate.toString(); + } + + @override + Widget build(BuildContext context) { + authProvider = Provider.of(context); + _locations = [ + TranslationBase.of(context).today, + TranslationBase.of(context).tomorrow, + TranslationBase.of(context).nextWeek, + ]; + //TranslationBase.of(context).all, + projectsProvider = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + + // patient = widget.patientSearchForm != null + // ? widget.patientSearchForm + // : routeArgs['patientSearchForm']; + // + // patientType = widget.selectedType != null + // ? widget.selectedType + // : routeArgs['selectedType']; + // arrivalType = widget.arrivalType != null + // ? widget.arrivalType + // : routeArgs['arrivalType']; + // if (routeArgs != null && routeArgs.containsKey("isSearch")) { + // isSearch = routeArgs['isSearch']; + // } + // if (routeArgs != null && routeArgs.containsKey("isSearch")) { + // isView = routeArgs['isView']; + // } + // if (routeArgs != null && routeArgs.containsKey('activeFilter')) { + // _activeLocation = routeArgs['activeFilter']; + // } + // if (routeArgs != null && routeArgs.containsKey('isInpatient')) { + // isInpatient = routeArgs['isInpatient']; + // } + + // if (!projectsProvider.isArabic) + // patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; + // else + // patientTypeTitle = SERVICES_PATIANT_HEADER_AR[int.parse(patientType)]; + + return BaseView( + onModelReady: (model) async { + if(widget.isSearchWithKeyInfo) { + await model.getPatientFileInformation(widget.patientSearchRequestModel); + } else { + // ignore: unrelated_type_equality_checks + if(widget.selectedPatientType == PatientType.OutPatient) { + await model.getOutPatient(widget.patientSearchRequestModel); + } else { + // TODO handel inPatient case + } + } + }, + builder: (_, model, w) => AppScaffold( + appBarTitle: "Search Patient", + isShowAppBar: widget.isAppbar, + // isLoading: _isLoading, + baseViewModel: model, + body: model.patientList.isEmpty + ? Column( + children: [ + Column(children: [ + SizedBox( + height: 10.0, + ), + if (widget.selectedPatientType == PatientType.OutPatient) + Container( + padding: EdgeInsets.all(5), + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(color: Colors.grey), + borderRadius: BorderRadius.circular(10)), + child: ClinicList( + clinicId: clinicId, + onClinicChange: (newValue) { + clinicId = newValue; + changeClinic(newValue, context, model); + }, + )), + Padding( + padding: EdgeInsets.only( + top: MediaQuery.of(context).size.height * + 0.03), + // child: _locationBar(context) + child: + widget.selectedPatientType == PatientType.OutPatient + ? _locationBar(context, model) + : Container(), + ) + ]), + Container( + margin: EdgeInsets.only( + top: MediaQuery.of(context).size.height * 0.10), + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText(TranslationBase.of(context) + .youDontHaveAnyPatient), + ) + ], + ), + ), + ), + ], + ) + : Container( + color: Colors.grey[200], + child: ListView( + scrollDirection: Axis.vertical, + children: [ + Container( + child:model.patientList.isEmpty + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + child: Center( + child: Padding( + padding: const EdgeInsets.fromLTRB( + 0, 0, 0, 0), //250 + child: + DrAppCircularProgressIndeicator(), + )), + ), + ], + ) + : Column( + children: [ + SizedBox(height: 18.5), + Container( + width: SizeConfig.screenWidth * 0.9, + height: 75, + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + left: 10, top: 10), + child: AppText( + TranslationBase.of( + context) + .searchPatientName, + fontSize: 13, + )), + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + padding: + EdgeInsets.only( + bottom: 30), + ), + onChanged: (String str) { + this.searchData(str); + }), + ])), + SizedBox( + height: 10.0, + ), + Padding( + padding: EdgeInsets.only( + top: MediaQuery.of(context) + .size + .height * + 0.03), + // child: _locationBar(context) + child: widget.selectedPatientType == PatientType.OutPatient? _locationBar(context, model) + : Container(), + ), + SizedBox( + height: 10.0, + ), + Container( + child: (model.patientList.isNotEmpty) + ? Column( + // mainAxisAlignment: MainAxisAlignment.center, + children: model.patientList + .map((PatiantInformtion + item) { + return PatientCard( + patientInfo: item, + patientType: + patientType, + arrivalType: + arrivalType, + isInpatient: + isInpatient, + onTap: () { + Navigator.of(context) + .pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": item, + "patientType": + patientType, + "from": patient + .getFrom, + "to": patient + .getTo, + "isSearch": + isSearch, + "isInpatient": + isInpatient, + "arrivalType": + arrivalType, + "isInpatient": + isInpatient + }); + }, + ); + }).toList(), + ) + : Center( + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + SizedBox( + height: 100, + ), + Image.asset( + 'assets/images/no-data.png'), + Padding( + padding: + const EdgeInsets + .all(8.0), + child: AppText( + TranslationBase.of( + context) + .youDontHaveAnyPatient), + ) + ], + ), + )), + ], + ), + ) + ], + ), + ) + ), + ); + } + + changeClinic(clinicId, BuildContext context, model) async { + GifLoaderDialogUtils.showMyDialog(context); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); + ProfileReqModel docInfo = new ProfileReqModel( + doctorID: doctorProfile.doctorID, + clinicID: clinicId, + license: true, + projectID: doctorProfile.projectID, + tokenID: '', + languageID: 2); + + authProvider + .getDocProfiles(docInfo.toJson(), allowChangeProfile: false) + .then((profileList) async { + print(profileList['DoctorProfileList'][0]); + int val2 = int.parse(patientType); + + GetPatientArrivalListRequestModel getPatientArrivalListRequestModel = + GetPatientArrivalListRequestModel( + from: patient.From, + to: patient.To, + clinicID: profileList['DoctorProfileList'][0]['ClinicID'], + doctorID: + profileList['DoctorProfileList'][0]['DoctorID'].toString(), + patientMRN: patient.getPatientID, + pageIndex: 0, + pageSize: 0); + + model + .getPatientList( + getPatientArrivalListRequestModel.toJson(), patientType) + .then((res) { + setState(() { + if (res != null && res['MessageStatus'] == 1) { + if (val2 == 7) { + if (res[SERVICES_PATIANT2[val2]] == null) { + _isError = true; + _isLoading = false; + this.error = error.toString(); + } else { + var localList = []; + if (res["patientArrivalList"]["entityList"] == null) { + res["patientArrivalList"]["entityList"] = []; + } + res["patientArrivalList"]["entityList"].forEach((v) { + Map mergedPatient = { + ...v, + ...v["patientDetails"] + }; + localList.add(mergedPatient); + }); + lItems = localList; + } + } + parsed = lItems; + responseModelList = new ModelResponse.fromJson(parsed).list; + responseModelList.sort((a, b) { + DateTime now = DateTime.now(); + DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); + String formattedDate = + DateFormat('yyyy-MM-dd ' + a.startTime).format(now); + DateTime dateTimeA = dateFormat.parse(formattedDate); + String formattedDateB = + DateFormat('yyyy-MM-dd ' + b.startTime).format(now); + DateTime dateTimeB = dateFormat.parse(formattedDateB); + var adate = dateTimeA; //a.startTime; + var bdate = dateTimeB; + return adate.compareTo(bdate); + }); + responseModelList2 = responseModelList; + _isError = false; + } else { + _isError = true; + error = model.error ?? + res['ErrorEndUserMessage'] ?? + res['ErrorMessage']; + } + + _isLoading = false; + }); + GifLoaderDialogUtils.hideDialog(context); + }).catchError((error) { + Helpers.showErrorToast(error.toString()); + GifLoaderDialogUtils.hideDialog(context); + }); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + Helpers.showErrorToast(err); + }); + } + + Widget _locationBar(BuildContext _context, model) { + return Container( + height: MediaQuery.of(context).size.height * 0.0619, + width: SizeConfig.screenWidth * 0.94, + decoration: BoxDecoration( + color: Color(0Xffffffff), + borderRadius: BorderRadius.circular(12.5), + // border: Border.all( + // width: 0.5, + // ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _locations.map((item) { + bool _isActive = _locations[_activeLocation] == item ? true : false; + return Column(mainAxisSize: MainAxisSize.min, children: [ + InkWell( + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.058, + width: SizeConfig.screenWidth * 0.2334, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(12.5), + topRight: Radius.circular(12.5), + topLeft: Radius.circular(9.5), + bottomLeft: Radius.circular(9.5)), + color: _isActive ? HexColor("#B8382B") : Colors.white, + ), + child: Center( + child: Text( + item, + style: TextStyle( + fontSize: 12, + color: _isActive + ? Colors.white + : Colors.black, //Colors.black, + + fontWeight: FontWeight.normal, + ), + ), + )), + ), + onTap: () { + //filterBooking(item.toString()); + + setState(() { + _activeLocation = _locations.indexOf(item); + }); + filterPatient(item.toString(), model); + }), + _isActive + ? Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(10), + topRight: Radius.circular(10)), + color: Colors.white), + alignment: Alignment.center, + height: 1, + width: SizeConfig.screenWidth * 0.23, + ) + : Container() + ]); + }).toList(), + ), + ); + } + + filterPatient(item, model) { + if (item == 'Tomorrow') { + _patientSearchFormValues.To = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 1), + 'yyyy-MM-dd'); + _patientSearchFormValues.From = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 1), + 'yyyy-MM-dd'); + } else if (item == 'Next Week') { + _patientSearchFormValues.From = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 1), + 'yyyy-MM-dd'); + + _patientSearchFormValues.To = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 6), + 'yyyy-MM-dd'); + } else { + _patientSearchFormValues.From = DateUtils.convertDateToFormat( + DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day), + 'yyyy-MM-dd'); + _patientSearchFormValues.To = DateUtils.convertDateToFormat( + DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day), + 'yyyy-MM-dd'); + } + searchPatient(model); + } + + searchPatient(model) { + GifLoaderDialogUtils.showMyDialog(context); + int val2 = int.parse(patientType); + GetPatientArrivalListRequestModel getPatientArrivalListRequestModel; + if (val2 == 0) { + patient = PatientModel( + From: _patientSearchFormValues.From, + To: _patientSearchFormValues.To, + FirstName: "0", + MiddleName: "0", + LastName: "0", + PatientMobileNumber: "0", + PatientIdentificationID: "0", + PatientID: 0, + ); + } + + model + .getPatientList( + val2 == 7 ? getPatientArrivalListRequestModel.toJson() : patient, + patientType, + isView: isView) + .then((res) { + setState(() { + GifLoaderDialogUtils.hideDialog(context); + if (res != null && res['MessageStatus'] == 1) { + if (val2 == 7) { + if (res[SERVICES_PATIANT2[val2]] == null) { + _isError = true; + _isLoading = false; + this.error = error.toString(); + } else { + var localList = []; + if (res["patientArrivalList"]["entityList"] == null) { + res["patientArrivalList"]["entityList"] = []; + } + res["patientArrivalList"]["entityList"].forEach((v) { + Map mergedPatient = { + ...v, + ...v["patientDetails"] + }; + localList.add(mergedPatient); + }); + lItems = localList; + } + } else { + if (isView == false && val2 == 1) { + lItems = res['GetPatientFileInformation_PRMList'] + .where((i) => i['PatientTypeDescription'] == 'Permanent File') + .toList(); + } else { + lItems = res[SERVICES_PATIANT2[val2]]; + } + } + parsed = lItems; + responseModelList = new ModelResponse.fromJson(parsed).list; + if (val2 == 7) { + responseModelList.sort((a, b) { + if (b.startTime != null && b.startTime != null) { + try { + DateTime now = DateTime.now(); + DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); + String formattedDate = + DateFormat('yyyy-MM-dd ' + a.startTime).format(now); + DateTime dateTimeA = dateFormat.parse(formattedDate); + String formattedDateB = + DateFormat('yyyy-MM-dd ' + b.startTime).format(now); + DateTime dateTimeB = dateFormat.parse(formattedDateB); + var adate = dateTimeA; //a.startTime; + var bdate = dateTimeB; + return adate.compareTo(bdate); + } on Exception catch (_) { + print('never reached'); + var adate = a.startTime; //a.startTime; + var bdate = b.startTime; + return adate.compareTo(bdate); + } + } else { + var adate = convertDateFormat(a.appointmentDate); + var bdate = convertDateFormat(b.appointmentDate); + return bdate.compareTo(adate); + } + }); + } + responseModelList2 = responseModelList; + _isError = false; + } else { + _isError = true; + error = + model.error ?? res['ErrorEndUserMessage'] ?? res['ErrorMessage']; + } + + _isLoading = false; + }); + }).catchError((error) { + GifLoaderDialogUtils.hideDialog(context); + setState(() { + _isError = true; + _isLoading = false; + this.error = error.toString(); + }); + }); + } +} diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 5dcedc7e..dad33425 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -35,18 +35,18 @@ class PatientCard extends StatelessWidget { color: Colors.white, ), child: Stack(children: [ - if (SERVICES_PATIANT2[int.parse(patientType)] != "List_MyInPatient") - Container( - height: MediaQuery.of(context).size.height * .20, - width: 5, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10), - bottomLeft: Radius.circular(10)), - color: patientInfo.patientStatusType == 43 - ? Colors.green[500] - : Colors.red[800], - )), + // if (SERVICES_PATIANT2[int.parse(patientType)] != "List_MyInPatient") + // Container( + // height: MediaQuery.of(context).size.height * .20, + // width: 5, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.only( + // topLeft: Radius.circular(10), + // bottomLeft: Radius.circular(10)), + // color: patientInfo.patientStatusType == 43 + // ? Colors.green[500] + // : Colors.red[800], + // )), Container( padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), child: InkWell( @@ -55,48 +55,48 @@ class PatientCard extends StatelessWidget { SizedBox( height: 10, ), - SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient" - ? Padding( - padding: EdgeInsets.only(left: 12.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - patientInfo.patientStatusType == 43 - ? AppText( - TranslationBase.of(context).arrivedP, - color: Colors.green, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ) - : AppText( - TranslationBase.of(context).notArrived, - color: Colors.red[800], - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ), - this.arrivalType == '1' - ? AppText( - patientInfo.startTime != null - ? patientInfo.startTime - : patientInfo.startTimes, - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ) - : patientInfo.arrivedOn != null - ? AppText( - DateUtils.convertStringToDateFormat( - patientInfo.arrivedOn, - 'MM-dd-yyyy HH:mm'), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ) - : SizedBox() - ], - )) - : SizedBox(), + // SERVICES_PATIANT2[int.parse(patientType)] == + // "List_MyOutPatient" + // ? Padding( + // padding: EdgeInsets.only(left: 12.0), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // patientInfo.patientStatusType == 43 + // ? AppText( + // TranslationBase.of(context).arrivedP, + // color: Colors.green, + // fontWeight: FontWeight.bold, + // fontFamily: 'Poppins', + // fontSize: 12, + // ) + // : AppText( + // TranslationBase.of(context).notArrived, + // color: Colors.red[800], + // fontWeight: FontWeight.bold, + // fontFamily: 'Poppins', + // fontSize: 12, + // ), + // this.arrivalType == '1' + // ? AppText( + // patientInfo.startTime != null + // ? patientInfo.startTime + // : patientInfo.startTimes, + // fontFamily: 'Poppins', + // fontWeight: FontWeight.w600, + // ) + // : patientInfo.arrivedOn != null + // ? AppText( + // DateUtils.convertStringToDateFormat( + // patientInfo.arrivedOn, + // 'MM-dd-yyyy HH:mm'), + // fontFamily: 'Poppins', + // fontWeight: FontWeight.w600, + // ) + // : SizedBox() + // ], + // )) + // : SizedBox(), Padding( padding: EdgeInsets.only(left: 12.0), child: Row( @@ -213,32 +213,32 @@ class PatientCard extends StatelessWidget { ), ), ), - if (SERVICES_PATIANT2[int.parse(patientType)] != - "List_MyInPatient") - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: - TranslationBase.of(context).age + - " : ", - style: TextStyle(fontSize: 14)), - new TextSpan( - text: - "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 15)), - ], - ), - ), - ), + // if (SERVICES_PATIANT2[int.parse(patientType)] != + // "List_MyInPatient") + // Container( + // child: RichText( + // text: new TextSpan( + // style: new TextStyle( + // fontSize: 2.0 * SizeConfig.textMultiplier, + // color: Colors.black, + // fontFamily: 'Poppins', + // ), + // children: [ + // new TextSpan( + // text: + // TranslationBase.of(context).age + + // " : ", + // style: TextStyle(fontSize: 14)), + // new TextSpan( + // text: + // "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", + // style: TextStyle( + // fontWeight: FontWeight.w700, + // fontSize: 15)), + // ], + // ), + // ), + // ), if (isInpatient == true) Container( child: RichText( @@ -370,27 +370,28 @@ class PatientCard extends StatelessWidget { //) ])) ]), - SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient" - ? Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - padding: EdgeInsets.all(4), - child: Image.asset( - patientInfo.appointmentType == - 'Regular' && - patientInfo.visitTypeId == 100 - ? 'assets/images/livecare.png' - : patientInfo.appointmentType == - 'Walkin' - ? 'assets/images/walkin.png' - : 'assets/images/booked.png', - height: 25, - width: 35, - )), - ]) - : (isInpatient == true) + // SERVICES_PATIANT2[int.parse(patientType)] == + // "List_MyOutPatient" + // ? Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // Container( + // padding: EdgeInsets.all(4), + // child: Image.asset( + // patientInfo.appointmentType == + // 'Regular' && + // patientInfo.visitTypeId == 100 + // ? 'assets/images/livecare.png' + // : patientInfo.appointmentType == + // 'Walkin' + // ? 'assets/images/walkin.png' + // : 'assets/images/booked.png', + // height: 25, + // width: 35, + // )), + // ]) + // : + (isInpatient == true) ? Row( mainAxisAlignment: MainAxisAlignment.end, children: [ From 357e01c846033eb8b4c591e7a045a6ba4649feec Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 26 Apr 2021 13:52:54 +0300 Subject: [PATCH 12/50] hot fixes --- lib/config/localized_values.dart | 2 +- lib/core/model/radiology/final_radiology.dart | 2 +- .../service/patient-vital-signs-service.dart | 18 ++- .../patient-vital-sign-viewmodel.dart | 13 +- .../my_referred_patient_model.dart | 4 +- .../profile/lab_result/labs_home_page.dart | 130 +++++++++-------- .../radiology/radiology_details_page.dart | 12 +- .../radiology/radiology_home_page.dart | 132 ++++++++++-------- .../referral/referred-patient-screen.dart | 3 +- .../referred_patient_detail_in-paint.dart | 2 +- .../prescription/add_prescription_form.dart | 113 +-------------- .../shared/buttons/secondary_button.dart | 8 +- lib/widgets/shared/doctor_card.dart | 5 +- 13 files changed, 191 insertions(+), 253 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index cfad087a..ee4181e3 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -782,7 +782,7 @@ const Map> localizedValues = { }, "show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"}, - "open-rad": {"en": "Open Image", "ar": "فتح صور الاشعة"}, + "open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"}, 'fileNumber': {'en': "File Number: ", 'ar': " :رقم الملف"}, 'searchPatient-name': { diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index 1d406b81..fdccf5f5 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -125,7 +125,7 @@ class FinalRadiology { orderNo = json['OrderNo']; projectName = json['ProjectName']; qR = json['QR']; - isLiveCareAppodynamicment = json['IsLiveCareAppodynamicment']; + isLiveCareAppodynamicment = json['IsLiveCareAppointment']; reportDataHTML = json['ReportDataHTML']; reportDataTextdynamic = json['ReportDataTextdynamic']; // speciality = json['Speciality'].cast(); diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index 71307ddc..4dd16859 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -71,14 +71,19 @@ class VitalSignsService extends BaseService { hasError = false; Map body = Map(); body['PatientID'] = patient.patientId; - body['PatientTypeID'] = 1; - if(isInPatient){ - body['InOutPatientType'] = 1; - }else { - body['InOutPatientType'] = 2; + body['PatientTypeID'] = patient.patientType; + // if(isInPatient){ + body['InOutPatientType'] = 0; + // }else { + // body['InOutPatientType'] = 2; + // } + + if (patient.appointmentNo != null && patient.projectId != null) { + body['TransNo'] = patient.appointmentNo; + body['ProjectID'] = patient.projectId; } - await baseAppClient.post( + await baseAppClient.postPatient( GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { patientVitalSignsHistory.clear(); @@ -93,6 +98,7 @@ class VitalSignsService extends BaseService { super.error = error.toString(); }, body: body, + patient: patient ); } } diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 6786ad92..f9cbfc8d 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -52,12 +52,13 @@ class VitalSignsViewModel extends BaseViewModel { to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } - await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient); - // if (isInPatient) { - // await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient); - // } else { - // await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); - // } + + if (isInPatient) { + await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); + } else { + await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient); + + } if (_vitalSignService.hasError) { error = _vitalSignService.error; diff --git a/lib/models/patient/my_referral/my_referred_patient_model.dart b/lib/models/patient/my_referral/my_referred_patient_model.dart index cc0381d8..44a427f7 100644 --- a/lib/models/patient/my_referral/my_referred_patient_model.dart +++ b/lib/models/patient/my_referral/my_referred_patient_model.dart @@ -64,6 +64,7 @@ class MyReferredPatientModel { String referralClinicDescription; String referringDoctorName; bool isReferralDoctorSameBranch; + String referralStatusDesc; MyReferredPatientModel({ this.rowID, @@ -128,7 +129,7 @@ class MyReferredPatientModel { this.referringDoctorName, this.isReferralDoctorSameBranch, this.referralDoctorName, - this.referralClinicDescription, + this.referralClinicDescription,this.referralStatusDesc }); MyReferredPatientModel.fromJson(Map json) { @@ -194,6 +195,7 @@ class MyReferredPatientModel { referringDoctorName = json['ReferringDoctorName']; referralDoctorName = json['ReferralDoctorName']; referralClinicDescription = json['ReferralClinicDescription']; + referralStatusDesc = json['ReferralStatusDesc']; } Map toJson() { diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 1cdc5987..dd3e0995 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart'; import 'package:doctor_app_flutter/screens/procedures/add_lab_orders.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -37,7 +38,7 @@ class _LabsHomePageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getLabs(patient, isInpatient: isInpatient), + onModelReady: (model) => model.getLabs(patient, isInpatient: false), builder: (context, ProcedureViewModel model, widget) => AppScaffold( baseViewModel: model, backgroundColor: Colors.grey[100], @@ -105,42 +106,7 @@ class _LabsHomePageState extends State { )), ); },label: 'Apply for New Lab Order',), - if(!isInpatient) - Container( - margin: EdgeInsets.only(right: 8), - width: double.maxFinite, - child: InkWell( - onTap: (){ - setState(() { - isInpatient= true; - }); - model.getLabs(patient, isInpatient: true); - }, - child: Align( - alignment: Alignment.centerRight, - child: AppText('View Inpatient Lab Result', - textDecoration:TextDecoration.underline,color: Colors.red,), - ), - ), - ), - if(isInpatient) - Container( - width: double.maxFinite, - margin: EdgeInsets.only(right: 8), - child: InkWell( - onTap: (){ - setState(() { - isInpatient= false; - }); - model.getLabs(patient, isInpatient: false); - }, - child: Align( - alignment: Alignment.centerRight, - child: AppText('View Outpatient Lab Result', - textDecoration:TextDecoration.underline,color: Colors.red,), - ), - ), - ), + ...List.generate( model.patientLabOrdersList.length, (index) => Column( @@ -149,26 +115,80 @@ class _LabsHomePageState extends State { children: model .patientLabOrdersList[index].patientLabOrdersList .map((labOrder) { - return DoctorCard( - onTap: () => Navigator.push( - context, - FadePage( - page: LaboratoryResultPage( - patientLabOrders: labOrder, - patient: patient, - arrivalType: arrivalType, - patientType: patientType, + return Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + color: Colors.white), + child: Row( + children: [ + Container( + width: 20, + height: 160, + decoration: BoxDecoration( + //Colors.red[900] Color(0xff404545) + color: labOrder.isLiveCareAppointment + ? Colors.red[900] + : !labOrder.isInOutPatient + ? Colors.black + : Color(0xffa9a089), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + bottomLeft: Radius.circular(8), + + ), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + labOrder.isLiveCareAppointment + ? TranslationBase.of(context) + .liveCare + .toUpperCase() + : !labOrder.isInOutPatient + ? TranslationBase.of(context) + .inPatient + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), + style: TextStyle(color: Colors.white), + ), + )), + ), + Expanded( + child: DoctorCard( + isNoMargin: true, + onTap: () => Navigator.push( + context, + FadePage( + page: LaboratoryResultPage( + patientLabOrders: labOrder, + patient: patient, + arrivalType: arrivalType, + patientType: patientType, + ), + ), + ), + doctorName: labOrder.doctorName, + invoiceNO: ' ${labOrder.invoiceNo}', + profileUrl: labOrder.doctorImageURL, + branch: labOrder.projectName, + clinic: labOrder.clinicDescription, + appointmentDate: labOrder.orderDate, + orderNo: labOrder.orderNo, + isShowTime: false, + ), ), - ), + ], ), - doctorName: labOrder.doctorName, - invoiceNO: ' ${labOrder.invoiceNo}', - profileUrl: labOrder.doctorImageURL, - branch: labOrder.projectName, - clinic: labOrder.clinicDescription, - appointmentDate: labOrder.orderDate, - orderNo: labOrder.orderNo, - isShowTime: false, ); }).toList(), ), diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index 4f3b5be2..acc79d19 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -64,17 +64,18 @@ class RadiologyDetailsPage extends StatelessWidget { SizedBox( height: 5, ), - AppText(TranslationBase.of(context).generalResult), - SizedBox( - height: 5, + Padding( + padding: const EdgeInsets.all(8.0), + child: AppText(TranslationBase.of(context).generalResult,color: Color(0xff2E303A),), ), + Padding( padding: const EdgeInsets.all(8.0), child: AppText( '${finalRadiology.reportData.trim()}', textAlign: TextAlign.start, fontSize: 17, - color: Colors.grey, + color: Color(0xff575757), ), ), SizedBox( @@ -94,8 +95,9 @@ class RadiologyDetailsPage extends StatelessWidget { margin: EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), child: SecondaryButton( - color: Colors.red[600], + color: Color(0xffD02127), disabled: finalRadiology.dIAPACSURL == "", + textColor: Color(0xffFFFFFF), onTap: () { launch(model.radImageURL); }, diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index ec34bcd1..6c709e83 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart'; import 'package:doctor_app_flutter/screens/procedures/add_radiology_order.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -24,6 +25,7 @@ class _RadiologyHomePageState extends State { PatiantInformtion patient; String arrivalType; bool isInpatient; + @override void didChangeDependencies() { super.didChangeDependencies(); @@ -38,8 +40,8 @@ class _RadiologyHomePageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => - model.getPatientRadOrders(patient, patientType: patientType, isInPatient: isInpatient), + onModelReady: (model) => model.getPatientRadOrders(patient, + patientType: patientType, isInPatient: false), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], @@ -112,63 +114,81 @@ class _RadiologyHomePageState extends State { }, label: 'Apply for Radiology Order', ), - if(!isInpatient) - Container( - width: double.maxFinite, - margin: EdgeInsets.only(right: 8), - child: InkWell( - onTap: (){ - setState(() { - isInpatient = true; - }); - model.getPatientRadOrders(patient, patientType: patientType, isInPatient: true); - }, - child: Align( - alignment: Alignment.centerRight, - child: AppText('View Inpatient Lab Result', - textDecoration:TextDecoration.underline,color: Colors.red,), - ), - ), - ), - if(isInpatient) - Container( - margin: EdgeInsets.only(right: 8), - width: double.maxFinite, - child: InkWell( - onTap: (){ - setState(() { - isInpatient = false; - }); - model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false); - }, - child: Align( - alignment: Alignment.centerRight, - child: AppText('View Outpatient Lab Result', - textDecoration:TextDecoration.underline,color: Colors.red,), - ), - ), - ), ...List.generate( model.radiologyList.length, - (index) => InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: RadiologyDetailsPage( - finalRadiology: model.radiologyList[index], - patient: patient, + (index) => Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, ), - ), - ), - child: DoctorCard( - doctorName: model.radiologyList[index].doctorName, - profileUrl: model.radiologyList[index].doctorImageURL, - invoiceNO: '${model.radiologyList[index].invoiceNo}', - branch: '${model.radiologyList[index].projectName}', - clinic: model.radiologyList[index].clinicDescription, - appointmentDate: - !isInpatient?model.radiologyList[index].orderDate : - model.radiologyList[index].reportDate, + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + color: Colors.white), + child: Row( + children: [ + Container( + width: 20, + height: 160, + decoration: BoxDecoration( + //Colors.red[900] Color(0xff404545) + color: model.radiologyList[index].isLiveCareAppodynamicment + ? Colors.red[900] + : !model.radiologyList[index].isInOutPatient + ? Colors.black + : Color(0xffa9a089), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + bottomLeft: Radius.circular(8), + + ), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + model.radiologyList[index].isLiveCareAppodynamicment + ? TranslationBase.of(context) + .liveCare + .toUpperCase() + : !model.radiologyList[index].isInOutPatient + ? TranslationBase.of(context) + .inPatient + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), + style: TextStyle(color: Colors.white), + ), + )), + ), + Expanded( + child: DoctorCard( + isNoMargin: true, + doctorName: model.radiologyList[index].doctorName, + profileUrl: model.radiologyList[index].doctorImageURL, + invoiceNO: '${model.radiologyList[index].invoiceNo}', + branch: '${model.radiologyList[index].projectName}', + clinic: model.radiologyList[index].clinicDescription, + appointmentDate: !isInpatient + ? model.radiologyList[index].orderDate + : model.radiologyList[index].reportDate, + onTap: () { + Navigator.push( + context, + FadePage( + page: RadiologyDetailsPage( + finalRadiology: model.radiologyList[index], + patient: patient, + ), + ), + ); + }, + ), + ), + ], ), )), if (model.radiologyList.isEmpty && diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index ceb35929..23bbb2b9 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -66,8 +66,7 @@ class ReferredPatientScreen extends StatelessWidget { ); }, child: PatientReferralItemWidget( - referralStatus: - "${model.getReferralStatusNameByCode(model.getReferredPatientItem(index).referralStatus, context)}", + referralStatus:model.getReferredPatientItem(index).referralStatusDesc, referralStatusCode: model .getReferredPatientItem(index) .referralStatus, diff --git a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart index 07c4b38e..a9ca6c27 100644 --- a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart @@ -146,7 +146,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { MainAxisAlignment.spaceBetween, children: [ AppText( - "${model.getReferralStatusNameByCode(referredPatient.referralStatus, context)}", + referredPatient.referralStatusDesc, fontFamily: 'Poppins', fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 2352ae32..c99bb063 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -284,118 +284,7 @@ class _PrescriptionFormWidgetState extends State { child: Column( //mainAxisAlignment: MainAxisAlignment.end, children: [ - // Container( - // height: MediaQuery.of(context).size.height * - // 0.070, - // color: Colors.white, - // child: InkWell( - // onTap: model.allMedicationList != null - // ? () { - // Helpers.hideKeyboard(context); - // setState(() { - // _selectedMedication = null; - // model.getItem( - // itemID: _selectedMedication - // .itemId); - // }); - // } - // : null, - // child: _selectedMedication == null - // ? AutoCompleteTextField< - // GetMedicationResponseModel>( - // onFocusChanged: (__) { - // if (_selectedMedication != - // null) { - // model.getItem( - // itemID: - // _selectedMedication - // .itemId); - // uom = _selectedMedication.uom; - // } else { - // null; - // } - // if (_selectedMedication != - // null && - // duration != null && - // frequency != null && - // strengthController.text != - // null) { - // model.getBoxQuantity( - // freq: frequency[ - // 'parameterCode'], - // duration: duration['id'], - // itemCode: - // _selectedMedication - // .itemId, - // strength: double.parse( - // strengthController - // .text)); - // box = model.boxQuintity; - // - // return; - // } - // }, - // decoration: - // textFieldSelectorDecoration( - // TranslationBase.of(context) - // .searchMedicineNameHere, - // _selectedMedication != null - // ? _selectedMedication - // .genericName - // : null, - // true, - // ), - // itemSubmitted: (item) => setState( - // () => _selectedMedication = - // item), - // key: key, - // suggestions: - // model.allMedicationList, - // itemBuilder: (context, - // suggestion) => - // new Padding( - // child: AppText(suggestion - // .description + - // '/' + - // suggestion - // .genericName), - // padding: - // EdgeInsets.all(15.0)), - // itemSorter: (a, b) => 1, - // suggestionsAmount: 7, - // itemFilter: (suggestion, input) => - // suggestion.genericName.toLowerCase().startsWith( - // input.toLowerCase()) || - // suggestion.description - // .toLowerCase() - // .startsWith(input - // .toLowerCase()) || - // suggestion.keywords - // .toLowerCase() - // .startsWith( - // input.toLowerCase()), - // ) - // : TextField( - // onEditingComplete: () { - // model.getItem( - // itemID: _selectedMedication - // .itemId); - // }, - // decoration: textFieldSelectorDecoration( - // TranslationBase.of(context) - // .searchMedicineNameHere, - // _selectedMedication != null - // ? _selectedMedication - // .description + - // ('${_selectedMedication.genericName}') - // : null, - // false, - // suffixIcon: - // Icon(Icons.search)), - // enabled: false, - // ), - // ), - // ), + FractionallySizedBox( widthFactor: 0.9, child: Container( diff --git a/lib/widgets/shared/buttons/secondary_button.dart b/lib/widgets/shared/buttons/secondary_button.dart index acd99c99..48c65baf 100644 --- a/lib/widgets/shared/buttons/secondary_button.dart +++ b/lib/widgets/shared/buttons/secondary_button.dart @@ -238,11 +238,9 @@ class _SecondaryButtonState extends State widget.label, style: TextStyle( color: widget.textColor, - fontSize: widget.small ? 12.0 : 15.0, - // fontWeight: FontWeight.w800, - fontFamily: projectViewModel.isArabic - ? 'Cairo' - : 'Poppins'), + fontSize: 16, + fontWeight: FontWeight.w700, + fontFamily: 'Poppins'), ), ) ], diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 1c889d9d..778ce3c8 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -20,6 +20,7 @@ class DoctorCard extends StatelessWidget { final String clinic; final bool isShowEye; final bool isShowTime; + final bool isNoMargin; DoctorCard( {this.doctorName, @@ -31,13 +32,13 @@ class DoctorCard extends StatelessWidget { this.orderNo, this.isPrescriptions = false, this.clinic, - this.isShowEye = true, this.isShowTime= true}); + this.isShowEye = true, this.isShowTime= true, this.isNoMargin =false}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - margin: EdgeInsets.all(10), + margin: EdgeInsets.all(!isNoMargin? 10:0), decoration: BoxDecoration( border: Border.all( width: 0.5, From 3e24278d89398ed3891082244fd11c218abb15c3 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 26 Apr 2021 14:59:37 +0300 Subject: [PATCH 13/50] in-patient re-design --- lib/config/config.dart | 3 + lib/config/localized_values.dart | 1 + lib/core/model/PatientSearchRequestModel.dart | 18 +- lib/core/service/patientInPatientService.dart | 36 ++++ .../viewModel/PatientSearchViewModel.dart | 53 ++++- lib/locator.dart | 2 + lib/screens/home/home_screen.dart | 26 ++- .../patients/PatientsInPatientScreen.dart | 189 ++++++++++++++++++ lib/util/translations_delegate_base.dart | 2 + .../shared/text_fields/text_fields_utils.dart | 4 +- 10 files changed, 312 insertions(+), 22 deletions(-) create mode 100644 lib/core/service/patientInPatientService.dart create mode 100644 lib/screens/patients/PatientsInPatientScreen.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 5c704152..e930aef9 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -152,6 +152,9 @@ const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; const GET_PATIENT_ARRIVAL_LIST = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; +const GET_PATIENT_IN_PATIENT_LIST = + 'Services/DoctorApplication.svc/REST/GetMyInPatient'; + const Verify_Referral_Doctor_Remarks = 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index cfad087a..eec509a9 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -48,6 +48,7 @@ const Map> localizedValues = { 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'}, 'inPatient': {'en': 'My InPatients', 'ar': 'المريض الداخلي'}, + 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى الداخليين'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'searchMedicine': {'en': 'Search Medicines', 'ar': 'بحث عن الدواء'}, diff --git a/lib/core/model/PatientSearchRequestModel.dart b/lib/core/model/PatientSearchRequestModel.dart index 72b1aa9e..e758d5e8 100644 --- a/lib/core/model/PatientSearchRequestModel.dart +++ b/lib/core/model/PatientSearchRequestModel.dart @@ -10,15 +10,15 @@ class PatientSearchRequestModel { String to; PatientSearchRequestModel( - {this.doctorID, - this.firstName, - this.middleName, - this.lastName, - this.patientMobileNumber, - this.patientIdentificationID, - this.patientID, - this.from, - this.to}); + {this.doctorID = 0, + this.firstName = "0", + this.middleName = "0", + this.lastName = "0", + this.patientMobileNumber = "0", + this.patientIdentificationID = "0", + this.patientID = 0, + this.from = "0", + this.to = "0"}); PatientSearchRequestModel.fromJson(Map json) { doctorID = json['DoctorID']; diff --git a/lib/core/service/patientInPatientService.dart b/lib/core/service/patientInPatientService.dart new file mode 100644 index 00000000..3e0ba4a4 --- /dev/null +++ b/lib/core/service/patientInPatientService.dart @@ -0,0 +1,36 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +class PatientInPatientService extends BaseService { + List inPatientList = List(); + + Future getInPatientList( + PatientSearchRequestModel requestModel, bool isMyInpatient) async { + hasError = false; + await getDoctorProfile(); + + if (isMyInpatient) { + requestModel.doctorID = doctorProfile.doctorID; + }else { + requestModel.doctorID = 0; + } + + await baseAppClient.post( + GET_PATIENT_IN_PATIENT_LIST, + onSuccess: (dynamic response, int statusCode) { + inPatientList.clear(); + + response['List_MyInPatient'].forEach((v) { + inPatientList.add(PatiantInformtion.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: requestModel.toJson(), + ); + } +} diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index ea0e5cec..e2d675ca 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -1,5 +1,54 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/service/patientInPatientService.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +import '../../locator.dart'; import 'base_view_model.dart'; -class PatientSearchViewModel extends BaseViewModel{ +class PatientSearchViewModel extends BaseViewModel { + PatientInPatientService _inPatientService = + locator(); + + List get _inPatientList => _inPatientService.inPatientList; + List filteredInPatientItems = List(); + + Future getInPatientList(PatientSearchRequestModel requestModel, + {bool isMyInpatient = false}) async { + setState(ViewState.Busy); + await _inPatientService.getInPatientList(requestModel, isMyInpatient); + if (_inPatientService.hasError) { + error = _inPatientService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + filteredInPatientItems.clear(); + filteredInPatientItems.addAll(_inPatientList); + } + } + + void filterSearchResults(String query) { + var strExist = query.length > 0 ? true : false; + if (strExist) { + filteredInPatientItems = []; + for (var i = 0; i < _inPatientList.length; i++) { + String firstName = _inPatientList[i].firstName.toUpperCase(); + String lastName = _inPatientList[i].lastName.toUpperCase(); + String mobile = _inPatientList[i].mobileNumber.toUpperCase(); + String patientID = _inPatientList[i].patientId.toString(); + + if (firstName.contains(query.toUpperCase()) || + lastName.contains(query.toUpperCase()) || + mobile.contains(query) || + patientID.contains(query)) { + filteredInPatientItems.add(_inPatientList[i]); + } + } + notifyListeners(); + } else { + filteredInPatientItems = _inPatientList; + notifyListeners(); + } + } -} \ No newline at end of file +} diff --git a/lib/locator.dart b/lib/locator.dart index 3aabd46b..c6ddae3c 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -27,6 +27,7 @@ import 'core/service/patient-admission-request-service.dart'; import 'core/service/patient-doctor-referral-service.dart'; import 'core/service/patient-ucaf-service.dart'; import 'core/service/patient-vital-signs-service.dart'; +import 'core/service/patientInPatientService.dart'; import 'core/service/prescriptions_service.dart'; import 'core/service/radiology_service.dart'; import 'core/service/referral_patient_service.dart'; @@ -80,6 +81,7 @@ void setupLocator() { locator.registerLazySingleton(() => ReferralService()); locator.registerLazySingleton(() => MyReferralInPatientService()); locator.registerLazySingleton(() => DischargedPatientService()); + locator.registerLazySingleton(() => PatientInPatientService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 39fc7a8c..5b1574df 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/search_medicine_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/DischargedPatientPage.dart'; +import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart'; import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; @@ -30,6 +31,7 @@ import 'package:doctor_app_flutter/widgets/dashboard/swiper_rounded_pagination.d import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-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/transitions/fade_page.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -494,15 +496,21 @@ class _HomeScreenState extends State { ), hasBorder: false, onTap: () { - getRequestHeader(true); - Navigator.of(context) - .pushNamed(PATIENTS, arguments: { - "patientSearchForm": - _patientSearchFormValues, - "selectedType": "1", - "arrivalType": "1", - "isInpatient": true - }); + Navigator.push( + context, + FadePage( + page: PatientInPatientScreen(), + ), + ); + // getRequestHeader(true); + // Navigator.of(context) + // .pushNamed(PATIENTS, arguments: { + // "patientSearchForm": + // _patientSearchFormValues, + // "selectedType": "1", + // "arrivalType": "1", + // "isInpatient": true + // }); }, ), HomePageCard( diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart new file mode 100644 index 00000000..e46055d5 --- /dev/null +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -0,0 +1,189 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.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/PatientCard.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/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; +import 'package:flutter/material.dart'; + +import '../../routes.dart'; + +class PatientInPatientScreen extends StatefulWidget { + @override + _PatientInPatientScreenState createState() => _PatientInPatientScreenState(); +} + +class _PatientInPatientScreenState extends State { + PatientSearchRequestModel requestModel = PatientSearchRequestModel(); + int _activeTab = 0; + + TextEditingController _searchController = TextEditingController(); + + @override + void dispose() { + _searchController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + + return BaseView( + onModelReady: (model) => model.getInPatientList(requestModel), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + Expanded( + child: AppText( + TranslationBase.of(context).inPatient, + fontSize: SizeConfig.textMultiplier * 2.8, + fontWeight: FontWeight.bold, + color: Color(0xFF2B353E), + fontFamily: 'Poppins', + ), + ), + ]), + ), + ), + tabsBar(context, screenSize, model), + model.filteredInPatientItems.length > 0 + ? Expanded( + child: Container( + margin: EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFieldCustom( + hintText: TranslationBase.of(context) + .searchPatientName, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.black, + ), + onPressed: () {}, + ), + controller: _searchController, + onChanged: (value) { + model.filterSearchResults(value); + }), + const SizedBox( + height: 16, + ), + ...model.filteredInPatientItems.map((item) { + return PatientCard( + patientInfo: item, + patientType: "1", + arrivalType: "1", + isInpatient: true, + onTap: () { + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": item, + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); + }, + ); + }).toList(), + ], + ), + ), + ), + ) + : Container( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable)), + ], + ), + ), + ); + } + + Widget tabsBar( + BuildContext context, Size screenSize, PatientSearchViewModel model) { + List _tabs = [ + TranslationBase.of(context).inPatientAll.toUpperCase(), + TranslationBase.of(context).inPatient.toUpperCase(), + ]; + + return Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _tabs.map((item) { + bool _isActive = _tabs[_activeTab] == item ? true : false; + + return Expanded( + child: InkWell( + onTap: () async { + setState(() { + _activeTab = _tabs.indexOf(item); + }); + // GifLoaderDialogUtils.showMyDialog( + // context); + await model.getInPatientList(requestModel, + isMyInpatient: _activeTab == 1); + }, + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + _isActive + ? Color(0xFFD02127 /*B8382B*/) + : Color(0xFFEAEAEA), + _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + item, + fontSize: SizeConfig.textMultiplier * 1.8, + color: _isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + ), + ), + ), + ), + ); + }).toList(), + ), + ); + } +} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 4645a5e0..3d431f9d 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -101,6 +101,8 @@ class TranslationBase { String get inPatient => localizedValues['inPatient'][locale.languageCode]; + String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; + String get operations => localizedValues['operations'][locale.languageCode]; String get patientServices => diff --git a/lib/widgets/shared/text_fields/text_fields_utils.dart b/lib/widgets/shared/text_fields/text_fields_utils.dart index 660f7918..54c7e494 100644 --- a/lib/widgets/shared/text_fields/text_fields_utils.dart +++ b/lib/widgets/shared/text_fields/text_fields_utils.dart @@ -4,11 +4,11 @@ class TextFieldsUtils{ static BoxDecoration containerBorderDecoration( Color containerColor, Color borderColor, - {double borderWidth = -1}) { + {double borderWidth = -1, double borderRadius = 12}) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(12)), + borderRadius: BorderRadius.all(Radius.circular(borderRadius)), border: Border.fromBorderSide(BorderSide( color: borderColor, width: borderWidth == -1 ? 2.0 : borderWidth, From 058a6d9e8cc3493bd5cd2d0ea1bc2a40d0981825 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 26 Apr 2021 15:00:44 +0300 Subject: [PATCH 14/50] sick leave service --- lib/core/model/sick_leave_patient_model.dart | 22 ++- lib/core/service/sickleave_service.dart | 48 +++--- lib/core/viewModel/sick_leave_view_model.dart | 11 ++ lib/screens/sick-leave/add-sickleave.dart | 163 +++++++++--------- 4 files changed, 137 insertions(+), 107 deletions(-) diff --git a/lib/core/model/sick_leave_patient_model.dart b/lib/core/model/sick_leave_patient_model.dart index e0637845..3c78f1ff 100644 --- a/lib/core/model/sick_leave_patient_model.dart +++ b/lib/core/model/sick_leave_patient_model.dart @@ -1,3 +1,5 @@ +import 'package:doctor_app_flutter/widgets/shared/StarRating.dart'; + class SickLeavePatientModel { String setupID; int projectID; @@ -30,8 +32,10 @@ class SickLeavePatientModel { dynamic patientName; String projectName; String qR; - List speciality; + // List speciality; String strRequestDate; + String startDate; + String endDate; SickLeavePatientModel( {this.setupID, @@ -65,11 +69,14 @@ class SickLeavePatientModel { this.patientName, this.projectName, this.qR, - this.speciality, - this.strRequestDate}); + // this.speciality, + this.strRequestDate, + this.startDate, + this.endDate}); SickLeavePatientModel.fromJson(Map json) { setupID = json['SetupID']; + projectID = json['ProjectID']; patientID = json['PatientID']; patientType = json['PatientType']; @@ -100,13 +107,16 @@ class SickLeavePatientModel { patientName = json['PatientName']; projectName = json['ProjectName']; qR = json['QR']; - speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); strRequestDate = json['StrRequestDate']; + startDate = json['StartDate']; + endDate = json['EndDate']; } Map toJson() { final Map data = new Map(); data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; data['PatientID'] = this.patientID; data['PatientType'] = this.patientType; @@ -137,8 +147,10 @@ class SickLeavePatientModel { data['PatientName'] = this.patientName; data['ProjectName'] = this.projectName; data['QR'] = this.qR; - data['Speciality'] = this.speciality; + // data['Speciality'] = this.speciality; data['StrRequestDate'] = this.strRequestDate; + data['StartDate'] = this.startDate; + data['EndDate'] = this.endDate; return data; } } diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index bba9b31f..90785a7b 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -98,13 +98,13 @@ class SickLeaveService extends BaseService { Future getSickLeave(patientMRN) async { hasError = false; - await baseAppClient.post( + await baseAppClient.postPatient( GET_SICK_LEAVE, onSuccess: (dynamic response, int statusCode) { Future.value(response); - _getAllsickLeave.clear(); - response['SickLeavesList']['entityList'].forEach((v) { - _getAllsickLeave.add(GetAllSickLeaveResponse.fromJson(v)); + _getAllsickLeavePatient.clear(); + response['List_SickLeave'].forEach((v) { + _getAllsickLeavePatient.add(SickLeavePatientModel.fromJson(v)); }); }, onFailure: (String error, int statusCode) { @@ -115,26 +115,26 @@ class SickLeaveService extends BaseService { ); } - // Future getSickLeavePatient(patientMRN) async { - // _sickLeavePatientRequestModel = - // SickLeavePatientRequestModel(patientID: patientMRN, patientType: 1); - // hasError = false; - // await baseAppClient.post( - // GET_SICK_LEAVE_PATIENT, - // onSuccess: (dynamic response, int statusCode) { - // Future.value(response); - // _getAllsickLeavePatient.clear(); - // response['List_SickLeave'].forEach((v) { - // _getAllsickLeavePatient.add(SickLeavePatientModel.fromJson(v)); - // }); - // }, - // onFailure: (String error, int statusCode) { - // hasError = true; - // super.error = error; - // }, - // body: _sickLeavePatientRequestModel.toJson(), - // ); - // } + Future getSickLeavePatient(patientMRN) async { + _sickLeavePatientRequestModel = SickLeavePatientRequestModel( + patientID: patientMRN, patientTypeID: 2, patientType: 1); + hasError = false; + await baseAppClient.postPatient( + GET_SICK_LEAVE_PATIENT, + onSuccess: (dynamic response, int statusCode) { + Future.value(response); + _getAllsickLeavePatient.clear(); + response['List_SickLeave'].forEach((v) { + _getAllsickLeavePatient.add(SickLeavePatientModel.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: _sickLeavePatientRequestModel.toJson(), + ); + } Future getRescheduleLeave() async { hasError = false; diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index d959f3aa..f5ddd676 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -10,6 +10,7 @@ class SickLeaveViewModel extends BaseViewModel { SickLeaveService _sickLeaveService = locator(); get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics; get getAllSIckLeave => _sickLeaveService.getAllSickLeave; + get getAllSIckLeavePatient => _sickLeaveService.getAllSickLeavePatient; List get allOffTime => _sickLeaveService.getOffTimeList; List get allReasons => _sickLeaveService.getReasons; List get coveringDoctors => _sickLeaveService.coveringDoctorsList; @@ -56,6 +57,16 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future getSickLeavePatient(patientMRN) async { + setState(ViewState.Busy); + await _sickLeaveService.getSickLeavePatient(patientMRN); + if (_sickLeaveService.hasError) { + error = _sickLeaveService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + Future getRescheduleLeave() async { setState(ViewState.Busy); await _sickLeaveService.getRescheduleLeave(); diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 7820b16c..444e76bd 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/sick_leave_patient_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; @@ -22,7 +23,7 @@ class AddSickLeavScreen extends StatelessWidget { patient = routeArgs['patient']; return BaseView( onModelReady: (model) => - model.getSickLeave(patient.patientMRN ?? patient.patientId), + model.getSickLeavePatient(patient.patientMRN ?? patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, @@ -102,25 +103,26 @@ class AddSickLeavScreen extends StatelessWidget { ], ) : SizedBox(), - model.getAllSIckLeave.length > 0 + model.getAllSIckLeavePatient.length > 0 ? Column( - children: model.getAllSIckLeave - .map((GetAllSickLeaveResponse item) { + children: model.getAllSIckLeavePatient + .map((SickLeavePatientModel item) { return RoundedContainer( margin: EdgeInsets.all(10), child: Column( children: [ Container( - decoration: BoxDecoration( - border: Border( - left: BorderSide( - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, - width: 5.0, - ))), + // decoration: BoxDecoration( + // border: Border( + // left: BorderSide( + // // color: item.status == 1 + // // ? Colors.yellow[800] + // // : item.status == 2 + // // ? Colors.green + // // : Colors.black, + // color: Colors.red, + // width: 5.0, + // ))), padding: EdgeInsets.all(10), child: Row( mainAxisAlignment: @@ -139,35 +141,37 @@ class AddSickLeavScreen extends StatelessWidget { Container( padding: EdgeInsets.all(3), child: AppText( - item.status == 1 - ? TranslationBase.of( - context) - .hold - : item.status == 2 - ? TranslationBase - .of( - context) - .active - : TranslationBase - .of(context) - .all, + item.doctorName, + // item.status == 1 + // ? TranslationBase.of( + // context) + // .hold + // : item.status == 2 + // ? TranslationBase + // .of( + // context) + // .active + // : TranslationBase + // .of(context) + // .all, fontWeight: FontWeight.bold, - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, + // color: item.status == 1 + // ? Colors.yellow[800] + // : item.status == 2 + // ? Colors.green + // : Colors.black, + color: Colors.red, ), ), Row( children: [ + AppText(TranslationBase + .of(context) + .daysSickleave + + ": "), AppText( - TranslationBase.of( - context) - .daysSickleave), - AppText( - item.noOfDays + item.sickLeaveDays .toString(), fontWeight: FontWeight.bold, @@ -183,52 +187,55 @@ class AddSickLeavScreen extends StatelessWidget { ' ', ), Flexible( - child: AppText( - DateUtils - .convertStringToDateFormat( - item.startDate, - 'dd-MMM-yyyy'), - fontWeight: - FontWeight.bold, - )) + child: AppText( + DateUtils + .convertStringToDateFormat( + item.startDate, + 'dd-MMM-yyyy'), + fontWeight: + FontWeight.bold, + ), + ) ], ), Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - AppText( - item.remarks ?? "", + children: [ + AppText( + TranslationBase.of( + context) + .endDate + + ' ', + ), + Flexible( + child: AppText( + DateUtils + .convertStringToDateFormat( + item.endDate, + 'dd-MMM-yyyy'), + fontWeight: + FontWeight.bold, ), - // (item.status == 1 || - // item.status == 2) - // ? IconButton( - // icon: Image.asset( - // 'assets/images/edit.png'), - // - // // color: Colors.green, //Colors.black, - // onPressed: () => { - // if (item.status == - // 1) - // { - // DrAppToastMsg.showErrorToast( - // TranslationBase.of( - // context) - // .sickleaveonhold) - // } - // else - // { - // openSickLeave( - // context, - // true, - // extendedData: - // item) - // } - // }, - // ) - // : SizedBox() - ]), + ) + ], + ), + Row(children: [ + AppText(TranslationBase.of( + context) + .branch + + ": "), + AppText( + item.projectName ?? "", + ), + ]), + Row(children: [ + AppText(TranslationBase.of( + context) + .clinic + + ": "), + AppText( + item.clinicName ?? "", + ), + ]), ], ), SizedBox( From 20f7664b4c47d9c3e4c09746b0fe31c06054d474 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 15:09:39 +0300 Subject: [PATCH 15/50] fix issue --- .../viewModel/PatientSearchViewModel.dart | 77 +++++- lib/screens/home/home_screen.dart | 63 ++--- .../patient_search_screen_new.dart | 2 +- ...n_new.dart => patients_screen_search.dart} | 251 +++++------------- .../patients/patient_search/time_bar.dart | 102 +++++++ 5 files changed, 264 insertions(+), 231 deletions(-) rename lib/screens/patients/patient_search/{patients_screen_new.dart => patients_screen_search.dart} (75%) create mode 100644 lib/screens/patients/patient_search/time_bar.dart diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 455e8788..fc37cbed 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -1,7 +1,9 @@ +import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/patient/out_patient_service.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -11,19 +13,29 @@ class PatientSearchViewModel extends BaseViewModel{ List get patientList => _outPatientService.patientList; - getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async { - setState(ViewState.Busy); + getOutPatient(PatientSearchRequestModel patientSearchRequestModel , {bool isLocalBusy = false}) async { + if(isLocalBusy) { + setState(ViewState.BusyLocal); + } else { + setState(ViewState.Busy); + } + await _outPatientService.getOutPatient( patientSearchRequestModel); if (_outPatientService.hasError) { error = _outPatientService.error; + if(isLocalBusy) { + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Error); + } setState(ViewState.Error); } else { setState(ViewState.Idle); } } - getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel) async { + getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel, {bool isLocalBusy = false}) async { setState(ViewState.Busy); await _outPatientService.getPatientFileInformation( patientSearchRequestModel); @@ -35,4 +47,63 @@ class PatientSearchViewModel extends BaseViewModel{ } } + + + getPatientBasedOnDate ( + {item, PatientSearchRequestModel patientSearchRequestModel, PatientType selectedPatientType, + bool isSearchWithKeyInfo })async { + String dateTo; + String dateFrom; + if (item == 'Tomorrow') { + dateTo = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 1), + 'yyyy-MM-dd'); + dateFrom = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 1), + 'yyyy-MM-dd'); + } else if (item == 'Next Week') { + + + dateTo = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 6), + 'yyyy-MM-dd'); + + dateFrom = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 1), + 'yyyy-MM-dd'); + } else { + dateFrom = DateUtils.convertDateToFormat( + DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day), + 'yyyy-MM-dd'); + dateTo= DateUtils.convertDateToFormat( + DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day), + 'yyyy-MM-dd'); + } + PatientSearchRequestModel currentModel = PatientSearchRequestModel(); + currentModel.patientID = patientSearchRequestModel.patientID; + currentModel.firstName = patientSearchRequestModel.firstName; + currentModel.lastName = patientSearchRequestModel.lastName; + currentModel.middleName = patientSearchRequestModel.middleName; + currentModel.from = dateFrom; + currentModel.to = dateTo; + + + if(isSearchWithKeyInfo) { + await getPatientFileInformation(currentModel); + } else { + if(selectedPatientType == PatientType.OutPatient) { + await getOutPatient(currentModel, isLocalBusy: true); + } else { + // TODO handel inPatient case + } + } + + } + } \ No newline at end of file diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 47bc1d0b..f81cb803 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -465,44 +465,6 @@ class _HomeScreenState extends State { child: new ListView( scrollDirection: Axis.horizontal, children: [ - HomePageCard( - color: Colors.black, - margin: EdgeInsets.all(5), - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - top: 10, left: 10, right: 0), - child: Icon( - DoctorApp.search, - size: 32, - color: Colors.white, - )), - Container( - padding: EdgeInsets.all(10), - child: AppText( - "New:"+TranslationBase.of(context) - .searchPatient, - color: Colors.white, - textAlign: TextAlign.start, - fontSize: 13, - )) - ], - ), - hasBorder: false, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - PatientSearchScreenNew(), - )); - }, - ), HomePageCard( color: Colors.red[800], margin: EdgeInsets.all(5), @@ -574,15 +536,22 @@ class _HomeScreenState extends State { ), hasBorder: false, onTap: () { - getRequestHeader(false); - Navigator.of(context) - .pushNamed(PATIENTS, arguments: { - "patientSearchForm": - _patientSearchFormValues, - "selectedType": "0", - "arrivalType": "1", - "isInpatient": false - }); + // getRequestHeader(false); + // Navigator.of(context) + // .pushNamed(PATIENTS, arguments: { + // "patientSearchForm": + // _patientSearchFormValues, + // "selectedType": "0", + // "arrivalType": "1", + // "isInpatient": false + // }); + + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PatientSearchScreenNew(), + )); }, ), HomePageCard( diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen_new.dart index f383cf40..7da76ec2 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_search.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_search.dart similarity index 75% rename from lib/screens/patients/patient_search/patients_screen_new.dart rename to lib/screens/patients/patient_search/patients_screen_search.dart index 5b3b5a77..d78f41d2 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_search.dart @@ -15,7 +15,7 @@ import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_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/date-utils.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; @@ -23,7 +23,6 @@ import 'package:doctor_app_flutter/widgets/patients/clinic_list_dropdwon.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/dr_app_circular_progress_Indeicator.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/material.dart'; @@ -92,27 +91,6 @@ class _PatientsScreenNewState extends State { final _controller = TextEditingController(); PatientModel patient; - 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); - searchData(String str) { this.responseModelList = this.responseModelList2; var strExist = str.length > 0 ? true : false; @@ -217,8 +195,7 @@ class _PatientsScreenNewState extends State { }, builder: (_, model, w) => AppScaffold( appBarTitle: "Search Patient", - isShowAppBar: widget.isAppbar, - // isLoading: _isLoading, + isShowAppBar: false, baseViewModel: model, body: model.patientList.isEmpty ? Column( @@ -227,18 +204,20 @@ class _PatientsScreenNewState extends State { SizedBox( height: 10.0, ), - if (widget.selectedPatientType == PatientType.OutPatient) - Container( - padding: EdgeInsets.all(5), - decoration: BoxDecoration( - color: Colors.white, - border: Border.all(color: Colors.grey), - borderRadius: BorderRadius.circular(10)), - child: ClinicList( - clinicId: clinicId, - onClinicChange: (newValue) { - clinicId = newValue; - changeClinic(newValue, context, model); + if (widget.selectedPatientType == + PatientType.OutPatient && + !widget.isSearchWithKeyInfo) + Container( + padding: EdgeInsets.all(5), + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(color: Colors.grey), + borderRadius: BorderRadius.circular(10)), + child: ClinicList( + clinicId: clinicId, + onClinicChange: (newValue) { + clinicId = newValue; + changeClinic(newValue, context, model); }, )), Padding( @@ -247,7 +226,8 @@ class _PatientsScreenNewState extends State { 0.03), // child: _locationBar(context) child: - widget.selectedPatientType == PatientType.OutPatient + (widget.selectedPatientType == PatientType.OutPatient && + widget.isSearchWithKeyInfo) ? _locationBar(context, model) : Container(), ) @@ -298,6 +278,47 @@ class _PatientsScreenNewState extends State { ) : Column( children: [ + + Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + height: 115, + child: Container( + padding: EdgeInsets.only( + left: 10, right: 10), + margin: EdgeInsets.only(top: 60), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize:20, + color: Colors.black), + children: [ + new TextSpan( + + text: "Search for 1111", + style: TextStyle( + color: Color(0xFF2B353E), + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 22)), + ], + ), + ), + ], + ), + ], + ), + ), + ), SizedBox(height: 18.5), Container( width: SizeConfig.screenWidth * 0.9, @@ -351,7 +372,9 @@ class _PatientsScreenNewState extends State { .height * 0.03), // child: _locationBar(context) - child: widget.selectedPatientType == PatientType.OutPatient? _locationBar(context, model) + child: widget.selectedPatientType == + PatientType.OutPatient && !widget.isSearchWithKeyInfo + ? _locationBar(context, model) : Container(), ), SizedBox( @@ -522,6 +545,7 @@ class _PatientsScreenNewState extends State { }); } + //TODO Replace it with time bar. Widget _locationBar(BuildContext _context, model) { return Container( height: MediaQuery.of(context).size.height * 0.0619, @@ -567,13 +591,17 @@ class _PatientsScreenNewState extends State { ), )), ), - onTap: () { - //filterBooking(item.toString()); - + onTap: () async { setState(() { _activeLocation = _locations.indexOf(item); }); - filterPatient(item.toString(), model); + GifLoaderDialogUtils.showMyDialog(context); + await model.getPatientBasedOnDate(item: item, + selectedPatientType: widget.selectedPatientType, + patientSearchRequestModel: widget + .patientSearchRequestModel, + isSearchWithKeyInfo: widget.isSearchWithKeyInfo); + GifLoaderDialogUtils.hideDialog(context); }), _isActive ? Container( @@ -592,141 +620,4 @@ class _PatientsScreenNewState extends State { ), ); } - - filterPatient(item, model) { - if (item == 'Tomorrow') { - _patientSearchFormValues.To = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), - 'yyyy-MM-dd'); - _patientSearchFormValues.From = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), - 'yyyy-MM-dd'); - } else if (item == 'Next Week') { - _patientSearchFormValues.From = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 1), - 'yyyy-MM-dd'); - - _patientSearchFormValues.To = DateUtils.convertDateToFormat( - DateTime(DateTime.now().year, DateTime.now().month, - DateTime.now().day + 6), - 'yyyy-MM-dd'); - } else { - _patientSearchFormValues.From = DateUtils.convertDateToFormat( - DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day), - 'yyyy-MM-dd'); - _patientSearchFormValues.To = DateUtils.convertDateToFormat( - DateTime( - DateTime.now().year, DateTime.now().month, DateTime.now().day), - 'yyyy-MM-dd'); - } - searchPatient(model); - } - - searchPatient(model) { - GifLoaderDialogUtils.showMyDialog(context); - int val2 = int.parse(patientType); - GetPatientArrivalListRequestModel getPatientArrivalListRequestModel; - if (val2 == 0) { - patient = PatientModel( - From: _patientSearchFormValues.From, - To: _patientSearchFormValues.To, - FirstName: "0", - MiddleName: "0", - LastName: "0", - PatientMobileNumber: "0", - PatientIdentificationID: "0", - PatientID: 0, - ); - } - - model - .getPatientList( - val2 == 7 ? getPatientArrivalListRequestModel.toJson() : patient, - patientType, - isView: isView) - .then((res) { - setState(() { - GifLoaderDialogUtils.hideDialog(context); - if (res != null && res['MessageStatus'] == 1) { - if (val2 == 7) { - if (res[SERVICES_PATIANT2[val2]] == null) { - _isError = true; - _isLoading = false; - this.error = error.toString(); - } else { - var localList = []; - if (res["patientArrivalList"]["entityList"] == null) { - res["patientArrivalList"]["entityList"] = []; - } - res["patientArrivalList"]["entityList"].forEach((v) { - Map mergedPatient = { - ...v, - ...v["patientDetails"] - }; - localList.add(mergedPatient); - }); - lItems = localList; - } - } else { - if (isView == false && val2 == 1) { - lItems = res['GetPatientFileInformation_PRMList'] - .where((i) => i['PatientTypeDescription'] == 'Permanent File') - .toList(); - } else { - lItems = res[SERVICES_PATIANT2[val2]]; - } - } - parsed = lItems; - responseModelList = new ModelResponse.fromJson(parsed).list; - if (val2 == 7) { - responseModelList.sort((a, b) { - if (b.startTime != null && b.startTime != null) { - try { - DateTime now = DateTime.now(); - DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); - String formattedDate = - DateFormat('yyyy-MM-dd ' + a.startTime).format(now); - DateTime dateTimeA = dateFormat.parse(formattedDate); - String formattedDateB = - DateFormat('yyyy-MM-dd ' + b.startTime).format(now); - DateTime dateTimeB = dateFormat.parse(formattedDateB); - var adate = dateTimeA; //a.startTime; - var bdate = dateTimeB; - return adate.compareTo(bdate); - } on Exception catch (_) { - print('never reached'); - var adate = a.startTime; //a.startTime; - var bdate = b.startTime; - return adate.compareTo(bdate); - } - } else { - var adate = convertDateFormat(a.appointmentDate); - var bdate = convertDateFormat(b.appointmentDate); - return bdate.compareTo(adate); - } - }); - } - responseModelList2 = responseModelList; - _isError = false; - } else { - _isError = true; - error = - model.error ?? res['ErrorEndUserMessage'] ?? res['ErrorMessage']; - } - - _isLoading = false; - }); - }).catchError((error) { - GifLoaderDialogUtils.hideDialog(context); - setState(() { - _isError = true; - _isLoading = false; - this.error = error.toString(); - }); - }); - } } diff --git a/lib/screens/patients/patient_search/time_bar.dart b/lib/screens/patients/patient_search/time_bar.dart new file mode 100644 index 00000000..0d376b02 --- /dev/null +++ b/lib/screens/patients/patient_search/time_bar.dart @@ -0,0 +1,102 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/patient_type.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class TimeBar extends StatefulWidget { + final PatientSearchViewModel model; + final PatientType selectedPatientType; + final PatientSearchRequestModel patientSearchRequestModel; + final bool isSearchWithKeyInfo; + + + const TimeBar({Key key, this.model, this.selectedPatientType, this.patientSearchRequestModel, this.isSearchWithKeyInfo}) : super(key: key); + @override + _TimeBarState createState() => _TimeBarState(); +} + +class _TimeBarState extends State { + + + @override + Widget build(BuildContext context) { + List _locations = [ + TranslationBase.of(context).today, + TranslationBase.of(context).tomorrow, + TranslationBase.of(context).nextWeek, + ]; + int _activeLocation = 0; + return Container( + height: MediaQuery.of(context).size.height * 0.0619, + width: SizeConfig.screenWidth * 0.94, + decoration: BoxDecoration( + color: Color(0Xffffffff), + borderRadius: BorderRadius.circular(12.5), + // border: Border.all( + // width: 0.5, + // ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _locations.map((item) { + bool _isActive = _locations[_activeLocation] == item ? true : false; + return Column(mainAxisSize: MainAxisSize.min, children: [ + InkWell( + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.058, + width: SizeConfig.screenWidth * 0.2334, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(12.5), + topRight: Radius.circular(12.5), + topLeft: Radius.circular(9.5), + bottomLeft: Radius.circular(9.5)), + color: _isActive ? HexColor("#B8382B") : Colors.white, + ), + child: Center( + child: Text( + item, + style: TextStyle( + fontSize: 12, + color: _isActive + ? Colors.white + : Colors.black, //Colors.black, + + fontWeight: FontWeight.normal, + ), + ), + )), + ), + onTap: () async{ + setState(() { + _activeLocation = _locations.indexOf(item); + }); + GifLoaderDialogUtils.showMyDialog(context); + await widget.model.getPatientBasedOnDate(item:item,selectedPatientType:widget.selectedPatientType, patientSearchRequestModel:widget.patientSearchRequestModel, isSearchWithKeyInfo:widget.isSearchWithKeyInfo); + GifLoaderDialogUtils.hideDialog(context); + }), + _isActive + ? Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(10), + topRight: Radius.circular(10)), + color: Colors.white), + alignment: Alignment.center, + height: 1, + width: SizeConfig.screenWidth * 0.23, + ) + : Container() + ]); + }).toList(), + ), + ); + } +} From 963e4b637357144594ff81305817c6f5d08e1702 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 15:11:49 +0300 Subject: [PATCH 16/50] fix issue --- .../patients/patient_search/patient_search_screen_new.dart | 2 +- .../{patients_screen_search.dart => patients_screen_new.dart} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename lib/screens/patients/patient_search/{patients_screen_search.dart => patients_screen_new.dart} (100%) diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen_new.dart index 7da76ec2..f383cf40 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_search.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; diff --git a/lib/screens/patients/patient_search/patients_screen_search.dart b/lib/screens/patients/patient_search/patients_screen_new.dart similarity index 100% rename from lib/screens/patients/patient_search/patients_screen_search.dart rename to lib/screens/patients/patient_search/patients_screen_new.dart From cc7d64e9d158e6125833a4ffdee19ad41b2bf115 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 15:24:13 +0300 Subject: [PATCH 17/50] fix merge issue --- lib/core/viewModel/PatientSearchViewModel.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 9548f306..74c4c363 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -111,9 +111,11 @@ class PatientSearchViewModel extends BaseViewModel{ } } -class PatientSearchViewModel extends BaseViewModel { + + + PatientInPatientService _inPatientService = - locator(); + locator(); List get _inPatientList => _inPatientService.inPatientList; List filteredInPatientItems = List(); @@ -156,4 +158,5 @@ class PatientSearchViewModel extends BaseViewModel { } } + } From 286d883c9bd845a926afa0776047211f93abe117 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 26 Apr 2021 15:37:19 +0300 Subject: [PATCH 18/50] in-patient re-design --- .../viewModel/PatientSearchViewModel.dart | 17 +++-- .../patients/PatientsInPatientScreen.dart | 69 ++++++++++++------- 2 files changed, 55 insertions(+), 31 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index e2d675ca..90a04c52 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -14,16 +14,20 @@ class PatientSearchViewModel extends BaseViewModel { List filteredInPatientItems = List(); Future getInPatientList(PatientSearchRequestModel requestModel, - {bool isMyInpatient = false}) async { - setState(ViewState.Busy); + {bool isMyInpatient = false, bool isFirstTime = true}) async { + if (isFirstTime) + setState(ViewState.Busy); + else + setState(ViewState.BusyLocal); await _inPatientService.getInPatientList(requestModel, isMyInpatient); if (_inPatientService.hasError) { error = _inPatientService.error; setState(ViewState.Error); } else { - setState(ViewState.Idle); filteredInPatientItems.clear(); - filteredInPatientItems.addAll(_inPatientList); + if (_inPatientList.length > 0) + filteredInPatientItems.addAll(_inPatientList); + setState(ViewState.Idle); } } @@ -46,9 +50,10 @@ class PatientSearchViewModel extends BaseViewModel { } notifyListeners(); } else { - filteredInPatientItems = _inPatientList; + if (_inPatientList.length > 0) + filteredInPatientItems.clear(); + filteredInPatientItems.addAll(_inPatientList); notifyListeners(); } } - } diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index e46055d5..ba8b5f0a 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.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'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -71,32 +72,35 @@ class _PatientInPatientScreenState extends State { ), ), tabsBar(context, screenSize, model), + Container( + margin: EdgeInsets.all(16.0), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context) + .searchPatientName, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.black, + ), + onPressed: () {}, + ), + controller: _searchController, + onChanged: (value) { + model.filterSearchResults(value); + }), + ), model.filteredInPatientItems.length > 0 ? Expanded( child: Container( - margin: EdgeInsets.all(16.0), + margin: EdgeInsets.symmetric(horizontal: 16.0), child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppTextFieldCustom( - hintText: TranslationBase.of(context) - .searchPatientName, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.black, - ), - onPressed: () {}, - ), - controller: _searchController, - onChanged: (value) { - model.filterSearchResults(value); - }), - const SizedBox( - height: 16, - ), + // const SizedBox( + // height: 16, + // ), ...model.filteredInPatientItems.map((item) { return PatientCard( patientInfo: item, @@ -104,6 +108,11 @@ class _PatientInPatientScreenState extends State { arrivalType: "1", isInpatient: true, onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } + Navigator.of(context) .pushNamed(PATIENTS_PROFILE, arguments: { "patient": item, @@ -122,9 +131,13 @@ class _PatientInPatientScreenState extends State { ), ), ) - : Container( - child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable)), + : Expanded( + child: SingleChildScrollView( + child: Container( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable)), + ), + ), ], ), ), @@ -155,10 +168,16 @@ class _PatientInPatientScreenState extends State { setState(() { _activeTab = _tabs.indexOf(item); }); - // GifLoaderDialogUtils.showMyDialog( - // context); + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } + GifLoaderDialogUtils.showMyDialog( + context); await model.getInPatientList(requestModel, - isMyInpatient: _activeTab == 1); + isMyInpatient: _activeTab == 1, isFirstTime: false); + GifLoaderDialogUtils.hideDialog( + context); }, child: Center( child: Container( From 975260df2a1dcf83ed67e94c01f0590712a78a46 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 26 Apr 2021 15:57:09 +0300 Subject: [PATCH 19/50] Search Profile Patient update --- .../profile/patient_profile_screen.dart | 14 +- ...rofile_medical_info_widget_in_patient.dart | 6 +- .../profile_medical_info_widget_search.dart | 649 ++++++++++++++---- pubspec.lock | 8 +- 4 files changed, 529 insertions(+), 148 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 749c0885..9e011ce9 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -58,7 +58,7 @@ class PatientProfileScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - !isFromSearch && isInpatient/*patientType == "1"*/ + !isFromSearch && isInpatient /*patientType == "1"*/ ? PatientProfileHeaderNewDesignInPatient( patient, patientType, arrivalType) : PatientProfileHeaderNewDesign( @@ -76,8 +76,9 @@ class PatientProfileScreen extends StatelessWidget { arrivalType: arrivalType, from: from, to: to, - isInpatient:isInpatient, - isDischargedPatient: isDischargedPatient, + isInpatient: isInpatient, + isDischargedPatient: + isDischargedPatient, ) : isFromSearch ? ProfileMedicalInfoWidgetSearch( @@ -86,7 +87,9 @@ class PatientProfileScreen extends StatelessWidget { arrivalType: arrivalType, from: from, to: to, - isInpatient:false + isInpatient: false, + isDischargedPatient: + isDischargedPatient, ) : ProfileMedicalInfoWidget( patient: patient, @@ -94,8 +97,7 @@ class PatientProfileScreen extends StatelessWidget { arrivalType: arrivalType, from: from, to: to, - isInpatient:isInpatient - ), + isInpatient: isInpatient), ], ), ), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart index f01f96f3..eea3bfbb 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_in_patient.dart @@ -16,15 +16,15 @@ class ProfileMedicalInfoWidgetInPatient extends StatelessWidget { final bool isInpatient; final bool isDischargedPatient; - - ProfileMedicalInfoWidgetInPatient( {Key key, this.patient, this.patientType, this.arrivalType, this.from, - this.to, this.isInpatient, this.isDischargedPatient = false}); + this.to, + this.isInpatient, + this.isDischargedPatient = false}); @override Widget build(BuildContext context) { diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index edca6000..c03367bc 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -4,6 +4,7 @@ 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/patients/profile/PatientProfileButton.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -14,6 +15,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { final String patientType; final String arrivalType; final bool isInpatient; + final bool isDischargedPatient; ProfileMedicalInfoWidgetSearch( {Key key, @@ -21,146 +23,523 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { this.patientType, this.arrivalType, this.from, - this.to, this.isInpatient}); + this.to, + this.isInpatient, + this.isDischargedPatient}); + TabController _tabController; + void initState() { + _tabController = TabController(length: 2); + } + + void dispose() { + _tabController.dispose(); + } @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) async {}, - builder: (_, model, w) => GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", //TranslationBase.of(context).medicalReport, - nameLine2: "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient:isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - (int.parse(patientType) == 7 || int.parse(patientType) == 6) - ? PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png') - : PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: SHOW_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.admissionNo != null && patient.admissionNo != "0") - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - if (patient.admissionNo != null && patient.admissionNo != "0") - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - nameLine1: "Order", //"Text", - nameLine2: "Sheet", - icon: 'patient/Progress_notes.png'), - if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileButton( - key: key, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - // isDisable: patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - ], + builder: (_, model, w) => DefaultTabController( + length: 2, + initialIndex: isInpatient ? 0 : 1, + child: SizedBox( + height: MediaQuery.of(context).size.height * 1.0, + width: double.infinity, + child: Scaffold( + appBar: AppBar( + backgroundColor: Colors.white, + toolbarHeight: 55, + elevation: 0, + bottom: TabBar( + controller: _tabController, + indicator: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10), // Creates border + color: Color(0xffD02126), + ), + //isScrollable: true, + + //indicatorWeight: 4.0, + indicatorColor: Colors.red[500], + + // labelPadding: + // EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0), + unselectedLabelColor: Color(0xff5A6168), + labelColor: Colors.white, + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.35, + height: MediaQuery.of(context).size.height * 0.06, + child: Center( + child: Text('Inpatient Info'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.35, + height: MediaQuery.of(context).size.height * 0.06, + child: Center( + child: Text('OutPatient Info'), + ), + ), + ]), + ), + body: Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0), + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + //TranslationBase.of(context).medicalReport, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + if (isInpatient) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + if (isInpatient) + PatientProfileButton( + key: key, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + nameLine1: "Order", //"Text", + nameLine2: "Sheet", + icon: 'patient/Progress_notes.png'), + ], + ), + ], + ), + ), + ), + ), + + // GridView.count( + // shrinkWrap: true, + // physics: NeverScrollableScrollPhysics(), + // crossAxisSpacing: 10, + // mainAxisSpacing: 10, + // childAspectRatio: 1 / 1.0, + // crossAxisCount: 3, + // children: [ + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // from: from, + // to: to, + // nameLine1: TranslationBase.of(context).vital, + // nameLine2: TranslationBase.of(context).signs, + // route: VITAL_SIGN_DETAILS, + // icon: 'patient/vital_signs.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: MEDICAL_FILE, + // nameLine1: + // "Health", //TranslationBase.of(context).medicalReport, + // nameLine2: + // "Summary", //TranslationBase.of(context).summaryReport, + // icon: 'patient/health_summary.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: LAB_RESULT, + // nameLine1: TranslationBase.of(context).lab, + // nameLine2: TranslationBase.of(context).result, + // icon: 'patient/lab_results.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // isInPatient: isInpatient, + // route: RADIOLOGY_PATIENT, + // nameLine1: TranslationBase.of(context).radiology, + // nameLine2: TranslationBase.of(context).service, + // icon: 'patient/health_summary.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: PATIENT_ECG, + // nameLine1: TranslationBase.of(context).patient, + // nameLine2: "ECG", + // icon: 'patient/patient_sick_leave.png'), + // (int.parse(patientType) == 7 || + // int.parse(patientType) == 6) + // ? PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: ORDER_PRESCRIPTION_NEW, + // nameLine1: TranslationBase.of(context).orders, + // nameLine2: + // TranslationBase.of(context).prescription, + // icon: 'patient/order_prescription.png') + // : PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: ORDER_PRESCRIPTION_NEW, + // nameLine1: TranslationBase.of(context).orders, + // nameLine2: + // TranslationBase.of(context).prescription, + // icon: 'patient/order_prescription.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: ORDER_PROCEDURE, + // nameLine1: TranslationBase.of(context).orders, + // nameLine2: TranslationBase.of(context).procedures, + // icon: 'patient/Order_Procedures.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: PATIENT_INSURANCE_APPROVALS_NEW, + // nameLine1: TranslationBase.of(context).insurance, + // nameLine2: TranslationBase.of(context).service, + // icon: 'patient/vital_signs.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: SHOW_SICKLEAVE, + // nameLine1: TranslationBase.of(context).patientSick, + // nameLine2: TranslationBase.of(context).leave, + // icon: 'patient/patient_sick_leave.png'), + // if (patient.admissionNo != null && + // patient.admissionNo != "0") + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: PROGRESS_NOTE, + // nameLine1: TranslationBase.of(context).progress, + // nameLine2: TranslationBase.of(context).note, + // icon: 'patient/Progress_notes.png'), + // if (patient.admissionNo != null && + // patient.admissionNo != "0") + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: ORDER_NOTE, + // nameLine1: "Order", //"Text", + // nameLine2: "Sheet", + // icon: 'patient/Progress_notes.png'), + // if (patient.appointmentNo != null && + // patient.appointmentNo != 0) + // PatientProfileButton( + // key: key, + // patient: patient, + // patientType: patientType, + // arrivalType: arrivalType, + // route: REFER_PATIENT_TO_DOCTOR, + // // isDisable: patient.patientStatusType != 43 ? true : false, + // nameLine1: TranslationBase.of(context).referral, + // nameLine2: TranslationBase.of(context).patient, + // icon: 'patient/refer_patient.png'), + // ], + // ), ), ); } diff --git a/pubspec.lock b/pubspec.lock index 9d52ce65..e9386145 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -566,7 +566,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: @@ -608,7 +608,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -900,7 +900,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" sticky_headers: dependency: "direct main" description: @@ -1091,5 +1091,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From c12818f1d07640ec622158bc303bbb006dc72fd3 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 18:04:10 +0300 Subject: [PATCH 20/50] fix search issue --- lib/screens/home/home_screen.dart | 2 +- .../patient_search/patients_screen_new.dart | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 7c8a9442..84cc7575 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -714,7 +714,7 @@ class _HomeScreenState extends State { context, MaterialPageRoute( builder: (context) => - PatientSearchScreen(), + PatientSearchScreenNew(), )); }, ), diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index d78f41d2..2597d397 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -396,25 +396,22 @@ class _PatientsScreenNewState extends State { isInpatient: isInpatient, onTap: () { + // TODO change the parameter to daynamic Navigator.of(context) .pushNamed( PATIENTS_PROFILE, arguments: { "patient": item, "patientType": - patientType, - "from": patient - .getFrom, - "to": patient - .getTo, + "1", + "from": widget.patientSearchRequestModel.from, + "to": widget.patientSearchRequestModel.from, "isSearch": isSearch, "isInpatient": isInpatient, "arrivalType": - arrivalType, - "isInpatient": - isInpatient + "7", }); }, ); From 46b4ea25eaac13e1837bb45c3164d38daa6ad8ba Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 18:35:46 +0300 Subject: [PATCH 21/50] fix search part --- .../patient_search/patients_screen_new.dart | 97 ++++++++++++------- 1 file changed, 61 insertions(+), 36 deletions(-) diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index 2597d397..714359f0 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -25,6 +25,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; @@ -151,7 +152,7 @@ class _PatientsScreenNewState extends State { //TranslationBase.of(context).all, projectsProvider = Provider.of(context); final routeArgs = ModalRoute.of(context).settings.arguments as Map; - + int _activeTab = 0; // patient = widget.patientSearchForm != null // ? widget.patientSearchForm // : routeArgs['patientSearchForm']; @@ -180,6 +181,13 @@ class _PatientsScreenNewState extends State { // else // patientTypeTitle = SERVICES_PATIANT_HEADER_AR[int.parse(patientType)]; + List _tabs = [ + TranslationBase.of(context).inPatientAll.toUpperCase(), + TranslationBase.of(context).inPatient.toUpperCase(), + ]; + final screenSize = MediaQuery.of(context).size; + + return BaseView( onModelReady: (model) async { if(widget.isSearchWithKeyInfo) { @@ -278,47 +286,64 @@ class _PatientsScreenNewState extends State { ) : Column( children: [ + BottomSheetTitle(title: "Search for 1111",), - Container( - padding: EdgeInsets.only( - left: 0, right: 5, bottom: 5, top: 5), - decoration: BoxDecoration( - color: Colors.white, - ), - height: 115, - child: Container( - padding: EdgeInsets.only( - left: 10, right: 10), - margin: EdgeInsets.only(top: 60), - child: Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - RichText( - text: TextSpan( - style: TextStyle( - fontSize:20, - color: Colors.black), - children: [ - new TextSpan( - - text: "Search for 1111", - style: TextStyle( - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 22)), - ], + + Container( + // color: Colors.red, + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _locations.map((item) { + bool _isActive = _locations[_activeLocation] == item ? true : false; + + return Expanded( + child: InkWell( + onTap: () async { + // setState(() { + // _activeTab = _locations.indexOf(item); + // }); + setState(() { + _activeLocation = _locations.indexOf(item); + }); + GifLoaderDialogUtils.showMyDialog(context); + await model.getPatientBasedOnDate(item: item, + selectedPatientType: widget.selectedPatientType, + patientSearchRequestModel: widget + .patientSearchRequestModel, + isSearchWithKeyInfo: widget.isSearchWithKeyInfo); + GifLoaderDialogUtils.hideDialog(context); + }, + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + _isActive + ? Color(0xFFD02127 /*B8382B*/) + : Color(0xFFEAEAEA), + _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + item, + fontSize: SizeConfig.textMultiplier * 1.8, + color: _isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), ), ), - ], + ), ), - ], - ), + ); + }).toList(), ), ), + SizedBox(height: 18.5), Container( width: SizeConfig.screenWidth * 0.9, From 5daadc836934ef3cc6a593b7419a161033b7b932 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 19:12:07 +0300 Subject: [PATCH 22/50] commit --- .../patients/patient_search/header.dart | 39 +++ .../patient_search_screen_new.dart | 1 + .../patient_search/patients_screen_new.dart | 296 +++++------------- 3 files changed, 114 insertions(+), 222 deletions(-) create mode 100644 lib/screens/patients/patient_search/header.dart diff --git a/lib/screens/patients/patient_search/header.dart b/lib/screens/patients/patient_search/header.dart new file mode 100644 index 00000000..eb404e70 --- /dev/null +++ b/lib/screens/patients/patient_search/header.dart @@ -0,0 +1,39 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class HeaderInSearch extends StatelessWidget { + final String title; + + const HeaderInSearch({Key key, this.title}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + Expanded( + child: AppText( + title, + fontSize: SizeConfig.textMultiplier * 2.8, + fontWeight: FontWeight.bold, + color: Color(0xFF2B353E), + fontFamily: 'Poppins', + ), + ), + ]), + ), + ); + } +} diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen_new.dart index f383cf40..5325a07e 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -294,6 +294,7 @@ class _PatientSearchScreenNewState extends State { patientSearchRequestModel: patientSearchRequestModel, isSearchWithKeyInfo: patientFileInfoController.text.isNotEmpty ? true : false, + isSearch: true, ), ), ); diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index 714359f0..32fa1766 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -15,7 +15,7 @@ import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/header.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; @@ -41,6 +41,8 @@ class PatientsScreenNew extends StatefulWidget { final PatientType selectedPatientType; final PatientSearchRequestModel patientSearchRequestModel; final bool isSearchWithKeyInfo; + final bool isSearch; + final bool isInpatient; PatientsScreenNew( {this.patientSearchForm, @@ -50,7 +52,9 @@ class PatientsScreenNew extends StatefulWidget { this.isView, this.selectedPatientType, this.patientSearchRequestModel, - this.isSearchWithKeyInfo = true}); + this.isSearchWithKeyInfo = true, + this.isSearch = false, + this.isInpatient = false}); @override _PatientsScreenNewState createState() => _PatientsScreenNewState(); @@ -78,9 +82,7 @@ class _PatientsScreenNewState extends State { List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; int _activeLocation = 0; - bool isInpatient = false; String patientType; - bool isSearch = false; String patientTypeTitle; var _isLoading = true; var selectedFilter = 1; @@ -205,144 +207,82 @@ class _PatientsScreenNewState extends State { appBarTitle: "Search Patient", isShowAppBar: false, baseViewModel: model, - body: model.patientList.isEmpty - ? Column( - children: [ - Column(children: [ - SizedBox( - height: 10.0, - ), - if (widget.selectedPatientType == - PatientType.OutPatient && - !widget.isSearchWithKeyInfo) - Container( - padding: EdgeInsets.all(5), - decoration: BoxDecoration( - color: Colors.white, - border: Border.all(color: Colors.grey), - borderRadius: BorderRadius.circular(10)), - child: ClinicList( - clinicId: clinicId, - onClinicChange: (newValue) { - clinicId = newValue; - changeClinic(newValue, context, model); - }, - )), - Padding( - padding: EdgeInsets.only( - top: MediaQuery.of(context).size.height * - 0.03), - // child: _locationBar(context) - child: - (widget.selectedPatientType == PatientType.OutPatient && - widget.isSearchWithKeyInfo) - ? _locationBar(context, model) - : Container(), - ) - ]), - Container( - margin: EdgeInsets.only( - top: MediaQuery.of(context).size.height * 0.10), - child: Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) - .youDontHaveAnyPatient), - ) - ], - ), - ), - ), - ], - ) - : Container( + body: Container( color: Colors.grey[200], child: ListView( scrollDirection: Axis.vertical, children: [ Container( - child:model.patientList.isEmpty - ? Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - child: Center( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 0, 0, 0, 0), //250 - child: - DrAppCircularProgressIndeicator(), - )), - ), - ], - ) - : Column( + child: Column( children: [ - BottomSheetTitle(title: "Search for 1111",), - - - Container( - // color: Colors.red, - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - Color(0Xffffffff), Color(0xFFCCCCCC), - borderRadius: 4, borderWidth: 0), - child: Row( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _locations.map((item) { - bool _isActive = _locations[_activeLocation] == item ? true : false; - - return Expanded( - child: InkWell( - onTap: () async { - // setState(() { - // _activeTab = _locations.indexOf(item); - // }); - setState(() { - _activeLocation = _locations.indexOf(item); - }); - GifLoaderDialogUtils.showMyDialog(context); - await model.getPatientBasedOnDate(item: item, - selectedPatientType: widget.selectedPatientType, - patientSearchRequestModel: widget - .patientSearchRequestModel, - isSearchWithKeyInfo: widget.isSearchWithKeyInfo); - GifLoaderDialogUtils.hideDialog(context); - }, - child: Center( - child: Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - _isActive - ? Color(0xFFD02127 /*B8382B*/) - : Color(0xFFEAEAEA), - _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( - child: AppText( - item, - fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, + if(widget.isSearch) + HeaderInSearch( + title: "Search for 1111", + ), + if(!widget.isSearch && !widget.isInpatient) + HeaderInSearch( + title: "Search for 1111", + ), + if(!widget.isInpatient) + Container( + // color: Colors.red, + height: screenSize.height * 0.070, + decoration: TextFieldsUtils + .containerBorderDecoration( + Color(0Xffffffff), + Color(0xFFCCCCCC), + borderRadius: 4, + borderWidth: 0), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _locations.map((item) { + bool _isActive = _locations[_activeLocation] == item + ? true + : false; + + return Expanded( + child: InkWell( + onTap: () async { + // setState(() { + // _activeTab = _locations.indexOf(item); + // }); + setState(() { + _activeLocation = _locations.indexOf(item); + }); + GifLoaderDialogUtils.showMyDialog(context); + await model.getPatientBasedOnDate(item: item, + selectedPatientType: widget.selectedPatientType, + patientSearchRequestModel: widget + .patientSearchRequestModel, + isSearchWithKeyInfo: widget.isSearchWithKeyInfo); + GifLoaderDialogUtils.hideDialog(context); + }, + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + _isActive + ? Color(0xFFD02127 /*B8382B*/) + : Color(0xFFEAEAEA), + _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + item, + fontSize: SizeConfig.textMultiplier * 1.8, + color: _isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), ), ), ), ), - ), - ); - }).toList(), + ); + }).toList(), + ), ), - ), SizedBox(height: 18.5), Container( @@ -390,18 +330,6 @@ class _PatientsScreenNewState extends State { SizedBox( height: 10.0, ), - Padding( - padding: EdgeInsets.only( - top: MediaQuery.of(context) - .size - .height * - 0.03), - // child: _locationBar(context) - child: widget.selectedPatientType == - PatientType.OutPatient && !widget.isSearchWithKeyInfo - ? _locationBar(context, model) - : Container(), - ), SizedBox( height: 10.0, ), @@ -419,7 +347,7 @@ class _PatientsScreenNewState extends State { arrivalType: arrivalType, isInpatient: - isInpatient, + widget.isInpatient, onTap: () { // TODO change the parameter to daynamic Navigator.of(context) @@ -432,9 +360,9 @@ class _PatientsScreenNewState extends State { "from": widget.patientSearchRequestModel.from, "to": widget.patientSearchRequestModel.from, "isSearch": - isSearch, + widget.isSearch, "isInpatient": - isInpatient, + widget.isInpatient, "arrivalType": "7", }); @@ -566,80 +494,4 @@ class _PatientsScreenNewState extends State { Helpers.showErrorToast(err); }); } - - //TODO Replace it with time bar. - Widget _locationBar(BuildContext _context, model) { - return Container( - height: MediaQuery.of(context).size.height * 0.0619, - width: SizeConfig.screenWidth * 0.94, - decoration: BoxDecoration( - color: Color(0Xffffffff), - borderRadius: BorderRadius.circular(12.5), - // border: Border.all( - // width: 0.5, - // ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _locations.map((item) { - bool _isActive = _locations[_activeLocation] == item ? true : false; - return Column(mainAxisSize: MainAxisSize.min, children: [ - InkWell( - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.058, - width: SizeConfig.screenWidth * 0.2334, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(12.5), - topRight: Radius.circular(12.5), - topLeft: Radius.circular(9.5), - bottomLeft: Radius.circular(9.5)), - color: _isActive ? HexColor("#B8382B") : Colors.white, - ), - child: Center( - child: Text( - item, - style: TextStyle( - fontSize: 12, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, - - fontWeight: FontWeight.normal, - ), - ), - )), - ), - onTap: () async { - setState(() { - _activeLocation = _locations.indexOf(item); - }); - GifLoaderDialogUtils.showMyDialog(context); - await model.getPatientBasedOnDate(item: item, - selectedPatientType: widget.selectedPatientType, - patientSearchRequestModel: widget - .patientSearchRequestModel, - isSearchWithKeyInfo: widget.isSearchWithKeyInfo); - GifLoaderDialogUtils.hideDialog(context); - }), - _isActive - ? Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(10), - topRight: Radius.circular(10)), - color: Colors.white), - alignment: Alignment.center, - height: 1, - width: SizeConfig.screenWidth * 0.23, - ) - : Container() - ]); - }).toList(), - ), - ); - } } From 403fece0087ede7c76709318438e16fc5ecf6837 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 20:40:48 +0300 Subject: [PATCH 23/50] commit things --- lib/screens/home/home_screen.dart | 25 +-- .../patient_search_screen_new.dart | 1 + .../patient_search/patients_screen_new.dart | 211 +----------------- lib/widgets/patients/PatientCard.dart | 2 +- 4 files changed, 21 insertions(+), 218 deletions(-) diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 84cc7575..53a338a9 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -2,6 +2,8 @@ import 'package:charts_flutter/flutter.dart' as charts; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/patient_type.dart'; +import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart'; @@ -13,11 +15,11 @@ import 'package:doctor_app_flutter/models/doctor/profile_req_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/medicine/medicine_search_screen.dart'; -import 'package:doctor_app_flutter/screens/medicine/search_medicine_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/DischargedPatientPage.dart'; import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart'; import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_screen_new.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -40,7 +42,6 @@ import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:provider/provider.dart'; import 'package:sticky_headers/sticky_headers/widget.dart'; -import '../../routes.dart'; import '../../widgets/shared/app_texts_widget.dart'; import '../../widgets/shared/rounded_container_widget.dart'; import 'home_page_card.dart'; @@ -544,21 +545,19 @@ class _HomeScreenState extends State { ), hasBorder: false, onTap: () { - // getRequestHeader(false); - // Navigator.of(context) - // .pushNamed(PATIENTS, arguments: { - // "patientSearchForm": - // _patientSearchFormValues, - // "selectedType": "0", - // "arrivalType": "1", - // "isInpatient": false - // }); - Navigator.push( context, MaterialPageRoute( builder: (context) => - PatientSearchScreenNew(), + PatientsScreenNew( + isSearch: false, + isInpatient: false, + patientSearchRequestModel: + PatientSearchRequestModel(), + selectedPatientType: + PatientType.OutPatient, + isSearchWithKeyInfo: false, + ), )); }, ), diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen_new.dart index 5325a07e..f9fadbc5 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -295,6 +295,7 @@ class _PatientSearchScreenNewState extends State { isSearchWithKeyInfo: patientFileInfoController.text.isNotEmpty ? true : false, isSearch: true, + isInpatient: selectedPatientType == PatientType.OutPatient && patientFileInfoController.text.isEmpty?false: true, ), ), ); diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index 32fa1766..3e4819ea 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -1,5 +1,3 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; @@ -7,28 +5,20 @@ import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; -import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/header.dart'; -import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; -import 'package:doctor_app_flutter/widgets/patients/clinic_list_dropdwon.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/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; // ignore: must_be_immutable @@ -72,76 +62,19 @@ class _PatientsScreenNewState extends State { AuthViewModel authProvider; Color sideColor = Colors.black; - List responseModelList; - List responseModelList2; - final String url = "assets/images/"; - final String avatarMale = "user_male.svg"; //'working_male.svg';//'user.svg'; - final String avatarFemale = 'user_female.svg'; - final String assetName = 'assets/image.svg'; - List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; int _activeLocation = 0; String patientType; String patientTypeTitle; - var _isLoading = true; var selectedFilter = 1; - bool _isError = false; - String error = ""; String arrivalType; ProjectViewModel projectsProvider; var isView; final _controller = TextEditingController(); PatientModel patient; - searchData(String str) { - this.responseModelList = this.responseModelList2; - var strExist = str.length > 0 ? true : false; - if (strExist) { - List filterData = []; - - for (var i = 0; i < responseModelList2.length; i++) { - String firstName = responseModelList[i].firstName.toUpperCase(); - String lastName = responseModelList[i].lastName.toUpperCase(); - String mobile = responseModelList[i].mobileNumber.toUpperCase(); - String patientID = responseModelList[i].patientId.toString(); - - if (firstName.contains(str.toUpperCase()) || - lastName.contains(str.toUpperCase()) || - mobile.contains(str) || - patientID.contains(str)) { - filterData.add(responseModelList[i]); - } - } - - setState(() { - this.responseModelList = filterData; - }); - } else { - setState(() { - this.responseModelList = this.responseModelList2; - }); - } - } - convertDateFormat(String str) { - String timeConvert; - const start = "/Date("; - const end = "+0300)"; - - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "-" + - date.month.toString().padLeft(2, '0') + - "-" + - date.day.toString().padLeft(2, '0'); - - return newDate.toString(); - } @override Widget build(BuildContext context) { @@ -151,38 +84,6 @@ class _PatientsScreenNewState extends State { TranslationBase.of(context).tomorrow, TranslationBase.of(context).nextWeek, ]; - //TranslationBase.of(context).all, - projectsProvider = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - int _activeTab = 0; - // patient = widget.patientSearchForm != null - // ? widget.patientSearchForm - // : routeArgs['patientSearchForm']; - // - // patientType = widget.selectedType != null - // ? widget.selectedType - // : routeArgs['selectedType']; - // arrivalType = widget.arrivalType != null - // ? widget.arrivalType - // : routeArgs['arrivalType']; - // if (routeArgs != null && routeArgs.containsKey("isSearch")) { - // isSearch = routeArgs['isSearch']; - // } - // if (routeArgs != null && routeArgs.containsKey("isSearch")) { - // isView = routeArgs['isView']; - // } - // if (routeArgs != null && routeArgs.containsKey('activeFilter')) { - // _activeLocation = routeArgs['activeFilter']; - // } - // if (routeArgs != null && routeArgs.containsKey('isInpatient')) { - // isInpatient = routeArgs['isInpatient']; - // } - - // if (!projectsProvider.isArabic) - // patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; - // else - // patientTypeTitle = SERVICES_PATIANT_HEADER_AR[int.parse(patientType)]; - List _tabs = [ TranslationBase.of(context).inPatientAll.toUpperCase(), TranslationBase.of(context).inPatient.toUpperCase(), @@ -192,15 +93,12 @@ class _PatientsScreenNewState extends State { return BaseView( onModelReady: (model) async { - if(widget.isSearchWithKeyInfo) { - await model.getPatientFileInformation(widget.patientSearchRequestModel); + if(!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) { + await model.getOutPatient(widget.patientSearchRequestModel); + } else { - // ignore: unrelated_type_equality_checks - if(widget.selectedPatientType == PatientType.OutPatient) { - await model.getOutPatient(widget.patientSearchRequestModel); - } else { - // TODO handel inPatient case - } + await model.getPatientFileInformation(widget.patientSearchRequestModel); + } }, builder: (_, model, w) => AppScaffold( @@ -221,7 +119,7 @@ class _PatientsScreenNewState extends State { ), if(!widget.isSearch && !widget.isInpatient) HeaderInSearch( - title: "Search for 1111", + title: "My Out patient", ), if(!widget.isInpatient) Container( @@ -244,9 +142,6 @@ class _PatientsScreenNewState extends State { return Expanded( child: InkWell( onTap: () async { - // setState(() { - // _activeTab = _locations.indexOf(item); - // }); setState(() { _activeLocation = _locations.indexOf(item); }); @@ -324,7 +219,7 @@ class _PatientsScreenNewState extends State { bottom: 30), ), onChanged: (String str) { - this.searchData(str); + // this.searchData(str); }), ])), SizedBox( @@ -402,96 +297,4 @@ class _PatientsScreenNewState extends State { ), ); } - - changeClinic(clinicId, BuildContext context, model) async { - GifLoaderDialogUtils.showMyDialog(context); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); - ProfileReqModel docInfo = new ProfileReqModel( - doctorID: doctorProfile.doctorID, - clinicID: clinicId, - license: true, - projectID: doctorProfile.projectID, - tokenID: '', - languageID: 2); - - authProvider - .getDocProfiles(docInfo.toJson(), allowChangeProfile: false) - .then((profileList) async { - print(profileList['DoctorProfileList'][0]); - int val2 = int.parse(patientType); - - GetPatientArrivalListRequestModel getPatientArrivalListRequestModel = - GetPatientArrivalListRequestModel( - from: patient.From, - to: patient.To, - clinicID: profileList['DoctorProfileList'][0]['ClinicID'], - doctorID: - profileList['DoctorProfileList'][0]['DoctorID'].toString(), - patientMRN: patient.getPatientID, - pageIndex: 0, - pageSize: 0); - - model - .getPatientList( - getPatientArrivalListRequestModel.toJson(), patientType) - .then((res) { - setState(() { - if (res != null && res['MessageStatus'] == 1) { - if (val2 == 7) { - if (res[SERVICES_PATIANT2[val2]] == null) { - _isError = true; - _isLoading = false; - this.error = error.toString(); - } else { - var localList = []; - if (res["patientArrivalList"]["entityList"] == null) { - res["patientArrivalList"]["entityList"] = []; - } - res["patientArrivalList"]["entityList"].forEach((v) { - Map mergedPatient = { - ...v, - ...v["patientDetails"] - }; - localList.add(mergedPatient); - }); - lItems = localList; - } - } - parsed = lItems; - responseModelList = new ModelResponse.fromJson(parsed).list; - responseModelList.sort((a, b) { - DateTime now = DateTime.now(); - DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); - String formattedDate = - DateFormat('yyyy-MM-dd ' + a.startTime).format(now); - DateTime dateTimeA = dateFormat.parse(formattedDate); - String formattedDateB = - DateFormat('yyyy-MM-dd ' + b.startTime).format(now); - DateTime dateTimeB = dateFormat.parse(formattedDateB); - var adate = dateTimeA; //a.startTime; - var bdate = dateTimeB; - return adate.compareTo(bdate); - }); - responseModelList2 = responseModelList; - _isError = false; - } else { - _isError = true; - error = model.error ?? - res['ErrorEndUserMessage'] ?? - res['ErrorMessage']; - } - - _isLoading = false; - }); - GifLoaderDialogUtils.hideDialog(context); - }).catchError((error) { - Helpers.showErrorToast(error.toString()); - GifLoaderDialogUtils.hideDialog(context); - }); - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - Helpers.showErrorToast(err); - }); - } } diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index dad33425..43a4b79d 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -265,7 +265,7 @@ class PatientCard extends StatelessWidget { fontWeight: FontWeight.w700, fontSize: 15)), ]))), - if (isInpatient == true) + if (patientInfo.admissionDate != null) Row( children: [ AppText( From b5a90bd6580d8d3fc59d2fbaf5f815e13a1d08ee Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 20:55:26 +0300 Subject: [PATCH 24/50] finish search --- .../patient_search_screen_new.dart | 1 + .../patient_search/patients_screen_new.dart | 18 ++++-------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen_new.dart index f9fadbc5..14d65831 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -295,6 +295,7 @@ class _PatientSearchScreenNewState extends State { isSearchWithKeyInfo: patientFileInfoController.text.isNotEmpty ? true : false, isSearch: true, + searchKey: patientFileInfoController.text, isInpatient: selectedPatientType == PatientType.OutPatient && patientFileInfoController.text.isEmpty?false: true, ), ), diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index 3e4819ea..bd2920dc 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -33,6 +33,8 @@ class PatientsScreenNew extends StatefulWidget { final bool isSearchWithKeyInfo; final bool isSearch; final bool isInpatient; + final String searchKey; + PatientsScreenNew( {this.patientSearchForm, @@ -44,24 +46,16 @@ class PatientsScreenNew extends StatefulWidget { this.patientSearchRequestModel, this.isSearchWithKeyInfo = true, this.isSearch = false, - this.isInpatient = false}); + this.isInpatient = false, this.searchKey}); @override _PatientsScreenNewState createState() => _PatientsScreenNewState(); } class _PatientsScreenNewState extends State { - List lItems; - - List parsed; - - List date; - List unFilterDate; - int clinicId; AuthViewModel authProvider; - Color sideColor = Colors.black; List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; int _activeLocation = 0; @@ -84,10 +78,6 @@ class _PatientsScreenNewState extends State { TranslationBase.of(context).tomorrow, TranslationBase.of(context).nextWeek, ]; - List _tabs = [ - TranslationBase.of(context).inPatientAll.toUpperCase(), - TranslationBase.of(context).inPatient.toUpperCase(), - ]; final screenSize = MediaQuery.of(context).size; @@ -115,7 +105,7 @@ class _PatientsScreenNewState extends State { children: [ if(widget.isSearch) HeaderInSearch( - title: "Search for 1111", + title: "Search for ${widget.searchKey}", ), if(!widget.isSearch && !widget.isInpatient) HeaderInSearch( From 3927c40d7e3750163f639fd3ebe691d416b0f0ef Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 26 Apr 2021 21:09:15 +0300 Subject: [PATCH 25/50] Fix Patient Profile --- .../profile/patient_profile_screen.dart | 552 +++++++++++++----- .../patient-profile-header-new-design.dart | 3 +- ...-profile-header-new-design_in_patient.dart | 5 +- 3 files changed, 396 insertions(+), 164 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 9e011ce9..4e1c288f 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -1,40 +1,54 @@ -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_in_patient.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; - import '../../../routes.dart'; -// ignore: must_be_immutable -class PatientProfileScreen extends StatelessWidget { + +class PatientProfileScreen extends StatefulWidget { + @override + _PatientProfileScreenState createState() => _PatientProfileScreenState(); +} + +class _PatientProfileScreenState extends Statewith SingleTickerProviderStateMixin { PatiantInformtion patient; + bool isFromSearch = false; + bool isInpatient = false; + bool isDischargedPatient = false; + String patientType; + String arrivalType; + String from; + String to; + TabController _tabController; + @override + void initState() { + _tabController = TabController(length: 2,vsync:this); + super.initState(); + } + @override + void dispose() { + _tabController.dispose(); + super.dispose(); + } @override - Widget build(BuildContext context) { + void didChangeDependencies() { + super.didChangeDependencies(); final routeArgs = ModalRoute.of(context).settings.arguments as Map; - ProjectViewModel projectViewModel = Provider.of(context); - - patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String arrivalType = routeArgs['arrivalType']; - String from = routeArgs['from']; - String to = routeArgs['to']; + patient = routeArgs['patient']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + from = routeArgs['from']; + to = routeArgs['to']; if (routeArgs.containsKey("isSearch")) { isFromSearch = routeArgs['isSearch']; } @@ -44,156 +58,370 @@ class PatientProfileScreen extends StatelessWidget { if (routeArgs.containsKey("isDischargedPatient")) { isDischargedPatient = routeArgs['isDischargedPatient']; } + } + @override + Widget build(BuildContext context) { return BaseView( builder: (_, patientViewModel, w) => AppScaffold( - baseViewModel: patientViewModel, - appBarTitle: TranslationBase.of(context).patientProfile, - isShowAppBar: false, - body: Container( - color: Color(0XFFF2F2F2), - child: Stack( - children: [ - Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - !isFromSearch && isInpatient /*patientType == "1"*/ - ? PatientProfileHeaderNewDesignInPatient( - patient, patientType, arrivalType) - : PatientProfileHeaderNewDesign( - patient, patientType, arrivalType), - Expanded( - child: Padding( - padding: const EdgeInsets.all(16.0), - child: SingleChildScrollView( - child: Column( - children: [ - isInpatient - ? ProfileMedicalInfoWidgetInPatient( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - isInpatient: isInpatient, - isDischargedPatient: - isDischargedPatient, - ) - : isFromSearch - ? ProfileMedicalInfoWidgetSearch( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - isInpatient: false, - isDischargedPatient: - isDischargedPatient, - ) - : ProfileMedicalInfoWidget( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - isInpatient: isInpatient), - ], + baseViewModel: patientViewModel, + appBarTitle: TranslationBase.of(context).patientProfile, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType), + body: SingleChildScrollView( + child: Column( + children: [ + DefaultTabController( + length: 2, + initialIndex: isInpatient ? 0 : 1, + child: SizedBox( + height: MediaQuery.of(context).size.height * 1.0, + width: double.infinity, + child: Scaffold( + appBar: AppBar( + backgroundColor: Colors.white, + toolbarHeight: 65, + elevation: 0, + bottom: TabBar( + controller: _tabController, + indicator: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(10), // Creates border + color: Color(0xffD02126), + ), + indicatorColor: Colors.red[500], + unselectedLabelColor: Color(0xff5A6168), + labelColor: Colors.white, + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.35, + height: MediaQuery.of(context).size.height * 0.06, + child: Center( + child: Text('Inpatient Info'), ), ), - ), - ) - ], + Container( + width: MediaQuery.of(context).size.width * 0.35, + height: MediaQuery.of(context).size.height * 0.06, + child: Center( + child: Text('OutPatient Info'), + ), + ), + ]), + ), + body: Container( + margin: EdgeInsets.only(top: 10), + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + //TranslationBase.of(context).medicalReport, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + + GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + if (isInpatient) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + if (isInpatient) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + nameLine1: "Order", //"Text", + nameLine2: "Sheet", + icon: 'patient/Progress_notes.png'), + ], + ), + ], + ), + ), ), ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) - BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => Positioned( - top: 175, - left: 20, - right: 20, - child: Row( - children: [ - Expanded(child: Container()), - if (patient.episodeNo == 0) - AppButton( - title: - "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/create-episod.png", - color: Colors.white, - height: 30, - ), - onPressed: () async { - if (patient.patientStatusType == 43) { - PostEpisodeReqModel - postEpisodeReqModel = - PostEpisodeReqModel( - appointmentNo: - patient.appointmentNo, - patientMRN: - patient.patientMRN); - GifLoaderDialogUtils.showMyDialog( - context); - await model.postEpisode( - postEpisodeReqModel); - GifLoaderDialogUtils.hideDialog( - context); - patient.episodeNo = model.episodeID; - Navigator.of(context).pushNamed( - CREATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }, - ), - if (patient.episodeNo != 0) - AppButton( - title: - "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/modilfy-episode.png", - color: Colors.white, - height: 30, - ), - onPressed: () { - if (patient.patientStatusType == - 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }), - ], - ), - )), - ], + ), + ), - ), - )); + ], + ), + ), + )); } } diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design.dart b/lib/widgets/patients/profile/patient-profile-header-new-design.dart index 27984614..b4d8ce17 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -16,10 +16,11 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { final String patientType; final String arrivalType; final double height; + final bool isHaveMargin; PatientProfileHeaderNewDesign( this.patient, this.patientType, this.arrivalType, - {this.height = 0.0}); + {this.height = 0.0, this.isHaveMargin=true}); @override Widget build(BuildContext context) { diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart b/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart index 272fc238..557f78ce 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart @@ -40,7 +40,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { height: height == 0 ? 200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - margin: EdgeInsets.only(top: 50), + // margin: EdgeInsets.only(top: 50), child: Column( children: [ Container( @@ -121,6 +121,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { fontWeight: FontWeight.w700), ], ), + if(patient.admissionDate!=null) Row( children: [ AppText( @@ -136,6 +137,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + if(patient.admissionDate!=null) Row( children: [ AppText( @@ -177,6 +179,7 @@ class PatientProfileHeaderNewDesignInPatient extends StatelessWidget { ) ], ), + if(patient.admissionDate!=null) Row( children: [ AppText( From 686c81463bce93664b31e627752540644a2ecda9 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 26 Apr 2021 21:11:52 +0300 Subject: [PATCH 26/50] Fix Patient Profile --- lib/screens/sick-leave/add-sickleave.dart | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 444e76bd..3b05d8f4 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -188,10 +188,9 @@ class AddSickLeavScreen extends StatelessWidget { ), Flexible( child: AppText( - DateUtils - .convertStringToDateFormat( - item.startDate, - 'dd-MMM-yyyy'), + DateUtils.getDayMonthYearDateFormatted(DateUtils + .convertStringToDate( + item.startDate)), fontWeight: FontWeight.bold, ), @@ -208,10 +207,10 @@ class AddSickLeavScreen extends StatelessWidget { ), Flexible( child: AppText( - DateUtils - .convertStringToDateFormat( - item.endDate, - 'dd-MMM-yyyy'), + DateUtils.getDayMonthYearDateFormatted(DateUtils + .convertStringToDate( + item.endDate, + )), fontWeight: FontWeight.bold, ), From 50a240122da93f0148019950eb69b4442ee8386f Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 21:35:46 +0300 Subject: [PATCH 27/50] fix date issue --- lib/screens/home/home_screen.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 53a338a9..1435c942 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -545,6 +545,12 @@ class _HomeScreenState extends State { ), hasBorder: false, onTap: () { + + String date = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day ), + 'yyyy-MM-dd'); + Navigator.push( context, MaterialPageRoute( @@ -553,7 +559,7 @@ class _HomeScreenState extends State { isSearch: false, isInpatient: false, patientSearchRequestModel: - PatientSearchRequestModel(), + PatientSearchRequestModel(from: date, to: date), selectedPatientType: PatientType.OutPatient, isSearchWithKeyInfo: false, From b6e698d4e47c329a6a2c73df4b4c92ef2f9b37b4 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 21:38:27 +0300 Subject: [PATCH 28/50] fix header --- .../patient_search/patients_screen_new.dart | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index bd2920dc..1e5f7339 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -93,7 +93,12 @@ class _PatientsScreenNewState extends State { }, builder: (_, model, w) => AppScaffold( appBarTitle: "Search Patient", - isShowAppBar: false, + isShowAppBar: true, + appBar: !widget.isSearch && !widget.isInpatient?HeaderInSearch( + title: "My Out patient", + ):HeaderInSearch( + title: "Search for ${widget.searchKey}", + ), baseViewModel: model, body: Container( color: Colors.grey[200], @@ -103,14 +108,6 @@ class _PatientsScreenNewState extends State { Container( child: Column( children: [ - if(widget.isSearch) - HeaderInSearch( - title: "Search for ${widget.searchKey}", - ), - if(!widget.isSearch && !widget.isInpatient) - HeaderInSearch( - title: "My Out patient", - ), if(!widget.isInpatient) Container( // color: Colors.red, From f4fd4b26d627bcb7798d318c4b2ef799daee8b8a Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 26 Apr 2021 21:41:41 +0300 Subject: [PATCH 29/50] Add filter in outpatient --- .../viewModel/PatientSearchViewModel.dart | 33 ++++++++++++++++--- .../patient_search/patients_screen_new.dart | 4 +-- .../profile/patient_profile_screen.dart | 20 ----------- 3 files changed, 31 insertions(+), 26 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 45b73329..816918cd 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -19,6 +19,32 @@ class PatientSearchViewModel extends BaseViewModel{ List get patientList => _outPatientService.patientList; + List filterData = []; + + searchData(String str) { + var strExist = str.length > 0 ? true : false; + if (strExist) { + filterData = []; + for (var i = 0; i < _outPatientService.patientList.length; i++) { + String firstName = _outPatientService.patientList[i].firstName.toUpperCase(); + String lastName = _outPatientService.patientList[i].lastName.toUpperCase(); + String mobile = _outPatientService.patientList[i].mobileNumber.toUpperCase(); + String patientID = _outPatientService.patientList[i].patientId.toString(); + + if (firstName.contains(str.toUpperCase()) || + lastName.contains(str.toUpperCase()) || + mobile.contains(str) || + patientID.contains(str)) { + filterData.add(_outPatientService.patientList[i]); + } + } + notifyListeners(); + } else { + filterData = _outPatientService.patientList; + notifyListeners(); + } + } + getOutPatient(PatientSearchRequestModel patientSearchRequestModel , {bool isLocalBusy = false}) async { if(isLocalBusy) { setState(ViewState.BusyLocal); @@ -37,6 +63,7 @@ class PatientSearchViewModel extends BaseViewModel{ } setState(ViewState.Error); } else { + filterData = _outPatientService.patientList; setState(ViewState.Idle); } } @@ -49,6 +76,7 @@ class PatientSearchViewModel extends BaseViewModel{ error = _outPatientService.error; setState(ViewState.Error); } else { + filterData = _outPatientService.patientList; setState(ViewState.Idle); } } @@ -103,12 +131,9 @@ class PatientSearchViewModel extends BaseViewModel{ if(isSearchWithKeyInfo) { await getPatientFileInformation(currentModel); } else { - if(selectedPatientType == PatientType.OutPatient) { await getOutPatient(currentModel, isLocalBusy: true); - } else { - // TODO handel inPatient case } - } + filterData = _outPatientService.patientList; } diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index bd2920dc..ade1e47e 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -219,10 +219,10 @@ class _PatientsScreenNewState extends State { height: 10.0, ), Container( - child: (model.patientList.isNotEmpty) + child: model.patientList.isNotEmpty ? Column( // mainAxisAlignment: MainAxisAlignment.center, - children: model.patientList + children: model.filterData .map((PatiantInformtion item) { return PatientCard( diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 4e1c288f..9cb8a0d4 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -378,7 +378,6 @@ class _PatientProfileScreenState extends Statewith SingleT if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileButton( - patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -388,26 +387,7 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, icon: 'patient/admission_req.png'), - if (isInpatient) - PatientProfileButton( - - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - if (isInpatient) - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - nameLine1: "Order", //"Text", - nameLine2: "Sheet", - icon: 'patient/Progress_notes.png'), ], ), ], From 85288cc01413bad45608d309f2b06937db0d170d Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 26 Apr 2021 21:58:04 +0300 Subject: [PATCH 30/50] Add filter in outpatient --- .../patients/patient_search/header.dart | 8 +- .../patient_search/patients_screen_new.dart | 2 +- lib/widgets/patients/PatientCard.dart | 202 +++++++++--------- 3 files changed, 106 insertions(+), 106 deletions(-) diff --git a/lib/screens/patients/patient_search/header.dart b/lib/screens/patients/patient_search/header.dart index eb404e70..0fbcdf1a 100644 --- a/lib/screens/patients/patient_search/header.dart +++ b/lib/screens/patients/patient_search/header.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -class HeaderInSearch extends StatelessWidget { +class HeaderInSearch extends StatelessWidget with PreferredSizeWidget { final String title; const HeaderInSearch({Key key, this.title}) : super(key: key); @@ -16,7 +16,7 @@ class HeaderInSearch extends StatelessWidget { ), child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - margin: EdgeInsets.only(top: 50), + margin: EdgeInsets.only(top: 35), child: Row(children: [ IconButton( icon: Icon(Icons.arrow_back_ios), @@ -36,4 +36,8 @@ class HeaderInSearch extends StatelessWidget { ), ); } + + @override + + Size get preferredSize => Size(double.maxFinite,65); } diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index e4e1ed4c..8786bc48 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -206,7 +206,7 @@ class _PatientsScreenNewState extends State { bottom: 30), ), onChanged: (String str) { - // this.searchData(str); + model.searchData(str); }), ])), SizedBox( diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 43a4b79d..f7f39d95 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -35,18 +35,18 @@ class PatientCard extends StatelessWidget { color: Colors.white, ), child: Stack(children: [ - // if (SERVICES_PATIANT2[int.parse(patientType)] != "List_MyInPatient") - // Container( - // height: MediaQuery.of(context).size.height * .20, - // width: 5, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.only( - // topLeft: Radius.circular(10), - // bottomLeft: Radius.circular(10)), - // color: patientInfo.patientStatusType == 43 - // ? Colors.green[500] - // : Colors.red[800], - // )), + if (isInpatient) + Container( + height: MediaQuery.of(context).size.height * .20, + width: 5, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10)), + color: patientInfo.patientStatusType == 43 + ? Colors.green[500] + : Colors.red[800], + )), Container( padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), child: InkWell( @@ -55,48 +55,47 @@ class PatientCard extends StatelessWidget { SizedBox( height: 10, ), - // SERVICES_PATIANT2[int.parse(patientType)] == - // "List_MyOutPatient" - // ? Padding( - // padding: EdgeInsets.only(left: 12.0), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // patientInfo.patientStatusType == 43 - // ? AppText( - // TranslationBase.of(context).arrivedP, - // color: Colors.green, - // fontWeight: FontWeight.bold, - // fontFamily: 'Poppins', - // fontSize: 12, - // ) - // : AppText( - // TranslationBase.of(context).notArrived, - // color: Colors.red[800], - // fontWeight: FontWeight.bold, - // fontFamily: 'Poppins', - // fontSize: 12, - // ), - // this.arrivalType == '1' - // ? AppText( - // patientInfo.startTime != null - // ? patientInfo.startTime - // : patientInfo.startTimes, - // fontFamily: 'Poppins', - // fontWeight: FontWeight.w600, - // ) - // : patientInfo.arrivedOn != null - // ? AppText( - // DateUtils.convertStringToDateFormat( - // patientInfo.arrivedOn, - // 'MM-dd-yyyy HH:mm'), - // fontFamily: 'Poppins', - // fontWeight: FontWeight.w600, - // ) - // : SizedBox() - // ], - // )) - // : SizedBox(), + !isInpatient + ? Padding( + padding: EdgeInsets.only(left: 12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + patientInfo.patientStatusType == 43 + ? AppText( + TranslationBase.of(context).arrivedP, + color: Colors.green, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ) + : AppText( + TranslationBase.of(context).notArrived, + color: Colors.red[800], + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + this.arrivalType == '1' + ? AppText( + patientInfo.startTime != null + ? patientInfo.startTime + : patientInfo.startTimes, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + : patientInfo.arrivedOn != null + ? AppText( + DateUtils.getDayMonthYearDateFormatted(DateUtils.convertStringToDate( + patientInfo.arrivedOn, + )), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + : SizedBox() + ], + )) + : SizedBox(), Padding( padding: EdgeInsets.only(left: 12.0), child: Row( @@ -213,33 +212,32 @@ class PatientCard extends StatelessWidget { ), ), ), - // if (SERVICES_PATIANT2[int.parse(patientType)] != - // "List_MyInPatient") - // Container( - // child: RichText( - // text: new TextSpan( - // style: new TextStyle( - // fontSize: 2.0 * SizeConfig.textMultiplier, - // color: Colors.black, - // fontFamily: 'Poppins', - // ), - // children: [ - // new TextSpan( - // text: - // TranslationBase.of(context).age + - // " : ", - // style: TextStyle(fontSize: 14)), - // new TextSpan( - // text: - // "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", - // style: TextStyle( - // fontWeight: FontWeight.w700, - // fontSize: 15)), - // ], - // ), - // ), - // ), - if (isInpatient == true) + if (isInpatient) + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: + TranslationBase.of(context).age + + " : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 15)), + ], + ), + ), + ), + if (isInpatient ) Container( child: RichText( text: new TextSpan( @@ -370,28 +368,26 @@ class PatientCard extends StatelessWidget { //) ])) ]), - // SERVICES_PATIANT2[int.parse(patientType)] == - // "List_MyOutPatient" - // ? Row( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // Container( - // padding: EdgeInsets.all(4), - // child: Image.asset( - // patientInfo.appointmentType == - // 'Regular' && - // patientInfo.visitTypeId == 100 - // ? 'assets/images/livecare.png' - // : patientInfo.appointmentType == - // 'Walkin' - // ? 'assets/images/walkin.png' - // : 'assets/images/booked.png', - // height: 25, - // width: 35, - // )), - // ]) - // : - (isInpatient == true) + !isInpatient + ? Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + padding: EdgeInsets.all(4), + child: Image.asset( + patientInfo.appointmentType == + 'Regular' && + patientInfo.visitTypeId == 100 + ? 'assets/images/livecare.png' + : patientInfo.appointmentType == + 'Walkin' + ? 'assets/images/walkin.png' + : 'assets/images/booked.png', + height: 25, + width: 35, + )), + ]) + : (isInpatient == true) ? Row( mainAxisAlignment: MainAxisAlignment.end, children: [ From 1e68f8fe33abd95105e46d509ef594203a06e580 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 22:11:13 +0300 Subject: [PATCH 31/50] fix small bug --- lib/core/model/PatientSearchRequestModel.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/core/model/PatientSearchRequestModel.dart b/lib/core/model/PatientSearchRequestModel.dart index e612ec2a..437c5885 100644 --- a/lib/core/model/PatientSearchRequestModel.dart +++ b/lib/core/model/PatientSearchRequestModel.dart @@ -20,6 +20,9 @@ class PatientSearchRequestModel { this.patientMobileNumber ="0", this.patientIdentificationID ="0", this.patientID =0, + this.searchType =1, + this.mobileNo="", + this.identificationNo="0", this.from ="0", this.to ="0"}); From 8a564b34acd661b10512d561e6529c0da5b26b03 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 26 Apr 2021 22:32:32 +0300 Subject: [PATCH 32/50] add procedure form update --- lib/core/service/procedure_service.dart | 4 +- .../profile/lab_result/labs_home_page.dart | 118 +++---- .../procedures/add-procedure-form.dart | 293 +++++++++++------- .../entity_list_checkbox_search_widget.dart | 4 +- 4 files changed, 240 insertions(+), 179 deletions(-) diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/procedure_service.dart index 64d60002..b403edf0 100644 --- a/lib/core/service/procedure_service.dart +++ b/lib/core/service/procedure_service.dart @@ -76,12 +76,12 @@ class ProcedureService extends BaseService { Future getProcedureCategory({String categoryName, String categoryID}) async { _getProcedureCategoriseReqModel = GetProcedureReqModel( - search: [categoryName], + search: ["$categoryName"], patientMRN: 0, pageIndex: 0, clinicId: 0, pageSize: 0, - category: categoryID ?? "01", + category: categoryID ?? null, ); hasError = false; _categoriesList.clear(); diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index dd3e0995..abfcb282 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -55,27 +55,29 @@ class _LabsHomePageState extends State { SizedBox( height: 12, ), - if(model.patientLabOrdersList.isNotEmpty && patient.patientStatusType != 43) - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Lab', - style: "caption2", - color: Colors.black, - fontSize: 13, - ), - AppText( - 'Result', - bold: true, - fontSize: 22, - ), - ], + if (model.patientLabOrdersList.isNotEmpty && + patient.patientStatusType != 43) + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Lab', + style: "caption2", + color: Colors.black, + fontSize: 13, + ), + AppText( + 'Result', + bold: true, + fontSize: 22, + ), + ], + ), ), - ), - if ( patient.patientStatusType!=null && patient.patientStatusType == 43) + if (patient.patientStatusType != null && + patient.patientStatusType == 43) Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -95,18 +97,21 @@ class _LabsHomePageState extends State { ], ), ), - if ( patient.patientStatusType!=null && patient.patientStatusType == 43) - AddNewOrder( onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => AddSelectedLabOrder( - patient: patient, - model: model, - )), - ); - },label: 'Apply for New Lab Order',), - + if (patient.patientStatusType != null && + patient.patientStatusType == 43) + AddNewOrder( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddSelectedLabOrder( + patient: patient, + model: model, + )), + ); + }, + label: 'Apply for New Lab Order', + ), ...List.generate( model.patientLabOrdersList.length, (index) => Column( @@ -116,16 +121,16 @@ class _LabsHomePageState extends State { .patientLabOrdersList[index].patientLabOrdersList .map((labOrder) { return Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, - ), - borderRadius: BorderRadius.all( - Radius.circular(8.0), - ), - color: Colors.white), + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + color: Colors.white), child: Row( children: [ Container( @@ -136,12 +141,11 @@ class _LabsHomePageState extends State { color: labOrder.isLiveCareAppointment ? Colors.red[900] : !labOrder.isInOutPatient - ? Colors.black - : Color(0xffa9a089), + ? Colors.black + : Color(0xffa9a089), borderRadius: BorderRadius.only( topLeft: Radius.circular(8), bottomLeft: Radius.circular(8), - ), ), child: RotatedBox( @@ -150,15 +154,15 @@ class _LabsHomePageState extends State { child: Text( labOrder.isLiveCareAppointment ? TranslationBase.of(context) - .liveCare - .toUpperCase() + .liveCare + .toUpperCase() : !labOrder.isInOutPatient - ? TranslationBase.of(context) - .inPatient - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + ? TranslationBase.of(context) + .inPatient + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -193,18 +197,20 @@ class _LabsHomePageState extends State { }).toList(), ), ), - if(model.patientLabOrdersList.isEmpty && patient.patientStatusType != 43) + if (model.patientLabOrdersList.isEmpty && + patient.patientStatusType != 43) Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox(height: 100,), + SizedBox( + height: 100, + ), Image.asset('assets/images/no-data.png'), Padding( padding: const EdgeInsets.all(8.0), child: AppText('No Lab Result Found'), ) - ], ), ) diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 17d09159..9a8fe0c5 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import 'entity_list_checkbox_search_widget.dart'; @@ -126,6 +127,7 @@ class _AddSelectedProcedureState extends State { TextEditingController remarksController = TextEditingController(); List entityList = List(); List entityListProcedure = List(); + TextEditingController procedureName = TextEditingController(); dynamic selectedCategory; @@ -139,7 +141,7 @@ class _AddSelectedProcedureState extends State { Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; return BaseView( - onModelReady: (model) => model.getCategory(), + //onModelReady: (model) => model.getCategory(), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: false, @@ -159,136 +161,191 @@ class _AddSelectedProcedureState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + 'Please Enter Procedure', + fontWeight: FontWeight.w700, + fontSize: 20, + ), + InkWell( + child: Icon( + Icons.close, + size: 24.0, + ), + onTap: () { + Navigator.pop(context); + }, + ) + ]), + SizedBox( + height: MediaQuery.of(context).size.height * 0.04, + ), Row( children: [ - AppText( - 'Please Select Category', - fontWeight: FontWeight.w700, - fontSize: 20, + Container( + width: MediaQuery.of(context).size.width * 0.85, + child: AppTextFieldCustom( + hintText: 'Search Procedure here...', + isTextFieldHasSuffix: false, + + maxLines: 1, + minLines: 1, + hasBorder: true, + controller: procedureName, + // onSubmitted: (_) { + // model.getProcedureCategory( + // categoryName: procedureName.text); + // }, + onClick: () { + model.getProcedureCategory( + categoryName: procedureName.text); + }, + ), ), SizedBox( - width: MediaQuery.of(context).size.width * 0.29, + width: MediaQuery.of(context).size.width * 0.02, ), InkWell( - child: Icon( - Icons.close, - size: 24.0, - ), onTap: () { - Navigator.pop(context); + model.getProcedureCategory( + categoryName: procedureName.text); }, + child: Icon( + Icons.search, + size: 25.0, + ), ), ], ), - SizedBox( - height: 10.0, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.categoryList != null && - model.categoryList.length > 0 - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model.categoryList, - attributeName: 'categoryName', - attributeValueId: 'categoryId', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - selectedCategory = selectedValue; - model.getProcedureCategory( - categoryName: selectedCategory[ - 'categoryName'], - categoryID: selectedCategory[ - 'categoryId'] <= - 9 - ? "0" + - selectedCategory[ - 'categoryId'] - .toString() - : selectedCategory[ - 'categoryId'] - .toString()); - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - //model.getProcedureCategory(); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .procedureCategorise, - selectedCategory != null - ? selectedCategory['categoryName'] - : null, - true, - suffixIcon: Icon( - Icons.search, - color: Colors.black, - )), - enabled: false, - ), - ), - ), - if (widget.model.categoriesList.length != 0) + // SizedBox( + // width: MediaQuery.of(context).size.width * 0.29, + // ), + // InkWell( + // child: Icon( + // Icons.close, + // size: 24.0, + // ), + // onTap: () { + // Navigator.pop(context); + // }, + // ), + // ], + // ), + // SizedBox( + // height: 10.0, + // ), + // Container( + // height: screenSize.height * 0.070, + // child: InkWell( + // onTap: model.categoryList != null && + // model.categoryList.length > 0 + // ? () { + // ListSelectDialog dialog = + // ListSelectDialog( + // list: model.categoryList, + // attributeName: 'categoryName', + // attributeValueId: 'categoryId', + // okText: TranslationBase.of(context).ok, + // okFunction: (selectedValue) { + // setState(() { + // selectedCategory = selectedValue; + // model.getProcedureCategory( + // categoryName: selectedCategory[ + // 'categoryName'], + // categoryID: selectedCategory[ + // 'categoryId'] <= + // 9 + // ? "0" + + // selectedCategory[ + // 'categoryId'] + // .toString() + // : selectedCategory[ + // 'categoryId'] + // .toString()); + // }); + // }, + // ); + // showDialog( + // barrierDismissible: false, + // context: context, + // builder: (BuildContext context) { + // return dialog; + // }, + // ); + // //model.getProcedureCategory(); + // } + // : null, + // child: TextField( + // decoration: textFieldSelectorDecoration( + // TranslationBase.of(context) + // .procedureCategorise, + // selectedCategory != null + // ? selectedCategory['categoryName'] + // : null, + // true, + // suffixIcon: Icon( + // Icons.search, + // color: Colors.black, + // )), + // enabled: false, + // ), + // ), + // ), + if (procedureName.text.isNotEmpty && + model.procedureList.length != 0) NetworkBaseView( baseViewModel: model, - child: selectedCategory != null - ? selectedCategory['categoryId'] == 02 || - selectedCategory['categoryId'] == 03 - ? EntityListCheckboxSearchWidget( - model: widget.model, - masterList: widget.model - .categoriesList[0].entityList, - removeHistory: (item) { - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => - isEntityListSelected(master), - ) - : ProcedureListWidget( - model: widget.model, - masterList: widget.model - .categoriesList[0].entityList, - removeHistory: (item) { - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => - isEntityListSelected(master), - ) - : null), + child: + // selectedCategory != null + // ? selectedCategory['categoryId'] == 02 || + // selectedCategory['categoryId'] == 03 + // ? + EntityListCheckboxSearchWidget( + model: widget.model, + masterList: + widget.model.categoriesList[0].entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), + ) + // : ProcedureListWidget( + // model: widget.model, + // masterList: widget.model + // .categoriesList[0].entityList, + // removeHistory: (item) { + // setState(() { + // entityList.remove(item); + // }); + // }, + // addHistory: (history) { + // setState(() { + // entityList.add(history); + // }); + // }, + // addSelectedHistories: () { + // //TODO build your fun herr + // // widget.addSelectedHistories(); + // }, + // isEntityListSelected: (master) => + // isEntityListSelected(master), + // ) + // : null, + ), SizedBox( height: 15.0, ), diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 70a5402c..801c730c 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -1,4 +1,3 @@ - import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -227,8 +226,7 @@ class _EntityListCheckboxSearchWidgetState ) : Center( child: Container( - child: AppText( - "There's no procedures for this category", + child: AppText("Sorry , No Match", color: Color(0xFFB9382C)), ), ) From a91d64f10343c8bce76c8555337be0988b94d138 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 23:06:18 +0300 Subject: [PATCH 33/50] samll fix --- lib/screens/patients/profile/patient_profile_screen.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 9cb8a0d4..93f70876 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -80,6 +80,7 @@ class _PatientProfileScreenState extends Statewith SingleT child: Scaffold( appBar: AppBar( backgroundColor: Colors.white, + automaticallyImplyLeading: false, toolbarHeight: 65, elevation: 0, bottom: TabBar( From 48471bbc0747e94e6ea9996140f7ffd3ddd0b460 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 23:07:07 +0300 Subject: [PATCH 34/50] fix small --- .../patients/patient_search/patient_search_screen_new.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen_new.dart index 14d65831..5c6b833f 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -296,7 +296,7 @@ class _PatientSearchScreenNewState extends State { patientFileInfoController.text.isNotEmpty ? true : false, isSearch: true, searchKey: patientFileInfoController.text, - isInpatient: selectedPatientType == PatientType.OutPatient && patientFileInfoController.text.isEmpty?false: true, + isInpatient: selectedPatientType == PatientType.OutPatient?false: true, ), ), ); From 29831e82071524b59397221ef357b47c082eef14 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 26 Apr 2021 23:16:25 +0300 Subject: [PATCH 35/50] return code back --- .../patients/patient_search/patient_search_screen_new.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen_new.dart index 5c6b833f..14d65831 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -296,7 +296,7 @@ class _PatientSearchScreenNewState extends State { patientFileInfoController.text.isNotEmpty ? true : false, isSearch: true, searchKey: patientFileInfoController.text, - isInpatient: selectedPatientType == PatientType.OutPatient?false: true, + isInpatient: selectedPatientType == PatientType.OutPatient && patientFileInfoController.text.isEmpty?false: true, ), ), ); From c3ac50a859db60fbf56b24f78c8257aac8de1c7f Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 26 Apr 2021 23:19:25 +0300 Subject: [PATCH 36/50] hot fixes --- .../viewModel/PatientSearchViewModel.dart | 1 + lib/models/patient/patiant_info_model.dart | 4 +- .../patients/PatientsInPatientScreen.dart | 1 + .../patient_search_screen_new.dart | 2 +- .../patient_search/patients_screen_new.dart | 3 +- .../profile/patient_profile_screen.dart | 4 + lib/util/date-utils.dart | 9 ++ lib/widgets/patients/PatientCard.dart | 131 ++++++++++++++---- 8 files changed, 126 insertions(+), 29 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 816918cd..59f8c9c6 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -147,6 +147,7 @@ class PatientSearchViewModel extends BaseViewModel{ Future getInPatientList(PatientSearchRequestModel requestModel, {bool isMyInpatient = false, bool isFirstTime = true}) async { + await getDoctorProfile(); if (isFirstTime) setState(ViewState.Busy); else diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index a794cf29..cd21f911 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -61,6 +61,7 @@ class PatiantInformtion { int visitTypeId; String startTimes; String dischargeDate; + int status; PatiantInformtion( {this.patientDetails, this.projectId, @@ -120,7 +121,7 @@ class PatiantInformtion { this.nationalityFlagURL, this.patientStatusType, this.visitTypeId, - this.startTimes,this.dischargeDate}); + this.startTimes,this.dischargeDate,this.status}); factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( @@ -197,5 +198,6 @@ class PatiantInformtion { visitTypeId: json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'], startTimes: json['StartTime'] ?? json['StartTime'], dischargeDate: json['DischargeDate'] , + status: json['Status'] , ); } diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index ba8b5f0a..2a3f3839 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -107,6 +107,7 @@ class _PatientInPatientScreenState extends State { patientType: "1", arrivalType: "1", isInpatient: true, + isMyPatient: _activeTab!=0? false:item.doctorId==model.doctorProfile.doctorID, onTap: () { FocusScopeNode currentFocus = FocusScope.of(context); if (!currentFocus.hasPrimaryFocus) { diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen_new.dart index 14d65831..c101567a 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -296,7 +296,7 @@ class _PatientSearchScreenNewState extends State { patientFileInfoController.text.isNotEmpty ? true : false, isSearch: true, searchKey: patientFileInfoController.text, - isInpatient: selectedPatientType == PatientType.OutPatient && patientFileInfoController.text.isEmpty?false: true, + isInpatient: selectedPatientType != PatientType.OutPatient, ), ), ); diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index 8786bc48..ab1e9594 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -108,7 +108,7 @@ class _PatientsScreenNewState extends State { Container( child: Column( children: [ - if(!widget.isInpatient) + if(!widget.isInpatient && !widget.isSearch) Container( // color: Colors.red, height: screenSize.height * 0.070, @@ -249,6 +249,7 @@ class _PatientsScreenNewState extends State { "7", }); }, + isFromSearch: widget.isSearch, ); }).toList(), ) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 9cb8a0d4..5bfb84db 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -58,6 +58,10 @@ class _PatientProfileScreenState extends Statewith SingleT if (routeArgs.containsKey("isDischargedPatient")) { isDischargedPatient = routeArgs['isDischargedPatient']; } + if(isInpatient) + _tabController.index =0; + else + _tabController.index = 1; } @override diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index d380ee93..78c2a3b9 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -290,6 +290,15 @@ class DateUtils { return ""; } + /// get data formatted like 26/4/2020 + /// [dateTime] convert DateTime to data formatted + static String getDayMonthYearDate(DateTime dateTime,{bool isArabic = false}) { + if (dateTime != null) + return dateTime.day.toString()+"/"+ "${dateTime.month}"+ "/" + dateTime.year.toString(); + else + return ""; + } + /// get data formatted like 10:45 PM /// [dateTime] convert DateTime to data formatted static String getHour(DateTime dateTime) { diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index f7f39d95..251f7653 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -16,13 +16,16 @@ class PatientCard extends StatelessWidget { final String patientType; final String arrivalType; final bool isInpatient; + final bool isMyPatient; + final bool isFromSearch; + const PatientCard( {Key key, this.patientInfo, this.onTap, this.patientType, this.arrivalType, - this.isInpatient}) + this.isInpatient, this.isMyPatient = false, this.isFromSearch = false}) : super(key: key); @override Widget build(BuildContext context) { @@ -35,9 +38,9 @@ class PatientCard extends StatelessWidget { color: Colors.white, ), child: Stack(children: [ - if (isInpatient) + if (!isInpatient&& !isMyPatient && !isFromSearch) Container( - height: MediaQuery.of(context).size.height * .20, + height: 160, width: 5, decoration: BoxDecoration( borderRadius: BorderRadius.only( @@ -47,6 +50,16 @@ class PatientCard extends StatelessWidget { ? Colors.green[500] : Colors.red[800], )), + if(isMyPatient && !isFromSearch) + Container( + height: 180, + width: 5, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10)), + color: Colors.green[500] + )), Container( padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), child: InkWell( @@ -55,47 +68,113 @@ class PatientCard extends StatelessWidget { SizedBox( height: 10, ), - !isInpatient + !(isInpatient && !isFromSearch) ? Padding( padding: EdgeInsets.only(left: 12.0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ patientInfo.patientStatusType == 43 - ? AppText( - TranslationBase.of(context).arrivedP, - color: Colors.green, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ) - : AppText( - TranslationBase.of(context).notArrived, - color: Colors.red[800], - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ), + ? Row( + children: [ + AppText( + TranslationBase.of(context).arrivedP, + color: Colors.green, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + SizedBox(width: 8,), + SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), + SizedBox(width: 8,), + AppText( + patientInfo.status==2? 'Confirmed':'Booked', + color: patientInfo.status==2? Colors.green:Colors.grey , + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + ], + ) + : patientInfo.patientStatusType == 42?Row( + children: [ + AppText( + TranslationBase.of(context).notArrived, + color: Colors.red[800], + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + SizedBox(width: 8,), + SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), + SizedBox(width: 8,), + AppText( + patientInfo.status==2? 'Confirmed':'Booked', + color: patientInfo.status==2? Colors.green:Colors.grey , + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + ], + ): !isFromSearch?Row( + children: [ + AppText( + TranslationBase.of(context).notArrived, + color: Colors.red[800], + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + SizedBox(width: 8,), + SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), + SizedBox(width: 8,), + AppText( + patientInfo.status==2? 'Confirmed':'Booked', + color: patientInfo.status==2? Colors.green:Colors.grey , + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ) + ], + ):SizedBox(), this.arrivalType == '1' ? AppText( patientInfo.startTime != null ? patientInfo.startTime : patientInfo.startTimes, fontFamily: 'Poppins', - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w400, ) : patientInfo.arrivedOn != null ? AppText( - DateUtils.getDayMonthYearDateFormatted(DateUtils.convertStringToDate( - patientInfo.arrivedOn, - )), + DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.arrivedOn,) + )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.arrivedOn,)), fontFamily: 'Poppins', - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w400, ) - : SizedBox() + : (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)? + AppText( + DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,) + )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)), + fontFamily: 'Poppins', + fontWeight: FontWeight.w400, + ):SizedBox() ], )) : SizedBox(), + if(isInpatient && isMyPatient && !isFromSearch) + Row( + children: [ + SizedBox(width: 12,), + AppText( + 'My Patient', + color: Colors.green, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + ], + ), Padding( padding: EdgeInsets.only(left: 12.0), child: Row( @@ -212,7 +291,7 @@ class PatientCard extends StatelessWidget { ), ), ), - if (isInpatient) + //if (isInpatient) Container( child: RichText( text: new TextSpan( @@ -368,7 +447,7 @@ class PatientCard extends StatelessWidget { //) ])) ]), - !isInpatient + !isInpatient && !isFromSearch ? Row( mainAxisAlignment: MainAxisAlignment.end, children: [ From 05a3ca73001ecea5d6e3b9c9400a4fec3ce0b5f1 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 11:40:27 +0300 Subject: [PATCH 37/50] add doctor profile --- lib/screens/home/home_screen.dart | 2 +- .../patient_search_screen_new.dart | 6 +- .../patient_search/patients_screen_new.dart | 347 +++++++++--------- 3 files changed, 183 insertions(+), 172 deletions(-) diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 1435c942..307b635c 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -559,7 +559,7 @@ class _HomeScreenState extends State { isSearch: false, isInpatient: false, patientSearchRequestModel: - PatientSearchRequestModel(from: date, to: date), + PatientSearchRequestModel(from: date, to: date,doctorID: authProvider.doctorProfile.doctorID), selectedPatientType: PatientType.OutPatient, isSearchWithKeyInfo: false, diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen_new.dart index c101567a..e1a22170 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/model/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patients_screen_new.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; @@ -12,6 +13,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; class PatientSearchScreenNew extends StatefulWidget { @override @@ -26,9 +28,11 @@ class _PatientSearchScreenNewState extends State { TextEditingController middleNameInfoController = TextEditingController(); TextEditingController lastNameFileInfoController = TextEditingController(); PatientType selectedPatientType = PatientType.inPatient; + AuthViewModel authProvider; @override Widget build(BuildContext context) { + authProvider =Provider.of(context); return BaseView( onModelReady: (model) async {}, builder: (_, model, w) => AppScaffold( @@ -248,7 +252,7 @@ class _PatientSearchScreenNewState extends State { isFormSubmitted = true; }); PatientSearchRequestModel patientSearchRequestModel = - PatientSearchRequestModel(); + PatientSearchRequestModel(doctorID: authProvider.doctorProfile.doctorID); if (showOther) { patientSearchRequestModel.firstName = firstNameInfoController.text.trim().isEmpty?"0":firstNameInfoController.text.trim(); patientSearchRequestModel.middleName = middleNameInfoController.text.trim().isEmpty?"0":middleNameInfoController.text.trim(); diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index ab1e9594..a4236870 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -100,187 +100,194 @@ class _PatientsScreenNewState extends State { title: "Search for ${widget.searchKey}", ), baseViewModel: model, - body: Container( - color: Colors.grey[200], - child: ListView( - scrollDirection: Axis.vertical, - children: [ + body: Column( + children: [ + if(!widget.isInpatient && !widget.isSearch) Container( - child: Column( - children: [ - if(!widget.isInpatient && !widget.isSearch) - Container( - // color: Colors.red, - height: screenSize.height * 0.070, - decoration: TextFieldsUtils - .containerBorderDecoration( - Color(0Xffffffff), - Color(0xFFCCCCCC), - borderRadius: 4, - borderWidth: 0), - child: Row( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _locations.map((item) { - bool _isActive = _locations[_activeLocation] == item - ? true - : false; + // color: Colors.red, + height: screenSize.height * 0.070, + decoration: TextFieldsUtils + .containerBorderDecoration( + Color(0Xffffffff), + Color(0xFFCCCCCC), + borderRadius: 4, + borderWidth: 0), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _locations.map((item) { + bool _isActive = _locations[_activeLocation] == item + ? true + : false; - return Expanded( - child: InkWell( - onTap: () async { - setState(() { - _activeLocation = _locations.indexOf(item); - }); - GifLoaderDialogUtils.showMyDialog(context); - await model.getPatientBasedOnDate(item: item, - selectedPatientType: widget.selectedPatientType, - patientSearchRequestModel: widget - .patientSearchRequestModel, - isSearchWithKeyInfo: widget.isSearchWithKeyInfo); - GifLoaderDialogUtils.hideDialog(context); - }, - child: Center( - child: Container( - height: screenSize.height * 0.070, - decoration: TextFieldsUtils.containerBorderDecoration( - _isActive - ? Color(0xFFD02127 /*B8382B*/) - : Color(0xFFEAEAEA), - _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), - borderRadius: 4, - borderWidth: 0), - child: Center( - child: AppText( - item, - fontSize: SizeConfig.textMultiplier * 1.8, - color: _isActive ? Colors.white : Color(0xFF2B353E), - fontWeight: FontWeight.w700, - ), - ), - ), - ), + return Expanded( + child: InkWell( + onTap: () async { + setState(() { + _activeLocation = _locations.indexOf(item); + }); + GifLoaderDialogUtils.showMyDialog(context); + await model.getPatientBasedOnDate(item: item, + selectedPatientType: widget.selectedPatientType, + patientSearchRequestModel: widget + .patientSearchRequestModel, + isSearchWithKeyInfo: widget.isSearchWithKeyInfo); + GifLoaderDialogUtils.hideDialog(context); + }, + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + _isActive + ? Color(0xFFD02127 /*B8382B*/) + : Color(0xFFEAEAEA), + _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + item, + fontSize: SizeConfig.textMultiplier * 1.8, + color: _isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, ), - ); - }).toList(), + ), + ), ), ), + ); + }).toList(), + ), + ), - SizedBox(height: 18.5), - Container( - width: SizeConfig.screenWidth * 0.9, - height: 75, - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"), - ), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.only( - left: 10, top: 10), - child: AppText( - TranslationBase.of( - context) - .searchPatientName, - fontSize: 13, - )), - AppTextFormField( - // focusNode: focusProject, - controller: _controller, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon( - DoctorApp.filter_1, - color: Colors.black, - ), - iconSize: 20, - padding: - EdgeInsets.only( - bottom: 30), - ), - onChanged: (String str) { - model.searchData(str); - }), - ])), - SizedBox( - height: 10.0, - ), - SizedBox( - height: 10.0, + SizedBox(height: 18.5), + Container( + width: SizeConfig.screenWidth * 0.9, + height: 75, + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"), ), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + left: 10, top: 10), + child: AppText( + TranslationBase.of( + context) + .searchPatientName, + fontSize: 13, + )), + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + padding: + EdgeInsets.only( + bottom: 30), + ), + onChanged: (String str) { + model.searchData(str); + }), + ])), + SizedBox( + height: 10.0, + ), + Expanded( + child: Container( + // color: Colors.grey[200], + child: ListView( + scrollDirection: Axis.vertical, + children: [ Container( - child: model.patientList.isNotEmpty - ? Column( - // mainAxisAlignment: MainAxisAlignment.center, - children: model.filterData - .map((PatiantInformtion - item) { - return PatientCard( - patientInfo: item, - patientType: - patientType, - arrivalType: - arrivalType, - isInpatient: - widget.isInpatient, - onTap: () { - // TODO change the parameter to daynamic - Navigator.of(context) - .pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": item, - "patientType": - "1", - "from": widget.patientSearchRequestModel.from, - "to": widget.patientSearchRequestModel.from, - "isSearch": - widget.isSearch, - "isInpatient": - widget.isInpatient, - "arrivalType": - "7", - }); - }, - isFromSearch: widget.isSearch, - ); - }).toList(), - ) - : Center( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - SizedBox( - height: 100, - ), - Image.asset( - 'assets/images/no-data.png'), - Padding( - padding: - const EdgeInsets - .all(8.0), - child: AppText( - TranslationBase.of( - context) - .youDontHaveAnyPatient), - ) - ], + child: Column( + children: [ + + SizedBox( + height: 10.0, ), - )), + Container( + child: model.patientList.isNotEmpty + ? Column( + // mainAxisAlignment: MainAxisAlignment.center, + children: model.filterData + .map((PatiantInformtion + item) { + return PatientCard( + patientInfo: item, + patientType: + patientType, + arrivalType: + arrivalType, + isInpatient: + widget.isInpatient, + onTap: () { + // TODO change the parameter to daynamic + Navigator.of(context) + .pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": item, + "patientType": + "1", + "from": widget.patientSearchRequestModel.from, + "to": widget.patientSearchRequestModel.from, + "isSearch": + widget.isSearch, + "isInpatient": + widget.isInpatient, + "arrivalType": + "7", + }); + }, + isFromSearch: widget.isSearch, + ); + }).toList(), + ) + : Center( + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + SizedBox( + height: 100, + ), + Image.asset( + 'assets/images/no-data.png'), + Padding( + padding: + const EdgeInsets + .all(8.0), + child: AppText( + TranslationBase.of( + context) + .youDontHaveAnyPatient), + ) + ], + ), + )), + ], + ), + ) ], ), - ) - ], - ), + ), + ), + ], ) ), ); From 60eb7adab119ab6bc06b29545be4dcb73584380b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 27 Apr 2021 11:54:25 +0300 Subject: [PATCH 38/50] hot fixes --- lib/config/localized_values.dart | 3 +- .../service/patient-vital-signs-service.dart | 47 ++- .../patient-vital-sign-viewmodel.dart | 2 +- lib/routes.dart | 1 + .../medical-file/medical_file_page.dart | 4 +- .../insurance_approval_screen_patient.dart | 4 +- .../profile/in_patient_profile_screen.dart | 227 +++++++++++++ .../profile/lab_result/labs_home_page.dart | 4 +- .../profile/note/progress_note_screen.dart | 2 +- .../profile/patient_profile_screen.dart | 310 +++++++++++++++++- .../radiology/radiology_home_page.dart | 9 +- .../refer-patient-screen-in-patient.dart | 4 +- .../prescription/prescriptions_page.dart | 3 +- lib/screens/procedures/procedure_screen.dart | 6 +- lib/screens/sick-leave/add-sickleave.dart | 2 + lib/util/translations_delegate_base.dart | 1 + ...ent-profile-header-new-design-app-bar.dart | 51 ++- 17 files changed, 617 insertions(+), 63 deletions(-) create mode 100644 lib/screens/patients/profile/in_patient_profile_screen.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e47a8707..ea99a982 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -48,6 +48,7 @@ const Map> localizedValues = { 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'}, 'inPatient': {'en': 'My InPatients', 'ar': 'المريض الداخلي'}, + 'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'}, 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى الداخليين'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, @@ -769,7 +770,7 @@ const Map> localizedValues = { 'arrived_p': {'en': "Arrived", 'ar': "وصل"}, 'details': {'en': 'Details', 'ar': 'التفاصيل'}, "liveCare": {"en": "Live Care", "ar": "لايف كير"}, - "out-patient": {"en": "Out Patient", "ar": "عيادات خارجية"}, + "out-patient": {"en": "OutPatient", "ar": "عيادات خارجية"}, "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, "labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"}, "sendSuc": { diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index 4dd16859..fe6dcb5b 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -39,25 +39,29 @@ class VitalSignsService extends BaseService { patientVitalSigns = null; hasError = false; Map body = Map(); - body['PatientMRN'] = patient.patientId; // patient.patientMRN - // body['AppointmentNo'] = patient.appointmentNo; - // body['EpisodeID'] = patient.episodeNo; + body['PatientID'] = patient.patientId; // patient.patientMRN + body['InOutPatientType'] = 1; body['PatientTypeID'] = 1; body['PatientType'] = 1; body['DeviceTypeID'] = 1; body['isDentalAllowedBackend'] = false; - body['From'] = fromDate; - body['To'] = toDate; + body['ProjectID'] = patient.projectId; + // body['From'] = fromDate; + // body['To'] = toDate; + if (patient.appointmentNo != null && patient.projectId != null) { + body['TransNo'] = patient.appointmentNo; + body['ProjectID'] = patient.projectId; + } await baseAppClient.post( - GET_PATIENT_VITAL_SIGN_DATA, + GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { patientVitalSignsHistory.clear(); - if (response['VitalSignsHistory'] != null) { - response['VitalSignsHistory'].forEach((v) { - patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); - }); - } + if (response['List_DoctorPatientVitalSign'] != null) { + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; @@ -67,31 +71,26 @@ class VitalSignsService extends BaseService { ); } - Future getInPatientVitalSignHistory(PatiantInformtion patient, bool isInPatient) async { + Future getOutPatientVitalSignHistory(PatiantInformtion patient, String fromDate, String toDate) async { hasError = false; Map body = Map(); body['PatientID'] = patient.patientId; body['PatientTypeID'] = patient.patientType; - // if(isInPatient){ - body['InOutPatientType'] = 0; - // }else { - // body['InOutPatientType'] = 2; - // } + // if(isInPatient){ + body['InOutPatientType'] = 0; + // }else { + // body['InOutPatientType'] = 2; + // } - if (patient.appointmentNo != null && patient.projectId != null) { - body['TransNo'] = patient.appointmentNo; - body['ProjectID'] = patient.projectId; - } await baseAppClient.postPatient( - GET_PATIENT_VITAL_SIGN, + GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) { patientVitalSignsHistory.clear(); if (response['List_DoctorPatientVitalSign'] != null) { response['List_DoctorPatientVitalSign'].forEach((v) { patientVitalSignsHistory.add(new VitalSignHistory.fromJson(v)); - }); - } + });} }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index f9cbfc8d..cd02f538 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -56,7 +56,7 @@ class VitalSignsViewModel extends BaseViewModel { if (isInPatient) { await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); } else { - await _vitalSignService.getInPatientVitalSignHistory(patient, isInPatient); + await _vitalSignService.getOutPatientVitalSignHistory(patient, from, to); } diff --git a/lib/routes.dart b/lib/routes.dart index c9a77e70..91c3eaed 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -35,6 +35,7 @@ const String LOGIN = 'login'; const String VERIFICATION_METHODS = 'verification-methods'; const String PATIENTS = 'patients/patients'; const String PATIENTS_PROFILE = 'patients/patients-profile'; +const String IN_PATIENTS_PROFILE = 'inpatients/patients-profile'; const String LAB_RESULT = 'patients/lab_result'; const String MEDICAL_FILE = 'patients/radiology'; const String PROGRESS_NOTE = 'patients/progress-note'; diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index f0ee6445..b7587efb 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -24,14 +24,14 @@ class _MedicalFilePageState extends State { patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; - + bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType.toString() ?? "0", arrivalType), + patient, patientType.toString() ?? "0", arrivalType,isInpatient:isInpatient ,), isShowAppBar: true, appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), body: NetworkBaseView( diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 2225e289..ab3abbe9 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -33,7 +33,7 @@ class _InsuranceApprovalScreenNewState PatiantInformtion patient = routeArgs['patient']; patient = routeArgs['patient']; String patientType = routeArgs['patientType']; - + bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: patient.admissionNo != null ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) @@ -45,7 +45,7 @@ class _InsuranceApprovalScreenNewState builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType.toString() ?? "0", patientType), + patient, patientType.toString() ?? "0", patientType,isInpatient: isInpatient,), isShowAppBar: true, baseViewModel: model, appBarTitle: TranslationBase.of(context).approvals, diff --git a/lib/screens/patients/profile/in_patient_profile_screen.dart b/lib/screens/patients/profile/in_patient_profile_screen.dart new file mode 100644 index 00000000..bce4c725 --- /dev/null +++ b/lib/screens/patients/profile/in_patient_profile_screen.dart @@ -0,0 +1,227 @@ +import 'package:doctor_app_flutter/core/viewModel/patient_view_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'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import '../../../routes.dart'; + + +class InPatientProfileScreen extends StatefulWidget { + @override + _InPatientProfileScreenState createState() => _InPatientProfileScreenState(); +} + +class _InPatientProfileScreenState extends Statewith SingleTickerProviderStateMixin { + PatiantInformtion patient; + + bool isFromSearch = false; + + bool isInpatient = false; + + bool isDischargedPatient = false; + String patientType; + String arrivalType; + String from; + String to; + + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + from = routeArgs['from']; + to = routeArgs['to']; + if (routeArgs.containsKey("isSearch")) { + isFromSearch = routeArgs['isSearch']; + } + if (routeArgs.containsKey("isInpatient")) { + isInpatient = routeArgs['isInpatient']; + } + if (routeArgs.containsKey("isDischargedPatient")) { + isDischargedPatient = routeArgs['isDischargedPatient']; + } + + } + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, patientViewModel, w) => AppScaffold( + baseViewModel: patientViewModel, + appBarTitle: TranslationBase.of(context).patientProfile, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType), + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(top: 10), + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + //TranslationBase.of(context).medicalReport, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + //TranslationBase.of(context).medicalReport, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ), + ), + ), + )); + } +} + +class AvatarWidget extends StatelessWidget { + final Widget avatarIcon; + + AvatarWidget(this.avatarIcon); + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) + ], + borderRadius: BorderRadius.all(Radius.circular(35.0)), + color: Color(0xffCCCCCC), + ), + child: avatarIcon, + ); + } +} diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index abfcb282..5677d374 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -44,7 +44,7 @@ class _LabsHomePageState extends State { backgroundColor: Colors.grey[100], isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', patientType), + patient, patient.patientType.toString() ?? '0', patientType,isInpatient: isInpatient,), body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( @@ -158,7 +158,7 @@ class _LabsHomePageState extends State { .toUpperCase() : !labOrder.isInOutPatient ? TranslationBase.of(context) - .inPatient + .inPatientLabel .toUpperCase() : TranslationBase.of(context) .outpatient diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index 443bff8d..d7506402 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -79,7 +79,7 @@ class _ProgressNoteState extends State { backgroundColor: Theme.of(context).scaffoldBackgroundColor, // appBarTitle: TranslationBase.of(context).progressNote, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', arrivalType), + patient, patient.patientType.toString() ?? '0', arrivalType,isInpatient: true,), body: model.patientProgressNoteList == null || model.patientProgressNoteList.length == 0 ? DrAppEmbeddedError( error: TranslationBase.of(context).errorNoProgressNote) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 730e8a26..49943159 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -71,9 +71,9 @@ class _PatientProfileScreenState extends Statewith SingleT baseViewModel: patientViewModel, appBarTitle: TranslationBase.of(context).patientProfile, isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType), + appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), body: SingleChildScrollView( - child: Column( + child: isFromSearch ?Column( children: [ DefaultTabController( length: 2, @@ -165,6 +165,7 @@ class _PatientProfileScreenState extends Statewith SingleT patientType: patientType, arrivalType: arrivalType, route: ORDER_PRESCRIPTION_NEW, + isInPatient: isInpatient, nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).prescription, icon: 'patient/order_prescription.png'), @@ -192,6 +193,7 @@ class _PatientProfileScreenState extends Statewith SingleT patientType: patientType, arrivalType: arrivalType, route: ORDER_PROCEDURE, + isInPatient: isInpatient, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, icon: 'patient/Order_Procedures.png'), @@ -201,7 +203,7 @@ class _PatientProfileScreenState extends Statewith SingleT arrivalType: arrivalType, route: MEDICAL_FILE, nameLine1: "Health", - //TranslationBase.of(context).medicalReport, + isInPatient: isInpatient, nameLine2: "Summary", //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), @@ -212,7 +214,7 @@ class _PatientProfileScreenState extends Statewith SingleT isDisable: true, route: MEDICAL_FILE, nameLine1: "Medical", //Health - //TranslationBase.of(context).medicalReport, + isInPatient: isInpatient, nameLine2: "Report", //Report //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), @@ -226,6 +228,7 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: TranslationBase.of(context).patient, icon: 'patient/refer_patient.png'), PatientProfileButton( + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -234,7 +237,7 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: TranslationBase.of(context).approvals, icon: 'patient/vital_signs.png'), PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -244,7 +247,7 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: "Summery", icon: 'patient/patient_sick_leave.png'), PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -264,7 +267,7 @@ class _PatientProfileScreenState extends Statewith SingleT crossAxisCount: 3, children: [ PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -276,7 +279,7 @@ class _PatientProfileScreenState extends Statewith SingleT icon: 'patient/vital_signs.png'), // if (selectedPatientType != 7) PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -287,7 +290,7 @@ class _PatientProfileScreenState extends Statewith SingleT "Summary", //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -307,7 +310,7 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: TranslationBase.of(context).service, icon: 'patient/health_summary.png'), PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -316,7 +319,7 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: "ECG", icon: 'patient/patient_sick_leave.png'), PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -326,7 +329,7 @@ class _PatientProfileScreenState extends Statewith SingleT icon: 'patient/order_prescription.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -336,7 +339,7 @@ class _PatientProfileScreenState extends Statewith SingleT icon: 'patient/Order_Procedures.png'), //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -346,7 +349,7 @@ class _PatientProfileScreenState extends Statewith SingleT icon: 'patient/vital_signs.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -357,7 +360,7 @@ class _PatientProfileScreenState extends Statewith SingleT if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -370,7 +373,7 @@ class _PatientProfileScreenState extends Statewith SingleT if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileButton( - + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -383,6 +386,7 @@ class _PatientProfileScreenState extends Statewith SingleT if (patient.appointmentNo != null && patient.appointmentNo != 0) PatientProfileButton( + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -404,6 +408,280 @@ class _PatientProfileScreenState extends Statewith SingleT ), ], + ):isInpatient?GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + isInPatient: isInpatient, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ):GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + + ], ), ), )); diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 6c709e83..81e0e6cf 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -47,7 +47,7 @@ class _RadiologyHomePageState extends State { backgroundColor: Colors.grey[100], // appBarTitle: TranslationBase.of(context).radiology, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patient.patientType.toString() ?? '0', arrivalType), + patient, patient.patientType.toString() ?? '0', arrivalType,isInpatient: isInpatient,), baseViewModel: model, body: FractionallySizedBox( widthFactor: 1.0, @@ -155,7 +155,7 @@ class _RadiologyHomePageState extends State { .toUpperCase() : !model.radiologyList[index].isInOutPatient ? TranslationBase.of(context) - .inPatient + .inPatientLabel .toUpperCase() : TranslationBase.of(context) .outpatient @@ -172,9 +172,8 @@ class _RadiologyHomePageState extends State { invoiceNO: '${model.radiologyList[index].invoiceNo}', branch: '${model.radiologyList[index].projectName}', clinic: model.radiologyList[index].clinicDescription, - appointmentDate: !isInpatient - ? model.radiologyList[index].orderDate - : model.radiologyList[index].reportDate, + appointmentDate: model.radiologyList[index].orderDate?? + model.radiologyList[index].reportDate, onTap: () { Navigator.push( context, diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index ae3fcee7..197cf6bc 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -48,7 +48,7 @@ class _PatientMakeInPatientReferralScreenState patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; - + bool isInpatient = routeArgs['isInpatient']; referToList = List(); dynamic sameBranch = { "id": 1, @@ -70,7 +70,7 @@ class _PatientMakeInPatientReferralScreenState appBarTitle: TranslationBase.of(context).referPatient, isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), + patient, patientType, arrivalType,isInpatient: isInpatient,), body: SingleChildScrollView( child: Container( child: Column( diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 19ce09e4..a1a5b962 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -24,6 +24,7 @@ class PrescriptionsPage extends StatelessWidget { PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; + bool isInpatient = routeArgs['isInpatient']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => @@ -35,7 +36,7 @@ class PrescriptionsPage extends StatelessWidget { isShowAppBar: true, backgroundColor: Colors.grey[100], appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType ?? '0', arrivalType), + patient, patientType ?? '0', arrivalType,isInpatient: isInpatient,), body: patient.admissionNo == null ? FractionallySizedBox( widthFactor: 1.0, diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 2a3a851c..51122999 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -30,17 +30,17 @@ class ProcedureScreen extends StatelessWidget { PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; - + bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) => - model.getProcedure(mrn: patient.patientId, patientType: patientType), + model.getProcedure(mrn: patient.patientId, patientType: patientType,), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], baseViewModel: model, appBar: PatientProfileHeaderNewDesignAppBar( - patient, arrivalType ?? '0', patientType), + patient, arrivalType ?? '0', patientType,isInpatient: isInpatient,), body: SingleChildScrollView( child: Container( child: Column( diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 3b05d8f4..6ee37745 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -21,6 +21,7 @@ class AddSickLeavScreen extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; + bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) => model.getSickLeavePatient(patient.patientMRN ?? patient.patientId), @@ -32,6 +33,7 @@ class AddSickLeavScreen extends StatelessWidget { patient, routeArgs['patientType'] ?? "0", routeArgs['arrivalType'] ?? "0", + isInpatient: isInpatient, ), body: SingleChildScrollView( child: Column(children: [ diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 3d431f9d..6602722c 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -100,6 +100,7 @@ class TranslationBase { String get referral => localizedValues['referral'][locale.languageCode]; String get inPatient => localizedValues['inPatient'][locale.languageCode]; + String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 48454af4..5faa82a4 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -17,9 +17,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final String patientType; final String arrivalType; final double height; + final bool isInpatient; PatientProfileHeaderNewDesignAppBar( - this.patient, this.patientType, this.arrivalType, {this.height = 0.0}); + this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false}); @override Widget build(BuildContext context) { @@ -38,7 +39,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - height: height == 0 ? 200 : height, + height: height == 0 ? isInpatient? 210:200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), @@ -254,7 +255,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), children: [ new TextSpan( - text: TranslationBase.of(context).age??'' + " : ", + text: TranslationBase.of(context).age+ " : ", style: TextStyle(fontSize: 14)), new TextSpan( text: @@ -265,6 +266,50 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), ), ), + if(isInpatient) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: + 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: patient.admissionDate == null + ? "" + : TranslationBase.of(context) + .admissionDate + + " : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: patient.admissionDate == null + ? "" + : "${DateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 15)), + ]))), + if (patient.admissionDate != null) + Row( + children: [ + AppText( + "${TranslationBase.of(context).numOfDays}: ", + fontSize: 15, + ), + AppText( + "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", + fontSize: 15, + fontWeight: FontWeight.w700), + ], + ), + ], + ) ], ), ), From 4c493d8ea680326f6a58e71d3aab90c6f6aebbab Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 12:16:12 +0300 Subject: [PATCH 39/50] fix issue in patients_screen --- .../viewModel/PatientSearchViewModel.dart | 1 + .../patient_search/patients_screen_new.dart | 117 ++++++------------ 2 files changed, 40 insertions(+), 78 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 59f8c9c6..b670205d 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -124,6 +124,7 @@ class PatientSearchViewModel extends BaseViewModel{ currentModel.firstName = patientSearchRequestModel.firstName; currentModel.lastName = patientSearchRequestModel.lastName; currentModel.middleName = patientSearchRequestModel.middleName; + currentModel.doctorID = patientSearchRequestModel.doctorID; currentModel.from = dateFrom; currentModel.to = dateTo; diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index a4236870..5de98242 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -5,7 +5,6 @@ import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -14,6 +13,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.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/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; @@ -208,85 +208,46 @@ class _PatientsScreenNewState extends State { ), Expanded( child: Container( - // color: Colors.grey[200], - child: ListView( - scrollDirection: Axis.vertical, - children: [ - Container( - child: Column( - children: [ - - SizedBox( - height: 10.0, - ), - Container( - child: model.patientList.isNotEmpty - ? Column( - // mainAxisAlignment: MainAxisAlignment.center, - children: model.filterData - .map((PatiantInformtion - item) { - return PatientCard( - patientInfo: item, - patientType: - patientType, - arrivalType: - arrivalType, - isInpatient: - widget.isInpatient, - onTap: () { - // TODO change the parameter to daynamic - Navigator.of(context) - .pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": item, - "patientType": - "1", - "from": widget.patientSearchRequestModel.from, - "to": widget.patientSearchRequestModel.from, - "isSearch": - widget.isSearch, - "isInpatient": - widget.isInpatient, - "arrivalType": - "7", - }); - }, - isFromSearch: widget.isSearch, - ); - }).toList(), - ) - : Center( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - SizedBox( - height: 100, - ), - Image.asset( - 'assets/images/no-data.png'), - Padding( - padding: - const EdgeInsets - .all(8.0), - child: AppText( - TranslationBase.of( - context) - .youDontHaveAnyPatient), - ) - ], + child: model.filterData.isEmpty + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context) + .youDontHaveAnyPatient, + ), + ) + : ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.filterData.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: PatientCard( + patientInfo: model.filterData[index], + patientType: patientType, + arrivalType: arrivalType, + isInpatient: widget.isInpatient, + onTap: () { + // TODO change the parameter to daynamic + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model.filterData[index], + "patientType": "1", + "from": widget + .patientSearchRequestModel.from, + "to": widget + .patientSearchRequestModel.from, + "isSearch": widget.isSearch, + "isInpatient": widget.isInpatient, + "arrivalType": "7", + }); + }, + isFromSearch: widget.isSearch, ), - )), - ], - ), - ) - ], - ), + ); + })), ), - ), ], ) ), From 21fd90ea8c1aa1d3d8c433e93cf9dad5fa291e27 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 27 Apr 2021 12:32:01 +0300 Subject: [PATCH 40/50] hot fixes --- .../viewModel/PatientSearchViewModel.dart | 2 +- .../patients/PatientsInPatientScreen.dart | 92 ++++++++++++------- lib/util/dr_app_shared_pref.dart | 3 +- 3 files changed, 64 insertions(+), 33 deletions(-) diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 59f8c9c6..9312f255 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -152,7 +152,7 @@ class PatientSearchViewModel extends BaseViewModel{ setState(ViewState.Busy); else setState(ViewState.BusyLocal); - await _inPatientService.getInPatientList(requestModel, isMyInpatient); + await _inPatientService.getInPatientList(requestModel, false); if (_inPatientService.hasError) { error = _inPatientService.error; setState(ViewState.Error); diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 2a3f3839..7d41b3cb 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -101,32 +101,60 @@ class _PatientInPatientScreenState extends State { // const SizedBox( // height: 16, // ), - ...model.filteredInPatientItems.map((item) { - return PatientCard( - patientInfo: item, - patientType: "1", - arrivalType: "1", - isInpatient: true, - isMyPatient: _activeTab!=0? false:item.doctorId==model.doctorProfile.doctorID, - onTap: () { - FocusScopeNode currentFocus = FocusScope.of(context); - if (!currentFocus.hasPrimaryFocus) { - currentFocus.unfocus(); - } + ...List.generate(model.filteredInPatientItems.length, (index) { + if(_activeTab == 0) + return PatientCard( + patientInfo: model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID, + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { - "patient": item, - "patientType": "1", - "from": "0", - "to": "0", - "isSearch": false, - "isInpatient": true, - "arrivalType": "1", - }); - }, - ); - }).toList(), + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); + }, + ); + else if(model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID && _activeTab==1) + return PatientCard( + patientInfo: model.filteredInPatientItems[index], + patientType: "1", + arrivalType: "1", + isInpatient: true, + isMyPatient: model.filteredInPatientItems[index].doctorId==model.doctorProfile.doctorID, + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } + + Navigator.of(context) + .pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filteredInPatientItems[index], + "patientType": "1", + "from": "0", + "to": "0", + "isSearch": false, + "isInpatient": true, + "arrivalType": "1", + }); + }, + ); + else return SizedBox(); + }), + SizedBox(height: 15,) ], ), ), @@ -173,12 +201,14 @@ class _PatientInPatientScreenState extends State { if (!currentFocus.hasPrimaryFocus) { currentFocus.unfocus(); } - GifLoaderDialogUtils.showMyDialog( - context); - await model.getInPatientList(requestModel, - isMyInpatient: _activeTab == 1, isFirstTime: false); - GifLoaderDialogUtils.hideDialog( - context); + if (_activeTab==0) { + GifLoaderDialogUtils.showMyDialog( + context); + await model.getInPatientList(requestModel, + isMyInpatient: _activeTab == 1, isFirstTime: false); + GifLoaderDialogUtils.hideDialog( + context); + } }, child: Center( child: Container( diff --git a/lib/util/dr_app_shared_pref.dart b/lib/util/dr_app_shared_pref.dart index 2f6f3232..bac296bf 100644 --- a/lib/util/dr_app_shared_pref.dart +++ b/lib/util/dr_app_shared_pref.dart @@ -92,7 +92,8 @@ class DrAppSharedPreferances { clear() async { final SharedPreferences prefs = await _prefs; - prefs.clear(); + var vvas= await prefs.clear(); + var asd; } remove(String key) async { From 4f6fec07dad85277ec8380a7d907ad5d9140d20e Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 27 Apr 2021 12:45:22 +0300 Subject: [PATCH 41/50] vital sign fix bug --- .../profile/vital_sign/vital_sign_details_screen.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 5ceaedd5..0b41e0a2 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -316,8 +316,8 @@ class VitalSignDetailsScreen extends StatelessWidget { GridView.count( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 6, - mainAxisSpacing: 6, + crossAxisSpacing: 8, + mainAxisSpacing: 12, crossAxisCount: 3, children: [ InkWell( From cf1d4439f2a310fc6abf5b22178d029089972b93 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 12:53:59 +0300 Subject: [PATCH 42/50] fix issue of out SA in case of 3 or 2 project id --- lib/client/base_app_client.dart | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index e6e6f9fc..602efa32 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:io' show Platform; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; @@ -6,12 +7,8 @@ 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/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; -import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart' as http; -import 'dart:io' show Platform; - -import '../UpdatePage.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = new Helpers(); @@ -70,6 +67,11 @@ class BaseAppClient { await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); } + if (body['ProjectID'] != null && + (body['ProjectID'] == 2 || body['ProjectID'] == 3)) { + body['PatientOutSA'] = true; + } + print("URL : $url"); print("Body : ${json.encode(body)}"); var asd = json.encode(body); @@ -192,6 +194,11 @@ class BaseAppClient { body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it body['SessionID'] = SESSION_ID; //getSe + if (body['ProjectID'] != null && + (body['ProjectID'] == 2 || body['ProjectID'] == 3)) { + body['PatientOutSA'] = true; + } + print("URL : $url"); print("Body : ${json.encode(body)}"); From dc9f75f0ca55b02f300b1b2b17b5704c164fc338 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 27 Apr 2021 16:35:01 +0300 Subject: [PATCH 43/50] hot fixes --- lib/client/base_app_client.dart | 4 +- .../service/patient-vital-signs-service.dart | 2 + .../viewModel/prescription_view_model.dart | 5 +- lib/core/viewModel/procedure_View_model.dart | 2 +- lib/core/viewModel/sick_leave_view_model.dart | 2 +- lib/models/patient/patiant_info_model.dart | 2 +- .../patients/DischargedPatientPage.dart | 2 +- .../ReferralDischargedPatientDetails.dart | 4 +- .../patient_search_screen_new.dart | 144 +- .../profile/lab_result/LineChartCurved.dart | 2 +- .../profile/patient_profile_screen.dart | 1304 +++++++++-------- .../refer-patient-screen-in-patient.dart | 109 +- .../LineChartCurvedBloodPressure.dart | 7 +- .../vital_sing_chart_blood_pressure.dart | 1 + .../prescription/prescriptions_page.dart | 3 +- .../procedures/add-procedure-form.dart | 10 +- .../medicine/medicine_item_widget.dart | 5 +- lib/widgets/patients/PatientCard.dart | 100 +- .../profile/PatientProfileButton.dart | 4 +- ...ent-profile-header-new-design-app-bar.dart | 4 +- 20 files changed, 936 insertions(+), 780 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index e6e6f9fc..c5f667d8 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -145,11 +145,11 @@ class BaseAppClient { : SETUP_ID; } - body['VersionID'] = 6.3; + body['VersionID'] = 8.3; body['Channel'] = CHANNEL; body['LanguageID'] = languageID == 'ar' ? 1 : 2; - body['IPAdress'] = IP_ADDRESS; + body['IPAdress'] = "10.20.10.20"; body['generalid'] = GENERAL_ID; body['PatientOutSA'] = body.containsKey('PatientOutSA') ? body['PatientOutSA'] != null diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index fe6dcb5b..1c07aa48 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -78,6 +78,8 @@ class VitalSignsService extends BaseService { body['PatientTypeID'] = patient.patientType; // if(isInPatient){ body['InOutPatientType'] = 0; + body['isDentalAllowedBackend'] = false; + body['IPAdress'] = "10.20.10.20"; // }else { // body['InOutPatientType'] = 2; // } diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index c266f3c0..c549b2b0 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -59,10 +59,11 @@ class PrescriptionViewModel extends BaseViewModel { getPrescriptionsInPatient(PatiantInformtion patient) async { setState(ViewState.Busy); + error=""; await _prescriptionsService.getPrescriptionInPatient( mrn: patient.patientId, adn: patient.admissionNo); if (_prescriptionsService.hasError) { - error = _prescriptionsService.error; + error = "No Prescription Found"; setState(ViewState.Error); } else { _filterList(); @@ -268,7 +269,7 @@ class PrescriptionViewModel extends BaseViewModel { if (patientType == "7") setState(ViewState.ErrorLocal); else - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else { _filterList(); await _getPrescriptionsOrders(); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index c68ec510..4ee569ce 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -147,7 +147,7 @@ class ProcedureViewModel extends BaseViewModel { if(patientType=="7") setState(ViewState.ErrorLocal); else - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else { _radiologyService.finalRadiologyList.forEach((element) { List finalRadiologyListClinic = diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index f5ddd676..bc80744f 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -62,7 +62,7 @@ class SickLeaveViewModel extends BaseViewModel { await _sickLeaveService.getSickLeavePatient(patientMRN); if (_sickLeaveService.hasError) { error = _sickLeaveService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index cd21f911..2dec82d1 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -174,7 +174,7 @@ class PatiantInformtion { genderDescription: json["GenderDescription"], nursingStationName: json["NursingStationName"], appointmentDate: json["AppointmentDate"] ?? '', - startTime: json["startTime"], + startTime: json["startTime"]??json['StartTime'], appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], appointmentType: json['appointmentType'], appointmentTypeId: json['appointmentTypeId']?? json['appointmentTypeid'], diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 0e61702d..793ae8bb 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -309,7 +309,7 @@ class _DischargedPatientState extends State { fontSize: 14,fontWeight: FontWeight.w300, ), AppText( - "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", + "${DateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(DateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", fontSize: 15, fontWeight: FontWeight.w700), ], diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index b0ec6105..e16a1d8e 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -195,9 +195,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { ), Expanded( child: AppText( - DateUtils.convertDateFromServerFormat( - referredPatient.dischargeDate, - "dd MMM,yyyy"), + "${DateUtils.convertStringToDate(referredPatient.dischargeDate).difference(DateUtils.convertStringToDate(referredPatient.admissionDate)).inDays+1}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen_new.dart index e1a22170..5972ee6f 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -125,78 +125,78 @@ class _PatientSearchScreenNewState extends State { SizedBox( height: 5, ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - InkWell( - child: this.showOther == false - ? AppText( - TranslationBase.of(context) - .searchWithOther, - color: Colors.red, - fontWeight: FontWeight.bold, - ) - : AppText( - TranslationBase.of(context) - .hideOtherCriteria, - color: Colors.red, - fontWeight: FontWeight.bold), - onTap: () { - setState(() { - this.showOther = !this.showOther; - }); - }, - ) - ], - ), - SizedBox( - height: 30, - ), - if (showOther) - Column( - children: [ - AppTextFieldCustom( - hintText: - TranslationBase.of(context).firstName, - controller: firstNameInfoController, - maxLines: 1, - minLines: 1, - hasBorder: true, - onChanged: (_) {}, - // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , - ), - SizedBox( - height: 10, - ), - AppTextFieldCustom( - hintText: - TranslationBase.of(context).middleName, - controller: middleNameInfoController, - maxLines: 1, - minLines: 1, - onChanged: (_) {}, - hasBorder: true, - // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , - ), - SizedBox( - height: 10, - ), - AppTextFieldCustom( - hintText: - TranslationBase.of(context).lastName, - controller: lastNameFileInfoController, - maxLines: 1, - minLines: 1, - onChanged: (_) {}, - hasBorder: true, - // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , - ), - SizedBox( - height: 10, - ), - ], - ), + // Row( + // mainAxisAlignment: MainAxisAlignment.end, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // InkWell( + // child: this.showOther == false + // ? AppText( + // TranslationBase.of(context) + // .searchWithOther, + // color: Colors.red, + // fontWeight: FontWeight.bold, + // ) + // : AppText( + // TranslationBase.of(context) + // .hideOtherCriteria, + // color: Colors.red, + // fontWeight: FontWeight.bold), + // onTap: () { + // setState(() { + // this.showOther = !this.showOther; + // }); + // }, + // ) + // ], + // ), + // SizedBox( + // height: 30, + // ), + // if (showOther) + // Column( + // children: [ + // AppTextFieldCustom( + // hintText: + // TranslationBase.of(context).firstName, + // controller: firstNameInfoController, + // maxLines: 1, + // minLines: 1, + // hasBorder: true, + // onChanged: (_) {}, + // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , + // ), + // SizedBox( + // height: 10, + // ), + // AppTextFieldCustom( + // hintText: + // TranslationBase.of(context).middleName, + // controller: middleNameInfoController, + // maxLines: 1, + // minLines: 1, + // onChanged: (_) {}, + // hasBorder: true, + // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , + // ), + // SizedBox( + // height: 10, + // ), + // AppTextFieldCustom( + // hintText: + // TranslationBase.of(context).lastName, + // controller: lastNameFileInfoController, + // maxLines: 1, + // minLines: 1, + // onChanged: (_) {}, + // hasBorder: true, + // // validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , + // ), + // SizedBox( + // height: 10, + // ), + // ], + // ), SizedBox( height: MediaQuery.of(context).size.height * 0.12, ), diff --git a/lib/screens/patients/profile/lab_result/LineChartCurved.dart b/lib/screens/patients/profile/lab_result/LineChartCurved.dart index d0e61c10..2734286d 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurved.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurved.dart @@ -160,7 +160,7 @@ class LineChartCurvedState extends State { ), minX: 0, maxX: (widget.labResult.length - 1).toDouble(), - maxY: getMaxY(), + maxY: getMaxY()+2, minY: getMinY(), lineBarsData: getData(), ); diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 49943159..ba51c621 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -1,4 +1,7 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -7,6 +10,10 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-head import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design_in_patient.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/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; import '../../../routes.dart'; @@ -29,6 +36,8 @@ class _PatientProfileScreenState extends Statewith SingleT String from; String to; TabController _tabController; + int index = 0; + int _activeTab = 0; @override void initState() { _tabController = TabController(length: 2,vsync:this); @@ -59,633 +68,758 @@ class _PatientProfileScreenState extends Statewith SingleT isDischargedPatient = routeArgs['isDischargedPatient']; } if(isInpatient) - _tabController.index =0; + _activeTab = 0; else - _tabController.index = 1; + _activeTab = 1; } @override Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; return BaseView( builder: (_, patientViewModel, w) => AppScaffold( baseViewModel: patientViewModel, appBarTitle: TranslationBase.of(context).patientProfile, - isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), + isShowAppBar: false,//TODO fix button location + // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), body: SingleChildScrollView( - child: isFromSearch ?Column( - children: [ - DefaultTabController( - length: 2, - initialIndex: isInpatient ? 0 : 1, - child: SizedBox( - height: MediaQuery.of(context).size.height * 1.0, - width: double.infinity, - child: Scaffold( - appBar: AppBar( - backgroundColor: Colors.white, - automaticallyImplyLeading: false, - toolbarHeight: 65, - elevation: 0, - bottom: TabBar( - controller: _tabController, - indicator: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(10), // Creates border - color: Color(0xffD02126), - ), - indicatorColor: Colors.red[500], - unselectedLabelColor: Color(0xff5A6168), - labelColor: Colors.white, - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.35, - height: MediaQuery.of(context).size.height * 0.06, - child: Center( - child: Text('Inpatient Info'), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.35, - height: MediaQuery.of(context).size.height * 0.06, - child: Center( - child: Text('OutPatient Info'), - ), - ), - ]), - ), - body: Container( - margin: EdgeInsets.only(top: 10), - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, + child: Container( + child: Column( + children: [ + Stack( + children: [ + PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient, height: (patient.patientStatusType != null && patient.patientStatusType == 43)?250:0,), + if (patient.patientStatusType != null && + patient.patientStatusType == 43) + BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => Positioned( + top: 175, + left: 20, + right: 20, + child: Row( children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( + Expanded(child: Container()), + if (patient.episodeNo == 0) + AppButton( + title: + "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + color: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/create-episod.png", + color: Colors.white, + height: 30, + ), + onPressed: () async { + if (patient.patientStatusType == 43) { + PostEpisodeReqModel + postEpisodeReqModel = + PostEpisodeReqModel( + appointmentNo: + patient.appointmentNo, + patientMRN: + patient.patientMRN); + GifLoaderDialogUtils.showMyDialog( + context); + await model.postEpisode( + postEpisodeReqModel); + GifLoaderDialogUtils.hideDialog( + context); + patient.episodeNo = model.episodeID; + Navigator.of(context).pushNamed( + CREATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }, + ), + if (patient.episodeNo != 0) + AppButton( + title: + "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", + color: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/modilfy-episode.png", + color: Colors.white, + height: 30, + ), + onPressed: () { + if (patient.patientStatusType == + 43) { + Navigator.of(context).pushNamed( + UPDATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }), + ], + ), + )), + ], + ), + Container( + child: isFromSearch ?Column( + children: [ - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), + tabsBar(context,screenSize), + SizedBox(height: 10,), + if(_activeTab==0) + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient: _activeTab==0, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + isInPatient: isInpatient, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + isDisable: isDischargedPatient|| isFromSearch, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ), + if(_activeTab==1) + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: "Medical", //Health isInPatient: isInpatient, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, nameLine1: TranslationBase.of(context).referral, nameLine2: TranslationBase.of(context).patient, icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) PatientProfileButton( isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - ], - ), + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), - GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( + ], + ), + ), + ], + ):isInpatient? + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient :true, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + isInPatient: isInpatient, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + isDisable: isDischargedPatient|| isFromSearch, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ): + Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient: false, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), - ], - ), ], ), ), - ), + ], ), ), + ], + ), + ), + ), + )); + } - ), - ], - ):isInpatient?GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isInPatient: isInpatient, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: "Medical", //Health - isInPatient: isInpatient, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - ], - ):GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), + Widget tabsBar( + BuildContext context, Size screenSize ) { + List _tabs = [ + "Inpatient Info".toUpperCase(), + "Outpatient Info".toUpperCase(), + ]; + + return Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC), + borderRadius: 4, borderWidth: 0), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _tabs.map((item) { + bool _isActive = _tabs[_activeTab] == item ? true : false; + + return Expanded( + child: InkWell( + onTap: () async { + setState(() { + _activeTab = _tabs.indexOf(item); + }); - ], + }, + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + _isActive + ? Color(0xFFD02127 /*B8382B*/) + : Color(0xFFEAEAEA), + _isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Center( + child: AppText( + item, + fontSize: SizeConfig.textMultiplier * 1.8, + color: _isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + ), + ), + ), ), - ), - )); + ); + }).toList(), + ), + ); } + } class AvatarWidget extends StatelessWidget { @@ -710,3 +844,5 @@ class AvatarWidget extends StatelessWidget { ); } } + + diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index 197cf6bc..38182570 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -1,6 +1,9 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.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/dr_app_toast_msg.dart'; @@ -11,11 +14,14 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:intl/intl.dart'; - +import 'package:permission_handler/permission_handler.dart'; +import 'package:speech_to_text/speech_recognition_error.dart'; +import 'package:speech_to_text/speech_to_text.dart' as stt; class PatientMakeInPatientReferralScreen extends StatefulWidget { @override _PatientMakeInPatientReferralScreenState createState() => @@ -41,6 +47,76 @@ class _PatientMakeInPatientReferralScreenState String clinicError; String doctorError; String frequencyError; + stt.SpeechToText speech = stt.SpeechToText(); + var reconizedWord; + var event = RobotProvider(); + + @override + void initState() { + requestPermissions(); + event.controller.stream.listen((p) { + if (p['startPopUp'] == 'true') { + if (this.mounted) { + initSpeechState().then((value) => {onVoiceText()}); + } + } + }); + super.initState(); + } + + onVoiceText() async { + new SpeechToText(context: context).showAlertDialog(context); + var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; + bool available = await speech.initialize( + onStatus: statusListener, onError: errorListener); + if (available) { + speech.listen( + onResult: resultListener, + listenMode: stt.ListenMode.confirmation, + localeId: lang == 'en' ? 'en-US' : 'ar-SA', + ); + } else { + print("The user has denied the use of speech recognition."); + } + } + + void errorListener(SpeechRecognitionError error) { + event.setValue({"searchText": 'null'}); + //SpeechToText.closeAlertDialog(context); + print(error); + } + + void statusListener(String status) { + reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + } + + void requestPermissions() async { + Map statuses = await [ + Permission.microphone, + ].request(); + } + + void resultListener(result) { + reconizedWord = result.recognizedWords; + event.setValue({"searchText": reconizedWord}); + + if (result.finalResult == true) { + setState(() { + SpeechToText.closeAlertDialog(context); + speech.stop(); + _remarksController.text = reconizedWord; + }); + } else { + print(result.finalResult); + } + } + + Future initSpeechState() async { + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); + print(hasSpeech); + if (!mounted) return; + } @override Widget build(BuildContext context) { @@ -387,13 +463,30 @@ class _PatientMakeInPatientReferralScreenState SizedBox( height: 10, ), - AppTextFieldCustom( - hintText: - TranslationBase.of(context).dietTypeRemarks, - controller: _remarksController, - inputType: TextInputType.multiline, - minLines: 4, - maxLines: 6, + Stack( + children: [ + AppTextFieldCustom( + hintText:"Remarks", + controller: _remarksController, + inputType: TextInputType.multiline, + minLines: 4, + maxLines: 6, + ), + Positioned( + top: 0, //MediaQuery.of(context).size.height * 0, + right: 15, + child: IconButton( + icon: Icon( + DoctorApp.speechtotext, + color: Colors.black, + ), + onPressed: () { + initSpeechState() + .then((value) => {onVoiceText()}); + }, + ), + ), + ], ), ], ), diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart index 3f9b1dd6..1c387c9a 100644 --- a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart @@ -10,9 +10,10 @@ class LineChartCurvedBloodPressure extends StatelessWidget { final List timeSeries1; final List timeSeries2; final int indexes; + final bool isOX; LineChartCurvedBloodPressure( - {this.title, this.timeSeries1, this.indexes, this.timeSeries2}); + {this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX= false}); List xAxixs = List(); List yAxixs = List(); @@ -79,7 +80,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { color: Theme.of(context).primaryColor), ), SizedBox(width: 5,), - AppText(TranslationBase.of(context).systolicLng) + AppText(isOX? "SAO2":TranslationBase.of(context).systolicLng) ], ), SizedBox(width: 15,), @@ -93,7 +94,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { color: Colors.red), ), SizedBox(width: 5,), - AppText(TranslationBase.of(context).diastolicLng,) + AppText(isOX? "FIO2":TranslationBase.of(context).diastolicLng,) ], ), ], diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart index ba27a793..27256525 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -47,6 +47,7 @@ class VitalSingChartBloodPressure extends StatelessWidget { borderRadius: BorderRadius.circular(12)), child: LineChartCurvedBloodPressure( title: name, + isOX: title2=="SAO2", timeSeries1: timeSeriesData1, timeSeries2: timeSeriesData2, indexes: timeSeriesData1.length ~/ 5.5, diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index a1a5b962..be212dc9 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -25,10 +25,11 @@ class PrescriptionsPage extends StatelessWidget { String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; bool isInpatient = routeArgs['isInpatient']; + bool isSelectInpatient = routeArgs['isSelectInpatient']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => - patient.admissionNo != null && patient.admissionNo != "0" + isSelectInpatient ? model.getPrescriptionsInPatient(patient) : model.getPrescriptions(patient, patientType: patientType), builder: (_, model, w) => AppScaffold( diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 9a8fe0c5..7cc9818b 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -199,8 +199,11 @@ class _AddSelectedProcedureState extends State { // categoryName: procedureName.text); // }, onClick: () { + if(procedureName.text.isNotEmpty && procedureName.text.length>=3) model.getProcedureCategory( categoryName: procedureName.text); + else + DrAppToastMsg.showErrorToast('At least three Characters'); }, ), ), @@ -209,8 +212,11 @@ class _AddSelectedProcedureState extends State { ), InkWell( onTap: () { - model.getProcedureCategory( - categoryName: procedureName.text); + if(procedureName.text.isNotEmpty && procedureName.text.length>=3) + model.getProcedureCategory( + categoryName: procedureName.text); + else + DrAppToastMsg.showErrorToast('At least three Characters'); }, child: Icon( Icons.search, diff --git a/lib/widgets/medicine/medicine_item_widget.dart b/lib/widgets/medicine/medicine_item_widget.dart index bd71e477..f4f78c08 100644 --- a/lib/widgets/medicine/medicine_item_widget.dart +++ b/lib/widgets/medicine/medicine_item_widget.dart @@ -2,6 +2,8 @@ import 'dart:convert'; import 'dart:typed_data'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import '../shared/app_texts_widget.dart'; @@ -62,7 +64,8 @@ class _MedicineItemWidgetState extends State { padding: EdgeInsets.all(5), child: Align( alignment: Alignment.centerLeft, - child: AppText(widget.label)))) + child: AppText(widget.label)))), + Icon(EvaIcons.eye) ], ), ), diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 251f7653..f56ad676 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -116,7 +116,7 @@ class PatientCard extends StatelessWidget { fontSize: 12, ), ], - ): !isFromSearch?Row( + ): !isFromSearch && patientInfo.patientStatusType==null ? Row( children: [ AppText( TranslationBase.of(context).notArrived, @@ -129,8 +129,8 @@ class PatientCard extends StatelessWidget { SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), SizedBox(width: 8,), AppText( - patientInfo.status==2? 'Confirmed':'Booked', - color: patientInfo.status==2? Colors.green:Colors.grey , + patientInfo.status==2? 'Booked':'Confirmed', + color: patientInfo.status==2? Colors.grey:Colors.green , fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 12, @@ -154,8 +154,9 @@ class PatientCard extends StatelessWidget { ) : (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)? AppText( - DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,) - )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)), + // + // )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)), + " ${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${patientInfo.startTime}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, ):SizedBox() @@ -355,96 +356,7 @@ class PatientCard extends StatelessWidget { fontWeight: FontWeight.w700), ], ), - // Container( - // child: Row( - // crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // Expanded( - // child: AppText( - // TranslationBase.of(context).noOfDays + - // " : ", - // fontSize: 14, - // ), - // ), - // AppText( - // patientInfo.days, - // color: Colors.white, - // fontSize: 1.5 * SizeConfig.textMultiplier, - // textAlign: TextAlign.center, - // fontWeight: FontWeight.bold, - // ), - // SizedBox( - // height: 0.5, - // ) - // ], - // ), - // margin: EdgeInsets.only( - // top: 8, - // ), - // ), - //if (SERVICES_PATIANT2[int.parse(patientType)] == - // "List_MyOutPatient") - // Container( - // child: Row( - // crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // AppText( - // TranslationBase.of(context) - // .appointmentDate + - // " : ", - // fontSize: 14, - // ), - - // // Container( - // // child: - // patientInfo.appointmentDate != null - // ? AppText( - // DateUtils - // .convertDateFromServerFormat( - // patientInfo.appointmentDate - // .toString(), - // 'yyyy-MM-dd'), - // fontSize: 12, - // fontWeight: FontWeight.bold, - // ) - // : SizedBox(), - // //), - // patientInfo.startTimes != null - // ? - // // - // // Container( - // // // height: 15, - // // // width: 60, - // // padding: EdgeInsets.all(5), - // // decoration: BoxDecoration( - // // borderRadius: - // // BorderRadius.circular(25), - // // color: HexColor("#20A169"), - // // ), - // // child: - // AppText( - // ' ' + patientInfo.startTimes, - // fontSize: 11, - // fontWeight: FontWeight.bold, - // ) - // //) - // : SizedBox(), - // SizedBox( - // width: 3.5, - // ), - // //, - // SizedBox( - // height: 0.5, - // ) - // ], - // ), - // margin: EdgeInsets.only( - // top: 8, - // ), - //) ])) ]), !isInpatient && !isFromSearch diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index a9db021f..66d33fe7 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -21,6 +21,7 @@ class PatientProfileButton extends StatelessWidget { final bool isLoading; final Function onTap; final bool isDischargedPatient; + final bool isSelectInpatient; PatientProfileButton( {Key key, this.patient, @@ -35,7 +36,7 @@ class PatientProfileButton extends StatelessWidget { this.isLoading = false, this.from, this.to, - this.isInPatient = false, this.isDischargedPatient=false, + this.isInPatient = false, this.isDischargedPatient=false, this.isSelectInpatient = false, }) : super(key: key); @@ -133,6 +134,7 @@ class PatientProfileButton extends StatelessWidget { 'arrivalType': arrivalType, 'isInpatient': isInPatient, 'isDischargedPatient': isDischargedPatient, + 'isSelectInpatient': isSelectInpatient, }); } } diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 5faa82a4..ddbeb379 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -39,7 +39,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - height: height == 0 ? isInpatient? 210:200 : height, + height: height == 0 ? isInpatient? 220:200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), @@ -60,7 +60,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget " " + Helpers.capitalize(patient.lastName)) : Helpers.capitalize(patient.patientDetails.fullName), - fontSize: SizeConfig.textMultiplier * 2.2, + fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', ), From d37051ebe0c7ea75606b70a006b114b65b6cf87c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 16:48:55 +0300 Subject: [PATCH 44/50] fix button --- .../profile/patient_profile_screen.dart | 1177 +++++++++-------- 1 file changed, 592 insertions(+), 585 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index ba51c621..c8411b2c 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -88,13 +88,602 @@ class _PatientProfileScreenState extends Statewith SingleT children: [ Stack( children: [ - PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient, height: (patient.patientStatusType != null && patient.patientStatusType == 43)?250:0,), + Column( + children: [ + PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient, height: (patient.patientStatusType != null && patient.patientStatusType == 43)?250:0,), + Container( + child: isFromSearch ?Column( + children: [ + + tabsBar(context,screenSize), + SizedBox(height: 10,), + if(_activeTab==0) + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient: _activeTab==0, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + isInPatient: isInpatient, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + isDisable: isDischargedPatient|| isFromSearch, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ), + if(_activeTab==1) + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + + ], + ), + ), + ], + ):isInpatient? + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient :true, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + isInPatient: isInpatient, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + isDisable: isDischargedPatient|| isFromSearch, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ): + Column( + children: [ + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient: false, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + + ], + ), + ), + ], + ), + ), + ], + ), + if (patient.patientStatusType != null && patient.patientStatusType == 43) BaseView( onModelReady: (model) async {}, builder: (_, model, w) => Positioned( - top: 175, + top: 210, left: 20, right: 20, child: Row( @@ -173,592 +762,10 @@ class _PatientProfileScreenState extends Statewith SingleT ], ), )), + ], ), - Container( - child: isFromSearch ?Column( - children: [ - - tabsBar(context,screenSize), - SizedBox(height: 10,), - if(_activeTab==0) - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( - - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: _activeTab==0, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: "Medical", //Health - isInPatient: isInpatient, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - isDisable: isDischargedPatient|| isFromSearch, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - ], - ), - ), - if(_activeTab==1) - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - - ], - ), - ), - ], - ):isInpatient? - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient :true, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isInPatient: isInpatient, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: "Medical", //Health - isInPatient: isInpatient, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - isDisable: isDischargedPatient|| isFromSearch, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - ], - ), - ): - Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: false, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - - ], - ), - ), - ], - ), - ), ], ), ), From b6d1c698e2abcc978ae738ba1baeebed2ba29031 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 17:05:04 +0300 Subject: [PATCH 45/50] fix --- lib/screens/patients/profile/patient_profile_screen.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index c8411b2c..b2997bc4 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -90,7 +90,7 @@ class _PatientProfileScreenState extends Statewith SingleT children: [ Column( children: [ - PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient, height: (patient.patientStatusType != null && patient.patientStatusType == 43)?250:0,), + PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient, height: (patient.patientStatusType != null && patient.patientStatusType == 43)?265:0,), Container( child: isFromSearch ?Column( children: [ From acb1bdbb37b6543df3c591ff79fae4a211cb9a3c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 17:10:10 +0300 Subject: [PATCH 46/50] fix --- .../profile/patient_profile_screen.dart | 43 ++++++++++++------- ...ent-profile-header-new-design-app-bar.dart | 2 +- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index b2997bc4..2082fefc 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -7,14 +7,13 @@ 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/PatientProfileButton.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design_in_patient.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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; import 'package:flutter/material.dart'; + import '../../../routes.dart'; @@ -90,18 +89,32 @@ class _PatientProfileScreenState extends Statewith SingleT children: [ Column( children: [ - PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient, height: (patient.patientStatusType != null && patient.patientStatusType == 43)?265:0,), - Container( - child: isFromSearch ?Column( - children: [ - - tabsBar(context,screenSize), - SizedBox(height: 10,), - if(_activeTab==0) - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, + PatientProfileHeaderNewDesignAppBar( + patient, + arrivalType ?? '0', + patientType, + isInpatient: isInpatient, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : 0, + ), + Container( + child: isFromSearch + ? Column( + children: [ + tabsBar(context, screenSize), + SizedBox( + height: 10, + ), + if (_activeTab == 0) + Padding( + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, physics: NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, @@ -683,7 +696,7 @@ class _PatientProfileScreenState extends Statewith SingleT BaseView( onModelReady: (model) async {}, builder: (_, model, w) => Positioned( - top: 210, + top: 180, left: 20, right: 20, child: Row( diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index ddbeb379..48ebe348 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -39,7 +39,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - height: height == 0 ? isInpatient? 220:200 : height, + height: height == 0 ? isInpatient? 235:200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), From 72bf5d233762322faf18ba4d9a02a7c1b57ffd7e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 17:27:22 +0300 Subject: [PATCH 47/50] fix scrolling in patient screen --- .../profile/patient_profile_screen.dart | 1087 +++++++++-------- ...ent-profile-header-new-design-app-bar.dart | 2 +- 2 files changed, 548 insertions(+), 541 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 2082fefc..c5a2fcb1 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -81,40 +81,331 @@ class _PatientProfileScreenState extends Statewith SingleT appBarTitle: TranslationBase.of(context).patientProfile, isShowAppBar: false,//TODO fix button location // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), - body: SingleChildScrollView( - child: Container( - child: Column( - children: [ - Stack( - children: [ - Column( - children: [ - PatientProfileHeaderNewDesignAppBar( - patient, - arrivalType ?? '0', - patientType, - isInpatient: isInpatient, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 210 - : 0, - ), - Container( - child: isFromSearch - ? Column( - children: [ - tabsBar(context, screenSize), - SizedBox( - height: 10, + body: Container( + child: Column( + children: [ + Stack( + children: [ + Column( + children: [ + PatientProfileHeaderNewDesignAppBar( + patient, + arrivalType ?? '0', + patientType, + isInpatient: isInpatient, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : 0, + ), + SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height *0.65, + child: ListView( + children: [ + Container( + child: isFromSearch + ? Column( + children: [ + tabsBar(context, screenSize), + SizedBox( + height: 10, + ), + if (_activeTab == 0) + Padding( + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient: _activeTab==0, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + isInPatient: isInpatient, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + isDisable: isDischargedPatient|| isFromSearch, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ), + if(_activeTab==1) + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + + ], ), - if (_activeTab == 0) - Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, + ), + ], + ):isInpatient? + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, physics: NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, @@ -142,7 +433,6 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: TranslationBase.of(context).result, icon: 'patient/lab_results.png'), PatientProfileButton( - patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -153,11 +443,11 @@ class _PatientProfileScreenState extends Statewith SingleT icon: 'patient/health_summary.png'), PatientProfileButton( patient: patient, + isInPatient: isInpatient, patientType: patientType, arrivalType: arrivalType, route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: _activeTab==0, - isInPatient: isInpatient, + isSelectInpatient :true, nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).prescription, icon: 'patient/order_prescription.png'), @@ -166,12 +456,14 @@ class _PatientProfileScreenState extends Statewith SingleT patientType: patientType, arrivalType: arrivalType, route: PROGRESS_NOTE, + isInPatient: isInpatient, isDischargedPatient: isDischargedPatient, nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, icon: 'patient/Progress_notes.png'), PatientProfileButton( patient: patient, + isInPatient: isInpatient, patientType: patientType, arrivalType: arrivalType, route: ORDER_NOTE, @@ -221,7 +513,6 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine2: TranslationBase.of(context).patient, icon: 'patient/refer_patient.png'), PatientProfileButton( - isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -250,462 +541,221 @@ class _PatientProfileScreenState extends Statewith SingleT icon: 'patient/patient_sick_leave.png'), ], ), - ), - if(_activeTab==1) - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - - ], - ), - ), - ], - ):isInpatient? - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient :true, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isInPatient: isInpatient, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - isInPatient: isInpatient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: "Medical", //Health - isInPatient: isInpatient, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - isDisable: isDischargedPatient|| isFromSearch, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - ], - ), - ): - Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, + ): + Column( children: [ - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: false, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient: false, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + ], + ), + ), ], - ), + ), + ), + ], ), - ], + ), ), - ), - ], - ), + ], + ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) - BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => Positioned( - top: 180, - left: 20, - right: 20, - child: Row( - children: [ - Expanded(child: Container()), - if (patient.episodeNo == 0) - AppButton( + if (patient.patientStatusType != null && + patient.patientStatusType == 43) + BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => Positioned( + top: 180, + left: 20, + right: 20, + child: Row( + children: [ + Expanded(child: Container()), + if (patient.episodeNo == 0) + AppButton( + title: + "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + color: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/create-episod.png", + color: Colors.white, + height: 30, + ), + onPressed: () async { + if (patient.patientStatusType == 43) { + PostEpisodeReqModel + postEpisodeReqModel = + PostEpisodeReqModel( + appointmentNo: + patient.appointmentNo, + patientMRN: + patient.patientMRN); + GifLoaderDialogUtils.showMyDialog( + context); + await model.postEpisode( + postEpisodeReqModel); + GifLoaderDialogUtils.hideDialog( + context); + patient.episodeNo = model.episodeID; + Navigator.of(context).pushNamed( + CREATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }, + ), + if (patient.episodeNo != 0) + AppButton( title: - "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", color: patient.patientStatusType == 43 ? Colors.red.shade700 : Colors.grey.shade700, @@ -716,71 +766,28 @@ class _PatientProfileScreenState extends Statewith SingleT fontWeight: FontWeight.normal, fontSize: 1.6, icon: Image.asset( - "assets/images/create-episod.png", + "assets/images/modilfy-episode.png", color: Colors.white, height: 30, ), - onPressed: () async { - if (patient.patientStatusType == 43) { - PostEpisodeReqModel - postEpisodeReqModel = - PostEpisodeReqModel( - appointmentNo: - patient.appointmentNo, - patientMRN: - patient.patientMRN); - GifLoaderDialogUtils.showMyDialog( - context); - await model.postEpisode( - postEpisodeReqModel); - GifLoaderDialogUtils.hideDialog( - context); - patient.episodeNo = model.episodeID; + onPressed: () { + if (patient.patientStatusType == + 43) { Navigator.of(context).pushNamed( - CREATE_EPISODE, + UPDATE_EPISODE, arguments: { 'patient': patient }); } - }, - ), - if (patient.episodeNo != 0) - AppButton( - title: - "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/modilfy-episode.png", - color: Colors.white, - height: 30, - ), - onPressed: () { - if (patient.patientStatusType == - 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }), - ], - ), - )), + }), + ], + ), + )), - ], - ), + ], + ), - ], - ), + ], ), ), )); diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 48ebe348..f07ad8a4 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -39,7 +39,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - height: height == 0 ? isInpatient? 235:200 : height, + height: height == 0 ? isInpatient? 210:200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), From cfe3056f173b338cb1b76c1af189895a00f7137b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 17:50:43 +0300 Subject: [PATCH 48/50] fix scrolling step 2 --- .../profile/patient_profile_screen.dart | 1213 ++++++++--------- 1 file changed, 605 insertions(+), 608 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index c5a2fcb1..6d7a7845 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -81,328 +81,469 @@ class _PatientProfileScreenState extends Statewith SingleT appBarTitle: TranslationBase.of(context).patientProfile, isShowAppBar: false,//TODO fix button location // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), - body: Container( - child: Column( - children: [ - Stack( - children: [ - Column( - children: [ - PatientProfileHeaderNewDesignAppBar( - patient, - arrivalType ?? '0', - patientType, - isInpatient: isInpatient, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 210 - : 0, - ), - SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height *0.65, - child: ListView( - children: [ - Container( - child: isFromSearch - ? Column( - children: [ - tabsBar(context, screenSize), - SizedBox( - height: 10, - ), - if (_activeTab == 0) - Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( + body: Column( + children: [ + Stack( + children: [ + Column( + children: [ + PatientProfileHeaderNewDesignAppBar( + patient, + arrivalType ?? '0', + patientType, + isInpatient: isInpatient, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : 0, + ), + Container( + height: MediaQuery.of(context).size.height *0.69, + + child: ListView( + children: [ + Container( + child: isFromSearch + ? Column( + children: [ + tabsBar(context, screenSize), + SizedBox( + height: 10, + ), + if (_activeTab == 0) + Padding( + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: _activeTab==0, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: "Medical", //Health - isInPatient: isInpatient, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - isDisable: isDischargedPatient|| isFromSearch, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - ], - ), - ), - if(_activeTab==1) - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient: _activeTab==0, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + isInPatient: isInpatient, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + isDisable: isDischargedPatient|| isFromSearch, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ), + if(_activeTab==1) + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), - ], - ), - ), - ], - ):isInpatient? - Padding( + ], + ), + ), + ], + ):isInpatient? + Padding( + padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + isInPatient: true, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: LAB_RESULT, + isInPatient: true, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/lab_results.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInPatient: isInpatient, + route: RADIOLOGY_PATIENT, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).result, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient :true, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PROGRESS_NOTE, + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + isInPatient: isInpatient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_NOTE, + isDischargedPatient: isDischargedPatient, + nameLine1: "Order", //"Text", + nameLine2: + "Sheet", //TranslationBase.of(context).orders, + icon: 'patient/Progress_notes.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ORDER_PROCEDURE, + isInPatient: isInpatient, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'patient/Order_Procedures.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: "Health", + isInPatient: isInpatient, + nameLine2: "Summary", + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: MEDICAL_FILE, + nameLine1: "Medical", //Health + isInPatient: isInpatient, + nameLine2: "Report", //Report + //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_IN_PATIENT_TO_DOCTOR, + isInPatient: true, + isDisable: isDischargedPatient|| isFromSearch, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).approvals, + icon: 'patient/vital_signs.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isDisable: true, + route: null, + nameLine1: "Discharge", + nameLine2: "Summery", + icon: 'patient/patient_sick_leave.png'), + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'patient/patient_sick_leave.png'), + ], + ), + ): + Column( + children: [ + Padding( padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), child: GridView.count( shrinkWrap: true, @@ -413,6 +554,7 @@ class _PatientProfileScreenState extends Statewith SingleT crossAxisCount: 3, children: [ PatientProfileButton( + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -421,57 +563,59 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, route: VITAL_SIGN_DETAILS, - isInPatient: true, icon: 'patient/vital_signs.png'), + // if (selectedPatientType != 7) PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: MEDICAL_FILE, + nameLine1: + "Health", //TranslationBase.of(context).medicalReport, + nameLine2: + "Summary", //TranslationBase.of(context).summaryReport, + icon: 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, route: LAB_RESULT, - isInPatient: true, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, icon: 'patient/lab_results.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( + patient: patient, patientType: patientType, arrivalType: arrivalType, isInPatient: isInpatient, route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, + nameLine2: TranslationBase.of(context).service, icon: 'patient/health_summary.png'), PatientProfileButton( - patient: patient, isInPatient: isInpatient, + patient: patient, patientType: patientType, arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient :true, + route: PATIENT_ECG, nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), + nameLine2: "ECG", + icon: 'patient/patient_sick_leave.png'), PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, isInPatient: isInpatient, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( patient: patient, - isInPatient: isInpatient, patientType: patientType, arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), + route: ORDER_PRESCRIPTION_NEW, + isSelectInpatient: false, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( patient: patient, patientType: patientType, @@ -481,55 +625,17 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, icon: 'patient/Order_Procedures.png'), + //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: "Medical", //Health isInPatient: isInpatient, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - isDisable: isDischargedPatient|| isFromSearch, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, + nameLine2: TranslationBase.of(context).service, icon: 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( isInPatient: isInpatient, patient: patient, @@ -539,181 +645,115 @@ class _PatientProfileScreenState extends Statewith SingleT nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, icon: 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_UCAF_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'patient/ucaf.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: REFER_PATIENT_TO_DOCTOR, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).referral, + nameLine2: TranslationBase.of(context).patient, + icon: 'patient/refer_patient.png'), + if (patient.appointmentNo != null && + patient.appointmentNo != 0) + PatientProfileButton( + isInPatient: isInpatient, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + route: PATIENT_ADMISSION_REQUEST, + isDisable: + patient.patientStatusType != 43 ? true : false, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'patient/admission_req.png'), + ], ), - ): - Column( - children: [ - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, - nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: false, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) - PatientProfileButton( - isInPatient: isInpatient, - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - - ], - ), - ), - ], - ), + ), + ], ), - ], - ), - ), + ), + ], ), - ], - ), + ), + ], + ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) - BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => Positioned( - top: 180, - left: 20, - right: 20, - child: Row( - children: [ - Expanded(child: Container()), - if (patient.episodeNo == 0) - AppButton( + if (patient.patientStatusType != null && + patient.patientStatusType == 43) + BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => Positioned( + top: 180, + left: 20, + right: 20, + child: Row( + children: [ + Expanded(child: Container()), + if (patient.episodeNo == 0) + AppButton( + title: + "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + color: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/create-episod.png", + color: Colors.white, + height: 30, + ), + onPressed: () async { + if (patient.patientStatusType == 43) { + PostEpisodeReqModel + postEpisodeReqModel = + PostEpisodeReqModel( + appointmentNo: + patient.appointmentNo, + patientMRN: + patient.patientMRN); + GifLoaderDialogUtils.showMyDialog( + context); + await model.postEpisode( + postEpisodeReqModel); + GifLoaderDialogUtils.hideDialog( + context); + patient.episodeNo = model.episodeID; + Navigator.of(context).pushNamed( + CREATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }, + ), + if (patient.episodeNo != 0) + AppButton( title: - "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", color: patient.patientStatusType == 43 ? Colors.red.shade700 : Colors.grey.shade700, @@ -724,71 +764,28 @@ class _PatientProfileScreenState extends Statewith SingleT fontWeight: FontWeight.normal, fontSize: 1.6, icon: Image.asset( - "assets/images/create-episod.png", + "assets/images/modilfy-episode.png", color: Colors.white, height: 30, ), - onPressed: () async { - if (patient.patientStatusType == 43) { - PostEpisodeReqModel - postEpisodeReqModel = - PostEpisodeReqModel( - appointmentNo: - patient.appointmentNo, - patientMRN: - patient.patientMRN); - GifLoaderDialogUtils.showMyDialog( - context); - await model.postEpisode( - postEpisodeReqModel); - GifLoaderDialogUtils.hideDialog( - context); - patient.episodeNo = model.episodeID; + onPressed: () { + if (patient.patientStatusType == + 43) { Navigator.of(context).pushNamed( - CREATE_EPISODE, + UPDATE_EPISODE, arguments: { 'patient': patient }); } - }, - ), - if (patient.episodeNo != 0) - AppButton( - title: - "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/modilfy-episode.png", - color: Colors.white, - height: 30, - ), - onPressed: () { - if (patient.patientStatusType == - 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }), - ], - ), - )), + }), + ], + ), + )), - ], - ), + ], + ), - ], - ), + ], ), )); } From bfd36b1c77321a2f594c4816f720b27db0e9050b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 27 Apr 2021 19:04:39 +0300 Subject: [PATCH 49/50] fix scrolling step 3 --- .../profile/patient_profile_screen.dart | 1469 ++++++++++++----- 1 file changed, 1019 insertions(+), 450 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 6d7a7845..3c2fab57 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -16,13 +16,13 @@ import 'package:flutter/material.dart'; import '../../../routes.dart'; - class PatientProfileScreen extends StatefulWidget { @override _PatientProfileScreenState createState() => _PatientProfileScreenState(); } -class _PatientProfileScreenState extends Statewith SingleTickerProviderStateMixin { +class _PatientProfileScreenState extends State + with SingleTickerProviderStateMixin { PatiantInformtion patient; bool isFromSearch = false; @@ -39,9 +39,10 @@ class _PatientProfileScreenState extends Statewith SingleT int _activeTab = 0; @override void initState() { - _tabController = TabController(length: 2,vsync:this); + _tabController = TabController(length: 2, vsync: this); super.initState(); } + @override void dispose() { _tabController.dispose(); @@ -52,11 +53,11 @@ class _PatientProfileScreenState extends Statewith SingleT void didChangeDependencies() { super.didChangeDependencies(); final routeArgs = ModalRoute.of(context).settings.arguments as Map; - patient = routeArgs['patient']; - patientType = routeArgs['patientType']; - arrivalType = routeArgs['arrivalType']; - from = routeArgs['from']; - to = routeArgs['to']; + patient = routeArgs['patient']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + from = routeArgs['from']; + to = routeArgs['to']; if (routeArgs.containsKey("isSearch")) { isFromSearch = routeArgs['isSearch']; } @@ -66,7 +67,7 @@ class _PatientProfileScreenState extends Statewith SingleT if (routeArgs.containsKey("isDischargedPatient")) { isDischargedPatient = routeArgs['isDischargedPatient']; } - if(isInpatient) + if (isInpatient) _activeTab = 0; else _activeTab = 1; @@ -78,47 +79,55 @@ class _PatientProfileScreenState extends Statewith SingleT return BaseView( builder: (_, patientViewModel, w) => AppScaffold( baseViewModel: patientViewModel, - appBarTitle: TranslationBase.of(context).patientProfile, - isShowAppBar: false,//TODO fix button location - // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), + appBarTitle: TranslationBase + .of(context) + .patientProfile, + isShowAppBar: false, + //TODO fix button location + // appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType,isInpatient: isInpatient,), body: Column( children: [ Stack( children: [ Column( children: [ - PatientProfileHeaderNewDesignAppBar( - patient, - arrivalType ?? '0', - patientType, - isInpatient: isInpatient, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 210 - : 0, - ), - Container( - height: MediaQuery.of(context).size.height *0.69, + PatientProfileHeaderNewDesignAppBar( + patient, + arrivalType ?? '0', + patientType, + isInpatient: isInpatient, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : 0, + ), + if(isFromSearch) + tabsBar(context, screenSize), + Container( + height: isFromSearch ? MediaQuery + .of(context) + .size + .height * 0.60 : MediaQuery + .of(context) + .size + .height * 0.69, + child: ListView( + children: [ + Container( + child: isFromSearch + ? Column( + children: [ - child: ListView( - children: [ - Container( - child: isFromSearch - ? Column( - children: [ - tabsBar(context, screenSize), - SizedBox( - height: 10, - ), - if (_activeTab == 0) - Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), + if (_activeTab == 0) + Padding( + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), + child: GridView.count( + shrinkWrap: true, + physics: + NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, childAspectRatio: 1 / 1.0, @@ -126,286 +135,584 @@ class _PatientProfileScreenState extends Statewith SingleT children: [ PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, from: from, to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, + route: + VITAL_SIGN_DETAILS, isInPatient: true, - icon: 'patient/vital_signs.png'), + icon: + 'patient/vital_signs.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: LAB_RESULT, isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), + patientType: + patientType, + arrivalType: + arrivalType, + isInPatient: + isInpatient, + route: + RADIOLOGY_PATIENT, + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/health_summary.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: _activeTab==0, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + isSelectInpatient: + _activeTab == 0, + isInPatient: + isInpatient, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: PROGRESS_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), + isDischargedPatient: + isDischargedPatient, + nameLine1: + TranslationBase + .of( + context) + .progress, + nameLine2: + TranslationBase + .of( + context) + .note, + icon: + 'patient/Progress_notes.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", + isDischargedPatient: + isDischargedPatient, + nameLine1: + "Order", + //"Text", nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), + "Sheet", + //TranslationBase.of(context).orders, + icon: + 'patient/Progress_notes.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), + isInPatient: + isInpatient, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: MEDICAL_FILE, nameLine1: "Health", - isInPatient: isInpatient, + isInPatient: + isInpatient, nameLine2: "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + icon: + 'patient/health_summary.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, isDisable: true, route: MEDICAL_FILE, - nameLine1: "Medical", //Health - isInPatient: isInpatient, - nameLine2: "Report", //Report + nameLine1: + "Medical", + //Health + isInPatient: + isInpatient, + nameLine2: + "Report", + //Report //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + icon: + 'patient/health_summary.png'), PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, + patientType: + patientType, + arrivalType: + arrivalType, + route: + REFER_IN_PATIENT_TO_DOCTOR, isInPatient: true, - isDisable: isDischargedPatient|| isFromSearch, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), + isDisable: + isDischargedPatient || + isFromSearch, + nameLine1: + TranslationBase + .of( + context) + .referral, + nameLine2: + TranslationBase + .of( + context) + .patient, + icon: + 'patient/refer_patient.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .approvals, + icon: + 'patient/vital_signs.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, isDisable: true, route: null, nameLine1: "Discharge", nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), + icon: + 'patient/patient_sick_leave.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), ], ), ), - if(_activeTab==1) + if (_activeTab == 1) Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), child: GridView.count( shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), + physics: + NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, childAspectRatio: 1 / 1.0, crossAxisCount: 3, children: [ PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, from: from, to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, + route: + VITAL_SIGN_DETAILS, + icon: + 'patient/vital_signs.png'), // if (selectedPatientType != 7) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: MEDICAL_FILE, nameLine1: - "Health", //TranslationBase.of(context).medicalReport, + "Health", + //TranslationBase.of(context).medicalReport, nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), + patientType: + patientType, + arrivalType: + arrivalType, + isInPatient: + isInpatient, + route: + RADIOLOGY_PATIENT, + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/health_summary.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, + nameLine1: + TranslationBase + .of( + context) + .patient, nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), + icon: + 'patient/patient_sick_leave.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/vital_signs.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_UCAF_REQUEST, isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .ucaf, + icon: + 'patient/ucaf.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + patientType: + patientType, + arrivalType: + arrivalType, + route: + REFER_PATIENT_TO_DOCTOR, + isDisable: patient + .patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .referral, + nameLine2: + TranslationBase + .of( + context) + .patient, + icon: + 'patient/refer_patient.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_ADMISSION_REQUEST, + isDisable: patient + .patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .admission, + nameLine2: + TranslationBase + .of( + context) + .request, + icon: + 'patient/admission_req.png'), ], ), ), ], - ):isInpatient? - Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + ) + : isInpatient + ? Padding( + padding: + const EdgeInsets.symmetric( + vertical: 15.0, + horizontal: 15), child: GridView.count( shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), + physics: + NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, childAspectRatio: 1 / 1.0, @@ -417,69 +724,130 @@ class _PatientProfileScreenState extends Statewith SingleT arrivalType: arrivalType, from: from, to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, route: VITAL_SIGN_DETAILS, isInPatient: true, - icon: 'patient/vital_signs.png'), + icon: + 'patient/vital_signs.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: LAB_RESULT, isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, isInPatient: isInpatient, route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/health_summary.png'), PatientProfileButton( patient: patient, isInPatient: isInpatient, patientType: patientType, arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient :true, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), + route: + ORDER_PRESCRIPTION_NEW, + isSelectInpatient: true, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: PROGRESS_NOTE, isInPatient: isInpatient, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), + isDischargedPatient: + isDischargedPatient, + nameLine1: + TranslationBase + .of( + context) + .progress, + nameLine2: + TranslationBase + .of( + context) + .note, + icon: + 'patient/Progress_notes.png'), PatientProfileButton( patient: patient, isInPatient: isInpatient, patientType: patientType, arrivalType: arrivalType, route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", + isDischargedPatient: + isDischargedPatient, + nameLine1: + "Order", + //"Text", nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), + "Sheet", + //TranslationBase.of(context).orders, + icon: + 'patient/Progress_notes.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, route: ORDER_PROCEDURE, isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), PatientProfileButton( patient: patient, patientType: patientType, @@ -489,36 +857,64 @@ class _PatientProfileScreenState extends Statewith SingleT isInPatient: isInpatient, nameLine2: "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + icon: + 'patient/health_summary.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, isDisable: true, route: MEDICAL_FILE, - nameLine1: "Medical", //Health + nameLine1: + "Medical", + //Health isInPatient: isInpatient, - nameLine2: "Report", //Report + nameLine2: + "Report", + //Report //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + icon: + 'patient/health_summary.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, + route: + REFER_IN_PATIENT_TO_DOCTOR, isInPatient: true, - isDisable: isDischargedPatient|| isFromSearch, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), + isDisable: + isDischargedPatient || + isFromSearch, + nameLine1: + TranslationBase + .of( + context) + .referral, + nameLine2: + TranslationBase + .of( + context) + .patient, + icon: + 'patient/refer_patient.png'), PatientProfileButton( patient: patient, patientType: patientType, arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .approvals, + icon: + 'patient/vital_signs.png'), PatientProfileButton( isInPatient: isInpatient, patient: patient, @@ -528,271 +924,448 @@ class _PatientProfileScreenState extends Statewith SingleT route: null, nameLine1: "Discharge", nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), + icon: + 'patient/patient_sick_leave.png'), PatientProfileButton( isInPatient: isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), ], ), - ): - Column( + ) + : Column( children: [ Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), + padding: const EdgeInsets + .symmetric( + vertical: 15.0, + horizontal: 15), child: GridView.count( shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), + physics: + NeverScrollableScrollPhysics(), crossAxisSpacing: 10, mainAxisSpacing: 10, childAspectRatio: 1 / 1.0, crossAxisCount: 3, children: [ PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, from: from, to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'patient/vital_signs.png'), + nameLine1: + TranslationBase + .of( + context) + .vital, + nameLine2: + TranslationBase + .of( + context) + .signs, + route: + VITAL_SIGN_DETAILS, + icon: + 'patient/vital_signs.png'), // if (selectedPatientType != 7) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: MEDICAL_FILE, nameLine1: - "Health", //TranslationBase.of(context).medicalReport, + "Health", + //TranslationBase.of(context).medicalReport, nameLine2: - "Summary", //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), + "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: LAB_RESULT, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), + nameLine1: + TranslationBase + .of( + context) + .lab, + nameLine2: + TranslationBase + .of( + context) + .result, + icon: + 'patient/lab_results.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/health_summary.png'), + patientType: + patientType, + arrivalType: + arrivalType, + isInPatient: + isInpatient, + route: + RADIOLOGY_PATIENT, + nameLine1: + TranslationBase + .of( + context) + .radiology, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/health_summary.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: PATIENT_ECG, - nameLine1: TranslationBase.of(context).patient, + nameLine1: + TranslationBase + .of( + context) + .patient, nameLine2: "ECG", - icon: 'patient/patient_sick_leave.png'), + icon: + 'patient/patient_sick_leave.png'), PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: false, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PRESCRIPTION_NEW, + isSelectInpatient: + false, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .prescription, + icon: + 'patient/order_prescription.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - isInPatient: isInpatient, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + ORDER_PROCEDURE, + isInPatient: + isInpatient, + nameLine1: + TranslationBase + .of( + context) + .orders, + nameLine2: + TranslationBase + .of( + context) + .procedures, + icon: + 'patient/Order_Procedures.png'), //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'patient/vital_signs.png'), + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_INSURANCE_APPROVALS_NEW, + nameLine1: + TranslationBase + .of( + context) + .insurance, + nameLine2: + TranslationBase + .of( + context) + .service, + icon: + 'patient/vital_signs.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, + patientType: + patientType, + arrivalType: + arrivalType, route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + nameLine1: + TranslationBase + .of( + context) + .patientSick, + nameLine2: + TranslationBase + .of( + context) + .leave, + icon: + 'patient/patient_sick_leave.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_UCAF_REQUEST, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_UCAF_REQUEST, isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'patient/ucaf.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .patient, + nameLine2: + TranslationBase + .of( + context) + .ucaf, + icon: + 'patient/ucaf.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_PATIENT_TO_DOCTOR, - isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - if (patient.appointmentNo != null && - patient.appointmentNo != 0) + patientType: + patientType, + arrivalType: + arrivalType, + route: + REFER_PATIENT_TO_DOCTOR, + isDisable: patient + .patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .referral, + nameLine2: + TranslationBase + .of( + context) + .patient, + icon: + 'patient/refer_patient.png'), + if (patient.appointmentNo != + null && + patient.appointmentNo != + 0) PatientProfileButton( - isInPatient: isInpatient, + isInPatient: + isInpatient, patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_ADMISSION_REQUEST, + patientType: + patientType, + arrivalType: + arrivalType, + route: + PATIENT_ADMISSION_REQUEST, isDisable: - patient.patientStatusType != 43 ? true : false, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'patient/admission_req.png'), - + patient.patientStatusType != + 43 + ? true + : false, + nameLine1: + TranslationBase + .of( + context) + .admission, + nameLine2: + TranslationBase + .of( + context) + .request, + icon: + 'patient/admission_req.png'), ], ), ), ], + ), + ), + ], ), ), - ], - ), - ), ], ), - if (patient.patientStatusType != null && patient.patientStatusType == 43) BaseView( onModelReady: (model) async {}, - builder: (_, model, w) => Positioned( - top: 180, - left: 20, - right: 20, - child: Row( - children: [ - Expanded(child: Container()), - if (patient.episodeNo == 0) - AppButton( - title: - "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/create-episod.png", - color: Colors.white, - height: 30, - ), - onPressed: () async { - if (patient.patientStatusType == 43) { - PostEpisodeReqModel - postEpisodeReqModel = - PostEpisodeReqModel( - appointmentNo: - patient.appointmentNo, - patientMRN: - patient.patientMRN); - GifLoaderDialogUtils.showMyDialog( - context); - await model.postEpisode( - postEpisodeReqModel); - GifLoaderDialogUtils.hideDialog( - context); - patient.episodeNo = model.episodeID; - Navigator.of(context).pushNamed( - CREATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }, - ), - if (patient.episodeNo != 0) - AppButton( - title: - "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/modilfy-episode.png", - color: Colors.white, - height: 30, + builder: (_, model, w) => + Positioned( + top: 180, + left: 20, + right: 20, + child: Row( + children: [ + Expanded(child: Container()), + if (patient.episodeNo == 0) + AppButton( + title: + "${TranslationBase + .of(context) + .createNew}\n${TranslationBase + .of(context) + .episode}", + color: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/create-episod.png", + color: Colors.white, + height: 30, + ), + onPressed: () async { + if (patient.patientStatusType == + 43) { + PostEpisodeReqModel + postEpisodeReqModel = + PostEpisodeReqModel( + appointmentNo: + patient.appointmentNo, + patientMRN: + patient.patientMRN); + GifLoaderDialogUtils.showMyDialog( + context); + await model.postEpisode( + postEpisodeReqModel); + GifLoaderDialogUtils.hideDialog( + context); + patient.episodeNo = + model.episodeID; + Navigator.of(context).pushNamed( + CREATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }, ), - onPressed: () { - if (patient.patientStatusType == - 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: { - 'patient': patient - }); - } - }), - ], - ), - )), - + if (patient.episodeNo != 0) + AppButton( + title: + "${TranslationBase + .of(context) + .update}\n${TranslationBase + .of(context) + .episode}", + color: + patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/modilfy-episode.png", + color: Colors.white, + height: 30, + ), + onPressed: () { + if (patient.patientStatusType == + 43) { + Navigator.of(context).pushNamed( + UPDATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }), + ], + ), + )), ], ), - ], ), )); } - - Widget tabsBar( - BuildContext context, Size screenSize ) { + Widget tabsBar(BuildContext context, Size screenSize) { List _tabs = [ "Inpatient Info".toUpperCase(), "Outpatient Info".toUpperCase(), @@ -815,7 +1388,6 @@ class _PatientProfileScreenState extends Statewith SingleT setState(() { _activeTab = _tabs.indexOf(item); }); - }, child: Center( child: Container( @@ -843,7 +1415,6 @@ class _PatientProfileScreenState extends Statewith SingleT ), ); } - } class AvatarWidget extends StatelessWidget { @@ -868,5 +1439,3 @@ class AvatarWidget extends StatelessWidget { ); } } - - From 1dd668ed70cf7ace27f02f0e55fba4f462d50d58 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 28 Apr 2021 00:03:31 +0300 Subject: [PATCH 50/50] hot fixes --- .../service/DischargedPatientService.dart | 2 +- lib/core/service/base/base_service.dart | 12 +- lib/core/service/labs_service.dart | 4 +- lib/core/service/sickleave_service.dart | 20 +- lib/core/viewModel/procedure_View_model.dart | 48 +-- .../patients/DischargedPatientPage.dart | 1 + .../ReferralDischargedPatientDetails.dart | 1 + .../patient_search_screen_new.dart | 83 ++-- .../patient_search/patients_screen_new.dart | 9 +- .../profile/lab_result/labs_home_page.dart | 142 +++---- .../profile/patient_profile_screen.dart | 386 +++--------------- .../assessment/update_assessment_page.dart | 108 ++--- .../objective/update_objective_page.dart | 96 ++--- .../soap_update/plan/update_plan_page.dart | 108 ++--- .../subjective/update_subjective_page.dart | 9 +- lib/util/date-utils.dart | 12 + lib/widgets/patients/PatientCard.dart | 4 +- ...ent-profile-header-new-design-app-bar.dart | 2 +- lib/widgets/shared/app_scaffold_widget.dart | 12 +- 19 files changed, 391 insertions(+), 668 deletions(-) diff --git a/lib/core/service/DischargedPatientService.dart b/lib/core/service/DischargedPatientService.dart index 63d3f0de..2d43afc6 100644 --- a/lib/core/service/DischargedPatientService.dart +++ b/lib/core/service/DischargedPatientService.dart @@ -11,7 +11,7 @@ class DischargedPatientService extends BaseService { Future getDischargedPatient() async { hasError = false; Map body = Map(); - await getDoctorProfile(); + await getDoctorProfile(isGetProfile: true); body['DoctorID'] = doctorProfile.doctorID; body['FirstName'] = "0"; body['MiddleName'] = "0"; diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index 42e2cc6d..09ee7c49 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -15,7 +15,17 @@ class BaseService { List patientArrivalList = []; //TODO add the user login model when we need it - Future getDoctorProfile() async { + Future getDoctorProfile({bool isGetProfile = false}) async { + if(isGetProfile) + { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; + } + } + } if (doctorProfile == null) { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { diff --git a/lib/core/service/labs_service.dart b/lib/core/service/labs_service.dart index aba5330e..8af2121f 100644 --- a/lib/core/service/labs_service.dart +++ b/lib/core/service/labs_service.dart @@ -25,7 +25,8 @@ class LabsService extends BaseService { body['isDentalAllowedBackend'] = false; url = GET_Patient_LAB_ORDERS; } - + patientLabOrdersList=[]; + patientLabOrdersList.clear(); await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabOrdersList=[]; @@ -33,6 +34,7 @@ class LabsService extends BaseService { response['ListPLO'].forEach((hospital) { patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); }); + var asd=""; } else { response['List_GetLabOreders'].forEach((hospital) { patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index 90785a7b..1bfb8df8 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -17,7 +17,7 @@ class SickLeaveService extends BaseService { List get getReasons => reasonse; List reasonse = []; List get getAllSickLeave => _getAllsickLeave; - List _getAllsickLeave = []; + List _getAllsickLeave = List(); List get coveringDoctorsList => _coveringDoctors; List _coveringDoctors = []; @@ -31,9 +31,8 @@ class SickLeaveService extends BaseService { dynamic get sickLeaveResponse => _sickLeaveResponse; dynamic _sickLeaveResponse; - List get getAllSickLeavePatient => - _getAllsickLeavePatient; - List _getAllsickLeavePatient = []; + + List getAllSickLeavePatient = List(); SickLeavePatientRequestModel _sickLeavePatientRequestModel = SickLeavePatientRequestModel(); @@ -98,13 +97,14 @@ class SickLeaveService extends BaseService { Future getSickLeave(patientMRN) async { hasError = false; + getAllSickLeavePatient = []; await baseAppClient.postPatient( GET_SICK_LEAVE, onSuccess: (dynamic response, int statusCode) { - Future.value(response); - _getAllsickLeavePatient.clear(); + // Future.value(response); + getAllSickLeavePatient=[]; response['List_SickLeave'].forEach((v) { - _getAllsickLeavePatient.add(SickLeavePatientModel.fromJson(v)); + getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v)); }); }, onFailure: (String error, int statusCode) { @@ -119,13 +119,15 @@ class SickLeaveService extends BaseService { _sickLeavePatientRequestModel = SickLeavePatientRequestModel( patientID: patientMRN, patientTypeID: 2, patientType: 1); hasError = false; + getAllSickLeavePatient =[]; + getAllSickLeavePatient.clear(); await baseAppClient.postPatient( GET_SICK_LEAVE_PATIENT, onSuccess: (dynamic response, int statusCode) { Future.value(response); - _getAllsickLeavePatient.clear(); + getAllSickLeavePatient.clear(); response['List_SickLeave'].forEach((v) { - _getAllsickLeavePatient.add(SickLeavePatientModel.fromJson(v)); + getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v)); }); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 4ee569ce..8717c84b 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -43,16 +43,15 @@ class ProcedureViewModel extends BaseViewModel { List get radiologyList => _radiologyService.finalRadiologyList; + List get patientLabOrdersList => _labsService.patientLabOrdersList; + List get labOrdersResultsList => _labsService.labOrdersResultsList; List _patientLabOrdersListClinic = List(); List _patientLabOrdersListHospital = List(); - List get patientLabOrdersList => - filterType == FilterType.Clinic - ? _patientLabOrdersListClinic - : _patientLabOrdersListHospital; + Future getProcedure({int mrn,String patientType}) async { hasError = false; @@ -222,6 +221,8 @@ class ProcedureViewModel extends BaseViewModel { List labResultLists = List(); + + List get labResultListsCoustom { return labResultLists; } @@ -233,45 +234,6 @@ class ProcedureViewModel extends BaseViewModel { error = _labsService.error; setState(ViewState.Error); } else { - _labsService.patientLabOrdersList.forEach((element) { - List patientLabOrdersClinic = - _patientLabOrdersListClinic - .where((elementClinic) => - elementClinic.filterName == element.clinicDescription) - .toList(); - - if (patientLabOrdersClinic.length != 0) { - _patientLabOrdersListClinic[_patientLabOrdersListClinic - .indexOf(patientLabOrdersClinic[0])] - .patientLabOrdersList - .add(element); - } else { - _patientLabOrdersListClinic.add(PatientLabOrdersList( - filterName: element.clinicDescription, - patientDoctorAppointment: element)); - } - - // doctor list sort via project - List patientLabOrdersHospital = - _patientLabOrdersListHospital - .where( - (elementClinic) => - elementClinic.filterName == element.projectName, - ) - .toList(); - - if (patientLabOrdersHospital.length != 0) { - _patientLabOrdersListHospital[_patientLabOrdersListHospital - .indexOf(patientLabOrdersHospital[0])] - .patientLabOrdersList - .add(element); - } else { - _patientLabOrdersListHospital.add(PatientLabOrdersList( - filterName: element.projectName, - patientDoctorAppointment: element)); - } - }); - setState(ViewState.Idle); } } diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 793ae8bb..28f7b834 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -27,6 +27,7 @@ class _DischargedPatientState extends State { onModelReady: (model) => model.getDischargedPatient(), builder: (_, model, w) => AppScaffold( appBarTitle: 'Discharged Patient', + subtitle: "Last Three Months", backgroundColor: Colors.grey[200], isShowAppBar: true, baseViewModel: model, diff --git a/lib/screens/patients/ReferralDischargedPatientDetails.dart b/lib/screens/patients/ReferralDischargedPatientDetails.dart index e16a1d8e..0b664d4b 100644 --- a/lib/screens/patients/ReferralDischargedPatientDetails.dart +++ b/lib/screens/patients/ReferralDischargedPatientDetails.dart @@ -75,6 +75,7 @@ class ReferralDischargedPatientDetails extends StatelessWidget { "patientType": "1", "isInpatient": true, "arrivalType": "1", + "isDischargedPatient":true, "from": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), "to": DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), }); diff --git a/lib/screens/patients/patient_search/patient_search_screen_new.dart b/lib/screens/patients/patient_search/patient_search_screen_new.dart index 5972ee6f..c17c173a 100644 --- a/lib/screens/patients/patient_search/patient_search_screen_new.dart +++ b/lib/screens/patients/patient_search/patient_search_screen_new.dart @@ -55,46 +55,46 @@ class _PatientSearchScreenNewState extends State { SizedBox( height: 16, ), - AppText( - 'Patient Type', - fontWeight: FontWeight.w600, - ), - Row( - children: [ - Row( - children: [ - Radio( - activeColor: Color(0xFFB9382C), - value: PatientType.inPatient, - groupValue: selectedPatientType, - onChanged: (value) { - setState(() { - selectedPatientType = - PatientType.inPatient; - }); - }, - ), - Text('InPatient'), - ], - ), - Row( - children: [ - Radio( - activeColor: Color(0xFFB9382C), - value: PatientType.OutPatient, - groupValue: selectedPatientType, - onChanged: (value) { - setState(() { - selectedPatientType = - PatientType.OutPatient; - }); - }, - ), - Text('OutPatient'), - ], - ), - ], - ), + // AppText( + // 'Patient Type', + // fontWeight: FontWeight.w600, + // ), + // Row( + // children: [ + // Row( + // children: [ + // Radio( + // activeColor: Color(0xFFB9382C), + // value: PatientType.inPatient, + // groupValue: selectedPatientType, + // onChanged: (value) { + // setState(() { + // selectedPatientType = + // PatientType.inPatient; + // }); + // }, + // ), + // Text('InPatient'), + // ], + // ), + // Row( + // children: [ + // Radio( + // activeColor: Color(0xFFB9382C), + // value: PatientType.OutPatient, + // groupValue: selectedPatientType, + // onChanged: (value) { + // setState(() { + // selectedPatientType = + // PatientType.OutPatient; + // }); + // }, + // ), + // Text('OutPatient'), + // ], + // ), + // ], + // ), SizedBox( height: 10, ), @@ -299,8 +299,9 @@ class _PatientSearchScreenNewState extends State { isSearchWithKeyInfo: patientFileInfoController.text.isNotEmpty ? true : false, isSearch: true, + isSearchAndOut:true, searchKey: patientFileInfoController.text, - isInpatient: selectedPatientType != PatientType.OutPatient, + isInpatient: false, ), ), ); diff --git a/lib/screens/patients/patient_search/patients_screen_new.dart b/lib/screens/patients/patient_search/patients_screen_new.dart index 5de98242..7074bda9 100644 --- a/lib/screens/patients/patient_search/patients_screen_new.dart +++ b/lib/screens/patients/patient_search/patients_screen_new.dart @@ -33,6 +33,7 @@ class PatientsScreenNew extends StatefulWidget { final bool isSearchWithKeyInfo; final bool isSearch; final bool isInpatient; + final bool isSearchAndOut; final String searchKey; @@ -46,7 +47,7 @@ class PatientsScreenNew extends StatefulWidget { this.patientSearchRequestModel, this.isSearchWithKeyInfo = true, this.isSearch = false, - this.isInpatient = false, this.searchKey}); + this.isInpatient = false, this.searchKey, this.isSearchAndOut=false}); @override _PatientsScreenNewState createState() => _PatientsScreenNewState(); @@ -226,7 +227,8 @@ class _PatientsScreenNewState extends State { patientInfo: model.filterData[index], patientType: patientType, arrivalType: arrivalType, - isInpatient: widget.isInpatient, + isFromSearch:widget.isSearchAndOut, + isInpatient: widget.isInpatient, onTap: () { // TODO change the parameter to daynamic Navigator.of(context).pushNamed( @@ -241,9 +243,10 @@ class _PatientsScreenNewState extends State { "isSearch": widget.isSearch, "isInpatient": widget.isInpatient, "arrivalType": "7", + "isSearchAndOut": widget.isSearchAndOut, }); }, - isFromSearch: widget.isSearch, + // isFromSearch: widget.isSearch, ), ); })), diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 5677d374..290f9569 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -114,87 +114,79 @@ class _LabsHomePageState extends State { ), ...List.generate( model.patientLabOrdersList.length, - (index) => Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: model - .patientLabOrdersList[index].patientLabOrdersList - .map((labOrder) { - return Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, - ), - borderRadius: BorderRadius.all( - Radius.circular(8.0), + (index) => Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + color: Colors.white), + child: Row( + children: [ + Container( + width: 20, + height: 160, + decoration: BoxDecoration( + //Colors.red[900] Color(0xff404545) + color: model.patientLabOrdersList[index].isLiveCareAppointment + ? Colors.red[900] + : !model.patientLabOrdersList[index].isInOutPatient + ? Colors.black + : Color(0xffa9a089), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8), + bottomLeft: Radius.circular(8), ), - color: Colors.white), - child: Row( - children: [ - Container( - width: 20, - height: 160, - decoration: BoxDecoration( - //Colors.red[900] Color(0xff404545) - color: labOrder.isLiveCareAppointment - ? Colors.red[900] - : !labOrder.isInOutPatient - ? Colors.black - : Color(0xffa9a089), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - bottomLeft: Radius.circular(8), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + model.patientLabOrdersList[index].isLiveCareAppointment + ? TranslationBase.of(context) + .liveCare + .toUpperCase() + : !model.patientLabOrdersList[index].isInOutPatient + ? TranslationBase.of(context) + .inPatientLabel + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), + style: TextStyle(color: Colors.white), ), - ), - child: RotatedBox( - quarterTurns: 3, - child: Center( - child: Text( - labOrder.isLiveCareAppointment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !labOrder.isInOutPatient - ? TranslationBase.of(context) - .inPatientLabel - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), - style: TextStyle(color: Colors.white), - ), - )), - ), - Expanded( - child: DoctorCard( - isNoMargin: true, - onTap: () => Navigator.push( - context, - FadePage( - page: LaboratoryResultPage( - patientLabOrders: labOrder, - patient: patient, - arrivalType: arrivalType, - patientType: patientType, - ), - ), + )), + ), + Expanded( + child: DoctorCard( + isNoMargin: true, + onTap: () => Navigator.push( + context, + FadePage( + page: LaboratoryResultPage( + patientLabOrders: model.patientLabOrdersList[index], + patient: patient, + arrivalType: arrivalType, + patientType: patientType, ), - doctorName: labOrder.doctorName, - invoiceNO: ' ${labOrder.invoiceNo}', - profileUrl: labOrder.doctorImageURL, - branch: labOrder.projectName, - clinic: labOrder.clinicDescription, - appointmentDate: labOrder.orderDate, - orderNo: labOrder.orderNo, - isShowTime: false, ), ), - ], + doctorName: model.patientLabOrdersList[index].doctorName, + invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}', + profileUrl: model.patientLabOrdersList[index].doctorImageURL, + branch: model.patientLabOrdersList[index].projectName, + clinic: model.patientLabOrdersList[index].clinicDescription, + appointmentDate: model.patientLabOrdersList[index].orderDate, + orderNo: model.patientLabOrdersList[index].orderNo, + isShowTime: false, + ), ), - ); - }).toList(), + ], + ), ), ), if (model.patientLabOrdersList.isEmpty && diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 3c2fab57..bae49ef9 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -30,6 +30,7 @@ class _PatientProfileScreenState extends State bool isInpatient = false; bool isDischargedPatient = false; + bool isSearchAndOut = false; String patientType; String arrivalType; String from; @@ -66,6 +67,8 @@ class _PatientProfileScreenState extends State } if (routeArgs.containsKey("isDischargedPatient")) { isDischargedPatient = routeArgs['isDischargedPatient']; + }if (routeArgs.containsKey("isSearchAndOut")) { + isSearchAndOut = routeArgs['isSearchAndOut']; } if (isInpatient) _activeTab = 0; @@ -101,24 +104,22 @@ class _PatientProfileScreenState extends State ? 210 : 0, ), - if(isFromSearch) - tabsBar(context, screenSize), + Container( - height: isFromSearch ? MediaQuery + height: !isSearchAndOut ? MediaQuery .of(context) .size - .height * 0.60 : MediaQuery + .height * 0.70 : MediaQuery .of(context) .size .height * 0.69, child: ListView( children: [ Container( - child: isFromSearch + child: isSearchAndOut ? Column( children: [ - if (_activeTab == 0) Padding( padding: const EdgeInsets.symmetric( @@ -134,6 +135,8 @@ class _PatientProfileScreenState extends State crossAxisCount: 3, children: [ PatientProfileButton( + isInPatient: + isInpatient, patient: patient, patientType: patientType, @@ -153,17 +156,17 @@ class _PatientProfileScreenState extends State .signs, route: VITAL_SIGN_DETAILS, - isInPatient: true, icon: 'patient/vital_signs.png'), PatientProfileButton( + isInPatient: + isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, route: LAB_RESULT, - isInPatient: true, nameLine1: TranslationBase .of( @@ -195,10 +198,12 @@ class _PatientProfileScreenState extends State TranslationBase .of( context) - .result, + .service, icon: 'patient/health_summary.png'), PatientProfileButton( + isInPatient: + isInpatient, patient: patient, patientType: patientType, @@ -206,15 +211,11 @@ class _PatientProfileScreenState extends State arrivalType, route: ORDER_PRESCRIPTION_NEW, - isSelectInpatient: - _activeTab == 0, - isInPatient: - isInpatient, nameLine1: TranslationBase .of( context) - .patient, + .orders, nameLine2: TranslationBase .of( @@ -222,222 +223,6 @@ class _PatientProfileScreenState extends State .prescription, icon: 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: PROGRESS_NOTE, - isDischargedPatient: - isDischargedPatient, - nameLine1: - TranslationBase - .of( - context) - .progress, - nameLine2: - TranslationBase - .of( - context) - .note, - icon: - 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ORDER_NOTE, - isDischargedPatient: - isDischargedPatient, - nameLine1: - "Order", - //"Text", - nameLine2: - "Sheet", - //TranslationBase.of(context).orders, - icon: - 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ORDER_PROCEDURE, - isInPatient: - isInpatient, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .procedures, - icon: - 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: MEDICAL_FILE, - nameLine1: "Health", - isInPatient: - isInpatient, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - isDisable: true, - route: MEDICAL_FILE, - nameLine1: - "Medical", - //Health - isInPatient: - isInpatient, - nameLine2: - "Report", - //Report - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - isDisable: - isDischargedPatient || - isFromSearch, - nameLine1: - TranslationBase - .of( - context) - .referral, - nameLine2: - TranslationBase - .of( - context) - .patient, - icon: - 'patient/refer_patient.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: - TranslationBase - .of( - context) - .insurance, - nameLine2: - TranslationBase - .of( - context) - .approvals, - icon: - 'patient/vital_signs.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: - 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: ADD_SICKLEAVE, - nameLine1: - TranslationBase - .of( - context) - .patientSick, - nameLine2: - TranslationBase - .of( - context) - .leave, - icon: - 'patient/patient_sick_leave.png'), - ], - ), - ), - if (_activeTab == 1) - Padding( - padding: - const EdgeInsets.symmetric( - vertical: 15.0, - horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: - NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - from: from, - to: to, - nameLine1: - TranslationBase - .of( - context) - .vital, - nameLine2: - TranslationBase - .of( - context) - .signs, - route: - VITAL_SIGN_DETAILS, - icon: - 'patient/vital_signs.png'), - // if (selectedPatientType != 7) PatientProfileButton( isInPatient: isInpatient, @@ -455,50 +240,6 @@ class _PatientProfileScreenState extends State //TranslationBase.of(context).summaryReport, icon: 'patient/health_summary.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: LAB_RESULT, - nameLine1: - TranslationBase - .of( - context) - .lab, - nameLine2: - TranslationBase - .of( - context) - .result, - icon: - 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - isInPatient: - isInpatient, - route: - RADIOLOGY_PATIENT, - nameLine1: - TranslationBase - .of( - context) - .radiology, - nameLine2: - TranslationBase - .of( - context) - .service, - icon: - 'patient/health_summary.png'), PatientProfileButton( isInPatient: isInpatient, @@ -516,29 +257,6 @@ class _PatientProfileScreenState extends State nameLine2: "ECG", icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - nameLine1: - TranslationBase - .of( - context) - .orders, - nameLine2: - TranslationBase - .of( - context) - .prescription, - icon: - 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( isInPatient: isInpatient, @@ -560,7 +278,6 @@ class _PatientProfileScreenState extends State .procedures, icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( isInPatient: isInpatient, @@ -583,7 +300,6 @@ class _PatientProfileScreenState extends State .service, icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( isInPatient: isInpatient, @@ -987,24 +703,6 @@ class _PatientProfileScreenState extends State VITAL_SIGN_DETAILS, icon: 'patient/vital_signs.png'), - // if (selectedPatientType != 7) - PatientProfileButton( - isInPatient: - isInpatient, - patient: patient, - patientType: - patientType, - arrivalType: - arrivalType, - route: MEDICAL_FILE, - nameLine1: - "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: - "Summary", - //TranslationBase.of(context).summaryReport, - icon: - 'patient/health_summary.png'), PatientProfileButton( isInPatient: isInpatient, @@ -1026,7 +724,6 @@ class _PatientProfileScreenState extends State .result, icon: 'patient/lab_results.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( patient: patient, patientType: @@ -1057,15 +754,20 @@ class _PatientProfileScreenState extends State patientType, arrivalType: arrivalType, - route: PATIENT_ECG, + route: + ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase .of( context) - .patient, - nameLine2: "ECG", + .orders, + nameLine2: + TranslationBase + .of( + context) + .prescription, icon: - 'patient/patient_sick_leave.png'), + 'patient/order_prescription.png'), PatientProfileButton( isInPatient: isInpatient, @@ -1074,33 +776,41 @@ class _PatientProfileScreenState extends State patientType, arrivalType: arrivalType, - route: - ORDER_PRESCRIPTION_NEW, - isSelectInpatient: - false, + route: MEDICAL_FILE, nameLine1: - TranslationBase - .of( - context) - .orders, + "Health", + //TranslationBase.of(context).medicalReport, nameLine2: + "Summary", + //TranslationBase.of(context).summaryReport, + icon: + 'patient/health_summary.png'), + PatientProfileButton( + isInPatient: + isInpatient, + patient: patient, + patientType: + patientType, + arrivalType: + arrivalType, + route: PATIENT_ECG, + nameLine1: TranslationBase .of( context) - .prescription, + .patient, + nameLine2: "ECG", icon: - 'patient/order_prescription.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + 'patient/patient_sick_leave.png'), PatientProfileButton( + isInPatient: + isInpatient, patient: patient, patientType: patientType, arrivalType: arrivalType, - route: - ORDER_PROCEDURE, - isInPatient: - isInpatient, + route: ORDER_PROCEDURE, nameLine1: TranslationBase .of( @@ -1113,7 +823,6 @@ class _PatientProfileScreenState extends State .procedures, icon: 'patient/Order_Procedures.png'), - //if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( isInPatient: isInpatient, @@ -1136,7 +845,6 @@ class _PatientProfileScreenState extends State .service, icon: 'patient/vital_signs.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( isInPatient: isInpatient, diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index bea229bb..1c3c7e3f 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -453,7 +453,7 @@ class _UpdateAssessmentPageState extends State { ), ), ), - bottomSheet: Container( + bottomSheet:Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( @@ -462,55 +462,67 @@ class _UpdateAssessmentPageState extends State { border: Border.all( color: HexColor('#707070'), width: 0), - ), child: Padding( - padding: const EdgeInsets.all(12.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.4, - child: AppButton( - title: TranslationBase - .of(context) - .previous, - color: Colors.grey[300], - fontColor: Colors.black, - fontWeight: FontWeight.w600, - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - widget.changePageViewIndex(1); - }, - ), - ), - SizedBox( - width: MediaQuery.of(context).size.width * 0.05, - ), - Container( - width: MediaQuery.of(context).size.width * 0.4, - child: AppButton( - title: TranslationBase - .of(context) - .next, - fontWeight: FontWeight.w600, - color: Colors.red[700], - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - if (widget.mySelectedAssessmentList.isEmpty) { - Helpers.showErrorToast( - TranslationBase - .of(context) - .assessmentErrorMsg); - } else { - widget.changePageViewIndex(3); - widget.changeLoadingState(true); - } - }, + ), + height: 80, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container(child: + FractionallySizedBox( + widthFactor: .80, + child: Center( + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase + .of(context) + .previous, + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w600, + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + widget.changePageViewIndex(1); + }, + ) + , + ), + SizedBox(width: 5,), + Expanded( + child: AppButton( + title: TranslationBase + .of(context) + .next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + if (widget.mySelectedAssessmentList.isEmpty) { + Helpers.showErrorToast( + TranslationBase + .of(context) + .assessmentErrorMsg); + } else { + widget.changePageViewIndex(3); + widget.changeLoadingState(true); + } + }, + ), + ), + ], ), ), - ], - ), - ), - ), + ),), + SizedBox( + height: 5, + ), + ], + ),) + ), ); } diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index 8fe66db1..8fdfffc2 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -143,7 +143,8 @@ class _UpdateObjectivePageState extends State { ), ), ), - bottomSheet: Container( + bottomSheet: + Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( @@ -153,55 +154,56 @@ class _UpdateObjectivePageState extends State { color: HexColor('#707070'), width: 0), ), - height: MediaQuery - .of(context) - .size - .height * 0.1, + height: 80, width: double.infinity, - child: FractionallySizedBox( - widthFactor: 0.9, - child: Row( - children: [ - Container( - width: MediaQuery.of(context).size.width *0.4, - child: AppButton( - title: TranslationBase.of(context).previous, - color: Colors.grey[300], - fontColor: Colors.black, - fontWeight: FontWeight.w600, - onPressed: () { - widget.changePageViewIndex(0); - }, - ), - ), - SizedBox( - width: MediaQuery.of(context).size.width *0.1, - ), - Container( - width: MediaQuery.of(context).size.width *0.4, - child: AppButton( - title: TranslationBase.of(context).next, - fontWeight: FontWeight.w600, - loading: model.state == ViewState.BusyLocal, - color: widget.mySelectedExamination != null && - widget.mySelectedExamination.length > 0 - ? Colors.red[700] - : HexColor("#A5A5A5"), - fontColor: widget.mySelectedExamination != null && - widget.mySelectedExamination.length > 0 ? Colors.white : HexColor("#5A5A5A"), - disabled: widget.mySelectedExamination != null && - widget.mySelectedExamination.length > 0 - ? false - : true, - onPressed: () async { - await submitUpdateObjectivePage(model); - }, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container(child: + FractionallySizedBox( + widthFactor: .80, + child: Center( + child: Row( + children: [ + Expanded( + child: AppButton( + title: TranslationBase.of(context).previous, + color: Colors.grey[300], + fontColor: Colors.black, + fontWeight: FontWeight.w600, + onPressed: () { + widget.changePageViewIndex(0); + }, + ) + , + ), + SizedBox(width: 5,), + Expanded( + child: AppButton( + title: TranslationBase + .of(context) + .next, + fontWeight: FontWeight.w600, + color: Colors.red[700], + disabled: model.state == ViewState.BusyLocal, + onPressed: () async { + await submitUpdateObjectivePage(model); + }, + ), + ), + ], ), ), - ], - ), - ), - ), + ),), + SizedBox( + height: 5, + ), + ], + ),) + + ), ); } diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 55b86022..8e7e3f98 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -236,7 +236,8 @@ class _UpdatePlanPageState extends State { ), ), ), - bottomSheet: Container( + bottomSheet: + Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( @@ -246,76 +247,85 @@ class _UpdatePlanPageState extends State { color: HexColor('#707070'), width: 0), ), - width: double.maxFinite, - height: 90, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - margin: EdgeInsets.all(6), - child: Column( - children: [ - Row( + height: 80, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container(child: + FractionallySizedBox( + widthFactor: .80, + child: Center( + child: Row( children: [ Expanded( child: AppButton( - title: TranslationBase.of(context).previous, + title: TranslationBase + .of(context) + .previous, color: Colors.grey[300], fontColor: Colors.black, fontWeight: FontWeight.w600, + disabled: model.state == ViewState.BusyLocal, onPressed: () async { - setState(() { - widget.changePageViewIndex(2); - }); + widget.changePageViewIndex(2); }, - ), + ) + , ), SizedBox(width: 5,), Expanded( child: AppButton( - title: isAddProgress? TranslationBase.of(context).next: "Finish", + title: TranslationBase + .of(context) + .next, fontWeight: FontWeight.w600, color: Colors.red[700], loading: model.state == ViewState.BusyLocal, disabled: progressNoteController.text.isEmpty, onPressed: () async { - if (progressNoteController.text.isNotEmpty) { - if (isAddProgress) { - Map profile = - await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = - DoctorProfileModel.fromJson(profile); - setState(() { - widget.patientProgressNote.createdByName = - widget.patientProgressNote - .createdByName ?? - doctorProfile.doctorName; - widget.patientProgressNote.editedByName = - doctorProfile.doctorName; - widget.patientProgressNote.createdOn = - DateTime.now().toString(); - widget.patientProgressNote.planNote = - progressNoteController.text; - isAddProgress = !isAddProgress; - }); - submitPlan(model); - } else { - Navigator.of(context).pop(); - } - } else { - Helpers.showErrorToast(TranslationBase.of(context) - .progressNoteErrorMsg); - } - }, + if (progressNoteController.text.isNotEmpty) { + if (isAddProgress) { + Map profile = + await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = + DoctorProfileModel.fromJson(profile); + setState(() { + widget.patientProgressNote.createdByName = + widget.patientProgressNote + .createdByName ?? + doctorProfile.doctorName; + widget.patientProgressNote.editedByName = + doctorProfile.doctorName; + widget.patientProgressNote.createdOn = + DateTime.now().toString(); + widget.patientProgressNote.planNote = + progressNoteController.text; + isAddProgress = !isAddProgress; + }); + submitPlan(model); + } else { + Navigator.of(context).pop(); + } + } else { + Helpers.showErrorToast(TranslationBase.of(context) + .progressNoteErrorMsg); + } + }, ), ), ], ), - - ], + ), + ),), + SizedBox( + height: 5, ), - ), - ), - ), + ], + ),) + ), ); } diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index 19999880..b0db0414 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -323,18 +323,15 @@ class _UpdateSubjectivePageState extends State { color: HexColor('#707070'), width: 0), ), - height: MediaQuery - .of(context) - .size - .height * 0.1, + height: 80, width: double.infinity, - child: Column( children: [ SizedBox( height: 10, ), - Container(child: FractionallySizedBox( + Container(child: + FractionallySizedBox( widthFactor: .80, child: Center( child: AppButton( diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 78c2a3b9..cd92f71b 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -361,6 +361,18 @@ class DateUtils { return DateFormat('hh:mm a').format(dateTime); } + static String getTimeHHMMA2 (DateTime dateTime){ + return DateFormat('hh:mm').format(dateTime); + } + + static String getStartTime(String dateTime){ + String time=dateTime; + + if(dateTime.length>7) + time = dateTime.substring(0,5); + return time; + } + static String getTimeFormated(DateTime dateTime) { print(dateTime); if (dateTime != null) diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index f56ad676..fd60b21d 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -148,7 +148,7 @@ class PatientCard extends StatelessWidget { : patientInfo.arrivedOn != null ? AppText( DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.arrivedOn,) - )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.arrivedOn,)), + )+" "+ "${DateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, ) @@ -156,7 +156,7 @@ class PatientCard extends StatelessWidget { AppText( // // )+" "+ DateUtils.getTimeHHMMA(DateUtils.convertStringToDate(patientInfo.appointmentDate,)), - " ${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${patientInfo.startTime}", + " ${DateUtils.getDayMonthYearDate(DateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${DateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, ):SizedBox() diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index f07ad8a4..0ba5c8f2 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -39,7 +39,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget decoration: BoxDecoration( color: Colors.white, ), - height: height == 0 ? isInpatient? 210:200 : height, + height: height == 0 ? isInpatient? 215:200 : height, child: Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), margin: EdgeInsets.only(top: 50), diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 017b7b39..e957b5d4 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -19,6 +19,7 @@ class AppScaffold extends StatelessWidget { final Widget bottomSheet; final Color backgroundColor; final Widget appBar; + final String subtitle; final bool isHomeIcon; AppScaffold( {this.appBarTitle = '', @@ -29,7 +30,7 @@ class AppScaffold extends StatelessWidget { this.bottomSheet, this.backgroundColor, this.isHomeIcon = true, - this.appBar}); + this.appBar, this.subtitle}); @override Widget build(BuildContext context) { @@ -51,7 +52,14 @@ class AppScaffold extends StatelessWidget { color: Colors.black87, fontSize: 16.8, )), - title: Text(appBarTitle.toUpperCase()), + title: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text(appBarTitle.toUpperCase()), + if(subtitle!=null) + Text(subtitle,style: TextStyle(fontSize: 12,color: Colors.red),), + ], + ), leading: Builder(builder: (BuildContext context) { return IconButton( icon: Icon(Icons.arrow_back_ios),