From 67e0cac7428cd36a677295cc6c566e18d30a1f02 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 19 May 2021 17:46:00 +0300 Subject: [PATCH 01/11] add livecare to home --- lib/config/config.dart | 2 + lib/core/service/home/dasboard_service.dart | 21 +- lib/core/viewModel/dashboard_view_model.dart | 29 +- lib/screens/home/home_screen.dart | 267 ++++++++++-------- .../AddVerifyMedicalReport.dart | 187 +----------- .../medical_report/MedicalReportPage.dart | 51 ++-- pubspec.lock | 8 +- 7 files changed, 247 insertions(+), 318 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 0e8106bc..1760caef 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -295,6 +295,8 @@ const GET_PROCEDURE_TEMPLETE = const GET_PROCEDURE_TEMPLETE_DETAILS = "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; +const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/core/service/home/dasboard_service.dart b/lib/core/service/home/dasboard_service.dart index 5a66e9eb..685646ee 100644 --- a/lib/core/service/home/dasboard_service.dart +++ b/lib/core/service/home/dasboard_service.dart @@ -6,7 +6,8 @@ class DashboardService extends BaseService { List _dashboardItemsList = []; List get dashboardItemsList => _dashboardItemsList; - // DashboardModel _dashboard = DashboardModel(); + bool hasVirtualClinic; + String sServiceID; Future getDashboard() async { hasError = false; @@ -28,4 +29,22 @@ class DashboardService extends BaseService { }, ); } + + Future checkDoctorHasLiveCare() async { + hasError = false; + await baseAppClient.post( + DOCTOR_CHECK_HAS_LIVE_CARE, + onSuccess: (dynamic response, int statusCode) { + hasVirtualClinic = response['HasVirtualClinic']; + sServiceID = response['SserviceID']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: { + "DoctorID": 9920 + }, + ); + } } diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index a1f83293..bbbef0b6 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -12,14 +12,18 @@ import 'authentication_view_model.dart'; import 'base_view_model.dart'; class DashboardViewModel extends BaseViewModel { - final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); DashboardService _dashboardService = locator(); List get dashboardItemsList => _dashboardService.dashboardItemsList; - Future setFirebaseNotification(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async{ + bool get hasVirtualClinic => _dashboardService.hasVirtualClinic; + + String get sServiceID => _dashboardService.sServiceID; + + Future setFirebaseNotification(ProjectViewModel projectsProvider, + AuthenticationViewModel authProvider) async { setState(ViewState.Busy); await projectsProvider.getDoctorClinicsList(); @@ -50,12 +54,27 @@ class DashboardViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async { + Future checkDoctorHasLiveCare() async { + setState(ViewState.Busy); + await _dashboardService.checkDoctorHasLiveCare(); + if (_dashboardService.hasError) { + error = _dashboardService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future changeClinic( + int clinicId, AuthenticationViewModel authProvider) async { setState(ViewState.BusyLocal); await getDoctorProfile(); - ClinicModel clinicModel = ClinicModel(doctorID:doctorProfile.doctorID,clinicID: clinicId, projectID: doctorProfile.projectID,); + ClinicModel clinicModel = ClinicModel( + doctorID: doctorProfile.doctorID, + clinicID: clinicId, + projectID: doctorProfile.projectID, + ); await authProvider.getDoctorProfileBasedOnClinic(clinicModel); - if(authProvider.state == ViewState.ErrorLocal) { + if (authProvider.state == ViewState.ErrorLocal) { error = authProvider.error; } } diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 40277db9..f99dc727 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -33,7 +33,6 @@ import 'package:provider/provider.dart'; import 'package:sticky_headers/sticky_headers/widget.dart'; import '../../widgets/shared/app_texts_widget.dart'; -import 'home_page_card.dart'; class HomeScreen extends StatefulWidget { HomeScreen({Key key, this.title}) : super(key: key); @@ -55,6 +54,7 @@ class _HomeScreenState extends State { int sliderActiveIndex = 0; var clinicId; AuthenticationViewModel authenticationViewModel; + int colorIndex = 0; @override Widget build(BuildContext context) { @@ -68,9 +68,11 @@ class _HomeScreenState extends State { return BaseView( onModelReady: (model) async { - await model.setFirebaseNotification(projectsProvider, authenticationViewModel); + await model.setFirebaseNotification( + projectsProvider, authenticationViewModel); await model.getDashboard(); await model.getDoctorProfile(isGetProfile: true); + await model.checkDoctorHasLiveCare(); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -289,117 +291,7 @@ class _HomeScreenState extends State { child: ListView( scrollDirection: Axis.horizontal, children: [ - HomePatientCard( - backgroundColor: Color(0xffD02127), - backgroundIconColor: Colors.white12, - cardIcon: DoctorApp.inpatient, - textColor: Colors.white, - text: "Live Care Patients", - onTap: () { - Navigator.push( - context, - FadePage( - page: PatientInPatientScreen(), - ), - ); - }, - ), - HomePatientCard( - backgroundColor: Color(0xffD02127), - backgroundIconColor: Colors.white12, - cardIcon: DoctorApp.inpatient, - textColor: Colors.white, - text: TranslationBase.of(context) - .myInPatient, - onTap: () { - Navigator.push( - context, - FadePage( - page: PatientInPatientScreen(), - ), - ); - }, - ), - HomePatientCard( - backgroundColor: Colors.grey[300], - backgroundIconColor: Colors.white38, - cardIcon: DoctorApp.arrival_patients, - textColor: Colors.black, - text: TranslationBase.of(context) - .myOutPatient_2lines, - onTap: () { - String date = - AppDateUtils.convertDateToFormat( - DateTime( - DateTime.now().year, - DateTime.now().month, - DateTime.now().day), - 'yyyy-MM-dd'); - - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => OutPatientsScreen( - patientSearchRequestModel: - PatientSearchRequestModel( - from: date, - to: date, - doctorID: - authenticationViewModel - .doctorProfile - .doctorID)), - )); - }, - ), - HomePatientCard( - backgroundColor: Color(0xff2B353E), - backgroundIconColor: Colors.white10, - cardIcon: DoctorApp.referral_1, - textColor: Colors.white, - text: TranslationBase.of(context) - .myPatientsReferral, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - PatientReferralScreen(), - ), - ); - }, - ), - HomePatientCard( - backgroundColor: Color(0xffD02127), - backgroundIconColor: Colors.white10, - cardIcon: DoctorApp.search, - textColor: Colors.white, - text: TranslationBase.of(context) - .searchPatientDashBoard, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - PatientSearchScreen(), - )); - }, - ), - HomePatientCard( - backgroundColor: Color(0xffC9C9C9), - backgroundIconColor: Colors.black12, - cardIcon: DoctorApp.search_medicines, - textColor: Color(0xff2B353E), - text: TranslationBase.of(context) - .searchMedicineDashboard, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - MedicineSearchScreen(), - )); - }, - ), + ...homePatientsCardsWidget(model), ])), SizedBox( height: 20, @@ -416,4 +308,153 @@ class _HomeScreenState extends State { ), ); } + + List homePatientsCardsWidget(DashboardViewModel model) { + colorIndex = 0; + + List backgroundColors = List(3); + backgroundColors[0] = Color(0xffD02127); + backgroundColors[1] = Colors.grey[300]; + backgroundColors[2] = Color(0xff2B353E); + List backgroundIconColors = List(3); + backgroundIconColors[0] = Colors.white12; + backgroundIconColors[1] = Colors.white38; + backgroundIconColors[2] = Colors.white10; + List textColors = List(3); + textColors[0] = Colors.white; + textColors[1] = Colors.black; + textColors[2] = Colors.white; + + List patientCards = List(); + + if (model.hasVirtualClinic) { + patientCards.add(HomePatientCard( + backgroundColor: backgroundColors[colorIndex], + backgroundIconColor: backgroundIconColors[colorIndex], + cardIcon: DoctorApp.inpatient, + textColor: textColors[colorIndex], + text: + "${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}", + onTap: () { + Navigator.push( + context, + FadePage( + page: PatientInPatientScreen(), + ), + ); + }, + )); + changeColorIndex(); + } + + patientCards.add(HomePatientCard( + backgroundColor: backgroundColors[colorIndex], + backgroundIconColor: backgroundIconColors[colorIndex], + cardIcon: DoctorApp.inpatient, + textColor: textColors[colorIndex], + text: TranslationBase.of(context).myInPatient, + onTap: () { + Navigator.push( + context, + FadePage( + page: PatientInPatientScreen(), + ), + ); + }, + )); + changeColorIndex(); + + patientCards.add(HomePatientCard( + backgroundColor: backgroundColors[colorIndex], + backgroundIconColor: backgroundIconColors[colorIndex], + cardIcon: DoctorApp.arrival_patients, + textColor: textColors[colorIndex], + text: TranslationBase.of(context).myOutPatient_2lines, + onTap: () { + String date = AppDateUtils.convertDateToFormat( + DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day), + 'yyyy-MM-dd'); + + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => OutPatientsScreen( + patientSearchRequestModel: PatientSearchRequestModel( + from: date, + to: date, + doctorID: + authenticationViewModel.doctorProfile.doctorID)), + )); + }, + )); + changeColorIndex(); + + patientCards.add(HomePatientCard( + backgroundColor: backgroundColors[colorIndex], + backgroundIconColor: backgroundIconColors[colorIndex], + cardIcon: DoctorApp.referral_1, + textColor: textColors[colorIndex], + text: TranslationBase.of(context) + .myPatientsReferral, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PatientReferralScreen(), + ), + ); + }, + )); + changeColorIndex(); + + patientCards.add(HomePatientCard( + backgroundColor: backgroundColors[colorIndex], + backgroundIconColor: backgroundIconColors[colorIndex], + cardIcon: DoctorApp.search, + textColor: textColors[colorIndex], + text: TranslationBase.of(context) + .searchPatientDashBoard, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PatientSearchScreen(), + )); + }, + )); + changeColorIndex(); + + patientCards.add(HomePatientCard( + backgroundColor: backgroundColors[colorIndex], + backgroundIconColor: backgroundIconColors[colorIndex], + cardIcon: DoctorApp.search_medicines, + textColor: textColors[colorIndex], + text: TranslationBase.of(context) + .searchMedicineDashboard, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + MedicineSearchScreen(), + )); + }, + )); + changeColorIndex(); + + return [ + ...List.generate(patientCards.length, (index) => patientCards[index]) + .toList() + ]; + } + + changeColorIndex() { + colorIndex++; + if (colorIndex > 2) { + colorIndex = 0; + } + } } diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 4c51e3d7..a3fa91e9 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -1,6 +1,4 @@ -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/PatientMedicalReportViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/MedicalReport/MeidcalReportModel.dart'; @@ -11,14 +9,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/buttons/app_buttons_widget.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/html_rich_editor.dart'; import 'package:flutter/material.dart'; import 'package:html_editor_enhanced/html_editor.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 AddVerifyMedicalReport extends StatefulWidget { @override @@ -26,42 +21,6 @@ class AddVerifyMedicalReport extends StatefulWidget { } class _AddVerifyMedicalReportState extends State { - stt.SpeechToText speechHistoryFinding = stt.SpeechToText(); - stt.SpeechToText speechLaboratoryData = stt.SpeechToText(); - stt.SpeechToText speechRecommendation = stt.SpeechToText(); - var recognizedWord1; - var recognizedWord2; - var recognizedWord3; - var event = RobotProvider(); - - TextEditingController historyFindingController = TextEditingController(); - TextEditingController laboratoryDataController = TextEditingController(); - TextEditingController recommendationController = TextEditingController(); - String commentsError; - String comments2Error; - String comments3Error; - - @override - void initState() { - requestPermissions(); - event.controller.stream.listen((p) { - if (p['startPopUp'] == 'true') { - if (this.mounted) { - initSpeechState().then((value) { - onVoiceText(); - }); - initSpeechState2().then((value) { - onVoiceText2(); - }); - initSpeechState3().then((value) { - onVoiceText3(); - }); - } - } - }); - super.initState(); - } - @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -94,9 +53,15 @@ class _AddVerifyMedicalReportState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - HtmlRichEditor(initialText: model - .medicalReportTemplate[0] - .templateTextHtml, height: MediaQuery.of(context).size.height * 0.75,), + if (model.medicalReportTemplate.length > 0) + HtmlRichEditor( + initialText: model + .medicalReportTemplate[0] + .templateTextHtml, + height: + MediaQuery.of(context).size.height * + 0.75, + ), ], ), ), @@ -121,13 +86,13 @@ class _AddVerifyMedicalReportState extends State { // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, onPressed: () async { - - String txtOfMedicalReport = await HtmlEditor.getText(); + String txtOfMedicalReport = + await HtmlEditor.getText(); if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - model.insertMedicalReport(patient,txtOfMedicalReport - ); + model.insertMedicalReport( + patient, txtOfMedicalReport); GifLoaderDialogUtils.hideDialog(context); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); @@ -166,137 +131,11 @@ class _AddVerifyMedicalReportState extends State { )); } - onVoiceText() async { - new SpeechToText(context: context).showAlertDialog(context); - var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speechHistoryFinding.initialize( - onStatus: statusListener, onError: errorListener); - if (available) { - speechHistoryFinding.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."); - } - } - - onVoiceText2() async { - new SpeechToText(context: context).showAlertDialog(context); - var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speechLaboratoryData.initialize( - onStatus: statusListener, onError: errorListener); - if (available) { - speechLaboratoryData.listen( - onResult: resultListener2, - listenMode: stt.ListenMode.confirmation, - localeId: lang == 'en' ? 'en-US' : 'ar-SA', - ); - } else { - print("The user has denied the use of speech recognition."); - } - } - - onVoiceText3() async { - new SpeechToText(context: context).showAlertDialog(context); - var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speechRecommendation.initialize( - onStatus: statusListener, onError: errorListener); - if (available) { - speechRecommendation.listen( - onResult: resultListener3, - 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) { - recognizedWord1 = status == 'listening' ? 'Lisening...' : 'Sorry....'; - recognizedWord2 = status == 'listening' ? 'Lisening...' : 'Sorry....'; - recognizedWord3 = status == 'listening' ? 'Lisening...' : 'Sorry....'; - } - void requestPermissions() async { Map statuses = await [ Permission.microphone, ].request(); } - - void resultListener(result) { - recognizedWord1 = result.recognizedWords; - event.setValue({"searchText": recognizedWord1}); - - if (result.finalResult == true) { - setState(() { - SpeechToText.closeAlertDialog(context); - speechHistoryFinding.stop(); - historyFindingController.text += recognizedWord1 + '\n'; - }); - } else { - print(result.finalResult); - } - } - - void resultListener2(result) { - recognizedWord2 = result.recognizedWords; - event.setValue({"searchText": recognizedWord2}); - - if (result.finalResult == true) { - setState(() { - SpeechToText.closeAlertDialog(context); - speechLaboratoryData.stop(); - laboratoryDataController.text += recognizedWord2 + '\n'; - }); - } else { - print(result.finalResult); - } - } - - void resultListener3(result) { - recognizedWord3 = result.recognizedWords; - event.setValue({"searchText": recognizedWord3}); - - if (result.finalResult == true) { - setState(() { - SpeechToText.closeAlertDialog(context); - speechRecommendation.stop(); - recommendationController.text += recognizedWord3 + '\n'; - }); - } else { - print(result.finalResult); - } - } - - Future initSpeechState() async { - bool hasSpeech = await speechHistoryFinding.initialize( - onError: errorListener, onStatus: statusListener); - print(hasSpeech); - if (!mounted) return; - } - - Future initSpeechState2() async { - bool hasSpeech = await speechLaboratoryData.initialize( - onError: errorListener, onStatus: statusListener); - print(hasSpeech); - if (!mounted) return; - } - - Future initSpeechState3() async { - bool hasSpeech = await speechRecommendation.initialize( - onError: errorListener, onStatus: statusListener); - print(hasSpeech); - if (!mounted) return; - } } enum MedicalReportStatus { ADD, VERIFY } diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index 4dad827c..5e71dbd6 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -6,6 +6,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/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.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/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; @@ -32,12 +33,16 @@ class MedicalReportPage extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getMedicalReportList(patient), + onModelReady: (model) async { + await model.getMedicalReportList(patient); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } + }, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, backgroundColor: Theme.of(context).scaffoldBackgroundColor, - appBar: PatientProfileHeaderNewDesignAppBar( patient, patientType, @@ -80,10 +85,10 @@ 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) + // Container( + // child: ErrorMessage(error: model.error), + // ), if (model.state != ViewState.ErrorLocal) ...List.generate( model.medicalReportList.length, @@ -150,22 +155,26 @@ class MedicalReportPage extends StatelessWidget { onTap: () { if (model.medicalReportList[index].status == 0) { - Navigator.of(context) - .pushNamed(PATIENT_MEDICAL_REPORT_INSERT, arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType, - 'type': MedicalReportStatus.ADD, - 'medicalReport' : model.medicalReportList[index] - }); + 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] - }); + Navigator.of(context).pushNamed( + PATIENT_MEDICAL_REPORT_DETAIL, + arguments: { + 'patient': patient, + 'patientType': patientType, + 'arrivalType': arrivalType, + 'medicalReport': + model.medicalReportList[index] + }); } }, child: Icon( diff --git a/pubspec.lock b/pubspec.lock index 613c2753..980a4154 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -587,7 +587,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3-nullsafety.1" + version: "0.6.2" json_annotation: dependency: transitive description: @@ -629,7 +629,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: @@ -921,7 +921,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.2" + version: "1.10.0-nullsafety.1" sticky_headers: dependency: "direct main" description: @@ -1119,5 +1119,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 33ceb01d67463d503f1644cd99c2591a258a0f84 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 20 May 2021 09:52:21 +0300 Subject: [PATCH 02/11] first step from Live care patient list --- lib/config/config.dart | 1 + ...dingPatientERForDoctorAppRequestModel.dart | 22 ++++ .../patient/LiveCarePatientServices.dart | 23 ++++ .../viewModel/LiveCarePatientViewModel.dart | 28 ++++- lib/models/patient/patiant_info_model.dart | 10 +- lib/screens/home/home_screen.dart | 3 +- .../live_care/LiveCarePatientScreen.dart | 59 ---------- .../live_care/live_care_patient_screen.dart | 105 ++++++++++++++++++ lib/util/date-utils.dart | 8 +- lib/widgets/patients/PatientCard.dart | 17 +-- ...ent-profile-header-new-design-app-bar.dart | 7 +- 11 files changed, 205 insertions(+), 78 deletions(-) create mode 100644 lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart delete mode 100644 lib/screens/live_care/LiveCarePatientScreen.dart create mode 100644 lib/screens/live_care/live_care_patient_screen.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 0e8106bc..48248bb7 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -294,6 +294,7 @@ const GET_PROCEDURE_TEMPLETE = const GET_PROCEDURE_TEMPLETE_DETAILS = "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; +const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP ='Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp'; var selectedPatientType = 1; diff --git a/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart b/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart new file mode 100644 index 00000000..dc1f25b3 --- /dev/null +++ b/lib/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart @@ -0,0 +1,22 @@ +class PendingPatientERForDoctorAppRequestModel { + bool outSA; + int doctorID; + String sErServiceID; + + PendingPatientERForDoctorAppRequestModel( + {this.outSA, this.doctorID, this.sErServiceID}); + + PendingPatientERForDoctorAppRequestModel.fromJson(Map json) { + outSA = json['OutSA']; + doctorID = json['DoctorID']; + sErServiceID = json['SErServiceID']; + } + + Map toJson() { + final Map data = new Map(); + data['OutSA'] = this.outSA; + data['DoctorID'] = this.doctorID; + data['SErServiceID'] = this.sErServiceID; + return data; + } +} diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index 31d3cf82..a0c94af0 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -1,5 +1,28 @@ +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/patient/patiant_info_model.dart'; class LiveCarePatientServices extends BaseService{ + List _patientList = []; + List get patientList => _patientList; + + Future getPendingPatientERForDoctorApp(PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async{ + hasError = false; + await baseAppClient.post( + GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP, + onSuccess: (dynamic response, int statusCode) { + _patientList.clear(); + response['List_PendingPatientList'].forEach((v) { + _patientList.add(PatiantInformtion.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: pendingPatientERForDoctorAppRequestModel.toJson(), + ); + } } \ No newline at end of file diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index de185de6..9c3c267f 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -1,6 +1,32 @@ 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/patient/LiveCarePatientServices.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +import '../../locator.dart'; class LiveCarePatientViewModel extends BaseViewModel { - getPendingPatientERForDoctorApp() async {} + List filterData = []; + + LiveCarePatientServices _liveCarePatientServices = + locator(); + + getPendingPatientERForDoctorApp() async { + setState(ViewState.BusyLocal); + //TODO Change it to dynamic + PendingPatientERForDoctorAppRequestModel + pendingPatientERForDoctorAppRequestModel = + PendingPatientERForDoctorAppRequestModel(doctorID: 9920,sErServiceID: "7,3", outSA: false); + await _liveCarePatientServices + .getPendingPatientERForDoctorApp(pendingPatientERForDoctorAppRequestModel); + if (_liveCarePatientServices.hasError) { + error = _liveCarePatientServices.error; + + setState(ViewState.ErrorLocal); + } else { + filterData = _liveCarePatientServices.patientList; + setState(ViewState.Idle); + } + } } diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 2dec82d1..0c189b86 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -130,7 +130,7 @@ class PatiantInformtion { projectId: json["ProjectID"] ?? json["projectID"], clinicId: json["ClinicID"] ?? json["clinicID"], doctorId: json["DoctorID"] ?? json["doctorID"], - patientId: json["PatientID"] ?? + patientId: json["PatientID"]!= null ?json["PatientID"] is String ? int.parse(json["PatientID"]):json["PatientID"]: json["patientID"] ?? json['patientMRN'] ?? json['PatientMRN'], @@ -142,10 +142,10 @@ class PatiantInformtion { firstNameN: json["FirstNameN"] ?? json["firstNameN"], middleNameN: json["MiddleNameN"] ?? json["middleNameN"], lastNameN: json["LastNameN"] ?? json["lastNameN"], - gender: json["Gender"] ?? json["gender"], - fullName: json["fullName"] ?? json["fullName"], - fullNameN: json["fullNameN"] ?? json["fullNameN"], - dateofBirth: json["DateofBirth"] ?? json["dob"], + 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"], diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 40277db9..c79c5b70 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart'; import 'package:doctor_app_flutter/screens/home/home_patient_card.dart'; +import 'package:doctor_app_flutter/screens/live_care/live_care_patient_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart'; import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart'; @@ -299,7 +300,7 @@ class _HomeScreenState extends State { Navigator.push( context, FadePage( - page: PatientInPatientScreen(), + page: LiveCarePatientScreen(), ), ); }, diff --git a/lib/screens/live_care/LiveCarePatientScreen.dart b/lib/screens/live_care/LiveCarePatientScreen.dart deleted file mode 100644 index 9f5e55ac..00000000 --- a/lib/screens/live_care/LiveCarePatientScreen.dart +++ /dev/null @@ -1,59 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:flutter/material.dart'; - -class LiveCarePatientScreen extends StatefulWidget { - @override - _LiveCarePatientScreenState createState() => _LiveCarePatientScreenState(); -} - -class _LiveCarePatientScreenState extends State { - @override - Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), - decoration: BoxDecoration( - color: Colors.white, - ), - child: Container( - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - margin: EdgeInsets.only(top: 50), - child: Row(children: [ - IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Colors.black, //Colors.black, - onPressed: () => Navigator.pop(context), - ), - Expanded( - child: AppText( - "Live Care Patients", - fontSize: SizeConfig.textMultiplier * 2.8, - fontWeight: FontWeight.bold, - color: Color(0xFF2B353E), - ), - ), - ]), - ), - ), - Expanded( - child: Column( - children: [], - ), - ), - ], - ), - ), - ); - } -} diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart new file mode 100644 index 00000000..39c7cbb5 --- /dev/null +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -0,0 +1,105 @@ +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'; +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/shared/app_loader_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/errors/error_message.dart'; +import 'package:flutter/material.dart'; + +import '../../routes.dart'; + +class LiveCarePatientScreen extends StatefulWidget { + @override + _LiveCarePatientScreenState createState() => _LiveCarePatientScreenState(); +} + +class _LiveCarePatientScreenState extends State { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) async { + await model.getPendingPatientERForDoctorApp(); + + }, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + Expanded( + child: AppText( + "Live Care Patients", + fontSize: SizeConfig.textMultiplier * 2.8, + fontWeight: FontWeight.bold, + color: Color(0xFF2B353E), + ), + ), + ]), + ), + ), + model.state == ViewState.Idle ?Expanded( + child: Container( + child: model.filterData.isEmpty + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context) + .youDontHaveAnyPatient, + ), + ) + : ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.filterData.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: PatientCard( + patientInfo: model.filterData[index], + patientType: "0", + arrivalType: "0", + isFromSearch: false, + isInpatient: false, + isFromLiveCare:true, + onTap: () { + // TODO change the parameter to daynamic + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": model.filterData[index], + "patientType": "0", + "isSearch": false, + "isInpatient": false, + "arrivalType": "0", + "isSearchAndOut": false, + }); + }, + // isFromSearch: widget.isSearch, + ), + ); + })), + ):Expanded(child: AppLoaderWidget()), + ], + ), + ), + ); + } +} diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 44e7bffe..adddc292 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -305,9 +305,13 @@ class AppDateUtils { return DateFormat('hh:mm a').format(dateTime); } - static String getAgeByBirthday(dynamic birthday, BuildContext context) { + static String getAgeByBirthday(dynamic birthday, BuildContext context, { bool isServerFormat = true}) { // https://leechy.dev/calculate-dates-diff-in-dart - DateTime birthDate = AppDateUtils.getDateTimeFromServerFormat(birthday); + DateTime birthDate; + if(isServerFormat){ birthDate = AppDateUtils.getDateTimeFromServerFormat(birthday); + }else{ + birthDate = DateTime.parse('1986-08-15'); + } final now = DateTime.now(); int years = now.year - birthDate.year; int months = now.month - birthDate.month; diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 179633e7..8515c115 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -9,7 +8,6 @@ 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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; class PatientCard extends StatelessWidget { final PatiantInformtion patientInfo; @@ -19,6 +17,7 @@ class PatientCard extends StatelessWidget { final bool isInpatient; final bool isMyPatient; final bool isFromSearch; + final bool isFromLiveCare; const PatientCard( {Key key, @@ -26,8 +25,12 @@ class PatientCard extends StatelessWidget { this.onTap, this.patientType, this.arrivalType, - this.isInpatient, this.isMyPatient = false, this.isFromSearch = false}) + this.isInpatient, + this.isMyPatient = false, + this.isFromSearch = false, + this.isFromLiveCare = false}) : super(key: key); + @override Widget build(BuildContext context) { return Container( @@ -43,7 +46,7 @@ class PatientCard extends StatelessWidget { marginLeft: (!isMyPatient && isInpatient)?0:10, marginSymmetric:isFromSearch ? 10 : 0.0, hasBorder: false, - bgColor:(isMyPatient && !isFromSearch)?Colors.green[500]: patientInfo.patientStatusType == 43 + 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( @@ -103,7 +106,7 @@ class PatientCard extends StatelessWidget { fontSize: 10, ), ], - ): !isFromSearch && patientInfo.patientStatusType==null ? Row( + ): !isFromSearch&&!isFromLiveCare && patientInfo.patientStatusType==null ? Row( children: [ AppText( TranslationBase.of(context).notArrived, @@ -174,7 +177,7 @@ class PatientCard extends StatelessWidget { Expanded( // width: MediaQuery.of(context).size.width*0.51, child: AppText( - (Helpers.capitalize(patientInfo.firstName) + + isFromLiveCare? Helpers.capitalize(patientInfo.fullName): (Helpers.capitalize(patientInfo.firstName) + " " + Helpers.capitalize(patientInfo.lastName)), fontSize: 16, @@ -299,7 +302,7 @@ class PatientCard extends StatelessWidget { style: TextStyle(fontSize: 12)), new TextSpan( text: - "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", + "${AppDateUtils.getAgeByBirthday(patientInfo.dateofBirth, context, isServerFormat: !isFromLiveCare)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 13)), diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 07bfe8f7..795a01bf 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -60,7 +60,7 @@ class PatientProfileHeaderNewDesignAppBar 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 * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -158,7 +158,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + + TranslationBase.of(context).appointmentDate + " : ", fontSize: 14, ), @@ -182,6 +182,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget SizedBox( width: 3.5, ), + Container( child: AppText( convertDateFormat2( @@ -260,7 +261,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget style: TextStyle(fontSize: 14)), new TextSpan( text: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth??"" : patient.dateofBirth??"", context)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth??"" : patient.dateofBirth??"", context,)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 14)), ], From 186461f3a87d2f7fd16a8ba28ed34d511e46fa5f Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 20 May 2021 10:41:44 +0300 Subject: [PATCH 03/11] hot fix --- lib/config/config.dart | 4 ++-- lib/core/service/home/dasboard_service.dart | 2 +- lib/screens/home/home_screen.dart | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 54a2d46e..a54bc613 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/home/dasboard_service.dart b/lib/core/service/home/dasboard_service.dart index 685646ee..a1072676 100644 --- a/lib/core/service/home/dasboard_service.dart +++ b/lib/core/service/home/dasboard_service.dart @@ -6,7 +6,7 @@ class DashboardService extends BaseService { List _dashboardItemsList = []; List get dashboardItemsList => _dashboardItemsList; - bool hasVirtualClinic; + bool hasVirtualClinic = false; String sServiceID; Future getDashboard() async { diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index f99dc727..147ffd4d 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -240,10 +240,10 @@ class _HomeScreenState extends State { ), sliderActiveIndex == 1 ? DashboardSliderItemWidget( - model.dashboardItemsList[3]) + model.dashboardItemsList[6]) : sliderActiveIndex == 0 ? DashboardSliderItemWidget( - model.dashboardItemsList[6]) + model.dashboardItemsList[3]) : DashboardSliderItemWidget( model.dashboardItemsList[4]), ]))) From 5778a4a887acd323da2d2fba3b6913516e57acb2 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 20 May 2021 11:21:34 +0300 Subject: [PATCH 04/11] view list of Live care patient --- lib/config/config.dart | 4 +- .../viewModel/LiveCarePatientViewModel.dart | 30 +++++++++- lib/screens/home/home_screen.dart | 6 +- .../live_care/live_care_patient_screen.dart | 56 ++++++++++++++++++- 4 files changed, 89 insertions(+), 7 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 425403db..c5372a07 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/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 9c3c267f..611beac7 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -1,5 +1,6 @@ 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'; 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/patient/patiant_info_model.dart'; @@ -12,12 +13,15 @@ class LiveCarePatientViewModel extends BaseViewModel { LiveCarePatientServices _liveCarePatientServices = locator(); + DashboardService _dashboardService = + locator(); + getPendingPatientERForDoctorApp() async { setState(ViewState.BusyLocal); //TODO Change it to dynamic PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel = - PendingPatientERForDoctorAppRequestModel(doctorID: 9920,sErServiceID: "7,3", outSA: false); + PendingPatientERForDoctorAppRequestModel(doctorID:9920 /*doctorProfile.doctorID*/,sErServiceID:"7,3" /*_dashboardService.sServiceID*/, outSA: false); await _liveCarePatientServices .getPendingPatientERForDoctorApp(pendingPatientERForDoctorAppRequestModel); if (_liveCarePatientServices.hasError) { @@ -29,4 +33,28 @@ class LiveCarePatientViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + searchData(String str) { + 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(); + String patientID = + _liveCarePatientServices.patientList[i].patientId.toString(); + String mobile = + _liveCarePatientServices.patientList[i].mobileNumber.toUpperCase(); + + if (fullName.contains(str.toUpperCase()) || + patientID.contains(str)|| mobile.contains(str)) { + filterData.add(_liveCarePatientServices.patientList[i]); + } + } + notifyListeners(); + } else { + filterData = _liveCarePatientServices.patientList; + notifyListeners(); + } + } } diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index f99dc727..dde5ae2a 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart'; import 'package:doctor_app_flutter/screens/home/home_patient_card.dart'; +import 'package:doctor_app_flutter/screens/live_care/live_care_patient_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/screens/patients/PatientsInPatientScreen.dart'; import 'package:doctor_app_flutter/screens/patients/out_patient/out_patient_screen.dart'; @@ -327,7 +328,8 @@ class _HomeScreenState extends State { List patientCards = List(); - if (model.hasVirtualClinic) { + //TODO: return back the right condition + if (true) { patientCards.add(HomePatientCard( backgroundColor: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], @@ -339,7 +341,7 @@ class _HomeScreenState extends State { Navigator.push( context, FadePage( - page: PatientInPatientScreen(), + page: LiveCarePatientScreen(), ), ); }, diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index 39c7cbb5..dfae66f2 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -1,6 +1,7 @@ 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'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; @@ -8,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_loader_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/errors/error_message.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_form_field.dart'; import 'package:flutter/material.dart'; import '../../routes.dart'; @@ -18,6 +20,8 @@ class LiveCarePatientScreen extends StatefulWidget { } class _LiveCarePatientScreenState extends State { + final _controller = TextEditingController(); + @override Widget build(BuildContext context) { return BaseView( @@ -56,7 +60,55 @@ class _LiveCarePatientScreenState extends State { ]), ), ), - model.state == ViewState.Idle ?Expanded( + SizedBox(height: 20,), + Center( + child: FractionallySizedBox( + widthFactor: .9, + child: Container( + width: double.maxFinite, + height: 75, + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: Color(0xffCCCCCC), + ), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only( + left: 10, top: 10), + child: AppText( + TranslationBase.of( + context) + .searchPatientName, + fontSize: 13, + )), + AppTextFormField( + // focusNode: focusProject, + controller: _controller, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + DoctorApp.filter_1, + color: Colors.black, + ), + iconSize: 20, + padding: + EdgeInsets.only( + bottom: 30), + ), + onChanged: (String str) { + model.searchData(str); + }), + ])), + ), + ), + Expanded( child: Container( child: model.filterData.isEmpty ? Center( @@ -96,7 +148,7 @@ class _LiveCarePatientScreenState extends State { ), ); })), - ):Expanded(child: AppLoaderWidget()), + ), ], ), ), From 97a855ab70ec729a8171b01357e6fcf8e826d639 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 20 May 2021 11:31:47 +0300 Subject: [PATCH 05/11] return condition in home page --- lib/screens/home/home_screen.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index dde5ae2a..60414976 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -328,8 +328,7 @@ class _HomeScreenState extends State { List patientCards = List(); - //TODO: return back the right condition - if (true) { + if (model.hasVirtualClinic) { patientCards.add(HomePatientCard( backgroundColor: backgroundColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex], From 3557e87b75136c6b1b08d225f9cbd2b4d9b5e688 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 20 May 2021 11:42:09 +0300 Subject: [PATCH 06/11] fix loading issue --- .../live_care/live_care_patient_screen.dart | 28 ++++++++++--------- lib/widgets/shared/app_loader_widget.dart | 2 +- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index dfae66f2..faa5405e 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -108,18 +108,19 @@ class _LiveCarePatientScreenState extends State { ])), ), ), - Expanded( - child: Container( - child: model.filterData.isEmpty - ? Center( - child: ErrorMessage( - error: TranslationBase.of(context) - .youDontHaveAnyPatient, - ), - ) - : ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, + model.state == ViewState.Idle + ? Expanded( + child: Container( + child: model.filterData.isEmpty + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context) + .youDontHaveAnyPatient, + ), + ) + : ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, itemCount: model.filterData.length, itemBuilder: (BuildContext ctxt, int index) { return Padding( @@ -148,7 +149,8 @@ class _LiveCarePatientScreenState extends State { ), ); })), - ), + ) : Expanded( + child: AppLoaderWidget(containerColor: Colors.transparent,)), ], ), ), diff --git a/lib/widgets/shared/app_loader_widget.dart b/lib/widgets/shared/app_loader_widget.dart index ef614209..4b6d753b 100644 --- a/lib/widgets/shared/app_loader_widget.dart +++ b/lib/widgets/shared/app_loader_widget.dart @@ -24,7 +24,7 @@ class _AppLoaderWidgetState extends State { child: Stack( children: [ Container( - color: Colors.grey.withOpacity(0.6), + color: widget.containerColor??Colors.grey.withOpacity(0.6), ), Container(child: GifLoaderContainer(), margin: EdgeInsets.only( bottom: MediaQuery.of(context).size.height * 0.09)) From 8e140abee9b3570585a0c027efff9c460ec8ee28 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 20 May 2021 11:45:25 +0300 Subject: [PATCH 07/11] make pending service dynamic --- lib/core/viewModel/LiveCarePatientViewModel.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 611beac7..803ea92a 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -18,10 +18,9 @@ class LiveCarePatientViewModel extends BaseViewModel { getPendingPatientERForDoctorApp() async { setState(ViewState.BusyLocal); - //TODO Change it to dynamic PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel = - PendingPatientERForDoctorAppRequestModel(doctorID:9920 /*doctorProfile.doctorID*/,sErServiceID:"7,3" /*_dashboardService.sServiceID*/, outSA: false); + PendingPatientERForDoctorAppRequestModel(sErServiceID:_dashboardService.sServiceID, outSA: false); await _liveCarePatientServices .getPendingPatientERForDoctorApp(pendingPatientERForDoctorAppRequestModel); if (_liveCarePatientServices.hasError) { From d49d52458b8ae0455b7db4d0fbba1b437379c3b8 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 20 May 2021 12:08:25 +0300 Subject: [PATCH 08/11] fix birthOfDate --- ios/Podfile.lock | 2 +- .../live_care/live_care_patient_screen.dart | 3 ++- .../patient_profile_screen.dart | 22 +++++++++---------- lib/util/date-utils.dart | 7 +++--- ...ent-profile-header-new-design-app-bar.dart | 22 +++++++++---------- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 59cdf14c..1cf7499c 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -328,4 +328,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.1 +COCOAPODS: 1.10.0.rc.1 diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index faa5405e..132cc214 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -131,7 +131,7 @@ class _LiveCarePatientScreenState extends State { arrivalType: "0", isFromSearch: false, isInpatient: false, - isFromLiveCare:true, + isFromLiveCare:true, onTap: () { // TODO change the parameter to daynamic Navigator.of(context).pushNamed( @@ -143,6 +143,7 @@ class _LiveCarePatientScreenState extends State { "isInpatient": false, "arrivalType": "0", "isSearchAndOut": false, + "isFromLiveCare":true }); }, // isFromSearch: widget.isSearch, 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 7a0305e4..dc4324ec 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -97,18 +97,16 @@ class _PatientProfileScreenState extends State Column( children: [ PatientProfileHeaderNewDesignAppBar( - patient, - arrivalType ?? '0', - patientType, - isInpatient: isInpatient, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) - ? 210 - : isDischargedPatient - ? 240 - : 0, - isDischargedPatient:isDischargedPatient - ), + patient, arrivalType ?? '0', patientType, + isInpatient: isInpatient, + isFromLiveCare: isFromLiveCare, + height: (patient.patientStatusType != null && + patient.patientStatusType == 43) + ? 210 + : isDischargedPatient + ? 240 + : 0, + isDischargedPatient: isDischargedPatient), Container( height: !isSearchAndOut ? isDischargedPatient diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index adddc292..fb68ab4e 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -305,12 +305,13 @@ class AppDateUtils { return DateFormat('hh:mm a').format(dateTime); } - static String getAgeByBirthday(dynamic birthday, BuildContext context, { bool isServerFormat = true}) { + static String getAgeByBirthday(String birthOfDate, BuildContext context, { bool isServerFormat = true}) { // https://leechy.dev/calculate-dates-diff-in-dart DateTime birthDate; - if(isServerFormat){ birthDate = AppDateUtils.getDateTimeFromServerFormat(birthday); + if(birthOfDate.contains("/Date")) { + birthDate = AppDateUtils.getDateTimeFromServerFormat(birthOfDate); }else{ - birthDate = DateTime.parse('1986-08-15'); + birthDate = DateTime.parse(birthOfDate); } final now = DateTime.now(); int years = now.year - birthDate.year; diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart index 795a01bf..995ac57a 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart @@ -19,9 +19,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final double height; final bool isInpatient; final bool isDischargedPatient; + final bool isFromLiveCare; PatientProfileHeaderNewDesignAppBar( - this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false}); + this.patient, this.patientType, this.arrivalType, {this.height = 0.0, this.isInpatient=false, this.isDischargedPatient=false, this.isFromLiveCare = false}); @override Widget build(BuildContext context) { @@ -152,7 +153,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget )) : SizedBox(), if (SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient") + "List_MyOutPatient" && !isFromLiveCare) Container( child: Row( mainAxisAlignment: MainAxisAlignment.start, @@ -182,15 +183,14 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget SizedBox( width: 3.5, ), - - Container( - child: AppText( - convertDateFormat2( - patient.appointmentDate ?? ''), - fontSize: 1.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, + Container( + child: AppText( + convertDateFormat2( + patient.appointmentDate ?? ''), + fontSize: 1.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), ), - ), SizedBox( height: 0.5, ) @@ -261,7 +261,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget style: TextStyle(fontSize: 14)), new TextSpan( text: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth??"" : patient.dateofBirth??"", context,)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth??"" : patient.dateofBirth??"", context,isServerFormat: !isFromLiveCare)}", style: TextStyle( fontWeight: FontWeight.w700, fontSize: 14)), ], From 6d989e3fc3cc465b3814bd8899205681a856b335 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 20 May 2021 14:19:30 +0300 Subject: [PATCH 09/11] finish new service for live care --- .../patient/LiveCarePatientServices.dart | 17 ++ .../viewModel/LiveCarePatientViewModel.dart | 24 ++ .../profile/in_patient_profile_screen.dart | 227 ------------------ .../patient_profile_screen.dart | 79 +++--- .../profile_gird_for_other.dart | 108 ++++++--- .../radiology/radiology_home_page.dart | 14 +- .../vital_sign/vital_sign_details_screen.dart | 36 +-- .../prescription/prescriptions_page.dart | 14 +- lib/screens/procedures/procedure_screen.dart | 15 +- .../profile/PatientProfileButton.dart | 5 +- 10 files changed, 198 insertions(+), 341 deletions(-) delete mode 100644 lib/screens/patients/profile/in_patient_profile_screen.dart diff --git a/lib/core/service/patient/LiveCarePatientServices.dart b/lib/core/service/patient/LiveCarePatientServices.dart index a0c94af0..e4443b9b 100644 --- a/lib/core/service/patient/LiveCarePatientServices.dart +++ b/lib/core/service/patient/LiveCarePatientServices.dart @@ -1,12 +1,18 @@ 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/patient/patiant_info_model.dart'; class LiveCarePatientServices extends BaseService{ List _patientList = []; List get patientList => _patientList; + bool _isFinished = false; + bool get isFinished => _isFinished; + + var endCallResponse = {}; + Future getPendingPatientERForDoctorApp(PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel) async{ hasError = false; await baseAppClient.post( @@ -25,4 +31,15 @@ class LiveCarePatientServices extends BaseService{ ); } + Future endCall(EndCallReq endCallReq) async { + + await baseAppClient.post(END_CALL, onSuccess: (response, statusCode) async { + _isFinished = true; + endCallResponse = response; + }, onFailure: (String error, int statusCode) { + _isFinished = true; + throw error; + }, body: endCallReq.toJson()); + } + } \ No newline at end of file diff --git a/lib/core/viewModel/LiveCarePatientViewModel.dart b/lib/core/viewModel/LiveCarePatientViewModel.dart index 803ea92a..0cce5f86 100644 --- a/lib/core/viewModel/LiveCarePatientViewModel.dart +++ b/lib/core/viewModel/LiveCarePatientViewModel.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDocto 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/patient/patiant_info_model.dart'; import '../../locator.dart'; @@ -13,6 +14,8 @@ class LiveCarePatientViewModel extends BaseViewModel { LiveCarePatientServices _liveCarePatientServices = locator(); + bool get isFinished => _liveCarePatientServices.isFinished; + DashboardService _dashboardService = locator(); @@ -33,6 +36,27 @@ class LiveCarePatientViewModel extends BaseViewModel { } } + Future endCall(request, isPatient, doctorID) async { + + EndCallReq endCallReq = new EndCallReq(); + endCallReq.doctorId = doctorID; //profile["DoctorID"]; + endCallReq.generalid = 'Cs2020@2016\$2958'; + endCallReq.vCID = request.vCID; //["VC_ID"]; + endCallReq.isDestroy = isPatient; + + setState(ViewState.BusyLocal); + await _liveCarePatientServices + .endCall(endCallReq); + if (_liveCarePatientServices.hasError) { + error = _liveCarePatientServices.error; + + setState(ViewState.ErrorLocal); + } else { + filterData = _liveCarePatientServices.patientList; + setState(ViewState.Idle); + } + } + searchData(String str) { var strExist= str.length > 0 ? true : false; if (strExist) { diff --git a/lib/screens/patients/profile/in_patient_profile_screen.dart b/lib/screens/patients/profile/in_patient_profile_screen.dart deleted file mode 100644 index 8b1c3b7e..00000000 --- a/lib/screens/patients/profile/in_patient_profile_screen.dart +++ /dev/null @@ -1,227 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/patient_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/patients/profile/PatientProfileButton.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design_in_patient.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; -import '../../../routes.dart'; - - -class InPatientProfileScreen extends StatefulWidget { - @override - _InPatientProfileScreenState createState() => _InPatientProfileScreenState(); -} - -class _InPatientProfileScreenState extends Statewith SingleTickerProviderStateMixin { - PatiantInformtion patient; - - bool isFromSearch = false; - - bool isInpatient = false; - - bool isDischargedPatient = false; - String patientType; - String arrivalType; - String from; - String to; - - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - patient = routeArgs['patient']; - patientType = routeArgs['patientType']; - arrivalType = routeArgs['arrivalType']; - from = routeArgs['from']; - to = routeArgs['to']; - if (routeArgs.containsKey("isSearch")) { - isFromSearch = routeArgs['isSearch']; - } - if (routeArgs.containsKey("isInpatient")) { - isInpatient = routeArgs['isInpatient']; - } - if (routeArgs.containsKey("isDischargedPatient")) { - isDischargedPatient = routeArgs['isDischargedPatient']; - } - - } - - @override - Widget build(BuildContext context) { - return BaseView( - builder: (_, patientViewModel, w) => AppScaffold( - baseViewModel: patientViewModel, - appBarTitle: TranslationBase.of(context).patientProfile, - isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar(patient,arrivalType??'0',patientType), - body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.only(top: 10), - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 15.0,horizontal: 15), - child: GridView.count( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - childAspectRatio: 1 / 1.0, - crossAxisCount: 3, - children: [ - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - isInPatient: true, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: LAB_RESULT, - isInPatient: true, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/lab_results.png'), - PatientProfileButton( - - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInPatient: isInpatient, - route: RADIOLOGY_PATIENT, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).result, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PRESCRIPTION_NEW, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).prescription, - icon: 'patient/order_prescription.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PROGRESS_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_NOTE, - isDischargedPatient: isDischargedPatient, - nameLine1: "Order", //"Text", - nameLine2: - "Sheet", //TranslationBase.of(context).orders, - icon: 'patient/Progress_notes.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'patient/Order_Procedures.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: HEALTH_SUMMARY, - nameLine1: "Health", - //TranslationBase.of(context).medicalReport, - nameLine2: "Summary", - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: HEALTH_SUMMARY, - nameLine1: "Medical", //Health - //TranslationBase.of(context).medicalReport, - nameLine2: "Report", //Report - //TranslationBase.of(context).summaryReport, - icon: 'patient/health_summary.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: REFER_IN_PATIENT_TO_DOCTOR, - isInPatient: true, - nameLine1: TranslationBase.of(context).referral, - nameLine2: TranslationBase.of(context).patient, - icon: 'patient/refer_patient.png'), - PatientProfileButton( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'patient/vital_signs.png'), - PatientProfileButton( - - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isDisable: true, - route: null, - nameLine1: "Discharge", - nameLine2: "Summery", - icon: 'patient/patient_sick_leave.png'), - PatientProfileButton( - - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'patient/patient_sick_leave.png'), - ], - ), - ), - ), - ), - )); - } -} - -class AvatarWidget extends StatelessWidget { - final Widget avatarIcon; - - AvatarWidget(this.avatarIcon); - - @override - Widget build(BuildContext context) { - return Container( - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) - ], - borderRadius: BorderRadius.all(Radius.circular(35.0)), - color: Color(0xffCCCCCC), - ), - child: avatarIcon, - ); - } -} 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 dc4324ec..344c5394 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/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'; @@ -85,9 +86,9 @@ class _PatientProfileScreenState extends State @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - return BaseView( - builder: (_, patientViewModel, w) => AppScaffold( - baseViewModel: patientViewModel, + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, appBarTitle: TranslationBase.of(context).patientProfile, isShowAppBar: false, body: Column( @@ -119,34 +120,35 @@ class _PatientProfileScreenState extends State child: isSearchAndOut ? ProfileGridForSearch( patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInpatient: isInpatient, - from: from, - to: to, - ) - : isInpatient - ? ProfileGridForInPatient( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInpatient: isInpatient, - from: from, - to: to, - isDischargedPatient: - isDischargedPatient, - isFromSearch: isFromSearch, - ) - : ProfileGridForOther( - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - isInpatient: isInpatient, - from: from, - to: to, - ), - ), - SizedBox( + patientType: patientType, + arrivalType: arrivalType, + isInpatient: isInpatient, + from: from, + to: to, + ) + : isInpatient + ? ProfileGridForInPatient( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInpatient: isInpatient, + from: from, + to: to, + isDischargedPatient: + isDischargedPatient, + isFromSearch: isFromSearch, + ) + : ProfileGridForOther( + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + isInpatient: isInpatient, + isFromLiveCare: isFromLiveCare, + from: from, + to: to, + ), + ), + SizedBox( height: MediaQuery.of(context).size.height * 0.05, ) ], @@ -270,14 +272,19 @@ class _PatientProfileScreenState extends State child: Center( child: AppButton( fontWeight: FontWeight.w700, - color: Colors.green[600], - title: TranslationBase + color: model.isFinished?Colors.red[600]:Colors.green[600], + title: model.isFinished?"End":TranslationBase .of(context) .initiateCall, onPressed: () async { - Navigator.push(context, MaterialPageRoute( - builder: (BuildContext context) => - EndCallScreen(patient:patient))); + if(model.isFinished) { + Navigator.push(context, MaterialPageRoute( + builder: (BuildContext context) => + EndCallScreen(patient:patient))); + } else { + // TODO Call initiateCall service + } + }, ), ), diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index 86ccd6d1..fee8b1e1 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -14,6 +14,7 @@ class ProfileGridForOther extends StatelessWidget { final String arrivalType; final double height; final bool isInpatient; + final bool isFromLiveCare; String from; String to; @@ -25,7 +26,8 @@ class ProfileGridForOther extends StatelessWidget { this.height, this.isInpatient, this.from, - this.to}) + this.to, + this.isFromLiveCare}) : super(key: key); @override @@ -74,41 +76,67 @@ class ProfileGridForOther extends StatelessWidget { 'patient/Order_Procedures.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).insurance, - TranslationBase.of(context).service, + TranslationBase + .of(context) + .insurance, + TranslationBase + .of(context) + .service, PATIENT_INSURANCE_APPROVALS_NEW, 'patient/vital_signs.png', isInPatient: isInpatient), PatientProfileCardModel( - TranslationBase.of(context).patientSick, - TranslationBase.of(context).leave, + TranslationBase + .of(context) + .patientSick, + TranslationBase + .of(context) + .leave, ADD_SICKLEAVE, 'patient/patient_sick_leave.png', isInPatient: isInpatient), - if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).ucaf, - PATIENT_UCAF_REQUEST, - 'patient/ucaf.png', - isInPatient: isInpatient, - isDisable: patient.patientStatusType != 43 ? true : false), - if (patient.appointmentNo != null && patient.appointmentNo != 0) - PatientProfileCardModel( - TranslationBase.of(context).referral, - TranslationBase.of(context).patient, - REFER_PATIENT_TO_DOCTOR, - 'patient/refer_patient.png', - isInPatient: isInpatient, - isDisable: patient.patientStatusType != 43 ? true : false), - if (patient.appointmentNo != null && patient.appointmentNo != 0) + if (isFromLiveCare || + (patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel( - TranslationBase.of(context).admission, - TranslationBase.of(context).request, + TranslationBase + .of(context) + .patient, + TranslationBase + .of(context) + .ucaf, + PATIENT_UCAF_REQUEST, + 'patient/ucaf.png', + isInPatient: isInpatient, + isDisable: patient.patientStatusType != 43 || + patient.appointmentNo == null ? true : false), + if (isFromLiveCare || + (patient.appointmentNo != null && patient.appointmentNo != 0)) + PatientProfileCardModel( + TranslationBase + .of(context) + .referral, + TranslationBase + .of(context) + .patient, + REFER_PATIENT_TO_DOCTOR, + 'patient/refer_patient.png', + isInPatient: isInpatient, + isDisable: patient.patientStatusType != 43 || + patient.appointmentNo == null ? true : false), + if (isFromLiveCare || + (patient.appointmentNo != null && patient.appointmentNo != 0)) + PatientProfileCardModel( + TranslationBase + .of(context) + .admission, + TranslationBase + .of(context) + .request, PATIENT_ADMISSION_REQUEST, 'patient/admission_req.png', isInPatient: isInpatient, - isDisable: patient.patientStatusType != 43 ? true : false), + isDisable: patient.patientStatusType != 43 || + patient.appointmentNo == null ? true : false), ]; return Column( @@ -124,20 +152,22 @@ class ProfileGridForOther extends StatelessWidget { itemCount: cardsList.length, staggeredTileBuilder: (int index) => StaggeredTile.fit(1), itemBuilder: (BuildContext context, int index) => PatientProfileButton( - patient: 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, + patient: 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, + isFromLiveCare: isFromLiveCare + ), ), ), diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 4b8d224e..7d70b677 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -25,6 +25,7 @@ class _RadiologyHomePageState extends State { PatiantInformtion patient; String arrivalType; bool isInpatient; + bool isFromLiveCare; @override void didChangeDependencies() { @@ -34,6 +35,7 @@ class _RadiologyHomePageState extends State { patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; isInpatient = routeArgs['isInpatient']; + isFromLiveCare = routeArgs['isFromLiveCare']; print(arrivalType); } @@ -97,21 +99,25 @@ class _RadiologyHomePageState extends State { fontSize: 13, ), AppText( - TranslationBase.of(context).result, + TranslationBase + .of(context) + .result, bold: true, fontSize: 22, ), ], ), ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) + if ((patient.patientStatusType != null && + patient.patientStatusType == 43) || + (isFromLiveCare && patient.appointmentNo != null)) AddNewOrder( onTap: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => AddSelectedRadiologyOrder( + builder: (context) => + AddSelectedRadiologyOrder( patient: patient, model: model, )), 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 a6f36784..4f3deeb3 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 @@ -9,9 +9,9 @@ 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'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; class VitalSignDetailsScreen extends StatelessWidget { int appointmentNo; @@ -39,6 +39,7 @@ class VitalSignDetailsScreen extends StatelessWidget { builder: (_, mode, widget) => AppScaffold( baseViewModel: mode, isShowAppBar: true, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, appBar: PatientProfileHeaderNewDesignAppBar( patient, patientType, arrivalType), appBarTitle: TranslationBase.of(context).vitalSign, @@ -587,31 +588,18 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ), ], - ), - ), - ), - ], - ) - : Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).vitalSignEmptyMsg, - fontWeight: FontWeight.normal, - color: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.5, - ), - ) - ], ), ), + ), + ], + ) + : Container( + color: Theme + .of(context) + .scaffoldBackgroundColor, + child: ErrorMessage(error: TranslationBase + .of(context) + .vitalSignEmptyMsg,)), ), ); } diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index a7367cf3..9bfd9b49 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -26,8 +26,8 @@ class PrescriptionsPage extends StatelessWidget { String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; bool isInpatient = routeArgs['isInpatient']; + bool isFromLiveCare = routeArgs['isFromLiveCare']; bool isSelectInpatient = routeArgs['isSelectInpatient']; - ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => isSelectInpatient ? model.getPrescriptionsInPatient(patient) @@ -86,21 +86,25 @@ class PrescriptionsPage extends StatelessWidget { fontSize: 13, ), AppText( - TranslationBase.of(context).prescriptions, + TranslationBase + .of(context) + .prescriptions, bold: true, fontSize: 22, ), ], ), ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) + if ((patient.patientStatusType != null && + patient.patientStatusType == 43) || + (isFromLiveCare && patient.appointmentNo != null)) AddNewOrder( onTap: () { addPrescriptionForm(context, model, patient, model.prescriptionList); }, - label: TranslationBase.of(context) + label: TranslationBase + .of(context) .applyForNewPrescriptionsOrder, ), ...List.generate( diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index b964392e..1829957d 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -5,7 +5,6 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/procedures/add-procedure-form.dart'; import 'package:doctor_app_flutter/screens/procedures/add_procedure_homeScreen.dart'; import 'package:doctor_app_flutter/screens/procedures/update-procedure.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -14,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:flutter/material.dart'; + import 'ProcedureCard.dart'; class ProcedureScreen extends StatelessWidget { @@ -31,6 +31,7 @@ class ProcedureScreen extends StatelessWidget { PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; + bool isFromLiveCare = routeArgs['isFromLiveCare']; bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) => model.getProcedure( @@ -91,21 +92,25 @@ class ProcedureScreen extends StatelessWidget { fontSize: 13, ), AppText( - TranslationBase.of(context).procedure, + TranslationBase + .of(context) + .procedure, bold: true, fontSize: 22, ), ], ), ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) + if ((patient.patientStatusType != null && + patient.patientStatusType == 43) || + (isFromLiveCare && patient.appointmentNo != null)) InkWell( onTap: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => AddProcedureHome( + builder: (context) => + AddProcedureHome( patient: patient, model: model, )), diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index c5580568..ef285150 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indei import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +// ignore: must_be_immutable class PatientProfileButton extends StatelessWidget { final String nameLine1; final String nameLine2; @@ -26,6 +27,7 @@ class PatientProfileButton extends StatelessWidget { final bool isSelectInpatient; final bool isDartIcon; final IconData dartIcon; + final bool isFromLiveCare; PatientProfileButton({ Key key, @@ -45,7 +47,7 @@ class PatientProfileButton extends StatelessWidget { this.isDischargedPatient = false, this.isSelectInpatient = false, this.isDartIcon = false, - this.dartIcon, + this.dartIcon, this.isFromLiveCare = false, }) : super(key: key); @override @@ -142,6 +144,7 @@ class PatientProfileButton extends StatelessWidget { 'isInpatient': isInPatient, 'isDischargedPatient': isDischargedPatient, 'isSelectInpatient': isSelectInpatient, + "isFromLiveCare":isFromLiveCare }); } } From 04c9a1168b607dd7bbbde0ad9007291f467d65ab Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 20 May 2021 14:34:30 +0300 Subject: [PATCH 10/11] add VC_ID --- lib/models/patient/patiant_info_model.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 0c189b86..fc77af66 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -62,6 +62,8 @@ class PatiantInformtion { String startTimes; String dischargeDate; int status; + int vcId; + PatiantInformtion( {this.patientDetails, this.projectId, @@ -121,7 +123,7 @@ class PatiantInformtion { this.nationalityFlagURL, this.patientStatusType, this.visitTypeId, - this.startTimes,this.dischargeDate,this.status}); + this.startTimes,this.dischargeDate,this.status, this.vcId}); factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( @@ -199,5 +201,6 @@ class PatiantInformtion { startTimes: json['StartTime'] ?? json['StartTime'], dischargeDate: json['DischargeDate'] , status: json['Status'] , + vcId: json['VC_ID'] , ); } From 1367f2bebb7fb8b706b884784e6afda244c9d994 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 20 May 2021 15:47:13 +0300 Subject: [PATCH 11/11] add translation --- lib/config/localized_values.dart | 1 + .../profile/profile_screen/patient_profile_screen.dart | 4 +++- lib/util/translations_delegate_base.dart | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index dcc4aa1f..e8309d70 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -996,4 +996,5 @@ const Map> localizedValues = { "impressionRecommendation": {"en": "Impression and Recommendation", "ar": "الانطباع والتوصية"}, "onHold": {"en": "'On Hold'", "ar": "قيد الانتظار"}, "verified": {"en": "'Verified'", "ar": "Verified"}, + "endCall": {"en": "'End'", "ar": "انهاء"}, }; 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..0ec0cf0e 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -273,7 +273,9 @@ class _PatientProfileScreenState extends State child: AppButton( fontWeight: FontWeight.w700, color: model.isFinished?Colors.red[600]:Colors.green[600], - title: model.isFinished?"End":TranslationBase + title: model.isFinished?TranslationBase + .of(context) + .endCall:TranslationBase .of(context) .initiateCall, onPressed: () async { diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index ac805956..9cf6e024 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1337,6 +1337,8 @@ class TranslationBase { 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 transferTo => localizedValues['transferTo'][locale.languageCode]; String get admin => localizedValues['admin'][locale.languageCode]; String get instructions => localizedValues['instructions'][locale.languageCode];