diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d0cd8720..3048a39d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -519,13 +519,21 @@ const Map> localizedValues = { 'en': "You make referral successfully", 'ar': "You make referral successfully" }, - 'diagnoseType': {'en': "Diagnose Type", 'ar':"نوع التشخيص" }, - 'condition': {'en': "Condition", 'ar':"الحالة" }, - 'id': {'en': "ID", 'ar':"بطاقة هوية" }, - 'quantity': {'en': "Quantity", 'ar':"الكمية" }, - 'codeNo': {'en': "Code #", 'ar':"# الرمز" }, - 'covered': {'en': "Covered", 'ar':"مغطى" }, - 'approvalRequired': {'en': "Approval Required", 'ar':"الموافقة مطلوبة" }, - 'uncoveredByDoctor': {'en': "Uncovered By Doctor", 'ar':"غير مغطى من قبل الدكتور" }, - 'chiefComplaintEmptyMsg': {'en': "There is no Chief Complaint", 'ar':"ليس هناك شكوى رئيس" }, + 'fromTime': {'en': "From Time", 'ar': "من وقت"}, + 'toTime': {'en': "To Time", 'ar': "الى وقت"}, + 'diagnoseType': {'en': "Diagnose Type", 'ar': "نوع التشخيص"}, + 'condition': {'en': "Condition", 'ar': "الحالة"}, + 'id': {'en': "ID", 'ar': "بطاقة هوية"}, + 'quantity': {'en': "Quantity", 'ar': "الكمية"}, + 'codeNo': {'en': "Code #", 'ar': "# الرمز"}, + 'covered': {'en': "Covered", 'ar': "مغطى"}, + 'approvalRequired': {'en': "Approval Required", 'ar': "الموافقة مطلوبة"}, + 'uncoveredByDoctor': { + 'en': "Uncovered By Doctor", + 'ar': "غير مغطى من قبل الدكتور" + }, + 'chiefComplaintEmptyMsg': { + 'en': "There is no Chief Complaint", + 'ar': "ليس هناك شكوى رئيس" + }, }; diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index d5aba154..5e86249c 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -99,6 +99,7 @@ class SickLeaveViewModel extends BaseViewModel { Future addReschedule(request) async { setState(ViewState.Busy); await _sickLeaveService.addReschedule(request); + notifyListeners(); if (_sickLeaveService.hasError) { error = _sickLeaveService.error; setState(ViewState.Error); diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index ad693f47..1e3b4739 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -124,10 +124,12 @@ class _MedicalFilePageState extends State { 'Doctor : '.toUpperCase(), fontWeight: FontWeight.w700, ), - AppText( - model.medicalFileList[0].entityList[0] - .timelines[index].doctorName, - fontWeight: FontWeight.w700, + Expanded( + child: AppText( + model.medicalFileList[0].entityList[0] + .timelines[index].doctorName, + fontWeight: FontWeight.w700, + ), ), ], ), diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 33b2606c..602bd180 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -466,25 +466,17 @@ class _PatientsScreenState extends State { height: 10.0, ), - Padding( - padding: EdgeInsets.symmetric( - vertical: - 5.5, - horizontal: - 22.5), - child: - AppText( + AppText( item.firstName + - " " + - item.lastName, + " " + + item.lastName, fontSize: - 2.0 * SizeConfig.textMultiplier, + 2.0 * SizeConfig.textMultiplier, fontWeight: - FontWeight.bold, + FontWeight.bold, backGroundcolor: - Colors.white, + Colors.white, ), - ), ], ), Row( diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index f39499e1..405f240b 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -696,7 +696,7 @@ class _PrescriptionFormWidgetState extends State { selectDate(BuildContext context, PrescriptionViewModel model) async { DateTime selectedDate; - selectedDate = DateTime.now().add(Duration(hours: 10)); + selectedDate = DateTime.now().add(Duration(hours: 15)); final DateTime picked = await showDatePicker( context: context, initialDate: selectedDate, diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 2067029f..685259b4 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -299,7 +299,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { getDoctor(model, doctorId) { var obj; obj = model.where((i) => i['doctorID'].toString() == doctorId).toList(); - print(obj); + //print(obj); return obj.length > 0 ? obj[0]['doctorName'] : ""; } @@ -307,7 +307,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { getReasons(model, reasonID) { var obj; obj = model.where((i) => i['id'] == reasonID).toList(); - print(obj); + //print(obj); return obj.length > 0 ? projectsProvider.isArabic == true diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 362e27d9..bdd87499 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -24,6 +24,7 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import 'package:provider/provider.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; Helpers helpers = Helpers(); @@ -49,13 +50,40 @@ class _RescheduleLeaveScreen extends State { var fromDate; var toDate; var clinicID; + var fromTime; + var toTime; TextEditingController _controller4; void _presentDatePicker(id) { var date = new DateTime.now(); + var initialDate = id == 'fromDate' + ? new DateTime(date.year, date.month, date.day + 15) + : new DateTime(fromDate.year, fromDate.month, fromDate.day); + var firstDate = id == 'fromDate' + ? new DateTime(date.year, date.month, date.day + 15) + : new DateTime(fromDate.year, fromDate.month, fromDate.day); showDatePicker( context: context, - initialDate: new DateTime(date.year, date.month, date.day + 15), - firstDate: new DateTime(date.year, date.month, date.day + 15), + initialDate: initialDate, + firstDate: firstDate, + lastDate: DateTime(2050), + ).then((pickedDate) { + if (pickedDate == null) { + return; + } + setState(() { + final df = new DateFormat('yyyy-MM-dd'); + fromDate = pickedDate; //df.format(); + _toDateController.text = df.format(pickedDate); + toDate = pickedDate; + }); + }); + } + + void _presentCurrentDate(id) { + showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime.now(), lastDate: DateTime(2050), ).then((pickedDate) { if (pickedDate == null) { @@ -328,7 +356,7 @@ class _RescheduleLeaveScreen extends State { TextInputType.number, controller: _toDateController, onTap: () { - _presentDatePicker( + _presentCurrentDate( 'fromDate'); }, inputFormatter: ONLY_DATE, @@ -355,14 +383,11 @@ class _RescheduleLeaveScreen extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - // new AppTextFormField( - // readOnly: true, - // hintText: "", - // borderColor: Colors.white, - // onSaved: (value) {}, - // inputFormatter: ONLY_NUMBERS), - DateTimePicker( + timeHintText: + TranslationBase.of( + context) + .fromTime, type: DateTimePickerType.time, controller: _controller4, @@ -373,6 +398,7 @@ class _RescheduleLeaveScreen extends State { //locale: Locale('en', 'US'), onChanged: (val) => () { print(val); + this.fromTime = val; }, validator: (val) { print(val); @@ -403,16 +429,15 @@ class _RescheduleLeaveScreen extends State { CrossAxisAlignment.start, children: [ DateTimePicker( + timeHintText: + TranslationBase.of( + context) + .toTime, type: DateTimePickerType.time, controller: _controller4, - //initialValue: _initialValue, - // icon: Icon(Icons.access_time), - - //use24HourFormat: false, - //locale: Locale('en', 'US'), onChanged: (val) => () { - print(val); + this.toTime = val; }, validator: (val) { print(val); @@ -761,7 +786,7 @@ class _RescheduleLeaveScreen extends State { "clinicId": this.profile['ClinicID'], "doctorId": this.profile['DoctorID'], "dateTimeFrom": df.format(fromDate), - "dateTimeTo": df.format(toDate), + "dateTimeTo": toDate != null ? df.format(toDate) : df.format(fromDate), "date": df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, "coveringDoctorId": @@ -772,8 +797,8 @@ class _RescheduleLeaveScreen extends State { "weekDayId": 1, "shiftId": 1, "isOpen": true, - "timeFrom": null, - "timeTo": null, + "timeFrom": fromTime, + "timeTo": toTime, "timeFromstr": "", "timeTostr": "" } @@ -784,7 +809,13 @@ class _RescheduleLeaveScreen extends State { model.addReschedule(request).then((response) { DrAppToastMsg.showSuccesToast(TranslationBase.of(context).leaveCreated); Navigator.pop(context); - model.getRescheduleLeave(); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddRescheduleLeavScreen(), + // MyReferredPatient(), + ), + ); }); } @@ -797,7 +828,7 @@ class _RescheduleLeaveScreen extends State { "clinicId": this.profile['ClinicID'], "doctorId": this.profile['DoctorID'], "dateTimeFrom": df.format(fromDate), - "dateTimeTo": df.format(toDate), + "dateTimeTo": toDate != null ? df.format(toDate) : df.format(fromDate), "date": df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, "coveringDoctorId": @@ -808,8 +839,8 @@ class _RescheduleLeaveScreen extends State { "weekDayId": 1, "shiftId": 1, "isOpen": true, - "timeFrom": null, - "timeTo": null, + "timeFrom": fromTime, + "timeTo": toTime, "timeFromstr": "", "timeTostr": "" } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index e2cba7f3..b167b48e 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -289,6 +289,10 @@ class TranslationBase { String get toDate => localizedValues['toDate'][locale.languageCode]; + String get fromTime => localizedValues['fromTime'][locale.languageCode]; + + String get toTime => localizedValues['toTime'][locale.languageCode]; + String get searchPatientImageCaptionTitle => localizedValues['searchPatientImageCaptionTitle'][locale.languageCode]; diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index f50c7669..7f49c868 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -94,7 +94,7 @@ class PatientProfileWidget extends StatelessWidget { color: Color(0xffCCCCCC), ), Container( - height: 10 * SizeConfig.textMultiplier, + height: 11 * SizeConfig.textMultiplier, child: Row( children: [ Expanded( @@ -232,14 +232,16 @@ class PatientProfileWidget extends StatelessWidget { SizeConfig.textMultiplier, ), ), - AppText( - patient.admissionDate != null - ? "${DateUtils.convertDateFromServerFormat(patient.admissionDate, 'EEEE dd, MMMM yyyy hh:mm a')}" - : "", - color: Colors.black, - fontWeight: FontWeight.normal, - fontSize: - 1.6 * SizeConfig.textMultiplier, + Expanded( + child: AppText( + patient.admissionDate != null + ? "${DateUtils.convertDateFromServerFormat(patient.admissionDate, 'EEEE dd, MMMM yyyy hh:mm a')}" + : "", + color: Colors.black, + fontWeight: FontWeight.normal, + fontSize: + 1.6 * SizeConfig.textMultiplier, + ), ), ], ), @@ -374,13 +376,15 @@ class PatientProfileWidget extends StatelessWidget { SizedBox( width: 4, ), - AppText( - "${patient.nursingStationName}\n${patient.roomId}", - fontWeight: - FontWeight.normal, - fontSize: 1.4 * - SizeConfig - .textMultiplier, + Expanded( + child: AppText( + "${patient.nursingStationName}\n${patient.roomId}", + fontWeight: + FontWeight.normal, + fontSize: 1.4 * + SizeConfig + .textMultiplier, + ), ), ], ), diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index e3aef3f4..37a5d72f 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -505,6 +505,8 @@ class _AddExaminationDailogState extends State { baseViewModel: model, child: MasterKeyCheckboxSearchWidget( model: model, + hintSearchText: 'Search Examination', + buttonName: 'Add Examination', masterList: model.physicalExaminationList, removeHistory: (history){ setState(() {