From e70eabe68d4b8e89109fea40e7afe56731b17041 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 22 Jun 2021 12:54:25 +0300 Subject: [PATCH] Fix live care issues and qr code --- lib/client/base_app_client.dart | 2 +- lib/config/localized_values.dart | 1 + .../PatientSearchRequestModel.dart | 8 ++-- lib/core/service/VideoCallService.dart | 6 +-- lib/core/service/home/scan_qr_service.dart | 8 ++-- .../viewModel/PatientSearchViewModel.dart | 6 ++- .../viewModel/authentication_view_model.dart | 2 +- .../insurance_approval_screen_patient.dart | 2 +- .../patient_profile_screen.dart | 39 +++++++++---------- .../assessment/update_assessment_page.dart | 2 +- .../objective/update_objective_page.dart | 2 +- .../soap_update/plan/update_plan_page.dart | 2 +- .../subjective/update_subjective_page.dart | 6 +-- .../prescription_checkout_screen.dart | 2 +- lib/screens/qr_reader/QR_reader_screen.dart | 4 +- 15 files changed, 47 insertions(+), 45 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 65c8341c..3c70c8cf 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -86,7 +86,7 @@ class BaseAppClient { int projectID = await sharedPref.getInt(PROJECT_ID); if (projectID == 2 || projectID == 3) body['PatientOutSA'] = true; - else if(body.containsKey('facilityId') && body['facilityId']==2 || body['facilityId']==3) + else if((body.containsKey('facilityId') && body['facilityId']==2 || body['facilityId']==3)|| body['ProjectID']==2 || body['ProjectID']==3) body['PatientOutSA'] = true; else body['PatientOutSA'] = false; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4d0436aa..eb122d89 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -57,6 +57,7 @@ const Map> localizedValues = { 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'searchMedicineDashboard': {'en': 'Search\nMedicines', 'ar': 'بحث\nعن الدواء'}, + 'searchMedicine': {'en': 'Search Medicines', 'ar': 'بحث عن الدواء'}, 'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'}, 'referPatient': {'en': 'Referral Patient', 'ar': 'إحالة مريض'}, 'myReferral': {'en': 'My Referral', 'ar': 'إحالة'}, diff --git a/lib/core/model/patient_muse/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart index 124f463a..b460fdee 100644 --- a/lib/core/model/patient_muse/PatientSearchRequestModel.dart +++ b/lib/core/model/patient_muse/PatientSearchRequestModel.dart @@ -16,7 +16,7 @@ class PatientSearchRequestModel { int clinicID=0; PatientSearchRequestModel( - {this.doctorID = 0, + {this.doctorID , this.firstName = "0", this.middleName = "0", this.lastName = "0", @@ -29,7 +29,7 @@ class PatientSearchRequestModel { this.from = "0", this.to = "0", this.clinicID, - this.nursingStationID = 0,this.projectID=0}); + this.nursingStationID = 0,this.projectID}); PatientSearchRequestModel.fromJson(Map json) { doctorID = json['DoctorID']; @@ -51,7 +51,7 @@ class PatientSearchRequestModel { Map toJson() { final Map data = new Map(); - data['DoctorID'] = 0; + data['DoctorID'] = this.doctorID; data['FirstName'] = this.firstName; data['MiddleName'] = this.middleName; data['LastName'] = this.lastName; @@ -63,7 +63,7 @@ class PatientSearchRequestModel { data['SearchType'] = this.searchType; data['MobileNo'] = this.mobileNo; data['IdentificationNo'] = this.identificationNo; - data['NursingStationID'] = this.nursingStationID; + //data['NursingStationID'] = this.nursingStationID; data['ClinicID'] = this.clinicID; data['ProjectID'] =this.projectID; return data; diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index 1bec02f5..d85774a6 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -27,9 +27,9 @@ class VideoCallService extends BaseService{ this.patient = patientModel; DoctorProfileModel doctorProfile = await getDoctorProfile(isGetProfile: true); await VideoChannel.openVideoCallScreen( - kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGIyZDljOTY3YjFiNWU1YzUzNzFmMjIyNjJmNmEzY2Y5NzZjOTdlYzpzZXNzaW9uX2lkPTFfTVg0ME56STBOemsxTkg1LU1UWXlNekEyTlRRMU9EVXhObjVrVFRoMFlVdFJXaXRYTWpadFZGZHFhSGxZVGpOdE1UVi1mZyZjcmVhdGVfdGltZT0xNjIzMDY1NDk1Jm5vbmNlPTAuMjM2Mjk0NTIwMTkyOTA4OTcmcm9sZT1wdWJsaXNoZXImZXhwaXJlX3RpbWU9MTYyNTY1NzQ5NCZpbml0aWFsX2xheW91dF9jbGFzc19saXN0PQ==", // startCallRes.openTokenID, - kSessionId:"1_MX40NzI0Nzk1NH5-MTYyMzA2NTQ1ODUxNn5kTTh0YUtRWitXMjZtVFdqaHlYTjNtMTV-fg", // startCallRes.openSessionID, - kApiKey: '47247954' ,//'46209962' + kToken: startCallRes.openTokenID, + kSessionId:startCallRes.openSessionID, + kApiKey: '46209962' ,//'46209962' vcId: patient.vcId, patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), tokenID: await sharedPref.getString(TOKEN), diff --git a/lib/core/service/home/scan_qr_service.dart b/lib/core/service/home/scan_qr_service.dart index bc6c8820..8ad92c89 100644 --- a/lib/core/service/home/scan_qr_service.dart +++ b/lib/core/service/home/scan_qr_service.dart @@ -11,11 +11,11 @@ class ScanQrService extends BaseService { hasError = false; await getDoctorProfile(); - if (isMyInpatient) { - requestModel.doctorID = doctorProfile.doctorID; - } else { + // if (isMyInpatient) { + // requestModel.doctorID = doctorProfile.doctorID; + // } else { requestModel.doctorID = 0; - } + //} await baseAppClient.post( GET_PATIENT_IN_PATIENT_LIST, diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 12d94498..8612ef9e 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -77,9 +77,11 @@ class PatientSearchViewModel extends BaseViewModel { sortOutPatient({bool isDes = false}){ if(isDes) - filterData.sort((PatiantInformtion a, PatiantInformtion b)=>b.appointmentDateWithDateTimeForm.compareTo(a.appointmentDateWithDateTimeForm)); + filterData= filterData.reversed.toList(); + // filterData.sort((PatiantInformtion a, PatiantInformtion b)=>b.appointmentDateWithDateTimeForm.compareTo(a.appointmentDateWithDateTimeForm)); else - filterData.sort((PatiantInformtion a, PatiantInformtion b)=>AppDateUtils.convertStringToDate(a.appointmentDate).compareTo(AppDateUtils.convertStringToDate(b.appointmentDate))); + filterData= filterData.reversed.toList(); + // filterData.sort((PatiantInformtion a, PatiantInformtion b)=>a.appointmentDateWithDateTimeForm.compareTo(b.appointmentDateWithDateTimeForm)); setState(ViewState.Idle); } diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index a161c861..9da1933a 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -255,7 +255,7 @@ class AuthenticationViewModel extends BaseViewModel { /// add  token to shared preferences in case of send activation code is success setDataAfterSendActivationSuccess(SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); - DrAppToastMsg.showSuccesToast("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); + // DrAppToastMsg.showSuccesToast("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); sharedPref.setString(VIDA_REFRESH_TOKEN_ID, diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 1ab0734b..bedca006 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -39,7 +39,7 @@ class _InsuranceApprovalScreenNewState ? (model) => model.getInsuranceInPatient(mrn: patient.patientId) : patient.appointmentNo != null ? (model) => model.getInsuranceApproval(patient, - appointmentNo: patient?.appointmentNo, + appointmentNo: int.parse(patient?.appointmentNo.toString()) , projectId: patient.projectId) : (model) => model.getInsuranceApproval(patient), builder: (BuildContext context, InsuranceViewModel model, Widget child) => 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 2c88835d..e11c1abf 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -46,6 +46,7 @@ class _PatientProfileScreenState extends State bool isCallFinished = false; bool isDischargedPatient = false; bool isSearchAndOut = false; + bool isCallStarted = false; String patientType; String arrivalType; String from; @@ -228,16 +229,12 @@ class _PatientProfileScreenState extends State height: 30, ), onPressed: () async { - if ((isFromLiveCare && - patient.appointmentNo != null && - patient.appointmentNo != 0) || - patient.patientStatusType == - 43) { + if ((isFromLiveCare && patient.appointmentNo != null ) || patient.patientStatusType == 43) { PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( appointmentNo: - patient.appointmentNo, + int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN); GifLoaderDialogUtils.showMyDialog( @@ -283,10 +280,7 @@ class _PatientProfileScreenState extends State height: 30, ), onPressed: () { - if ((isFromLiveCare && - patient.appointmentNo != - null && - patient.appointmentNo != 0) || + if ((isFromLiveCare && patient.appointmentNo != null && patient.appointmentNo != 0) || patient.patientStatusType == 43) { Navigator.of(context).pushNamed( @@ -294,7 +288,7 @@ class _PatientProfileScreenState extends State arguments: { 'patient': patient }); - } + } }), ], ), @@ -331,18 +325,13 @@ class _PatientProfileScreenState extends State title: isCallFinished? TranslationBase.of(context).endCall: TranslationBase.of(context).initiateCall, - disabled: model.state == ViewState.BusyLocal, + disabled: isCallStarted || model.state == ViewState.BusyLocal, onPressed: () async { // Navigator.push(context, MaterialPageRoute( // builder: (BuildContext context) => // EndCallScreen(patient:patient))); - // TODO MOSA remov it and uncomment the below code - AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){ - locator().openVideo(model.startCallRes, patient, callConnected, callDisconnected); - }); - - /* if(isCallFinished) { + if(isCallFinished) { Navigator.push(context, MaterialPageRoute( builder: (BuildContext context) => EndCallScreen(patient:patient))); } else { @@ -354,15 +343,23 @@ class _PatientProfileScreenState extends State Helpers.showErrorToast(model.error); } else { await model.getDoctorProfile(); - patient.appointmentNo = model.startCallRes.appointmentNo; + patient.appointmentNo = int.parse(model.startCallRes.appointmentNo.toString()); patient.episodeNo = 0; - + setState(() { + isCallStarted = true; + }); GifLoaderDialogUtils.hideDialog(context); AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){ locator().openVideo(model.startCallRes, patient, callConnected, callDisconnected); }); } - }*/ + } + + // AppPermissionsUtils.requestVideoCallPermission(context: context,onTapGrant: (){ + // locator().openVideo(model.startCallRes, patient, callConnected, callDisconnected); + // }); + + }, diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index 4f48ff27..fab69c44 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -55,7 +55,7 @@ class _UpdateAssessmentPageState extends State { episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: '', - appointmentNo: widget.patientInfo.appointmentNo); + appointmentNo: int.parse(widget.patientInfo.appointmentNo)); await model.getPatientAssessment(getAssessmentReqModel); if (model.patientAssessmentList.isNotEmpty) { if (model.listOfDiagnosisCondition.length == 0) { diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index 8fdfffc2..a78db029 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -67,7 +67,7 @@ class _UpdateObjectivePageState extends State { GetPhysicalExamReqModel( patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo.toString(), - appointmentNo: widget.patientInfo.appointmentNo); + appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString())); await model.getPatientPhysicalExam(getPhysicalExamReqModel); if (model.patientPhysicalExamList.isNotEmpty) { diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 87ea1e4d..e4731325 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -78,7 +78,7 @@ class _UpdatePlanPageState extends State { onModelReady: (model) async { GetGetProgressNoteReqModel getGetProgressNoteReqModel = GetGetProgressNoteReqModel( - appointmentNo: widget.patientInfo.appointmentNo, + appointmentNo: int.parse(widget.patientInfo.appointmentNo), patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: ''); await model.getPatientProgressNote(getGetProgressNoteReqModel); diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index b0db0414..8ab08c31 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -63,7 +63,7 @@ class _UpdateSubjectivePageState extends State { GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo.toString(), - appointmentNo: widget.patientInfo.appointmentNo, + appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()), doctorID: '', editedBy: ''); @@ -152,7 +152,7 @@ class _UpdateSubjectivePageState extends State { GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, + appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()), doctorID: '', editedBy: ''); await model.getPatientAllergy(generalGetReqForSOAP); @@ -201,7 +201,7 @@ class _UpdateSubjectivePageState extends State { GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( patientMRN: widget.patientInfo.patientMRN, - appointmentNo: widget.patientInfo.appointmentNo, + appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()), episodeId: widget.patientInfo.episodeNo, episodeID: widget.patientInfo.episodeNo, doctorID: ''); diff --git a/lib/screens/prescription/prescription_checkout_screen.dart b/lib/screens/prescription/prescription_checkout_screen.dart index 5ebc84aa..cac2f99a 100644 --- a/lib/screens/prescription/prescription_checkout_screen.dart +++ b/lib/screens/prescription/prescription_checkout_screen.dart @@ -186,7 +186,7 @@ class _PrescriptionCheckOutScreenState extends State setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - indicationController.text += reconizedWord + '\n'; + instructionController.text += reconizedWord + '\n'; }); } else { print(result.finalResult); diff --git a/lib/screens/qr_reader/QR_reader_screen.dart b/lib/screens/qr_reader/QR_reader_screen.dart index 3d50d53a..c6d07bb9 100644 --- a/lib/screens/qr_reader/QR_reader_screen.dart +++ b/lib/screens/qr_reader/QR_reader_screen.dart @@ -82,7 +82,8 @@ class _QrReaderScreenState extends State { int patientID = 0; if (listOfParams[1].length != 0) patientID = int.parse(listOfParams[1]); PatientSearchRequestModel patientSearchRequestModel = PatientSearchRequestModel( - patientID: patientID, + patientID: patientID,clinicID: 0, + doctorID: 0, projectID: int.parse(listOfParams[0]) ); @@ -93,6 +94,7 @@ class _QrReaderScreenState extends State { else Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": model.inPatientList[0], + "isInpatient": true, }); } else { DrAppToastMsg.showErrorToast(model.error);