diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 21caa827..43eda715 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -68,7 +68,7 @@ class BaseAppClient { body['LanguageID'] = 2; body['stamp'] = STAMP; - // if(!body.containsKey("IPAdress")) + // if(!body.containsKey("IPAdress")) body['IPAdress'] = IP_ADDRESS; body['VersionID'] = VERSION_ID; body['Channel'] = CHANNEL; @@ -86,9 +86,6 @@ class BaseAppClient { print("URL : $url"); print("Body : ${json.encode(body)}"); - String bodyData= json.encode(body); - var asd = ""; - if (await Helpers.checkConnection()) { final response = await http.post(url, diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e520374e..d695275b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -837,21 +837,18 @@ const Map> localizedValues = { "enter_credentials": { "en": "Enter the user credentials below", "ar": "أدخل بيانات اعتماد المستخدم أدناه" - - }, - "step": { - "en": "Step", - "ar": "خطوة" - }, - "fieldRequired": { - "en": "This field is required", - "ar": "هذه الخانة مطلوبه" }, + "step": {"en": "Step", "ar": "خطوة"}, + "fieldRequired": {"en": "This field is required", "ar": "هذه الخانة مطلوبه"}, "applyOrRescheduleLeave": { + "en": "Apply Or Reschedule Leave", + "ar": "التقدم بطلب أو إعادة جدولة الإجازة" + }, + "myQRCode": {"en": "My QR Code", "ar": "My QR Code"}, + "patientIDMobilenational": { + "en": "Patient ID, National ID, Mobile Number", + "ar": "هوية المريض ، الهوية الوطنية ، رقم الهاتف المحمول" "en": "Apply Reschedule Leave", "ar": "التقدم بطلب إعادة جدولة الإجازة" - },"myQRCode": { - "en": "My QR Code", - "ar": "My QR Code" }, }; diff --git a/lib/core/service/patient_service.dart b/lib/core/service/patient_service.dart index 477d9d80..413bb6ae 100644 --- a/lib/core/service/patient_service.dart +++ b/lib/core/service/patient_service.dart @@ -130,7 +130,8 @@ class PatientService extends BaseService { "IsLoginForDoctorApp": patient.IsLoginForDoctorApp, "PatientOutSA": patient.PatientOutSA, "SearchType": patient.Searchtype, - "MobileNo": '' + "MobileNo": patient.MobileNo, + "IdentificationNo": patient.IdentificationNo }, ); diff --git a/lib/core/viewModel/leave_rechdule_response.dart b/lib/core/viewModel/leave_rechdule_response.dart index abcba69e..555e19cf 100644 --- a/lib/core/viewModel/leave_rechdule_response.dart +++ b/lib/core/viewModel/leave_rechdule_response.dart @@ -10,6 +10,7 @@ class GetRescheduleLeavesResponse { int requisitionType; int status; String createdOn; + String statusDescription; GetRescheduleLeavesResponse( {this.clinicId, this.coveringDoctorId, @@ -21,7 +22,8 @@ class GetRescheduleLeavesResponse { this.requisitionNo, this.requisitionType, this.status, - this.createdOn}); + this.createdOn, + this.statusDescription}); GetRescheduleLeavesResponse.fromJson(Map json) { clinicId = json['clinicId']; @@ -35,6 +37,7 @@ class GetRescheduleLeavesResponse { requisitionType = json['requisitionType']; status = json['status']; createdOn = json['createdOn']; + statusDescription = json['statusDescription']; } Map toJson() { @@ -50,6 +53,7 @@ class GetRescheduleLeavesResponse { data['requisitionType'] = this.requisitionType; data['status'] = this.status; data['createdOn'] = this.createdOn; + data['statusDescription'] = this.statusDescription; return data; } } diff --git a/lib/models/patient/patient_model.dart b/lib/models/patient/patient_model.dart index 08b5d1d0..7368c538 100644 --- a/lib/models/patient/patient_model.dart +++ b/lib/models/patient/patient_model.dart @@ -29,7 +29,8 @@ class PatientModel { bool IsLoginForDoctorApp; bool PatientOutSA; int Searchtype; - + String IdentificationNo; + String MobileNo; int get getProjectID => ProjectID; set setProjectID(int ProjectID) => this.ProjectID = ProjectID; @@ -132,7 +133,9 @@ class PatientModel { this.SessionID, this.IsLoginForDoctorApp, this.PatientOutSA, - this.Searchtype}); + this.Searchtype, + this.IdentificationNo, + this.MobileNo}); factory PatientModel.fromJson(Map json) => PatientModel( FirstName: json["FirstName"], @@ -162,6 +165,8 @@ class PatientModel { data['IsLoginForDoctorApp'] = this.IsLoginForDoctorApp; data['PatientOutSA'] = this.PatientOutSA; data['Searchtype'] = this.Searchtype; + data['IdentificationNo'] = this.IdentificationNo; + data['MobileNo'] = this.MobileNo; return data; } } diff --git a/lib/models/sickleave/get_all_sickleave_response.dart b/lib/models/sickleave/get_all_sickleave_response.dart index f3fc8032..de831213 100644 --- a/lib/models/sickleave/get_all_sickleave_response.dart +++ b/lib/models/sickleave/get_all_sickleave_response.dart @@ -7,7 +7,7 @@ class GetAllSickLeaveResponse { int requestNo; String startDate; int status; - + String statusDescription; GetAllSickLeaveResponse( {this.appointmentNo, this.isExtendedLeave, @@ -16,7 +16,8 @@ class GetAllSickLeaveResponse { this.remarks, this.requestNo, this.startDate, - this.status}); + this.status, + this.statusDescription}); GetAllSickLeaveResponse.fromJson(Map json) { appointmentNo = json['appointmentNo']; @@ -27,6 +28,7 @@ class GetAllSickLeaveResponse { requestNo = json['requestNo']; startDate = json['startDate']; status = json['status']; + statusDescription = json['statusDescription']; } Map toJson() { @@ -39,6 +41,7 @@ class GetAllSickLeaveResponse { data['requestNo'] = this.requestNo; data['startDate'] = this.startDate; data['status'] = this.status; + data['statusDescription'] = this.statusDescription; return data; } } diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 50614d52..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: 6, 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/medicine/search_medicine_patient_screen.dart b/lib/screens/medicine/search_medicine_patient_screen.dart index 245c0602..305ad1d2 100644 --- a/lib/screens/medicine/search_medicine_patient_screen.dart +++ b/lib/screens/medicine/search_medicine_patient_screen.dart @@ -72,25 +72,27 @@ class _SearchMedicinePatientScreen extends State indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: - EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + EdgeInsets.only(top: 4.0, left: 30.0, right: 30.0), unselectedLabelColor: Colors.grey[800], tabs: [ Container( - width: MediaQuery.of(context).size.width * 0.30, + width: MediaQuery.of(context).size.width * 0.35, child: Center( child: AppText( TranslationBase.of(context).searchPatient, color: Colors.black, fontWeight: FontWeight.bold, + fontSize: 14, ), ), ), Container( - width: MediaQuery.of(context).size.width * 0.30, + width: MediaQuery.of(context).size.width * 0.35, child: Center( child: AppText( TranslationBase.of(context).searchMedicine, fontWeight: FontWeight.bold, + fontSize: 14, color: Colors.black), ), ), diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 0ae5452b..115b395b 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -56,6 +56,7 @@ class _PatientSearchScreenState extends State { LastName: "0", PatientMobileNumber: "0", PatientIdentificationID: "0", + MobileNo: '0', PatientID: 0, From: "0", To: "0", @@ -67,6 +68,7 @@ class _PatientSearchScreenState extends State { TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", SessionID: "5G0yXn0Jnq", IsLoginForDoctorApp: true, + IdentificationNo: '0', PatientOutSA: false); void _validateInputs() async { @@ -180,54 +182,78 @@ class _PatientSearchScreenState extends State { width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(10), child: AppTextFormField( - labelText: - TranslationBase.of(context).patientID, + labelText: TranslationBase.of(context) + .patpatientIDMobilenationalientID, borderColor: Colors.white, textInputType: TextInputType.number, textInputAction: TextInputAction.done, inputFormatter: ONLY_NUMBERS, focusNode: _nodeText1, onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues.setPatientID = - 0 - : _patientSearchFormValues.setPatientID = + if (value != null && value != '') { + if (value.length == 10 && + (value[0] == '2' || value[0] == '1')) { + _patientSearchFormValues + .IdentificationNo = value; + _patientSearchFormValues.Searchtype = 2; + _patientSearchFormValues.setPatientID = 0; + } else if ((value.length == 10 || + value.length == 9) && + (value[0] == '05' || value[0] == '5')) { + _patientSearchFormValues.MobileNo = value; + _patientSearchFormValues.Searchtype = 0; + _patientSearchFormValues.setPatientID = 0; + } else { + _patientSearchFormValues.setPatientID = int.parse(value); - - if (value != null && - value.toString().trim().isEmpty) { - _patientSearchFormValues.setPatientID = 0; + _patientSearchFormValues.Searchtype = 1; + } } + + // else{ + + // } + + // value == null || value == '' + // ? _patientSearchFormValues.setPatientID = + // 0 + // : _patientSearchFormValues.setPatientID = + // int.parse(value); + + // if (value != null && + // value.toString().trim().isEmpty) { + // _patientSearchFormValues.setPatientID = 0; + // } }, ), ), SizedBox( height: 10, ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - InkWell( - child: this.isView == false - ? AppText( - TranslationBase.of(context) - .searchWithOther, - color: Colors.red, - fontWeight: FontWeight.bold, - ) - : AppText( - TranslationBase.of(context) - .hideOtherCriteria, - color: Colors.red, - fontWeight: FontWeight.bold), - onTap: () { - setState(() { - this.isView = !this.isView; - }); - }, - ) - ], - ), + // Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // InkWell( + // child: this.isView == false + // ? AppText( + // TranslationBase.of(context) + // .searchWithOther, + // color: Colors.red, + // fontWeight: FontWeight.bold, + // ) + // : AppText( + // TranslationBase.of(context) + // .hideOtherCriteria, + // color: Colors.red, + // fontWeight: FontWeight.bold), + // onTap: () { + // setState(() { + // this.isView = !this.isView; + // }); + // }, + // ) + // ], + // ), isView == true ? Column(children: [ SizedBox( diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 0efd3a95..e9b5f1a8 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -16,6 +16,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/patients/clinic_list_dropdwon.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -83,7 +84,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; @@ -250,7 +270,10 @@ class _PatientsScreenState extends State { } if (routeArgs != null && routeArgs.containsKey("isSearch")) { isView = routeArgs['isView']; - patient.Searchtype = 1; + //patient.Searchtype = 1; + } + if (routeArgs != null && routeArgs.containsKey('activeFilter')) { + _activeLocation = routeArgs['activeFilter']; } if (!projectsProvider.isArabic) @@ -310,34 +333,34 @@ class _PatientsScreenState extends State { } parsed = lItems; responseModelList = new ModelResponse.fromJson(parsed).list; - //if (val2 == 7) { - responseModelList.sort((a, b) { - if (b.startTime != null && b.startTime != null) { - try { - DateTime now = DateTime.now(); - DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); - String formattedDate = - DateFormat('yyyy-MM-dd ' + a.startTime).format(now); - DateTime dateTimeA = dateFormat.parse(formattedDate); - String formattedDateB = - DateFormat('yyyy-MM-dd ' + b.startTime).format(now); - DateTime dateTimeB = dateFormat.parse(formattedDateB); - var adate = dateTimeA; //a.startTime; - var bdate = dateTimeB; - return adate.compareTo(bdate); - } on Exception catch (_) { - print('never reached'); - var adate = a.startTime; //a.startTime; - var bdate = b.startTime; - return adate.compareTo(bdate); + if (val2 == 7) { + responseModelList.sort((a, b) { + if (b.startTime != null && b.startTime != null) { + try { + DateTime now = DateTime.now(); + DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); + String formattedDate = + DateFormat('yyyy-MM-dd ' + a.startTime).format(now); + DateTime dateTimeA = dateFormat.parse(formattedDate); + String formattedDateB = + DateFormat('yyyy-MM-dd ' + b.startTime).format(now); + DateTime dateTimeB = dateFormat.parse(formattedDateB); + var adate = dateTimeA; //a.startTime; + var bdate = dateTimeB; + return adate.compareTo(bdate); + } on Exception catch (_) { + print('never reached'); + var adate = a.startTime; //a.startTime; + var bdate = b.startTime; + return adate.compareTo(bdate); + } + } else { + var adate = convertDateFormat(a.appointmentDate); + var bdate = convertDateFormat(b.appointmentDate); + return bdate.compareTo(adate); } - } else { - var adate = convertDateFormat(a.appointmentDate); - var bdate = convertDateFormat(b.appointmentDate); - return bdate.compareTo(adate); - } - }); - //} + }); + } responseModelList2 = responseModelList; _isError = false; } else { @@ -540,48 +563,74 @@ class _PatientsScreenState extends State { // color: Color(0xffCCCCCC), // ), Container( - // decoration: BoxDecoration( - // color: Color(0Xffffffff), - // borderRadius: - // BorderRadius.circular(20)), - child: (responseModelList.length > 0) - ? Column( - // mainAxisAlignment: MainAxisAlignment.center, - children: responseModelList - .map((PatiantInformtion - item) { - return PatientCard( - patientInfo: item, - patientType: patientType, - arrivalType: arrivalType, - onTap: () { - Navigator.of(context) - .pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": item, - "patientType": - patientType, - "from": patient - .getFrom, - "to": - patient.getTo, - "isSearch": - isSearch, - "arrivalType": - arrivalType, - }); - }, - ); - }).toList(), - ) - : Center( - child: DrAppEmbeddedError( - error: TranslationBase.of( - context) - .youDontHaveAnyPatient), - ), - ), + // decoration: BoxDecoration( + // color: Color(0Xffffffff), + // borderRadius: + // BorderRadius.circular(20)), + child: (responseModelList.length > + 0) + ? Column( + // mainAxisAlignment: MainAxisAlignment.center, + children: responseModelList + .map((PatiantInformtion + item) { + return PatientCard( + patientInfo: item, + patientType: + patientType, + arrivalType: + arrivalType, + onTap: () { + Navigator.of(context) + .pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": item, + "patientType": + patientType, + "from": patient + .getFrom, + "to": patient + .getTo, + "isSearch": + isSearch, + "arrivalType": + arrivalType, + }); + }, + ); + }).toList(), + ) + : Center( + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + SizedBox( + height: 100, + ), + Image.asset( + 'assets/images/no-data.png'), + Padding( + padding: + const EdgeInsets + .all(8.0), + child: Texts( + TranslationBase.of( + context) + .youDontHaveAnyPatient), + ) + ], + ), + ) + // : Center( + // child: DrAppEmbeddedError( + // error: TranslationBase.of( + // context) + // .youDontHaveAnyPatient), + // ), + ), ], ), ) @@ -752,11 +801,12 @@ class _PatientsScreenState extends State { )), ), onTap: () { - filterBooking(item.toString()); + //filterBooking(item.toString()); setState(() { _activeLocation = _locations.indexOf(item); }); + filterPatient(item.toString()); }), _isActive ? Container( @@ -775,4 +825,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 + }); + } } diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index deb9fe53..cab5f9e9 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -1264,75 +1264,68 @@ class _PrescriptionFormWidgetState extends State { if (formKey.currentState .validate()) { Navigator.pop(context); - //openDrugToDrug(model); + openDrugToDrug(model); { - // var x = model - // .patientAssessmentList - // .map((value) => - // value.icdCode10ID) - // .toList() - // .join(','); - - postProcedure( - icdCode: model - .patientAssessmentList - .isNotEmpty - ? model - .patientAssessmentList[ - 0] - .icdCode10ID - .isEmpty - ? "test" - : model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString() - : "test", - // icdCode: model - // .patientAssessmentList - // .map((value) => value - // .icdCode10ID - // .trim()) - // .toList() - // .join(' '), - dose: - strengthController - .text, - doseUnit: units[ - 'parameterCode'] - .toString(), - patient: - widget.patient, - doseTimeIn: - doseTime['id'] - .toString(), - model: widget.model, - duration: - duration['id'] - .toString(), - frequency: frequency[ - 'parameterCode'] - .toString(), - route: route[ - 'parameterCode'] - .toString(), - drugId: - _selectedMedication - .itemId - .toString(), - strength: - strengthController - .text, - indication: - indicationController - .text, - instruction: - instructionController - .text, - doseTime: - selectedDate, - ); + // postProcedure( + // icdCode: model + // .patientAssessmentList + // .isNotEmpty + // ? model + // .patientAssessmentList[ + // 0] + // .icdCode10ID + // .isEmpty + // ? "test" + // : model + // .patientAssessmentList[ + // 0] + // .icdCode10ID + // .toString() + // : "test", + // // icdCode: model + // // .patientAssessmentList + // // .map((value) => value + // // .icdCode10ID + // // .trim()) + // // .toList() + // // .join(' '), + // dose: + // strengthController + // .text, + // doseUnit: units[ + // 'parameterCode'] + // .toString(), + // patient: + // widget.patient, + // doseTimeIn: + // doseTime['id'] + // .toString(), + // model: widget.model, + // duration: + // duration['id'] + // .toString(), + // frequency: frequency[ + // 'parameterCode'] + // .toString(), + // route: route[ + // 'parameterCode'] + // .toString(), + // drugId: + // _selectedMedication + // .itemId + // .toString(), + // strength: + // strengthController + // .text, + // indication: + // indicationController + // .text, + // instruction: + // instructionController + // .text, + // doseTime: + // selectedDate, + // ); } } @@ -1432,7 +1425,7 @@ class _PrescriptionFormWidgetState extends State { context: context, builder: (context) { return Container( - height: SizeConfig.realScreenHeight * .5, + height: SizeConfig.realScreenHeight * .8, width: SizeConfig.realScreenWidth, child: SingleChildScrollView( child: Column( @@ -1448,6 +1441,7 @@ class _PrescriptionFormWidgetState extends State { title: TranslationBase.of(context).addMedication, onPressed: () { Navigator.pop(context); + postProcedure( icdCode: model.patientAssessmentList.isNotEmpty ? model.patientAssessmentList[0].icdCode10ID @@ -1477,6 +1471,36 @@ class _PrescriptionFormWidgetState extends State { instruction: instructionController.text, doseTime: selectedDate, ); + + // postProcedure( + // icdCode: model.patientAssessmentList.isNotEmpty + // ? model.patientAssessmentList[0].icdCode10ID + // .isEmpty + // ? "test" + // : model.patientAssessmentList[0].icdCode10ID + // .toString() + // : "test", + // // icdCode: model + // // .patientAssessmentList + // // .map((value) => value + // // .icdCode10ID + // // .trim()) + // // .toList() + // // .join(' '), + // dose: strengthController.text, + // doseUnit: units['parameterCode'].toString(), + // patient: widget.patient, + // doseTimeIn: doseTime['id'].toString(), + // model: widget.model, + // duration: duration['id'].toString(), + // frequency: frequency['parameterCode'].toString(), + // route: route['parameterCode'].toString(), + // drugId: _selectedMedication.itemId.toString(), + // strength: strengthController.text, + // indication: indicationController.text, + // instruction: instructionController.text, + // doseTime: selectedDate, + // ); }, )) ], diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 41f7c6aa..bd753080 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -80,11 +80,11 @@ class AddRescheduleLeavScreen extends StatelessWidget { border: Border( left: BorderSide( color: item.status == 10 - ? Colors.green + ? Colors.red[800] : item.status == 2 ? HexColor('#CC9B14') : item.status == 9 - ? Colors.red[800] + ? Colors.green : Colors.red, width: 5.0, ))), @@ -109,29 +109,14 @@ class AddRescheduleLeavScreen extends StatelessWidget { margin: EdgeInsets.only(top: 10), child: AppText( - item.status == 10 - ? TranslationBase.of( - context) - .accepted - : item.status == 2 - ? TranslationBase.of( - context) - .pending - : item.status == 9 - ? TranslationBase - .of( - context) - .rejected - : TranslationBase - .of(context) - .cancelled, + item.statusDescription, fontWeight: FontWeight.bold, color: item.status == 10 - ? Colors.green + ? Colors.red[800] : item.status == 2 ? HexColor('#CC9B14') : item.status == 9 - ? Colors.red[800] + ? Colors.green : Colors.red, fontSize: 14, ), diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 87071e6e..45088b8d 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -243,21 +243,21 @@ class AddSickLeavScreen extends StatelessWidget { ) : patient.patientStatusType != 43 ? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(height: 100,), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts('No Sick Leave Found'), - ) - - ], - ), - ) + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: 100, + ), + Image.asset('assets/images/no-data.png'), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('No Sick Leave Found'), + ) + ], + ), + ) : SizedBox() - ])))); } diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart index 94624b5e..6085dc19 100644 --- a/lib/screens/sick-leave/show-sickleave.dart +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -128,8 +128,7 @@ class ShowSickLeaveScreen extends StatelessWidget { AppText( item.remarks ?? "", ), - (item.status == 1 || - item.status == 2) + (item.status == 1) ? IconButton( icon: Image.asset( 'assets/images/edit.png'), diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 8a4cfbd0..7874cc82 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -423,6 +423,10 @@ class Helpers { } static String capitalize(str) { - return "${str[0].toUpperCase()}${str.substring(1).toLowerCase()}"; + if (str != "") { + return "${str[0].toUpperCase()}${str.substring(1).toLowerCase()}"; + } else { + return str; + } } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 0a0248a6..06b34678 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -624,8 +624,7 @@ class TranslationBase { String get applyOrRescheduleLeave => localizedValues['applyOrRescheduleLeave'][locale.languageCode]; - String get myQRCode => - localizedValues['myQRCode'][locale.languageCode]; + String get myQRCode => localizedValues['myQRCode'][locale.languageCode]; String get addMedication => localizedValues['addMedication'][locale.languageCode]; @@ -1216,13 +1215,16 @@ class TranslationBase { String get remove => localizedValues['remove'][locale.languageCode]; String get step => localizedValues['step'][locale.languageCode]; - String get fieldRequired => localizedValues['fieldRequired'][locale.languageCode]; + String get fieldRequired => + localizedValues['fieldRequired'][locale.languageCode]; String get noSickLeave => localizedValues['no-sickleve'][locale.languageCode]; String get changeOfSchedule => localizedValues['changeOfSchedule'][locale.languageCode]; String get newSchedule => localizedValues['newSchedule'][locale.languageCode]; String get enterCredentials => localizedValues['enter_credentials'][locale.languageCode]; + String get patpatientIDMobilenationalientID => + localizedValues['patientIDMobilenational'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index f64221b8..42028dcc 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -857,7 +857,8 @@ class _VerificationMethodsState extends State { authProv.setDoctorProfile(doctor); sharedPref.setObj(DOCTOR_PROFILE, profile); projectsProvider.isLogin = true; - Navigator.of(context).pushReplacementNamed(HOME); + + Navigator.of(context).popAndPushNamed(HOME); } getDocProfiles(ClinicModel clinicInfo, authProv) { diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 75cfbf7c..faa7fee5 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -129,14 +129,17 @@ class PatientCard extends StatelessWidget { children: [ AppText( patientInfo.nationalityName != null - ? patientInfo.nationalityName + ? patientInfo.nationalityName.trim() : patientInfo.nationality != null - ? patientInfo.nationality - : "", + ? patientInfo.nationality.trim() + : patientInfo.nationalityId != null + ? patientInfo.nationalityId + : "", fontWeight: FontWeight.bold, fontSize: 14, ), - patientInfo.nationality != null + patientInfo.nationality != null || + patientInfo.nationalityId != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design.dart b/lib/widgets/patients/profile/patient-profile-header-new-design.dart index 0349fb6c..a626ac7f 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -17,7 +17,8 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { final double height; PatientProfileHeaderNewDesign( - this.patient, this.patientType, this.arrivalType, {this.height = 0.0}); + this.patient, this.patientType, this.arrivalType, + {this.height = 0.0}); @override Widget build(BuildContext context) { @@ -155,7 +156,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { color: HexColor("#20A169"), ), child: AppText( - patient.startTime??"", + patient.startTime ?? "", color: Colors.white, fontSize: 1.5 * SizeConfig.textMultiplier, textAlign: TextAlign.center, @@ -208,7 +209,10 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { Row( children: [ AppText( - patient.nationalityName ?? patient.nationality?? patient.nationalityId ?? '', + patient.nationalityName ?? + patient.nationality ?? + patient.nationalityId ?? + '', fontWeight: FontWeight.bold, fontSize: 12, ),