diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 74f3da60..fc70a2ca 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -837,21 +837,16 @@ 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" + }, + "myQRCode": {"en": "My QR Code", "ar": "My QR Code"}, + "patientIDMobilenational": { + "en": "Patient ID, National ID, Mobile Number", + "ar": "هوية المريض ، الهوية الوطنية ، رقم الهاتف المحمول" }, }; diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 0ae5452b..bcd118c3 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -180,54 +180,73 @@ 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 + .PatientIdentificationID = value; + } else if (value.length == 10 && + (value[0] == '05' || value[0] == '5')) { + _patientSearchFormValues + .setPatientMobileNumber = value; + } else { + _patientSearchFormValues.setPatientID = int.parse(value); - - if (value != null && - value.toString().trim().isEmpty) { - _patientSearchFormValues.setPatientID = 0; + } } + + // 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/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/patients/profile/patient-profile-header-new-design.dart b/lib/widgets/patients/profile/patient-profile-header-new-design.dart index 2453f382..ebde0946 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,9 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { Row( children: [ AppText( - patient.nationalityName ?? patient.nationality??'', + patient.nationalityName ?? + patient.nationality ?? + '', fontWeight: FontWeight.bold, fontSize: 12, ),