From 478900d4fd0553af323615167de083884be61e79 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 1 Sep 2021 14:29:42 +0300 Subject: [PATCH 1/2] fix inpatient issues --- lib/screens/patients/InPatientPage.dart | 3 + .../profile_gird_for_InPatient.dart | 133 ++++++++++++------ 2 files changed, 92 insertions(+), 44 deletions(-) diff --git a/lib/screens/patients/InPatientPage.dart b/lib/screens/patients/InPatientPage.dart index 0c0d548d..8314a653 100644 --- a/lib/screens/patients/InPatientPage.dart +++ b/lib/screens/patients/InPatientPage.dart @@ -127,6 +127,9 @@ class _InPatientPageState extends State { "isSearch": false, "isInpatient": true, "arrivalType": "1", + "isMyPatient":widget.patientSearchViewModel.filteredInPatientItems[index] + .doctorId == + widget.patientSearchViewModel.doctorProfile.doctorID, }); }, ); diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart index 210b237f..f1d29ffb 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart @@ -35,36 +35,69 @@ class ProfileGridForInPatient extends StatelessWidget { @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, + PatientProfileCardModel( + TranslationBase.of(context).vital, + TranslationBase.of(context).signs, + VITAL_SIGN_DETAILS, 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'patient/lab_results.png', + TranslationBase.of(context).lab, + TranslationBase.of(context).result, + LAB_RESULT, + 'patient/lab_results.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).specialResult, - ALL_SPECIAL_LAB_RESULT, 'patient/lab_results.png', + PatientProfileCardModel( + TranslationBase.of(context).lab, + TranslationBase.of(context).specialResult, + ALL_SPECIAL_LAB_RESULT, + 'patient/lab_results.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).result, - RADIOLOGY_PATIENT, 'patient/health_summary.png', + PatientProfileCardModel( + TranslationBase.of(context).radiology, + TranslationBase.of(context).result, + RADIOLOGY_PATIENT, + 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).prescription, - ORDER_PRESCRIPTION_NEW, 'patient/order_prescription.png', + PatientProfileCardModel( + TranslationBase.of(context).patient, + TranslationBase.of(context).prescription, + ORDER_PRESCRIPTION_NEW, + 'patient/order_prescription.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).progress, TranslationBase.of(context).note, PROGRESS_NOTE, + PatientProfileCardModel( + TranslationBase.of(context).progress, + TranslationBase.of(context).note, + PROGRESS_NOTE, 'patient/Progress_notes.png', - isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), - PatientProfileCardModel(TranslationBase.of(context).order, TranslationBase.of(context).sheet, ORDER_NOTE, + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient), + PatientProfileCardModel( + TranslationBase.of(context).order, + TranslationBase.of(context).sheet, + ORDER_NOTE, 'patient/Progress_notes.png', - isInPatient: isInpatient, isDischargedPatient: isDischargedPatient), - PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, - ORDER_PROCEDURE, 'patient/Order_Procedures.png', + isInPatient: isInpatient, + isDischargedPatient: isDischargedPatient), + PatientProfileCardModel( + TranslationBase.of(context).orders, + TranslationBase.of(context).procedures, + ORDER_PROCEDURE, + 'patient/Order_Procedures.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, + PatientProfileCardModel( + TranslationBase.of(context).health, + TranslationBase.of(context).summary, + HEALTH_SUMMARY, 'patient/health_summary.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).medical, TranslationBase.of(context).report, - PATIENT_MEDICAL_REPORT, 'patient/health_summary.png', - isInPatient: isInpatient, isDisable: false), + PatientProfileCardModel( + TranslationBase.of(context).medical, + TranslationBase.of(context).report, + PATIENT_MEDICAL_REPORT, + 'patient/health_summary.png', + isInPatient: isInpatient, + isDisable: false), PatientProfileCardModel( TranslationBase.of(context).referral, TranslationBase.of(context).patient, @@ -73,12 +106,19 @@ class ProfileGridForInPatient extends StatelessWidget { isInPatient: isInpatient, isDisable: isDischargedPatient || isFromSearch, ), - PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).approvals, - PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', + PatientProfileCardModel( + TranslationBase.of(context).insurance, + TranslationBase.of(context).approvals, + PATIENT_INSURANCE_APPROVALS_NEW, + 'patient/vital_signs.png', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).discharge, TranslationBase.of(context).report, null, + PatientProfileCardModel( + TranslationBase.of(context).discharge, + TranslationBase.of(context).report, + null, 'patient/patient_sick_leave.png', - isInPatient: isInpatient, isDisable: true), + isInPatient: isInpatient, + isDisable: true), PatientProfileCardModel( TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, @@ -90,30 +130,35 @@ class ProfileGridForInPatient extends StatelessWidget { return Padding( padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), - child: StaggeredGridView.countBuilder( + child: GridView( shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - crossAxisCount: 3, - itemCount: cardsList.length, - staggeredTileBuilder: (int index) => StaggeredTile.fit(1), - itemBuilder: (BuildContext context, int index) => PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: cardsList[index].nameLine1, - nameLine2: cardsList[index].nameLine2, - route: cardsList[index].route, - icon: cardsList[index].icon, - isInPatient: cardsList[index].isInPatient, - isDischargedPatient: cardsList[index].isDischargedPatient, - isDisable: cardsList[index].isDisable, - onTap: cardsList[index].onTap, - isLoading: cardsList[index].isLoading, + + physics: BouncingScrollPhysics(), + // if you want IOS bouncing effect, otherwise remove this line + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisSpacing: 10, + mainAxisSpacing: 10, + crossAxisCount: 3, ), + //change the number as you want + children: cardsList.map((item) { + return PatientProfileButton( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: item.nameLine1, + nameLine2: item.nameLine2, + route: item.route, + icon: item.icon, + isInPatient: item.isInPatient, + isDischargedPatient: item.isDischargedPatient, + isDisable: item.isDisable, + onTap: item.onTap, + isLoading: item.isLoading, + ); + }).toList(), ), ); } From a4c817869501d0de4d1fc1e9fe8b7b590bbdb7d5 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Wed, 1 Sep 2021 17:02:46 +0300 Subject: [PATCH 2/2] fix inpatient issues --- lib/screens/patients/PatientsInPatientScreen.dart | 3 ++- .../profile/profile_screen/patient_profile_screen.dart | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index ec9aeebc..f094f71a 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -69,8 +69,9 @@ class _PatientInPatientScreenState extends State await model.getSpecialClinicalCareMappingList(widget.specialClinic.clinicID); requestModel.nursingStationID = model.specialClinicalCareMappingList[0].nursingStationID; - requestModel.clinicID = 0; + } + requestModel.clinicID = 0; await model.getInPatientList(requestModel); }, builder: (_, model, w) => diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index eec42b86..f170b128 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -204,7 +204,7 @@ class _PatientProfileScreenState extends State with Single ), ], ), - if ( (isInpatient && isMyPatient )? true:isFromLiveCare + if ( (isInpatient )? true:isFromLiveCare ? patient.episodeNo != null : patient.patientStatusType != null && patient.patientStatusType == 43) BaseView( @@ -222,7 +222,7 @@ class _PatientProfileScreenState extends State with Single AppButton( title: "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", - color: isFromLiveCare + color: isFromLiveCare ||isInpatient ? Colors.red.shade700 : patient.patientStatusType == 43 ? Colors.red.shade700 @@ -261,7 +261,7 @@ class _PatientProfileScreenState extends State with Single AppButton( title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: (isInpatient &&isMyPatient ) || isFromLiveCare + color: (isInpatient ) || isFromLiveCare ? Colors.red.shade700 : patient.patientStatusType == 43 ? Colors.red.shade700