From 103e267f6ebc1afc250f26ed337424739364c52e Mon Sep 17 00:00:00 2001 From: "taha.alam@cloudsolutions.com.sa" Date: Wed, 3 Dec 2025 09:54:48 +0300 Subject: [PATCH] ipd issues of request model removed. --- lib/config/config.dart | 4 +- .../post_chief_complaint_request_model.dart | 6 +- .../PatientSearchRequestModel.dart | 8 + lib/core/viewModel/SOAP_view_model.dart | 1 - .../viewModel/patient-ucaf-viewmodel.dart | 2 +- .../patients/In_patient/filter_date_page.dart | 2 +- .../In_patient/in_patient_screen.dart | 4 + .../patient_search/patient_search_screen.dart | 9 + .../medical_report/MedicalReportPage.dart | 2 +- .../procedures/add_procedure_page.dart | 216 +++++++++--------- 10 files changed, 140 insertions(+), 114 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 29f954c3..c71bbf6f 100755 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -11,9 +11,9 @@ const DOCTOR_ROTATION = 'https://doctorrota.hmg.com/'; // const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'http://10.20.200.111:1010/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://webservices.hmg.com/'; // diff --git a/lib/core/model/SOAP/chief_complaint/post_chief_complaint_request_model.dart b/lib/core/model/SOAP/chief_complaint/post_chief_complaint_request_model.dart index cb70b6ac..ac093b0e 100644 --- a/lib/core/model/SOAP/chief_complaint/post_chief_complaint_request_model.dart +++ b/lib/core/model/SOAP/chief_complaint/post_chief_complaint_request_model.dart @@ -12,6 +12,7 @@ class PostChiefComplaintRequestModel { int? numberOfWeeks; dynamic doctorID; dynamic editedBy; + bool? isVidaPlusProject; PostChiefComplaintRequestModel( {this.appointmentNo, @@ -25,7 +26,7 @@ class PostChiefComplaintRequestModel { this.doctorID, this.editedBy, this.numberOfWeeks, - this.admissionNo,this.pomrId}); + this.admissionNo}); PostChiefComplaintRequestModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; @@ -40,7 +41,6 @@ class PostChiefComplaintRequestModel { doctorID = json['DoctorID']; editedBy = json['EditedBy']; admissionNo = json['AdmissionNo']; - pomrId = json[' String? pomrId;']; } Map toJson() { @@ -60,7 +60,7 @@ class PostChiefComplaintRequestModel { data['isLactation'] = this.isLactation; data['numberOfWeeks'] = this.numberOfWeeks; data['DoctorID'] = this.doctorID; - data['pomrId'] = this.pomrId; + if (editedBy != null) { data['EditedBy'] = this.editedBy; } diff --git a/lib/core/model/patient_muse/PatientSearchRequestModel.dart b/lib/core/model/patient_muse/PatientSearchRequestModel.dart index 14ab6782..d779cf80 100644 --- a/lib/core/model/patient_muse/PatientSearchRequestModel.dart +++ b/lib/core/model/patient_muse/PatientSearchRequestModel.dart @@ -84,4 +84,12 @@ class PatientSearchRequestModel { data['PageSize'] = this.pageSize; return data; } + + void transformDataForVidaPlus(){ + this.firstName = ""; + this.middleName = ""; + this.lastName = ""; + this.patientMobileNumber = ""; + this.patientIdentificationID = ""; + } } diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 18386729..d58c58bc 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -934,7 +934,6 @@ class SOAPViewModel extends BaseViewModel { isLactation: false, ispregnant: false, doctorID: '', - pomrId: patientInfo.pomrId, numberOfWeeks: 0); } diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index 853749c0..3ec32f8a 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -53,7 +53,7 @@ class UcafViewModel extends BaseViewModel { } Future getLanguage() async { - selectedLanguage = await sharedPref.getString(APP_Language); + selectedLanguage = await sharedPref.getString(APP_Language)??"en"; } Future getUCAFData(PatiantInformtion patient) async { diff --git a/lib/screens/patients/In_patient/filter_date_page.dart b/lib/screens/patients/In_patient/filter_date_page.dart index c2ee565f..39cb25f8 100644 --- a/lib/screens/patients/In_patient/filter_date_page.dart +++ b/lib/screens/patients/In_patient/filter_date_page.dart @@ -152,7 +152,7 @@ class _FilterDatePageState extends State { from: "${AppDateUtils.convertDateToFormat(widget.patientSearchViewModel.selectedFromDate!, "yyyy-MM-dd")} 00:00:00", to: "${AppDateUtils.convertDateToFormat(widget.patientSearchViewModel.selectedToDate!, "yyyy-MM-dd")} 00:00:00", - searchType: null), + searchType: null)..transformDataForVidaPlus(), isForceFullRefresh: true); Navigator.of(context).pop(); } diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index 0f628ed2..b4eb1145 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -79,6 +79,7 @@ class _InPatientScreenState extends State with SingleTickerProv isVidaPlusProject = Utils.isVidaPlusProject(viewModel!, doctorProfile.projectID ?? -1); if (isVidaPlusProject) { + requestModel.transformDataForVidaPlus(); DateTime dateTime = DateTime.now(); String currentDate = AppDateUtils.convertDateToFormat( dateTime, @@ -114,6 +115,9 @@ class _InPatientScreenState extends State with SingleTickerProv GifLoaderDialogUtils.showMyDialog(context); PatientSearchRequestModel requestModel = PatientSearchRequestModel(nursingStationID: selectedMapId, clinicID: 0); + if (isVidaPlusProject) { + requestModel.transformDataForVidaPlus(); + } await model.getInPatientList(requestModel, isLocalBusy: true, isVidaPlusProject: Utils.isVidaPlusProject( diff --git a/lib/screens/patients/patient_search/patient_search_screen.dart b/lib/screens/patients/patient_search/patient_search_screen.dart index b89be8f5..dc5f3b71 100644 --- a/lib/screens/patients/patient_search/patient_search_screen.dart +++ b/lib/screens/patients/patient_search/patient_search_screen.dart @@ -3,10 +3,12 @@ import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_result_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.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'; @@ -30,10 +32,12 @@ class _PatientSearchScreenState extends State { TextEditingController lastNameFileInfoController = TextEditingController(); PatientType selectedPatientType = PatientType.inPatient; AuthenticationViewModel authenticationViewModel = AuthenticationViewModel(); + ProjectViewModel projectViewModel = ProjectViewModel(); @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); + projectViewModel= Provider.of(context); return BaseView( onModelReady: (model) async {}, builder: (_, model, w) => AppScaffold( @@ -126,6 +130,11 @@ class _PatientSearchScreenState extends State { isFormSubmitted = true; }); PatientSearchRequestModel patientSearchRequestModel = PatientSearchRequestModel(doctorID: authenticationViewModel.doctorProfile!.doctorID); + var isVidaPlusProject = + Utils.isVidaPlusProject(projectViewModel, authenticationViewModel.doctorProfile!.projectID ?? -1); + if(isVidaPlusProject){ + patientSearchRequestModel.transformDataForVidaPlus(); + } if (showOther) { patientSearchRequestModel.firstName = firstNameInfoController.text.trim().isEmpty ? "0" : firstNameInfoController.text.trim(); patientSearchRequestModel.middleName = middleNameInfoController.text.trim().isEmpty ? "0" : middleNameInfoController.text.trim(); diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index ef73a95c..cfe6b63b 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -213,7 +213,7 @@ class _MedicalReportPageState extends State { : model .medicalReportList[index].doctorName!, url: model - .medicalReportList[index].doctorImageURL!, + .medicalReportList[index].doctorImageURL!??"", ), width: 50, height: 50, diff --git a/lib/screens/procedures/add_procedure_page.dart b/lib/screens/procedures/add_procedure_page.dart index a4cd24fc..31917808 100644 --- a/lib/screens/procedures/add_procedure_page.dart +++ b/lib/screens/procedures/add_procedure_page.dart @@ -60,114 +60,120 @@ class _AddProcedurePageState extends State { }, builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( isShowAppBar: false, - body: SingleChildScrollView( - child: FractionallySizedBox( - widthFactor: .97, - child: Center( - child: Column( - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.070, - ), - NetworkBaseView( - baseViewModel: model, - child: Container( - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (procedureType == ProcedureType.PROCEDURE) - Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - TranslationBase.of(context).pleaseEnterProcedure, - fontWeight: FontWeight.w700, - fontSize: 20, - ), - ], - ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.02, - ), - Row( - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.79, - child: AppTextFieldCustom( - hintText: TranslationBase.of(context).searchProcedureHere, - isTextFieldHasSuffix: false, - maxLines: 1, - minLines: 1, - hasBorder: true, - controller: procedureName, - onChanged: (value) {}, - onFieldSubmitted: () {}, + body: NetworkBaseView( + baseViewModel: model, + child: SingleChildScrollView( + child: FractionallySizedBox( + widthFactor: .97, + child: Center( + child: Column( + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.070, + ), + // NetworkBaseView( + // baseViewModel: model, + // child: + Container( + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (procedureType == ProcedureType.PROCEDURE) + Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + AppText( + TranslationBase.of(context).pleaseEnterProcedure, + fontWeight: FontWeight.w700, + fontSize: 20, + ), + ], + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.02, + ), + Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.79, + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).searchProcedureHere, + isTextFieldHasSuffix: false, + maxLines: 1, + minLines: 1, + hasBorder: true, + controller: procedureName, + onChanged: (value) {}, + onFieldSubmitted: () {}, + ), ), - ), - SizedBox( - width: MediaQuery.of(context).size.width * 0.02, - ), - Expanded( - child: InkWell( - onTap: () async { - if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) { - GifLoaderDialogUtils.showMyDialog(context); - await model.getProcedureCategory(patientId: patient.patientId, categoryName: procedureName.text, isLocalBusy: true); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); + SizedBox( + width: MediaQuery.of(context).size.width * 0.02, + ), + Expanded( + child: InkWell( + onTap: () async { + if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) { + GifLoaderDialogUtils.showMyDialog(context); + await model.getProcedureCategory(patientId: patient.patientId, categoryName: procedureName.text, isLocalBusy: true); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } + GifLoaderDialogUtils.hideDialog(context); + } else { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).atLeastThreeCharacters, + ); } - GifLoaderDialogUtils.hideDialog(context); - } else { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).atLeastThreeCharacters, - ); - } - }, - child: Icon( - Icons.search, - size: 25.0, + }, + child: Icon( + Icons.search, + size: 25.0, + ), ), ), - ), - ], - ), - ], - ), - if ((procedureType == ProcedureType.PROCEDURE ? procedureName.text.isNotEmpty : true) && model.categoriesList.length != 0) - NetworkBaseView( - baseViewModel: model, - child: EntityListCheckboxSearchWidget( - model: widget.model, - masterList: model.categoriesList[0].entityList!, - removeProcedure: (item) { - setState(() { - entityList.remove(item); - }); - }, - addProcedure: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () {}, - selectedType: (val) { - selectedType = val; - }, - isEntityListSelected: (master) => widget.model.isEntityListSelected(master, entityList), - )), - SizedBox( - height: 10, - ) - ], + ], + ), + ], + ), + if ((procedureType == ProcedureType.PROCEDURE ? procedureName.text.isNotEmpty : true) && model.categoriesList.length != 0) + // NetworkBaseView( + // baseViewModel: model, + // child: + EntityListCheckboxSearchWidget( + model: widget.model, + masterList: model.categoriesList[0].entityList!, + removeProcedure: (item) { + setState(() { + entityList.remove(item); + }); + }, + addProcedure: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () {}, + selectedType: (val) { + selectedType = val; + }, + isEntityListSelected: (master) => widget.model.isEntityListSelected(master, entityList), + ), + // ), + SizedBox( + height: 10, + ) + ], + ), ), ), - ), - ), - ], + // ), + ], + ), ), ), ), @@ -193,16 +199,16 @@ class _AddProcedurePageState extends State { builder: (BuildContext context) { return ConfirmationDialog(title:TranslationBase.of(context).afterOrderCreation, onTapGrant: () async{ - GifLoaderDialogUtils.showMyDialog(context); + // GifLoaderDialogUtils.showMyDialog(context); await widget.model.preparePostProcedure( orderType: selectedType.toString(), entityList: entityList, patient: patient, remarks: remarksController.text, procedureType: ProcedureType.PROCEDURE, - isLocalBusy: true, + isLocalBusy: false, ); - GifLoaderDialogUtils.hideDialog(context); + // GifLoaderDialogUtils.hideDialog(context); }); },