From 53f45adf69275fb1df521ce676801e48a20d4787 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 22 Mar 2021 14:11:42 +0200 Subject: [PATCH 1/8] hussam --- .../profile_medical_info_widget_search.dart | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index 67b1cad1..98487523 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -26,7 +26,6 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { crossAxisCount: 2, childAspectRatio: 1.5, children: [ - PatientProfileButton( key: key, patient: patient, @@ -66,22 +65,21 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { // nameLine1: TranslationBase.of(context).admission, // nameLine2: TranslationBase.of(context).request, // icon: 'heartbeat.png'), - // (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') - // : - PatientProfileButton( - key: key, - patient: patient, - route: ORDER_PRESCRIPTION_HISTORY, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'lab.png'), + (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') + : PatientProfileButton( + key: key, + patient: patient, + route: ORDER_PRESCRIPTION_HISTORY, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'lab.png'), PatientProfileButton( key: key, patient: patient, From 6f3977d1862e2735d0065670a56ec6c3e99e5546 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 22 Mar 2021 14:44:04 +0200 Subject: [PATCH 2/8] lab orders ui enhancements --- lib/widgets/doctor/lab_result_widget.dart | 102 +++++++++++----------- 1 file changed, 52 insertions(+), 50 deletions(-) diff --git a/lib/widgets/doctor/lab_result_widget.dart b/lib/widgets/doctor/lab_result_widget.dart index e897f33e..5ca50864 100644 --- a/lib/widgets/doctor/lab_result_widget.dart +++ b/lib/widgets/doctor/lab_result_widget.dart @@ -59,9 +59,58 @@ class _LabResultWidgetState extends State { decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(10)), ), - child: Column( - children: widget.labResult.map((result) { + child: Column(children: [ + Container( + child: Row( + children: [ + Expanded( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + TranslationBase.of(context).description, + color: Colors.white, + ), + ), + height: 60, + ), + ), + Expanded( + child: Container( + color: HexColor('#515B5D'), + child: Center( + child: Texts( + TranslationBase.of(context).value, + color: Colors.white), + ), + height: 60), + ), + Expanded( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + TranslationBase.of(context).range, + color: Colors.white), + ), + height: 60), + ), + ], + ), + ), + ...widget.labResult.map((result) { return Container( + padding: EdgeInsets.symmetric(horizontal: 4), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(10)), border: Border( @@ -76,53 +125,6 @@ class _LabResultWidgetState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - children: [ - Expanded( - child: Container( - decoration: BoxDecoration( - color: HexColor('#515B5D'), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), - ), - ), - child: Center( - child: Texts( - TranslationBase.of(context) - .description, - color: Colors.white, - ), - ), - height: 60, - ), - ), - Expanded( - child: Container( - color: HexColor('#515B5D'), - child: Center( - child: Texts( - TranslationBase.of(context).value, - color: Colors.white), - ), - height: 60), - ), - Expanded( - child: Container( - decoration: BoxDecoration( - color: HexColor('#515B5D'), - borderRadius: BorderRadius.only( - topRight: Radius.circular(10.0), - ), - ), - child: Center( - child: Texts( - TranslationBase.of(context).range, - color: Colors.white), - ), - height: 60), - ), - ], - ), Row( children: [ Expanded( @@ -164,7 +166,7 @@ class _LabResultWidgetState extends State { ), ); }).toList(), - ), + ]), ), ) ], From 234cc57a2a342b132bce815066cc1d078b1787b3 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 22 Mar 2021 14:45:31 +0200 Subject: [PATCH 3/8] return search medicine --- lib/core/service/medicine_service.dart | 3 +- lib/core/viewModel/medicine_view_model.dart | 4 +- .../medicine/medicine_search_screen.dart | 282 ++++++++++-------- .../medicine/pharmacies_list_screen.dart | 67 ++--- 4 files changed, 183 insertions(+), 173 deletions(-) diff --git a/lib/core/service/medicine_service.dart b/lib/core/service/medicine_service.dart index 44b380d6..5c716d6d 100644 --- a/lib/core/service/medicine_service.dart +++ b/lib/core/service/medicine_service.dart @@ -11,7 +11,7 @@ class MedicineService extends BaseService { var _pharmaciesList = []; get pharmacyItemsList => _pharmacyItemsList; get pharmaciesList => _pharmaciesList; - + String searchText=''; List patientAssessmentList = []; PharmaciesItemsRequestModel _itemsRequestModel = @@ -20,6 +20,7 @@ class MedicineService extends BaseService { Future getMedicineItem(String itemName) async { _itemsRequestModel.pHRItemName = itemName; + searchText =itemName; await baseAppClient.post( PHARMACY_ITEMS_URL, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index a029b519..9e83d63e 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -15,7 +15,7 @@ class MedicineViewModel extends BaseViewModel { PrescriptionService _prescriptionService = locator(); get pharmacyItemsList => _medicineService.pharmacyItemsList; - + get searchText=>_medicineService.searchText; get pharmaciesList => _medicineService.pharmaciesList; get medicationStrengthList => _prescriptionService.medicationStrengthList; @@ -34,6 +34,7 @@ class MedicineViewModel extends BaseViewModel { List get patientAssessmentList => _prescriptionService.patientAssessmentList; + List get allMedicationList => _prescriptionService.allMedicationList; List get itemMedicineList => _prescriptionService.itemMedicineList; @@ -41,6 +42,7 @@ class MedicineViewModel extends BaseViewModel { _prescriptionService.itemMedicineListRoute; List get itemMedicineListUnit => _prescriptionService.itemMedicineListUnit; + Future getItem({int itemID}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index ea891f3e..a37debbf 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -1,10 +1,10 @@ import 'dart:math'; import 'package:autocomplete_textfield/autocomplete_textfield.dart'; +import 'package:doctor_app_flutter/config/config.dart'; 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/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; @@ -12,13 +12,13 @@ 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/medicine/medicine_item_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_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/loader/gif_loader_dialog_utils.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_result.dart'; @@ -117,151 +117,169 @@ class _MedicineSearchState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - if (model.allMedicationList.length == 0) - await model.getMedicationList(); + // if (model.allMedicationList.length == 0) + // await model.getMedicationList(); }, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - appBarTitle: TranslationBase.of(context).searchMedicine, - body: SingleChildScrollView( - child: FractionallySizedBox( - widthFactor: 0.97, - child: SingleChildScrollView( - child: Container( - // height: SizeConfig.screenHeight, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - SizedBox( - height: SizeConfig.screenHeight * .16, - ), - Column(children: [ - FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - Container( - // height: MediaQuery.of(context).size.height * 0.070, - child: InkWell( - onTap: model.allMedicationList != null - ? () { - setState(() { - _selectedMedication = null; - }); - } - : null, - child: _selectedMedication == null - ? AutoCompleteTextField< - GetMedicationResponseModel>( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .searchMedicineNameHere, - _selectedMedication != null - ? _selectedMedication.genericName - : null, - true, - icon: EvaIcons.search), - itemSubmitted: (item) => setState( - () => _selectedMedication = item), - key: key, - suggestions: model.allMedicationList, - itemBuilder: (context, suggestion) => - new Padding( - child: Texts( - suggestion.description + - '/' + - suggestion.genericName), - padding: EdgeInsets.all(10.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( - minLines: 2, - maxLines: 2, - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .searchMedicineNameHere, - _selectedMedication != null - ? _selectedMedication - .description + - (' (${_selectedMedication.genericName} )') - : null, - true, - icon: EvaIcons.search), - enabled: false, - ), + builder: (_, model, w) { + myController.text =model.searchText; + return AppScaffold( + // baseViewModel: model, + isShowAppBar: false, + appBarTitle: TranslationBase.of(context).searchMedicine, + body: SingleChildScrollView( + child: FractionallySizedBox( + widthFactor: 0.97, + child: SingleChildScrollView( + child: Container( + // height: SizeConfig.screenHeight, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: SizeConfig.screenHeight * .16, + ), + FractionallySizedBox( + widthFactor: 0.9, + child: Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(10), + child: AppTextFormField( + borderColor: Colors.white, + hintText: TranslationBase.of(context) + .searchMedicineNameHere, + controller: myController, + onSaved: (value) {}, + onFieldSubmitted: (value) { + searchMedicine(context, model); + }, + inputFormatter: ONLY_LETTERS, ), ), - ], - ), - ) - ]), - SizedBox( - height: SizeConfig.screenHeight * .5, - ), - Column( - children: [ - FractionallySizedBox( - widthFactor: 0.97, - child: Wrap( - alignment: WrapAlignment.center, - children: [ - // TODO change it secondary button and add loading - AppButton( - title: TranslationBase.of(context).search, - onPressed: () async { - await searchMedicine(context, model); - }, + ), + FractionallySizedBox( + widthFactor: 0.9, + child: Container( + child: Wrap( + alignment: WrapAlignment.center, + children: [ + // TODO change it secondary button and add loading + AppButton( + title: TranslationBase.of(context).search, + onPressed: () async{ + await searchMedicine(context, model); + + }, + ), + ], ), - ], + ), + ), + + Container( + margin: EdgeInsets.only( + left: SizeConfig.heightMultiplier * 2), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase + .of(context) + .youCanFind + + (myController.text !=''?model.pharmacyItemsList.length + .toString():'0' )+ + " " + + TranslationBase + .of(context) + .itemsInSearch, + fontWeight: FontWeight.bold, + ), + ], + ), + ), + SizedBox( + height:10, ), - ) - ], - ) - ], - ), - )), + if(myController.text !='') + Container( + height: MediaQuery + .of(context) + .size + .height * 0.5, + child: ListView.builder( + padding: const EdgeInsets.only(top:20), + + 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"]), + ), + ); + }, + ); + }, + ), + ), + ], + ), + )), + ), ), - ), - ), + );} + ); } searchMedicine(context, MedicineViewModel model) async { FocusScope.of(context).unfocus(); - if (_selectedMedication.isNullOrEmpty()) { - helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); + if (myController.text.isNullOrEmpty()) { + helpers.showErrorToast(TranslationBase + .of(context) + .typeMedicineName); //"Type Medicine Name") return; - } else if (_selectedMedication.description.length < 3) { - helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); + } + if (myController.text.length < 3) { + helpers.showErrorToast(TranslationBase + .of(context) + .moreThan3Letter); return; } - // GifLoaderDialogUtils.showMyDialog(context); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => PharmaciesListScreen( - itemID: _selectedMedication.itemId, - selectedMedication: _selectedMedication, - ), - ), - ); - // await model.getMedicineItem(_selectedMedication.description); - // GifLoaderDialogUtils.hideDialog(context); + GifLoaderDialogUtils.showMyDialog(context); + + await model.getMedicineItem(myController.text); + GifLoaderDialogUtils.hideDialog(context); } startVoiceSearch() { diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 61bd7ad4..6af1d5b7 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -2,7 +2,6 @@ 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'; @@ -23,11 +22,9 @@ 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, this.selectedMedication}) + PharmaciesListScreen({Key key, @required this.itemID, this.url}) : super(key: key); @override @@ -52,39 +49,31 @@ class _PharmaciesListState extends State { Widget build(BuildContext context) { projectsProvider = Provider.of(context); return BaseView( - 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 && model.pharmacyItemsList.length > 0 + 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: [ + model.pharmaciesList.length > 0 ? RoundedContainer( - child: Row( - children: [ - Expanded( - flex: 1, - child: ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(7)), - child: model.pharmacyItemsList[0] - ["ImageSRCUrl"]!= null - ? Image.network( - model.pharmacyItemsList[0]["ImageSRCUrl"], - height: - SizeConfig.imageSizeMultiplier * + child: Row( + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(7)), + child: widget.url != null + ? Image.network( + widget.url, + height: + SizeConfig.imageSizeMultiplier * 21, width: SizeConfig.imageSizeMultiplier * @@ -241,8 +230,8 @@ class _PharmaciesListState extends State { }), ), ) - ]), - ),),); + ]), + ),),); } @@ -253,7 +242,7 @@ class _PharmaciesListState extends State { //TODO CHECK THE URL IS NULL OR NOT Uint8List dataFromBase64String(String base64String) { if(base64String !=null) - return base64Decode(base64String); + return base64Decode(base64String); } String base64String(Uint8List data) { From 06fdee2d2da93a7e514b9cf918b59c82ed9d9b55 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 22 Mar 2021 15:49:04 +0200 Subject: [PATCH 4/8] hussam --- lib/core/model/prescription_req_model.dart | 5 +- lib/core/service/prescription_service.dart | 4 +- .../medical-file/medical_file_page.dart | 222 +++++++++--------- .../prescription/prescription_screen.dart | 2 +- 4 files changed, 116 insertions(+), 117 deletions(-) diff --git a/lib/core/model/prescription_req_model.dart b/lib/core/model/prescription_req_model.dart index 3accb428..3eb71072 100644 --- a/lib/core/model/prescription_req_model.dart +++ b/lib/core/model/prescription_req_model.dart @@ -1,18 +1,21 @@ class PrescriptionReqModel { String vidaAuthTokenID; dynamic patientMRN; + dynamic appNo; - PrescriptionReqModel({this.vidaAuthTokenID, this.patientMRN}); + PrescriptionReqModel({this.vidaAuthTokenID, this.patientMRN, this.appNo}); PrescriptionReqModel.fromJson(Map json) { vidaAuthTokenID = json['VidaAuthTokenID']; patientMRN = json['PatientMRN']; + appNo = json['AppointmentNo']; } Map toJson() { final Map data = new Map(); data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['PatientMRN'] = this.patientMRN; + data['AppointmentNo'] = this.appNo; return data; } } diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 8b518c07..758f4595 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -82,7 +82,9 @@ class PrescriptionService extends LookupService { } Future getPrescription({int mrn}) async { - _prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn); + _prescriptionReqModel = PrescriptionReqModel( + patientMRN: mrn, + ); hasError = false; _prescriptionList.clear(); await baseAppClient.post(GET_PRESCRIPTION_LIST, diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index 2b817d8b..79f7416f 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -31,128 +31,122 @@ class _MedicalFilePageState extends State { body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( - child: Center( - child: Container( - color: Colors.white, - child: Column( - // mainAxisAlignment: model.medicalFileList.length != 0 && - // model.medicalFileList != null - // ? MainAxisAlignment.start - // : MainAxisAlignment.center, - children: [ - PatientPageHeaderWidget(patient), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), - (model.medicalFileList.length != 0 && - model.medicalFileList != null) - ? ListView.builder( - //physics: , - physics: NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList[0] - .timelines.length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.symmetric( - horizontal: 12.0, vertical: 8.0), - child: InkWell( - child: Container( - child: Column( - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context) - .branch + - ": ", - fontWeight: FontWeight.w700, - ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .projectName), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .doctorName - .toUpperCase() + - ": ", - fontWeight: FontWeight.w700, - ), - Expanded( - child: AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .doctorName, - fontWeight: FontWeight.w700, - ), - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .clinicName + - ": ", - fontWeight: FontWeight.w700, - ), - AppText( + child: Container( + color: Colors.white, + child: Column( + // mainAxisAlignment: model.medicalFileList.length != 0 && + // model.medicalFileList != null + // ? MainAxisAlignment.start + // : MainAxisAlignment.center, + children: [ + PatientPageHeaderWidget(patient), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), + (model.medicalFileList != null && + model.medicalFileList.length != 0) + ? ListView.builder( + //physics: , + physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.medicalFileList[0].entityList[0] + .timelines.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.0, vertical: 8.0), + child: InkWell( + child: Container( + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).branch + + ": ", + fontWeight: FontWeight.w700, + ), + AppText(model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .projectName), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .doctorName + .toUpperCase() + + ": ", + fontWeight: FontWeight.w700, + ), + Expanded( + child: AppText( model .medicalFileList[0] .entityList[0] .timelines[index] - .clinicName, + .doctorName, + fontWeight: FontWeight.w700, ), - ], - ), - SizedBox(height: 10.0), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey.shade400, - ) - ], - ), + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .clinicName + + ": ", + fontWeight: FontWeight.w700, + ), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .clinicName, + ), + ], + ), + SizedBox(height: 10.0), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey.shade400, + ) + ], ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - MedicalFileDetails( - age: patient.age, - firstName: patient.firstName, - lastName: patient.lastName, - gender: - patient.genderDescription, - encounterNumber: index, - pp: patient.patientId, - )), - ); - }, ), - ); - }) - : Center( - child: Container( - child: AppText( - 'THERES NO MEDICAL FILE FOR THIS Patient', + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + MedicalFileDetails( + age: patient.age, + firstName: patient.firstName, + lastName: patient.lastName, + gender: patient.genderDescription, + encounterNumber: index, + pp: patient.patientId, + )), + ); + }, ), - ), - ) - ], - ), + ); + }) + : Container( + child: AppText( + 'THERES NO MEDICAL FILE FOR THIS Patient', + ), + ) + ], ), ), ), diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 87202979..18655e65 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -35,7 +35,7 @@ class _NewPrescriptionScreenState extends State { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getPrescription(mrn: 0), + onModelReady: (model) => model.getPrescription(mrn: patient.patientId), builder: (BuildContext context, PrescriptionViewModel model, Widget child) => AppScaffold( From 7ebf36f98fa810b6a4b94c7065c57ca0493e7579 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 22 Mar 2021 15:49:16 +0200 Subject: [PATCH 5/8] add radiology open image --- lib/config/localized_values.dart | 2 + .../radiology/radiology_report_screen.dart | 74 ++++++++++++++----- .../profile/radiology/radiology_screen.dart | 2 + lib/util/translations_delegate_base.dart | 2 + lib/widgets/shared/app_scaffold_widget.dart | 6 +- 5 files changed, 64 insertions(+), 22 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 356c321d..9df6a544 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -748,4 +748,6 @@ const Map> localizedValues = { }, 'appointmentDate': {'en': "Appointment Date", 'ar': "تاريخ الموعد"}, 'arrived_p': {'en': "Arrived", 'ar': "وصل"}, + "open-rad": {"en": "Open Image", "ar": "فتح صور الاشعة"}, + }; diff --git a/lib/screens/patients/profile/radiology/radiology_report_screen.dart b/lib/screens/patients/profile/radiology/radiology_report_screen.dart index 29544cdf..29430b27 100644 --- a/lib/screens/patients/profile/radiology/radiology_report_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_report_screen.dart @@ -1,37 +1,71 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:url_launcher/url_launcher.dart'; class RadiologyReportScreen extends StatelessWidget { final String reportData; + final String url; - RadiologyReportScreen({Key key, this.reportData}); + RadiologyReportScreen({Key key, this.reportData, this.url}); @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).radiologyReport, - body: Container( - padding: EdgeInsets.all(10), - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(10)), - color: Colors.white, - border: Border( - bottom: BorderSide(color: Colors.grey, width: 0.5), - top: BorderSide(color: Colors.grey, width: 0.5), - left: BorderSide(color: Colors.grey, width: 0.5), - right: BorderSide(color: Colors.grey, width: 0.5), + appBarTitle: TranslationBase.of(context).radiologyReport, + body: SingleChildScrollView( + child: Container( + padding: EdgeInsets.all(10), + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(10)), + color: Colors.white, + border: Border( + bottom: BorderSide(color: Colors.grey, width: 0.5), + top: BorderSide(color: Colors.grey, width: 0.5), + left: BorderSide(color: Colors.grey, width: 0.5), + right: BorderSide(color: Colors.grey, width: 0.5), + ), + ), + child: AppText( + reportData, + fontSize: 2.5 * SizeConfig.textMultiplier, + ), ), ), - child: AppText( - reportData, - fontSize: 2.5 * SizeConfig.textMultiplier, - ), - ), - ); + bottomSheet: url == null + ? Container( + height: MediaQuery.of(context).size.height * 0, + ) + : Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.1, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + FractionallySizedBox( + widthFactor: 0.9, + child: Container( + child: Wrap( + alignment: WrapAlignment.center, + children: [ + // TODO change it secondary button and add loading + AppButton( + title: TranslationBase.of(context).openRad, + onPressed: () async { + launch(url); + }, + ), + ], + ), + ), + ), + ], + ), + )); } } diff --git a/lib/screens/patients/profile/radiology/radiology_screen.dart b/lib/screens/patients/profile/radiology/radiology_screen.dart index cdab5bca..0bce886a 100644 --- a/lib/screens/patients/profile/radiology/radiology_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_screen.dart @@ -102,6 +102,8 @@ class _RadiologyScreenState extends State { reportData: model .patientRadiologyList[index] .reportData, + url: model + .patientRadiologyList[index].imageURL, )), ); }, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 8c8afde2..f7f94812 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1136,6 +1136,8 @@ class TranslationBase { String get appointmentDate => localizedValues['appointmentDate'][locale.languageCode]; String get arrivedP => localizedValues['arrived_p'][locale.languageCode]; + String get openRad => localizedValues['open-rad'][locale.languageCode]; + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 378094c7..9842bbed 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -17,13 +17,13 @@ class AppScaffold extends StatelessWidget { final bool isLoading; final bool isShowAppBar; final BaseViewModel baseViewModel; - + final Widget bottomSheet; AppScaffold( {this.appBarTitle = '', this.body, this.isLoading = false, this.isShowAppBar = true, - this.baseViewModel}); + this.baseViewModel, this.bottomSheet}); @override Widget build(BuildContext context) { @@ -59,6 +59,8 @@ class AppScaffold extends StatelessWidget { ], ) : null, + + bottomSheet: bottomSheet, body: projectProvider.isInternetConnection ? baseViewModel != null ? NetworkBaseView( From 96d07e7a594ef4cc39c812fef2194e9018238bf9 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 22 Mar 2021 17:28:36 +0200 Subject: [PATCH 6/8] fix small issue in radiology --- .../radiology/radiology_report_screen.dart | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/lib/screens/patients/profile/radiology/radiology_report_screen.dart b/lib/screens/patients/profile/radiology/radiology_report_screen.dart index 29430b27..75be23e8 100644 --- a/lib/screens/patients/profile/radiology/radiology_report_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_report_screen.dart @@ -18,23 +18,28 @@ class RadiologyReportScreen extends StatelessWidget { return AppScaffold( appBarTitle: TranslationBase.of(context).radiologyReport, body: SingleChildScrollView( - child: Container( - padding: EdgeInsets.all(10), - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(10)), - color: Colors.white, - border: Border( - bottom: BorderSide(color: Colors.grey, width: 0.5), - top: BorderSide(color: Colors.grey, width: 0.5), - left: BorderSide(color: Colors.grey, width: 0.5), - right: BorderSide(color: Colors.grey, width: 0.5), + child: Column( + children: [ + Container( + padding: EdgeInsets.all(10), + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(10)), + color: Colors.white, + border: Border( + bottom: BorderSide(color: Colors.grey, width: 0.5), + top: BorderSide(color: Colors.grey, width: 0.5), + left: BorderSide(color: Colors.grey, width: 0.5), + right: BorderSide(color: Colors.grey, width: 0.5), + ), + ), + child: AppText( + reportData, + fontSize: 2.5 * SizeConfig.textMultiplier, + ), ), - ), - child: AppText( - reportData, - fontSize: 2.5 * SizeConfig.textMultiplier, - ), + SizedBox(height:MediaQuery.of(context).size.height * 0.13 ,) + ], ), ), bottomSheet: url == null From 3928165570b41440cc2bfe08b9042f1f6729dcb6 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 22 Mar 2021 23:08:26 +0200 Subject: [PATCH 7/8] get Prescription history fix --- .../profile/profile_medical_info_widget.dart | 190 +++++++++--------- pubspec.lock | 6 +- 2 files changed, 97 insertions(+), 99 deletions(-) diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index fb0ef609..60a0154e 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -36,72 +36,70 @@ class ProfileMedicalInfoWidget extends StatelessWidget { childAspectRatio: 1.5, children: [ if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - isDisable: patient.episodeNo != 0 ? true : false, - nameLine1: TranslationBase.of(context).createNew, - nameLine2: TranslationBase.of(context).episode, - route: CREATE_EPISODE, - onTap: () async { - PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( - appointmentNo: patient.appointmentNo, - patientMRN: patient.patientMRN); - await model.postEpisode(postEpisodeReqModel); - patient.episodeNo = model.episodeID; - Navigator.of(context) - .pushNamed(CREATE_EPISODE, arguments: {'patient': patient}); - }, - isLoading: model.state == ViewState.BusyLocal, - icon: 'create-episod.png'), + PatientProfileButton( + key: key, + patient: patient, + isDisable: patient.episodeNo != 0 ? true : false, + nameLine1: TranslationBase.of(context).createNew, + nameLine2: TranslationBase.of(context).episode, + route: CREATE_EPISODE, + onTap: () async { + PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( + appointmentNo: patient.appointmentNo, + patientMRN: patient.patientMRN); + await model.postEpisode(postEpisodeReqModel); + patient.episodeNo = model.episodeID; + Navigator.of(context).pushNamed(CREATE_EPISODE, + arguments: {'patient': patient}); + }, + isLoading: model.state == ViewState.BusyLocal, + icon: 'create-episod.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - isDisable: patient.episodeNo == 0 ? true : false, - nameLine1: TranslationBase.of(context).update, - nameLine2: TranslationBase.of(context).episode, - route: UPDATE_EPISODE, - icon: 'modilfy-episode.png'), - + PatientProfileButton( + key: key, + patient: patient, + isDisable: patient.episodeNo == 0 ? true : false, + nameLine1: TranslationBase.of(context).update, + nameLine2: TranslationBase.of(context).episode, + route: UPDATE_EPISODE, + icon: 'modilfy-episode.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: RADIOLOGY, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'radiology-1.png'), + PatientProfileButton( + key: key, + patient: patient, + route: RADIOLOGY, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'radiology-1.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: PATIENT_INSURANCE_APPROVALS, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'lab.png'), - + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_INSURANCE_APPROVALS, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'lab.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: - VITAL_SIGN_DETAILS /* PATIENT_VITAL_SIGN + PatientProfileButton( + key: key, + patient: patient, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: + VITAL_SIGN_DETAILS /* PATIENT_VITAL_SIGN */ - , - icon: 'heartbeat.png'), + , + icon: 'heartbeat.png'), if (selectedPatientType != 7) - PatientProfileButton( - key: key, - patient: patient, - route: LAB_ORDERS, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'lab.png'), + PatientProfileButton( + key: key, + patient: patient, + route: LAB_ORDERS, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'lab.png'), PatientProfileButton( key: key, patient: patient, @@ -112,26 +110,26 @@ class ProfileMedicalInfoWidget extends StatelessWidget { if (selectedPatientType != 0 && selectedPatientType != 5 && selectedPatientType != 7) - PatientProfileButton( - key: key, - patient: patient, - route: PROGRESS_NOTE, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'heartbeat.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PROGRESS_NOTE, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'heartbeat.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: PATIENT_ADMISSION_REQUEST, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'heartbeat.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_ADMISSION_REQUEST, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'heartbeat.png'), (int.parse(patientType) == 7 || int.parse(patientType) == 6) ? PatientProfileButton( key: key, patient: patient, - route: ORDER_PRESCRIPTION_HISTORY, + route: ORDER_PRESCRIPTION, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'lab.png') @@ -151,29 +149,29 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine2: TranslationBase.of(context).procedures, icon: 'lab.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: REFER_PATIENT_TO_DOCTOR, - nameLine1: TranslationBase.of(context).myReferral, - nameLine2: TranslationBase.of(context).patient, - icon: 'note.png'), + PatientProfileButton( + key: key, + patient: patient, + route: REFER_PATIENT_TO_DOCTOR, + nameLine1: TranslationBase.of(context).myReferral, + nameLine2: TranslationBase.of(context).patient, + icon: 'note.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'sick_leaves_icons.png'), + PatientProfileButton( + key: key, + patient: patient, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'sick_leaves_icons.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: PATIENT_UCAF_REQUEST, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'lab.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_UCAF_REQUEST, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'lab.png'), ], ), ); diff --git a/pubspec.lock b/pubspec.lock index d044f1fb..909670db 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -573,7 +573,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -844,7 +844,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" stream_channel: dependency: transitive description: @@ -986,5 +986,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From d0d8d81ae4e3524f9c7fd040861ea85e1b5da1b5 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 23 Mar 2021 09:03:25 +0200 Subject: [PATCH 8/8] fix small issue in on search --- lib/screens/patients/patients_screen.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 06a5d92d..2900f56a 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -516,6 +516,7 @@ class _PatientsScreenState extends State { .getFrom, "to": patient.getTo, + "isSearch":isSearch }); }, );