From dc9f75f0ca55b02f300b1b2b17b5704c164fc338 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 27 Apr 2021 16:35:01 +0300 Subject: [PATCH] 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', ),