From 55c63c95316654922100989b3406402defd630c5 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 26 Apr 2021 10:53:41 +0300 Subject: [PATCH] fix Discharged Patient --- lib/core/service/radiology_service.dart | 2 +- .../viewModel/DischargedPatientViewModel.dart | 16 +++++++--------- lib/screens/patients/DischargedPatientPage.dart | 2 +- .../profile/lab_result/labs_home_page.dart | 1 + lib/widgets/shared/doctor_card.dart | 5 +++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/core/service/radiology_service.dart b/lib/core/service/radiology_service.dart index b1c0fbd4..42a79098 100644 --- a/lib/core/service/radiology_service.dart +++ b/lib/core/service/radiology_service.dart @@ -39,7 +39,7 @@ class RadiologyService extends BaseService { await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { - finalRadiologyList.clear(); + finalRadiologyList = []; String label = "ListRAD"; if(isInPatient) { label ="List_GetRadOreders"; diff --git a/lib/core/viewModel/DischargedPatientViewModel.dart b/lib/core/viewModel/DischargedPatientViewModel.dart index 339e9505..1c1ed4d1 100644 --- a/lib/core/viewModel/DischargedPatientViewModel.dart +++ b/lib/core/viewModel/DischargedPatientViewModel.dart @@ -13,15 +13,12 @@ class DischargedPatientViewModel extends BaseViewModel { _dischargedPatientService.myDischargedPatients; - - List get filterData => filterData2.isNotEmpty? filterData2:myDischargedPatient; - - List filterData2 = []; + List filterData = []; searchData(String str) { var strExist = str.length > 0 ? true : false; if (strExist) { - filterData2 = []; + filterData = []; for (var i = 0; i < myDischargedPatient.length; i++) { String firstName = myDischargedPatient[i].firstName.toUpperCase(); String lastName = myDischargedPatient[i].lastName.toUpperCase(); @@ -32,12 +29,12 @@ class DischargedPatientViewModel extends BaseViewModel { lastName.contains(str.toUpperCase()) || mobile.contains(str) || patientID.contains(str)) { - filterData2.add(myDischargedPatient[i]); + filterData.add(myDischargedPatient[i]); } } notifyListeners(); } else { - filterData2 = myDischargedPatient; + filterData = myDischargedPatient; notifyListeners(); } } @@ -49,8 +46,9 @@ class DischargedPatientViewModel extends BaseViewModel { if (_dischargedPatientService.hasError) { error = _dischargedPatientService.error; setState(ViewState.Error); - } else - setState(ViewState.Idle); + } else{ + filterData = myDischargedPatient; + setState(ViewState.Idle);} } Future gtMyDischargeReferralPatient() async { diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 0ba791c6..0e61702d 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -30,7 +30,7 @@ class _DischargedPatientState extends State { backgroundColor: Colors.grey[200], isShowAppBar: true, baseViewModel: model, - body: model.filterData.isEmpty?Center( + body: model.myDischargedPatient.isEmpty?Center( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 3dc771f5..1cdc5987 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -168,6 +168,7 @@ class _LabsHomePageState extends State { clinic: labOrder.clinicDescription, appointmentDate: labOrder.orderDate, orderNo: labOrder.orderNo, + isShowTime: false, ); }).toList(), ), diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index a974c5f8..1c889d9d 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -19,6 +19,7 @@ class DoctorCard extends StatelessWidget { final bool isPrescriptions; final String clinic; final bool isShowEye; + final bool isShowTime; DoctorCard( {this.doctorName, @@ -30,7 +31,7 @@ class DoctorCard extends StatelessWidget { this.orderNo, this.isPrescriptions = false, this.clinic, - this.isShowEye = true}); + this.isShowEye = true, this.isShowTime= true}); @override Widget build(BuildContext context) { @@ -71,7 +72,7 @@ class DoctorCard extends StatelessWidget { fontWeight: FontWeight.w600, fontSize: 14, ), - if (!isPrescriptions) + if (!isPrescriptions&& isShowTime) AppText( '${DateUtils.getHour(appointmentDate)}', fontWeight: FontWeight.w600,