From 1dd668ed70cf7ace27f02f0e55fba4f462d50d58 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 28 Apr 2021 00:03:31 +0300 Subject: [PATCH] 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),