From ced4edebdedff5aa8ad66ca71b43b275a85506ae Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 21 Jan 2021 14:35:28 +0200 Subject: [PATCH 01/11] patinet profile update --- .../prescription/add_prescription_form.dart | 36 ++++++++++++++ .../profile/profile_medical_info_widget.dart | 49 ++++++++++--------- 2 files changed, 63 insertions(+), 22 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 7b7535d6..44c219fb 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -165,6 +165,24 @@ class _PrescriptionFormWidgetState extends State { dynamic route7 = {"id": 27, "name": "In Both EYES"}; dynamic route8 = {"id": 28, "name": "In Both Ears"}; dynamic route9 = {"id": 32, "name": "Intramuscular"}; + dynamic route10 = {"id": 60, "name": "TRANSDERMAL"}; + dynamic route11 = {"id": 59, "name": "OROPHARYNGEAL"}; + dynamic route12 = {"id": 15, "name": "for INJECTION"}; + dynamic route13 = {"id": 58, "name": "SUBCUTANEOUS"}; + dynamic route14 = {"id": 57, "name": "NASOGASTRIC"}; + dynamic route15 = {"id": 56, "name": "IRRIGATION"}; + dynamic route16 = {"id": 55, "name": "INTRAVITREAL"}; + dynamic route17 = {"id": 54, "name": "INTRAVENOUS BOLUS"}; + dynamic route18 = {"id": 51, "name": "EPIDURAL"}; + dynamic route19 = {"id": 47, "name": "Parenteral"}; + dynamic route20 = {"id": 43, "name": "IM"}; + dynamic route21 = {"id": 42, "name": "IV"}; + dynamic route22 = {"id": 41, "name": "Sublingual"}; + dynamic route23 = {"id": 40, "name": "For Nebulization"}; + dynamic route24 = {"id": 39, "name": "Nasal"}; + dynamic route25 = {"id": 37, "name": "Inserted into Vagina"}; + dynamic route26 = {"id": 36, "name": "Inserted into Rectum"}; + dynamic route27 = {"id": 31, "name": "In Each Nostril"}; dynamic frequency1 = {"id": 1, "name": "2 Times a day"}; dynamic frequency2 = {"id": 2, "name": "3 Times a day"}; dynamic frequency3 = {"id": 3, "name": "4 Times a day"}; @@ -258,6 +276,24 @@ class _PrescriptionFormWidgetState extends State { routeList.add(route7); routeList.add(route8); routeList.add(route9); + routeList.add(route10); + routeList.add(route11); + routeList.add(route12); + routeList.add(route13); + routeList.add(route14); + routeList.add(route15); + routeList.add(route16); + routeList.add(route17); + routeList.add(route18); + routeList.add(route19); + routeList.add(route20); + routeList.add(route21); + routeList.add(route22); + routeList.add(route23); + routeList.add(route24); + routeList.add(route25); + routeList.add(route26); + routeList.add(route27); strengthList.add(strength1); strengthList.add(strength2); strengthList.add(strength3); diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index b243f15a..5c64c70a 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -91,14 +91,17 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, icon: 'lab.png'), - PatientProfileButton( - key: key, - patient: patient, - route: MEDICAL_FILE, - nameLine1: TranslationBase.of(context).previewHealth, - nameLine2: TranslationBase.of(context).summaryReport, - icon: 'radiology-1.png'), - if (selectedPatientType != 0 && selectedPatientType != 5 && selectedPatientType != 7) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + route: MEDICAL_FILE, + nameLine1: TranslationBase.of(context).previewHealth, + nameLine2: TranslationBase.of(context).summaryReport, + icon: 'radiology-1.png'), + if (selectedPatientType != 0 && + selectedPatientType != 5 && + selectedPatientType != 7) PatientProfileButton( key: key, patient: patient, @@ -114,20 +117,22 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, icon: 'heartbeat.png'), - PatientProfileButton( - key: key, - patient: patient, - route: ORDER_PRESCRIPTION, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'lab.png'), - PatientProfileButton( - key: key, - patient: patient, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'lab.png'), + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + route: ORDER_PRESCRIPTION, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'lab.png'), + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'lab.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, From 3be693337a81e063395a1a0dd87d6b2dab703315 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 21 Jan 2021 19:19:00 +0200 Subject: [PATCH 02/11] some fixes --- lib/models/patient/patiant_info_model.dart | 9 +++------ lib/widgets/patients/profile/patient_profile_widget.dart | 8 ++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index f7c4b0a2..3547a73d 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -42,6 +42,7 @@ class PatiantInformtion { int patientMRN; String admissionNo; String admissionDate; + String createdOn; String roomId; String bedId; String nursingStationId; @@ -77,6 +78,7 @@ class PatiantInformtion { this.patientType, this.admissionNo, this.admissionDate, + this.createdOn, this.roomId, this.bedId, this.nursingStationId, @@ -129,6 +131,7 @@ class PatiantInformtion { patientType: json["PatientType"]?? json["patientType"], admissionNo: json["AdmissionNo"]?? json["admissionNo"], admissionDate: json["AdmissionDate"]?? json["admissionDate"], + createdOn: json["CreatedOn"]?? json["CreatedOn"], roomId: json["RoomID"]?? json["roomID"], bedId: json["BedID"]?? json["bedID"], nursingStationId: json["NursingStationID"]?? json["nursingStationID"], @@ -158,10 +161,4 @@ class PatiantInformtion { patientMRN :json['patientMRN'] ?? json['PatientMRN'], ); - - - - - - } diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index bab7cc84..248d0dd2 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -254,8 +254,8 @@ class PatientProfileWidget extends StatelessWidget { ), Expanded( child: AppText( - patient.admissionDate != null - ? "${DateUtils.convertDateFromServerFormat(patient.admissionDate, 'EEEE dd, MMMM yyyy hh:mm a')}" + patient.createdOn != null + ? "${DateUtils.convertDateFromServerFormat(patient.createdOn, 'EEEE dd, MMMM yyyy hh:mm a')}" : "", color: Colors.black, fontWeight: FontWeight.normal, @@ -310,10 +310,10 @@ class PatientProfileWidget extends StatelessWidget { ), ), AppText( - patient.admissionDate != null + patient.createdOn != null ? DateUtils .differenceBetweenServerDateAndCurrent( - patient.admissionDate) + patient.createdOn) : "", color: Colors.black, fontWeight: FontWeight.normal, From 38d9881ed265f12466c60116b0550fa72514c741 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 21 Jan 2021 20:35:56 +0200 Subject: [PATCH 03/11] Prescription date --- lib/widgets/shared/dialogs/search-drugs-dailog-list.dart | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 lib/widgets/shared/dialogs/search-drugs-dailog-list.dart diff --git a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart new file mode 100644 index 00000000..e69de29b From 4a4cd03f636109d911ed0b54f8b3afc56fb71e7d Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 21 Jan 2021 20:39:09 +0200 Subject: [PATCH 04/11] Prescription date --- lib/core/service/prescription_service.dart | 4 +- lib/core/viewModel/medicine_view_model.dart | 1 - .../viewModel/prescription_view_model.dart | 6 +- lib/core/viewModel/procedure_View_model.dart | 2 +- .../prescription/add_prescription_form.dart | 161 +++++++++++++++++- .../prescription/prescription_screen.dart | 21 ++- lib/screens/procedures/procedure_screen.dart | 37 +++- .../shared/dialogs/dailog-list-select.dart | 8 +- .../dialogs/search-drugs-dailog-list.dart | 92 ++++++++++ 9 files changed, 316 insertions(+), 16 deletions(-) diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 6558ad6e..44e34627 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -46,7 +46,9 @@ class PrescriptionService extends BaseService { }, body: _prescriptionReqModel.toJson()); } - Future getDrugs() async { + Future getDrugs({String drugName}) async { + _drugRequestModel = SearchDrugRequestModel(search: [drugName]); + hasError = false; await baseAppClient.post(SEARCH_DRUG, diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index a86f6dfb..2d87c548 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -9,7 +9,6 @@ class MedicineViewModel extends BaseViewModel { get pharmacyItemsList => _medicineService.pharmacyItemsList; get pharmaciesList => _medicineService.pharmaciesList; - Future getMedicineItem(String itemName) async { setState(ViewState.Busy); await _medicineService.getMedicineItem(itemName); diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 3e39a7fa..f8f58e4f 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -60,11 +60,11 @@ class PrescriptionViewModel extends BaseViewModel { } } - Future getDrugs() async { + Future getDrugs({String drugName}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); - await _prescriptionService.getDrugs(); + setState(ViewState.BusyLocal); + await _prescriptionService.getDrugs(drugName: drugName); if (_prescriptionService.hasError) { error = _prescriptionService.error; setState(ViewState.ErrorLocal); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 5e1d8d0c..fb84f505 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -68,7 +68,7 @@ class ProcedureViewModel extends BaseViewModel { } Future updateProcedure( - PostProcedureReqModel postProcedureReqModel, int mrn) async { + {PostProcedureReqModel postProcedureReqModel, int mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 44c219fb..2f8b47cb 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -21,6 +21,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -107,6 +108,12 @@ class _PrescriptionFormWidgetState extends State { TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); + final searchController = TextEditingController(); + + var notesList; + var filteredNotesList; + String textSeartch = "Amoxicillin"; + final GlobalKey formKey = GlobalKey(); final double spaceBetweenTextFileds = 12; List referToList; @@ -331,12 +338,13 @@ class _PrescriptionFormWidgetState extends State { @override Widget build(BuildContext context) { + ListSelectDialog drugDialog; final screenSize = MediaQuery.of(context).size; // final routeArgs = ModalRoute.of(context).settings.arguments as Map; // patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getDrugs(), + onModelReady: (model) => model.getDrugs(drugName: textSeartch), builder: (BuildContext context, PrescriptionViewModel model, Widget child) => NetworkBaseView( @@ -375,7 +383,7 @@ class _PrescriptionFormWidgetState extends State { onTap: model.drugsList != null && model.drugsList.length > 0 ? () { - ListSelectDialog dialog = + return drugDialog = ListSelectDialog( list: model.drugsList, attributeName: 'GenericName', @@ -388,17 +396,121 @@ class _PrescriptionFormWidgetState extends State { selectedDrug = selectedValue; }); }, + /* searchWidget: Row( + children: [ + Expanded( + child: TextField( + decoration: Helpers + .textFieldSelectorDecoration( + TranslationBase.of( + context) + .search, + searchController.text != + null && + searchController + .text != + "" + ? searchController + .text + : null, + false, + ), + onChanged: (String str) { + textSeartch = str; + }, + controller: + searchController, + enabled: true, + ), + ), + Container( + child: InkWell( + child: Icon( + Icons.search, + color: Colors.black, + ), + onTap: () async { + Navigator.of(context) + .pop(); + await searchMedicine( + context, + model, + textSeartch); + showDialog( + barrierDismissible: + false, + context: context, + builder: (BuildContext + context) { + return drugDialog; + }, + ); + }, + ), + margin: + EdgeInsets.symmetric( + horizontal: 8), + ) + ], + ),*/ ); showDialog( barrierDismissible: false, context: context, builder: (BuildContext context) { - return dialog; + return drugDialog; }, ); } : null, - child: TextField( + child: Row( + children: [ + Expanded( + child: TextField( + decoration: Helpers + .textFieldSelectorDecoration( + TranslationBase.of(context) + .search, + searchController.text != null && + searchController.text != + "" + ? searchController.text + : null, + false, + ), + onChanged: (String str) { + textSeartch = str; + }, + controller: searchController, + enabled: true, + ), + ), + Container( + child: InkWell( + child: Icon( + Icons.search, + color: Colors.black, + ), + onTap: () async { + // Navigator.of(context) + // .pop(); + await searchMedicine( + context, model, textSeartch); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return drugDialog; + }, + ); + }, + ), + margin: EdgeInsets.symmetric( + horizontal: 8), + ) + ], + ), /*TextField( decoration: textFieldSelectorDecoration( TranslationBase.of(context) .searchMedicine, @@ -410,8 +522,8 @@ class _PrescriptionFormWidgetState extends State { Icons.search, color: Colors.black, )), - enabled: false, - ), + enabled: true, + ),*/ ), ), SizedBox( @@ -981,4 +1093,41 @@ class _PrescriptionFormWidgetState extends State { ); }); } + + // searchData(String str, PrescriptionViewModel model) { + // var strExist = str.length > 0 ? true : false; + // + // if (strExist) { + // filteredNotesList = null; + // filteredNotesList = model.drugsList + // .where((note) => + // note["GenericName"].toString().contains(str.toUpperCase())) + // .toList(); + // setState(() { + // notesList = filteredNotesList; + // }); + // } else { + // setState(() { + // notesList = model.drugsList; + // }); + // } + // } + + searchMedicine(context, PrescriptionViewModel model, String str) async { + FocusScope.of(context).unfocus(); + // if (searchController.text.isEmpty()) { + // helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); + // //"Type Medicine Name") + // return; + // } + if (searchController.text.length < 0) { + helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); + return; + } + + GifLoaderDialogUtils.showMyDialog(context); + + await model.getDrugs(drugName: searchController.text); + GifLoaderDialogUtils.hideDialog(context); + } } diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index c1f00092..4d000838 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/models/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/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart'; @@ -337,7 +338,25 @@ class _NewPrescriptionScreenState extends State { child: Column( children: [ AppText( - '8\nDEC', + DateTime.parse(model + .prescriptionList[ + 0] + .entityList[ + index] + .startDate) + .day + .toString(), + color: Colors + .green, + ), + AppText( + Helpers.getMonth(model.prescriptionList[0].entityList[index].startDate != + null + ? (DateTime.parse(model.prescriptionList[0].entityList[index].startDate) + .month) + : DateTime.now() + .month) + .toUpperCase(), color: Colors .green, ) diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 667bcc6d..5483ffd9 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/procedures/entity_list_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; @@ -271,7 +272,36 @@ class _ProcedureScreenState extends State { child: Column( children: [ AppText( - '8\nDEC', + DateTime.parse(model + .procedureList[ + 0] + .entityList[ + index] + .orderDate) + .day + .toString(), + color: + Colors.green, + ), + AppText( + Helpers.getMonth(model + .procedureList[ + 0] + .entityList[ + index] + .orderDate != + null + ? (DateTime.parse(model + .procedureList[ + 0] + .entityList[ + index] + .orderDate) + .month) + : DateTime + .now() + .month) + .toUpperCase(), color: Colors.green, ) @@ -421,6 +451,8 @@ class _ProcedureScreenState extends State { child: Icon( Icons.edit), onTap: () { + // model + // .updateProcedure(); updateProcedureForm( context, remarks: model @@ -691,7 +723,8 @@ updateProcedure( category: categorieId, procedure: procedureId, controls: controls)); updateProcedureReqModel.procedures = controlsProcedure; - await model.updateProcedure(updateProcedureReqModel, patient.patientMRN); + await model.updateProcedure( + postProcedureReqModel: updateProcedureReqModel, mrn: patient.patientMRN); if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index 68dce5a4..fa33a72d 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -1,3 +1,6 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; @@ -8,13 +11,15 @@ class ListSelectDialog extends StatefulWidget { final okText; final Function(dynamic) okFunction; dynamic selectedValue; + final Widget searchWidget; ListSelectDialog( {@required this.list, @required this.attributeName, @required this.attributeValueId, @required this.okText, - @required this.okFunction}); + @required this.okFunction, + this.searchWidget}); @override _ListSelectDialogState createState() => _ListSelectDialogState(); @@ -63,6 +68,7 @@ class _ListSelectDialogState extends State { child: SingleChildScrollView( child: Column( children: [ + if (widget.searchWidget != null) widget.searchWidget, ...widget.list .map((item) => RadioListTile( title: Text("${item[widget.attributeName].toString()}"), diff --git a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart index e69de29b..68dce5a4 100644 --- a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart +++ b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart @@ -0,0 +1,92 @@ +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; + +class ListSelectDialog extends StatefulWidget { + final List list; + final String attributeName; + final String attributeValueId; + final okText; + final Function(dynamic) okFunction; + dynamic selectedValue; + + ListSelectDialog( + {@required this.list, + @required this.attributeName, + @required this.attributeValueId, + @required this.okText, + @required this.okFunction}); + + @override + _ListSelectDialogState createState() => _ListSelectDialogState(); +} + +class _ListSelectDialogState extends State { + @override + void initState() { + super.initState(); + widget.selectedValue = widget.selectedValue ?? widget.list[0]; + } + + @override + Widget build(BuildContext context) { + return showAlertDialog(context); + } + + showAlertDialog(BuildContext context) { + // set up the buttons + Widget cancelButton = FlatButton( + child: Text(TranslationBase.of(context).cancel), + onPressed: () { + Navigator.of(context).pop(); + }); + Widget continueButton = FlatButton( + child: Text(this.widget.okText), + onPressed: () { + this.widget.okFunction(widget.selectedValue); + Navigator.of(context).pop(); + }); +// set up the AlertDialog + AlertDialog alert = AlertDialog( + // title: Text(widget.title), + content: createDialogList(), + actions: [ + cancelButton, + continueButton, + ], + ); + return alert; + } + + Widget createDialogList() { + return Container( + height: MediaQuery.of(context).size.height * 0.5, + child: SingleChildScrollView( + child: Column( + children: [ + ...widget.list + .map((item) => RadioListTile( + title: Text("${item[widget.attributeName].toString()}"), + groupValue: widget.selectedValue[widget.attributeValueId] + .toString(), + value: item[widget.attributeValueId].toString(), + activeColor: Colors.blue.shade700, + selected: item[widget.attributeValueId].toString() == + widget.selectedValue[widget.attributeValueId] + .toString(), + onChanged: (val) { + setState(() { + widget.selectedValue = item; + }); + }, + )) + .toList() + ], + ), + ), + ); + } + + static closeAlertDialog(BuildContext context) { + Navigator.of(context).pop(); + } +} From bada160cf5272b11ba75a0b48f511a2df34d0601 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sat, 23 Jan 2021 18:22:34 +0200 Subject: [PATCH 05/11] Search Medacation --- lib/core/service/prescription_service.dart | 18 +- lib/core/viewModel/medicine_view_model.dart | 5 +- .../viewModel/prescription_view_model.dart | 15 +- .../prescription/add_prescription_form.dart | 305 +++++++----------- .../prescription/prescription_screen.dart | 16 +- 5 files changed, 153 insertions(+), 206 deletions(-) diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 807d8bc1..98c6143b 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -65,17 +65,17 @@ class PrescriptionService extends BaseService { Future getMedicationList() async { hasError = false; - _drugRequestModel.search =[""]; + _drugRequestModel.search = [""]; await baseAppClient.post(SEARCH_DRUG, onSuccess: (dynamic response, int statusCode) { - allMedicationList = []; - response['MedicationList']['entityList'].forEach((v) { - allMedicationList.add(GetMedicationResponseModel.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: _drugRequestModel.toJson()); + allMedicationList = []; + response['MedicationList']['entityList'].forEach((v) { + allMedicationList.add(GetMedicationResponseModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _drugRequestModel.toJson()); } Future postPrescription( diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index 6b780858..23dd0306 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -12,8 +12,8 @@ class MedicineViewModel extends BaseViewModel { get pharmaciesList => _medicineService.pharmaciesList; PrescriptionService _prescriptionService = locator(); - List get allMedicationList => _prescriptionService.allMedicationList; - + List get allMedicationList => + _prescriptionService.allMedicationList; Future getMedicineItem(String itemName) async { setState(ViewState.Busy); @@ -24,6 +24,7 @@ class MedicineViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + Future getMedicationList() async { setState(ViewState.Busy); await _prescriptionService.getMedicationList(); diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 467a715c..34f86ffd 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart'; @@ -13,11 +14,13 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign- class PrescriptionViewModel extends BaseViewModel { bool hasError = false; PrescriptionService _prescriptionService = locator(); + List get allMedicationList => + _prescriptionService.allMedicationList; List get prescriptionList => _prescriptionService.prescriptionList; List get drugsList => _prescriptionService.doctorsList; - List get allMedicationList => _prescriptionService.allMedicationList; + //List get allMedicationList => _prescriptionService.allMedicationList; Future getPrescription({int mrn}) async { hasError = false; @@ -46,6 +49,16 @@ class PrescriptionViewModel extends BaseViewModel { } } + Future getMedicationList() async { + setState(ViewState.Busy); + await _prescriptionService.getMedicationList(); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + Future updatePrescription( PostPrescriptionReqModel updatePrescriptionReqModel, int mrn) async { hasError = false; diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 2f8b47cb..5c1bd3b4 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -1,7 +1,9 @@ +import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; @@ -16,6 +18,7 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/dynamic_elements.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; @@ -23,6 +26,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; @@ -105,6 +109,9 @@ class _PrescriptionFormWidgetState extends State { TextEditingController instructionController = TextEditingController(); DateTime selectedDate; dynamic selectedDrug; + GetMedicationResponseModel _selectedMedication; + GlobalKey key = + new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); @@ -344,7 +351,9 @@ class _PrescriptionFormWidgetState extends State { // patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getDrugs(drugName: textSeartch), + onModelReady: (model) async { + await model.getMedicationList(); + }, builder: (BuildContext context, PrescriptionViewModel model, Widget child) => NetworkBaseView( @@ -378,152 +387,73 @@ class _PrescriptionFormWidgetState extends State { //mainAxisAlignment: MainAxisAlignment.end, children: [ Container( - height: screenSize.height * 0.070, + height: MediaQuery.of(context).size.height * + 0.070, child: InkWell( - onTap: model.drugsList != null && - model.drugsList.length > 0 + onTap: model.allMedicationList != null ? () { - return drugDialog = - ListSelectDialog( - list: model.drugsList, - attributeName: 'GenericName', - attributeValueId: 'ItemId', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - selectedDrug = selectedValue; - }); - }, - /* searchWidget: Row( - children: [ - Expanded( - child: TextField( - decoration: Helpers - .textFieldSelectorDecoration( - TranslationBase.of( - context) - .search, - searchController.text != - null && - searchController - .text != - "" - ? searchController - .text - : null, - false, - ), - onChanged: (String str) { - textSeartch = str; - }, - controller: - searchController, - enabled: true, - ), - ), - Container( - child: InkWell( - child: Icon( - Icons.search, - color: Colors.black, - ), - onTap: () async { - Navigator.of(context) - .pop(); - await searchMedicine( - context, - model, - textSeartch); - showDialog( - barrierDismissible: - false, - context: context, - builder: (BuildContext - context) { - return drugDialog; - }, - ); - }, - ), - margin: - EdgeInsets.symmetric( - horizontal: 8), - ) - ], - ),*/ - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return drugDialog; - }, - ); + setState(() { + _selectedMedication = null; + }); } : null, - child: Row( - children: [ - Expanded( - child: TextField( - decoration: Helpers - .textFieldSelectorDecoration( + child: _selectedMedication == null + ? AutoCompleteTextField< + GetMedicationResponseModel>( + decoration: + textFieldSelectorDecoration( TranslationBase.of(context) - .search, - searchController.text != null && - searchController.text != - "" - ? searchController.text + .searchMedicineNameHere, + _selectedMedication != null + ? _selectedMedication + .genericName : null, - false, + true, ), - onChanged: (String str) { - textSeartch = str; - }, - controller: searchController, - enabled: true, - ), - ), - Container( - child: InkWell( - child: Icon( - Icons.search, - color: Colors.black, + itemSubmitted: (item) => setState( + () => + _selectedMedication = item), + key: key, + suggestions: + model.allMedicationList, + itemBuilder: (context, + suggestion) => + new Padding( + child: Texts(suggestion + .description + + '/' + + suggestion.genericName), + padding: + EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.genericName + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.description + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.keywords + .toLowerCase() + .startsWith( + input.toLowerCase()), + ) + : TextField( + decoration: + textFieldSelectorDecoration( + TranslationBase.of(context) + .searchMedicineNameHere, + _selectedMedication != null + ? _selectedMedication + .description + + ('${_selectedMedication.genericName}') + : null, + true, ), - onTap: () async { - // Navigator.of(context) - // .pop(); - await searchMedicine( - context, model, textSeartch); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return drugDialog; - }, - ); - }, + enabled: false, ), - margin: EdgeInsets.symmetric( - horizontal: 8), - ) - ], - ), /*TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .searchMedicine, - selectedDrug != null - ? selectedDrug['GenericName'] - : null, - true, - suffixIcon: Icon( - Icons.search, - color: Colors.black, - )), - enabled: true, - ),*/ ), ), SizedBox( @@ -603,47 +533,21 @@ class _PrescriptionFormWidgetState extends State { Container( width: MediaQuery.of(context).size.width * - 0.5, - child: InkWell( - onTap: strengthList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: strengthList, - attributeName: 'name', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - strength = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .strength, - strength != null - ? strength['name'] - : null, - true), - enabled: false, - ), + 0.650, + child: TextFields( + hintText: TranslationBase.of(context) + .strength, + controller: strengthController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty && + strengthController.text.length > + 4) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, ), ), SizedBox( @@ -652,7 +556,7 @@ class _PrescriptionFormWidgetState extends State { Container( width: MediaQuery.of(context).size.width * - 0.40, + 0.250, child: InkWell( onTap: unitsList != null ? () { @@ -958,15 +862,15 @@ class _PrescriptionFormWidgetState extends State { onPressed: () { formKey.currentState.save(); Navigator.pop(context); - openDrugToDrug(); - if (strength == null || - route == null || + //openDrugToDrug(); + if (route == null || frequency == null || indication == null || doseTime == null || duration == null || - selectedDrug == null || - selectedDate == null) { + selectedDate == null || + units == null || + _selectedMedication == null) { DrAppToastMsg.showErrorToast( "Please Fill All Fields"); return; @@ -974,7 +878,32 @@ class _PrescriptionFormWidgetState extends State { if (formKey.currentState.validate()) { Navigator.pop(context); - openDrugToDrug(); + { + postProcedure( + dose: strengthController.text, + doseUnit: + units['id'].toString(), + patient: widget.patient, + doseTimeIn: + doseTime['id'].toString(), + model: widget.model, + duration: + duration['id'].toString(), + frequency: frequency['id'] + .toString(), + route: route['id'].toString(), + drugId: _selectedMedication + .itemId + .toString(), + strength: + strengthController.text, + indication: + indicationController.text, + instruction: + instructionController + .text, + doseTime: selectedDate); + } } { // Navigator.push( @@ -1070,7 +999,7 @@ class _PrescriptionFormWidgetState extends State { title: TranslationBase.of(context).addMedication, onPressed: () { postProcedure( - dose: strength['id'].toString(), + dose: strengthController.text, doseUnit: units['id'].toString(), patient: widget.patient, doseTimeIn: doseTime['id'].toString(), @@ -1079,7 +1008,7 @@ class _PrescriptionFormWidgetState extends State { frequency: frequency['id'].toString(), route: route['id'].toString(), drugId: selectedDrug['ItemId'].toString(), - strength: strength['id'].toString(), + strength: strengthController.text, indication: indicationController.text, instruction: instructionController.text, doseTime: selectedDate); diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 4d000838..00fc38b8 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -754,8 +754,7 @@ class _NewPrescriptionScreenState extends State { route = selectedValue; }); if (route == null) { - helpers - .showErrorToast('plase fill'); + route = route['id']; } }, ); @@ -904,10 +903,15 @@ class _NewPrescriptionScreenState extends State { model: model, drugId: drugId, remarks: remarksController.text, - route: route['id'].toString(), - frequency: - frequencyUpdate['id'].toString(), - dose: doseTime['id'].toString(), + route: route != null + ? route['id'].toString() + : rouat, + frequency: frequencyUpdate != null + ? frequencyUpdate['id'].toString() + : frequency, + dose: doseTime != null + ? doseTime['id'].toString() + : dose, enteredRemarks: enteredRemarks); Navigator.pop(context); }, From 1de25aae2f87074301cbe06c2f411c5500e9b893 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 24 Jan 2021 01:35:15 +0200 Subject: [PATCH 06/11] fix issue on assessment design --- lib/config/localized_values.dart | 4 ++-- .../profile/soap_update/update_assessment_page.dart | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 77836895..c56f2e02 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -329,7 +329,7 @@ const Map> localizedValues = { 'referredFrom': {'en': "Referred From", 'ar': 'محال من'}, 'branch': {'en': "Branch", 'ar': 'الفرع'}, 'chooseAppointment': {'en': "Choose Appointment", 'ar': 'اختر موعد'}, - 'appointmentNo': {'en': "Appointment #:", 'ar': '# الموعد:'}, + 'appointmentNo': {'en': "Appointment # : ", 'ar': '# الموعد:'}, 'refer': {'en': "REFER", 'ar': 'إحالة'}, 'rejected': {'en': "Rejected", 'ar': 'مرفوض'}, 'sameBranch': {'en': "Same Branch", 'ar': 'نفس الفرع'}, @@ -582,7 +582,7 @@ const Map> localizedValues = { }, 'searchExamination': {'en': "Search Examination", 'ar': "فحص البحث"}, 'addExamination': {'en': "Add Examination", 'ar': "اضافه"}, - 'doc': {'en': "Doc :", 'ar': " د: "}, + 'doc': {'en': "Doc : ", 'ar': " د : "}, 'patientNoDetailErrMsg': { 'en': "There is no detail for this patient", 'ar': "لا توجد تفاصيل لهذا المريض" diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 7bcea474..e42cfcf8 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -1,5 +1,6 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; 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/viewModel/SOAP_view_model.dart'; @@ -8,6 +9,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -263,7 +265,7 @@ class _UpdateAssessmentPageState extends State { MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).dType+':', + TranslationBase.of(context).dType+' : ', fontWeight: FontWeight .bold, fontSize: 16, @@ -788,7 +790,11 @@ class _AddAssessmentDetailsState extends State { helpers .showErrorToast(model.error); } else { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; + mySelectedAssessment.doctorName = doctorProfile.doctorName; if (!isUpdate) { // widget.mySelectedAssessmentList.add(mySelectedAssessment); From f0cd33ae433708da509bcc1f459ec45fd6637168 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 24 Jan 2021 02:31:27 +0200 Subject: [PATCH 07/11] fix issue on assessment design --- lib/config/localized_values.dart | 2 +- .../profile/patient_profile_widget.dart | 2 +- .../subjective/update_subjective_page.dart | 1 - .../soap_update/update_assessment_page.dart | 2 +- .../profile/soap_update/update_plan_page.dart | 18 +++++++---- lib/widgets/shared/app_scaffold_widget.dart | 30 ++++++++++--------- 6 files changed, 31 insertions(+), 24 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c56f2e02..71929250 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -7,7 +7,7 @@ const Map> localizedValues = { 'theDoctor': {'en': 'Doctor', 'ar': 'الطبيب'}, 'reply': {'en': 'Reply', 'ar': 'رد'}, 'time': {'en': 'Time', 'ar': 'الوقت'}, - 'fileNo': {'en': 'File No:', 'ar': 'رقم الملف:'}, + 'fileNo': {'en': 'File No : ', 'ar': 'رقم الملف :'}, 'mobileNo': {'en': 'Mobile No', 'ar': 'رقم الموبايل'}, 'messagesScreenToolbarTitle': {'en': 'Messages', 'ar': 'الرسائل'}, 'mySchedule': {'en': 'Schedule', 'ar': 'جدولي'}, diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index bab7cc84..67c489e7 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 { fontWeight: FontWeight.bold, ), SizedBox( - width: 20, + width: 4, ), AppText( patient.patientId.toString(), diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 184b4391..a6167c43 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -522,7 +522,6 @@ class _UpdateSubjectivePageState extends State { if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - //TODO: make static value dynamic postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( ListHisProgNotePatientAllergyDiseaseVM( allergyDiseaseId: allergy.selectedAllergy.id, diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index e42cfcf8..e6e1a908 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -332,7 +332,7 @@ class _UpdateAssessmentPageState extends State { children: [ AppText( - "ICD: ".toUpperCase(), + "ICD : ".toUpperCase(), fontWeight: FontWeight .bold, fontSize: 16, diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index 06cbfc06..04b2b73d 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -132,7 +132,7 @@ class _UpdatePlanPageState extends State { ), Column( children: [ - if(widget.patientProgressNote==null) + if(widget.patientProgressNote.planNote == null) Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), @@ -161,7 +161,7 @@ class _UpdatePlanPageState extends State { SizedBox( height: 20, ), - if (progressNoteController.text !='') + if ( widget.patientProgressNote.planNote != null) Container( margin: EdgeInsets.only(left: 5, right: 5, top: 15), @@ -308,12 +308,16 @@ class _UpdatePlanPageState extends State { patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, - planNote: progressNoteController.text, doctorID: '', editedBy: ''); + planNote: widget.patientProgressNote.planNote, doctorID: '', editedBy: ''); if(model.patientProgressNoteList.isEmpty){ await model.postProgressNote(postProgressNoteRequestModel); }else { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + postProgressNoteRequestModel.editedBy =doctorProfile.doctorID; await model.patchProgressNote(postProgressNoteRequestModel); } @@ -335,12 +339,12 @@ class _UpdatePlanPageState extends State { context: context, builder: (context) { return FractionallySizedBox( - heightFactor: 0.5, + heightFactor: 0.6, child: Container( child: FractionallySizedBox( widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + child: ListView( + // crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 16, @@ -355,6 +359,7 @@ class _UpdatePlanPageState extends State { ), Container( margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: TextFields( hintText: TranslationBase.of(context).addProgressNote, fontSize: 13.5, @@ -383,6 +388,7 @@ class _UpdatePlanPageState extends State { widget.patientProgressNote.createdByName = widget.patientProgressNote.createdByName??doctorProfile.doctorName; widget.patientProgressNote.editedByName=doctorProfile.doctorName; widget.patientProgressNote.createdOn= DateTime.now().toString() ; + widget.patientProgressNote.planNote = progressNoteController.text; setState(() { print(progressNoteController.text); }); diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 4ddd7873..d60edb9f 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -1,11 +1,12 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; + import '../../widgets/shared/app_loader_widget.dart'; import 'app_texts_widget.dart'; import 'network_base_view.dart'; @@ -64,20 +65,21 @@ class AppScaffold extends StatelessWidget { children: [body, buildAppLoaderWidget(isLoading)]) : Center( child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - "assets/images/undraw_connected_world_wuay.png", - height: 250, - ), - AppText('No Internet Connection') - ], - ), - )); + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/images/undraw_connected_world_wuay.png", + height: 250, + ), + AppText('No Internet Connection') + ], + ), + ), + ); } - Widget buildAppLoaderWidget(bool isloading) { - return isloading ? AppLoaderWidget() : Container(); + Widget buildAppLoaderWidget(bool isLoading) { + return isLoading ? AppLoaderWidget() : Container(); } } From cbf850da2faaf5d8c35fa64d6f6b5f069220d9c7 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 24 Jan 2021 11:10:09 +0200 Subject: [PATCH 08/11] fix DA-201 --- .../medicine/medicine_search_screen.dart | 87 ++++--------------- .../medicine/pharmacies_list_screen.dart | 39 ++++++--- 2 files changed, 41 insertions(+), 85 deletions(-) diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 5e26e65b..e0102e77 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -117,7 +117,7 @@ class _MedicineSearchState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - if(model.allMedicationList.isNotEmpty) + if(model.allMedicationList.length == 0) await model.getMedicationList(); }, builder: (_, model, w) => @@ -214,6 +214,8 @@ class _MedicineSearchState extends State { .startsWith(input.toLowerCase()), ) : TextField( + minLines: 2, + maxLines: 2, decoration: textFieldSelectorDecoration( TranslationBase .of(context) @@ -245,72 +247,6 @@ class _MedicineSearchState extends State { ], ), ), - Column( - children: [ - Container( - margin: EdgeInsets.only( - left: SizeConfig.heightMultiplier * 2), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase - .of(context) - .youCanFind + - model.pharmacyItemsList.length - .toString() + - " " + - TranslationBase - .of(context) - .itemsInSearch, - fontWeight: FontWeight.bold, - ), - ], - ), - ), - Container( - height: MediaQuery - .of(context) - .size - .height * 0.35, - child: Container( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.pharmacyItemsList == null - ? 0 - : model.pharmacyItemsList.length, - itemBuilder: (BuildContext context, - int index) { - return InkWell( - child: MedicineItemWidget( - label: model.pharmacyItemsList[index] - ["ItemDescription"], - url: model.pharmacyItemsList[index] - ["ImageSRCUrl"], - ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - PharmaciesListScreen( - itemID: - model.pharmacyItemsList[ - index]["ItemID"], - url: model - .pharmacyItemsList[ - index]["ImageSRCUrl"]), - ), - ); - }, - ); - }, - ), - ), - ), - ], - ), ], ), ), @@ -337,10 +273,19 @@ class _MedicineSearchState extends State { return; } - GifLoaderDialogUtils.showMyDialog(context); - - await model.getMedicineItem(_selectedMedication.description); - GifLoaderDialogUtils.hideDialog(context); + // GifLoaderDialogUtils.showMyDialog(context); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PharmaciesListScreen( + itemID:_selectedMedication.itemId, + selectedMedication: _selectedMedication, + ), + ), + ); + // await model.getMedicineItem(_selectedMedication.description); + // GifLoaderDialogUtils.hideDialog(context); } diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 2433487f..d39de338 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'dart:typed_data'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -22,9 +23,11 @@ class PharmaciesListScreen extends StatefulWidget { final int itemID; final String url; + final GetMedicationResponseModel selectedMedication; // In the constructor, require a item id. - PharmaciesListScreen({Key key, @required this.itemID, this.url}) + PharmaciesListScreen( + {Key key, @required this.itemID, this.url, this.selectedMedication}) : super(key: key); @override @@ -49,17 +52,24 @@ class _PharmaciesListState extends State { Widget build(BuildContext context) { projectsProvider = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPharmaciesList(widget.itemID), - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).pharmaciesList, - body: Container( - height: SizeConfig.screenHeight, - child: ListView( - shrinkWrap: true, - scrollDirection: Axis.vertical, - physics: const AlwaysScrollableScrollPhysics(), - children: [ + onModelReady: (model) async { + await model.getPharmaciesList(widget.selectedMedication.itemId); + await model.getMedicineItem(widget.selectedMedication.description); + + }, + builder: (_, model, w) => + AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase + .of(context) + .pharmaciesList, + body: Container( + height: SizeConfig.screenHeight, + child: ListView( + shrinkWrap: true, + scrollDirection: Axis.vertical, + physics: const AlwaysScrollableScrollPhysics(), + children: [ model.pharmaciesList.length > 0 ? RoundedContainer( child: Row( @@ -69,9 +79,10 @@ class _PharmaciesListState extends State { child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(7)), - child: widget.url != null + child: model.pharmacyItemsList[0] + ["ImageSRCUrl"]!= null ? Image.network( - widget.url, + model.pharmacyItemsList[0]["ImageSRCUrl"], height: SizeConfig.imageSizeMultiplier * 21, From 8c9ffc2e62b058fa09261192de3a29e9bf42018d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 24 Jan 2021 14:31:00 +0200 Subject: [PATCH 09/11] fix multiple issue --- lib/core/viewModel/SOAP_view_model.dart | 13 +++++++++---- .../get_patient_arrival_list_request_model.dart | 17 +++++++++++------ lib/screens/patients/patients_screen.dart | 2 +- .../profile/patient-page-header-widget.dart | 2 +- .../subjective/update_subjective_page.dart | 8 ++++++++ .../profile/soap_update/update_soap_index.dart | 1 + 6 files changed, 31 insertions(+), 12 deletions(-) diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 2c312ade..076f379c 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -237,13 +237,18 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - - Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async { - - setState(ViewState.Busy); + Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP, + {isLocalBusy = false}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else + setState(ViewState.Busy); await _SOAPService.getPatientAllergy(generalGetReqForSOAP); if (_SOAPService.hasError) { error = _SOAPService.error; + if (isLocalBusy) { + setState(ViewState.ErrorLocal); + } else setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart index 66890a8f..1d0da9c5 100644 --- a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart +++ b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart @@ -6,15 +6,17 @@ class GetPatientArrivalListRequestModel { int pageIndex; int pageSize; int clinicID; + int patientMRN; GetPatientArrivalListRequestModel( {this.vidaAuthTokenID, - this.from, - this.to, - this.doctorID, - this.pageIndex, - this.pageSize, - this.clinicID}); + this.from, + this.to, + this.doctorID, + this.pageIndex, + this.pageSize, + this.clinicID, + this.patientMRN}); GetPatientArrivalListRequestModel.fromJson(Map json) { vidaAuthTokenID = json['VidaAuthTokenID']; @@ -24,6 +26,7 @@ class GetPatientArrivalListRequestModel { pageIndex = json['PageIndex']; pageSize = json['PageSize']; clinicID = json['ClinicID']; + patientMRN = json['PatientMRN']; } Map toJson() { @@ -35,6 +38,8 @@ class GetPatientArrivalListRequestModel { data['PageSize'] = this.pageSize; data['ClinicID'] = this.clinicID; data['VidaAuthTokenID'] = this.vidaAuthTokenID; + data['PatientMRN'] = this.patientMRN; + return data; } diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 57abe393..14f68a79 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -262,7 +262,7 @@ class _PatientsScreenState extends State { GetPatientArrivalListRequestModel getPatientArrivalListRequestModel; if (val2 == 7) { getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel( - from: patient.From, to: patient.To, pageIndex: 0, pageSize: 0); + from: patient.From, to: patient.To, pageIndex: 0, pageSize: 0,patientMRN: patient.getPatientID); } model diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index abd2f5ad..6457b8cb 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -91,7 +91,7 @@ class PatientPageHeaderWidget extends StatelessWidget { ), ], ), - model.patientAllergiesList.isNotEmpty ?AppText( + model.patientAllergiesList.isNotEmpty && model.getAllergicNames(projectViewModel.isArabic)!='' ?AppText( TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic), color: Color(0xFFB9382C), fontWeight: FontWeight.bold, diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index a6167c43..ea81282e 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -544,6 +544,14 @@ class _UpdateSubjectivePageState extends State { await model.patchAllergy(postAllergyRequestModel); } + GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + doctorID: '', + editedBy: ''); + await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy : true); + if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); } diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 7b68b4f3..61e5a4b4 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -37,6 +37,7 @@ class _UpdateSoapIndexState extends State GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); changePageViewIndex(pageIndex) { + changeLoadingState(true); _controller.jumpToPage(pageIndex); } From 00543a759a4c1632fba91de0fac7a91347ef3caa Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 24 Jan 2021 15:30:42 +0200 Subject: [PATCH 10/11] fix remarks in allergies --- assets/fonts/DoctorApp.ttf | Bin 15928 -> 16960 bytes lib/core/service/SOAP_service.dart | 2 + lib/core/viewModel/patient_view_model.dart | 14 +-- lib/icons_app/config.json | 14 +++ lib/icons_app/doctor_app_icons.dart | 94 ++++++------------ lib/models/SOAP/GetAllergiesResModel.dart | 5 +- lib/screens/dashboard_screen.dart | 2 +- .../medicine/medicine_search_screen.dart | 2 +- .../medicine/pharmacies_list_screen.dart | 2 +- .../subjective/update_subjective_page.dart | 1 + 10 files changed, 62 insertions(+), 74 deletions(-) diff --git a/assets/fonts/DoctorApp.ttf b/assets/fonts/DoctorApp.ttf index 22539da0652f12c82f86a0652f0c69f2a8f697c8..7c3f1bf1f7a4bec949e74b3cd8319ed91b753cb5 100644 GIT binary patch delta 1408 zcmYjQOKcle6n%H>nTdZB+w)6okK?gpkMpzR-%L_}s~|*5irhj{1SP?3(}b!{+%}>q z6nR0UR?tPkEMNgbf>kSoP*_wbi>iE7LE-%&& zDYw?IA@??#zKnqFBK<3#x6lTc>uc*TZFTVuenEfj=<31RM>jt^jQY3HFVt)64R{hB z;C&zZp_N*FaqEVU$b=NnVnSzQ^~Bm=7u;P!DsLg_;u~9$vO)m4Xy?9G-dpG`+$9c6 z8xitT#)qVT_wL>9b4<;00Nox!nJ5lZr?i4_4Dzk>P=@K&_ps5VuXiy%q0ua8qiFcT z@YO>)A(s&~g`>FJAL3SGrtuOtB2>G#-PiWD2ioCww5_+N%~);H<`D}bHuxWgivJHl z{W#fy4_hDwQX-|+w^Wf1U;^d?j|IF)cA5fM-UO(F=&tY{J>xdcH_z>p=5(l}soigJ)r zK+WNG8FDd=i7*j0Z1VLeu9!uN<}e4-3t9qQ1q4|)az-wzXVkQ$fGkR~UItptskB*6 zvI#7MrLhUnVwzY2Hm8Zgc2HInWJ#9tkd_2y1dGAzw4RNPfGA@zK`_!f7D1~CDhZM) z3&*ffEgZ{b4VI@b<(NjEUKAqr9niohg6&qFQ}*32-ObTcYo0`wU%sVP!8w33h!c`^HAaVgn1w|@K) zeg9FBbBg!wKk$gG&B+_j*OSTmg5iGDVGWGPbW(Lbo;y=MG$>yQ*nam(iywv$l z2n1jPq<})%QhVn$yF;7bn{s-D3eN%M;wuh2WfeOsKy^Csg-diX!@~?G4Z1v3k4^IL z33<6rhvP#QyWPdD3W_2uj5L-@cUYT^b)V|-du=N3j{*JQjwNc%%x1$d8JC;Gy}cuH zd=kRh*$h}{i1~Td=JogV1%?8t@w2>CE=#anV0)`@*WxZg3;sJPvg#*Cvs%nyNG5kf-1OWRiI z$XMi7JXsyJ`dHRy9jzwgLz=_l8z17lylZIOM_E~R&{woWyPyE?p=Ec*ji-PhIvfY=Av;rXv$l$j{m{SDk8@}1 z&B;F@)!Nwc4Wu@!`C|Y|>q=pQg5c)8LIDK#iN)ISgUbtz+S&_?D{EsZ{H6Z^e1aS= delta 451 zcmYL^ze_?<6vxl;`6MeSh#Z6Dj?Rsg;G1!?hTZdQKF$OD44W_Pr9`^aur$0M29e8E+HnP3qZP_QiU_yeczN z={fD>b|16VRpen^%NabzpQyJX?_ARKgn8qlR-&ODENnE=%h|~X{gfzj0MqWa*%NgW z!wVffPHxULMc%1Fksx%}GO+P?TkqDCLsMpv*Af0xJJmk7@Nk9)MUkT%6jxlx1FDb$ zc_BMyo3#~0XQ0(4FYfvpw^MaRGXj3uB-^A*cF1noCxey+Lb3(K1Je6L;Ql|1J|Be; zVMGK4Ch=ekVT(g_DPN+(s_3vgoT=ZQ_Oj1D&7!1+@Q3oXdLIz$!>{ZYxsglumq()+ PX16$th01TS2*dLYRUvQb diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index abb832c7..d0cebe77 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -217,7 +217,9 @@ class SOAPService extends LookupService { await baseAppClient.post (GET_ALLERGY, onSuccess: (dynamic response, int statusCode) { + print("Success"); patientAllergiesList.clear(); + response['List_Allergies']['entityList'].forEach((v) { patientAllergiesList.add(GetAllergiesResModel.fromJson(v)); }); diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index 2fcdc779..d12ac7f5 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -2,7 +2,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient_service.dart'; import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart'; import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart'; @@ -56,16 +55,13 @@ class PatientViewModel extends BaseViewModel { } else { setState(ViewState.Busy); } - return _patientService.getPatientList(patient, patientType); + if (_patientService.hasError) { error = _patientService.error; - if (isBusyLocal) { - setState(ViewState.ErrorLocal); - } else { - setState(ViewState.Error); - } - } else - setState(ViewState.Idle); + setState(ViewState.Error); + } + return _patientService.getPatientList(patient, patientType); + } Future getPatientVitalSign(patient) async { diff --git a/lib/icons_app/config.json b/lib/icons_app/config.json index ede09595..15dda748 100644 --- a/lib/icons_app/config.json +++ b/lib/icons_app/config.json @@ -412,6 +412,20 @@ "leaves" ] }, + { + "uid": "4477771717c5280f9030b8e410040eda", + "css": "search_patient-1", + "code": 59465, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M1142.7 436.8A165.2 165.2 0 1 0 1307.8 601.9 165.4 165.4 0 0 0 1142.7 436.8ZM1142.7 748.8A146.9 146.9 0 1 1 1289.5 601.9 147 147 0 0 1 1142.7 748.8ZM1023.4 611.1H1041.7A110.3 110.3 0 0 1 1151.8 500.9V482.7A128.5 128.5 0 0 0 1023.4 611.1ZM1476.4 883.8L1489.3 870.9 1357.9 739.4 1345 752.4 1322 729.4A219.8 219.8 0 1 0 1270.1 781.5L1293.1 804.5 1280.2 817.4 1411.4 948.7 1424.4 935.7 1306 817.3 1357.9 765.4ZM1142.6 803.9A201.9 201.9 0 1 1 1344.4 602 202.2 202.2 0 0 1 1142.6 803.9ZM1306 791.3L1284.7 770.1A220.1 220.1 0 0 0 1310.7 744.1L1332.1 765.5ZM48.4 483.9H301.4A96.4 96.4 0 0 1 276.7 346.5 305.1 305.1 0 0 1 257.9 242V201.9A201.8 201.8 0 0 1 564.5 29.2 201.8 201.8 0 0 1 871 201.8V205.4L887 177.2 957.1 299.9A80.6 80.6 0 0 1 869.7 417.5 96.9 96.9 0 0 1 785.1 499.2 226.4 226.4 0 0 1 645.1 662.2V696.2L780.4 720.8A267.4 267.4 0 0 1 999.9 983.9V999.9H129V983.9A267.4 267.4 0 0 1 348.6 720.8L483.9 696.2V662.3A224.6 224.6 0 0 1 396.8 602.3C396 602.6 395.1 602.8 394.3 603.1A92.8 92.8 0 0 1 352.9 612.9H48.4A48.4 48.4 0 0 1 0 564.5V532.3A48.4 48.4 0 0 1 48.4 483.9ZM339.5 465.8C339.3 461.1 338.7 456.4 338.7 451.7V341A64.2 64.2 0 0 0 339.5 465.7ZM838.7 242V201.9A169.6 169.6 0 0 0 575.1 60.8L564.5 67.8 554 60.8A169.6 169.6 0 0 0 290.3 201.9V242A273.2 273.2 0 0 0 302.3 322.2 96.2 96.2 0 0 1 338.7 308.1V282.4L403.2 234V193.5A32.3 32.3 0 0 1 435.5 161.3H693.5A32.3 32.3 0 0 1 725.8 193.5V233.9L790.3 282.3V307.8A95.4 95.4 0 0 1 810.8 313.9 78.8 78.8 0 0 1 817 299.9L837.7 263.6C838.3 256.4 838.7 249.2 838.7 242ZM435.5 290.4H693.6V193.5H435.5ZM887.9 387.2A47.6 47.6 0 0 0 929.3 316L887.1 242.2 844.9 315.9A47.6 47.6 0 0 0 887.6 387.1ZM838.8 403.2A79.4 79.4 0 0 1 807.4 348.1 63.2 63.2 0 0 0 790.4 340.9V451.6C790.4 456.4 790 461 789.7 465.7A64.5 64.5 0 0 0 838.7 403.2ZM758.1 451.6V298.4L725.9 274.3V290.4A32.3 32.3 0 0 1 693.6 322.6H435.5A32.3 32.3 0 0 1 403.2 290.4V274.3L370.9 298.4V451.6A195.2 195.2 0 0 0 374.4 486.4 92.8 92.8 0 0 1 394.3 493.6 60.6 60.6 0 0 0 421.2 500H532.2A48.4 48.4 0 1 1 532.2 596.7H436.9A193.2 193.2 0 0 0 758.1 451.6ZM532.3 564.5A16 16 0 1 0 532.3 532.2H516.3V564.5ZM637.4 727.6A80.7 80.7 0 0 1 583.6 771.6 64.5 64.5 0 0 0 645.1 806.4C680.7 806.4 709.6 784.7 709.6 758A36.4 36.4 0 0 0 704.4 739.7ZM161.8 967.8H967.2A235 235 0 0 0 774.7 752.6L740.8 746.5A64.8 64.8 0 0 1 742 758.2C742 802.6 698.6 838.8 645.2 838.8A102.9 102.9 0 0 1 564.6 802.6 102.9 102.9 0 0 1 483.9 838.7C430.4 838.7 387.1 802.5 387.1 758.1A65.9 65.9 0 0 1 388.2 746.4L354.4 752.6A235 235 0 0 0 161.8 967.8ZM424.5 739.9A36.4 36.4 0 0 0 419.4 758.2C419.4 784.9 448.3 806.6 483.9 806.6A64.5 64.5 0 0 0 545.4 771.8 80.6 80.6 0 0 1 491.6 727.7ZM516 677.4V693.4A48.4 48.4 0 1 0 612.8 693.4V672.1A222.6 222.6 0 0 1 516 672.1ZM379.6 574.3A92.9 92.9 0 0 1 421 564.5H483.9V532.3H421.2A93.1 93.1 0 0 1 379.9 522.5 60.6 60.6 0 0 0 352.9 516H129V580.5H352.9A60.6 60.6 0 0 0 379.9 574.3ZM32.1 564.5A16 16 0 0 0 48.1 580.5H96.8V516H48.4A16 16 0 0 0 32.4 532ZM524.9 368.4L507 341.5 410.3 406.1 428.2 432.9ZM718.5 405.8L621.8 341.3 603.9 368.1 700.6 432.7Z", + "width": 1489 + }, + "search": [ + "search_patient" + ] + }, { "uid": "740f78c2b53c8cc100a8b0d283bbd34f", "css": "home_icon-1", diff --git a/lib/icons_app/doctor_app_icons.dart b/lib/icons_app/doctor_app_icons.dart index ef01c934..7c05c223 100644 --- a/lib/icons_app/doctor_app_icons.dart +++ b/lib/icons_app/doctor_app_icons.dart @@ -1,5 +1,5 @@ /// Flutter icons DoctorApp -/// Copyright (C) 2020 by original authors @ fluttericon.com, fontello.com +/// Copyright (C) 2021 by original authors @ fluttericon.com, fontello.com /// This font was generated by FlutterIcon.com, which is derived from Fontello. /// /// To use this font, place it in your fonts/ directory and include the @@ -11,7 +11,7 @@ /// fonts: /// - asset: fonts/DoctorApp.ttf /// -/// +/// /// import 'package:flutter/widgets.dart'; @@ -19,64 +19,36 @@ class DoctorApp { DoctorApp._(); static const _kFontFam = 'DoctorApp'; - static const String _kFontPkg = null; + static const _kFontPkg = null; - static const IconData female_icon = - IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData male = - IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData reject_icon = - IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_icon_active = - IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu_icon = - IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu_icon_active = - IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData message_icon = - IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData message_icon_active = - IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData scdedule_icon_active = - IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData schedule_icon = - IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData discharge_patient = - IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData approved_icon = - IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData pending_icon = - IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData in_patient_white = - IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData lab_results = - IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_icon = - IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData operations = - IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData out_patient = - IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData patient = - IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData qr_code = - IconData(0xe816, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData radiology = - IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData referral = - IconData(0xe818, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData search_patient = - IconData(0xe81a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData mail = - IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData medicine_search = - IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData referred = - IconData(0xe822, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData sync_icon = - IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData drawer_icon = - IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData leaves = - IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData female_icon = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData male = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData reject_icon = IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon_active = IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_icon = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_icon_active = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData message_icon = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData message_icon_active = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData scdedule_icon_active = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData schedule_icon = IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData discharge_patient = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData approved_icon = IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData pending_icon = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData in_patient_white = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData lab_results = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData operations = IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData out_patient = IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData patient = IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData qr_code = IconData(0xe816, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData radiology = IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referral = IconData(0xe818, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_patient = IconData(0xe81a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData mail = IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData medicine_search = IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referred = IconData(0xe822, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData sync_icon = IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData drawer_icon = IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData leaves = IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_patient_1 = IconData(0xe849, fontFamily: _kFontFam, fontPackage: _kFontPkg); } diff --git a/lib/models/SOAP/GetAllergiesResModel.dart b/lib/models/SOAP/GetAllergiesResModel.dart index a403bd2e..1eeca63e 100644 --- a/lib/models/SOAP/GetAllergiesResModel.dart +++ b/lib/models/SOAP/GetAllergiesResModel.dart @@ -11,6 +11,7 @@ class GetAllergiesResModel { bool isUpdatedByNurse; int severity; String severityName; + String remarks; GetAllergiesResModel( {this.allergyDiseaseId, @@ -24,7 +25,7 @@ class GetAllergiesResModel { this.isChecked, this.isUpdatedByNurse, this.severity, - this.severityName}); + this.severityName, this.remarks=''}); GetAllergiesResModel.fromJson(Map json) { allergyDiseaseId = json['allergyDiseaseId']; @@ -39,6 +40,7 @@ class GetAllergiesResModel { isUpdatedByNurse = json['isUpdatedByNurse']; severity = json['severity']; severityName = json['severityName']; + remarks = json['remarks']; } Map toJson() { @@ -55,6 +57,7 @@ class GetAllergiesResModel { data['isUpdatedByNurse'] = this.isUpdatedByNurse; data['severity'] = this.severity; data['severityName'] = this.severityName; + data['remarks'] = this.remarks; return data; } } diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 76f4e16e..85dd440d 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -804,7 +804,7 @@ class _DashboardScreenState extends State { children: [ Center( child: Icon( - DoctorApp.search_patient, + DoctorApp.search_patient_1, size: 50, color: Colors.black, ), diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index e0102e77..f08f52cb 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -222,7 +222,7 @@ class _MedicineSearchState extends State { .searchMedicineNameHere, _selectedMedication != null ? _selectedMedication.description + - ('${_selectedMedication.genericName}') + (' (${_selectedMedication.genericName} )') : null, true, icon: EvaIcons.search), diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index d39de338..61bd7ad4 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -70,7 +70,7 @@ class _PharmaciesListState extends State { scrollDirection: Axis.vertical, physics: const AlwaysScrollableScrollPhysics(), children: [ - model.pharmaciesList.length > 0 + model.pharmaciesList.length > 0 && model.pharmacyItemsList.length > 0 ? RoundedContainer( child: Row( children: [ diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index ea81282e..f4ad30ab 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -181,6 +181,7 @@ class _UpdateSubjectivePageState extends State { selectedAllergy: selectedAllergy, isChecked: element.isChecked, createdBy: element.createdBy, + remark: element.remarks, selectedAllergySeverity: selectedAllergySeverity); if (selectedAllergy != null && selectedAllergySeverity != null) widget.myAllergiesList.add(mySelectedAllergy); From 7c800bdab4ae636450627ad12264cf31cc45b0a8 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 24 Jan 2021 16:08:43 +0200 Subject: [PATCH 11/11] medical file fix --- lib/core/viewModel/procedure_View_model.dart | 1 + lib/screens/medical-file/medical_file_details.dart | 3 ++- lib/screens/prescription/add_prescription_form.dart | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index fb84f505..5c253025 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -61,6 +61,7 @@ class ProcedureViewModel extends BaseViewModel { if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); + await getProcedure(mrn: mrn); } else { await getProcedure(mrn: mrn); setState(ViewState.Idle); diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 7ad1d47e..f7525391 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -638,7 +638,8 @@ class _MedicalFileDetailsState extends State { .medicalFileList[ 0] .entityList[0] - .timelines[0] + .timelines[ + encounterNumber] .timeLineEvents[0] .consulations[0] .lstProcedure[ diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 5c1bd3b4..b5c248b9 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -350,13 +351,12 @@ class _PrescriptionFormWidgetState extends State { // final routeArgs = ModalRoute.of(context).settings.arguments as Map; // patient = routeArgs['patient']; - return BaseView( + return BaseView( onModelReady: (model) async { await model.getMedicationList(); }, - builder: - (BuildContext context, PrescriptionViewModel model, Widget child) => - NetworkBaseView( + builder: (BuildContext context, MedicineViewModel model, Widget child) => + NetworkBaseView( baseViewModel: model, child: DraggableScrollableSheet( initialChildSize: 0.90,