From e2e92c1c59e96236975120f473d03af63b5df8a3 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 18 Mar 2021 20:37:54 +0200 Subject: [PATCH 1/6] Clinic List widget --- lib/screens/patients/patients_screen.dart | 179 ++++++++++++---------- 1 file changed, 100 insertions(+), 79 deletions(-) diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index ed535b47..ac91050e 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -42,7 +42,7 @@ class _PatientsScreenState extends State { List date; List unFilterDate; - var clinicId; + int clinicId; AuthViewModel authProvider; Color sideColor = Colors.black; @@ -340,10 +340,7 @@ class _PatientsScreenState extends State { children: [ Padding( padding: EdgeInsets.only( - top: MediaQuery.of(context) - .size - .height * - 0.03), + top:0), child: SERVICES_PATIANT2[ int.parse(patientType)] == "List_MyOutPatient" @@ -371,80 +368,10 @@ class _PatientsScreenState extends State { height: 10.0, ), if(int.parse(patientType)==7) - projectsProvider - .doctorClinicsList.length > - 0 - ? FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - Container( - width: MediaQuery.of(context).size.width *0.8, - child: Center( - child: DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: - Colors.white, - iconEnabledColor: - Colors.black, - isExpanded: true, - value: clinicId == null - ? projectsProvider - .doctorClinicsList[ - 0] - .clinicID - : clinicId, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return projectsProvider - .doctorClinicsList - .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - AppText( - item.clinicName, - fontSize: SizeConfig - .textMultiplier * - 2.1, - color: Colors - .black, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) { - clinicId = newValue; - changeClinic(newValue, context, model); - }, - items: projectsProvider - .doctorClinicsList - .map((item) { - return DropdownMenuItem( - child: Text( - item.clinicName, - textAlign: - TextAlign.end, - ), - value: item.clinicID, - ); - }).toList(), - )), - ), - ), - ], - ), - ) - : AppText( - TranslationBase - .of(context) - .noClinic), + ClinicList(clinicId: clinicId,onClinicChange: (newValue) { + clinicId = newValue; + changeClinic(newValue, context, model); + },), Divider( thickness: 0.8, color: Color(0xffCCCCCC), @@ -663,3 +590,97 @@ class _PatientsScreenState extends State { ); } } + +// ignore: must_be_immutable +class ClinicList extends StatelessWidget { + + ProjectViewModel projectsProvider; + final int clinicId; + final Function (int value) onClinicChange; + + ClinicList({Key key, this.clinicId, this.onClinicChange}) : super(key: key); + + @override + Widget build(BuildContext context) { + // authProvider = Provider.of(context); + + projectsProvider = Provider.of(context); + return Container( + child: + projectsProvider + .doctorClinicsList.length > + 0 + ? FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width *0.8, + child: Center( + child: DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: + Colors.white, + iconEnabledColor: + Colors.black, + isExpanded: true, + value: clinicId == null + ? projectsProvider + .doctorClinicsList[ + 0] + .clinicID + : clinicId, + iconSize: 25, + elevation: 16, + selectedItemBuilder: + (BuildContext + context) { + return projectsProvider + .doctorClinicsList + .map((item) { + return Row( + mainAxisSize: + MainAxisSize + .max, + children: [ + AppText( + item.clinicName, + fontSize: SizeConfig + .textMultiplier * + 2.1, + color: Colors + .black, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue){ + onClinicChange(newValue); + }, + items: projectsProvider + .doctorClinicsList + .map((item) { + return DropdownMenuItem( + child: Text( + item.clinicName, + textAlign: + TextAlign.end, + ), + value: item.clinicID, + ); + }).toList(), + )), + ), + ), + ], + ), + ) + : AppText( + TranslationBase + .of(context) + .noClinic), + ); + } +} + From e7e4aad9624d3eeb5a810704a95453f0964eb73b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 21 Mar 2021 09:09:37 +0200 Subject: [PATCH 2/6] add ECG service --- ios/Podfile.lock | 2 +- lib/config/config.dart | 3 + lib/core/model/PatientMuseResultsModel.dart | 64 +++++++++++++++++++ lib/core/service/PatientMuseService.dart | 28 ++++++++ lib/core/viewModel/PatientMuseViewModel.dart | 23 +++++++ lib/locator.dart | 4 ++ .../profile/patient_profile_screen.dart | 2 +- lib/screens/sick-leave/add-sickleave.dart | 1 + .../profile/profile_medical_info_widget.dart | 2 +- pubspec.lock | 6 +- 10 files changed, 129 insertions(+), 6 deletions(-) create mode 100644 lib/core/model/PatientMuseResultsModel.dart create mode 100644 lib/core/service/PatientMuseService.dart create mode 100644 lib/core/viewModel/PatientMuseViewModel.dart diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 9c86879d..46d7599e 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -292,4 +292,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.0.rc.1 +COCOAPODS: 1.10.1 diff --git a/lib/config/config.dart b/lib/config/config.dart index 35c35ef3..4ba98b6b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -212,6 +212,9 @@ const GET_PROCEDURE_VALIDATION = const GET_BOX_QUANTITY = 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; +///GET ECG +const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/core/model/PatientMuseResultsModel.dart b/lib/core/model/PatientMuseResultsModel.dart new file mode 100644 index 00000000..8b10de83 --- /dev/null +++ b/lib/core/model/PatientMuseResultsModel.dart @@ -0,0 +1,64 @@ +import 'package:doctor_app_flutter/util/date-utils.dart'; + +class PatientMuseResultsModel { + int rowID; + String setupID; + int projectID; + String orderNo; + int lineItemNo; + int patientType; + int patientID; + String procedureID; + dynamic reportData; + String imageURL; + String createdBy; + String createdOn; + DateTime createdOnDateTime; + + PatientMuseResultsModel( + {this.rowID, + this.setupID, + this.projectID, + this.orderNo, + this.lineItemNo, + this.patientType, + this.patientID, + this.procedureID, + this.reportData, + this.imageURL, + this.createdBy, + this.createdOn}); + + PatientMuseResultsModel.fromJson(Map json) { + rowID = json['RowID']; + setupID = json['SetupID']; + projectID = json['ProjectID']; + orderNo = json['OrderNo']; + lineItemNo = json['LineItemNo']; + patientType = json['PatientType']; + patientID = json['PatientID']; + procedureID = json['ProcedureID']; + reportData = json['ReportData']; + imageURL = json['ImageURL']; + createdBy = json['CreatedBy']; + createdOn = json['CreatedOn']; + createdOnDateTime = DateUtils.getDateTimeFromServerFormat(json['CreatedOn']); + } + + Map toJson() { + final Map data = new Map(); + data['RowID'] = this.rowID; + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['OrderNo'] = this.orderNo; + data['LineItemNo'] = this.lineItemNo; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['ProcedureID'] = this.procedureID; + data['ReportData'] = this.reportData; + data['ImageURL'] = this.imageURL; + data['CreatedBy'] = this.createdBy; + data['CreatedOn'] = this.createdOn; + return data; + } +} diff --git a/lib/core/service/PatientMuseService.dart b/lib/core/service/PatientMuseService.dart new file mode 100644 index 00000000..891029c3 --- /dev/null +++ b/lib/core/service/PatientMuseService.dart @@ -0,0 +1,28 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/PatientMuseResultsModel.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; + +class PatientMuseService extends BaseService { + List patientMuseResultsModelList = List(); + + getECGPatient({int patientType, int patientOutSA,int patientID}) async { + Map body = Map(); + body['PatientType'] = patientType; + body['PatientOutSA'] = patientOutSA; + body['PatientID'] = patientID; + await baseAppClient.post( + GET_ECG, + onSuccess: (dynamic response, int statusCode) { + patientMuseResultsModelList.clear(); + response['HIS_GetPatientMuseResultsList'].forEach((v) { + patientMuseResultsModelList.add(PatientMuseResultsModel.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: body, + ); + } +} diff --git a/lib/core/viewModel/PatientMuseViewModel.dart b/lib/core/viewModel/PatientMuseViewModel.dart new file mode 100644 index 00000000..3f5e82ed --- /dev/null +++ b/lib/core/viewModel/PatientMuseViewModel.dart @@ -0,0 +1,23 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/PatientMuseService.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; + +import '../../locator.dart'; + +class PatientMuseViewModel extends BaseViewModel { + + PatientMuseService _patientMuseService = locator(); + + getECGPatient({int patientType, int patientOutSA, int patientID}) async { + setState(ViewState.Busy); + await _patientMuseService.getECGPatient( + patientID: patientID, + patientOutSA: patientOutSA, + patientType: patientType); + if (_patientMuseService.hasError) { + error = _patientMuseService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/locator.dart b/lib/locator.dart index f939effc..3a5b94b2 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:get_it/get_it.dart'; +import 'core/service/PatientMuseService.dart'; import 'core/service/SOAP_service.dart'; import 'core/service/patient-admission-request-service.dart'; import 'core/service/doctor_reply_service.dart'; @@ -25,6 +26,7 @@ import 'core/service/patient-doctor-referral-service.dart'; import 'core/service/referral_patient_service.dart'; import 'core/service/referred_patient_service.dart'; import 'core/service/schedule_service.dart'; +import 'core/viewModel/PatientMuseViewModel.dart'; import 'core/viewModel/SOAP_view_model.dart'; import 'core/viewModel/doctor_replay_view_model.dart'; import 'core/viewModel/medicine_view_model.dart'; @@ -58,6 +60,7 @@ void setupLocator() { locator.registerLazySingleton(() => AdmissionRequestService()); locator.registerLazySingleton(() => UcafService()); locator.registerLazySingleton(() => AuthService()); + locator.registerLazySingleton(() => PatientMuseService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -77,4 +80,5 @@ void setupLocator() { locator.registerFactory(() => AdmissionRequestViewModel()); locator.registerFactory(() => UcafViewModel()); locator.registerFactory(() => MedicalFileViewModel()); + locator.registerFactory(() => PatientMuseViewModel()); } diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index ba42173e..24b59f8e 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -27,7 +27,7 @@ class PatientProfileScreen extends StatelessWidget { PatiantInformtion patient; - + //TODO change it @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index ad74b760..a0546d98 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -17,6 +17,7 @@ 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/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 9bd2230d..c2b2d8a4 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -28,7 +28,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { String from; String to; - + //TODO change it PatiantInformtion patient; String patientType; @override diff --git a/pubspec.lock b/pubspec.lock index 909670db..d044f1fb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -573,7 +573,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.4" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -844,7 +844,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.2" + version: "1.10.0-nullsafety.1" stream_channel: dependency: transitive description: @@ -986,5 +986,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <=2.11.0-213.1.beta" + dart: ">=2.10.0 <2.11.0" flutter: ">=1.22.0 <2.0.0" From 42666e2200f9ceaed32249999c47fef0072000b4 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 21 Mar 2021 09:36:01 +0200 Subject: [PATCH 3/6] move clinic list to its own file --- lib/screens/patients/patients_screen.dart | 111 +++--------------- .../patients/clinic_list_dropdwon.dart | 99 ++++++++++++++++ 2 files changed, 116 insertions(+), 94 deletions(-) create mode 100644 lib/widgets/patients/clinic_list_dropdwon.dart diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index ac91050e..e0f3fe0e 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/routes.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/patients/PatientCard.dart'; +import 'package:doctor_app_flutter/widgets/patients/clinic_list_dropdwon.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; @@ -312,9 +313,22 @@ class _PatientsScreenState extends State { : _isError ? DrAppEmbeddedError(error: error) : lItems == null || lItems.length == 0 - ? DrAppEmbeddedError( - error: - TranslationBase.of(context).youDontHaveAnyPatient) + ? Column( + children: [ + if(int.parse(patientType)==7) + ClinicList(clinicId: clinicId,onClinicChange: (newValue) { + clinicId = newValue; + changeClinic(newValue, context, model); + },), + Divider( + thickness: 0.8, + color: Color(0xffCCCCCC), + ), + DrAppEmbeddedError( + error: + TranslationBase.of(context).youDontHaveAnyPatient), + ], + ) : Container( child: ListView( scrollDirection: Axis.vertical, @@ -591,96 +605,5 @@ class _PatientsScreenState extends State { } } -// ignore: must_be_immutable -class ClinicList extends StatelessWidget { - - ProjectViewModel projectsProvider; - final int clinicId; - final Function (int value) onClinicChange; - - ClinicList({Key key, this.clinicId, this.onClinicChange}) : super(key: key); - - @override - Widget build(BuildContext context) { - // authProvider = Provider.of(context); - projectsProvider = Provider.of(context); - return Container( - child: - projectsProvider - .doctorClinicsList.length > - 0 - ? FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - Container( - width: MediaQuery.of(context).size.width *0.8, - child: Center( - child: DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: - Colors.white, - iconEnabledColor: - Colors.black, - isExpanded: true, - value: clinicId == null - ? projectsProvider - .doctorClinicsList[ - 0] - .clinicID - : clinicId, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return projectsProvider - .doctorClinicsList - .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - AppText( - item.clinicName, - fontSize: SizeConfig - .textMultiplier * - 2.1, - color: Colors - .black, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue){ - onClinicChange(newValue); - }, - items: projectsProvider - .doctorClinicsList - .map((item) { - return DropdownMenuItem( - child: Text( - item.clinicName, - textAlign: - TextAlign.end, - ), - value: item.clinicID, - ); - }).toList(), - )), - ), - ), - ], - ), - ) - : AppText( - TranslationBase - .of(context) - .noClinic), - ); - } -} diff --git a/lib/widgets/patients/clinic_list_dropdwon.dart b/lib/widgets/patients/clinic_list_dropdwon.dart new file mode 100644 index 00000000..c903bd7b --- /dev/null +++ b/lib/widgets/patients/clinic_list_dropdwon.dart @@ -0,0 +1,99 @@ +// ignore: must_be_immutable +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class ClinicList extends StatelessWidget { + + ProjectViewModel projectsProvider; + final int clinicId; + final Function (int value) onClinicChange; + + ClinicList({Key key, this.clinicId, this.onClinicChange}) : super(key: key); + + @override + Widget build(BuildContext context) { + // authProvider = Provider.of(context); + + projectsProvider = Provider.of(context); + return Container( + child: + projectsProvider + .doctorClinicsList.length > + 0 + ? FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width *0.8, + child: Center( + child: DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: + Colors.white, + iconEnabledColor: + Colors.black, + isExpanded: true, + value: clinicId == null + ? projectsProvider + .doctorClinicsList[ + 0] + .clinicID + : clinicId, + iconSize: 25, + elevation: 16, + selectedItemBuilder: + (BuildContext + context) { + return projectsProvider + .doctorClinicsList + .map((item) { + return Row( + mainAxisSize: + MainAxisSize + .max, + children: [ + AppText( + item.clinicName, + fontSize: SizeConfig + .textMultiplier * + 2.1, + color: Colors + .black, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue){ + onClinicChange(newValue); + }, + items: projectsProvider + .doctorClinicsList + .map((item) { + return DropdownMenuItem( + child: Text( + item.clinicName, + textAlign: + TextAlign.end, + ), + value: item.clinicID, + ); + }).toList(), + )), + ), + ), + ], + ), + ) + : AppText( + TranslationBase + .of(context) + .noClinic), + ); + } +} \ No newline at end of file From 1af6115365aea868b406623c65f1140ef3c8322e Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 21 Mar 2021 09:53:25 +0200 Subject: [PATCH 4/6] add ECG and Show sick leave --- lib/core/viewModel/PatientMuseViewModel.dart | 3 + lib/routes.dart | 6 + lib/screens/patients/ECGPage.dart | 49 +++++++ lib/screens/sick-leave/add-sickleave.dart | 1 - lib/screens/sick-leave/show-sickleave.dart | 133 ++++++++++++++++++ .../profile_medical_info_widget_search.dart | 14 ++ 6 files changed, 205 insertions(+), 1 deletion(-) create mode 100644 lib/screens/patients/ECGPage.dart create mode 100644 lib/screens/sick-leave/show-sickleave.dart 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'), ], ), ); From 51c6329517c0e0745fc51d975fc6bfd45c730cde Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 21 Mar 2021 10:23:00 +0200 Subject: [PATCH 5/6] return back my code --- lib/screens/patients/patients_screen.dart | 32 ++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index f645e33b..5da9f397 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -1,7 +1,11 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; @@ -301,9 +305,26 @@ class _PatientsScreenState extends State { : _isError ? DrAppEmbeddedError(error: error) : lItems == null || lItems.length == 0 - ? DrAppEmbeddedError( - error: - TranslationBase.of(context).youDontHaveAnyPatient) + ? Column( + children: [ + + if(int.parse(patientType)==7) + Container( + margin: EdgeInsets.only(top: 70), + child: ClinicList(clinicId: clinicId,onClinicChange: (newValue) { + clinicId = newValue; + changeClinic(newValue, context, model); + },), + ), + Container( + margin: EdgeInsets.only(top: MediaQuery.of(context).size.height*0.35), + + child: DrAppEmbeddedError( + error: + TranslationBase.of(context).youDontHaveAnyPatient), + ), + ], + ) : Container( color: Colors.grey[200], child: ListView( @@ -347,6 +368,11 @@ class _PatientsScreenState extends State { SizedBox( height: 10.0, ), + if(int.parse(patientType)==7) + ClinicList(clinicId: clinicId,onClinicChange: (newValue) { + clinicId = newValue; + changeClinic(newValue, context, model); + },), Padding( padding: EdgeInsets.only( top: MediaQuery.of(context) From 7d85c8b69268d9901430e7b6727bfddacd9fcb3b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 21 Mar 2021 10:26:23 +0200 Subject: [PATCH 6/6] return back the condition --- .../profile/profile_medical_info_widget.dart | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index ee500957..fb0ef609 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -35,7 +35,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { crossAxisCount: 2, childAspectRatio: 1.5, children: [ - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -54,7 +54,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { }, isLoading: model.state == ViewState.BusyLocal, icon: 'create-episod.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -64,7 +64,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: UPDATE_EPISODE, icon: 'modilfy-episode.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -72,7 +72,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).service, icon: 'radiology-1.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -81,7 +81,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine2: TranslationBase.of(context).service, icon: 'lab.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -94,7 +94,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { */ , icon: 'heartbeat.png'), - // if (selectedPatientType != 7) + if (selectedPatientType != 7) PatientProfileButton( key: key, patient: patient, @@ -109,9 +109,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).previewHealth, nameLine2: TranslationBase.of(context).summaryReport, icon: 'radiology-1.png'), - // if (selectedPatientType != 0 && - // selectedPatientType != 5 && - // selectedPatientType != 7) + if (selectedPatientType != 0 && + selectedPatientType != 5 && + selectedPatientType != 7) PatientProfileButton( key: key, patient: patient, @@ -119,7 +119,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, icon: 'heartbeat.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -150,7 +150,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, icon: 'lab.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -158,7 +158,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).myReferral, nameLine2: TranslationBase.of(context).patient, icon: 'note.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -166,7 +166,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, icon: 'sick_leaves_icons.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient,