diff --git a/lib/core/viewModel/PatientMuseViewModel.dart b/lib/core/viewModel/PatientMuseViewModel.dart index 3f5e82ed..890b24d6 100644 --- a/lib/core/viewModel/PatientMuseViewModel.dart +++ b/lib/core/viewModel/PatientMuseViewModel.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/PatientMuseResultsModel.dart'; import 'package:doctor_app_flutter/core/service/PatientMuseService.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; @@ -8,6 +9,8 @@ class PatientMuseViewModel extends BaseViewModel { PatientMuseService _patientMuseService = locator(); + List get patientMuseResultsModelList => _patientMuseService.patientMuseResultsModelList; + getECGPatient({int patientType, int patientOutSA, int patientID}) async { setState(ViewState.Busy); await _patientMuseService.getECGPatient( diff --git a/lib/routes.dart b/lib/routes.dart index fe280d40..210396fe 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/root_page.dart'; import 'package:doctor_app_flutter/screens/medical-file/medical_file_page.dart'; +import 'package:doctor_app_flutter/screens/patients/ECGPage.dart'; import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-detail-screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/UCAF/UCAF-input-screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/insurance_approvals_screen.dart'; @@ -12,6 +13,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_pat import 'package:doctor_app_flutter/screens/live_care/video_call.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_screen_history.dart'; import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.dart'; +import 'package:doctor_app_flutter/screens/sick-leave/show-sickleave.dart'; import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_screen.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_soap_index.dart'; @@ -95,6 +97,7 @@ const String PATIENT_ADMISSION_REQUEST_2 = 'patients/admission-request-second'; const String PATIENT_ADMISSION_REQUEST_3 = 'patients/admission-request-third'; const String PATIENT_UCAF_REQUEST = 'patients/ucaf'; const String PATIENT_UCAF_DETAIL = 'patients/ucaf/detail'; +const String PATIENT_ECG = 'patients/ecg'; const String BODY_MEASUREMENTS = 'patients/body-measurements'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; @@ -106,6 +109,7 @@ const String ORDER_PROCEDURE = 'procedure/procedure'; // const String LIVECARE_END_DIALOG = 'video-call/EndCallDialogBox'; const String PATIENT_SICKLEAVE = 'patients/patient_sickleave'; const String ADD_SICKLEAVE = 'add-sickleave'; +const String SHOW_SICKLEAVE = 'show-sickleave'; const String RADIOLOGY = 'radiology'; //todo: change the routing way. var routes = { @@ -159,6 +163,7 @@ var routes = { // LIVECARE_END_DIALOG: (_) => EndCallDialogBox(), PATIENT_SICKLEAVE: (_) => SickLeaveScreen(), ADD_SICKLEAVE: (_) => AddSickLeavScreen(), + SHOW_SICKLEAVE: (_) => ShowSickLeaveScreen(), ORDER_PRESCRIPTION: (_) => NewPrescriptionScreen(), ORDER_PRESCRIPTION_HISTORY: (_) => NewPrescriptionHistoryScreen(), ORDER_PROCEDURE: (_) => ProcedureScreen(), @@ -167,4 +172,5 @@ var routes = { MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(), PATIENT_UCAF_REQUEST: (_) => UCAFInputScreen(), PATIENT_UCAF_DETAIL: (_) => UcafDetailScreen(), + PATIENT_ECG: (_) => ECGPage(), }; diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart new file mode 100644 index 00000000..ba76c031 --- /dev/null +++ b/lib/screens/patients/ECGPage.dart @@ -0,0 +1,49 @@ +import 'package:doctor_app_flutter/core/viewModel/PatientMuseViewModel.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/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class ECGPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + + return BaseView( + onModelReady: (model) => model.getECGPatient( + patientType: patient.patientType, + patientOutSA: 0, + patientID: patient.patientId), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: 'ECG', + body: ListView.builder( + itemCount: model.patientMuseResultsModelList.length, + itemBuilder: (context, index) => InkWell( + onTap: () async { + await launch( + model.patientMuseResultsModelList[index].imageURL); + }, + child: Container( + width: double.infinity, + margin: EdgeInsets.all(5), + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey,width: 2) + ), + child: Center( + child: Texts( + "${model.patientMuseResultsModelList[index].createdOnDateTime}"), + ), + ), + )), + ), + ); + } +} diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index a0546d98..ad74b760 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -17,7 +17,6 @@ import 'package:hexcolor/hexcolor.dart'; class AddSickLeavScreen extends StatelessWidget { PatiantInformtion patient; - //TODO jammal @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart new file mode 100644 index 00000000..c3bd3178 --- /dev/null +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -0,0 +1,133 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/sick_leave_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/models/sickleave/get_all_sickleave_response.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/card_with_bgNew_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class ShowSickLeaveScreen extends StatelessWidget { + PatiantInformtion patient; + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + return BaseView( + onModelReady: (model) => model.getSickLeave(patient.patientMRN ?? patient.patientId), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).sickleave, + body: SingleChildScrollView( + child: Column( + children: [ + PatientPageHeaderWidget(patient), + Column( + children: model.getAllSIckLeave + .map((GetAllSickLeaveResponse item) { + return CardWithBgWidgetNew( + widget: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 10, right: 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 4, + child: Wrap( + // mainAxisAlignment: + // MainAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.all(3), + child: AppText( + item.status == 1 + ? TranslationBase.of(context) + .hold + : item.status == 2 + ? TranslationBase.of( + context) + .active + : TranslationBase.of( + context) + .all, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + color: item.status == 1 + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .leaveStartDate + + ' ', + fontWeight: FontWeight.bold, + ), + Flexible( + child: Text( + item.startDate, + overflow: TextOverflow.ellipsis, + )) + ], + ), + AppText( + item.noOfDays.toString() + + ' ' + + TranslationBase.of(context) + .daysSickleave, + fontWeight: FontWeight.bold, + ), + Row(children: [ + AppText( + item.remarks ?? "", + ) + ]), + ], + ), + SizedBox( + width: 20, + ), + ], + ), + ), + + ], + )), + SizedBox( + height: 20, + ), + Divider( + height: 1, + ), + ], + )); + }).toList(), + ) + ], + ), + ), + ), + ); + } + + +} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart index a3f84804..5b4d5593 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -87,6 +87,20 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { nameLine1: TranslationBase.of(context).previewHealth, nameLine2: TranslationBase.of(context).summaryReport, icon: 'radiology-1.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'lab.png'), + PatientProfileButton( + key: key, + patient: patient, + route: SHOW_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'sick_leaves_icons.png'), ], ), );