From 7afe24c2bc1644a01dcec9dd1aab4d27d08aff03 Mon Sep 17 00:00:00 2001 From: RoaaGhali98 Date: Tue, 25 Jan 2022 16:53:36 +0200 Subject: [PATCH] Refactor add_prescription_form --- lib/core/viewModel/medicine_view_model.dart | 91 ++++ .../live-care_transfer_to_admin.dart | 10 +- .../medicine/medicine_search_screen.dart | 6 +- .../profile/notes/note/update_note.dart | 10 +- .../update_operation_report.dart | 2 +- .../referral/AddReplayOnReferralPatient.dart | 10 +- .../refer-patient-screen-in-patient.dart | 10 +- .../add_prescription_form.dart | 428 +++++++++--------- .../{ => add_prescription}/drugtodrug.dart | 0 .../update_prescription_form.dart | 0 .../prescription_authorazation_form.dart | 1 - .../prescription_checkout_screen.dart | 46 +- .../prescription_details_page.dart | 168 ------- .../prescription/prescription_items_page.dart | 3 + .../prescription/prescription_warnings.dart | 168 ------- .../prescription/prescriptions_page.dart | 3 +- .../base_add_procedure_tab_page.dart | 2 +- .../entity_list_checkbox_search_widget.dart | 4 +- .../procedures/entity_list_fav_procedure.dart | 3 +- lib/screens/procedures/update-procedure.dart | 4 +- .../shared/dialogs/dailog-list-select.dart | 4 +- .../shared/text_fields/html_rich_editor.dart | 2 +- 22 files changed, 358 insertions(+), 617 deletions(-) rename lib/screens/prescription/{ => add_prescription}/add_prescription_form.dart (85%) rename lib/screens/prescription/{ => add_prescription}/drugtodrug.dart (100%) rename lib/screens/prescription/{ => add_prescription}/update_prescription_form.dart (100%) delete mode 100644 lib/screens/prescription/prescription_authorazation_form.dart delete mode 100644 lib/screens/prescription/prescription_details_page.dart delete mode 100644 lib/screens/prescription/prescription_warnings.dart diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index 6b63d999..7505265e 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/medicine_service.dart'; @@ -7,12 +8,20 @@ import 'package:doctor_app_flutter/core/service/patient_medical_file/prescriptio import 'package:doctor_app_flutter/core/service/patient_medical_file/procedure/procedure_service.dart'; import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentResModel.dart'; +import 'package:flutter/cupertino.dart'; import '../../locator.dart'; +import '../model/Prescriptions/prescription_model.dart'; import 'base_view_model.dart'; class MedicineViewModel extends BaseViewModel { bool hasError = false; + // dynamic route; + // dynamic frequency; + // dynamic duration; + // dynamic units; + + MedicineService _medicineService = locator(); ProcedureService _procedureService = locator(); PrescriptionService _prescriptionService = locator(); @@ -21,6 +30,8 @@ class MedicineViewModel extends BaseViewModel { _procedureService.templateList; List templateList = List(); + GetMedicationResponseModel _selectedMedication; + get pharmacyItemsList => _medicineService.pharmacyItemsList; get searchText => _medicineService.searchText; @@ -56,6 +67,10 @@ class MedicineViewModel extends BaseViewModel { List get itemMedicineListUnit => _prescriptionService.itemMedicineListUnit; + + + + Future getItem({int itemID}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); @@ -90,6 +105,82 @@ class MedicineViewModel extends BaseViewModel { print(templateList.length.toString()); } + + + + getPrescriptionForDrug( + List prescriptionList, + MedicineViewModel model, + ) { + var prescriptionDetails = []; + if (prescriptionList.length > 0) { + prescriptionList[0].entityList.forEach((element) { + if (element.mediSpanGPICode != null) { + prescriptionDetails.add({ + 'DrugId': element.mediSpanGPICode, + 'DrugName': element.medicationName, + 'Dose': element.doseDailyQuantity, + 'DoseType': element.doseDailyUnitID, + 'Unit': element.uom, + 'FrequencyType': element.frequencyID, + 'Duration': element.doseDurationDays, + 'RouteID': element.routeID, + 'IsScreen': element.isSIG + }); + } + }); + } + // if (_selectedMedication.mediSpanGPICode != null) { + // prescriptionDetails.add({ + // 'DrugId': _selectedMedication.mediSpanGPICode, + // 'DrugName': _selectedMedication.description, + // // 'Dose': strengthController.text, + // 'DoseType': model.itemMedicineListUnit.length == 1 + // ? model.itemMedicineListUnit[0]['parameterCode'].toString() + // : units['parameterCode'].toString(), + // 'Unit': model.itemMedicineListUnit.length == 1 + // ? model.itemMedicineListUnit[0]['description'] + // : units['description'], + // 'FrequencyType': model.itemMedicineList.length == 1 + // ? model.itemMedicineList[0]['parameterCode'].toString() + // : frequency['parameterCode'].toString(), + // 'Duration': duration['id'].toString(), + // 'RouteID': model.itemMedicineListRoute.length == 1 + // ? model.itemMedicineListRoute[0]['parameterCode'].toString() + // : route['parameterCode'].toString(), + // 'IsScreen': true + // }); + // } + return prescriptionDetails; + } + + + + Future getAssessmentList ({ + PatiantInformtion patientInfo, + bool isBusyLocal = false + }) async { + patientAssessmentList.map((element) { + return element.icdCode10ID; + }); + GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( + patientMRN: patientInfo.patientMRN, + episodeID: patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: '', + appointmentNo: patientInfo.appointmentNo); + if (medicationStrengthList.length == 0) { + await getMedicationStrength(); + } + if (medicationDurationList.length == 0) { + await getMedicationDuration(); + } + if (medicationDoseTimeList.length == 0) { + await getMedicationDoseTime(); + } + await getPatientAssessment(getAssessmentReqModel); + } + Future getProcedureTemplate({String categoryID}) async { hasError = false; setState(ViewState.Busy); diff --git a/lib/screens/live_care/live-care_transfer_to_admin.dart b/lib/screens/live_care/live-care_transfer_to_admin.dart index 921666e8..4cd9a3a0 100644 --- a/lib/screens/live_care/live-care_transfer_to_admin.dart +++ b/lib/screens/live_care/live-care_transfer_to_admin.dart @@ -32,7 +32,7 @@ class LivaCareTransferToAdmin extends StatefulWidget { class _LivaCareTransferToAdminState extends State { stt.SpeechToText speech = stt.SpeechToText(); - var reconizedWord; + var recognizedWord; var event = RobotProvider(); ProjectViewModel projectViewModel; @@ -168,7 +168,7 @@ class _LivaCareTransferToAdminState extends State { } void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } void requestPermissions() async { @@ -178,14 +178,14 @@ class _LivaCareTransferToAdminState extends State { } void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); + recognizedWord = result.recognizedWords; + event.setValue({"searchText": recognizedWord}); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - noteController.text += reconizedWord + '\n'; + noteController.text += recognizedWord + '\n'; }); } else { print(result.finalResult); diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index a845bde2..aef2ff05 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -58,7 +58,7 @@ class _MedicineSearchState extends State { double level = 0.0; double minSoundLevel = 50000; double maxSoundLevel = -50000; - String reconizedWord; + String recognizedWord; @override void didChangeDependencies() { @@ -264,9 +264,9 @@ class _MedicineSearchState extends State { void resultListener(SpeechRecognitionResult result) { setState(() { // lastWords = "${result.recognizedWords} - ${result.finalResult}"; - reconizedWord = result.recognizedWords; + recognizedWord = result.recognizedWords; lastStatus = ''; - myController.text = reconizedWord; + myController.text = recognizedWord; Future.delayed(const Duration(seconds: 2), () { // searchMedicine(context); }); diff --git a/lib/screens/patients/profile/notes/note/update_note.dart b/lib/screens/patients/profile/notes/note/update_note.dart index f1395bff..10b3c30d 100644 --- a/lib/screens/patients/profile/notes/note/update_note.dart +++ b/lib/screens/patients/profile/notes/note/update_note.dart @@ -51,7 +51,7 @@ class _UpdateNoteOrderState extends State { int selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); - var reconizedWord; + var recognizedWord; var event = RobotProvider(); ProjectViewModel projectViewModel; @@ -296,7 +296,7 @@ class _UpdateNoteOrderState extends State { } void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } void requestPermissions() async { @@ -306,14 +306,14 @@ class _UpdateNoteOrderState extends State { } void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); + recognizedWord = result.recognizedWords; + event.setValue({"searchText": recognizedWord}); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - progressNoteController.text += reconizedWord + '\n'; + progressNoteController.text += recognizedWord + '\n'; }); } else { print(result.finalResult); diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index 2ea38254..882bacc8 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -47,7 +47,7 @@ class _UpdateOperationReportState extends State { int selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); - var reconizedWord; + var recognizedWord; var event = RobotProvider(); ProjectViewModel projectViewModel; diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index 0c2c4d8d..835339ea 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -46,7 +46,7 @@ class _AddReplayOnReferralPatientState int replay = 1; int reject = 2; stt.SpeechToText speech = stt.SpeechToText(); - var reconizedWord; + var recognizedWord; var event = RobotProvider(); TextEditingController replayOnReferralController = TextEditingController(); @@ -248,7 +248,7 @@ class _AddReplayOnReferralPatientState void errorListener(SpeechRecognitionError error) {} void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } void requestPermissions() async { @@ -258,13 +258,13 @@ class _AddReplayOnReferralPatientState } void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); + recognizedWord = result.recognizedWords; + event.setValue({"searchText": recognizedWord}); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); - replayOnReferralController.text += reconizedWord + '\n'; + replayOnReferralController.text += recognizedWord + '\n'; }); } } diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index ad78e895..8b229479 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -49,7 +49,7 @@ class _PatientMakeInPatientReferralScreenState String doctorError; String frequencyError; stt.SpeechToText speech = stt.SpeechToText(); - var reconizedWord; + var recognizedWord; var event = RobotProvider(); @override @@ -88,7 +88,7 @@ class _PatientMakeInPatientReferralScreenState } void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } void requestPermissions() async { @@ -98,14 +98,14 @@ class _PatientMakeInPatientReferralScreenState } void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); + recognizedWord = result.recognizedWords; + event.setValue({"searchText": recognizedWord}); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - _remarksController.text += reconizedWord + '\n'; + _remarksController.text += recognizedWord + '\n'; }); } else { print(result.finalResult); diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription/add_prescription_form.dart similarity index 85% rename from lib/screens/prescription/add_prescription_form.dart rename to lib/screens/prescription/add_prescription/add_prescription_form.dart index 6e5c57fb..be614389 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription/add_prescription_form.dart @@ -15,7 +15,7 @@ import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/core/model/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/prescription/drugtodrug.dart'; +import 'package:doctor_app_flutter/screens/prescription/add_prescription/drugtodrug.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -122,8 +122,8 @@ class _PrescriptionFormWidgetState extends State { TextEditingController indicationController = TextEditingController(); TextEditingController instructionController = TextEditingController(); - bool visbiltyPrescriptionForm = false; - bool visbiltySearch = true; + bool visibilityPrescriptionForm = false; + bool visibilitySearch = true; final myController = TextEditingController(); DateTime selectedDate; @@ -137,10 +137,10 @@ class _PrescriptionFormWidgetState extends State { final searchController = TextEditingController(); stt.SpeechToText speech = stt.SpeechToText(); var event = RobotProvider(); - var reconizedWord; + var recognizedWord; final GlobalKey formKey = GlobalKey(); - final double spaceBetweenTextFileds = 12; + final double spaceBetweenTextFields = 12; dynamic route; dynamic frequency; dynamic duration; @@ -151,19 +151,19 @@ class _PrescriptionFormWidgetState extends State { dynamic box; dynamic x; - @override - void initState() { - requestPermissions(); - event.controller.stream.listen((p) { - if (p['startPopUp'] == 'true') { - if (this.mounted) { - initSpeechState().then((value) => {onVoiceText()}); - } - } - }); - selectedType = 1; - super.initState(); - } + // @override + // void initState() { + // requestPermissions(); + // event.controller.stream.listen((p) { + // if (p['startPopUp'] == 'true') { + // if (this.mounted) { + // initSpeechState().then((value) => {onVoiceText()}); + // } + // } + // }); + // selectedType = 1; + // super.initState(); + // } setSelectedType(int val) { setState(() { @@ -193,24 +193,24 @@ class _PrescriptionFormWidgetState extends State { } void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } - void requestPermissions() async { - Map statuses = await [ - Permission.microphone, - ].request(); - } + // void requestPermissions() async { + // Map statuses = await [ + // Permission.microphone, + // ].request(); + // } void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); + recognizedWord = result.recognizedWords; + event.setValue({"searchText": recognizedWord}); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - instructionController.text += reconizedWord + '\n'; + instructionController.text += recognizedWord + '\n'; }); } else { print(result.finalResult); @@ -227,42 +227,21 @@ class _PrescriptionFormWidgetState extends State { @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) async { - /// TODO Elham* Move this to view model - x = model.patientAssessmentList.map((element) { - return element.icdCode10ID; - }); - GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( - patientMRN: widget.patient.patientMRN, - episodeID: widget.patient.episodeNo.toString(), - editedBy: '', - doctorID: '', - appointmentNo: widget.patient.appointmentNo); - if (model.medicationStrengthList.length == 0) { - await model.getMedicationStrength(); - } - if (model.medicationDurationList.length == 0) { - await model.getMedicationDuration(); - } - if (model.medicationDoseTimeList.length == 0) { - await model.getMedicationDoseTime(); - } - await model.getPatientAssessment(getAssessmentReqModel); - }, + onModelReady: (model) => model.getAssessmentList( + patientInfo: widget.patient + ), builder: ( BuildContext context, MedicineViewModel model, - Widget child, - ) => + Widget child,) => NetworkBaseView( - baseViewModel: model, - child: GestureDetector( - onTap: () { + baseViewModel: model, + child: GestureDetector( + onTap: () { FocusScope.of(context).requestFocus(new FocusNode()); - }, - child: DraggableScrollableSheet( + }, + child: DraggableScrollableSheet( initialChildSize: 0.98, maxChildSize: 0.98, minChildSize: 0.9, @@ -285,7 +264,7 @@ class _PrescriptionFormWidgetState extends State { ], ), SizedBox( - height: spaceBetweenTextFileds, + height: spaceBetweenTextFields, ), Container( child: Form( @@ -304,8 +283,8 @@ class _PrescriptionFormWidgetState extends State { padding: EdgeInsets.all(10), child: AppTextFormField( onTap: () { - visbiltyPrescriptionForm = false; - visbiltySearch = true; + visibilityPrescriptionForm = false; + visibilitySearch = true; }, borderColor: Colors.white, hintText: TranslationBase.of(context) @@ -323,7 +302,7 @@ class _PrescriptionFormWidgetState extends State { height: 15.0, ), Visibility( - visible: visbiltySearch, + visible: visibilitySearch, child: Container( child: Column( children: [ @@ -378,9 +357,9 @@ class _PrescriptionFormWidgetState extends State { .allMedicationList[ index] .itemId); - visbiltyPrescriptionForm = + visibilityPrescriptionForm = true; - visbiltySearch = false; + visibilitySearch = false; _selectedMedication = model.allMedicationList[ index]; @@ -396,10 +375,10 @@ class _PrescriptionFormWidgetState extends State { ), ), SizedBox( - height: spaceBetweenTextFileds, + height: spaceBetweenTextFields, ), Visibility( - visible: visbiltyPrescriptionForm, + visible: visibilityPrescriptionForm, child: Container( child: Column( children: [ @@ -424,7 +403,7 @@ class _PrescriptionFormWidgetState extends State { SizedBox(width: 18,), Radio( activeColor: - Color(0xFFB9382C), + AppGlobal.appRedColor, value: 1, groupValue: selectedType, onChanged: (value) { @@ -540,14 +519,14 @@ class _PrescriptionFormWidgetState extends State { ), ), SizedBox( - height: spaceBetweenTextFileds), + height: spaceBetweenTextFields), PrescriptionTextFiled( elementList: model.itemMedicineListRoute, element: model.itemMedicineListRoute .length == 1 - ? model.itemMedicineListRoute[0] + ? route = model.itemMedicineListRoute[0] : route, elementError: routeError, keyId: 'parameterCode', @@ -563,45 +542,37 @@ class _PrescriptionFormWidgetState extends State { .route, ), SizedBox( - height: spaceBetweenTextFileds), + height: spaceBetweenTextFields), PrescriptionTextFiled( - hintText: - TranslationBase.of(context) - .frequency, + hintText: TranslationBase.of(context).frequency, elementError: frequencyError, - element: frequency, - elementList: - model.itemMedicineList, + // element: frequency, + element: model.itemMedicineListRoute + .length == + 1 + ? frequency = model.itemMedicineListRoute[0] + : frequency, + elementList: model.itemMedicineList, keyId: 'parameterCode', keyName: 'description', okFunction: (selectedValue) { setState(() { frequency = selectedValue; frequency['isDefault'] = true; - if (_selectedMedication != - null && - duration != null && - frequency != null && - strengthController.text != - null) { + if (_selectedMedication != null && duration != null && frequency != null && strengthController.text != null) { model.getBoxQuantity( - freq: frequency[ - 'parameterCode'], - duration: - duration['id'], - itemCode: - _selectedMedication - .itemId, - strength: double.parse( - strengthController - .text)); + freq: frequency['parameterCode'], + duration: duration['id'], + itemCode: _selectedMedication.itemId, + strength: double.parse(strengthController.text) + ); return; } }); }), SizedBox( - height: spaceBetweenTextFileds), + height: spaceBetweenTextFields), PrescriptionTextFiled( hintText: TranslationBase.of(context) @@ -618,7 +589,7 @@ class _PrescriptionFormWidgetState extends State { }); }), SizedBox( - height: spaceBetweenTextFileds), + height: spaceBetweenTextFields), if (model .patientAssessmentList.isNotEmpty) Container( @@ -633,21 +604,19 @@ class _PrescriptionFormWidgetState extends State { .size .width * 0.29, - child: TextField( - decoration: - textFieldSelectorDecoration( + child: AppTextFieldCustom( + hintText: model .patientAssessmentList[ 0] .icdCode10ID .toString(), - indication != null - ? indication[ - 'name'] - : null, - false), + // indication != null + // ? indication[ + // 'name'] + // : null, + enabled: true, - readOnly: true, ), ), Container( @@ -657,57 +626,68 @@ class _PrescriptionFormWidgetState extends State { .width * 0.57, color: Colors.white, - child: TextField( + child: AppTextFieldCustom( maxLines: 5, - decoration: - textFieldSelectorDecoration( + hintText: model .patientAssessmentList[ 0] .asciiDesc .toString(), - indication != null - ? indication[ - 'name'] - : null, - false), + // indication != null + // ? indication[ + // 'name'] + // : null, enabled: true, - readOnly: true, ), ), ], ), ), SizedBox( - height: spaceBetweenTextFileds), + height: spaceBetweenTextFields), Container( - height: screenSize.height * 0.070, - color: Colors.white, + color: Colors.transparent, child: InkWell( onTap: () => selectDate( context, widget.model), - /// TODO Elham* Use customTextFields for all TextFields here - child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of( - context) - .date, - selectedDate != null - ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), + child: AppTextFieldCustom( + validationError: + strengthError, + hintText: 'Date', + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( + Icons.calendar_today, + color: Colors.black,), + ), + dropDownText: selectedDate != null + ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, enabled: false, + controller: strengthController, ), + + // TextField( + // decoration: + // textFieldSelectorDecoration( + // TranslationBase.of( + // context) + // .date, + // selectedDate != null + // ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + // : null, + // true, + // suffixIcon: Icon( + // Icons.calendar_today, + // color: Colors.black, + // )), + // enabled: false, + // ), ), ), SizedBox( - height: spaceBetweenTextFileds), - /// TODO Elham* Use customTextFields for all + height: spaceBetweenTextFields), PrescriptionTextFiled( element: duration, elementError: durationError, @@ -746,7 +726,7 @@ class _PrescriptionFormWidgetState extends State { }, ), SizedBox( - height: spaceBetweenTextFileds), + height: spaceBetweenTextFields), Container( color: Colors.white, child: AppTextFieldCustom( @@ -758,7 +738,7 @@ class _PrescriptionFormWidgetState extends State { ), ), SizedBox( - height: spaceBetweenTextFileds), + height: spaceBetweenTextFields), Container( color: Colors.white, child: AppTextFieldCustom( @@ -773,7 +753,8 @@ class _PrescriptionFormWidgetState extends State { ), ), SizedBox( - height: spaceBetweenTextFileds), + height: spaceBetweenTextFields + ), Container( decoration: BoxDecoration( borderRadius: BorderRadius.all( @@ -814,7 +795,7 @@ class _PrescriptionFormWidgetState extends State { ), ), SizedBox( - height: spaceBetweenTextFileds), + height: spaceBetweenTextFields), Container( margin: EdgeInsets.all( SizeConfig.widthMultiplier * 5), @@ -1058,49 +1039,48 @@ class _PrescriptionFormWidgetState extends State { }); } } - /// TODO Elham* Use it from the textfeild utils - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown - ? suffixIcon != null - ? suffixIcon - : Icon( - Icons.keyboard_arrow_down_sharp, - color: Color(0xff2E303A), - ) - : null, - hintStyle: TextStyle( - fontSize: 13, - color: Color(0xff2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ), - labelText: selectedText != null ? '$hintText\n$selectedText' : null, - labelStyle: TextStyle( - fontSize: 13, - color: Color(0xff2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ), - ); - } + // InputDecoration textFieldSelectorDecoration( + // String hintText, String selectedText, bool isDropDown, + // {Icon suffixIcon}) { + // return InputDecoration( + // focusedBorder: OutlineInputBorder( + // borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + // borderRadius: BorderRadius.circular(8), + // ), + // enabledBorder: OutlineInputBorder( + // borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + // borderRadius: BorderRadius.circular(8), + // ), + // disabledBorder: OutlineInputBorder( + // borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), + // borderRadius: BorderRadius.circular(8), + // ), + // hintText: selectedText != null ? selectedText : hintText, + // suffixIcon: isDropDown + // ? suffixIcon != null + // ? suffixIcon + // : Icon( + // Icons.keyboard_arrow_down_sharp, + // color: Color(0xff2E303A), + // ) + // : null, + // hintStyle: TextStyle( + // fontSize: 13, + // color: Color(0xff2E303A), + // fontFamily: 'Poppins', + // fontWeight: FontWeight.w600, + // ), + // labelText: selectedText != null ? '$hintText\n$selectedText' : null, + // labelStyle: TextStyle( + // fontSize: 13, + // color: Color(0xff2E303A), + // fontFamily: 'Poppins', + // fontWeight: FontWeight.w600, + // ), + // ); + // } - openDrugToDrug(model) { + openDrugToDrug(MedicineViewModel model) { showModalBottomSheet( context: context, builder: (context) { @@ -1114,7 +1094,9 @@ class _PrescriptionFormWidgetState extends State { children: [ DrugToDrug( widget.patient, - getPriscriptionforDrug(widget.prescriptionList, model), + model.getPrescriptionForDrug( + widget.prescriptionList, model + ), model.patientAssessmentList), Container( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3), @@ -1158,57 +1140,53 @@ class _PrescriptionFormWidgetState extends State { )) ], )), - - //], - //) ); }); } - /// TODO Elham* Move this to view model - getPriscriptionforDrug( - List prescriptionList, MedicineViewModel model) { - var prescriptionDetails = []; - if (prescriptionList.length > 0) { - prescriptionList[0].entityList.forEach((element) { - if (element.mediSpanGPICode != null) { - prescriptionDetails.add({ - 'DrugId': element.mediSpanGPICode, - 'DrugName': element.medicationName, - 'Dose': element.doseDailyQuantity, - 'DoseType': element.doseDailyUnitID, - 'Unit': element.uom, - 'FrequencyType': element.frequencyID, - 'Duration': element.doseDurationDays, - 'RouteID': element.routeID, - 'IsScreen': element.isSIG - }); - } - }); - } - if (_selectedMedication.mediSpanGPICode != null) { - prescriptionDetails.add({ - 'DrugId': _selectedMedication.mediSpanGPICode, - 'DrugName': _selectedMedication.description, - 'Dose': strengthController.text, - 'DoseType': model.itemMedicineListUnit.length == 1 - ? model.itemMedicineListUnit[0]['parameterCode'].toString() - : units['parameterCode'].toString(), - 'Unit': model.itemMedicineListUnit.length == 1 - ? model.itemMedicineListUnit[0]['description'] - : units['description'], - 'FrequencyType': model.itemMedicineList.length == 1 - ? model.itemMedicineList[0]['parameterCode'].toString() - : frequency['parameterCode'].toString(), - 'Duration': duration['id'].toString(), - 'RouteID': model.itemMedicineListRoute.length == 1 - ? model.itemMedicineListRoute[0]['parameterCode'].toString() - : route['parameterCode'].toString(), - 'IsScreen': true - }); - } - return prescriptionDetails; - } + // getPrescriptionForDrug( + // List prescriptionList, MedicineViewModel model) { + // var prescriptionDetails = []; + // if (prescriptionList.length > 0) { + // prescriptionList[0].entityList.forEach((element) { + // if (element.mediSpanGPICode != null) { + // prescriptionDetails.add({ + // 'DrugId': element.mediSpanGPICode, + // 'DrugName': element.medicationName, + // 'Dose': element.doseDailyQuantity, + // 'DoseType': element.doseDailyUnitID, + // 'Unit': element.uom, + // 'FrequencyType': element.frequencyID, + // 'Duration': element.doseDurationDays, + // 'RouteID': element.routeID, + // 'IsScreen': element.isSIG + // }); + // } + // }); + // } + // if (_selectedMedication.mediSpanGPICode != null) { + // prescriptionDetails.add({ + // 'DrugId': _selectedMedication.mediSpanGPICode, + // 'DrugName': _selectedMedication.description, + // 'Dose': strengthController.text, + // 'DoseType': model.itemMedicineListUnit.length == 1 + // ? model.itemMedicineListUnit[0]['parameterCode'].toString() + // : units['parameterCode'].toString(), + // 'Unit': model.itemMedicineListUnit.length == 1 + // ? model.itemMedicineListUnit[0]['description'] + // : units['description'], + // 'FrequencyType': model.itemMedicineList.length == 1 + // ? model.itemMedicineList[0]['parameterCode'].toString() + // : frequency['parameterCode'].toString(), + // 'Duration': duration['id'].toString(), + // 'RouteID': model.itemMedicineListRoute.length == 1 + // ? model.itemMedicineListRoute[0]['parameterCode'].toString() + // : route['parameterCode'].toString(), + // 'IsScreen': true + // }); + // } + // return prescriptionDetails; + // } searchMedicine(context, MedicineViewModel model) async { FocusScope.of(context).unfocus(); diff --git a/lib/screens/prescription/drugtodrug.dart b/lib/screens/prescription/add_prescription/drugtodrug.dart similarity index 100% rename from lib/screens/prescription/drugtodrug.dart rename to lib/screens/prescription/add_prescription/drugtodrug.dart diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/add_prescription/update_prescription_form.dart similarity index 100% rename from lib/screens/prescription/update_prescription_form.dart rename to lib/screens/prescription/add_prescription/update_prescription_form.dart diff --git a/lib/screens/prescription/prescription_authorazation_form.dart b/lib/screens/prescription/prescription_authorazation_form.dart deleted file mode 100644 index 8b137891..00000000 --- a/lib/screens/prescription/prescription_authorazation_form.dart +++ /dev/null @@ -1 +0,0 @@ - diff --git a/lib/screens/prescription/prescription_checkout_screen.dart b/lib/screens/prescription/prescription_checkout_screen.dart index 076f7051..dfeea9f6 100644 --- a/lib/screens/prescription/prescription_checkout_screen.dart +++ b/lib/screens/prescription/prescription_checkout_screen.dart @@ -114,8 +114,8 @@ class _PrescriptionCheckOutScreenState TextEditingController indicationController = TextEditingController(); TextEditingController instructionController = TextEditingController(); - bool visbiltyPrescriptionForm = true; - bool visbiltySearch = true; + bool visibilityPrescriptionForm = true; + bool visibilitySearch = true; final myController = TextEditingController(); DateTime selectedDate; @@ -129,10 +129,10 @@ class _PrescriptionCheckOutScreenState final searchController = TextEditingController(); stt.SpeechToText speech = stt.SpeechToText(); var event = RobotProvider(); - var reconizedWord; + var recognizedWord; final GlobalKey formKey = GlobalKey(); - final double spaceBetweenTextFileds = 12; + final double spaceBetweenTextFields = 12; dynamic route; dynamic frequency; dynamic duration; @@ -179,7 +179,7 @@ class _PrescriptionCheckOutScreenState } void statusListener(String status) { - reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } void requestPermissions() async { @@ -189,14 +189,14 @@ class _PrescriptionCheckOutScreenState } void resultListener(result) { - reconizedWord = result.recognizedWords; - event.setValue({"searchText": reconizedWord}); + recognizedWord = result.recognizedWords; + event.setValue({"searchText": recognizedWord}); if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - instructionController.text += reconizedWord + '\n'; + instructionController.text += recognizedWord + '\n'; }); } else { print(result.finalResult); @@ -299,7 +299,7 @@ class _PrescriptionCheckOutScreenState ], ), SizedBox( - height: spaceBetweenTextFileds, + height: spaceBetweenTextFields, ), Container( child: Form( @@ -316,10 +316,10 @@ class _PrescriptionCheckOutScreenState ), ), SizedBox( - height: spaceBetweenTextFileds, + height: spaceBetweenTextFields, ), Visibility( - visible: visbiltyPrescriptionForm, + visible: visibilityPrescriptionForm, child: Container( child: Column( children: [ @@ -337,7 +337,7 @@ class _PrescriptionCheckOutScreenState fontWeight: FontWeight.w600, ), Radio( - activeColor: Color(0xFFB9382C), + activeColor: AppGlobal.appRedColor, value: 1, groupValue: selectedType, onChanged: (value) { @@ -349,7 +349,7 @@ class _PrescriptionCheckOutScreenState ], ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), Container( width: double.infinity, child: Row( @@ -410,7 +410,7 @@ class _PrescriptionCheckOutScreenState ], ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( elementList: model.itemMedicineListRoute, @@ -427,7 +427,7 @@ class _PrescriptionCheckOutScreenState hintText: TranslationBase.of(context).route, ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( hintText: TranslationBase.of(context) .frequency, @@ -460,7 +460,7 @@ class _PrescriptionCheckOutScreenState } }); }), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( hintText: TranslationBase.of(context) .doseTime, @@ -475,7 +475,7 @@ class _PrescriptionCheckOutScreenState doseTime = selectedValue; }); }), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), if (model .patientAssessmentList.isNotEmpty) Container( @@ -533,7 +533,7 @@ class _PrescriptionCheckOutScreenState ], ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), Container( height: screenSize.height * 0.070, color: Colors.white, @@ -556,7 +556,7 @@ class _PrescriptionCheckOutScreenState ), ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( element: duration, elementError: durationError, @@ -590,9 +590,9 @@ class _PrescriptionCheckOutScreenState }); }, ), - SizedBox(height: spaceBetweenTextFileds), - SizedBox(height: spaceBetweenTextFileds), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), + SizedBox(height: spaceBetweenTextFields), + SizedBox(height: spaceBetweenTextFields), Container( decoration: BoxDecoration( borderRadius: BorderRadius.all( @@ -630,7 +630,7 @@ class _PrescriptionCheckOutScreenState ], ), ), - SizedBox(height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFields), Container( margin: EdgeInsets.all( SizeConfig.widthMultiplier * 5), diff --git a/lib/screens/prescription/prescription_details_page.dart b/lib/screens/prescription/prescription_details_page.dart deleted file mode 100644 index 623cee90..00000000 --- a/lib/screens/prescription/prescription_details_page.dart +++ /dev/null @@ -1,168 +0,0 @@ -import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -class PrescriptionDetailsPage extends StatelessWidget { - final PrescriptionReport prescriptionReport; - - PrescriptionDetailsPage({Key key, this.prescriptionReport}); - - @override - Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescriptions, - body: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all(color: Colors.grey[200], width: 0.5), - ), - child: Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), - child: Image.network( - prescriptionReport.imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: AppText( - prescriptionReport.itemDescription.isNotEmpty - ? prescriptionReport.itemDescription - : prescriptionReport.itemDescriptionN), - ), - ), - ) - ], - ), - ), - Container( - color: Colors.white, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - child: Table( - border: TableBorder.symmetric( - inside: BorderSide(width: 0.5), - outside: BorderSide(width: 0.5)), - children: [ - TableRow( - children: [ - Container( - color: Colors.white, - height: 30, - width: double.infinity, - child: Center( - child: AppText( - TranslationBase.of(context).route, - fontSize: 14, - ))), - Container( - color: Colors.white, - height: 30, - width: double.infinity, - child: Center( - child: AppText( - TranslationBase.of(context).frequency, - fontSize: 14, - ))), - Container( - color: Colors.white, - width: double.infinity, - padding: EdgeInsets.symmetric(horizontal: 4), - child: Center( - child: AppText( - "${TranslationBase.of(context).dailyDoses}", - fontSize: 14, - ))), - Container( - color: Colors.white, - height: 30, - width: double.infinity, - child: Center( - child: AppText( - TranslationBase.of(context).duration, - fontSize: 14, - ))), - ], - ), - TableRow( - children: [ - Container( - color: Colors.white, - height: 50, - width: double.infinity, - child: - Center(child: Text(prescriptionReport.routeN))), - Container( - color: Colors.white, - height: 50, - width: double.infinity, - child: Center( - child: - Text(prescriptionReport.frequencyN ?? ''))), - Container( - color: Colors.white, - height: 50, - width: double.infinity, - child: Center( - child: Text( - '${prescriptionReport.doseDailyQuantity}'))), - Container( - color: Colors.white, - height: 50, - width: double.infinity, - child: - Center(child: Text('${prescriptionReport.days}'))) - ], - ), - ], - ), - ), - Container( - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - width: double.infinity, - color: Colors.white, - padding: EdgeInsets.all(5), - child: Center( - child: Column( - children: [ - AppText(TranslationBase.of(context).notes), - SizedBox( - height: 5, - ), - Divider( - height: 0.5, - color: Colors.grey[300], - ), - SizedBox( - height: 5, - ), - AppText(prescriptionReport.remarks ?? ''), - ], - ), - ), - ) - ], - ), - ), - ); - } -} diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index 0f356e0e..bf1632fd 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -51,6 +51,7 @@ class PrescriptionItemsPage extends StatelessWidget { children: [ if (!prescriptions.isInOutPatient) ...List.generate( + // TODO Elham* List.generate to list.builder model.prescriptionReportList.length, (index) => Container( decoration: BoxDecoration( @@ -204,6 +205,7 @@ class PrescriptionItemsPage extends StatelessWidget { )) else ...List.generate( + // TODO Elham* List.generate to list.builder model.prescriptionReportEnhList.length, (index) => Container( decoration: BoxDecoration( @@ -211,6 +213,7 @@ class PrescriptionItemsPage extends StatelessWidget { color: Colors.white, ), margin: EdgeInsets.all(12), + // TODO Elham* use custom card child: Padding( padding: const EdgeInsets.all(8.0), child: Column( diff --git a/lib/screens/prescription/prescription_warnings.dart b/lib/screens/prescription/prescription_warnings.dart deleted file mode 100644 index c91ce9c9..00000000 --- a/lib/screens/prescription/prescription_warnings.dart +++ /dev/null @@ -1,168 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -void prescriptionWarning(context) { - showModalBottomSheet( - context: context, - isScrollControlled: true, - builder: (BuildContext bc) { - return SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Container( - height: 600, - child: Column( - children: [ - ...List.generate( - 5, - (index) => Container( - child: ExpansionTile( - title: AppText('Prescription warning and alerts(0)'), - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - 'DOSESCREENINGRESULTFORETCETC', - color: Color(0XFFB8382C), - ) - ], - ) - ], - ), - ), - ), - SizedBox( - height: 10.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: - Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: 'Remarks', - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - ), - ), - SizedBox( - height: 95.0, - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'CONTINUE', - onPressed: () { - Navigator.pop(context); - authorizationForm(context); - }, - ), - ], - ), - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - color: Colors.white, - title: 'remove', - fontColor: Colors.red, - onPressed: () { - Navigator.pop(context); - prescriptionWarning(context); - }, - ), - ], - ), - ), - ], - ), - ), - )); - }); -} - -void authorizationForm(context) { - showModalBottomSheet( - context: context, - isScrollControlled: true, - builder: (BuildContext bc) { - return Container( - height: 500, - child: Form( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Prescription authorization'.toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: 30.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: 'Auth ID', - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: 'Password', - borderColor: Colors.white, - textInputType: TextInputType.text, - inputFormatter: ONLY_LETTERS, - obscureText: true, - ), - ), - SizedBox( - height: 190.0, - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'CONTINUE', - onPressed: () { - Navigator.pop(context); - authorizationForm(context); - }, - ), - ], - ), - ), - ], - ), - ), - )); - }); -} diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 3b914d69..b02d1861 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -101,7 +101,8 @@ class PrescriptionsPage extends StatelessWidget { label: TranslationBase.of(context) .applyForNewPrescriptionsOrder, ), - ...List.generate( + ...List.generate + ( model.prescriptionsList.length, (index) => InkWell( onTap: () => Navigator.push( diff --git a/lib/screens/procedures/base_add_procedure_tab_page.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart index 66d42a0d..90ca0e55 100644 --- a/lib/screens/procedures/base_add_procedure_tab_page.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart'; +import 'package:doctor_app_flutter/screens/prescription/add_prescription/add_prescription_form.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 361ec695..7038fbc9 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -9,6 +9,8 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../../config/config.dart'; + class EntityListCheckboxSearchWidget extends StatefulWidget { final ProcedureViewModel model; final Function addSelectedHistories; @@ -229,7 +231,7 @@ class _EntityListCheckboxSearchWidgetState : Center( child: Container( child: AppText("Sorry , No Match", - color: Color(0xFFB9382C)), + color: AppGlobal.appRedColor), ), ) ], diff --git a/lib/screens/procedures/entity_list_fav_procedure.dart b/lib/screens/procedures/entity_list_fav_procedure.dart index 494540b1..3fc6ca32 100644 --- a/lib/screens/procedures/entity_list_fav_procedure.dart +++ b/lib/screens/procedures/entity_list_fav_procedure.dart @@ -8,6 +8,7 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../../config/config.dart'; import 'ExpansionProcedure.dart'; class EntityListCheckboxSearchFavProceduresWidget extends StatefulWidget { @@ -125,7 +126,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState : Center( child: Container( child: AppText("Sorry , No Match", - color: Color(0xFFB9382C)), + color: AppGlobal.appRedColor), ), ) ], diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 01b0787c..a7e0d22f 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -247,7 +247,7 @@ class _UpdateProcedureWidgetState extends State { children: [ AppText(TranslationBase.of(context).orderType), Radio( - activeColor: Color(0xFFB9382C), + activeColor: AppGlobal.appRedColor, value: 0, groupValue: selectedType, onChanged: (value) { @@ -256,7 +256,7 @@ class _UpdateProcedureWidgetState extends State { ), Text('routine'), Radio( - activeColor: Color(0xFFB9382C), + activeColor: AppGlobal.appRedColor, groupValue: selectedType, value: 1, onChanged: (value) { diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index 1030e2f9..01849e5b 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -2,6 +2,8 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; +import '../../../config/config.dart'; + class ListSelectDialog extends StatefulWidget { final List list; final String attributeName; @@ -104,7 +106,7 @@ class _ListSelectDialogState extends State { .selectedValue[widget.attributeValueId] .toString(), value: item[widget.attributeValueId].toString(), - activeColor: Color(0xFFB9382C), + activeColor: AppGlobal.appRedColor, selected: item[widget.attributeValueId] .toString() == widget.selectedValue[widget.attributeValueId] diff --git a/lib/widgets/shared/text_fields/html_rich_editor.dart b/lib/widgets/shared/text_fields/html_rich_editor.dart index 79e9829f..d249ead0 100644 --- a/lib/widgets/shared/text_fields/html_rich_editor.dart +++ b/lib/widgets/shared/text_fields/html_rich_editor.dart @@ -134,7 +134,7 @@ class _HtmlRichEditorState extends State { } void statusListener(String status) { - recognizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + recognizedWord = status == 'listening' ? 'Listening...' : 'Sorry....'; } void requestPermissions() async {