From 9c54f85782b01a3880e0740fc75dcabd73afc344 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 14 Apr 2021 12:14:34 +0300 Subject: [PATCH] bug fix --- lib/screens/dashboard_screen.dart | 3 +- lib/screens/patients/patients_screen.dart | 48 ++++++++++++++++++++++- 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 252958b1..b0c3bcde 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -79,8 +79,7 @@ class _DashboardScreenState extends State { PatientID: 0, From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') .toString(), - To: DateUtils.convertDateToFormat( - DateTime.now().add(Duration(days: 7, hours: 0)), 'yyyy-MM-dd') + To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') .toString(), LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 0efd3a95..d06e05e1 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -83,7 +83,26 @@ class _PatientsScreenState extends State { final _controller = TextEditingController(); PatientModel patient; - + var _patientSearchFormValues = PatientModel( + FirstName: "0", + MiddleName: "0", + LastName: "0", + PatientMobileNumber: "0", + PatientIdentificationID: "0", + PatientID: 0, + From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + LanguageID: 2, + stamp: "2020-03-02T13:56:39.170Z", + IPAdress: "11.11.11.11", + VersionID: 1.2, + Channel: 9, + TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", + SessionID: "5G0yXn0Jnq", + IsLoginForDoctorApp: true, + PatientOutSA: false); searchData(String str) { this.responseModelList = this.responseModelList2; var strExist = str.length > 0 ? true : false; @@ -252,6 +271,9 @@ class _PatientsScreenState extends State { isView = routeArgs['isView']; patient.Searchtype = 1; } + if (routeArgs != null && routeArgs.containsKey('activeFilter')) { + _activeLocation = routeArgs['activeFilter']; + } if (!projectsProvider.isArabic) patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; @@ -752,11 +774,12 @@ class _PatientsScreenState extends State { )), ), onTap: () { - filterBooking(item.toString()); + //filterBooking(item.toString()); setState(() { _activeLocation = _locations.indexOf(item); }); + filterPatient(item.toString()); }), _isActive ? Container( @@ -775,4 +798,25 @@ class _PatientsScreenState extends State { ), ); } + + filterPatient(item) { + if (item == 'Tomorrow') { + _patientSearchFormValues.To = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 1), + 'yyyy-MM-dd'); + } else if (item == 'Next Week') { + _patientSearchFormValues.To = DateUtils.convertDateToFormat( + DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day + 6), + 'yyyy-MM-dd'); + } + Navigator.of(context).pop(); + Navigator.of(context).pushNamed(PATIENTS, arguments: { + "patientSearchForm": _patientSearchFormValues, + "selectedType": "7", + "arrivalType": "1", + "activeFilter": _activeLocation + }); + } }