From ac4489c452895bda8ec13841a86657c921b599a6 Mon Sep 17 00:00:00 2001 From: Amjad Amireh Date: Mon, 11 May 2020 16:44:32 +0300 Subject: [PATCH] patiant model modify --- lib/models/patient/patient_model.dart | 96 +++++++++++++++++-- .../patients/patient_search_screen.dart | 30 ++++-- lib/screens/patients/patients_screen.dart | 13 +-- 3 files changed, 119 insertions(+), 20 deletions(-) diff --git a/lib/models/patient/patient_model.dart b/lib/models/patient/patient_model.dart index e49f64ea..93e77c18 100644 --- a/lib/models/patient/patient_model.dart +++ b/lib/models/patient/patient_model.dart @@ -1,8 +1,18 @@ + +/* + *@author:Modified by amjad add getter and setter Amjad Amireh + *@Date:11/5/2020 + *@param: + *@return:PatientsScreen Search textbox filter + + *@desc: + */ class PatientModel { int ProjectID; int ClinicID; int DoctorID; String FirstName; + String MiddleName; String LastName; String PatientMobileNumber; @@ -21,13 +31,87 @@ class PatientModel { bool PatientOutSA; - getFirstName() { - return this.FirstName; - } + int get getProjectID => ProjectID; + + set setProjectID(int ProjectID) => this.ProjectID = ProjectID; + + int get getClinicID => ClinicID; + + set setClinicID(int ClinicID) => this.ClinicID = ClinicID; + + int get getDoctorID => DoctorID; + + set setDoctorID(int DoctorID) => this.DoctorID = DoctorID; + String get getFirstName => FirstName; + + set setFirstName(String FirstName) => this.FirstName = FirstName; + + String get getMiddleName => MiddleName; + + set setMiddleName(String MiddleName) => this.MiddleName = MiddleName; + + String get getLastName => LastName; + + set setLastName(String LastName) => this.LastName = LastName; + + String get getPatientMobileNumber => PatientMobileNumber; + + set setPatientMobileNumber(String PatientMobileNumber) => this.PatientMobileNumber = PatientMobileNumber; + +// String get getPatientIdentificationID => PatientIdentificationID; + +// set setPatientIdentificationID(String PatientIdentificationID) => this.PatientIdentificationID = PatientIdentificationID; + + int get getPatientID => PatientID; + + set setPatientID(int PatientID) => this.PatientID = PatientID; + + String get getFrom => From; + + set setFrom(String From) => this.From = From; + + String get getTo => To; + + set setTo(String To) => this.To = To; + + int get getLanguageID => LanguageID; + + set setLanguageID(int LanguageID) => this.LanguageID = LanguageID; + + String get getStamp => stamp; + + set setStamp(String stamp) => this.stamp = stamp; + + String get getIPAdress => IPAdress; + + set setIPAdress(String IPAdress) => this.IPAdress = IPAdress; + + double get getVersionID => VersionID; + + set setVersionID(double VersionID) => this.VersionID = VersionID; + + int get getChannel => Channel; + + set setChannel(int Channel) => this.Channel = Channel; + + String get getTokenID => TokenID; + + set setTokenID(String TokenID) => this.TokenID = TokenID; + + String get getSessionID => SessionID; + + set setSessionID(String SessionID) => this.SessionID = SessionID; + + bool get getIsLoginForDoctorApp => IsLoginForDoctorApp; + + set setIsLoginForDoctorApp(bool IsLoginForDoctorApp) => this.IsLoginForDoctorApp = IsLoginForDoctorApp; + + bool get getPatientOutSA => PatientOutSA; + + set setPatientOutSA(bool PatientOutSA) => this.PatientOutSA = PatientOutSA; + + - setFirstName( FirstName) { - this.FirstName = FirstName; - } diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 2582310a..4704b564 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -62,15 +62,32 @@ class _PatientSearchScreenState extends State { // _patientSearchFormValues.TokenID = if (_formKey.currentState.validate()) { -// If all data are correct then save data to out variables - // _formKey.currentState.save(); - sharedPref.setString(TOKEN,'@dm!n'); - sharedPref.setString(SLECTED_PATIENT_TYPE,_selectedType); +//*****If all data are correct then save data to out variables**** + if (_patientSearchFormValues.getFirstName == null || + _patientSearchFormValues.getMiddleName == null || + _patientSearchFormValues.getLastName == null || + _patientSearchFormValues.getPatientMobileNumber == null) { + _patientSearchFormValues.setFirstName = "0"; + _patientSearchFormValues.setLastName = "0"; + _patientSearchFormValues.setMiddleName = "0"; + _patientSearchFormValues.setPatientMobileNumber = "0"; + _patientSearchFormValues.setPatientID = 0; + _patientSearchFormValues.From = "0"; + _patientSearchFormValues.To = "0"; + + //_formKey.currentState.save(); + } else { + _formKey.currentState.save(); + } + // _formKey.currentState.save(); + //*********************************** */ + sharedPref.setString(TOKEN, '@dm!n'); + sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType); print('_selectedType${_selectedType}'); String token = await sharedPref.getString(TOKEN); int projectID = await sharedPref.getInt(PROJECT_ID); _patientSearchFormValues.TokenID = token; - _patientSearchFormValues.ProjectID = 15;//projectID; + _patientSearchFormValues.ProjectID = 15; //projectID; // print(_patientSearchFormValues.PatientMobileNumber+"dfdfdfddf"); Navigator.of(context).pushNamed(PATIENTS, arguments: { "patientSearchForm": _patientSearchFormValues, @@ -173,7 +190,8 @@ class _PatientSearchScreenState extends State { AppTextFormField( hintText: 'First Name', onSaved: (value) { - _patientSearchFormValues.FirstName = value; + // _patientSearchFormValues.FirstName = value; + _patientSearchFormValues.setFirstName = value; }, // validator: (value) { // return TextValidator().validateName(value); diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 979c4158..676f9589 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -285,15 +285,12 @@ class _PatientsScreenState extends State { Container( child: Center( child: - DrAppCircularProgressIndeicator()), + Padding( + padding: const EdgeInsets.fromLTRB(0, 250, 0, 0), + child: DrAppCircularProgressIndeicator(), + )), ), - Container( - child: Text( - "Sorry There is No Data", - style: TextStyle( - color: Theme.of(context).errorColor), - ), - ) + ], ) : Column(