From 0798057f31b646d79b1b099029d28101679de6f3 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 20 May 2021 13:55:59 +0300 Subject: [PATCH 01/25] change --- .../medical_report/PatientMedicalReportService.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart index 760c7dd5..6e00b890 100644 --- a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart +++ b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart @@ -11,8 +11,6 @@ class PatientMedicalReportService extends BaseService { Future getMedicalReportList(PatiantInformtion patient) async { hasError = false; Map body = Map(); - // body['TokenID'] = "@dm!n"; - body['SetupID'] = "91877"; body['AdmissionNo'] = patient.admissionNo; await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, From 0ed0dbb5aaf9344f7db9f845ed7a8fde2044ce2e Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 20 May 2021 15:10:21 +0300 Subject: [PATCH 02/25] livecare changes --- lib/config/localized_values.dart | 1 + lib/screens/live_care/end_call_screen.dart | 48 ++++---- .../live-care_transfer_to_admin.dart | 108 ++++++++++++++++++ lib/util/helpers.dart | 51 ++++++++- lib/util/translations_delegate_base.dart | 2 + 5 files changed, 184 insertions(+), 26 deletions(-) create mode 100644 lib/screens/live_care/live-care_transfer_to_admin.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index dcc4aa1f..f8d6a510 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1,6 +1,7 @@ const Map> localizedValues = { 'dashboardScreenToolbarTitle': {'ar': 'الرئيسة', 'en': 'Home'}, 'settings': {'en': 'Settings', 'ar': 'الاعدادات'}, + 'areYouSureYouWantTo': {'en': 'Are you sure you want to', 'ar': 'هل انت متاكد من انك تريد أن'}, 'language': {'en': 'App Language', 'ar': 'لغة التطبيق'}, 'lanEnglish': {'en': 'English', 'ar': 'English'}, 'lanArabic': {'en': 'العربية', 'ar': 'العربية'}, diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index 880c8fd8..dff46923 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.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/PatientProfileButton.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; @@ -35,18 +36,24 @@ class _EndCallScreenState extends State { final List cardsList = [ PatientProfileCardModel(TranslationBase.of(context).resume, TranslationBase.of(context).theCall, '', 'patient/vital_signs.png', - isInPatient: isInpatient, onTap: () {}, isDartIcon: true, + isInPatient: isInpatient, + onTap: () {}, + isDartIcon: true, dartIcon: DoctorApp.call), PatientProfileCardModel( TranslationBase.of(context).endLC, TranslationBase.of(context).consultation, '', 'patient/vital_signs.png', - isInPatient: isInpatient, - onTap: () {}, - isDartIcon: true, - dartIcon: DoctorApp.end_consultaion - ), + isInPatient: isInpatient, onTap: () { + Helpers.showConfirmationDialog( + context, + "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?", + () { + Navigator.of(context).pop(); + + }); + }, isDartIcon: true, dartIcon: DoctorApp.end_consultaion), PatientProfileCardModel( TranslationBase.of(context).sendLC, TranslationBase.of(context).instruction, @@ -55,19 +62,13 @@ class _EndCallScreenState extends State { onTap: () {}, isInPatient: isInpatient, isDartIcon: true, - dartIcon: DoctorApp.send_instruction - ), - PatientProfileCardModel( - TranslationBase.of(context).transferTo, - TranslationBase.of(context).admin, - '', - 'patient/health_summary.png', + dartIcon: DoctorApp.send_instruction), + PatientProfileCardModel(TranslationBase.of(context).transferTo, + TranslationBase.of(context).admin, '', 'patient/health_summary.png', onTap: () {}, - isInPatient: isInpatient, - - isDartIcon: true, - dartIcon: DoctorApp.transfer_to_admin - ), + isInPatient: isInpatient, + isDartIcon: true, + dartIcon: DoctorApp.transfer_to_admin), ]; return AppScaffold( @@ -93,8 +94,8 @@ class _EndCallScreenState extends State { child: ListView( children: [ Padding( - padding: const EdgeInsets.symmetric( - vertical: 15.0, horizontal: 15), + padding: + const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -103,11 +104,14 @@ class _EndCallScreenState extends State { fontSize: 14, fontWeight: FontWeight.w500, ), - AppText(TranslationBase.of(context).endcall, + AppText( + TranslationBase.of(context).endcall, fontSize: 26, fontWeight: FontWeight.bold, ), - SizedBox(height: 10,), + SizedBox( + height: 10, + ), StaggeredGridView.countBuilder( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), diff --git a/lib/screens/live_care/live-care_transfer_to_admin.dart b/lib/screens/live_care/live-care_transfer_to_admin.dart new file mode 100644 index 00000000..f6e3798f --- /dev/null +++ b/lib/screens/live_care/live-care_transfer_to_admin.dart @@ -0,0 +1,108 @@ +import 'dart:html'; + +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; +import 'package:flutter/material.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:provider/provider.dart'; +import 'package:speech_to_text/speech_recognition_error.dart'; +import 'package:speech_to_text/speech_to_text.dart' as stt; + +class LivaCareTransferToAdmin extends StatefulWidget { + + final PatiantInformtion patient; + + const LivaCareTransferToAdmin({Key key, this.patient}) : super(key: key); + + @override + _LivaCareTransferToAdminState createState() => _LivaCareTransferToAdminState(); +} + +class _LivaCareTransferToAdminState extends State { + + stt.SpeechToText speech = stt.SpeechToText(); + var reconizedWord; + var event = RobotProvider(); + ProjectViewModel projectViewModel; + + TextEditingController noteController = TextEditingController(); + + void initState() { + requestPermissions(); + event.controller.stream.listen((p) { + if (p['startPopUp'] == 'true') { + if (this.mounted) { + initSpeechState().then((value) => {onVoiceText()}); + } + } + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + + return Container( + + ); + } + + onVoiceText() async { + new SpeechToText(context: context).showAlertDialog(context); + var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; + bool available = await speech.initialize( + onStatus: statusListener, onError: errorListener); + if (available) { + speech.listen( + onResult: resultListener, + listenMode: stt.ListenMode.confirmation, + localeId: lang == 'en' ? 'en-US' : 'ar-SA', + ); + } else { + print("The user has denied the use of speech recognition."); + } + } + + void errorListener(SpeechRecognitionError error) { + event.setValue({"searchText": 'null'}); + //SpeechToText.closeAlertDialog(context); + print(error); + } + + void statusListener(String status) { + reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; + } + + void requestPermissions() async { + Map statuses = await [ + Permission.microphone, + ].request(); + } + + void resultListener(result) { + reconizedWord = result.recognizedWords; + event.setValue({"searchText": reconizedWord}); + + if (result.finalResult == true) { + setState(() { + SpeechToText.closeAlertDialog(context); + speech.stop(); + noteController.text += reconizedWord + '\n'; + }); + } else { + print(result.finalResult); + } + } + + Future initSpeechState() async { + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); + print(hasSpeech); + if (!mounted) return; + } +} diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 53f81ef2..7f72435f 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -8,6 +8,8 @@ import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table import 'package:doctor_app_flutter/screens/auth/login_screen.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -24,7 +26,47 @@ class Helpers { static int cupertinoPickerIndex = 0; get currentLanguage => null; - static showCupertinoPicker(context, List items, decKey, onSelectFun, AuthenticationViewModel model) { + + static showConfirmationDialog( + BuildContext context, String message, Function okFunction) { + return showDialog( + context: context, + barrierDismissible: false, // user must tap button! + builder: (_) { + return Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AlertDialog( + title: null, + content: Container( + child: AppText(message), + ), + actions: [ + AppButton( + onPressed: okFunction, + title: TranslationBase.of(context).noteConfirm, + fontColor: Colors.white, + color: Colors.green[600], + ), + AppButton( + onPressed: (){ + Navigator.of(context).pop(); + }, + title: TranslationBase.of(context).cancel, + fontColor: Colors.white, + color: Colors.red[600], + ), + ], + ), + ], + ), + ); + }); + } + + static showCupertinoPicker(context, List items, + decKey, onSelectFun, AuthenticationViewModel model) { showModalBottomSheet( isDismissible: false, context: context, @@ -64,8 +106,8 @@ class Helpers { Container( height: SizeConfig.realScreenHeight * 0.3, color: Color(0xfff7f7f7), - child: - buildPickerItems(context, items, decKey, onSelectFun, model)) + child: buildPickerItems( + context, items, decKey, onSelectFun, model)) ], ), ); @@ -75,7 +117,8 @@ class Helpers { static TextStyle textStyle(context) => TextStyle(color: Theme.of(context).primaryColor); - static buildPickerItems(context, List items, decKey, onSelectFun, model) { + static buildPickerItems(context, List items, + decKey, onSelectFun, model) { return CupertinoPicker( magnification: 1.5, scrollController: diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index ac805956..4f5a128b 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -18,6 +18,8 @@ class TranslationBase { String get settings => localizedValues['settings'][locale.languageCode]; + String get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo'][locale.languageCode]; + String get language => localizedValues['language'][locale.languageCode]; String get lanEnglish => localizedValues['lanEnglish'][locale.languageCode]; From 5d5f9f692839d2dd76a275756c19d58e031b24db Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 20 May 2021 15:45:37 +0300 Subject: [PATCH 03/25] Fix issues on the add procedure --- lib/models/doctor/doctor_profile_model.dart | 2 +- lib/screens/live_care/video_call.dart | 2 +- .../procedures/add-procedure-form.dart | 38 +-- .../procedures/procedure_checkout_screen.dart | 303 +++++++++--------- 4 files changed, 163 insertions(+), 182 deletions(-) diff --git a/lib/models/doctor/doctor_profile_model.dart b/lib/models/doctor/doctor_profile_model.dart index 17625968..c2f5b0dd 100644 --- a/lib/models/doctor/doctor_profile_model.dart +++ b/lib/models/doctor/doctor_profile_model.dart @@ -7,7 +7,7 @@ class DoctorProfileModel { Null clinicDescriptionN; Null licenseExpiry; int employmentType; - Null setupID; + dynamic setupID; int projectID; String projectName; String nationalityID; diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index 961654cc..321a7e0f 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -76,7 +76,7 @@ class _VideoCallPageState extends State { }); }, onCallNotRespond: (SessionStatusModel sessionStatusModel) { - //TODO handling onCalcallNotRespondlEnd + //TODO handling onCalNotRespondEnd WidgetsBinding.instance.addPostFrameCallback((_) { changeRoute(context); }); diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index b17f50ae..db249da7 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -13,13 +13,11 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import 'entity_list_checkbox_search_widget.dart'; -import 'entity_list_procedure_widget.dart'; valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, List entityList) async { @@ -139,9 +137,7 @@ class _AddSelectedProcedureState extends State { @override Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; return BaseView( - //onModelReady: (model) => model.getCategory(), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: false, @@ -218,21 +214,23 @@ class _AddSelectedProcedureState extends State { width: MediaQuery.of(context).size.width * 0.02, ), - InkWell( - onTap: () { - if (procedureName.text.isNotEmpty && - procedureName.text.length >= 3) - model.getProcedureCategory( - categoryName: procedureName.text); - else - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .atLeastThreeCharacters, - ); - }, - child: Icon( - Icons.search, - size: 25.0, + Expanded( + child: InkWell( + onTap: () { + if (procedureName.text.isNotEmpty && + procedureName.text.length >= 3) + model.getProcedureCategory( + categoryName: procedureName.text); + else + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .atLeastThreeCharacters, + ); + }, + child: Icon( + Icons.search, + size: 25.0, + ), ), ), ], @@ -429,8 +427,6 @@ class _AddSelectedProcedureState extends State { color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () { - //print(entityList.toString()); - onPressed: if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( TranslationBase.of(context) diff --git a/lib/screens/procedures/procedure_checkout_screen.dart b/lib/screens/procedures/procedure_checkout_screen.dart index e3fc86be..f5b6dcb7 100644 --- a/lib/screens/procedures/procedure_checkout_screen.dart +++ b/lib/screens/procedures/procedure_checkout_screen.dart @@ -10,7 +10,6 @@ import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -37,164 +36,159 @@ class _ProcedureCheckOutScreenState extends State { AppScaffold( backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), isShowAppBar: false, - body: Column( - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.070, - color: Colors.white, - ), - Container( - color: Colors.white, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Row( - //mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - InkWell( - child: Icon( - Icons.arrow_back_ios_sharp, - size: 24.0, + body: SingleChildScrollView( + child: Column( + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.070, + color: Colors.white, + ), + Container( + color: Colors.white, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Row( + //mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + InkWell( + child: Icon( + Icons.arrow_back_ios_sharp, + size: 24.0, + ), + onTap: () { + Navigator.pop(context); + }, ), - onTap: () { - Navigator.pop(context); - }, - ), - SizedBox( - width: 5.0, - ), - AppText( - 'Add Procedure', - fontWeight: FontWeight.w700, - fontSize: 20, - ), - ], + SizedBox( + width: 5.0, + ), + AppText( + 'Add Procedure', + fontWeight: FontWeight.w700, + fontSize: 20, + ), + ], + ), ), ), - ), - Padding( - padding: const EdgeInsets.only( - left: 12.0, right: 12.0, bottom: 26.0, top: 10), - child: ListView.builder( - scrollDirection: Axis.vertical, - physics: AlwaysScrollableScrollPhysics(), - shrinkWrap: true, - itemCount: widget.items.length, - itemBuilder: (BuildContext context, int index) { - return Container( - margin: EdgeInsets.only(bottom: 15.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: - BorderRadius.all(Radius.circular(10.0))), - child: ExpansionTile( - initiallyExpanded: true, - title: Row( + SizedBox(height: 30,), + ...List.generate(widget.items.length, (index) => Container( + margin: EdgeInsets.only(bottom: 15.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: + BorderRadius.all(Radius.circular(10.0))), + child: ExpansionTile( + initiallyExpanded: true, + title: Row( + children: [ + Icon( + Icons.check_box, + color: Color(0xffD02127), + size: 30.5, + ), + SizedBox( + width: 6.0, + ), + Expanded( + child: + AppText(widget.items[index].procedureName)), + ], + ), + children: [ + Container( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon( - Icons.check_box, - color: Color(0xffD02127), - size: 30.5, + Row( + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 11), + child: AppText( + TranslationBase.of(context).orderType, + fontWeight: FontWeight.w700, + color: Color(0xff2B353E), + ), + ), + ], ), - SizedBox( - width: 6.0, + Row( + children: [ + Radio( + activeColor: Color(0xFFD02127), + value: 0, + groupValue: + widget.items[index].selectedType, + onChanged: (value) { + widget.items[index].selectedType = 0; + setState(() { + widget.items[index].type = + value.toString(); + }); + }, + ), + AppText( + 'routine', + color: Color(0xff575757), + fontWeight: FontWeight.w600, + ), + Radio( + activeColor: Color(0xFFD02127), + groupValue: + widget.items[index].selectedType, + value: 1, + onChanged: (value) { + widget.items[index].selectedType = 1; + setState(() { + widget.items[index].type = + value.toString(); + }); + }, + ), + AppText( + TranslationBase.of(context).urgent, + color: Color(0xff575757), + fontWeight: FontWeight.w600, + ), + ], ), - Expanded( - child: - AppText(widget.items[index].procedureName)), ], ), - children: [ - Container( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 11), - child: AppText( - TranslationBase.of(context).orderType, - fontWeight: FontWeight.w700, - color: Color(0xff2B353E), - ), - ), - ], - ), - Row( - children: [ - Radio( - activeColor: Color(0xFFD02127), - value: 0, - groupValue: - widget.items[index].selectedType, - onChanged: (value) { - widget.items[index].selectedType = 0; - setState(() { - widget.items[index].type = - value.toString(); - }); - }, - ), - AppText( - 'routine', - color: Color(0xff575757), - fontWeight: FontWeight.w600, - ), - Radio( - activeColor: Color(0xFFD02127), - groupValue: - widget.items[index].selectedType, - value: 1, - onChanged: (value) { - widget.items[index].selectedType = 1; - setState(() { - widget.items[index].type = - value.toString(); - }); - }, - ), - AppText( - TranslationBase.of(context).urgent, - color: Color(0xff575757), - fontWeight: FontWeight.w600, - ), - ], - ), - ], - ), - ), - ), - SizedBox( - height: 2.0, - ), - Padding( - padding: EdgeInsets.symmetric( - horizontal: 12, vertical: 15.0), - child: TextFields( - hintText: TranslationBase.of(context).remarks, - controller: remarksController, - onChanged: (value) { - widget.items[index].remarks = value; - }, - minLines: 3, - maxLines: 5, - borderWidth: 0.5, - borderColor: Colors.grey[500], - ), - ), - SizedBox( - height: 19.0, - ), - //DividerWithSpacesAround(), - ], ), - ); - }), - ), - ], + ), + SizedBox( + height: 2.0, + ), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 12, vertical: 15.0), + child: TextFields( + hintText: TranslationBase.of(context).remarks, + controller: remarksController, + onChanged: (value) { + widget.items[index].remarks = value; + }, + minLines: 3, + maxLines: 5, + borderWidth: 0.5, + borderColor: Colors.grey[500], + ), + ), + SizedBox( + height: 19.0, + ), + //DividerWithSpacesAround(), + ], + ), + )), + SizedBox(height: 90,), + + + ], + ), ), bottomSheet: Container( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), @@ -206,15 +200,6 @@ class _ProcedureCheckOutScreenState extends State { color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () async { - //print(entityList.toString()); - onPressed: - // if (entityList.isEmpty == true) { - // DrAppToastMsg.showErrorToast( - // TranslationBase.of(context) - // .fillTheMandatoryProcedureDetails, - // ); - // return; - // } List entityList = List(); widget.items.forEach((element) { entityList.add( From 8b2c7f1a059e5153d0508afccc9401e877938fef Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 20 May 2021 15:49:35 +0300 Subject: [PATCH 04/25] livecare --- .../patient/LiveCarePatientServices.dart | 16 ++ .../viewModel/LiveCarePatientViewModel.dart | 13 + lib/screens/live_care/end_call_screen.dart | 241 ++++++++++-------- .../live-care_transfer_to_admin.dart | 21 +- .../patient_profile_screen.dart | 8 +- 5 files changed, 179 insertions(+), 120 deletions(-) diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index e4443b9b..36ca2c7e 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -42,4 +42,20 @@ class LiveCarePatientServices extends BaseService{ }, body: endCallReq.toJson()); } + Future endCallWithCharge(int vcID) async{ + hasError = false; + await baseAppClient.post( + END_CALL_WITH_CHARGE, + onSuccess: (dynamic response, int statusCode) { + endCallResponse = response; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: { + "VC_ID": vcID, + }, + ); + } } \ No newline at end of file diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 0cce5f86..8c7587a4 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -57,6 +57,19 @@ class LiveCarePatientViewModel extends BaseViewModel { } } + Future endCallWithCharge(int vcID) async { + setState(ViewState.BusyLocal); + await _liveCarePatientServices + .endCallWithCharge(vcID); + if (_liveCarePatientServices.hasError) { + error = _liveCarePatientServices.error; + setState(ViewState.ErrorLocal); + } else { + await getPendingPatientERForDoctorApp(); + setState(ViewState.Idle); + } + } + searchData(String str) { var strExist= str.length > 0 ? true : false; if (strExist) { diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index dff46923..b7657d31 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -1,6 +1,11 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.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/screens/live_care/live-care_transfer_to_admin.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.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/PatientProfileButton.dart'; @@ -8,6 +13,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-head import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -31,6 +37,8 @@ class _EndCallScreenState extends State { String from; String to; + LiveCarePatientViewModel liveCareModel; + @override Widget build(BuildContext context) { final List cardsList = [ @@ -46,13 +54,17 @@ class _EndCallScreenState extends State { '', 'patient/vital_signs.png', isInPatient: isInpatient, onTap: () { - Helpers.showConfirmationDialog( - context, + Helpers.showConfirmationDialog(context, "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).endLC} ${TranslationBase.of(context).consultation} ?", - () { - Navigator.of(context).pop(); - - }); + () async { + Navigator.of(context).pop(); + GifLoaderDialogUtils.showMyDialog(context); + liveCareModel.endCallWithCharge(0); + GifLoaderDialogUtils.hideDialog(context); + if (liveCareModel.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(liveCareModel.error); + } + }); }, isDartIcon: true, dartIcon: DoctorApp.end_consultaion), PatientProfileCardModel( TranslationBase.of(context).sendLC, @@ -65,122 +77,133 @@ class _EndCallScreenState extends State { dartIcon: DoctorApp.send_instruction), PatientProfileCardModel(TranslationBase.of(context).transferTo, TranslationBase.of(context).admin, '', 'patient/health_summary.png', - onTap: () {}, + onTap: () { + Navigator.push(context, MaterialPageRoute( + builder: (BuildContext context) => + LivaCareTransferToAdmin(patient:widget.patient))); + }, isInPatient: isInpatient, isDartIcon: true, dartIcon: DoctorApp.transfer_to_admin), ]; - return AppScaffold( - appBarTitle: TranslationBase.of(context).patientProfile, - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - widget.patient, arrivalType ?? '7', '1', - isInpatient: isInpatient, - height: (widget.patient.patientStatusType != null && - widget.patient.patientStatusType == 43) - ? 210 - : isDischargedPatient - ? 240 - : 0, - isDischargedPatient: isDischargedPatient), - body: Container( - height: !isSearchAndOut - ? isDischargedPatient - ? MediaQuery.of(context).size.height * 0.64 - : MediaQuery.of(context).size.height * 0.65 - : MediaQuery.of(context).size.height * 0.69, - child: ListView( - children: [ - Padding( - padding: - const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).patient, - fontSize: 14, - fontWeight: FontWeight.w500, - ), - AppText( - TranslationBase.of(context).endcall, - fontSize: 26, - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 10, - ), - StaggeredGridView.countBuilder( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - crossAxisCount: 3, - itemCount: cardsList.length, - staggeredTileBuilder: (int index) => StaggeredTile.fit(1), - itemBuilder: (BuildContext context, int index) => - PatientProfileButton( - patient: widget.patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: cardsList[index].nameLine1, - nameLine2: cardsList[index].nameLine2, - route: cardsList[index].route, - icon: cardsList[index].icon, - isInPatient: cardsList[index].isInPatient, - isDischargedPatient: cardsList[index].isDischargedPatient, - isDisable: cardsList[index].isDisable, - onTap: cardsList[index].onTap, - isLoading: cardsList[index].isLoading, - isDartIcon: cardsList[index].isDartIcon, - dartIcon: cardsList[index].dartIcon, + return BaseView( + onModelReady: (model) { + liveCareModel = model; + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).patientProfile, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + widget.patient, arrivalType ?? '7', '1', + isInpatient: isInpatient, + height: (widget.patient.patientStatusType != null && + widget.patient.patientStatusType == 43) + ? 210 + : isDischargedPatient + ? 240 + : 0, + isDischargedPatient: isDischargedPatient), + body: Container( + height: !isSearchAndOut + ? isDischargedPatient + ? MediaQuery.of(context).size.height * 0.64 + : MediaQuery.of(context).size.height * 0.65 + : MediaQuery.of(context).size.height * 0.69, + child: ListView( + children: [ + Padding( + padding: + const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).patient, + fontSize: 14, + fontWeight: FontWeight.w500, ), - ), - ], + AppText( + TranslationBase.of(context).endcall, + fontSize: 26, + fontWeight: FontWeight.bold, + ), + SizedBox( + height: 10, + ), + StaggeredGridView.countBuilder( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + crossAxisCount: 3, + itemCount: cardsList.length, + staggeredTileBuilder: (int index) => StaggeredTile.fit(1), + itemBuilder: (BuildContext context, int index) => + PatientProfileButton( + patient: widget.patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, + nameLine1: cardsList[index].nameLine1, + nameLine2: cardsList[index].nameLine2, + route: cardsList[index].route, + icon: cardsList[index].icon, + isInPatient: cardsList[index].isInPatient, + isDischargedPatient: + cardsList[index].isDischargedPatient, + isDisable: cardsList[index].isDisable, + onTap: cardsList[index].onTap, + isLoading: cardsList[index].isLoading, + isDartIcon: cardsList[index].isDartIcon, + dartIcon: cardsList[index].dartIcon, + ), + ), + ], + ), ), - ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.05, - ) - ], - ), - ), - bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), + SizedBox( + height: MediaQuery.of(context).size.height * 0.05, + ) + ], ), - border: Border.all(color: HexColor('#707070'), width: 0), ), - height: MediaQuery.of(context).size.height * 0.1, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - fontWeight: FontWeight.w700, - color: Colors.red[600], - title: "Close", //TranslationBase.of(context).close, - onPressed: () async {}, + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, + ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + fontWeight: FontWeight.w700, + color: Colors.red[600], + title: "Close", //TranslationBase.of(context).close, + onPressed: () async {}, + ), ), ), ), - ), - SizedBox( - height: 5, - ), - ], + SizedBox( + height: 5, + ), + ], + ), ), ), ); diff --git a/lib/screens/live_care/live-care_transfer_to_admin.dart b/lib/screens/live_care/live-care_transfer_to_admin.dart index f6e3798f..33f55c95 100644 --- a/lib/screens/live_care/live-care_transfer_to_admin.dart +++ b/lib/screens/live_care/live-care_transfer_to_admin.dart @@ -1,10 +1,11 @@ -import 'dart:html'; - import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; import 'package:flutter/material.dart'; import 'package:permission_handler/permission_handler.dart'; @@ -13,17 +14,16 @@ import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; class LivaCareTransferToAdmin extends StatefulWidget { - final PatiantInformtion patient; const LivaCareTransferToAdmin({Key key, this.patient}) : super(key: key); @override - _LivaCareTransferToAdminState createState() => _LivaCareTransferToAdminState(); + _LivaCareTransferToAdminState createState() => + _LivaCareTransferToAdminState(); } class _LivaCareTransferToAdminState extends State { - stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; var event = RobotProvider(); @@ -47,8 +47,15 @@ class _LivaCareTransferToAdminState extends State { Widget build(BuildContext context) { projectViewModel = Provider.of(context); - return Container( - + return BaseView( + onModelReady: (model) {}, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + isShowAppBar: true, + body: Container(), + ), ); } diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index 344c5394..a2aa07e3 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -277,13 +277,13 @@ class _PatientProfileScreenState extends State .of(context) .initiateCall, onPressed: () async { - if(model.isFinished) { + // if(model.isFinished) { Navigator.push(context, MaterialPageRoute( builder: (BuildContext context) => EndCallScreen(patient:patient))); - } else { - // TODO Call initiateCall service - } + // } else { + // // TODO Call initiateCall service + // } }, ), From e313722743ec02a0905cc755ebf274cc8f69c80e Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 20 May 2021 15:59:25 +0300 Subject: [PATCH 05/25] fix bug when logout --- lib/core/viewModel/authentication_view_model.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 232d9619..a6e9eaeb 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -421,8 +421,9 @@ class AuthenticationViewModel extends BaseViewModel { doctorProfile = null; sharedPref.setString(APP_Language, lang); deleteUser(); - await getDeviceInfoFromFirebase(); + await getDeviceInfoFromFirebase(); this.isFromLogin = isFromLogin; + setState(ViewState.Idle); Navigator.pushAndRemoveUntil( AppGlobal.CONTEX, FadePage( From 0cd7fa0cb2530d811dc1bd7691f99662b17c59ba Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 20 May 2021 17:07:50 +0300 Subject: [PATCH 06/25] working on livecare --- .../patient/LiveCarePatientServices.dart | 20 +++++ .../viewModel/LiveCarePatientViewModel.dart | 13 +++ lib/screens/live_care/end_call_screen.dart | 5 +- .../live-care_transfer_to_admin.dart | 86 ++++++++++++++++++- .../shared/buttons/button_bottom_sheet.dart | 38 ++++---- 5 files changed, 142 insertions(+), 20 deletions(-) diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index 36ca2c7e..0a8c4894 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -12,6 +12,7 @@ class LiveCarePatientServices extends BaseService{ bool get isFinished => _isFinished; var endCallResponse = {}; + var transferToAdminResponse = {}; Future getPendingPatientERForDoctorApp(PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async{ hasError = false; @@ -58,4 +59,23 @@ class LiveCarePatientServices extends BaseService{ }, ); } + + Future transferToAdmin(int vcID, String notes) async{ + hasError = false; + await baseAppClient.post( + TRANSFERT_TO_ADMIN, + onSuccess: (dynamic response, int statusCode) { + transferToAdminResponse = response; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: { + "VC_ID": vcID, + "IsOutKsa": false, + "Notes": notes, + }, + ); + } } \ No newline at end of file diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 8c7587a4..e8b07cba 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -70,6 +70,19 @@ class LiveCarePatientViewModel extends BaseViewModel { } } + Future transferToAdmin(int vcID, String notes) async { + setState(ViewState.BusyLocal); + await _liveCarePatientServices + .transferToAdmin(vcID, notes); + if (_liveCarePatientServices.hasError) { + error = _liveCarePatientServices.error; + setState(ViewState.ErrorLocal); + } else { + await getPendingPatientERForDoctorApp(); + setState(ViewState.Idle); + } + } + searchData(String str) { var strExist= str.length > 0 ? true : false; if (strExist) { diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index b7657d31..e33d476c 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -59,10 +59,13 @@ class _EndCallScreenState extends State { () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - liveCareModel.endCallWithCharge(0); + liveCareModel.endCallWithCharge(widget.patient.vcId); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); + } else { + Navigator.of(context).pop(); + Navigator.of(context).pop(); } }); }, isDartIcon: true, dartIcon: DoctorApp.end_consultaion), diff --git a/lib/screens/live_care/live-care_transfer_to_admin.dart b/lib/screens/live_care/live-care_transfer_to_admin.dart index 33f55c95..c5bcf304 100644 --- a/lib/screens/live_care/live-care_transfer_to_admin.dart +++ b/lib/screens/live_care/live-care_transfer_to_admin.dart @@ -1,12 +1,19 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.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/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.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/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/button_bottom_sheet.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; @@ -30,6 +37,7 @@ class _LivaCareTransferToAdminState extends State { ProjectViewModel projectViewModel; TextEditingController noteController = TextEditingController(); + String noteError; void initState() { requestPermissions(); @@ -51,10 +59,84 @@ class _LivaCareTransferToAdminState extends State { onModelReady: (model) {}, builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", + appBarTitle: + "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", backgroundColor: Theme.of(context).scaffoldBackgroundColor, isShowAppBar: true, - body: Container(), + body: Container( + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Container( + color: Colors.white, + margin: EdgeInsets.all(16), + child: Stack( + children: [ + AppTextFieldCustom( + hintText: TranslationBase.of(context).notes, + //TranslationBase.of(context).addProgressNote, + controller: noteController, + maxLines: 35, + minLines: 25, + hasBorder: true, + validationError: noteError, + ), + Positioned( + top: -2, //MediaQuery.of(context).size.height * 0, + right: projectViewModel.isArabic + ? MediaQuery.of(context).size.width * 0.75 + : 15, + child: Column( + children: [ + IconButton( + icon: Icon(DoctorApp.speechtotext, + color: Colors.black, size: 35), + onPressed: () { + initSpeechState() + .then((value) => {onVoiceText()}); + }, + ), + ], + )) + ], + ), + ), + ), + ), + ButtonBottomSheet( + title: + "${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin}", + onPressed: () { + setState(() { + if (noteController.text.isEmpty) { + noteError = TranslationBase.of(context).emptyMessage; + } else { + noteError = null; + } + if (noteController.text.isNotEmpty) { + Helpers.showConfirmationDialog(context, + "${TranslationBase.of(context).areYouSureYouWantTo} ${TranslationBase.of(context).transferTo}${TranslationBase.of(context).admin} ?", + () async { + Navigator.of(context).pop(); + GifLoaderDialogUtils.showMyDialog(context); + model.endCallWithCharge(widget.patient.vcId); + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } else { + Navigator.of(context).pop(); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + } + }); + } + }); + }, + ) + ], + ), + ), ), ); } diff --git a/lib/widgets/shared/buttons/button_bottom_sheet.dart b/lib/widgets/shared/buttons/button_bottom_sheet.dart index 9db662d2..3c5cc32d 100644 --- a/lib/widgets/shared/buttons/button_bottom_sheet.dart +++ b/lib/widgets/shared/buttons/button_bottom_sheet.dart @@ -42,23 +42,27 @@ class ButtonBottomSheet extends StatelessWidget { Widget build(BuildContext context) { return Container( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - child: AppButton( - title: title, - onPressed: onPressed, - fontWeight: fontWeight, - color: color, - fontSize: fontSize, - padding: padding, - disabled: disabled, - radius: radius, - hasBorder: hasBorder, - fontColor: fontColor, - icon: icon, - iconData: iconData, - hPadding: hPadding, - vPadding: vPadding, - borderColor: borderColor, - loading: loading, + child: Column( + children: [ + AppButton( + title: title, + onPressed: onPressed, + fontWeight: fontWeight, + color: color, + fontSize: fontSize, + padding: padding, + disabled: disabled, + radius: radius, + hasBorder: hasBorder, + fontColor: fontColor, + icon: icon, + iconData: iconData, + hPadding: hPadding, + vPadding: vPadding, + borderColor: borderColor, + loading: loading, + ), + ], ), ); } From 401516403f198a9ecb226e34a802537dba7163ba Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 20 May 2021 17:13:52 +0300 Subject: [PATCH 07/25] first step from show Video call --- .../patient/LiveCarePatientServices.dart | 27 +++++++++++++--- .../viewModel/LiveCarePatientViewModel.dart | 31 +++++++++++++++++-- lib/screens/live_care/panding_list.dart | 14 ++++----- lib/screens/live_care/video_call.dart | 16 ++++++---- .../patient_profile_screen.dart | 17 +++++++++- 5 files changed, 85 insertions(+), 20 deletions(-) diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index e4443b9b..deff406e 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -2,17 +2,25 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/livecare/end_call_req.dart'; +import 'package:doctor_app_flutter/models/livecare/start_call_req.dart'; +import 'package:doctor_app_flutter/models/livecare/start_call_res.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -class LiveCarePatientServices extends BaseService{ +class LiveCarePatientServices extends BaseService { List _patientList = []; + List get patientList => _patientList; bool _isFinished = false; - bool get isFinished => _isFinished; + + bool get isFinished => _isFinished; + var endCallResponse = {}; + StartCallRes _startCallRes; + StartCallRes get startCallRes => _startCallRes; + Future getPendingPatientERForDoctorApp(PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async{ hasError = false; await baseAppClient.post( @@ -32,14 +40,25 @@ class LiveCarePatientServices extends BaseService{ } Future endCall(EndCallReq endCallReq) async { - + hasError = false; await baseAppClient.post(END_CALL, onSuccess: (response, statusCode) async { _isFinished = true; endCallResponse = response; }, onFailure: (String error, int statusCode) { _isFinished = true; - throw error; + hasError = true; + super.error = error; }, body: endCallReq.toJson()); } + Future startCall(StartCallReq startCallReq) async { + hasError = false; + await baseAppClient.post(START_LIVECARE_CALL, + onSuccess: (response, statusCode) async { + _startCallRes = StartCallRes.fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: startCallReq.toJson()); + } } \ No newline at end of file diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 0cce5f86..f5d089b4 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -4,6 +4,8 @@ import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/models/livecare/end_call_req.dart'; +import 'package:doctor_app_flutter/models/livecare/start_call_req.dart'; +import 'package:doctor_app_flutter/models/livecare/start_call_res.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import '../../locator.dart'; @@ -15,6 +17,7 @@ class LiveCarePatientViewModel extends BaseViewModel { locator(); bool get isFinished => _liveCarePatientServices.isFinished; + StartCallRes get startCallRes => _liveCarePatientServices.startCallRes; DashboardService _dashboardService = locator(); @@ -49,14 +52,38 @@ class LiveCarePatientViewModel extends BaseViewModel { .endCall(endCallReq); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; - setState(ViewState.ErrorLocal); } else { - filterData = _liveCarePatientServices.patientList; setState(ViewState.Idle); } } + + Future startCall({int vCID, bool isReCall}) async { + StartCallReq startCallReq = new StartCallReq(); + await getDoctorProfile(); + startCallReq.clinicId = super.doctorProfile.clinicID; + startCallReq.vCID = vCID; //["VC_ID"]; + startCallReq.isrecall = isReCall; + startCallReq.doctorId = doctorProfile.doctorID; + startCallReq.isOutKsa = false; //["IsOutKSA"]; + startCallReq.projectName = doctorProfile.projectName; + startCallReq.docotrName = doctorProfile.doctorName; + startCallReq.clincName = doctorProfile.clinicDescription; + startCallReq.docSpec = doctorProfile.doctorTitleForProfile; + startCallReq.generalid = 'Cs2020@2016\$2958'; + + setState(ViewState.BusyLocal); + await _liveCarePatientServices + .startCall(startCallReq); + if (_liveCarePatientServices.hasError) { + error = _liveCarePatientServices.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + + } searchData(String str) { var strExist= str.length > 0 ? true : false; if (strExist) { diff --git a/lib/screens/live_care/panding_list.dart b/lib/screens/live_care/panding_list.dart index 8c9851db..f081479c 100644 --- a/lib/screens/live_care/panding_list.dart +++ b/lib/screens/live_care/panding_list.dart @@ -204,13 +204,13 @@ class _LiveCarePandingListState extends State { // .pushNamed( // VIDEO_CALL, // item) - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - VideoCallPage( - item, - context))) + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // VideoCallPage( + // item, + // context))) }, ), ) diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index 961654cc..e3b05871 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -1,10 +1,12 @@ import 'dart:async'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart'; import 'package:doctor_app_flutter/models/livecare/get_pending_res_list.dart'; import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; import 'package:doctor_app_flutter/models/livecare/start_call_res.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/VideoChannel.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -13,9 +15,10 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class VideoCallPage extends StatefulWidget { - final LiveCarePendingListResponse patientData; + final PatiantInformtion patientData; final listContext; - VideoCallPage(this.patientData, this.listContext); + final LiveCarePatientViewModel model; + VideoCallPage({this.patientData, this.listContext, this.model}); @override _VideoCallPageState createState() => _VideoCallPageState(); @@ -41,7 +44,8 @@ class _VideoCallPageState extends State { super.didChangeDependencies(); if (_isInit) { _liveCareProvider = Provider.of(context); - startCall(false); + connectOpenTok(widget.model.startCallRes); + // widget.model.startCall(vCID: widget.patientData.vcId, isReCall: false); } _isInit = false; } @@ -61,7 +65,7 @@ class _VideoCallPageState extends State { kSessionId: tokenData.openSessionID, //'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg', kApiKey: '46209962', - vcId: widget.patientData.vCID, + vcId: widget.patientData.vcId, tokenID: token, //"hfkjshdf347r8743", generalId: "Cs2020@2016\$2958", doctorId: doctorprofile['DoctorID'], @@ -130,7 +134,7 @@ class _VideoCallPageState extends State { height: MediaQuery.of(context).size.height * 0.02, ), Text( - widget.patientData.patientName, + widget.patientData.fullName, style: TextStyle( color: Colors.deepPurpleAccent, fontWeight: FontWeight.w900, @@ -319,7 +323,7 @@ class _VideoCallPageState extends State { endCallWithCharge() { _liveCareProvider - .endCallWithCharge(widget.patientData.vCID, doctorprofile['DoctorID']) + .endCallWithCharge(widget.patientData.vcId, doctorprofile['DoctorID']) .then((result) { closeRoute(); print('end callwith charge'); diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index 0ec0cf0e..f90e9f33 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; @@ -5,9 +6,11 @@ import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.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/screens/live_care/end_call_screen.dart'; +import 'package:doctor_app_flutter/screens/live_care/video_call.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.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-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -278,13 +281,25 @@ class _PatientProfileScreenState extends State .endCall:TranslationBase .of(context) .initiateCall, + disabled: model.state == ViewState.BusyLocal, onPressed: () async { if(model.isFinished) { Navigator.push(context, MaterialPageRoute( builder: (BuildContext context) => EndCallScreen(patient:patient))); } else { - // TODO Call initiateCall service + GifLoaderDialogUtils.showMyDialog(context); + await model.startCall( isReCall : false, vCID: patient.vcId); + if(model.state == ViewState.ErrorLocal) { + // + GifLoaderDialogUtils.hideDialog(context); + Helpers.showErrorToast(model.error); + } else { + GifLoaderDialogUtils.hideDialog(context); + Navigator.push(context, MaterialPageRoute( + builder: (BuildContext context) => + VideoCallPage(patientData: patient,listContext: "dfd",model: model,))); + } } }, From 69eca869b4a7afe7899b932e79ec2c94bf9a882b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 23 May 2021 10:12:08 +0300 Subject: [PATCH 08/25] fix error after merge --- .../patients/profile/profile_screen/patient_profile_screen.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index e3d5ef64..f90e9f33 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -283,7 +283,7 @@ class _PatientProfileScreenState extends State .initiateCall, disabled: model.state == ViewState.BusyLocal, onPressed: () async { - // if(model.isFinished) { + if(model.isFinished) { Navigator.push(context, MaterialPageRoute( builder: (BuildContext context) => EndCallScreen(patient:patient))); From 73cf681e9dbc94a6b2b054bb3013773991af52d9 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 23 May 2021 17:18:23 +0300 Subject: [PATCH 09/25] lab-result-special --- lib/config/config.dart | 4 ++-- .../lab_order/labs_service.dart | 7 +++++-- .../PatientMedicalReportService.dart | 2 ++ .../lab_result/laboratory_result_page.dart | 16 ++++++++++------ .../lab_result/laboratory_result_widget.dart | 8 ++++---- lib/widgets/shared/doctor_card.dart | 9 ++++++--- 6 files changed, 29 insertions(+), 17 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index f1d642eb..638ff134 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -// const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart index d7fc3aab..c7bb9a78 100644 --- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -105,13 +105,16 @@ class LabsService extends BaseService { await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { - // patientLabSpecialResult.clear(); - labResultList.clear(); + patientLabSpecialResult = []; + labResultList = []; if (isInpatient) { response['List_GetLabNormal'].forEach((hospital) { labResultList.add(LabResult.fromJson(hospital)); }); + response['List_GetLabSpecial'].forEach((hospital) { + patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital)); + }); } else { response['ListPLR'].forEach((lab) { labResultList.add(LabResult.fromJson(lab)); diff --git a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart index 6e00b890..aa81e8a6 100644 --- a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart +++ b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart @@ -11,7 +11,9 @@ class PatientMedicalReportService extends BaseService { Future getMedicalReportList(PatiantInformtion patient) async { hasError = false; Map body = Map(); + await getDoctorProfile(); body['AdmissionNo'] = patient.admissionNo; + body['SetupID'] = doctorProfile.setupID; await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index e54a3782..4670e2d1 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -30,13 +30,17 @@ class _LaboratoryResultPageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getLaboratoryResult( - invoiceNo: widget.patientLabOrders.invoiceNo, - clinicID: widget.patientLabOrders.clinicID, - projectID: widget.patientLabOrders.projectID, - orderNo: widget.patientLabOrders.orderNo, + // onModelReady: (model) => model.getLaboratoryResult( + // invoiceNo: widget.patientLabOrders.invoiceNo, + // clinicID: widget.patientLabOrders.clinicID, + // projectID: widget.patientLabOrders.projectID, + // orderNo: widget.patientLabOrders.orderNo, + // patient: widget.patient, + // isInpatient: widget.patientType == "1"), + onModelReady: (model) => model.getPatientLabResult( + patientLabOrder: widget.patientLabOrders, patient: widget.patient, - isInpatient: widget.patientType == "1"), + isInpatient: widget.patientType =="1"), builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBar: PatientProfileHeaderWhitAppointmentAppBar( diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index bc6fcbcb..1bdc49cf 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -45,10 +45,10 @@ class _LaboratoryResultWidgetState extends State { Widget build(BuildContext context) { projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPatientLabResult( - patientLabOrder: widget.patientLabOrder, - patient: widget.patient, - isInpatient: widget.isInpatient), + // onModelReady: (model) => model.getPatientLabResult( + // patientLabOrder: widget.patientLabOrder, + // patient: widget.patient, + // isInpatient: widget.isInpatient), builder: (_, model, w) => NetworkBaseView( baseViewModel: model, child: Container( diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 2a98a381..faa4379a 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -139,6 +139,7 @@ class DoctorCard extends StatelessWidget { ), if (clinic != null) Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( TranslationBase.of(context).clinic + @@ -146,9 +147,11 @@ class DoctorCard extends StatelessWidget { color: Colors.grey[500], fontSize: 14, ), - AppText( - clinic, - fontSize: 14, + Expanded( + child: AppText( + clinic, + fontSize: 14, + ), ) ], ), From ac701c98064a6612ee286de875872454365f5fd0 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 23 May 2021 17:22:37 +0300 Subject: [PATCH 10/25] fix live care issues --- ios/Podfile.lock | 2 +- lib/config/localized_values.dart | 6 +- .../patient/LiveCarePatientServices.dart | 10 ++- .../viewModel/LiveCarePatientViewModel.dart | 18 +++-- lib/screens/live_care/end_call_screen.dart | 75 ++++++++++++++++--- .../patient_profile_screen.dart | 65 ++++++++++++---- lib/util/translations_delegate_base.dart | 4 +- 7 files changed, 138 insertions(+), 42 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 1cf7499c..59cdf14c 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -328,4 +328,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.0.rc.1 +COCOAPODS: 1.10.1 diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 6c0e0d83..64a353fd 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -982,7 +982,7 @@ const Map> localizedValues = { "medicalReportAdd": {"en": "Add Medical Report", "ar": "إضافة تقرير طبي"}, "medicalReportVerify": {"en": "Verify Medical Report", "ar": "تحقق من التقرير الطبي"}, "comments": {"en": "Comments", "ar": "تعليقات"}, - "initiateCall ": {"en": "Initiate Call ", "ar": "بدء الاتصال"}, + "initiateCall": {"en": "Initiate Call ", "ar": "بدء الاتصال"}, "transferTo": {"en": "Transfer To ", "ar": "حول إلى"}, "admin": {"en": "Admin", "ar": "مشرف"}, "instructions": {"en": "Instructions", "ar": "تعليمات"}, @@ -996,6 +996,6 @@ const Map> localizedValues = { "laboratoryPhysicalData": {"en": "Laboratory and Physical Data", "ar": "المعامل والبيانات الفيزيائية"}, "impressionRecommendation": {"en": "Impression and Recommendation", "ar": "الانطباع والتوصية"}, "onHold": {"en": "'On Hold'", "ar": "قيد الانتظار"}, - "verified": {"en": "'Verified'", "ar": "Verified"}, - "endCall": {"en": "'End'", "ar": "انهاء"}, + "verified": {"en": "Verified", "ar": "Verified"}, + "endCall": {"en": "End Call", "ar": "انهاء"}, }; diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index cb8cf61d..27dd666f 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -15,6 +15,10 @@ class LiveCarePatientServices extends BaseService { bool get isFinished => _isFinished; + setFinished(bool isFinished){ + _isFinished = isFinished; + } + var endCallResponse = {}; var transferToAdminResponse = {}; @@ -43,10 +47,10 @@ class LiveCarePatientServices extends BaseService { Future endCall(EndCallReq endCallReq) async { hasError = false; await baseAppClient.post(END_CALL, onSuccess: (response, statusCode) async { - _isFinished = true; + endCallResponse = response; }, onFailure: (String error, int statusCode) { - _isFinished = true; + hasError = true; super.error = error; }, body: endCallReq.toJson()); @@ -74,7 +78,7 @@ class LiveCarePatientServices extends BaseService { super.error = error; }, body: { - "VC_ID": vcID, + "VC_ID": vcID,"generalid":"Cs2020@2016\$2958", }, ); } diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index a7e0024f..59706429 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart'; import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; @@ -16,7 +17,7 @@ class LiveCarePatientViewModel extends BaseViewModel { LiveCarePatientServices _liveCarePatientServices = locator(); - bool get isFinished => _liveCarePatientServices.isFinished; + StartCallRes get startCallRes => _liveCarePatientServices.startCallRes; DashboardService _dashboardService = @@ -39,12 +40,12 @@ class LiveCarePatientViewModel extends BaseViewModel { } } - Future endCall(request, isPatient, doctorID) async { - + Future endCall(int vCID, bool isPatient) async { + await getDoctorProfile(isGetProfile: true); EndCallReq endCallReq = new EndCallReq(); - endCallReq.doctorId = doctorID; //profile["DoctorID"]; + endCallReq.doctorId = doctorProfile.doctorID; endCallReq.generalid = 'Cs2020@2016\$2958'; - endCallReq.vCID = request.vCID; //["VC_ID"]; + endCallReq.vCID = vCID; endCallReq.isDestroy = isPatient; setState(ViewState.BusyLocal); @@ -58,6 +59,10 @@ class LiveCarePatientViewModel extends BaseViewModel { } } + getToken()async{ + String token = await sharedPref.getString(TOKEN); + return token; + } Future startCall({int vCID, bool isReCall}) async { StartCallReq startCallReq = new StartCallReq(); @@ -74,8 +79,7 @@ class LiveCarePatientViewModel extends BaseViewModel { startCallReq.generalid = 'Cs2020@2016\$2958'; setState(ViewState.BusyLocal); - await _liveCarePatientServices - .startCall(startCallReq); + await _liveCarePatientServices.startCall(startCallReq); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); diff --git a/lib/screens/live_care/end_call_screen.dart b/lib/screens/live_care/end_call_screen.dart index e33d476c..d4e9120e 100644 --- a/lib/screens/live_care/end_call_screen.dart +++ b/lib/screens/live_care/end_call_screen.dart @@ -1,10 +1,13 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/livecare/session_status_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/screens/live_care/live-care_transfer_to_admin.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/PatientProfileCardModel.dart'; +import 'package:doctor_app_flutter/util/VideoChannel.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'; @@ -44,10 +47,51 @@ class _EndCallScreenState extends State { final List cardsList = [ PatientProfileCardModel(TranslationBase.of(context).resume, TranslationBase.of(context).theCall, '', 'patient/vital_signs.png', - isInPatient: isInpatient, - onTap: () {}, - isDartIcon: true, - dartIcon: DoctorApp.call), + isInPatient: isInpatient, onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + await liveCareModel + .startCall(isReCall: false, vCID: widget.patient.vcId) + .then((value) async{ + await liveCareModel.getDoctorProfile(); + GifLoaderDialogUtils.hideDialog(context); + if (liveCareModel.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(liveCareModel.error); + }else + await VideoChannel.openVideoCallScreen( + kToken: liveCareModel.startCallRes.openTokenID, + kSessionId: liveCareModel.startCallRes.openSessionID, + kApiKey: '46209962', + vcId: widget.patient.vcId, + tokenID: await liveCareModel.getToken(), + generalId: GENERAL_ID, + doctorId: liveCareModel.doctorProfile.doctorID, + onFailure: (String error) { + DrAppToastMsg.showErrorToast(error); + }, + onCallEnd: () async{ + GifLoaderDialogUtils.showMyDialog(context); + GifLoaderDialogUtils.showMyDialog(context); + await liveCareModel.endCall(widget.patient.vcId, false,); + GifLoaderDialogUtils.hideDialog(context); + if (liveCareModel.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(liveCareModel.error); + } + }, + onCallNotRespond: (SessionStatusModel sessionStatusModel) async{ + GifLoaderDialogUtils.showMyDialog(context); + GifLoaderDialogUtils.showMyDialog(context); + await liveCareModel.endCall(widget.patient.vcId, sessionStatusModel.sessionStatus == 3,); + GifLoaderDialogUtils.hideDialog(context); + if (liveCareModel.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(liveCareModel.error); + } + }); + }); + GifLoaderDialogUtils.hideDialog(context); + if (liveCareModel.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(liveCareModel.error); + } + }, isDartIcon: true, dartIcon: DoctorApp.call), PatientProfileCardModel( TranslationBase.of(context).endLC, TranslationBase.of(context).consultation, @@ -59,7 +103,7 @@ class _EndCallScreenState extends State { () async { Navigator.of(context).pop(); GifLoaderDialogUtils.showMyDialog(context); - liveCareModel.endCallWithCharge(widget.patient.vcId); + await liveCareModel.endCallWithCharge(widget.patient.vcId); GifLoaderDialogUtils.hideDialog(context); if (liveCareModel.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(liveCareModel.error); @@ -77,14 +121,19 @@ class _EndCallScreenState extends State { onTap: () {}, isInPatient: isInpatient, isDartIcon: true, + isDisable: true, dartIcon: DoctorApp.send_instruction), - PatientProfileCardModel(TranslationBase.of(context).transferTo, - TranslationBase.of(context).admin, '', 'patient/health_summary.png', - onTap: () { - Navigator.push(context, MaterialPageRoute( + PatientProfileCardModel( + TranslationBase.of(context).transferTo, + TranslationBase.of(context).admin, + '', + 'patient/health_summary.png', onTap: () { + Navigator.push( + context, + MaterialPageRoute( builder: (BuildContext context) => - LivaCareTransferToAdmin(patient:widget.patient))); - }, + LivaCareTransferToAdmin(patient: widget.patient))); + }, isInPatient: isInpatient, isDartIcon: true, dartIcon: DoctorApp.transfer_to_admin), @@ -197,7 +246,9 @@ class _EndCallScreenState extends State { fontWeight: FontWeight.w700, color: Colors.red[600], title: "Close", //TranslationBase.of(context).close, - onPressed: () async {}, + onPressed: () { + Navigator.of(context).pop(); + }, ), ), ), diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index f90e9f33..ae5406d5 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -1,15 +1,17 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; +import 'package:doctor_app_flutter/models/livecare/session_status_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/screens/live_care/end_call_screen.dart'; -import 'package:doctor_app_flutter/screens/live_care/video_call.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.dart'; +import 'package:doctor_app_flutter/util/VideoChannel.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-header-new-design-app-bar.dart'; @@ -34,7 +36,7 @@ class _PatientProfileScreenState extends State bool isFromLiveCare = false; bool isInpatient = false; - + bool isCallFinished = false; bool isDischargedPatient = false; bool isSearchAndOut = false; String patientType; @@ -275,15 +277,13 @@ class _PatientProfileScreenState extends State child: Center( child: AppButton( fontWeight: FontWeight.w700, - color: model.isFinished?Colors.red[600]:Colors.green[600], - title: model.isFinished?TranslationBase - .of(context) - .endCall:TranslationBase - .of(context) - .initiateCall, + color: isCallFinished?Colors.red[600]:Colors.green[600], + title: isCallFinished? + TranslationBase.of(context).endCall: + TranslationBase.of(context).initiateCall, disabled: model.state == ViewState.BusyLocal, onPressed: () async { - if(model.isFinished) { + if(isCallFinished) { Navigator.push(context, MaterialPageRoute( builder: (BuildContext context) => EndCallScreen(patient:patient))); @@ -291,14 +291,51 @@ class _PatientProfileScreenState extends State GifLoaderDialogUtils.showMyDialog(context); await model.startCall( isReCall : false, vCID: patient.vcId); if(model.state == ViewState.ErrorLocal) { - // GifLoaderDialogUtils.hideDialog(context); Helpers.showErrorToast(model.error); } else { + await model.getDoctorProfile(); GifLoaderDialogUtils.hideDialog(context); - Navigator.push(context, MaterialPageRoute( - builder: (BuildContext context) => - VideoCallPage(patientData: patient,listContext: "dfd",model: model,))); + await VideoChannel.openVideoCallScreen( + kToken: model.startCallRes.openTokenID, + kSessionId: model.startCallRes.openSessionID, + kApiKey: '46209962', + vcId: patient.vcId, + tokenID: await model.getToken(), + generalId: GENERAL_ID, + doctorId: model.doctorProfile.doctorID, + onFailure: (String error) { + DrAppToastMsg.showErrorToast(error); + }, + onCallEnd: () { + WidgetsBinding.instance.addPostFrameCallback((_) { + GifLoaderDialogUtils.showMyDialog(context); + model.endCall(patient.vcId, false,).then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } + setState(() { + isCallFinished = true; + }); + }); + }); + }, + onCallNotRespond: (SessionStatusModel sessionStatusModel) { + WidgetsBinding.instance.addPostFrameCallback((_) { + GifLoaderDialogUtils.showMyDialog(context); + model.endCall(patient.vcId, sessionStatusModel.sessionStatus == 3,).then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } + setState(() { + isCallFinished = true; + }); + }); + + }); + }); } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index a4ecc977..9ed00146 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1338,8 +1338,8 @@ class TranslationBase { String get medicalReportAdd => localizedValues['medicalReportAdd'][locale.languageCode]; String get medicalReportVerify => localizedValues['medicalReportVerify'][locale.languageCode]; String get comments => localizedValues['comments'][locale.languageCode]; - String get initiateCall => localizedValues['initiateCall '][locale.languageCode]; - String get endCall => localizedValues['endCall '][locale.languageCode]; + String get initiateCall => localizedValues['initiateCall'][locale.languageCode]; + String get endCall => localizedValues['endCall'][locale.languageCode]; String get transferTo => localizedValues['transferTo'][locale.languageCode]; String get admin => localizedValues['admin'][locale.languageCode]; From 1391799101af955215ebc6a0969aacb78c265c68 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 23 May 2021 17:26:39 +0300 Subject: [PATCH 11/25] fix live care user --- lib/core/service/home/dasboard_service.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/core/service/home/dasboard_service.dart b/lib/core/service/home/dasboard_service.dart index a1072676..ba836287 100644 --- a/lib/core/service/home/dasboard_service.dart +++ b/lib/core/service/home/dasboard_service.dart @@ -32,6 +32,7 @@ class DashboardService extends BaseService { Future checkDoctorHasLiveCare() async { hasError = false; + await getDoctorProfile(isGetProfile: true); await baseAppClient.post( DOCTOR_CHECK_HAS_LIVE_CARE, onSuccess: (dynamic response, int statusCode) { @@ -43,7 +44,7 @@ class DashboardService extends BaseService { super.error = error; }, body: { - "DoctorID": 9920 + "DoctorID": doctorProfile.doctorID// test user 9920 }, ); } From 41515b311cea8987c983e2462960a349b5e4004f Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 24 May 2021 12:45:07 +0300 Subject: [PATCH 12/25] lab-result-fixes --- lib/config/config.dart | 4 +- lib/config/localized_values.dart | 4 +- .../PatientMedicalReportService.dart | 1 + lib/core/viewModel/labs_view_model.dart | 33 +- .../admission-request-detail-screen.dart | 307 ------------------ .../admission-request-first-screen.dart | 14 - .../lab_result/laboratory_result_page.dart | 23 +- .../lab_result/laboratory_result_widget.dart | 152 +++++---- .../medical_report/MedicalReportPage.dart | 21 +- lib/util/helpers.dart | 7 +- 10 files changed, 136 insertions(+), 430 deletions(-) delete mode 100644 lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 638ff134..f1d642eb 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 6c0e0d83..20bcd1d7 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -995,7 +995,7 @@ const Map> localizedValues = { "historyPhysicalFinding": {"en": "History and Physical Finding", "ar": "التاريخ والاكتشاف المادي"}, "laboratoryPhysicalData": {"en": "Laboratory and Physical Data", "ar": "المعامل والبيانات الفيزيائية"}, "impressionRecommendation": {"en": "Impression and Recommendation", "ar": "الانطباع والتوصية"}, - "onHold": {"en": "'On Hold'", "ar": "قيد الانتظار"}, - "verified": {"en": "'Verified'", "ar": "Verified"}, + "onHold": {"en": "On Hold", "ar": "قيد الانتظار"}, + "verified": {"en": "Verified", "ar": "تم التحقق"}, "endCall": {"en": "'End'", "ar": "انهاء"}, }; diff --git a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart index aa81e8a6..94933d7d 100644 --- a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart +++ b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart @@ -14,6 +14,7 @@ class PatientMedicalReportService extends BaseService { await getDoctorProfile(); body['AdmissionNo'] = patient.admissionNo; body['SetupID'] = doctorProfile.setupID; + body['ProjectID'] = doctorProfile.projectID; await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index 90e9b327..5b4b7e4c 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -128,25 +128,28 @@ class LabsViewModel extends BaseViewModel { error = _labsService.error; setState(ViewState.Error); } else { - _labsService.labResultList.forEach((element) { - List patientLabOrdersClinic = labResultLists - .where( - (elementClinic) => elementClinic.filterName == element.testCode) - .toList(); - - if (patientLabOrdersClinic.length != 0) { - labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] - .patientLabResultList - .add(element); - } else { - labResultLists - .add(LabResultList(filterName: element.testCode, lab: element)); - } - }); setState(ViewState.Idle); } } + void setLabResultDependOnFilterName(){ + _labsService.labResultList.forEach((element) { + List patientLabOrdersClinic = labResultLists + .where( + (elementClinic) => elementClinic.filterName == element.testCode) + .toList(); + + if (patientLabOrdersClinic.length != 0) { + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] + .patientLabResultList + .add(element); + } else { + labResultLists + .add(LabResultList(filterName: element.testCode, lab: element)); + } + }); + } + getPatientLabOrdersResults( {PatientLabOrders patientLabOrder, String procedure, diff --git a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart deleted file mode 100644 index bbc968b0..00000000 --- a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart +++ /dev/null @@ -1,307 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_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/date-utils.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-page-header-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:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:provider/provider.dart'; - -import '../../../../routes.dart'; - -class AdmissionRequestDetailScreen extends StatefulWidget { - @override - _AdmissionRequestDetailScreenState createState() => - _AdmissionRequestDetailScreenState(); -} - -class _AdmissionRequestDetailScreenState - extends State { - DateTime selectedDate; - dynamic _selectedSpeciality; - dynamic _selectedDoctor; - - @override - Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - final screenSize = MediaQuery.of(context).size; - ProjectViewModel projectViewModel = Provider.of(context); - - return BaseView( - onModelReady: (model) => model.getSpecialityList(), - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).admissionRequest, - body: model.doctorsList != null - ? Column( - children: [ - Expanded( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - PatientPageHeaderWidget(patient), - Container( - margin: EdgeInsets.symmetric( - vertical: 16, horizontal: 16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).patientDetails, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.5, - ), - SizedBox( - height: 10, - ), - Container( - decoration: - Helpers.containerBorderDecoration( - Color(0xFFEEEEEE), - Color(0xFFCCCCCC), - borderWidth: 0.0), - height: screenSize.height * 0.070, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - "Pre Admission Number :01", - null, - false), - enabled: false, - // controller: _remarksController, - keyboardType: TextInputType.text, - )), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: () => _selectDate(context, model), - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).date, - selectedDate != null - ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), - enabled: false, - ), - ), - ), - SizedBox( - height: 20, - ), - AppText( - TranslationBase.of(context) - .specialityAndDoctorDetail, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.5, - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: () { - ListSelectDialog dialog = - ListSelectDialog( - list: model.speciality, - attributeName: - projectViewModel.isArabic - ? 'nameAr' - : 'nameEn', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - _selectedSpeciality = - selectedValue; - }); - }); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - }, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .speciality, - _selectedSpeciality != null - ? projectViewModel.isArabic - ? _selectedSpeciality[ - 'nameAr'] - : _selectedSpeciality[ - 'nameEn'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.doctorsList != null && - model.doctorsList.length > 0 - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model.doctorsList, - attributeName: 'DoctorName', - attributeValueId: 'DoctorID', - usingSearch: true, - hintSearchText: - TranslationBase.of(context) - .doctorSearch, - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - _selectedDoctor = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .doctor, - _selectedDoctor != null - ? _selectedDoctor[ - 'DoctorName'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - decoration: Helpers.containerBorderDecoration( - Color(0xFFEEEEEE), Color(0xFFCCCCCC), - borderWidth: 0.0), - child: InkWell( - onTap: () => null, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .referringDate, - null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Color(0xFFCCCCCC), - )), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - decoration: - Helpers.containerBorderDecoration( - Color(0xFFEEEEEE), - Color(0xFFCCCCCC), - borderWidth: 0.0), - height: screenSize.height * 0.070, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .referringDoctor, - null, - true, - dropDownColor: Color(0xFFCCCCCC)), - enabled: false, - // controller: _remarksController, - keyboardType: TextInputType.text, - )), - ], - ), - ), - ], - ), - ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: AppButton( - title: TranslationBase.of(context).next, - color: HexColor("#B8382B"), - onPressed: () { - Navigator.of(context).pushNamed( - PATIENT_ADMISSION_REQUEST_2, - arguments: {'patient': patient}); - }, - ), - ), - ], - ) - : Container(), - ), - ); - } - - _selectDate(BuildContext context, AdmissionRequestViewModel model) async { - selectedDate = DateTime.now(); - final DateTime picked = await showDatePicker( - context: context, - initialDate: selectedDate, - firstDate: DateTime.now().add(Duration(hours: 2)), - lastDate: DateTime(2040), - initialEntryMode: DatePickerEntryMode.calendar, - ); - if (picked != null && picked != selectedDate) { - setState(() { - selectedDate = picked; - }); - } - } -} diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index d23397da..08a69907 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -453,20 +453,6 @@ class _AdmissionRequestThirdScreenState ); } - Future _selectDate(BuildContext context, DateTime dateTime, - Function(DateTime picked) updateDate) async { - final DateTime picked = await showDatePicker( - context: context, - initialDate: dateTime, - firstDate: DateTime.now(), - lastDate: DateTime(2040), - initialEntryMode: DatePickerEntryMode.calendar, - ); - if (picked != null && picked != dateTime) { - updateDate(picked); - } - } - void openListDialogField(String attributeName, String attributeValueId, List list, Function(dynamic selectedValue) okFunction) { ListSelectDialog dialog = ListSelectDialog( diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index 4670e2d1..3aae6e69 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -61,18 +61,17 @@ class _LaboratoryResultPageState extends State { body: SingleChildScrollView( child: Column( children: [ - ...List.generate( - model.patientLabSpecialResult.length, - (index) => LaboratoryResultWidget( - onTap: () async {}, - billNo: widget.patientLabOrders.invoiceNo, - details: model - .patientLabSpecialResult[index].resultDataHTML, - orderNo: widget.patientLabOrders.orderNo, - patientLabOrder: widget.patientLabOrders, - patient: widget.patient, - isInpatient: widget.patientType == "1", - )), + LaboratoryResultWidget( + onTap: () async {}, + billNo: widget.patientLabOrders.invoiceNo, + details: model + .patientLabSpecialResult.length > 0 ? model + .patientLabSpecialResult[0].resultDataHTML : null, + orderNo: widget.patientLabOrders.orderNo, + patientLabOrder: widget.patientLabOrders, + patient: widget.patient, + isInpatient: widget.patientType == "1", + ), ], ), ), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index 1bdc49cf..08c247ee 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_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/screens/patients/profile/lab_result/LabResultWidget.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/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; @@ -45,7 +46,8 @@ class _LaboratoryResultWidgetState extends State { Widget build(BuildContext context) { projectViewModel = Provider.of(context); return BaseView( - // onModelReady: (model) => model.getPatientLabResult( + onModelReady: (model) => model.setLabResultDependOnFilterName(), + // model.getPatientLabResult( // patientLabOrder: widget.patientLabOrder, // patient: widget.patient, // isInpatient: widget.isInpatient), @@ -130,8 +132,11 @@ class _LaboratoryResultWidgetState extends State { model.labResultLists.length, (index) => LabResultWidget( patientLabOrder: widget.patientLabOrder, - filterName: model.labResultLists[index].filterName, - patientLabResultList: model.labResultLists[index].patientLabResultList, + filterName: model + .labResultLists[index].filterName, + patientLabResultList: model + .labResultLists[index] + .patientLabResultList, patient: widget.patient, isInpatient: widget.isInpatient, ), @@ -143,76 +148,85 @@ class _LaboratoryResultWidgetState extends State { ], ), ), - SizedBox(height: 15,), - if(widget.details!=null && widget.details.isNotEmpty) - Column( - children: [ - InkWell( - onTap: () { - setState(() { - _isShowMore = !_isShowMore; - }); - }, - child: Container( - padding: EdgeInsets.all(10.0), - margin: EdgeInsets.only(left: 5, right: 5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(5.0), - )), - child: Row( - children: [ - Expanded( - child: Container( - margin: EdgeInsets.only( - left: 10, right: 10), - child: AppText( - TranslationBase.of(context) - .specialResult, - bold: true, - ))), - Container( - width: 25, - height: 25, - child: Icon( - _isShowMore - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, - color: Colors.grey[800], - size: 22, - ), - ) - ], + SizedBox( + height: 15, + ), + if (widget.details != null && widget.details.isNotEmpty) + Column( + children: [ + InkWell( + onTap: () { + setState(() { + _isShowMore = !_isShowMore; + }); + }, + child: Container( + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(5.0), + )), + child: Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.only( + left: 10, right: 10), + child: AppText( + TranslationBase.of(context) + .specialResult, + bold: true, + ))), + Container( + width: 25, + height: 25, + child: Icon( + _isShowMore + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.grey[800], + size: 22, + ), + ) + ], + ), ), ), - ), - if (_isShowMore) - AnimatedContainer( - padding: EdgeInsets.all(10.0), - margin: EdgeInsets.only(left: 5, right: 5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(5.0), - bottomRight: Radius.circular(5.0), - )), - duration: Duration(milliseconds: 7000), - child: Container( + if (_isShowMore) + AnimatedContainer( + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(5.0), + bottomRight: Radius.circular(5.0), + )), + duration: Duration(milliseconds: 7000), + child: Container( width: double.infinity, - child: Html( - data: widget.details ?? TranslationBase.of(context).noDataAvailable, - )), + child: !Helpers.isTextHtml(widget.details) + ? AppText( + widget.details ?? + TranslationBase.of(context) + .noDataAvailable, + ) + : Html( + data: widget.details ?? + TranslationBase.of(context) + .noDataAvailable, + ), + ), + ), + SizedBox( + height: 10, ), - SizedBox( - height: 10, - ), - ], - ), - - + ], + ), ], ), ], diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index 5e71dbd6..b54d4837 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -14,7 +14,6 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-head import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -94,7 +93,7 @@ class MedicalReportPage extends StatelessWidget { model.medicalReportList.length, (index) => CardWithBgWidget( hasBorder: false, - bgColor: model.medicalReportList[index].status == 0 + bgColor: model.medicalReportList[index].status == 1 ? Colors.red[700] : Colors.green[700], widget: Column( @@ -106,10 +105,12 @@ class MedicalReportPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - model.medicalReportList[index].status == 0 + model.medicalReportList[index].status == 1 ? TranslationBase.of(context).onHold : TranslationBase.of(context).verified, - color: Colors.red, + color: model.medicalReportList[index].status == 1 + ? Colors.red[700] + : Colors.green[700], ), AppText( "Jammal" ?? "", @@ -123,13 +124,17 @@ class MedicalReportPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.convertDateFromServerFormat( + model.medicalReportList[index].editedOn, + "dd/MM/yyyy")}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), AppText( - '${AppDateUtils.getHour(DateTime.now())}', + '${AppDateUtils.convertDateFromServerFormat( + model.medicalReportList[index].editedOn, + "hh:mm a")}', fontWeight: FontWeight.w600, color: Colors.grey[700], fontSize: 14, @@ -154,7 +159,7 @@ class MedicalReportPage extends StatelessWidget { InkWell( onTap: () { if (model.medicalReportList[index].status == - 0) { + 1) { Navigator.of(context).pushNamed( PATIENT_MEDICAL_REPORT_INSERT, arguments: { @@ -178,7 +183,7 @@ class MedicalReportPage extends StatelessWidget { } }, child: Icon( - model.medicalReportList[index].status == 0 + model.medicalReportList[index].status == 1 ? EvaIcons.eye : DoctorApp.edit_1, ), diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 7f72435f..634abd02 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -50,7 +50,7 @@ class Helpers { color: Colors.green[600], ), AppButton( - onPressed: (){ + onPressed: () { Navigator.of(context).pop(); }, title: TranslationBase.of(context).cancel, @@ -265,4 +265,9 @@ class Helpers { return str; } } + + static bool isTextHtml(String text) { + var htmlRegex = RegExp("<(“[^”]*”|'[^’]*’|[^'”>])*>"); + return htmlRegex.hasMatch(text); + } } From 281a807ec8b35ec40e4f4673bc4c9c22860fde86 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 24 May 2021 16:37:57 +0300 Subject: [PATCH 13/25] fix live care --- lib/client/base_app_client.dart | 8 ++++++-- lib/config/config.dart | 3 ++- lib/config/localized_values.dart | 2 +- lib/core/service/patient/LiveCarePatientServices.dart | 10 +++++----- lib/core/viewModel/livecare_view_model.dart | 2 +- lib/models/patient/patiant_info_model.dart | 6 +++--- lib/util/VideoChannel.dart | 2 +- 7 files changed, 19 insertions(+), 14 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 7a8baa56..824b8189 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -21,8 +21,12 @@ class BaseAppClient { {Map body, Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, - bool isAllowAny = false}) async { - String url = BASE_URL + endPoint; + bool isAllowAny = false,bool isLiveCare = false}) async { + String url; + if(isLiveCare) + url = BASE_URL_LIVE_CARE + endPoint; + else + url = BASE_URL + endPoint; bool callLog = true; try { diff --git a/lib/config/config.dart b/lib/config/config.dart index 638ff134..86c42f8d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,6 +4,7 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; +const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; @@ -47,7 +48,7 @@ const GET_RADIOLOGY = 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; const GET_LIVECARE_PENDINGLIST = 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; -const START_LIVECARE_CALL = 'LiveCareApi/DoctorApp/CallPatient'; +const START_LIVE_CARE_CALL = 'LiveCareApi/DoctorApp/CallPatient'; const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = "Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 64a353fd..0bb783d9 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -774,7 +774,7 @@ const Map> localizedValues = { 'appointmentDate': {'en': "Appointment Date", 'ar': "تاريخ الموعد"}, 'arrived_p': {'en': "Arrived", 'ar': "وصل"}, 'details': {'en': 'Details', 'ar': 'التفاصيل'}, - "liveCare": {"en": "Live Care", "ar": "لايف كير"}, + "liveCare": {"en": "LiveCare", "ar": "لايف كير"}, "out-patient": {"en": "OutPatient", "ar": "عيادات خارجية"}, "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, "labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"}, diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index 27dd666f..4fc25094 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -53,18 +53,18 @@ class LiveCarePatientServices extends BaseService { hasError = true; super.error = error; - }, body: endCallReq.toJson()); + }, body: endCallReq.toJson(),isLiveCare: true); } Future startCall(StartCallReq startCallReq) async { hasError = false; - await baseAppClient.post(START_LIVECARE_CALL, + await baseAppClient.post(START_LIVE_CARE_CALL, onSuccess: (response, statusCode) async { _startCallRes = StartCallRes.fromJson(response); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: startCallReq.toJson()); + }, body: startCallReq.toJson(),isLiveCare: true); } Future endCallWithCharge(int vcID) async{ hasError = false; @@ -79,7 +79,7 @@ class LiveCarePatientServices extends BaseService { }, body: { "VC_ID": vcID,"generalid":"Cs2020@2016\$2958", - }, + },isLiveCare: true ); } @@ -98,7 +98,7 @@ class LiveCarePatientServices extends BaseService { "VC_ID": vcID, "IsOutKsa": false, "Notes": notes, - }, + },isLiveCare: true ); } } \ No newline at end of file diff --git a/lib/core/viewModel/livecare_view_model.dart b/lib/core/viewModel/livecare_view_model.dart index f6ef42e7..de586e1e 100644 --- a/lib/core/viewModel/livecare_view_model.dart +++ b/lib/core/viewModel/livecare_view_model.dart @@ -66,7 +66,7 @@ class LiveCareViewModel with ChangeNotifier { newRequest.docSpec = profile["DoctorTitleForProfile"]; newRequest.generalid = 'Cs2020@2016\$2958'; isFinished = false; - await baseAppClient.post(START_LIVECARE_CALL, + await baseAppClient.post(START_LIVE_CARE_CALL, onSuccess: (response, statusCode) async { isFinished = true; inCallResponse = StartCallRes.fromJson(response); diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index fc77af66..1fcce8eb 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -5,8 +5,8 @@ class PatiantInformtion { int genderInt; dynamic age; String appointmentDate; - int appointmentNo; - String appointmentType; + dynamic appointmentNo; + dynamic appointmentType; int appointmentTypeId; String arrivedOn; int clinicGroupId; @@ -23,7 +23,7 @@ class PatiantInformtion { String nationality; int projectId; int clinicId; - int patientId; + dynamic patientId; String doctorName; String doctorNameN; String firstName; diff --git a/lib/util/VideoChannel.dart b/lib/util/VideoChannel.dart index bf255b54..a0962010 100644 --- a/lib/util/VideoChannel.dart +++ b/lib/util/VideoChannel.dart @@ -20,7 +20,7 @@ class VideoChannel{ "kSessionId": kSessionId, "kToken": kToken, "appLang": "en", - "baseUrl": BASE_URL, + "baseUrl": BASE_URL_LIVE_CARE,//TODO change it to live "VC_ID": vcId, "TokenID": tokenID, "generalId": generalId, From e068009527534c702e6483feec1e15ad5f01cfcd Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 24 May 2021 17:36:33 +0300 Subject: [PATCH 14/25] prescription form --- lib/config/config.dart | 285 ++---- .../prescription/add_prescription_form.dart | 961 ++++++------------ pubspec.lock | 2 +- 3 files changed, 406 insertions(+), 842 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 86c42f8d..36f4f88d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,304 +5,215 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +//const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; -const PATIENT_PROGRESS_NOTE_URL = - "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; -const PATIENT_INSURANCE_APPROVALS_URL = - "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; -const PATIENT_ORDERS_URL = - "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; -const PATIENT_REFER_TO_DOCTOR_URL = - "Services/DoctorApplication.svc/REST/ReferToDoctor"; -const PATIENT_GET_DOCTOR_BY_CLINIC_URL = - "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; - -const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = - "Services/Doctors.svc/REST/SearchDoctorsByTime"; - -const GET_CLINICS_FOR_DOCTOR = - 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor'; -const PATIENT_GET_LIST_REFERAL_URL = - "Services/Lists.svc/REST/GetList_STPReferralFrequency"; -const PATIENT_GET_CLINIC_BY_PROJECT_URL = - "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; +const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; +const PATIENT_INSURANCE_APPROVALS_URL = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; +const PATIENT_ORDERS_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; +const PATIENT_REFER_TO_DOCTOR_URL = "Services/DoctorApplication.svc/REST/ReferToDoctor"; +const PATIENT_GET_DOCTOR_BY_CLINIC_URL = "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; + +const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = "Services/Doctors.svc/REST/SearchDoctorsByTime"; + +const GET_CLINICS_FOR_DOCTOR = 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor'; +const PATIENT_GET_LIST_REFERAL_URL = "Services/Lists.svc/REST/GetList_STPReferralFrequency"; +const PATIENT_GET_CLINIC_BY_PROJECT_URL = "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo"; const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics"; -const GET_REFERRAL_FACILITIES = - 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; +const GET_REFERRAL_FACILITIES = 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo'; -const GET_PATIENT_VITAL_SIGN = - 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; -const GET_PATIENT_VITAL_SIGN_DATA = - 'Services/DoctorApplication.svc/REST/GetVitalSigns'; -const GET_PATIENT_LAB_OREDERS = - 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; +const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; +const GET_PATIENT_VITAL_SIGN_DATA = 'Services/DoctorApplication.svc/REST/GetVitalSigns'; +const GET_PATIENT_LAB_OREDERS = 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; const GET_PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const GET_RADIOLOGY = 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; -const GET_LIVECARE_PENDINGLIST = - 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; +const GET_LIVECARE_PENDINGLIST = 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; const START_LIVE_CARE_CALL = 'LiveCareApi/DoctorApp/CallPatient'; const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = "Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor"; -const GET_PRESCRIPTION_REPORT = - 'Services/Patients.svc/REST/GetPrescriptionReport'; +const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/GetPrescriptionReport'; -const GT_MY_PATIENT_QUESTION = - 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; +const GT_MY_PATIENT_QUESTION = 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; -const PRM_SEARCH_PATIENT = - 'Services/Patients.svc/REST/GetPatientInformation_PRM'; +const PRM_SEARCH_PATIENT = 'Services/Patients.svc/REST/GetPatientInformation_PRM'; const GET_PATIENT = 'Services/DoctorApplication.svc/REST/'; -const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = - 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; +const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; -const GET_MY_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; +const GET_MY_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; const REFER_TO_DOCTOR = 'Services/DoctorApplication.svc/REST/ReferToDoctor'; -const ADD_REFERRED_DOCTOR_REMARKS = - 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; +const ADD_REFERRED_DOCTOR_REMARKS = 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; -const GET_MY_REFERRED_PATIENT = - 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; +const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; -const GET_PENDING_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/PendingReferrals'; +const GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals'; -const CREATE_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/CreateReferral'; +const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral'; -const RESPONSE_PENDING_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/RespondReferral'; +const RESPONSE_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/RespondReferral'; const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal'; const POST_UCAF = 'Services/DoctorApplication.svc/REST/PostUCAF'; -const GET_DOCTOR_WORKING_HOURS_TABLE = - 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; +const GET_DOCTOR_WORKING_HOURS_TABLE = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; -const GET_PATIENT_LAB_RESULTS = - 'Services/DoctorApplication.svc/REST/GetPatientLabResults'; +const GET_PATIENT_LAB_RESULTS = 'Services/DoctorApplication.svc/REST/GetPatientLabResults'; const LOGIN_URL = 'Services/Sentry.svc/REST/MemberLogIN_New'; -const INSERT_DEVICE_IMEI = - 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'; +const INSERT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'; // 'Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI'; // const SELECT_DEVICE_IMEI = // 'Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI'; -const SELECT_DEVICE_IMEI = - 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI'; +const SELECT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI'; const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; -const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = - 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; +const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; -const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = - 'Services/DoctorApplication.svc/REST/SendVerificationCode'; -const MEMBER_CHECK_ACTIVATION_CODE_NEW = - 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; +const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = 'Services/DoctorApplication.svc/REST/SendVerificationCode'; +const MEMBER_CHECK_ACTIVATION_CODE_NEW = 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; -const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = - 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; +const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; -const GET_DASHBOARD = - 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; -const GET_SICKLEAVE_STATISTIC = - 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; -const ARRIVED_PATIENT_URL = - 'Services/DoctorApplication.svc/REST/PatientArrivalList'; +const GET_DASHBOARD = 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; +const GET_SICKLEAVE_STATISTIC = 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; +const ARRIVED_PATIENT_URL = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; const GET_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; const GET_OFFTIME = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; -const GET_COVERING_DOCTORS = - 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; +const GET_COVERING_DOCTORS = 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition'; -const UPDATE_RESCHDEULE = - 'Services/DoctorApplication.svc/REST/PatchRequisition'; -const GET_RESCHEDULE_LEAVE = - 'Services/DoctorApplication.svc/REST/GetRequisition'; -const GET_PRESCRIPTION_LIST = - 'Services/DoctorApplication.svc/REST/GetPrescription'; - -const POST_PRESCRIPTION_LIST = - 'Services/DoctorApplication.svc/REST/PostPrescription'; -const GET_PROCEDURE_LIST = - 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; +const UPDATE_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PatchRequisition'; +const GET_RESCHEDULE_LEAVE = 'Services/DoctorApplication.svc/REST/GetRequisition'; +const GET_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/GetPrescription'; + +const POST_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/PostPrescription'; +const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; -const GET_PATIENT_ARRIVAL_LIST = - 'Services/DoctorApplication.svc/REST/PatientArrivalList'; +const GET_PATIENT_ARRIVAL_LIST = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; -const GET_PATIENT_IN_PATIENT_LIST = - 'Services/DoctorApplication.svc/REST/GetMyInPatient'; +const GET_PATIENT_IN_PATIENT_LIST = 'Services/DoctorApplication.svc/REST/GetMyInPatient'; -const Verify_Referral_Doctor_Remarks = - 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; +const Verify_Referral_Doctor_Remarks = 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; -const GET_Patient_LAB_SPECIAL_RESULT = - 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -const SEND_LAB_RESULT_EMAIL = - 'Services/Notifications.svc/REST/SendLabReportEmail'; -const GET_Patient_LAB_RESULT = - 'Services/Patients.svc/REST/GetPatientLabResults'; -const GET_Patient_LAB_ORDERS_RESULT = - 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; +const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; +const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; // SOAP const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; -const GET_MASTER_LOOKUP_LIST = - 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; +const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode'; const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; -const POST_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; -const POST_PHYSICAL_EXAM = - 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; -const POST_PROGRESS_NOTE = - '/Services/DoctorApplication.svc/REST/PostProgressNote'; +const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; +const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; +const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote'; const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment'; const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies'; const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory'; -const PATCH_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; +const PATCH_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; -const PATCH_PHYSICAL_EXAM = - 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; -const PATCH_PROGRESS_NOTE = - 'Services/DoctorApplication.svc/REST/PatchProgressNote'; +const PATCH_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; +const PATCH_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PatchProgressNote'; const PATCH_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PatchAssessment'; const GET_ALLERGY = 'Services/DoctorApplication.svc/REST/GetAllergies'; const GET_HISTORY = 'Services/DoctorApplication.svc/REST/GetHistory'; -const GET_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; +const GET_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote'; const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment'; -const GET_ORDER_PROCEDURE = - 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; +const GET_ORDER_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; -const GET_LIST_CATEGORISE = - 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; +const GET_LIST_CATEGORISE = 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; -const GET_CATEGORISE_PROCEDURE = - 'Services/DoctorApplication.svc/REST/GetProcedure'; +const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure'; const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure'; -const UPDATE_PRESCRIPTION = - 'Services/DoctorApplication.svc/REST/PatchPrescription'; +const UPDATE_PRESCRIPTION = 'Services/DoctorApplication.svc/REST/PatchPrescription'; const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList'; -const DRUG_TO_DRUG = - 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; +const DRUG_TO_DRUG = 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors'; const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards'; -const GET_ROOM_CATEGORIES = - 'Services/DoctorApplication.svc/REST/GetRoomCategories'; -const GET_DIAGNOSIS_TYPES = - 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; +const GET_ROOM_CATEGORIES = 'Services/DoctorApplication.svc/REST/GetRoomCategories'; +const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes'; const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes'; -const POST_ADMISSION_REQUEST = - 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; -const GET_ITEM_BY_MEDICINE = - 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; +const POST_ADMISSION_REQUEST = 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; +const GET_ITEM_BY_MEDICINE = 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; -const GET_PROCEDURE_VALIDATION = - 'Services/DoctorApplication.svc/REST/ValidateProcedures'; -const GET_BOX_QUANTITY = - 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; +const GET_PROCEDURE_VALIDATION = 'Services/DoctorApplication.svc/REST/ValidateProcedures'; +const GET_BOX_QUANTITY = 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; ///GET ECG const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; -const GET_MY_REFERRAL_INPATIENT = - "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; +const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; -const GET_MY_DISCHARGE_PATIENT = - "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; -const GET_DISCHARGE_PATIENT = - "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; +const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; +const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; -const GET_PAtIENTS_INSURANCE_APPROVALS = - "Services/Patients.svc/REST/GetApprovalStatus"; +const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; -const GET_IN_PATIENT_ORDERS = - 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; +const GET_IN_PATIENT_ORDERS = 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; ///Prescriptions const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; -const GET_PRESCRIPTIONS_ALL_ORDERS = - 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const GET_PRESCRIPTION_REPORT_NEW = - 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; -const SEND_PRESCRIPTION_EMAIL = - 'Services/Notifications.svc/REST/SendPrescriptionEmail'; -const GET_PRESCRIPTION_REPORT_ENH = - 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; +const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PRESCRIPTION_REPORT_NEW = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; +const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; +const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; -const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = - "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; -const CREATE_PROGRESS_NOTE_FOR_INPATIENT = - "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; +const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; +const CREATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; -const GET_PRESCRIPTION_IN_PATIENT = - 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; +const GET_PRESCRIPTION_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; -const GET_INSURANCE_IN_PATIENT = - "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; +const GET_INSURANCE_IN_PATIENT = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave"; -const GET_MY_OUT_PATIENT = - "Services/DoctorApplication.svc/REST/GetMyOutPatient"; - -const PATIENT_MEDICAL_REPORT_GET_LIST = - "Services/Patients.svc/REST/DAPP_ListMedicalReport"; -const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = - "Services/Patients.svc/REST/DAPP_GetTemplateByID"; -const PATIENT_MEDICAL_REPORT_INSERT = - "Services/Patients.svc/REST/DAPP_InsertMedicalReport"; -const PATIENT_MEDICAL_REPORT_VERIFIED = - "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport"; - -const GET_PROCEDURE_TEMPLETE = - 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet'; - -const GET_PROCEDURE_TEMPLETE_DETAILS = - "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; -const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = - 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp'; - -const DOCTOR_CHECK_HAS_LIVE_CARE = - "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare"; +const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient"; + +const PATIENT_MEDICAL_REPORT_GET_LIST = "Services/Patients.svc/REST/DAPP_ListMedicalReport"; +const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = "Services/Patients.svc/REST/DAPP_GetTemplateByID"; +const PATIENT_MEDICAL_REPORT_INSERT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport"; +const PATIENT_MEDICAL_REPORT_VERIFIED = "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport"; + +const GET_PROCEDURE_TEMPLETE = 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet'; + +const GET_PROCEDURE_TEMPLETE_DETAILS = "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; +const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp'; + +const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare"; var selectedPatientType = 1; diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index fc4609f3..d03e8f13 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -36,8 +36,7 @@ import 'package:provider/provider.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; -addPrescriptionForm(context, PrescriptionViewModel model, - PatiantInformtion patient, prescription) { +addPrescriptionForm(context, PrescriptionViewModel model, PatiantInformtion patient, prescription) { showModalBottomSheet( isScrollControlled: true, context: context, @@ -62,8 +61,7 @@ postProcedure( String icdCode, PatiantInformtion patient, String patientType}) async { - PostPrescriptionReqModel postProcedureReqModel = - new PostPrescriptionReqModel(); + PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); List sss = List(); postProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -131,8 +129,7 @@ class _PrescriptionFormWidgetState extends State { dynamic selectedDrug; int strengthChar; GetMedicationResponseModel _selectedMedication; - GlobalKey key = - new GlobalKey>(); + GlobalKey key = new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); @@ -177,10 +174,7 @@ class _PrescriptionFormWidgetState extends State { dynamic indication3 = {"id": 547, "name": "Hypertrichosis"}; dynamic indication4 = {"id": 548, "name": "Mild Dizziness"}; dynamic indication5 = {"id": 549, "name": "Enlargement of Facial Features"}; - dynamic indication6 = { - "id": 550, - "name": "Phenytoin Hypersensitivity Syndrome" - }; + dynamic indication6 = {"id": 550, "name": "Phenytoin Hypersensitivity Syndrome"}; dynamic indication7 = {"id": 551, "name": "Asterixis"}; dynamic indication8 = {"id": 552, "name": "Bullous Dermatitis"}; dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"}; @@ -207,8 +201,7 @@ class _PrescriptionFormWidgetState extends State { onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speech.initialize( - onStatus: statusListener, onError: errorListener); + bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); if (available) { speech.listen( onResult: resultListener, @@ -252,8 +245,7 @@ class _PrescriptionFormWidgetState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } @@ -310,15 +302,13 @@ class _PrescriptionFormWidgetState extends State { initialChildSize: 0.98, maxChildSize: 0.98, minChildSize: 0.9, - builder: - (BuildContext context, ScrollController scrollController) { + builder: (BuildContext context, ScrollController scrollController) { return SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 1.65, color: Color(0xffF8F8F8), child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 12.0, vertical: 10.0), + padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), child: Column( //crossAxisAlignment: CrossAxisAlignment.start, //mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -329,12 +319,10 @@ class _PrescriptionFormWidgetState extends State { height: 15, ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - TranslationBase.of(context) - .newPrescriptionOrder, + TranslationBase.of(context).newPrescriptionOrder, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -364,11 +352,8 @@ class _PrescriptionFormWidgetState extends State { widthFactor: 0.9, child: Container( decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(10), child: AppTextFormField( onTap: () { @@ -376,8 +361,7 @@ class _PrescriptionFormWidgetState extends State { visbiltySearch = true; }, borderColor: Colors.white, - hintText: TranslationBase.of(context) - .searchMedicineNameHere, + hintText: TranslationBase.of(context).searchMedicineNameHere, controller: myController, onSaved: (value) {}, onFieldSubmitted: (value) { @@ -403,12 +387,9 @@ class _PrescriptionFormWidgetState extends State { children: [ // TODO change it secondary button and add loading AppButton( - title: TranslationBase.of( - context) - .search, + title: TranslationBase.of(context).search, onPressed: () async { - await searchMedicine( - context, model); + await searchMedicine(context, model); }, ), ], @@ -417,50 +398,29 @@ class _PrescriptionFormWidgetState extends State { ), if (myController.text != '') Container( - height: MediaQuery.of(context) - .size - .height * - 0.5, + height: MediaQuery.of(context).size.height * 0.5, child: ListView.builder( - padding: const EdgeInsets.only( - top: 20), + padding: const EdgeInsets.only(top: 20), scrollDirection: Axis.vertical, // shrinkWrap: true, - itemCount: - model.allMedicationList == - null - ? 0 - : model - .allMedicationList - .length, - itemBuilder: - (BuildContext context, - int index) { + itemCount: model.allMedicationList == null + ? 0 + : model.allMedicationList.length, + itemBuilder: (BuildContext context, int index) { return InkWell( child: MedicineItemWidget( - label: model - .allMedicationList[ - index] - .description + label: model.allMedicationList[index].description // url: model // .pharmacyItemsList[ // index]["ImageSRCUrl"], ), onTap: () { - model.getItem( - itemID: model - .allMedicationList[ - index] - .itemId); - visbiltyPrescriptionForm = - true; + model.getItem(itemID: model.allMedicationList[index].itemId); + visbiltyPrescriptionForm = true; visbiltySearch = false; - _selectedMedication = - model.allMedicationList[ - index]; - uom = _selectedMedication - .uom; + _selectedMedication = model.allMedicationList[index]; + uom = _selectedMedication.uom; }, ); }, @@ -479,21 +439,18 @@ class _PrescriptionFormWidgetState extends State { child: Column( children: [ AppText( - _selectedMedication?.description ?? - "", + _selectedMedication?.description ?? "", bold: true, ), Container( child: Row( children: [ AppText( - TranslationBase.of(context) - .orderType, + TranslationBase.of(context).orderType, fontWeight: FontWeight.w600, ), Radio( - activeColor: - Color(0xFFB9382C), + activeColor: Color(0xFFB9382C), value: 1, groupValue: selectedType, onChanged: (value) { @@ -504,43 +461,32 @@ class _PrescriptionFormWidgetState extends State { ], ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( width: double.infinity, child: Row( children: [ Container( color: Colors.white, - width: MediaQuery.of(context) - .size - .width * - 0.35, + width: MediaQuery.of(context).size.width * 0.35, child: AppTextFieldCustom( height: 40, - validationError: - strengthError, - hintText: 'Strength', + validationError: strengthError, + hintText: 'Strength' + "*", isTextFieldHasSuffix: false, enabled: true, - controller: - strengthController, + controller: strengthController, onChanged: (String value) { setState(() { - strengthChar = - value.length; + strengthChar = value.length; }); if (strengthChar >= 5) { - DrAppToastMsg - .showErrorToast( - TranslationBase.of( - context) - .only5DigitsAllowedForStrength, + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).only5DigitsAllowedForStrength, ); } }, - inputType: TextInputType - .numberWithOptions( + inputType: TextInputType.numberWithOptions( decimal: true, ), // keyboardType: TextInputType @@ -554,133 +500,80 @@ class _PrescriptionFormWidgetState extends State { ), Container( color: Colors.white, - width: MediaQuery.of(context) - .size - .width * - 0.560, + width: MediaQuery.of(context).size.width * 0.560, child: InkWell( - onTap: - model.itemMedicineListUnit != - null - ? () { - Helpers - .hideKeyboard( - context); - ListSelectDialog - dialog = - ListSelectDialog( - list: model - .itemMedicineListUnit, - attributeName: - 'description', - attributeValueId: - 'parameterCode', - okText: TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState( - () { - units = - selectedValue; - units['isDefault'] = - true; - }); - }, - ); - showDialog( - barrierDismissible: - false, - context: - context, - builder: - (BuildContext - context) { - return dialog; - }, - ); - } - : null, + onTap: model.itemMedicineListUnit != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.itemMedicineListUnit, + attributeName: 'description', + attributeValueId: 'parameterCode', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + units = selectedValue; + units['isDefault'] = true; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, child: AppTextFieldCustom( hintText: 'Select', - isTextFieldHasSuffix: - true, - dropDownText: model - .itemMedicineListUnit - .length == - 1 - ? units = model - .itemMedicineListUnit[0] - ['description'] + isTextFieldHasSuffix: true, + dropDownText: model.itemMedicineListUnit.length == 1 + ? units = model.itemMedicineListUnit[0]['description'] : units != null - ? units['description'] - .toString() + ? units['description'].toString() : null, validationError: - model.itemMedicineListUnit - .length != - 1 - ? unitError - : null, + model.itemMedicineListUnit.length != 1 ? unitError : null, enabled: false), ), ), ], ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( //height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: - model.itemMedicineListRoute != - null - ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog - dialog = - ListSelectDialog( - list: model - .itemMedicineListRoute, - attributeName: - 'description', - attributeValueId: - 'parameterCode', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - route = - selectedValue; - route['isDefault'] = - true; - }); - if (route == - null) { - Helpers.showErrorToast( - 'plase fill'); - } - }, - ); - showDialog( - barrierDismissible: - false, - context: context, - builder: - (BuildContext - context) { - return dialog; - }, - ); - } - : null, + onTap: model.itemMedicineListRoute != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.itemMedicineListRoute, + attributeName: 'description', + attributeValueId: 'parameterCode', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + route = selectedValue; + route['isDefault'] = true; + }); + if (route == null) { + Helpers.showErrorToast('plase fill'); + } + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, child: AppTextFieldCustom( // decoration: // textFieldSelectorDecoration( @@ -698,179 +591,108 @@ class _PrescriptionFormWidgetState extends State { // 'description'] // : null, // true), - hintText: - TranslationBase.of(context) - .route, - dropDownText: model - .itemMedicineListRoute - .length == - 1 - ? model.itemMedicineListRoute[ - 0]['description'] + hintText: TranslationBase.of(context).route + "*", + dropDownText: model.itemMedicineListRoute.length == 1 + ? model.itemMedicineListRoute[0]['description'] : route != null ? route['description'] : null, isTextFieldHasSuffix: true, //height: 45, validationError: - model.itemMedicineListRoute - .length != - 1 - ? routeError - : null, + model.itemMedicineListRoute.length != 1 ? routeError : null, enabled: false, ), ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( //height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: - model.itemMedicineList != null - ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog - dialog = - ListSelectDialog( - list: model - .itemMedicineList, - attributeName: - 'description', - attributeValueId: - 'parameterCode', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - frequency = - selectedValue; - frequency[ - 'isDefault'] = - true; - if (_selectedMedication != null && - duration != - null && - frequency != - null && - strengthController - .text != - null) { - model.getBoxQuantity( - freq: frequency[ - 'parameterCode'], - duration: - duration[ - 'id'], - itemCode: - _selectedMedication - .itemId, - strength: - double.parse( - strengthController.text)); + onTap: model.itemMedicineList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.itemMedicineList, + attributeName: 'description', + attributeValueId: 'parameterCode', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + frequency = selectedValue; + frequency['isDefault'] = true; + if (_selectedMedication != null && + duration != null && + frequency != null && + strengthController.text != null) { + model.getBoxQuantity( + freq: frequency['parameterCode'], + duration: duration['id'], + itemCode: _selectedMedication.itemId, + strength: double.parse(strengthController.text)); - return; - } - }); - }, - ); - showDialog( - barrierDismissible: - false, - context: context, - builder: - (BuildContext - context) { - return dialog; - }, - ); - } - : null, + return; + } + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, child: AppTextFieldCustom( isTextFieldHasSuffix: true, - hintText: - TranslationBase.of(context) - .frequency, - dropDownText: model - .itemMedicineList - .length == - 1 - ? model.itemMedicineList[0] - ['description'] + hintText: TranslationBase.of(context).frequency + "*", + dropDownText: model.itemMedicineList.length == 1 + ? model.itemMedicineList[0]['description'] : frequency != null - ? frequency[ - 'description'] + ? frequency['description'] : null, - validationError: model - .itemMedicineList - .length != - 1 - ? frequencyError - : null, + validationError: + model.itemMedicineList.length != 1 ? frequencyError : null, enabled: false, ), ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( //height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: - model.medicationDoseTimeList != - null - ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog - dialog = - ListSelectDialog( - list: model - .medicationDoseTimeList, - attributeName: - 'nameEn', - attributeValueId: - 'id', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - doseTime = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: - false, - context: context, - builder: - (BuildContext - context) { - return dialog; - }, - ); - } - : null, + onTap: model.medicationDoseTimeList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.medicationDoseTimeList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + doseTime = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, child: AppTextFieldCustom( - hintText: - TranslationBase.of(context) - .doseTime, + hintText: TranslationBase.of(context).doseTime + "*", isTextFieldHasSuffix: true, - dropDownText: doseTime != null - ? doseTime['nameEn'] - : null, + dropDownText: doseTime != null ? doseTime['nameEn'] : null, //height: 45, enabled: false, @@ -878,10 +700,8 @@ class _PrescriptionFormWidgetState extends State { ), ), ), - SizedBox( - height: spaceBetweenTextFileds), - if (model - .patientAssessmentList.isNotEmpty) + SizedBox(height: spaceBetweenTextFileds), + if (model.patientAssessmentList.isNotEmpty) Container( height: screenSize.height * 0.070, width: double.infinity, @@ -889,68 +709,38 @@ class _PrescriptionFormWidgetState extends State { child: Row( children: [ Container( - width: - MediaQuery.of(context) - .size - .width * - 0.29, + width: MediaQuery.of(context).size.width * 0.29, child: InkWell( - onTap: - indicationList != null - ? () { - Helpers.hideKeyboard( - context); - } - : null, + onTap: indicationList != null + ? () { + Helpers.hideKeyboard(context); + } + : null, child: TextField( - decoration: - textFieldSelectorDecoration( - model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString(), - indication != - null - ? indication[ - 'name'] - : null, - false), + decoration: textFieldSelectorDecoration( + model.patientAssessmentList[0].icdCode10ID.toString(), + indication != null ? indication['name'] : null, + false), enabled: true, readOnly: true, ), ), ), Container( - width: - MediaQuery.of(context) - .size - .width * - 0.65, + width: MediaQuery.of(context).size.width * 0.65, color: Colors.white, child: InkWell( - onTap: - indicationList != null - ? () { - Helpers.hideKeyboard( - context); - } - : null, + onTap: indicationList != null + ? () { + Helpers.hideKeyboard(context); + } + : null, child: TextField( maxLines: 5, - decoration: - textFieldSelectorDecoration( - model - .patientAssessmentList[ - 0] - .asciiDesc - .toString(), - indication != - null - ? indication[ - 'name'] - : null, - false), + decoration: textFieldSelectorDecoration( + model.patientAssessmentList[0].asciiDesc.toString(), + indication != null ? indication['name'] : null, + false), enabled: true, readOnly: true, ), @@ -959,152 +749,101 @@ class _PrescriptionFormWidgetState extends State { ], ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: () => selectDate( - context, widget.model), + onTap: () => selectDate(context, widget.model), child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of( - context) - .date, - selectedDate != null - ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).date + "*", + selectedDate != null + ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), enabled: false, ), ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( //height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: - model.medicationDurationList != - null - ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog - dialog = - ListSelectDialog( - list: model - .medicationDurationList, - attributeName: - 'nameEn', - attributeValueId: - 'id', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - duration = - selectedValue; - if (_selectedMedication != null && - duration != - null && - frequency != - null && - strengthController - .text != - null) { - model - .getBoxQuantity( - freq: frequency[ - 'parameterCode'], - duration: - duration[ - 'id'], - itemCode: - _selectedMedication - .itemId, - strength: double.parse( - strengthController - .text), - ); - box = model - .boxQuintity; + onTap: model.medicationDurationList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.medicationDurationList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + duration = selectedValue; + if (_selectedMedication != null && + duration != null && + frequency != null && + strengthController.text != null) { + model.getBoxQuantity( + freq: frequency['parameterCode'], + duration: duration['id'], + itemCode: _selectedMedication.itemId, + strength: double.parse(strengthController.text), + ); + box = model.boxQuintity; - return; - } - }); - }, - ); - showDialog( - barrierDismissible: - false, - context: context, - builder: - (BuildContext - context) { - return dialog; - }, - ); - } - : null, + return; + } + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, child: AppTextFieldCustom( validationError: durationError, isTextFieldHasSuffix: true, - dropDownText: duration != null - ? duration['nameEn'] - : null, - hintText: - TranslationBase.of(context) - .duration, + dropDownText: duration != null ? duration['nameEn'] : null, + hintText: TranslationBase.of(context).duration + "*", enabled: false, ), ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: model.allMedicationList != - null + onTap: model.allMedicationList != null ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .allMedicationList, + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.allMedicationList, attributeName: 'nameEn', attributeValueId: 'id', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { setState(() { - duration = - selectedValue; + duration = selectedValue; }); }, ); showDialog( - barrierDismissible: - false, + barrierDismissible: false, context: context, - builder: (BuildContext - context) { + builder: (BuildContext context) { return dialog; }, ); @@ -1112,103 +851,70 @@ class _PrescriptionFormWidgetState extends State { : null, child: TextField( decoration: - textFieldSelectorDecoration( - "UOM", - uom != null - ? uom - : null, - false), + textFieldSelectorDecoration("UOM", uom != null ? uom : null, false), //enabled: false, readOnly: true, ), ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: model.allMedicationList != - null + onTap: model.allMedicationList != null ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .allMedicationList, + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.allMedicationList, attributeName: 'nameEn', attributeValueId: 'id', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { setState(() { - duration = - selectedValue; + duration = selectedValue; }); }, ); showDialog( - barrierDismissible: - false, + barrierDismissible: false, context: context, - builder: (BuildContext - context) { + builder: (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of( - context) - .boxQuantity, - box != null - ? TranslationBase.of( - context) - .boxQuantity + - ": " + - model - .boxQuintity - .toString() - : null, - false), + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).boxQuantity, + box != null + ? TranslationBase.of(context).boxQuantity + + ": " + + model.boxQuintity.toString() + : null, + false), //enabled: false, readOnly: true, ), ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), child: Stack( children: [ TextFields( maxLines: 6, minLines: 4, - hintText: TranslationBase.of( - context) - .instruction, - controller: - instructionController, + hintText: TranslationBase.of(context).instruction, + controller: instructionController, //keyboardType: TextInputType.number, ), Positioned( - top: - 0, //MediaQuery.of(context).size.height * 0, + top: 0, //MediaQuery.of(context).size.height * 0, right: 15, child: IconButton( icon: Icon( @@ -1217,28 +923,22 @@ class _PrescriptionFormWidgetState extends State { size: 35, ), onPressed: () { - initSpeechState().then( - (value) => - {onVoiceText()}); + initSpeechState().then((value) => {onVoiceText()}); }, ), ), ], ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Wrap( alignment: WrapAlignment.center, children: [ AppButton( color: Color(0xff359846), - title: TranslationBase.of( - context) - .addMedication, + title: TranslationBase.of(context).addMedication, fontWeight: FontWeight.w600, onPressed: () async { if (route != null && @@ -1247,41 +947,25 @@ class _PrescriptionFormWidgetState extends State { frequency != null && units != null && selectedDate != null && - strengthController - .text != - "") { - if (_selectedMedication - .isNarcotic == - true) { - DrAppToastMsg.showErrorToast( - TranslationBase.of( - context) - .narcoticMedicineCanOnlyBePrescribedFromVida); + strengthController.text != "") { + if (_selectedMedication.isNarcotic == true) { + DrAppToastMsg.showErrorToast(TranslationBase.of(context) + .narcoticMedicineCanOnlyBePrescribedFromVida); Navigator.pop(context); return; } - if (double.parse( - strengthController - .text) > - 1000.0) { - DrAppToastMsg - .showErrorToast( - "1000 is the MAX for the strength"); + if (double.parse(strengthController.text) > 1000.0) { + DrAppToastMsg.showErrorToast( + "1000 is the MAX for the strength"); return; } - if (double.parse( - strengthController - .text) < - 0.0) { - DrAppToastMsg - .showErrorToast( - "strength can't be zero"); + if (double.parse(strengthController.text) < 0.0) { + DrAppToastMsg.showErrorToast("strength can't be zero"); return; } - if (formKey.currentState - .validate()) { + if (formKey.currentState.validate()) { Navigator.pop(context); openDrugToDrug(model); { @@ -1370,52 +1054,32 @@ class _PrescriptionFormWidgetState extends State { } else { setState(() { if (duration == null) { - durationError = - TranslationBase.of( - context) - .fieldRequired; + durationError = TranslationBase.of(context).fieldRequired; } else { durationError = null; } if (doseTime == null) { - doseTimeError = - TranslationBase.of( - context) - .fieldRequired; + doseTimeError = TranslationBase.of(context).fieldRequired; } else { doseTimeError = null; } if (route == null) { - routeError = - TranslationBase.of( - context) - .fieldRequired; + routeError = TranslationBase.of(context).fieldRequired; } else { routeError = null; } if (frequency == null) { - frequencyError = - TranslationBase.of( - context) - .fieldRequired; + frequencyError = TranslationBase.of(context).fieldRequired; } else { frequencyError = null; } if (units == null) { - unitError = - TranslationBase.of( - context) - .fieldRequired; + unitError = TranslationBase.of(context).fieldRequired; } else { unitError = null; } - if (strengthController - .text == - "") { - strengthError = - TranslationBase.of( - context) - .fieldRequired; + if (strengthController.text == "") { + strengthError = TranslationBase.of(context).fieldRequired; } else { strengthError = null; } @@ -1489,8 +1153,7 @@ class _PrescriptionFormWidgetState extends State { } } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( @@ -1530,8 +1193,7 @@ class _PrescriptionFormWidgetState extends State { ); } - InputDecoration textFieldSelectorDecorationStreangrh( - String hintText, String selectedText, bool isDropDown, + InputDecoration textFieldSelectorDecorationStreangrh(String hintText, String selectedText, bool isDropDown, {Icon suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( @@ -1561,8 +1223,7 @@ class _PrescriptionFormWidgetState extends State { fontWeight: FontWeight.w600, ), hintText: selectedText == null || selectedText == "" ? hintText : null, - labelText: - selectedText != null && selectedText != "" ? '\n$selectedText' : null, + labelText: selectedText != null && selectedText != "" ? '\n$selectedText' : null, labelStyle: TextStyle( fontSize: 15, color: Color(0xff2E303A), @@ -1583,9 +1244,7 @@ class _PrescriptionFormWidgetState extends State { child: Column( // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - DrugToDrug( - widget.patient, - getPriscriptionforDrug(widget.prescriptionList, model), + DrugToDrug(widget.patient, getPriscriptionforDrug(widget.prescriptionList, model), model.patientAssessmentList), Container( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3), @@ -1596,11 +1255,9 @@ class _PrescriptionFormWidgetState extends State { postProcedure( icdCode: model.patientAssessmentList.isNotEmpty - ? model.patientAssessmentList[0].icdCode10ID - .isEmpty + ? model.patientAssessmentList[0].icdCode10ID.isEmpty ? "test" - : model.patientAssessmentList[0].icdCode10ID - .toString() + : model.patientAssessmentList[0].icdCode10ID.toString() : "test", // icdCode: model // .patientAssessmentList @@ -1611,20 +1268,17 @@ class _PrescriptionFormWidgetState extends State { // .join(' '), dose: strengthController.text, doseUnit: model.itemMedicineListUnit.length == 1 - ? model.itemMedicineListUnit[0]['parameterCode'] - .toString() + ? model.itemMedicineListUnit[0]['parameterCode'].toString() : units['parameterCode'].toString(), patient: widget.patient, doseTimeIn: doseTime['id'].toString(), model: widget.model, duration: duration['id'].toString(), frequency: model.itemMedicineList.length == 1 - ? model.itemMedicineList[0]['parameterCode'] - .toString() + ? model.itemMedicineList[0]['parameterCode'].toString() : frequency['parameterCode'].toString(), route: model.itemMedicineListRoute.length == 1 - ? model.itemMedicineListRoute[0]['parameterCode'] - .toString() + ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), drugId: _selectedMedication.itemId.toString(), strength: strengthController.text, @@ -1682,8 +1336,7 @@ class _PrescriptionFormWidgetState extends State { // // return selected; // // } - getPriscriptionforDrug( - List prescriptionList, MedicineViewModel model) { + getPriscriptionforDrug(List prescriptionList, MedicineViewModel model) { var prescriptionDetails = []; if (prescriptionList.length > 0) { prescriptionList[0].entityList.forEach((element) { diff --git a/pubspec.lock b/pubspec.lock index ad16d0c2..613c2753 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -587,7 +587,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: From 280f87e51487ca19b4bf0a3d9ce3b3795bc5eed3 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 24 May 2021 17:45:44 +0300 Subject: [PATCH 15/25] fix live care issues --- lib/core/viewModel/authentication_view_model.dart | 1 + lib/models/patient/patiant_info_model.dart | 2 +- lib/screens/live_care/live_care_patient_screen.dart | 2 +- .../patients/profile/vital_sign/vital_sign_details_screen.dart | 2 +- .../patient_profile_header_with_appointment_card_app_bar.dart | 2 +- lib/widgets/shared/app_drawer_widget.dart | 1 + 6 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index a6e9eaeb..4e8217d3 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -423,6 +423,7 @@ class AuthenticationViewModel extends BaseViewModel { deleteUser(); await getDeviceInfoFromFirebase(); this.isFromLogin = isFromLogin; + app_status = APP_STATUS.UNAUTHENTICATED; setState(ViewState.Idle); Navigator.pushAndRemoveUntil( AppGlobal.CONTEX, diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 1fcce8eb..61fb4a2f 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -154,7 +154,7 @@ class PatiantInformtion { patientIdentificationNo: json["PatientIdentificationNo"] ?? json["patientIdentificationNo"], //TODO make 7 dynamic when the backend retrun it in patient arrival - patientType: json["PatientType"] ?? json["patientType"]??7, + patientType: json["PatientType"] ?? json["patientType"]??1, admissionNo: json["AdmissionNo"] ?? json["admissionNo"], admissionDate: json["AdmissionDate"] ?? json["admissionDate"], createdOn: json["CreatedOn"] ?? json["CreatedOn"], diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index 132cc214..abe8cf58 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -143,7 +143,7 @@ class _LiveCarePatientScreenState extends State { "isInpatient": false, "arrivalType": "0", "isSearchAndOut": false, - "isFromLiveCare":true + "isFromLiveCare":true, }); }, // isFromSearch: widget.isSearch, diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 4f3deeb3..33f9a1cb 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -57,7 +57,7 @@ class VitalSignDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient.patientDetails.firstName}'s", + "${patient.firstName ?? patient.patientDetails?.firstName??''}'s", fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart index 9093566b..5d46e745 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -84,7 +84,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget ? (Helpers.capitalize(patient.firstName) + " " + Helpers.capitalize(patient.lastName)) - : Helpers.capitalize(patient.patientDetails.fullName), + : Helpers.capitalize(patient.fullName??patient?.patientDetails?.fullName??""), fontSize: SizeConfig.textMultiplier * 2.2, fontWeight: FontWeight.bold, fontFamily: 'Poppins', diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 64791b26..8f8c0108 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -175,6 +175,7 @@ class _AppDrawerState extends State { Navigator.pop(context); GifLoaderDialogUtils.showMyDialog(context); await authenticationViewModel.logout(isFromLogin: false); + // GifLoaderDialogUtils.showMyDialog(context); }, ), ], From 6620c79478270252333094d5f92515ac5864a263 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 26 May 2021 10:33:21 +0300 Subject: [PATCH 16/25] fix ui issues --- lib/config/config.dart | 4 +-- .../procedure_template_details_model.dart | 25 +++++++++++++++++++ lib/core/viewModel/procedure_View_model.dart | 2 +- lib/screens/procedures/add_lab_orders.dart | 5 ++-- lib/screens/procedures/procedure_screen.dart | 2 +- 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 36f4f88d..08dd8562 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -//const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; diff --git a/lib/core/model/procedure/procedure_template_details_model.dart b/lib/core/model/procedure/procedure_template_details_model.dart index 42a2517a..c566a539 100644 --- a/lib/core/model/procedure/procedure_template_details_model.dart +++ b/lib/core/model/procedure/procedure_template_details_model.dart @@ -4,6 +4,7 @@ class ProcedureTempleteDetailsModel { int clinicID; int doctorID; int templateID; + String templateName; String procedureID; bool isActive; int createdBy; @@ -16,6 +17,9 @@ class ProcedureTempleteDetailsModel { String aliasN; String categoryID; String subGroupID; + String categoryDescription; + String categoryDescriptionN; + String categoryAlias; dynamic riskCategoryID; String type = "1"; String remarks; @@ -40,6 +44,10 @@ class ProcedureTempleteDetailsModel { this.categoryID, this.subGroupID, this.riskCategoryID, + this.templateName, + this.categoryDescription, + this.categoryDescriptionN, + this.categoryAlias, this.remarks, this.type = "1", this.selectedType = 0}); @@ -63,6 +71,10 @@ class ProcedureTempleteDetailsModel { categoryID = json['CategoryID']; subGroupID = json['SubGroupID']; riskCategoryID = json['RiskCategoryID']; + templateName = json['TemplateName']; + categoryDescription = json['CategoryDescription']; + categoryDescriptionN = json['CategoryDescriptionN']; + categoryAlias = json['CategoryAlias']; } Map toJson() { @@ -85,6 +97,19 @@ class ProcedureTempleteDetailsModel { data['CategoryID'] = this.categoryID; data['SubGroupID'] = this.subGroupID; data['RiskCategoryID'] = this.riskCategoryID; + data['TemplateName'] = this.templateName; + data['CategoryDescription'] = this.categoryDescription; + data['CategoryDescriptionN'] = this.categoryDescriptionN; + data['CategoryAlias'] = this.categoryAlias; return data; } } +class ProcedureTempleteDetailsModelList { + List procedureTemplate; + String templateName; + + ProcedureTempleteDetailsModelList( + {this.templateName, ProcedureTempleteDetailsModel template}) { + procedureTemplate.add(template); + } +} diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 4411f7b5..29b4b0e4 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -61,7 +61,7 @@ class ProcedureViewModel extends BaseViewModel { Future getProcedure({int mrn, String patientType}) async { hasError = false; await getDoctorProfile(); - doctorProfile.doctorID; + //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _procedureService.getProcedure(mrn: mrn); diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart index 4a20dbaa..cd3205df 100644 --- a/lib/screens/procedures/add_lab_orders.dart +++ b/lib/screens/procedures/add_lab_orders.dart @@ -159,15 +159,14 @@ class _AddSelectedLabOrderState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( TranslationBase.of(context).applyForNewLabOrder, fontWeight: FontWeight.w700, fontSize: 20, ), - SizedBox( - width: MediaQuery.of(context).size.width * 0.48, - ), + InkWell( child: Icon( Icons.close, diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index b6bd705a..f6752c4a 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -189,7 +189,7 @@ class ProcedureScreen extends StatelessWidget { // 'You Cant Update This Procedure'); }, patient: patient, - doctorID: model.doctorProfile.doctorID, + doctorID: model?.doctorProfile?.doctorID, ), ), if (model.state == ViewState.ErrorLocal || From f75ac64cad8c4468b8ce4fdfc5ae70a044bf2743 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 26 May 2021 14:47:27 +0300 Subject: [PATCH 17/25] procedure get template --- lib/client/base_app_client.dart | 4 ++- lib/config/config.dart | 2 ++ .../procedure_template_details_model.dart | 5 +-- .../procedure/procedure_service.dart | 17 +++++---- lib/core/viewModel/procedure_View_model.dart | 36 +++++++++++++++++-- .../procedures/add-favourite-procedure.dart | 8 +++-- 6 files changed, 57 insertions(+), 15 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 824b8189..b4e5f810 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -52,7 +52,9 @@ class BaseAppClient { if (body['EditedBy'] == '') { body.remove("EditedBy"); } - body['TokenID'] = token ?? ''; + if(body['TokenID'] == null){ + body['TokenID'] = token ?? ''; + } // body['TokenID'] = "@dm!n" ?? ''; String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') diff --git a/lib/config/config.dart b/lib/config/config.dart index 08dd8562..c8af8ad9 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -210,6 +210,8 @@ const PATIENT_MEDICAL_REPORT_VERIFIED = "Services/Patients.svc/REST/DAPP_Verifie const GET_PROCEDURE_TEMPLETE = 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet'; +const GET_TEMPLETE_LIST = 'Services/Doctors.svc/REST/DAPP_TemplateGet'; + const GET_PROCEDURE_TEMPLETE_DETAILS = "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp'; diff --git a/lib/core/model/procedure/procedure_template_details_model.dart b/lib/core/model/procedure/procedure_template_details_model.dart index c566a539..1fc797ae 100644 --- a/lib/core/model/procedure/procedure_template_details_model.dart +++ b/lib/core/model/procedure/procedure_template_details_model.dart @@ -105,11 +105,12 @@ class ProcedureTempleteDetailsModel { } } class ProcedureTempleteDetailsModelList { - List procedureTemplate; + List procedureTemplate = List(); String templateName; + int templateId; ProcedureTempleteDetailsModelList( - {this.templateName, ProcedureTempleteDetailsModel template}) { + {this.templateName, this.templateId, ProcedureTempleteDetailsModel template}) { procedureTemplate.add(template); } } diff --git a/lib/core/service/patient_medical_file/procedure/procedure_service.dart b/lib/core/service/patient_medical_file/procedure/procedure_service.dart index 9673b9bf..756044ca 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -23,8 +23,9 @@ class ProcedureService extends BaseService { List procedureslist = List(); List categoryList = []; - List _templateList = List(); - List get templateList => _templateList; + // List _templateList = List(); + // List get templateList => _templateList; + List templateList = List(); List _templateDetailsList = List(); List get templateDetailsList => @@ -68,17 +69,19 @@ class ProcedureService extends BaseService { tokenID: "@dm!n", patientID: 0, searchType: 1, - editedBy: 208195, ); hasError = false; //insuranceApprovalInPatient.clear(); - await baseAppClient.post(GET_PROCEDURE_TEMPLETE, + await baseAppClient.post(GET_TEMPLETE_LIST/*GET_PROCEDURE_TEMPLETE*/, onSuccess: (dynamic response, int statusCode) { - //prescriptionsList.clear(); - response['HIS_ProcedureTemplateList'].forEach((template) { - _templateList.add(ProcedureTempleteModel.fromJson(template)); + templateList.clear(); + response['DAPP_TemplateGetList'].forEach((template) { + templateList.add(ProcedureTempleteDetailsModel.fromJson(template)); }); + // response['HIS_ProcedureTemplateList'].forEach((template) { + // _templateList.add(ProcedureTempleteModel.fromJson(template)); + // }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 29b4b0e4..6ff78fd0 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -26,17 +26,22 @@ class ProcedureViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; bool hasError = false; ProcedureService _procedureService = locator(); + List get procedureList => _procedureService.procedureList; + List get valadteProcedureList => _procedureService.valadteProcedureList; + List get categoriesList => _procedureService.categoriesList; + List get categoryList => _procedureService.categoryList; RadiologyService _radiologyService = locator(); LabsService _labsService = locator(); List _finalRadiologyListClinic = List(); List _finalRadiologyListHospital = List(); + List get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic @@ -50,8 +55,11 @@ class ProcedureViewModel extends BaseViewModel { List get labOrdersResultsList => _labsService.labOrdersResultsList; - List get procedureTemplate => + + List get procedureTemplate => _procedureService.templateList; + List templateList = List(); + List get procedureTemplateDetails => _procedureService.templateDetailsList; @@ -108,11 +116,35 @@ class ProcedureViewModel extends BaseViewModel { if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); - } else + } else { + setTemplateListDependOnId(); setState(ViewState.Idle); + } + } + + setTemplateListDependOnId() { + procedureTemplate.forEach((element) { + List templateListData = templateList + .where((elementTemplate) => + elementTemplate.templateId == element.templateID) + .toList(); + + if (templateListData.length != 0) { + templateList[templateList.indexOf(templateListData[0])] + .procedureTemplate + .add(element); + } else { + templateList.add(ProcedureTempleteDetailsModelList( + templateName: element.templateName, + templateId: element.templateID, + template: element)); + } + }); + print(templateList.length.toString()); } int tempId = 0; + Future getProcedureTemplateDetails({int templateId}) async { tempId = templateId; hasError = false; diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index be6e3451..f520a226 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -39,13 +39,15 @@ class _AddFavouriteProcedureState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - if (model.procedureTemplate.length == 0) { + // TODO mosa_change + // if (model.procedureTemplate.length == 0) { model.getProcedureTemplate(); - } + // } }, builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: false, + baseViewModel: model, body: Column( children: [ Container( @@ -57,7 +59,7 @@ class _AddFavouriteProcedureState extends State { baseViewModel: model, child: EntityListCheckboxSearchFavProceduresWidget( model: widget.model, - masterList: widget.model.procedureTemplate, + // masterList: widget.model.procedureTemplate, removeFavProcedure: (item) { setState(() { entityList.remove(item); From 390a34dd818f5000b801441f70d91297eaa9a95d Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 26 May 2021 15:07:37 +0300 Subject: [PATCH 18/25] procedure hot fix --- .../procedure/procedure_service.dart | 13 ++++++++++--- lib/core/viewModel/procedure_View_model.dart | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/core/service/patient_medical_file/procedure/procedure_service.dart b/lib/core/service/patient_medical_file/procedure/procedure_service.dart index 756044ca..9e3d4297 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -64,20 +64,27 @@ class ProcedureService extends BaseService { ); Future getProcedureTemplate( - {int doctorId, int projectId, int clinicId}) async { + {int doctorId, int projectId, int clinicId, String categoryID}) async { _procedureTempleteRequestModel = ProcedureTempleteRequestModel( tokenID: "@dm!n", patientID: 0, searchType: 1, ); hasError = false; - //insuranceApprovalInPatient.clear(); await baseAppClient.post(GET_TEMPLETE_LIST/*GET_PROCEDURE_TEMPLETE*/, onSuccess: (dynamic response, int statusCode) { templateList.clear(); response['DAPP_TemplateGetList'].forEach((template) { - templateList.add(ProcedureTempleteDetailsModel.fromJson(template)); + ProcedureTempleteDetailsModel templateElement = ProcedureTempleteDetailsModel.fromJson(template); + if(categoryID != null){ + if(categoryID == templateElement.categoryID){ + templateList.add(templateElement); + } + } else { + templateList.add(templateElement); + } + }); // response['HIS_ProcedureTemplateList'].forEach((template) { // _templateList.add(ProcedureTempleteModel.fromJson(template)); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 6ff78fd0..fe370800 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -108,11 +108,11 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureTemplate() async { + Future getProcedureTemplate({String categoryID}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.getProcedureTemplate(); + await _procedureService.getProcedureTemplate(categoryID: categoryID); if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); From 725c87fe8b148e8b287909a5a463a2734608576e Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 26 May 2021 15:27:52 +0300 Subject: [PATCH 19/25] Add favorite procedure templates for lab and radiology --- lib/core/service/home/dasboard_service.dart | 2 +- lib/core/viewModel/procedure_View_model.dart | 1 + lib/screens/home/home_screen.dart | 6 +- .../live_care/live_care_patient_screen.dart | 2 +- .../insurance_approval_screen_patient.dart | 2 +- .../radiology/radiology_home_page.dart | 3 +- .../procedures/ExpansionProcedure.dart | 39 +-- .../procedures/add-favourite-procedure.dart | 69 ++--- .../procedures/add-procedure-form.dart | 158 +----------- .../procedures/add_lab_home_screen.dart | 218 ++++++++++++++++ lib/screens/procedures/add_lab_orders.dart | 6 +- .../procedures/add_procedure_homeScreen.dart | 2 + .../procedures/add_radiology_order.dart | 5 +- .../procedures/add_radiology_screen.dart | 219 ++++++++++++++++ .../procedures/entity_list_fav_procedure.dart | 3 +- .../procedures/procedure_checkout_screen.dart | 237 +++++++++--------- 16 files changed, 635 insertions(+), 337 deletions(-) create mode 100644 lib/screens/procedures/add_lab_home_screen.dart create mode 100644 lib/screens/procedures/add_radiology_screen.dart diff --git a/lib/core/service/home/dasboard_service.dart b/lib/core/service/home/dasboard_service.dart index ba836287..b35d24f2 100644 --- a/lib/core/service/home/dasboard_service.dart +++ b/lib/core/service/home/dasboard_service.dart @@ -44,7 +44,7 @@ class DashboardService extends BaseService { super.error = error; }, body: { - "DoctorID": doctorProfile.doctorID// test user 9920 + "DoctorID": doctorProfile?.doctorID// test user 9920 }, ); } diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 29b4b0e4..823ca2b4 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -23,6 +23,7 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:flutter/cupertino.dart'; class ProcedureViewModel extends BaseViewModel { + //TODO Hussam clean it FilterType filterType = FilterType.Clinic; bool hasError = false; ProcedureService _procedureService = locator(); diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index b2020abe..c305b752 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -241,12 +241,12 @@ class _HomeScreenState extends State { ), sliderActiveIndex == 1 ? DashboardSliderItemWidget( - model.dashboardItemsList[6]) + model.dashboardItemsList[4]) : sliderActiveIndex == 0 ? DashboardSliderItemWidget( model.dashboardItemsList[3]) : DashboardSliderItemWidget( - model.dashboardItemsList[4]), + model.dashboardItemsList[6]), ]))) : SizedBox(), FractionallySizedBox( @@ -332,7 +332,7 @@ class _HomeScreenState extends State { patientCards.add(HomePatientCard( backgroundColor: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], - cardIcon: DoctorApp.inpatient, + cardIcon: DoctorApp.livecare, textColor: textColors[colorIndex], text: "${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}", diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index abe8cf58..6bef6d5f 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -51,7 +51,7 @@ class _LiveCarePatientScreenState extends State { ), Expanded( child: AppText( - "Live Care Patients", + "LiveCare Patients", fontSize: SizeConfig.textMultiplier * 2.8, fontWeight: FontWeight.bold, color: Color(0xFF2B353E), diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 2e4645ae..2bffdda5 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -39,7 +39,7 @@ class _InsuranceApprovalScreenNewState ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) : patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, - appointmentNo: patient.appointmentNo, + appointmentNo: patient?.appointmentNo, projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient), builder: (BuildContext context, InsuranceViewModel model, Widget child) => diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 7d70b677..4e969793 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -4,6 +4,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/patients/profile/radiology/radiology_details_page.dart'; import 'package:doctor_app_flutter/screens/procedures/add_radiology_order.dart'; +import 'package:doctor_app_flutter/screens/procedures/add_radiology_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; @@ -117,7 +118,7 @@ class _RadiologyHomePageState extends State { context, MaterialPageRoute( builder: (context) => - AddSelectedRadiologyOrder( + AddRadiologyScreen( patient: patient, model: model, )), diff --git a/lib/screens/procedures/ExpansionProcedure.dart b/lib/screens/procedures/ExpansionProcedure.dart index 188f6634..cdad16da 100644 --- a/lib/screens/procedures/ExpansionProcedure.dart +++ b/lib/screens/procedures/ExpansionProcedure.dart @@ -11,7 +11,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ExpansionProcedure extends StatefulWidget { - final ProcedureTempleteModel procedureTempleteModel; + final ProcedureTempleteDetailsModelList procedureTempleteModel; final ProcedureViewModel model; final Function(ProcedureTempleteDetailsModel) removeFavProcedure; final Function(ProcedureTempleteDetailsModel) addFavProcedure; @@ -37,19 +37,14 @@ class ExpansionProcedure extends StatefulWidget { class _ExpansionProcedureState extends State { bool _isShowMore = false; - List _templateDetailsList = List(); BaseAppClient baseAppClient = BaseAppClient(); + @override Widget build(BuildContext context) { return Column( children: [ InkWell( onTap: () async { - if (!_isShowMore && _templateDetailsList.isEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - await getProcedureTemplateDetails(widget.procedureTempleteModel.templateID); - GifLoaderDialogUtils.hideDialog(context); - } setState(() { _isShowMore = !_isShowMore; }); @@ -116,8 +111,8 @@ class _ExpansionProcedureState extends State { )), duration: Duration(milliseconds: 7000), child: Column( - children: - _templateDetailsList.map((itemProcedure) { + children: widget.procedureTempleteModel.procedureTemplate + .map((itemProcedure) { return Container( child: Padding( padding: EdgeInsets.symmetric(horizontal: 12), @@ -135,8 +130,10 @@ class _ExpansionProcedureState extends State { activeColor: Color(0xffD02127), onChanged: (bool newValue) { setState(() { - if (widget.isEntityFavListSelected(itemProcedure)) { - widget.removeFavProcedure(itemProcedure); + if (widget.isEntityFavListSelected( + itemProcedure)) { + widget + .removeFavProcedure(itemProcedure); } else { widget.addFavProcedure(itemProcedure); } @@ -145,8 +142,7 @@ class _ExpansionProcedureState extends State { ), Expanded( child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 0), child: AppText(itemProcedure.procedureName, fontSize: 14.0, variant: "bodyText", @@ -169,21 +165,4 @@ class _ExpansionProcedureState extends State { ], ); } - - getProcedureTemplateDetails(templateId)async { - ProcedureTempleteDetailsRequestModel _procedureTempleteDetailsRequestModel = ProcedureTempleteDetailsRequestModel(templateID: templateId, searchType: 1, patientID: 0); - _templateDetailsList.clear(); - await baseAppClient.post(GET_PROCEDURE_TEMPLETE_DETAILS, - onSuccess: (dynamic response, int statusCode) { - response['HIS_ProcedureTemplateDetailsList'].forEach((template) { - setState(() { - _templateDetailsList.add(ProcedureTempleteDetailsModel.fromJson(template)); - }); - }); - }, onFailure: (String error, int statusCode) { - DrAppToastMsg.showErrorToast(error); - - }, body: _procedureTempleteDetailsRequestModel.toJson()); - } - } diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index be6e3451..7e43f934 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -20,9 +20,17 @@ import 'package:flutter/material.dart'; class AddFavouriteProcedure extends StatefulWidget { final ProcedureViewModel model; final PatiantInformtion patient; + final String categoryID; + final String addButtonTitle; + final String toolbarTitle; - const AddFavouriteProcedure({Key key, this.model, this.patient}) - : super(key: key); + AddFavouriteProcedure( + {Key key, + this.model, + this.patient, + this.categoryID, + @required this.addButtonTitle, + @required this.toolbarTitle}); @override _AddFavouriteProcedureState createState() => _AddFavouriteProcedureState(); @@ -46,6 +54,7 @@ class _AddFavouriteProcedureState extends State { builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: false, + baseViewModel: model, body: Column( children: [ Container( @@ -54,27 +63,25 @@ class _AddFavouriteProcedureState extends State { if (model.procedureTemplate.length != 0) Expanded( child: NetworkBaseView( - baseViewModel: model, - child: EntityListCheckboxSearchFavProceduresWidget( - model: widget.model, - masterList: widget.model.procedureTemplate, - removeFavProcedure: (item) { - setState(() { - entityList.remove(item); - }); - }, - addFavProcedure: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityFavListSelected: (master) => - isEntityListSelected(master), - )), + baseViewModel: model, + child: EntityListCheckboxSearchFavProceduresWidget( + model: widget.model, + masterList: widget.model.procedureTemplate, + //TODO change it to the new model + removeFavProcedure: (item) { + setState(() { + entityList.remove(item); + }); + }, + addFavProcedure: (history) { + setState(() { + entityList.add(history); + }); + }, + isEntityFavListSelected: (master) => + isEntityListSelected(master), + ), + ), ), Container( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), @@ -82,7 +89,8 @@ class _AddFavouriteProcedureState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: TranslationBase.of(context).addSelectedProcedures, + title: widget.addButtonTitle ?? + TranslationBase.of(context).addSelectedProcedures, color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () { @@ -97,11 +105,14 @@ class _AddFavouriteProcedureState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => ProcedureCheckOutScreen( - items: entityList, - model: model, - patient: widget.patient, - )), + builder: (context) => ProcedureCheckOutScreen( + items: entityList, + model: model, + patient: widget.patient, + addButtonTitle: widget.addButtonTitle, + toolbarTitle: widget.toolbarTitle, + ), + ), ); }, ), diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 4e08a73d..844ff246 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -111,6 +111,7 @@ class AddSelectedProcedure extends StatefulWidget { const AddSelectedProcedure({Key key, this.model, this.patient}) : super(key: key); + @override _AddSelectedProcedureState createState() => _AddSelectedProcedureState(patient: patient, model: model); @@ -120,7 +121,9 @@ class _AddSelectedProcedureState extends State { int selectedType; ProcedureViewModel model; PatiantInformtion patient; + _AddSelectedProcedureState({this.patient, this.model}); + TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); List entityList = List(); @@ -220,7 +223,8 @@ class _AddSelectedProcedureState extends State { if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) model.getProcedureCategory( - categoryName: procedureName.text); + categoryName: + procedureName.text); else DrAppToastMsg.showErrorToast( TranslationBase.of(context) @@ -235,90 +239,11 @@ class _AddSelectedProcedureState extends State { ), ], ), - // SizedBox( - // width: MediaQuery.of(context).size.width * 0.29, - // ), - // InkWell( - // child: Icon( - // Icons.close, - // size: 24.0, - // ), - // onTap: () { - // Navigator.pop(context); - // }, - // ), - // ], - // ), - // SizedBox( - // height: 10.0, - // ), - // Container( - // height: screenSize.height * 0.070, - // child: InkWell( - // onTap: model.categoryList != null && - // model.categoryList.length > 0 - // ? () { - // ListSelectDialog dialog = - // ListSelectDialog( - // list: model.categoryList, - // attributeName: 'categoryName', - // attributeValueId: 'categoryId', - // okText: TranslationBase.of(context).ok, - // okFunction: (selectedValue) { - // setState(() { - // selectedCategory = selectedValue; - // model.getProcedureCategory( - // categoryName: selectedCategory[ - // 'categoryName'], - // categoryID: selectedCategory[ - // 'categoryId'] <= - // 9 - // ? "0" + - // selectedCategory[ - // 'categoryId'] - // .toString() - // : selectedCategory[ - // 'categoryId'] - // .toString()); - // }); - // }, - // ); - // showDialog( - // barrierDismissible: false, - // context: context, - // builder: (BuildContext context) { - // return dialog; - // }, - // ); - // //model.getProcedureCategory(); - // } - // : null, - // child: TextField( - // decoration: textFieldSelectorDecoration( - // TranslationBase.of(context) - // .procedureCategorise, - // selectedCategory != null - // ? selectedCategory['categoryName'] - // : null, - // true, - // suffixIcon: Icon( - // Icons.search, - // color: Colors.black, - // )), - // enabled: false, - // ), - // ), - // ), if (procedureName.text.isNotEmpty && model.procedureList.length != 0) NetworkBaseView( baseViewModel: model, - child: - // selectedCategory != null - // ? selectedCategory['categoryId'] == 02 || - // selectedCategory['categoryId'] == 03 - // ? - EntityListCheckboxSearchWidget( + child: EntityListCheckboxSearchWidget( model: widget.model, masterList: widget .model.categoriesList[0].entityList, @@ -338,77 +263,10 @@ class _AddSelectedProcedureState extends State { }, isEntityListSelected: (master) => isEntityListSelected(master), - ) - // : ProcedureListWidget( - // model: widget.model, - // masterList: widget.model - // .categoriesList[0].entityList, - // removeHistory: (item) { - // setState(() { - // entityList.remove(item); - // }); - // }, - // addHistory: (history) { - // setState(() { - // entityList.add(history); - // }); - // }, - // addSelectedHistories: () { - // //TODO build your fun herr - // // widget.addSelectedHistories(); - // }, - // isEntityListSelected: (master) => - // isEntityListSelected(master), - // ) - // : null, - ), + )), SizedBox( - height: 15.0, + height: 115.0, ), - Column( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - // Container( - // child: Row( - // children: [ - // AppText( - // TranslationBase.of(context).orderType), - // Radio( - // activeColor: Color(0xFFB9382C), - // value: 1, - // groupValue: selectedType, - // onChanged: (value) { - // setSelectedType(value); - // }, - // ), - // Text('routine'), - // Radio( - // activeColor: Color(0xFFB9382C), - // groupValue: selectedType, - // value: 0, - // onChanged: (value) { - // setSelectedType(value); - // }, - // ), - // Text(TranslationBase.of(context).urgent), - // ], - // ), - // ), - // SizedBox( - // height: 15.0, - // ), - // TextFields( - // hintText: TranslationBase.of(context).remarks, - // controller: remarksController, - // minLines: 3, - // maxLines: 5, - // ), - SizedBox( - height: 100.0, - ), - ], - ) ], ), ), diff --git a/lib/screens/procedures/add_lab_home_screen.dart b/lib/screens/procedures/add_lab_home_screen.dart new file mode 100644 index 00000000..d86c4ecd --- /dev/null +++ b/lib/screens/procedures/add_lab_home_screen.dart @@ -0,0 +1,218 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/procedure_View_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/screens/procedures/add-favourite-procedure.dart'; +import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'add_lab_orders.dart'; + +class AddLabHomeScreen extends StatefulWidget { + final ProcedureViewModel model; + final PatiantInformtion patient; + const AddLabHomeScreen({Key key, this.model, this.patient}) : super(key: key); + @override + _AddLabHomeScreenState createState() => + _AddLabHomeScreenState(patient: patient, model: model); +} + +class _AddLabHomeScreenState extends State + with SingleTickerProviderStateMixin { + _AddLabHomeScreenState({this.patient, this.model}); + ProcedureViewModel model; + PatiantInformtion patient; + TabController _tabController; + int _activeTab = 0; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + _tabController.addListener(_handleTabSelection); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + _handleTabSelection() { + setState(() { + _activeTab = _tabController.index; + }); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return BaseView( + builder: (BuildContext context, ProcedureViewModel model, Widget child) => + AppScaffold( + isShowAppBar: false, + body: NetworkBaseView( + baseViewModel: model, + child: DraggableScrollableSheet( + minChildSize: 0.90, + initialChildSize: 0.95, + maxChildSize: 1.0, + builder: + (BuildContext context, ScrollController scrollController) { + return Container( + height: MediaQuery.of(context).size.height * 1.20, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + 'Add Procedure', + fontWeight: FontWeight.w700, + fontSize: 20, + ), + InkWell( + child: Icon( + Icons.close, + size: 24.0, + ), + onTap: () { + Navigator.pop(context); + }, + ) + ]), + SizedBox( + height: MediaQuery.of(context).size.height * 0.04, + ), + Expanded( + child: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight( + MediaQuery.of(context).size.height * 0.070), + child: Container( + height: + MediaQuery.of(context).size.height * 0.070, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.5), //width: 0.7 + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: false, + controller: _tabController, + indicatorColor: Colors.transparent, + indicatorWeight: 1.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: EdgeInsets.only( + top: 0, left: 0, right: 0, bottom: 0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + tabWidget( + screenSize, + _activeTab == 0, + "Favorite Templates", + ), + tabWidget( + screenSize, + _activeTab == 1, + 'All Lab', + ), + ], + ), + ), + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + AddFavouriteProcedure( + patient: patient, + model: model, + addButtonTitle: TranslationBase.of(context).addLabOrder, + toolbarTitle: TranslationBase.of(context).applyForNewLabOrder, + categoryID: "02", + ), + AddSelectedLabOrder( + model: model, + patient: patient, + ), + ], + ), + ), + ], + ), + ), + ), + ], + ), + ), + ); + }), + ), + ), + ); + } + + Widget tabWidget(Size screenSize, bool isActive, String title, + {int counter = -1}) { + return Center( + child: Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), + isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + title, + fontSize: SizeConfig.textMultiplier * 1.5, + color: isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + if (counter != -1) + Container( + margin: EdgeInsets.all(4), + width: 15, + height: 15, + decoration: BoxDecoration( + color: isActive ? Colors.white : Color(0xFFD02127), + shape: BoxShape.circle, + ), + child: Center( + child: FittedBox( + child: AppText( + "$counter", + fontSize: SizeConfig.textMultiplier * 1.5, + color: !isActive ? Colors.white : Color(0xFFD02127), + fontWeight: FontWeight.w700, + ), + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart index cd3205df..a4cb4e68 100644 --- a/lib/screens/procedures/add_lab_orders.dart +++ b/lib/screens/procedures/add_lab_orders.dart @@ -218,14 +218,10 @@ class _AddSelectedLabOrderState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: TranslationBase.of(context) - .addLabOrder, //TranslationBase.of(context) + title: TranslationBase.of(context).addLabOrder, fontWeight: FontWeight.w700, - //.addSelectedProcedures, color: Color(0xff359846), onPressed: () { - //print(entityList.toString()); - onPressed: if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( TranslationBase.of(context) diff --git a/lib/screens/procedures/add_procedure_homeScreen.dart b/lib/screens/procedures/add_procedure_homeScreen.dart index 4a4d8242..39ed4b25 100644 --- a/lib/screens/procedures/add_procedure_homeScreen.dart +++ b/lib/screens/procedures/add_procedure_homeScreen.dart @@ -147,6 +147,8 @@ class _AddProcedureHomeState extends State AddFavouriteProcedure( patient: patient, model: model, + addButtonTitle: TranslationBase.of(context).addSelectedProcedures, + toolbarTitle: 'Add Procedure', ), AddSelectedProcedure( model: model, diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart index 3f19e7f9..78e91ba8 100644 --- a/lib/screens/procedures/add_radiology_order.dart +++ b/lib/screens/procedures/add_radiology_order.dart @@ -110,6 +110,7 @@ class AddSelectedRadiologyOrder extends StatefulWidget { const AddSelectedRadiologyOrder({Key key, this.model, this.patient}) : super(key: key); + @override _AddSelectedRadiologyOrderState createState() => _AddSelectedRadiologyOrderState(patient: patient, model: model); @@ -119,7 +120,9 @@ class _AddSelectedRadiologyOrderState extends State { int selectedType; ProcedureViewModel model; PatiantInformtion patient; + _AddSelectedRadiologyOrderState({this.patient, this.model}); + TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); List entityList = List(); @@ -221,8 +224,6 @@ class _AddSelectedRadiologyOrderState extends State { color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () { - //print(entityList.toString()); - onPressed: if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast(TranslationBase.of(context) .fillTheMandatoryProcedureDetails); diff --git a/lib/screens/procedures/add_radiology_screen.dart b/lib/screens/procedures/add_radiology_screen.dart new file mode 100644 index 00000000..ac21e7d9 --- /dev/null +++ b/lib/screens/procedures/add_radiology_screen.dart @@ -0,0 +1,219 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/procedure_View_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/screens/procedures/add-favourite-procedure.dart'; +import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'add_lab_orders.dart'; +import 'add_radiology_order.dart'; + +class AddRadiologyScreen extends StatefulWidget { + final ProcedureViewModel model; + final PatiantInformtion patient; + const AddRadiologyScreen({Key key, this.model, this.patient}) : super(key: key); + @override + _AddRadiologyScreenState createState() => + _AddRadiologyScreenState(patient: patient, model: model); +} + +class _AddRadiologyScreenState extends State + with SingleTickerProviderStateMixin { + _AddRadiologyScreenState({this.patient, this.model}); + ProcedureViewModel model; + PatiantInformtion patient; + TabController _tabController; + int _activeTab = 0; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + _tabController.addListener(_handleTabSelection); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + _handleTabSelection() { + setState(() { + _activeTab = _tabController.index; + }); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return BaseView( + builder: (BuildContext context, ProcedureViewModel model, Widget child) => + AppScaffold( + isShowAppBar: false, + body: NetworkBaseView( + baseViewModel: model, + child: DraggableScrollableSheet( + minChildSize: 0.90, + initialChildSize: 0.95, + maxChildSize: 1.0, + builder: + (BuildContext context, ScrollController scrollController) { + return Container( + height: MediaQuery.of(context).size.height * 1.20, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + TranslationBase.of(context).addLabOrder, + fontWeight: FontWeight.w700, + fontSize: 20, + ), + InkWell( + child: Icon( + Icons.close, + size: 24.0, + ), + onTap: () { + Navigator.pop(context); + }, + ) + ]), + SizedBox( + height: MediaQuery.of(context).size.height * 0.04, + ), + Expanded( + child: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight( + MediaQuery.of(context).size.height * 0.070), + child: Container( + height: + MediaQuery.of(context).size.height * 0.070, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 0.5), //width: 0.7 + ), + color: Colors.white), + child: Center( + child: TabBar( + isScrollable: false, + controller: _tabController, + indicatorColor: Colors.transparent, + indicatorWeight: 1.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Theme.of(context).primaryColor, + labelPadding: EdgeInsets.only( + top: 0, left: 0, right: 0, bottom: 0), + unselectedLabelColor: Colors.grey[800], + tabs: [ + tabWidget( + screenSize, + _activeTab == 0, + "Favorite Templates", + ), + tabWidget( + screenSize, + _activeTab == 1, + 'All Radiology', + ), + ], + ), + ), + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + AddFavouriteProcedure( + patient: patient, + model: model, + addButtonTitle: TranslationBase.of(context).addLabOrder, + toolbarTitle: TranslationBase.of(context).applyForNewLabOrder, + categoryID: "03", + ), + AddSelectedRadiologyOrder( + model: model, + patient: patient, + ), + ], + ), + ), + ], + ), + ), + ), + ], + ), + ), + ); + }), + ), + ), + ); + } + + Widget tabWidget(Size screenSize, bool isActive, String title, + {int counter = -1}) { + return Center( + child: Container( + height: screenSize.height * 0.070, + decoration: TextFieldsUtils.containerBorderDecoration( + isActive ? Color(0xFFD02127 /*B8382B*/) : Color(0xFFEAEAEA), + isActive ? Color(0xFFD02127) : Color(0xFFEAEAEA), + borderRadius: 4, + borderWidth: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + title, + fontSize: SizeConfig.textMultiplier * 1.5, + color: isActive ? Colors.white : Color(0xFF2B353E), + fontWeight: FontWeight.w700, + ), + if (counter != -1) + Container( + margin: EdgeInsets.all(4), + width: 15, + height: 15, + decoration: BoxDecoration( + color: isActive ? Colors.white : Color(0xFFD02127), + shape: BoxShape.circle, + ), + child: Center( + child: FittedBox( + child: AppText( + "$counter", + fontSize: SizeConfig.textMultiplier * 1.5, + color: !isActive ? Colors.white : Color(0xFFD02127), + fontWeight: FontWeight.w700, + ), + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/procedures/entity_list_fav_procedure.dart b/lib/screens/procedures/entity_list_fav_procedure.dart index 1dac2f24..c5189a48 100644 --- a/lib/screens/procedures/entity_list_fav_procedure.dart +++ b/lib/screens/procedures/entity_list_fav_procedure.dart @@ -61,6 +61,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState } List items = List(); + List itemss = List(); List itemsProcedure = List(); List remarksList = List(); List typeList = List(); @@ -104,7 +105,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState ), items.length != 0 ? Column( - children: items.map((historyInfo) { + children: itemss.map((historyInfo) { return ExpansionProcedure( procedureTempleteModel: historyInfo, model: widget.model, diff --git a/lib/screens/procedures/procedure_checkout_screen.dart b/lib/screens/procedures/procedure_checkout_screen.dart index f5b6dcb7..76d6cf6f 100644 --- a/lib/screens/procedures/procedure_checkout_screen.dart +++ b/lib/screens/procedures/procedure_checkout_screen.dart @@ -14,10 +14,14 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ProcedureCheckOutScreen extends StatefulWidget { - ProcedureCheckOutScreen({this.items, this.model, this.patient}); final List items; final ProcedureViewModel model; final PatiantInformtion patient; + final String addButtonTitle; + final String toolbarTitle; + + ProcedureCheckOutScreen( + {this.items, this.model, this.patient,@required this.addButtonTitle,@required this.toolbarTitle}); @override _ProcedureCheckOutScreenState createState() => @@ -63,7 +67,7 @@ class _ProcedureCheckOutScreenState extends State { width: 5.0, ), AppText( - 'Add Procedure', + widget.toolbarTitle ?? 'Add Procedure', fontWeight: FontWeight.w700, fontSize: 20, ), @@ -71,122 +75,129 @@ class _ProcedureCheckOutScreenState extends State { ), ), ), - SizedBox(height: 30,), - ...List.generate(widget.items.length, (index) => Container( - margin: EdgeInsets.only(bottom: 15.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: - BorderRadius.all(Radius.circular(10.0))), - child: ExpansionTile( - initiallyExpanded: true, - title: Row( - children: [ - Icon( - Icons.check_box, - color: Color(0xffD02127), - size: 30.5, - ), - SizedBox( - width: 6.0, - ), - Expanded( - child: - AppText(widget.items[index].procedureName)), - ], - ), - children: [ - Container( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 11), + SizedBox( + height: 30, + ), + ...List.generate( + widget.items.length, + (index) => Container( + margin: EdgeInsets.only(bottom: 15.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: + BorderRadius.all(Radius.circular(10.0))), + child: ExpansionTile( + initiallyExpanded: true, + title: Row( + children: [ + Icon( + Icons.check_box, + color: Color(0xffD02127), + size: 30.5, + ), + SizedBox( + width: 6.0, + ), + Expanded( child: AppText( - TranslationBase.of(context).orderType, - fontWeight: FontWeight.w700, - color: Color(0xff2B353E), - ), + widget.items[index].procedureName)), + ], + ), + children: [ + Container( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 11), + child: AppText( + TranslationBase.of(context) + .orderType, + fontWeight: FontWeight.w700, + color: Color(0xff2B353E), + ), + ), + ], + ), + Row( + children: [ + Radio( + activeColor: Color(0xFFD02127), + value: 0, + groupValue: + widget.items[index].selectedType, + onChanged: (value) { + widget.items[index].selectedType = + 0; + setState(() { + widget.items[index].type = + value.toString(); + }); + }, + ), + AppText( + 'routine', + color: Color(0xff575757), + fontWeight: FontWeight.w600, + ), + Radio( + activeColor: Color(0xFFD02127), + groupValue: + widget.items[index].selectedType, + value: 1, + onChanged: (value) { + widget.items[index].selectedType = + 1; + setState(() { + widget.items[index].type = + value.toString(); + }); + }, + ), + AppText( + TranslationBase.of(context).urgent, + color: Color(0xff575757), + fontWeight: FontWeight.w600, + ), + ], + ), + ], ), - ], + ), ), - Row( - children: [ - Radio( - activeColor: Color(0xFFD02127), - value: 0, - groupValue: - widget.items[index].selectedType, - onChanged: (value) { - widget.items[index].selectedType = 0; - setState(() { - widget.items[index].type = - value.toString(); - }); - }, - ), - AppText( - 'routine', - color: Color(0xff575757), - fontWeight: FontWeight.w600, - ), - Radio( - activeColor: Color(0xFFD02127), - groupValue: - widget.items[index].selectedType, - value: 1, - onChanged: (value) { - widget.items[index].selectedType = 1; - setState(() { - widget.items[index].type = - value.toString(); - }); - }, - ), - AppText( - TranslationBase.of(context).urgent, - color: Color(0xff575757), - fontWeight: FontWeight.w600, - ), - ], + SizedBox( + height: 2.0, + ), + Padding( + padding: EdgeInsets.symmetric( + horizontal: 12, vertical: 15.0), + child: TextFields( + hintText: TranslationBase.of(context).remarks, + controller: remarksController, + onChanged: (value) { + widget.items[index].remarks = value; + }, + minLines: 3, + maxLines: 5, + borderWidth: 0.5, + borderColor: Colors.grey[500], + ), ), + SizedBox( + height: 19.0, + ), + //DividerWithSpacesAround(), ], ), - ), - ), - SizedBox( - height: 2.0, - ), - Padding( - padding: EdgeInsets.symmetric( - horizontal: 12, vertical: 15.0), - child: TextFields( - hintText: TranslationBase.of(context).remarks, - controller: remarksController, - onChanged: (value) { - widget.items[index].remarks = value; - }, - minLines: 3, - maxLines: 5, - borderWidth: 0.5, - borderColor: Colors.grey[500], - ), - ), - SizedBox( - height: 19.0, - ), - //DividerWithSpacesAround(), - ], - ), - )), - SizedBox(height: 90,), - - + )), + SizedBox( + height: 90, + ), ], ), ), @@ -196,7 +207,7 @@ class _ProcedureCheckOutScreenState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: TranslationBase.of(context).addSelectedProcedures, + title: widget.addButtonTitle ?? TranslationBase.of(context).addSelectedProcedures, color: Color(0xff359846), fontWeight: FontWeight.w700, onPressed: () async { From b16dc2092b5499774a54f3c1cbd149eccefacf7b Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 26 May 2021 16:22:35 +0300 Subject: [PATCH 20/25] liveCare cahnges --- .../viewModel/LiveCarePatientViewModel.dart | 44 ++- lib/models/patient/patiant_info_model.dart | 82 +++- .../live_care/live_care_patient_screen.dart | 22 ++ lib/widgets/patients/PatientCard.dart | 365 +++++++++++------- 4 files changed, 339 insertions(+), 174 deletions(-) diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 59706429..844ebf55 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -17,19 +17,23 @@ class LiveCarePatientViewModel extends BaseViewModel { LiveCarePatientServices _liveCarePatientServices = locator(); - StartCallRes get startCallRes => _liveCarePatientServices.startCallRes; - DashboardService _dashboardService = - locator(); + DashboardService _dashboardService = locator(); + + getPendingPatientERForDoctorApp({bool isFromTimer = false}) async { + if (isFromTimer) { + setState(ViewState.Idle); + } else { + setState(ViewState.BusyLocal); + } - getPendingPatientERForDoctorApp() async { - setState(ViewState.BusyLocal); PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel = - PendingPatientERForDoctorAppRequestModel(sErServiceID:_dashboardService.sServiceID, outSA: false); - await _liveCarePatientServices - .getPendingPatientERForDoctorApp(pendingPatientERForDoctorAppRequestModel); + PendingPatientERForDoctorAppRequestModel( + sErServiceID: _dashboardService.sServiceID, outSA: false); + await _liveCarePatientServices.getPendingPatientERForDoctorApp( + pendingPatientERForDoctorAppRequestModel); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; @@ -49,8 +53,7 @@ class LiveCarePatientViewModel extends BaseViewModel { endCallReq.isDestroy = isPatient; setState(ViewState.BusyLocal); - await _liveCarePatientServices - .endCall(endCallReq); + await _liveCarePatientServices.endCall(endCallReq); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); @@ -59,7 +62,7 @@ class LiveCarePatientViewModel extends BaseViewModel { } } - getToken()async{ + getToken() async { String token = await sharedPref.getString(TOKEN); return token; } @@ -86,12 +89,11 @@ class LiveCarePatientViewModel extends BaseViewModel { } else { setState(ViewState.Idle); } - } + Future endCallWithCharge(int vcID) async { setState(ViewState.BusyLocal); - await _liveCarePatientServices - .endCallWithCharge(vcID); + await _liveCarePatientServices.endCallWithCharge(vcID); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); @@ -103,8 +105,7 @@ class LiveCarePatientViewModel extends BaseViewModel { Future transferToAdmin(int vcID, String notes) async { setState(ViewState.BusyLocal); - await _liveCarePatientServices - .transferToAdmin(vcID, notes); + await _liveCarePatientServices.transferToAdmin(vcID, notes); if (_liveCarePatientServices.hasError) { error = _liveCarePatientServices.error; setState(ViewState.ErrorLocal); @@ -115,19 +116,20 @@ class LiveCarePatientViewModel extends BaseViewModel { } searchData(String str) { - var strExist= str.length > 0 ? true : false; + var strExist = str.length > 0 ? true : false; if (strExist) { filterData = []; for (var i = 0; i < _liveCarePatientServices.patientList.length; i++) { String fullName = - _liveCarePatientServices.patientList[i].fullName.toUpperCase(); + _liveCarePatientServices.patientList[i].fullName.toUpperCase(); String patientID = - _liveCarePatientServices.patientList[i].patientId.toString(); + _liveCarePatientServices.patientList[i].patientId.toString(); String mobile = - _liveCarePatientServices.patientList[i].mobileNumber.toUpperCase(); + _liveCarePatientServices.patientList[i].mobileNumber.toUpperCase(); if (fullName.contains(str.toUpperCase()) || - patientID.contains(str)|| mobile.contains(str)) { + patientID.contains(str) || + mobile.contains(str)) { filterData.add(_liveCarePatientServices.patientList[i]); } } diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 61fb4a2f..0cb067e0 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -7,6 +7,15 @@ class PatiantInformtion { String appointmentDate; dynamic appointmentNo; dynamic appointmentType; + String arrivalTime; + String arrivalTimeD; + int callStatus; + Null callStatusDisc; + int callTypeID; + String clientRequestID; + String clinicName; + String consoltationEnd; + String consultationNotes; int appointmentTypeId; String arrivedOn; int clinicGroupId; @@ -57,12 +66,14 @@ class PatiantInformtion { String startTime; String visitType; String nationalityFlagURL; + int patientStatus; int patientStatusType; int visitTypeId; String startTimes; String dischargeDate; int status; int vcId; + String voipToken; PatiantInformtion( {this.patientDetails, @@ -102,6 +113,15 @@ class PatiantInformtion { this.appointmentDate, this.startTime, this.appointmentNo, + this.arrivalTime, + this.arrivalTimeD, + this.callStatus, + this.callStatusDisc, + this.callTypeID, + this.clientRequestID, + this.clinicName, + this.consoltationEnd, + this.consultationNotes, this.appointmentType, this.appointmentTypeId, this.arrivedOn, @@ -122,20 +142,27 @@ class PatiantInformtion { this.fullNameN, this.nationalityFlagURL, this.patientStatusType, + this.patientStatus, this.visitTypeId, - this.startTimes,this.dischargeDate,this.status, this.vcId}); + this.startTimes, + this.dischargeDate, + this.status, + this.vcId, + this.voipToken}); factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( - patientDetails: json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) + patientDetails: json['patientDetails'] != null + ? new PatiantInformtion.fromJson(json['patientDetails']) : null, projectId: json["ProjectID"] ?? json["projectID"], clinicId: json["ClinicID"] ?? json["clinicID"], doctorId: json["DoctorID"] ?? json["doctorID"], - patientId: json["PatientID"]!= null ?json["PatientID"] is String ? int.parse(json["PatientID"]):json["PatientID"]: - json["patientID"] ?? - json['patientMRN'] ?? - json['PatientMRN'], + patientId: json["PatientID"] != null + ? json["PatientID"] is String + ? int.parse(json["PatientID"]) + : json["PatientID"] + : json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN'], doctorName: json["DoctorName"] ?? json["doctorName"], doctorNameN: json["DoctorNameN"] ?? json["doctorNameN"], firstName: json["FirstName"] ?? json["firstName"], @@ -144,17 +171,22 @@ class PatiantInformtion { firstNameN: json["FirstNameN"] ?? json["firstNameN"], middleNameN: json["MiddleNameN"] ?? json["middleNameN"], lastNameN: json["LastNameN"] ?? json["lastNameN"], - gender: json["Gender"]!= null? json["Gender"]is String ?int.parse(json["Gender"]):json["Gender"] :json["gender"], - fullName: json["fullName"] ?? json["fullName"]??json["PatientName"], - fullNameN: json["fullNameN"] ?? json["fullNameN"]??json["PatientName"], - dateofBirth: json["DateofBirth"] ?? json["dob"]??json['DateOfBirth'], + gender: json["Gender"] != null + ? json["Gender"] is String + ? int.parse(json["Gender"]) + : json["Gender"] + : json["gender"], + fullName: json["fullName"] ?? json["fullName"] ?? json["PatientName"], + fullNameN: + json["fullNameN"] ?? json["fullNameN"] ?? json["PatientName"], + dateofBirth: json["DateofBirth"] ?? json["dob"] ?? json['DateOfBirth'], nationalityId: json["NationalityID"] ?? json["nationalityID"], mobileNumber: json["MobileNumber"] ?? json["mobileNumber"], emailAddress: json["EmailAddress"] ?? json["emailAddress"], patientIdentificationNo: json["PatientIdentificationNo"] ?? json["patientIdentificationNo"], //TODO make 7 dynamic when the backend retrun it in patient arrival - patientType: json["PatientType"] ?? json["patientType"]??1, + patientType: json["PatientType"] ?? json["patientType"] ?? 1, admissionNo: json["AdmissionNo"] ?? json["admissionNo"], admissionDate: json["AdmissionDate"] ?? json["admissionDate"], createdOn: json["CreatedOn"] ?? json["CreatedOn"], @@ -176,10 +208,11 @@ class PatiantInformtion { genderDescription: json["GenderDescription"], nursingStationName: json["NursingStationName"], appointmentDate: json["AppointmentDate"] ?? '', - startTime: json["startTime"]??json['StartTime'], + startTime: json["startTime"] ?? json['StartTime'], appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], appointmentType: json['appointmentType'], - appointmentTypeId: json['appointmentTypeId']?? json['appointmentTypeid'], + appointmentTypeId: + json['appointmentTypeId'] ?? json['appointmentTypeid'], arrivedOn: json['ArrivedOn'] ?? json['arrivedOn'] ?? json['ArrivedOn'], clinicGroupId: json['clinicGroupId'], companyName: json['companyName'], @@ -192,15 +225,28 @@ class PatiantInformtion { medicationOrders: json['medicationOrders'], nationality: json['nationality'] ?? json['NationalityNameN'], patientMRN: json['patientMRN'] ?? json['PatientMRN'], - visitType: json['visitType'] ?? json['visitType']?? json['visitType'], + visitType: json['visitType'] ?? json['visitType'] ?? json['visitType'], nationalityFlagURL: json['NationalityFlagURL'] ?? json['NationalityFlagURL'], patientStatusType: json['patientStatusType'] ?? json['PatientStatusType'], - visitTypeId: json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'], + visitTypeId: + json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'], startTimes: json['StartTime'] ?? json['StartTime'], - dischargeDate: json['DischargeDate'] , - status: json['Status'] , - vcId: json['VC_ID'] , + dischargeDate: json['DischargeDate'], + status: json['Status'], + vcId: json['VC_ID'], + + arrivalTime: json['ArrivalTime'], + arrivalTimeD: json['ArrivalTimeD'], + callStatus: json['CallStatus'], + callStatusDisc: json['CallStatusDisc'], + callTypeID: json['CallTypeID'], + clientRequestID: json['ClientRequestID'], + clinicName: json['ClinicName'], + consoltationEnd: json['ConsoltationEnd'], + consultationNotes: json['ConsultationNotes'], + patientStatus: json['PatientStatus'], + voipToken: json['VoipToken'], ); } diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index abe8cf58..c5cdddbc 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; @@ -22,10 +24,30 @@ class LiveCarePatientScreen extends StatefulWidget { class _LiveCarePatientScreenState extends State { final _controller = TextEditingController(); + Timer timer; + LiveCarePatientViewModel _liveCareViewModel; + @override + void initState() { + super.initState(); + timer = Timer.periodic(Duration(seconds: 10), (Timer t) { + if(_liveCareViewModel != null){ + _liveCareViewModel.getPendingPatientERForDoctorApp(isFromTimer: true); + } + }); + } + + @override + void dispose() { + _liveCareViewModel = null; + timer?.cancel(); + super.dispose(); + } + @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { + _liveCareViewModel = model; await model.getPendingPatientERForDoctorApp(); }, diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 8515c115..45445bbf 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -43,15 +43,25 @@ class PatientCard extends StatelessWidget { ), child: CardWithBgWidget( padding: 0, - marginLeft: (!isMyPatient && isInpatient)?0:10, - marginSymmetric:isFromSearch ? 10 : 0.0, + marginLeft: (!isMyPatient && isInpatient) ? 0 : 10, + marginSymmetric: isFromSearch ? 10 : 0.0, hasBorder: false, - bgColor:isFromLiveCare?Colors.white:(isMyPatient && !isFromSearch)?Colors.green[500]: patientInfo.patientStatusType == 43 - ? Colors.green[500] - :isMyPatient? Colors.green[500]:isInpatient?Colors.white:!isFromSearch?Colors.red[800]:Colors.white, + bgColor: isFromLiveCare + ? Colors.white + : (isMyPatient && !isFromSearch) + ? Colors.green[500] + : patientInfo.patientStatusType == 43 + ? Colors.green[500] + : isMyPatient + ? Colors.green[500] + : isInpatient + ? Colors.white + : !isFromSearch + ? Colors.red[800] + : Colors.white, widget: Container( - color: Colors.white, - // padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), + color: Colors.white, + // padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), child: InkWell( child: Column( children: [ @@ -66,67 +76,120 @@ class PatientCard extends StatelessWidget { children: [ patientInfo.patientStatusType == 43 ? Row( - children: [ - AppText( - TranslationBase.of(context).arrivedP, + children: [ + AppText( + TranslationBase.of(context) + .arrivedP, color: Colors.green, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 10, ), - SizedBox(width: 8,), - SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), - SizedBox(width: 8,), - AppText( - patientInfo.status==2? 'Confirmed':'Booked', - color: patientInfo.status==2? Colors.green:Colors.grey , - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 10, - ), - ], - ) - : patientInfo.patientStatusType == 42?Row( - children: [ - AppText( - TranslationBase.of(context).notArrived, - color: Colors.red[800], + SizedBox( + width: 8, + ), + SizedBox( + height: 12, + width: 1.5, + child: Container( + color: Colors.grey, + ), + ), + SizedBox( + width: 8, + ), + AppText( + patientInfo.status == 2 + ? 'Confirmed' + : 'Booked', + color: patientInfo.status == 2 + ? Colors.green + : Colors.grey, fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: 10, ), - SizedBox(width: 8,), - SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), - SizedBox(width: 8,), - AppText( - patientInfo.status==2? 'Confirmed':'Booked', - color: patientInfo.status==2? Colors.green:Colors.grey , - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 10, - ), - ], - ): !isFromSearch&&!isFromLiveCare && patientInfo.patientStatusType==null ? Row( - children: [ - AppText( - TranslationBase.of(context).notArrived, - color: Colors.red[800], - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ), - SizedBox(width: 8,), - SizedBox(height: 12,width: 1.5,child: Container(color: Colors.grey,),), - SizedBox(width: 8,), - AppText( - patientInfo.status==2? 'Booked':'Confirmed', - color: patientInfo.status==2? Colors.grey:Colors.green , - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ) - ], - ):SizedBox(), + ], + ) + : patientInfo.patientStatusType == 42 + ? Row( + children: [ + AppText( + TranslationBase.of(context) + .notArrived, + color: Colors.red[800], + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 10, + ), + SizedBox( + width: 8, + ), + SizedBox( + height: 12, + width: 1.5, + child: Container( + color: Colors.grey, + ), + ), + SizedBox( + width: 8, + ), + AppText( + patientInfo.status == 2 + ? 'Confirmed' + : 'Booked', + color: patientInfo.status == 2 + ? Colors.green + : Colors.grey, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 10, + ), + ], + ) + : !isFromSearch && + !isFromLiveCare && + patientInfo.patientStatusType == + null + ? Row( + children: [ + AppText( + TranslationBase.of(context) + .notArrived, + color: Colors.red[800], + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + SizedBox( + width: 8, + ), + SizedBox( + height: 12, + width: 1.5, + child: Container( + color: Colors.grey, + ), + ), + SizedBox( + width: 8, + ), + AppText( + patientInfo.status == 2 + ? 'Booked' + : 'Confirmed', + color: + patientInfo.status == 2 + ? Colors.grey + : Colors.green, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ) + ], + ) + : SizedBox(), this.arrivalType == '1' ? AppText( patientInfo.startTime != null @@ -137,27 +200,39 @@ class PatientCard extends StatelessWidget { ) : patientInfo.arrivedOn != null ? AppText( - AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(patientInfo.arrivedOn,) - )+" "+ "${AppDateUtils.getStartTime(patientInfo.startTime)}", + AppDateUtils.getDayMonthYearDate( + AppDateUtils + .convertStringToDate( + patientInfo.arrivedOn, + )) + + " " + + "${AppDateUtils.getStartTime(patientInfo.startTime)}", fontFamily: 'Poppins', fontWeight: FontWeight.w400, - fontSize: 15, + fontSize: 15, ) - : (patientInfo.appointmentDate != null && patientInfo.appointmentDate.isNotEmpty)? - AppText( - - "${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate(patientInfo.appointmentDate,))} ${AppDateUtils.getStartTime(patientInfo.startTime)}", - fontFamily: 'Poppins', - fontWeight: FontWeight.w400, - fontSize: 15, - ):SizedBox() + : (patientInfo.appointmentDate != + null && + patientInfo + .appointmentDate.isNotEmpty) + ? AppText( + "${AppDateUtils.getDayMonthYearDate(AppDateUtils.convertStringToDate( + patientInfo.appointmentDate, + ))} ${AppDateUtils.getStartTime(patientInfo.startTime)}", + fontFamily: 'Poppins', + fontWeight: FontWeight.w400, + fontSize: 15, + ) + : SizedBox() ], )) : SizedBox(), - if(isInpatient && isMyPatient && !isFromSearch) + if (isInpatient && isMyPatient && !isFromSearch) Row( children: [ - SizedBox(width: 12,), + SizedBox( + width: 12, + ), AppText( 'My Patient', color: Colors.green, @@ -177,9 +252,14 @@ class PatientCard extends StatelessWidget { Expanded( // width: MediaQuery.of(context).size.width*0.51, child: AppText( - isFromLiveCare? Helpers.capitalize(patientInfo.fullName): (Helpers.capitalize(patientInfo.firstName) + - " " + - Helpers.capitalize(patientInfo.lastName)), + isFromLiveCare + ? Helpers.capitalize( + patientInfo.fullName) + : (Helpers.capitalize( + patientInfo.firstName) + + " " + + Helpers.capitalize( + patientInfo.lastName)), fontSize: 16, color: Color(0xff2e303a), fontWeight: FontWeight.w700, @@ -189,12 +269,14 @@ class PatientCard extends StatelessWidget { ), if (patientInfo.gender == 1) Icon( - DoctorApp.male_2, - color: Colors.blue, - ) else Icon( - DoctorApp.female_1, - color: Colors.pink, - ), + DoctorApp.male_2, + color: Colors.blue, + ) + else + Icon( + DoctorApp.female_1, + color: Colors.pink, + ), ]), ), Row( @@ -286,31 +368,30 @@ class PatientCard extends StatelessWidget { ), ), //if (isInpatient) - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: - TranslationBase.of(context).age + - " : ", - style: TextStyle(fontSize: 12)), - new TextSpan( - text: - "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 13)), - ], + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', ), + children: [ + new TextSpan( + text: TranslationBase.of(context).age + + " : ", + style: TextStyle(fontSize: 12)), + new TextSpan( + text: + "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 13)), + ], ), ), - if (isInpatient ) + ), + if (isInpatient) Container( child: RichText( text: new TextSpan( @@ -342,61 +423,75 @@ class PatientCard extends StatelessWidget { text: new TextSpan( style: new TextStyle( fontSize: - 2.0 * SizeConfig.textMultiplier, + 2.0 * SizeConfig.textMultiplier, color: Colors.black, fontFamily: 'Poppins', ), children: [ - new TextSpan( - text: TranslationBase.of(context).numOfDays + " : ", - style: TextStyle(fontSize: 12)), - new TextSpan( - text: "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", - style: TextStyle( - fontWeight: FontWeight.w700, - fontSize: 13)), - ]))), - + new TextSpan( + text: TranslationBase.of(context) + .numOfDays + + " : ", + style: TextStyle(fontSize: 12)), + new TextSpan( + text: + "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 13)), + ]))), ])) ]), - !isInpatient && !isFromSearch + isFromLiveCare ? Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - Container( - padding: EdgeInsets.all(4), - child: Image.asset( - patientInfo.appointmentType == - 'Regular' && - patientInfo.visitTypeId == 100 - ? 'assets/images/livecare.png' - : patientInfo.appointmentType == - 'Walkin' - ? 'assets/images/walkin.png' - : 'assets/images/booked.png', - height: 25, - width: 35, - )), - ]) - : (isInpatient == true) + Container( + padding: EdgeInsets.all(4), + child: Image.asset( + 'assets/images/livecare.png', + height: 25, + width: 35, + color: Colors.grey.shade700, + )), + ], + ) + : !isInpatient && !isFromSearch ? Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Container( padding: EdgeInsets.all(4), child: Image.asset( - 'assets/images/inpatient.png', + patientInfo.appointmentType == + 'Regular' && + patientInfo.visitTypeId == 100 + ? 'assets/images/livecare.png' + : patientInfo.appointmentType == + 'Walkin' + ? 'assets/images/walkin.png' + : 'assets/images/booked.png', height: 25, width: 35, )), ]) - : SizedBox() + : (isInpatient == true) + ? Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + padding: EdgeInsets.all(4), + child: Image.asset( + 'assets/images/inpatient.png', + height: 25, + width: 35, + )), + ]) + : SizedBox() ], ), onTap: onTap, )), )); } - - } From 3c325ef19979a78aa49b380a35abc9f415b99516 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 26 May 2021 17:05:08 +0300 Subject: [PATCH 21/25] fix load procedure --- lib/config/localized_values.dart | 2 +- .../procedure/procedure_service.dart | 4 ++-- lib/core/viewModel/procedure_View_model.dart | 12 +++++----- lib/models/patient/patiant_info_model.dart | 2 +- .../profile/lab_result/labs_home_page.dart | 3 ++- .../procedures/add-favourite-procedure.dart | 14 ++++-------- .../procedures/add-procedure-form.dart | 5 +++-- lib/screens/procedures/add_lab_orders.dart | 22 +------------------ .../procedures/add_radiology_order.dart | 21 +----------------- .../procedures/entity_list_fav_procedure.dart | 7 +++--- 10 files changed, 24 insertions(+), 68 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c5460859..d27f698c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -123,7 +123,7 @@ const Map> localizedValues = { 'en': 'please enter answer', 'ar': 'الرجاء ادخال اجابة ' }, - 'replay': {'en': 'Replay', 'ar': 'تاكيد'}, + 'replay': {'en': 'Reply', 'ar': 'تاكيد'}, 'progressNote': {'en': 'Progress Note', 'ar': 'ملاحظة التقدم'}, 'progress': {'en': 'Progress', 'ar': 'التقدم'}, 'note': {'en': 'Note', 'ar': 'ملاحظة'}, diff --git a/lib/core/service/patient_medical_file/procedure/procedure_service.dart b/lib/core/service/patient_medical_file/procedure/procedure_service.dart index 9e3d4297..0c284f3d 100644 --- a/lib/core/service/patient_medical_file/procedure/procedure_service.dart +++ b/lib/core/service/patient_medical_file/procedure/procedure_service.dart @@ -145,10 +145,10 @@ class ProcedureService extends BaseService { }, body: Map()); } - Future getProcedureCategory({String categoryName, String categoryID}) async { + Future getProcedureCategory({String categoryName, String categoryID,patientId}) async { _getProcedureCategoriseReqModel = GetProcedureReqModel( search: ["$categoryName"], - patientMRN: 0, + patientMRN: patientId, pageIndex: 0, clinicId: 0, pageSize: 0, diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 2c75f639..ad62158e 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -84,12 +84,11 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureCategory({String categoryName, String categoryID}) async { + Future getProcedureCategory({String categoryName, String categoryID, patientId}) async { hasError = false; - //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _procedureService.getProcedureCategory( - categoryName: categoryName, categoryID: categoryID); + categoryName: categoryName, categoryID: categoryID,patientId: patientId); if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); @@ -111,7 +110,6 @@ class ProcedureViewModel extends BaseViewModel { Future getProcedureTemplate({String categoryID}) async { hasError = false; - //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); await _procedureService.getProcedureTemplate(categoryID: categoryID); if (_procedureService.hasError) { @@ -135,10 +133,12 @@ class ProcedureViewModel extends BaseViewModel { .procedureTemplate .add(element); } else { - templateList.add(ProcedureTempleteDetailsModelList( + var template = ProcedureTempleteDetailsModelList( templateName: element.templateName, templateId: element.templateID, - template: element)); + template: element); + if(!templateList.contains(template)) + templateList.add(template); } }); print(templateList.length.toString()); diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 0cb067e0..75552184 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -10,7 +10,7 @@ class PatiantInformtion { String arrivalTime; String arrivalTimeD; int callStatus; - Null callStatusDisc; + dynamic callStatusDisc; int callTypeID; String clientRequestID; String clinicName; diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 5c65ceb4..1ebc4fd3 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_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/screens/patients/profile/lab_result/laboratory_result_page.dart'; +import 'package:doctor_app_flutter/screens/procedures/add_lab_home_screen.dart'; import 'package:doctor_app_flutter/screens/procedures/add_lab_orders.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; @@ -111,7 +112,7 @@ class _LabsHomePageState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => AddSelectedLabOrder( + builder: (context) => AddLabHomeScreen( patient: patient, model: model, )), diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index ac355a85..9b5a97ad 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -46,12 +46,8 @@ class _AddFavouriteProcedureState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) async { - // TODO mosa_change - // if (model.procedureTemplate.length == 0) { - model.getProcedureTemplate(); - // } - }, + onModelReady: (model) => + model.getProcedureTemplate(categoryID: widget.categoryID), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: false, @@ -61,14 +57,12 @@ class _AddFavouriteProcedureState extends State { Container( height: MediaQuery.of(context).size.height * 0.070, ), - if (model.procedureTemplate.length != 0) + if (model.templateList.length != 0) Expanded( child: NetworkBaseView( baseViewModel: model, child: EntityListCheckboxSearchFavProceduresWidget( - model: widget.model, - // masterList: widget.model.procedureTemplate, - //TODO change it to the new model + model: model, removeFavProcedure: (item) { setState(() { entityList.remove(item); diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 844ff246..354ada19 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -203,6 +203,7 @@ class _AddSelectedProcedureState extends State { if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) model.getProcedureCategory( + patientId: patient.patientId, categoryName: procedureName.text); else @@ -223,8 +224,8 @@ class _AddSelectedProcedureState extends State { if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) model.getProcedureCategory( - categoryName: - procedureName.text); + patientId: patient.patientId, + categoryName: procedureName.text); else DrAppToastMsg.showErrorToast( TranslationBase.of(context) diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart index a4cb4e68..b8d4e7c7 100644 --- a/lib/screens/procedures/add_lab_orders.dart +++ b/lib/screens/procedures/add_lab_orders.dart @@ -138,7 +138,7 @@ class _AddSelectedLabOrderState extends State { final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) => model.getProcedureCategory( - categoryName: "Laboratory", categoryID: "02"), + categoryName: "Laboratory", categoryID: "02",patientId: patient.patientId), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: false, @@ -158,26 +158,6 @@ class _AddSelectedLabOrderState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - TranslationBase.of(context).applyForNewLabOrder, - fontWeight: FontWeight.w700, - fontSize: 20, - ), - - InkWell( - child: Icon( - Icons.close, - size: 28.0, - ), - onTap: () { - Navigator.pop(context); - }, - ), - ], - ), SizedBox( height: 10.0, ), diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart index 78e91ba8..dc68aacc 100644 --- a/lib/screens/procedures/add_radiology_order.dart +++ b/lib/screens/procedures/add_radiology_order.dart @@ -141,7 +141,7 @@ class _AddSelectedRadiologyOrderState extends State { final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) => model.getProcedureCategory( - categoryName: "Radiology", categoryID: "03"), + categoryName: "Radiology", categoryID: "03",patientId: patient.patientId), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: false, @@ -161,25 +161,6 @@ class _AddSelectedRadiologyOrderState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - TranslationBase.of(context).newRadiologyOrder, - fontWeight: FontWeight.w700, - fontSize: 20, - ), - InkWell( - child: Icon( - Icons.close, - size: 28.0, - ), - onTap: () { - Navigator.pop(context); - }, - ), - ], - ), SizedBox( height: 10.0, ), diff --git a/lib/screens/procedures/entity_list_fav_procedure.dart b/lib/screens/procedures/entity_list_fav_procedure.dart index c5189a48..822726ce 100644 --- a/lib/screens/procedures/entity_list_fav_procedure.dart +++ b/lib/screens/procedures/entity_list_fav_procedure.dart @@ -61,14 +61,13 @@ class _EntityListCheckboxSearchFavProceduresWidgetState } List items = List(); - List itemss = List(); List itemsProcedure = List(); List remarksList = List(); List typeList = List(); @override void initState() { - items.addAll(widget.masterList); + //items.addAll(widget.masterList); super.initState(); } @@ -103,9 +102,9 @@ class _EntityListCheckboxSearchFavProceduresWidgetState SizedBox( height: 15, ), - items.length != 0 + widget.model.templateList.length != 0 ? Column( - children: itemss.map((historyInfo) { + children: widget.model.templateList.map((historyInfo) { return ExpansionProcedure( procedureTempleteModel: historyInfo, model: widget.model, From e336821f65820259f288e48fa857cf4914f832af Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 27 May 2021 15:43:47 +0300 Subject: [PATCH 22/25] fix lab result --- lib/config/localized_values.dart | 2 +- .../profile/lab_result/laboratory_result_page.dart | 12 +++++++----- .../patients/profile/lab_result/labs_home_page.dart | 4 ++-- lib/screens/procedures/add_radiology_screen.dart | 6 +++--- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d27f698c..231e7f9b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -932,7 +932,7 @@ const Map> localizedValues = { "ar": "تقدم بطلب جديد للمختبر الأشعة" }, "addLabOrder": {"en": "Add Lab Order", "ar": "إضافة طلب معمل"}, - "addRadiologyOrder": {"en": "Add Radiology Order", "ar": "إضافة اشغة"}, + "addRadiologyOrder": {"en": "Add Radiology Order", "ar": "إضافة اشعة"}, "newRadiologyOrder": {"en": "New Radiology Order", "ar": "طلب الأشعة الجديد"}, "orderDate": {"en": "Order Date", "ar": "تاريخ الطلب"}, "examType": {"en": "Exam Type", "ar": "نوع الفحص"}, diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index 3aae6e69..5f79038f 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -14,13 +14,15 @@ class LaboratoryResultPage extends StatefulWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; + final bool isInpatient; LaboratoryResultPage( {Key key, this.patientLabOrders, this.patient, this.patientType, - this.arrivalType}); + this.arrivalType, + this.isInpatient}); @override _LaboratoryResultPageState createState() => _LaboratoryResultPageState(); @@ -40,7 +42,7 @@ class _LaboratoryResultPageState extends State { onModelReady: (model) => model.getPatientLabResult( patientLabOrder: widget.patientLabOrders, patient: widget.patient, - isInpatient: widget.patientType =="1"), + isInpatient: true), builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBar: PatientProfileHeaderWhitAppointmentAppBar( @@ -64,9 +66,9 @@ class _LaboratoryResultPageState extends State { LaboratoryResultWidget( onTap: () async {}, billNo: widget.patientLabOrders.invoiceNo, - details: model - .patientLabSpecialResult.length > 0 ? model - .patientLabSpecialResult[0].resultDataHTML : null, + details: model.patientLabSpecialResult.length > 0 + ? model.patientLabSpecialResult[0].resultDataHTML + : null, orderNo: widget.patientLabOrders.orderNo, patientLabOrder: widget.patientLabOrders, patient: widget.patient, diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 1ebc4fd3..578e9f17 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -181,9 +181,9 @@ class _LabsHomePageState extends State { context, FadePage( page: LaboratoryResultPage( - patientLabOrders: - model.patientLabOrdersList[index], + patientLabOrders: model.patientLabOrdersList[index], patient: patient, + isInpatient:isInpatient, arrivalType: arrivalType, patientType: patientType, ), diff --git a/lib/screens/procedures/add_radiology_screen.dart b/lib/screens/procedures/add_radiology_screen.dart index ac21e7d9..26308553 100644 --- a/lib/screens/procedures/add_radiology_screen.dart +++ b/lib/screens/procedures/add_radiology_screen.dart @@ -77,7 +77,7 @@ class _AddRadiologyScreenState extends State mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - TranslationBase.of(context).addLabOrder, + TranslationBase.of(context).addRadiologyOrder, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -147,8 +147,8 @@ class _AddRadiologyScreenState extends State AddFavouriteProcedure( patient: patient, model: model, - addButtonTitle: TranslationBase.of(context).addLabOrder, - toolbarTitle: TranslationBase.of(context).applyForNewLabOrder, + addButtonTitle: TranslationBase.of(context).addRadiologyOrder, + toolbarTitle: TranslationBase.of(context).addRadiologyOrder, categoryID: "03", ), AddSelectedRadiologyOrder( From 54fbe76c7b90bada6d9ae440767725815d96f668 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 27 May 2021 15:56:43 +0300 Subject: [PATCH 23/25] medical report fixes and vital sign --- .../MedicalReport/MeidcalReportModel.dart | 38 +++- .../MedicalReportDetailPage.dart | 10 +- .../medical_report/MedicalReportPage.dart | 214 ++++++++++-------- .../vital_sign/vital_sign_details_screen.dart | 2 +- .../vital_sign_item_details_screen.dart | 2 +- 5 files changed, 168 insertions(+), 98 deletions(-) diff --git a/lib/models/patient/MedicalReport/MeidcalReportModel.dart b/lib/models/patient/MedicalReport/MeidcalReportModel.dart index 450b93f6..473140d1 100644 --- a/lib/models/patient/MedicalReport/MeidcalReportModel.dart +++ b/lib/models/patient/MedicalReport/MeidcalReportModel.dart @@ -6,10 +6,19 @@ class MedicalReportModel { String invoiceNo; int status; String verifiedOn; - int verifiedBy; + String verifiedBy; String editedOn; int editedBy; int lineItemNo; + String createdOn; + int templateID; + int doctorID; + int doctorGender; + String doctorGenderDescription; + String doctorGenderDescriptionN; + String doctorImageURL; + String doctorName; + String doctorNameN; String reportDataHtml; MedicalReportModel( @@ -24,6 +33,15 @@ class MedicalReportModel { this.editedOn, this.editedBy, this.lineItemNo, + this.createdOn, + this.templateID, + this.doctorID, + this.doctorGender, + this.doctorGenderDescription, + this.doctorGenderDescriptionN, + this.doctorImageURL, + this.doctorName, + this.doctorNameN, this.reportDataHtml}); MedicalReportModel.fromJson(Map json) { @@ -38,6 +56,15 @@ class MedicalReportModel { editedOn = json['EditedOn']; editedBy = json['EditedBy']; lineItemNo = json['LineItemNo']; + createdOn = json['CreatedOn']; + templateID = json['TemplateID']; + doctorID = json['DoctorID']; + doctorGender = json['DoctorGender']; + doctorGenderDescription = json['DoctorGenderDescription']; + doctorGenderDescriptionN = json['DoctorGenderDescriptionN']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; reportDataHtml = json['ReportDataHtml']; } @@ -54,6 +81,15 @@ class MedicalReportModel { data['EditedOn'] = this.editedOn; data['EditedBy'] = this.editedBy; data['LineItemNo'] = this.lineItemNo; + data['CreatedOn'] = this.createdOn; + data['TemplateID'] = this.templateID; + data['DoctorID'] = this.doctorID; + data['DoctorGender'] = this.doctorGender; + data['DoctorGenderDescription'] = this.doctorGenderDescription; + data['DoctorGenderDescriptionN'] = this.doctorGenderDescriptionN; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; data['ReportDataHtml'] = this.reportDataHtml; return data; } diff --git a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart index 1233fe98..e63f39eb 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.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/models/patient/MedicalReport/MeidcalReportModel.dart'; @@ -23,10 +24,11 @@ class MedicalReportDetailPage extends StatelessWidget { String arrivalType = routeArgs['arrivalType']; MedicalReportModel medicalReport = routeArgs['medicalReport']; - return BaseView( + return BaseView( builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, appBar: PatientProfileHeaderNewDesignAppBar( patient, patientType, @@ -57,7 +59,7 @@ class MedicalReportDetailPage extends StatelessWidget { ], ), ), - Container( + medicalReport.reportDataHtml != null ? Container( width: double.infinity, margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16), @@ -73,8 +75,10 @@ class MedicalReportDetailPage extends StatelessWidget { ), ), child: Html( - data: medicalReport.reportDataHtml + data: medicalReport.reportDataHtml ?? "" ), + ) : Container( + ), ], ), diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index b54d4837..eb078dd5 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -17,6 +17,7 @@ import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:provider/provider.dart'; import '../../../../routes.dart'; @@ -84,113 +85,142 @@ class MedicalReportPage extends StatelessWidget { }, label: TranslationBase.of(context).createNewMedicalReport, ), - // if (model.state == ViewState.ErrorLocal) - // Container( - // child: ErrorMessage(error: model.error), - // ), if (model.state != ViewState.ErrorLocal) ...List.generate( model.medicalReportList.length, - (index) => CardWithBgWidget( - hasBorder: false, - bgColor: model.medicalReportList[index].status == 1 - ? Colors.red[700] - : Colors.green[700], - widget: Column( - children: [ - Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - model.medicalReportList[index].status == 1 - ? TranslationBase.of(context).onHold - : TranslationBase.of(context).verified, - color: model.medicalReportList[index].status == 1 - ? Colors.red[700] - : Colors.green[700], - ), - AppText( - "Jammal" ?? "", - fontSize: 15, - bold: true, - ), - ], - )), - Expanded( - child: Column( + (index) => Container( + margin: EdgeInsets.symmetric(horizontal: 8), + child: CardWithBgWidget( + hasBorder: false, + bgColor: model.medicalReportList[index].status == 1 + ? Colors.red[700] + : Colors.green[700], + widget: Column( + children: [ + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + model.medicalReportList[index].status == 1 + ? TranslationBase.of(context).onHold + : TranslationBase.of(context).verified, + color: + model.medicalReportList[index].status == + 1 + ? Colors.red[700] + : Colors.green[700], + fontSize: 1.4 * SizeConfig.textMultiplier, + bold: true, + ), + AppText( + projectViewModel.isArabic + ? model.medicalReportList[index] + .doctorNameN + : model.medicalReportList[index] + .doctorName, + fontSize: 1.9 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), + ), + ], + )), + Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - '${AppDateUtils.convertDateFromServerFormat( - model.medicalReportList[index].editedOn, - "dd/MM/yyyy")}', - color: Colors.black, + '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "dd MMM yyyy")}', + color: Color(0xFF2E303A), fontWeight: FontWeight.w600, - fontSize: 14, + fontSize: 1.6 * SizeConfig.textMultiplier, ), AppText( - '${AppDateUtils.convertDateFromServerFormat( - model.medicalReportList[index].editedOn, - "hh:mm a")}', + '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "hh:mm a")}', + color: Color(0xFF2E303A), fontWeight: FontWeight.w600, - color: Colors.grey[700], - fontSize: 14, + fontSize: 1.5 * SizeConfig.textMultiplier, ), ], ), - ), - ], - ), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - child: LargeAvatar( - name: "Jammal", - url: null, + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + margin: EdgeInsets.only( + left: 0, top: 4, right: 8, bottom: 0), + child: LargeAvatar( + name: projectViewModel.isArabic + ? model + .medicalReportList[index].doctorNameN + : model + .medicalReportList[index].doctorName, + url: model + .medicalReportList[index].doctorImageURL, + ), + width: 50, + height: 50, ), - width: 55, - height: 55, - ), - Expanded(child: AppText("")), - InkWell( - onTap: () { - if (model.medicalReportList[index].status == - 1) { - Navigator.of(context).pushNamed( - PATIENT_MEDICAL_REPORT_INSERT, - arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType, - 'type': MedicalReportStatus.ADD, - 'medicalReport': - model.medicalReportList[index] - }); - } else { - Navigator.of(context).pushNamed( - PATIENT_MEDICAL_REPORT_DETAIL, - arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType, - 'medicalReport': - model.medicalReportList[index] - }); - } - }, - child: Icon( - model.medicalReportList[index].status == 1 - ? EvaIcons.eye - : DoctorApp.edit_1, + Expanded( + child: Container( + height: 50, + child: AppText( + TranslationBase.of(context).showDetail, + fontSize: 1.4 * SizeConfig.textMultiplier, + ), + ), + // child: Html( + // data: model.medicalReportList[index] + // .reportDataHtml ?? + // ""), ), - ) - ], - ), - ], + Container( + child: InkWell( + onTap: () { + if (model.medicalReportList[index].status == + 1) { + Navigator.of(context).pushNamed( + PATIENT_MEDICAL_REPORT_DETAIL, + arguments: { + 'patient': patient, + 'patientType': patientType, + 'arrivalType': arrivalType, + 'medicalReport': + model.medicalReportList[index] + }); + } else { + Navigator.of(context).pushNamed( + PATIENT_MEDICAL_REPORT_INSERT, + arguments: { + 'patient': patient, + 'patientType': patientType, + 'arrivalType': arrivalType, + 'type': MedicalReportStatus.ADD, + 'medicalReport': + model.medicalReportList[index] + }); + } + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Icon( + model.medicalReportList[index].status == + 1 + ? EvaIcons.eye + : DoctorApp.edit_1, + ), + ], + ), + ), + ) + ], + ), + ], + ), ), ), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 33f9a1cb..e8314816 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -57,7 +57,7 @@ class VitalSignDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient.patientDetails?.firstName??''}'s", + "${patient.firstName ?? patient.patientDetails != null ? patient.patientDetails.firstName : patient.fullName}'s", fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart index 343d0590..9e6663de 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart @@ -202,7 +202,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient.patientDetails.firstName}'s", + "${patient.firstName ?? patient.patientDetails != null ? patient.patientDetails.firstName : patient.fullName}'s", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, From 6e660883f66bdfeca5a89435775e5a30fc9d2420 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 27 May 2021 16:12:17 +0300 Subject: [PATCH 24/25] Fix medical report --- .../MedicalReportDetailPage.dart | 4 +- .../medical_report/MedicalReportPage.dart | 235 +++++++++--------- 2 files changed, 121 insertions(+), 118 deletions(-) diff --git a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart index e63f39eb..7bf6f1d9 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportDetailPage.dart @@ -10,6 +10,8 @@ import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:provider/provider.dart'; @@ -78,7 +80,7 @@ class MedicalReportDetailPage extends StatelessWidget { data: medicalReport.reportDataHtml ?? "" ), ) : Container( - + child: ErrorMessage(error: "No Data",), ), ], ), diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index eb078dd5..746068ad 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -88,122 +88,122 @@ class MedicalReportPage extends StatelessWidget { if (model.state != ViewState.ErrorLocal) ...List.generate( model.medicalReportList.length, - (index) => Container( - margin: EdgeInsets.symmetric(horizontal: 8), - child: CardWithBgWidget( - hasBorder: false, - bgColor: model.medicalReportList[index].status == 1 - ? Colors.red[700] - : Colors.green[700], - widget: Column( - children: [ - Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - model.medicalReportList[index].status == 1 - ? TranslationBase.of(context).onHold - : TranslationBase.of(context).verified, - color: - model.medicalReportList[index].status == - 1 - ? Colors.red[700] - : Colors.green[700], - fontSize: 1.4 * SizeConfig.textMultiplier, - bold: true, - ), - AppText( - projectViewModel.isArabic - ? model.medicalReportList[index] - .doctorNameN - : model.medicalReportList[index] - .doctorName, - fontSize: 1.9 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w700, - color: Color(0xFF2E303A), - ), - ], - )), - Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - AppText( - '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "dd MMM yyyy")}', - color: Color(0xFF2E303A), - fontWeight: FontWeight.w600, - fontSize: 1.6 * SizeConfig.textMultiplier, - ), - AppText( - '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "hh:mm a")}', - color: Color(0xFF2E303A), - fontWeight: FontWeight.w600, - fontSize: 1.5 * SizeConfig.textMultiplier, - ), - ], - ), - ], - ), - Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Container( - margin: EdgeInsets.only( - left: 0, top: 4, right: 8, bottom: 0), - child: LargeAvatar( - name: projectViewModel.isArabic - ? model - .medicalReportList[index].doctorNameN - : model - .medicalReportList[index].doctorName, - url: model - .medicalReportList[index].doctorImageURL, + (index) => InkWell( + onTap: (){ + if (model.medicalReportList[index].status == + 1) { + Navigator.of(context).pushNamed( + PATIENT_MEDICAL_REPORT_DETAIL, + arguments: { + 'patient': patient, + 'patientType': patientType, + 'arrivalType': arrivalType, + 'medicalReport': + model.medicalReportList[index] + }); + } else { + Navigator.of(context).pushNamed( + PATIENT_MEDICAL_REPORT_INSERT, + arguments: { + 'patient': patient, + 'patientType': patientType, + 'arrivalType': arrivalType, + 'type': MedicalReportStatus.ADD, + 'medicalReport': + model.medicalReportList[index] + }); + } + }, + child: Container( + margin: EdgeInsets.symmetric(horizontal: 8), + child: CardWithBgWidget( + hasBorder: false, + bgColor: model.medicalReportList[index].status == 1 + ? Colors.red[700] + : Colors.green[700], + widget: Column( + children: [ + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + model.medicalReportList[index].status == 1 + ? TranslationBase.of(context).onHold + : TranslationBase.of(context).verified, + color: + model.medicalReportList[index].status == + 1 + ? Colors.red[700] + : Colors.green[700], + fontSize: 1.4 * SizeConfig.textMultiplier, + bold: true, + ), + AppText( + projectViewModel.isArabic + ? model.medicalReportList[index] + .doctorNameN + : model.medicalReportList[index] + .doctorName, + fontSize: 1.9 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w700, + color: Color(0xFF2E303A), + ), + ], + )), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "dd MMM yyyy")}', + color: Color(0xFF2E303A), + fontWeight: FontWeight.w600, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + AppText( + '${AppDateUtils.convertDateFromServerFormat(model.medicalReportList[index].editedOn ?? model.medicalReportList[index].createdOn, "hh:mm a")}', + color: Color(0xFF2E303A), + fontWeight: FontWeight.w600, + fontSize: 1.5 * SizeConfig.textMultiplier, + ), + ], ), - width: 50, - height: 50, - ), - Expanded( - child: Container( + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + margin: EdgeInsets.only( + left: 0, top: 4, right: 8, bottom: 0), + child: LargeAvatar( + name: projectViewModel.isArabic + ? model + .medicalReportList[index].doctorNameN + : model + .medicalReportList[index].doctorName, + url: model + .medicalReportList[index].doctorImageURL, + ), + width: 50, height: 50, - child: AppText( - TranslationBase.of(context).showDetail, - fontSize: 1.4 * SizeConfig.textMultiplier, + ), + Expanded( + child: Container( + height: 50, + child: AppText( + TranslationBase.of(context).showDetail, + fontSize: 1.4 * SizeConfig.textMultiplier, + ), ), + // child: Html( + // data: model.medicalReportList[index] + // .reportDataHtml ?? + // ""), ), - // child: Html( - // data: model.medicalReportList[index] - // .reportDataHtml ?? - // ""), - ), - Container( - child: InkWell( - onTap: () { - if (model.medicalReportList[index].status == - 1) { - Navigator.of(context).pushNamed( - PATIENT_MEDICAL_REPORT_DETAIL, - arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType, - 'medicalReport': - model.medicalReportList[index] - }); - } else { - Navigator.of(context).pushNamed( - PATIENT_MEDICAL_REPORT_INSERT, - arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType, - 'type': MedicalReportStatus.ADD, - 'medicalReport': - model.medicalReportList[index] - }); - } - }, + Container( child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ @@ -215,15 +215,16 @@ class MedicalReportPage extends StatelessWidget { ), ], ), - ), - ) - ], - ), - ], + ) + ], + ), + ], + ), ), ), ), ), + SizedBox(height: 15,) ], ), ), From 59e06f53af3e003b72506f00bc1e016e1afa2149 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 27 May 2021 16:33:57 +0300 Subject: [PATCH 25/25] hot fix --- .../patients/profile/vital_sign/vital_sign_details_screen.dart | 2 +- .../profile/vital_sign/vital_sign_item_details_screen.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index e8314816..37a7a60f 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -57,7 +57,7 @@ class VitalSignDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient.patientDetails != null ? patient.patientDetails.firstName : patient.fullName}'s", + "${patient.firstName ?? patient?.patientDetails?.firstName?? patient.fullName?? ''}'s", fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart index 9e6663de..49f82c2f 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart @@ -202,7 +202,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient.firstName ?? patient.patientDetails != null ? patient.patientDetails.firstName : patient.fullName}'s", + "${patient.firstName ?? patient?.patientDetails?.firstName?? patient.fullName?? ''}'s", fontFamily: 'Poppins', fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600,