From c3e4ef142d837cd7d77e674e762a28019a90de2f Mon Sep 17 00:00:00 2001 From: "taha.alam@cloudsolutions.com.sa" Date: Wed, 14 Jan 2026 09:15:32 +0300 Subject: [PATCH] bug resolution --- lib/config/localized_values.dart | 4 + .../Prescriptions/prescription_req_model.dart | 6 +- .../model/insurance/insurance_approval.dart | 4 + .../MedicalReport/MeidcalReportModel.dart | 38 + .../service/patient/out_patient_service.dart | 4 + .../PatientMedicalReportService.dart | 50 +- .../prescription/prescription_service.dart | 6 +- .../soap/SOAP_service.dart | 3 + .../PatientMedicalReportViewModel.dart | 1 + .../viewModel/PatientSearchViewModel.dart | 11 +- lib/core/viewModel/SOAP_view_model.dart | 5 +- lib/core/viewModel/medicine_view_model.dart | 24 +- .../viewModel/patient-referral-viewmodel.dart | 4 +- .../prescription/prescription_view_model.dart | 6 +- lib/core/viewModel/procedure_View_model.dart | 13 +- lib/core/viewModel/project_view_model.dart | 10 + lib/main.dart | 3 +- lib/screens/home/home_screen.dart | 2 + .../medical-file/medical_file_details.dart | 883 +++++++++--------- .../add_patient_sick_leave_screen.dart | 5 +- .../In_patient/in_patient_list_page.dart | 4 +- .../In_patient/in_patient_screen.dart | 1 + .../patients/insurance_approvals_details.dart | 2 +- .../UCAF/widgets/pocedures_widget.dart | 2 +- ...iabetic_details_blood_pressurewideget.dart | 3 +- .../profile/lab_result/labs_home_page.dart | 272 +++--- .../AddVerifyMedicalReport.dart | 5 +- .../medical_report/MedicalReportPage.dart | 6 +- .../patient_profile_screen.dart | 12 +- .../radiology/radiology_details_page.dart | 2 +- .../refer-patient-screen-in-patient.dart | 14 +- .../refer_details/refer-patient-screen.dart | 4 +- .../add_details_to_examination_vida_plus.dart | 2 +- .../add_examination_page_vida_plus.dart | 2 +- .../update_present_illness.dart | 2 +- .../add_drug/add_drug_widget.dart | 1 + .../prescription_form_widget.dart | 53 +- .../search_preescription_widget.dart | 22 +- .../prescription/new_prescriptions_page.dart | 4 +- .../prescription_checkout_screen.dart | 12 +- .../procedures/add_procedure_page.dart | 13 +- .../base_add_procedure_tab_page.dart | 3 + .../entity_list_fav_procedure.dart | 13 +- lib/utils/date-utils.dart | 75 +- .../translations_delegate_base_utils.dart | 1 + .../shared/dialogs/dailog-list-select.dart | 6 +- lib/widgets/shared/user-guid/CusomRow.dart | 16 +- pubspec.lock | 8 + pubspec.yaml | 1 + 49 files changed, 950 insertions(+), 693 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 3a6c2d27..9bad2892 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1216,6 +1216,10 @@ const Map> localizedValues = { "moderate": {"en": "Moderate", "ar":"معتدل"}, "remarksCanNotBeEmpty": {"en": "Remarks Can Not Be Empty", "ar":"لا يمكن أن تكون الملاحظات فارغة"}, "kindlySelectCategory": {"en": "Kindly Select Any Diagnosis Category", "ar":"يرجى اختيار أي فئة تشخيص"}, + "kindlySelectAllMandatoryField": { + "en": "Please complete all mandatory fields.", + "ar": "يرجى استكمال جميع الحقول الإلزامية" + }, "noRemarks": {"en": "No Remarks", "ar":"لا ملاحظات"}, "event": {"en": "Event: ", "ar":"حدث: "}, "editDiagnosis": {"en": "Edit Diagnosis ", "ar":"تحرير التشخيص"}, diff --git a/lib/core/model/Prescriptions/prescription_req_model.dart b/lib/core/model/Prescriptions/prescription_req_model.dart index ec69ca33..481b1b1f 100644 --- a/lib/core/model/Prescriptions/prescription_req_model.dart +++ b/lib/core/model/Prescriptions/prescription_req_model.dart @@ -1,9 +1,10 @@ class PrescriptionReqModel { dynamic patientMRN; dynamic appNo; + dynamic? episodeId; PrescriptionReqModel( - { this.patientMRN, this.appNo}); + { this.patientMRN, this.appNo, this.episodeId}); PrescriptionReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; @@ -15,6 +16,9 @@ class PrescriptionReqModel { final Map data = new Map(); data['PatientMRN'] = this.patientMRN; data['AppointmentNo'] = this.appNo; + if(this.episodeId != null) { + data['EpisodeID'] = this.episodeId; + } return data; } } diff --git a/lib/core/model/insurance/insurance_approval.dart b/lib/core/model/insurance/insurance_approval.dart index ef33c6a9..8468919e 100644 --- a/lib/core/model/insurance/insurance_approval.dart +++ b/lib/core/model/insurance/insurance_approval.dart @@ -51,6 +51,8 @@ class InsuranceApprovalModel { String? expiryDate; String? rceiptOn; int? appointmentNo; + String? companyName; + String? companyNameN; InsuranceApprovalModel( {this.versionID, @@ -112,6 +114,8 @@ class InsuranceApprovalModel { doctorName = json['DoctorName']; doctorImage = json['DoctorImageURL']; clinicName = json['ClinicName']; + companyName = json['CompanyName']; + companyNameN = json['CompanyNameN']; if (json['ApporvalDetails'] != null) { apporvalDetails = []; json['ApporvalDetails'].forEach((v) { diff --git a/lib/core/model/patient/MedicalReport/MeidcalReportModel.dart b/lib/core/model/patient/MedicalReport/MeidcalReportModel.dart index ae101a10..3964826c 100644 --- a/lib/core/model/patient/MedicalReport/MeidcalReportModel.dart +++ b/lib/core/model/patient/MedicalReport/MeidcalReportModel.dart @@ -25,6 +25,7 @@ class MedicalReportModel { String? clinicName; String? clinicNameN; String? reportDataHtml; + int? summaryId; MedicalReportModel( {this.reportData, @@ -113,4 +114,41 @@ class MedicalReportModel { data['ReportDataHtml'] = this.reportDataHtml; return data; } + + ///handling this to change the status of vida 4 to make it as vida 3 so ui does not handle these things + ///https://cloudsolutions-sa.atlassian.net/browse/V4-38664?focusedCommentId=469446 + MedicalReportModel.fromJsonForVidaPlus(Map json) { + if(json['Status'] == 1){ + json['Status'] = 0; + }else{ + json['Status'] = 1; + } + reportData = json['ReportData']; + setupID = json['SetupID']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + projectNameN = json['ProjectNameN']; + patientID = json['PatientID']; + invoiceNo = json['InvoiceNo']??"0"; + status = json['Status']; + verifiedOn = json['VerifiedOn']; + verifiedBy = json['VerifiedBy']; + editedOn = json['EditedOn']; + editedBy = json['EditedBy']; + lineItemNo = json['LineItemNo']??0; + createdOn = json['CreatedOn']; + templateID = json['TemplateID']; + doctorID = json['DoctorID']; + doctorGender = json['DoctorGender']; + doctorGenderDescription = json['DoctorGenderDescription']; + doctorGenderDescriptionN = json['DoctorGenderDescriptionN']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + clinicID = json['ClinicID']; + clinicName = json['ClinicName']; + clinicNameN = json['ClinicNameN']; + reportDataHtml = json['ReportDataHtml']; + summaryId = json['summaryId']; + } } diff --git a/lib/core/service/patient/out_patient_service.dart b/lib/core/service/patient/out_patient_service.dart index 81a939e7..da31c169 100644 --- a/lib/core/service/patient/out_patient_service.dart +++ b/lib/core/service/patient/out_patient_service.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; class OutPatientService extends BaseService { List _patientList = []; @@ -9,6 +10,9 @@ class OutPatientService extends BaseService { List get patientList => _patientList; Future getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async { + if(ProjectViewModel.getVidaPlusStatus()){ + patientSearchRequestModel.pageSize = 0; + } hasError = false; await baseAppClient.post( GET_MY_OUT_PATIENT, diff --git a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart index 9899bfea..36b4dcca 100644 --- a/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart +++ b/lib/core/service/patient_medical_file/medical_report/PatientMedicalReportService.dart @@ -4,6 +4,8 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MedicalReportTemplate.dart'; import 'package:doctor_app_flutter/core/model/patient/MedicalReport/MeidcalReportModel.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/utils/extenstions_utils.dart'; class PatientMedicalReportService extends BaseService { List medicalReportList = []; @@ -21,7 +23,11 @@ class PatientMedicalReportService extends BaseService { await baseAppClient.postPatient(PATIENT_MEDICAL_REPORT_GET_LIST, onSuccess: (dynamic response, int statusCode) { if (response['DAPP_ListMedicalReportList'] != null) { response['DAPP_ListMedicalReportList'].forEach((v) { - medicalReportList.add(MedicalReportModel.fromJson(v)); + if (isVidaPlusProject) { + medicalReportList.add(MedicalReportModel.fromJsonForVidaPlus(v)); + } else { + medicalReportList.add(MedicalReportModel.fromJson(v)); + } }); } medicalReportList = medicalReportList.reversed.toList(); @@ -64,11 +70,26 @@ class PatientMedicalReportService extends BaseService { Future verifyMedicalReport(PatiantInformtion patient, MedicalReportModel medicalReport, bool? isVidaPlusProject,) async { hasError = false; + print("the isVidaPlusProject flag in Service is $isVidaPlusProject"); Map body = Map(); - body['SetupID'] = "91877"; + if (isVidaPlusProject == true) { + body['SetupID'] = doctorProfile!.setupID; + } else + body['SetupID'] = "91877"; body['AdmissionNo'] = isVidaPlusProject == true? patient.admissionID : patient.admissionNo; body['InvoiceNo'] = medicalReport.invoiceNo; body['LineItemNo'] = medicalReport.lineItemNo; + if (isVidaPlusProject == true) { + body['TemplateID'] = medicalReport.templateID ?? 0; + body['summaryId'] = medicalReport.summaryId ?? 0; + try { + if (body['InvoiceNo'].toString().isEmpty) { + body['InvoiceNo'] = "0"; + } + } catch (e) { + body['InvoiceNo'] = "0"; + } + } if (body['ProjectID'] == null) { body['ProjectID'] = doctorProfile?.projectID; } @@ -83,15 +104,17 @@ class PatientMedicalReportService extends BaseService { Future addMedicalReport(PatiantInformtion patient, String htmlText, bool? isVidaPlusProject) async { hasError = false; Map body = Map(); - body['SetupID'] = body.containsKey('SetupID') - ? body['SetupID'] != null - ? body['SetupID'] - : SETUP_ID - : SETUP_ID; - print("isVidaPlusProject $isVidaPlusProject"); - body['AdmissionNo'] = isVidaPlusProject == true? patient.admissionID ?? -1 :int.parse(patient.admissionNo!); - print('the admission no is ${body['AdmissionNo']}'); - body['MedicalReportHTML'] = htmlText; + if (isVidaPlusProject == false) { + body['SetupID'] = body.containsKey('SetupID') + ? body['SetupID'] != null + ? body['SetupID'] + : SETUP_ID + : SETUP_ID; + } + + body['AdmissionNo'] = isVidaPlusProject == true? patient.admissionID ?? -1 :int.parse(patient.admissionNo!); + + body['MedicalReportHTML'] = htmlText; body['ProjectID'] = doctorProfile?.projectID; body['PatientID'] = patient.patientId; body['DoctorID'] = doctorProfile?.doctorID; @@ -111,6 +134,11 @@ class PatientMedicalReportService extends BaseService { body['LineItemNo'] = limitNumber; body['InvoiceNo'] = invoiceNumber; + if (ProjectViewModel.getVidaPlusStatus()) { + if (body['InvoiceNo'].toString().isEmpty) { + body['InvoiceNo'] = "0"; + } + } body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null diff --git a/lib/core/service/patient_medical_file/prescription/prescription_service.dart b/lib/core/service/patient_medical_file/prescription/prescription_service.dart index bf3a2cb6..b0991cc7 100644 --- a/lib/core/service/patient_medical_file/prescription/prescription_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescription_service.dart @@ -94,8 +94,8 @@ class PrescriptionService extends LookupService { }, body: getAssessmentReqModel.toJson()); } - Future getPrescriptionListNew({required int mrn, required int appNo}) async { - _prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn, appNo: appNo); + Future getPrescriptionListNew({required int mrn, required int appNo, int? episodeID}) async { + _prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn, appNo: appNo, episodeId: episodeID); hasError = false; _prescriptionList.clear(); _prescriptionListNew.clear(); @@ -127,10 +127,10 @@ class PrescriptionService extends LookupService { } Future getMedicationList({String drug = ''}) async { + allMedicationList = []; hasError = false; _drugRequestModel.search = ["$drug"]; await baseAppClient.post(SEARCH_DRUG, onSuccess: (dynamic response, int statusCode) { - allMedicationList = []; response['MedicationList']['entityList'].forEach((v) { allMedicationList.add(GetMedicationResponseModel.fromJson(v)); }); diff --git a/lib/core/service/patient_medical_file/soap/SOAP_service.dart b/lib/core/service/patient_medical_file/soap/SOAP_service.dart index a1cfd751..a0dd69f1 100644 --- a/lib/core/service/patient_medical_file/soap/SOAP_service.dart +++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart @@ -707,6 +707,9 @@ class SOAPService extends LookupService { hasError = false; await baseAppClient.post(POST_CHIEF_COMPLAINT_VP, onSuccess: (dynamic response, int statusCode) { + response['List_CreateChiefComplaint']['resultData'].forEach((v) { + episodeID = v['episodeId']; + }); print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModel/PatientMedicalReportViewModel.dart b/lib/core/viewModel/PatientMedicalReportViewModel.dart index 8195fc17..3eef8edf 100644 --- a/lib/core/viewModel/PatientMedicalReportViewModel.dart +++ b/lib/core/viewModel/PatientMedicalReportViewModel.dart @@ -48,6 +48,7 @@ class PatientMedicalReportViewModel extends BaseViewModel { Future verifyMedicalReport( PatiantInformtion patient, MedicalReportModel medicalReport, bool? isVidaPlusProject) async { setState(ViewState.Busy); + print("the isVidaPlusProject flag in VM is $isVidaPlusProject"); await _service.verifyMedicalReport(patient, medicalReport, isVidaPlusProject); if (_service.hasError) { error = _service.error; diff --git a/lib/core/viewModel/PatientSearchViewModel.dart b/lib/core/viewModel/PatientSearchViewModel.dart index 15156250..2ac5973d 100644 --- a/lib/core/viewModel/PatientSearchViewModel.dart +++ b/lib/core/viewModel/PatientSearchViewModel.dart @@ -31,6 +31,7 @@ class PatientSearchViewModel extends BaseViewModel { int firstSubsetIndex = 0; int inPatientPageSize = 20; int lastSubsetIndex = 20; + String noDataFoundText = ""; List InpatientClinicList = []; @@ -192,6 +193,7 @@ class PatientSearchViewModel extends BaseViewModel { FutureOr paginatedInPatientCall(String? selectedClinicName, String? query, bool? isSortDes,{bool isMyInPatient = false,bool isAllClinic = false }) async { if(isVidaPlusProject == false) return; + if(paginationLoading == true) return; if(this.requestModel == null) return; PatientSearchRequestModel requestModel = this.requestModel!; @@ -200,18 +202,23 @@ class PatientSearchViewModel extends BaseViewModel { notifyListeners(); await _inPatientService.getInPatientList(requestModel, false, isVidaPlusProject: isVidaPlusProject); paginationLoading = false; - notifyListeners(); if (_inPatientService.hasError) { error = _inPatientService.error; - + requestModel.pageIndex = (requestModel.pageIndex??1) - 1 ; } else { this.requestModel = requestModel; + if (inPatientList.isEmpty == true) { + requestModel.pageIndex = (requestModel.pageIndex??1) - 1 ; + Utils.showErrorToast(noDataFoundText); + return; + } await setDefaultInPatientList(isFromPagination: true); generateInpatientClinicList(isFromPagination: true); sortInPatient(isDes:isSortDes == true, isAllClinic: isAllClinic, isMyInPatient: isMyInPatient ); filterSearchResults(query!, isAllClinic: isAllClinic, isMyInPatient: isMyInPatient); filterByClinic(clinicName: selectedClinicName!); } + notifyListeners(); } diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index d58c58bc..49e6b1bf 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -1100,8 +1100,11 @@ class SOAPViewModel extends BaseViewModel { if (_SOAPService.hasError) { error = _SOAPService.error; setState(ViewState.ErrorLocal); - } else + } else { + if(patientInfo.episodeNo == 0) + patientInfo.episodeNo = _SOAPService.episodeID; setState(ViewState.Idle); + } } updateChiefComplaint( diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index 0dd02428..c861e1d2 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -180,15 +180,15 @@ class MedicineViewModel extends BaseViewModel { } GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(patientMRN: patientInfo!.patientMRN!, episodeID: patientInfo.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: patientInfo.appointmentNo); - if (medicationStrengthList.length == 0) { + // if (medicationStrengthList.length == 0) { await getMedicationStrength(isLocalBusy: true); - } - if (medicationDurationList.length == 0) { + // } + // if (medicationDurationList.length == 0) { await getMedicationDuration(isLocalBusy: true); - } - if (medicationDoseTimeList.length == 0) { + // } + // if (medicationDoseTimeList.length == 0) { await getMedicationDoseTime(isLocalBusy: true); - } + // } await getPatientAssessment(getAssessmentReqModel, isLocalBusy: true); if (_prescriptionService.hasError) { error = _prescriptionService.error; @@ -260,15 +260,15 @@ class MedicineViewModel extends BaseViewModel { GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(patientMRN: patient!.patientMRN!, episodeID: patient.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: patient.appointmentNo); - if (medicationStrengthList.length == 0) { + // if (medicationStrengthList.length == 0) { await getMedicationStrength(); - } - if (medicationDurationList.length == 0) { + // } + // if (medicationDurationList.length == 0) { await getMedicationDuration(); - } - if (medicationDoseTimeList.length == 0) { + // } + // if (medicationDoseTimeList.length == 0) { await getMedicationDoseTime(); - } + // } await getPatientAssessment(getAssessmentReqModel); } diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 505ec8c2..4a855ba3 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -126,9 +126,11 @@ class PatientReferralViewModel extends BaseViewModel { } } - mapHospitalToBranchList(){ + mapHospitalToBranchList() async { branchesList!.clear(); + DoctorProfileModel doctorProfile = await getDoctorProfile(); _hospitalService.hospitals.forEach((element) { + if(doctorProfile.projectID != element.facilityId) branchesList!.add({"facilityId": element.facilityId, "facilityName": element.facilityName}); }); } diff --git a/lib/core/viewModel/prescription/prescription_view_model.dart b/lib/core/viewModel/prescription/prescription_view_model.dart index 1e036027..7cad6681 100644 --- a/lib/core/viewModel/prescription/prescription_view_model.dart +++ b/lib/core/viewModel/prescription/prescription_view_model.dart @@ -56,13 +56,13 @@ class PrescriptionViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getPrescriptionListNew({int? mrn, int appNo = 0, bool isLocalBusy = false}) async { + Future getPrescriptionListNew({int? mrn, int appNo = 0, bool isLocalBusy = false, int? episodeId}) async { hasError = false; if (isLocalBusy) setState(ViewState.BusyLocal); else setState(ViewState.Busy); - await _prescriptionService.getPrescriptionListNew(mrn: mrn!, appNo: appNo); + await _prescriptionService.getPrescriptionListNew(mrn: mrn!, appNo: appNo, episodeID: episodeId); if (_prescriptionService.hasError) { error = _prescriptionService.error!; setState(ViewState.ErrorLocal); @@ -78,7 +78,7 @@ class PrescriptionViewModel extends BaseViewModel { error = _prescriptionService.error!; setState(ViewState.ErrorLocal); } else { - await getPrescriptionListNew(mrn: mrn); + await getPrescriptionListNew(mrn: mrn, episodeId: postProcedureReqModel.episodeID); setState(ViewState.Idle); } } diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 6581a30d..c4c55547 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -130,6 +130,7 @@ class ProcedureViewModel extends BaseViewModel { } setTemplateListDependOnId() { + templateList.clear(); procedureTemplate.forEach((element) { List templateListData = templateList.where((elementTemplate) => elementTemplate.templateId == element.templateID).toList(); @@ -444,22 +445,20 @@ class ProcedureViewModel extends BaseViewModel { } } - void filterProcedureSearchResults(String query, List masterList, List items) { - List dummySearchList = []; + void filterProcedureSearchResults(String query, List masterList, Function(List) onItemSearched) { + List dummySearchList = []; if (masterList != null) dummySearchList.addAll(masterList); if (query.isNotEmpty) { - List dummyListData = []; + List dummyListData = []; dummySearchList.forEach((item) { if (item.templateName!.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); - items.clear(); - items.addAll(dummyListData); + onItemSearched(dummyListData); return; } else { - items.clear(); - items.addAll(masterList); + onItemSearched(dummySearchList); } } diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index 9f19a629..72a1f485 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -24,6 +24,7 @@ class ProjectViewModel with ChangeNotifier { String? currentLanguage = 'ar'; bool _isArabic = false; + static bool _isVidaPlusProject = false; bool isInternetConnection = true; List doctorClinicsList = []; bool isLoading = false; @@ -149,4 +150,13 @@ class ProjectViewModel with ChangeNotifier { await Provider.of(AppGlobal.CONTEX, listen: false).getDoctorProfileBasedOnClinic(clinicModel); } + + + static setVidaPlusStatus(bool isVidaPlus){ + _isVidaPlusProject = isVidaPlus; + } + + static getVidaPlusStatus(){ + return _isVidaPlusProject; + } } diff --git a/lib/main.dart b/lib/main.dart index e6c49ce9..026ea959 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -18,13 +18,14 @@ import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:provider/provider.dart'; import 'package:shared_preferences/shared_preferences.dart'; - + import 'package:timezone/data/latest_all.dart' as tz; void main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); HttpOverrides.global = MyHttpOverrides(); setupLocator(); await clearPrefsOnFirstLaunch(); + tz.initializeTimeZones(); runApp(MyApp()); } diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 62378baa..4be54f9e 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -82,6 +82,8 @@ class _HomeScreenState extends State { return BaseView( onModelReady: (model) async { + var doctorProfile = await model.getDoctorProfile(); + ProjectViewModel.setVidaPlusStatus(Utils.isVidaPlusProject(projectsProvider!, doctorProfile.projectID ?? -1)); model.startHomeScreenServices(projectsProvider, authenticationViewModel).then((value) { WidgetsBinding.instance.addPostFrameCallback((_) async { if (model.radiologyCriticalFindingModel != null) { diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index bfffa7f0..9d4f8668 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -80,483 +80,486 @@ class _MedicalFileDetailsState extends State { model.getMedicalFile(mrn: pp!); } }, - builder: (BuildContext context, MedicalFileViewModel model, Widget? child) => AppScaffold( - appBar: PatientProfileAppBar( - patient!, - doctorName: doctorName!, - profileUrl: doctorImage!, - clinic: clinicName!, - isPrescriptions: true, - isMedicalFile: true, - episode: episode!, - visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( - vistDate!, - ), isArabic: projectViewModel.isArabic)}', - isAppointmentHeader: true, - ), - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), - body: NetworkBaseView( - baseViewModel: model, - child: SingleChildScrollView( - child: Center( - child: Container( - child: Column( - children: [ - model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0 - ? Padding( - padding: EdgeInsets.all(10.0), - child: Container( - child: Column( - children: [ - SizedBox(height: 25.0), - if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) - Container( - width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all(color: Colors.grey[200]!, width: 0.5), - ), - child: Padding( - padding: const EdgeInsets.all(15.0), - child: HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText(TranslationBase.of(context).historyOfPresentIllness.toUpperCase(), - variant: isHistoryExpand ? "bodyText" : '', bold: isHistoryExpand ? true : true, color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isHistoryExpand = !isHistoryExpand; - }); - }, - child: Icon(isHistoryExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) - ], + builder: (BuildContext context, MedicalFileViewModel model, Widget? child) => + // AppScaffold( + // isShowAppBar: false, + // appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), + // body: + Material( + child: Column( + children: [ + PatientProfileAppBar( + patient!, + doctorName: doctorName!, + profileUrl: doctorImage!, + clinic: clinicName!, + isPrescriptions: true, + isMedicalFile: true, + episode: episode!, + visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( + vistDate!, + ), isArabic: projectViewModel.isArabic)}', + isAppointmentHeader: true, + ), + Expanded( + child: SingleChildScrollView( + child: Column( + children: [ + model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0 + ? Padding( + padding: EdgeInsets.all(10.0), + child: Container( + child: Column( + children: [ + SizedBox(height: 25.0), + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), - bodyWidget: ListView.builder( - physics: NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstCheifComplaint!.length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - children: [ - Expanded( - child: AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstCheifComplaint![index].hOPI! - .trim(), + border: Border.all(color: Colors.grey[200]!, width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText(TranslationBase.of(context).historyOfPresentIllness.toUpperCase(), + variant: isHistoryExpand ? "bodyText" : '', bold: isHistoryExpand ? true : true, color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isHistoryExpand = !isHistoryExpand; + }); + }, + child: Icon(isHistoryExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + ], + ), + bodyWidget: ListView.builder( + physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstCheifComplaint!.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Expanded( + child: AppText( + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstCheifComplaint![index].hOPI! + .trim(), + ), ), - ), - SizedBox(width: 35.0), - ], - ), - ], + SizedBox(width: 35.0), + ], + ), + ], + ), ), - ), - ); - }), - isExpand: isHistoryExpand, + ); + }), + isExpand: isHistoryExpand, + ), ), ), + // SizedBox( + // height: 30, + // ), + + SizedBox( + height: 30, ), - // SizedBox( - // height: 30, - // ), - - SizedBox( - height: 30, - ), - if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) - Container( - width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all(color: Colors.grey[200]!, width: 0.5), - ), - child: Padding( - padding: const EdgeInsets.all(15.0), - child: HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText(TranslationBase.of(context).assessment.toUpperCase(), - variant: isAssessmentExpand ? "bodyText" : '', bold: isAssessmentExpand ? true : true, color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isAssessmentExpand = !isAssessmentExpand; - }); - }, - child: Icon(isAssessmentExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) - ], + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), - bodyWidget: ListView.builder( - physics: NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments!.length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - children: [ - AppText( - 'ICD: ', - fontSize: 13.0, - ), - AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].iCD10! - .trim(), - fontSize: 13.5, - fontWeight: FontWeight.w700, - ), - SizedBox(width: 15.0), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).condition + ": ", - fontSize: 12.5, - ), - Expanded( - child: AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index] - .condition! - .trim(), + border: Border.all(color: Colors.grey[200]!, width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText(TranslationBase.of(context).assessment.toUpperCase(), + variant: isAssessmentExpand ? "bodyText" : '', bold: isAssessmentExpand ? true : true, color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isAssessmentExpand = !isAssessmentExpand; + }); + }, + child: Icon(isAssessmentExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + ], + ), + bodyWidget: ListView.builder( + physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments!.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + AppText( + 'ICD: ', fontSize: 13.0, - fontWeight: FontWeight.w700, ), - ), - ], - ), - Row( - children: [ - Expanded( - child: AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index] - .description!, + AppText( + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].iCD10! + .trim(), + fontSize: 13.5, fontWeight: FontWeight.w700, - fontSize: 15.0, ), - ) - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).type + ": ", - fontSize: 15.5, - ), - Expanded( - child: AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].type!, - fontSize: 16.0, - fontWeight: FontWeight.w700, + SizedBox(width: 15.0), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).condition + ": ", + fontSize: 12.5, + ), + Expanded( + child: AppText( + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index] + .condition! + .trim(), + fontSize: 13.0, + fontWeight: FontWeight.w700, + ), + ), + ], + ), + Row( + children: [ + Expanded( + child: AppText( + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index] + .description!, + fontWeight: FontWeight.w700, + fontSize: 15.0, + ), + ) + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context).type + ": ", + fontSize: 15.5, + ), + Expanded( + child: AppText( + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].type!, + fontSize: 16.0, + fontWeight: FontWeight.w700, + ), ), - ), - ], - ), - SizedBox( - height: 15.0, - ), - AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].remarks! - .trim(), - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, - ), - ], + ], + ), + SizedBox( + height: 15.0, + ), + AppText( + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].remarks??"" + .trim(), + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, + ), + ], + ), ), - ), - ); - }), - isExpand: isAssessmentExpand, + ); + }), + isExpand: isAssessmentExpand, + ), ), ), + + SizedBox( + height: 30, ), - - SizedBox( - height: 30, - ), - if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) - Container( - width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all(color: Colors.grey[200]!, width: 0.5), - ), - child: Padding( - padding: const EdgeInsets.all(15.0), - child: HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText(TranslationBase.of(context).test.toUpperCase(), - variant: isProcedureExpand ? "bodyText" : '', bold: isProcedureExpand ? true : true, color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isProcedureExpand = !isProcedureExpand; - }); - }, - child: Icon(isProcedureExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) - ], + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), - bodyWidget: ListView.builder( - physics: NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure!.length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - children: [ - Column( - children: [ - AppText( - 'Procedure ID: ', - ), - AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index] - .procedureId! - .trim(), - fontSize: 13.5, - fontWeight: FontWeight.w700, - ), - ], - ), - SizedBox(width: 35.0), - Column( - children: [ - AppText( - TranslationBase.of(context).orderDate + ": ", - ), - AppText( - AppDateUtils.getDateFormatted(DateTime.parse( + border: Border.all(color: Colors.grey[200]!, width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText(TranslationBase.of(context).test.toUpperCase(), + variant: isProcedureExpand ? "bodyText" : '', bold: isProcedureExpand ? true : true, color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isProcedureExpand = !isProcedureExpand; + }); + }, + child: Icon(isProcedureExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + ], + ), + bodyWidget: ListView.builder( + physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure!.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Column( + children: [ + AppText( + 'Procedure ID: ', + ), + AppText( model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index] - .orderDate! + .procedureId! .trim(), - )), - fontSize: 13.5, + fontSize: 13.5, + fontWeight: FontWeight.w700, + ), + ], + ), + SizedBox(width: 35.0), + Column( + children: [ + AppText( + TranslationBase.of(context).orderDate + ": ", + ), + AppText( + AppDateUtils.getDateFormatted(DateTime.parse( + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index] + .orderDate! + .trim(), + )), + fontSize: 13.5, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), + SizedBox( + height: 20.0, + ), + Row( + children: [ + Expanded( + child: AppText( + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index].procName!, fontWeight: FontWeight.w700, ), - ], - ), - ], - ), - SizedBox( - height: 20.0, - ), - Row( - children: [ - Expanded( - child: AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index].procName!, + ) + ], + ), + Row( + children: [ + AppText( + 'CPT Code : ', + ), + AppText( + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index].patientID + .toString(), fontWeight: FontWeight.w700, ), - ) - ], - ), - Row( - children: [ - AppText( - 'CPT Code : ', - ), - AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index].patientID - .toString(), - fontWeight: FontWeight.w700, - ), - ], - ), - SizedBox( - height: 15.0, - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, - ), - ], + ], + ), + SizedBox( + height: 15.0, + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, + ), + ], + ), ), - ), - ); - }), - isExpand: isProcedureExpand, + ); + }), + isExpand: isProcedureExpand, + ), ), ), + + SizedBox( + height: 30, ), - - SizedBox( - height: 30, - ), - if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) - Container( - width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all(color: Colors.grey[200]!, width: 0.5), - ), - child: Padding( - padding: const EdgeInsets.all(15.0), - child: HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText(TranslationBase.of(context).physicalSystemExamination.toUpperCase(), - variant: isPhysicalExam ? "bodyText" : '', bold: isPhysicalExam ? true : true, color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isPhysicalExam = !isPhysicalExam; - }); - }, - child: Icon(isPhysicalExam ? EvaIcons.arrowUp : EvaIcons.arrowDown)) - ], + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), - bodyWidget: ListView.builder( - physics: NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam!.length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - children: [ - Row( - children: [ - AppText(TranslationBase.of(context).examType + ": "), - AppText( - model - .medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].examDesc!, - fontWeight: FontWeight.w700, - ), - ], - ), - Row( - children: [ - AppText( - model - .medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].examDesc!, - fontWeight: FontWeight.w700, - ) - ], - ), - Row( - children: [ - AppText(TranslationBase.of(context).abnormal + ": "), - AppText( - model - .medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].abnormal!, - fontWeight: FontWeight.w700, - ), - ], - ), - SizedBox( - height: 15.0, - ), - AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].remarks!, - ), - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - SizedBox( - height: 8.0, - ), - ], + border: Border.all(color: Colors.grey[200]!, width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText(TranslationBase.of(context).physicalSystemExamination.toUpperCase(), + variant: isPhysicalExam ? "bodyText" : '', bold: isPhysicalExam ? true : true, color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isPhysicalExam = !isPhysicalExam; + }); + }, + child: Icon(isPhysicalExam ? EvaIcons.arrowUp : EvaIcons.arrowDown)) + ], + ), + bodyWidget: ListView.builder( + physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam!.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + children: [ + Row( + children: [ + AppText(TranslationBase.of(context).examType + ": "), + AppText( + model + .medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].examDesc!, + fontWeight: FontWeight.w700, + ), + ], + ), + // Row( + // children: [ + // AppText( + // model + // .medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].examDesc!, + // fontWeight: FontWeight.w700, + // ) + // ], + // ), + Row( + children: [ + AppText(TranslationBase.of(context).abnormal + ": "), + AppText( + model + .medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].abnormal!, + fontWeight: FontWeight.w700, + ), + ], + ), + SizedBox( + height: 15.0, + ), + AppText( + model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].remarks!, + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, + ), + ], + ), ), - ), - ); - }), - isExpand: isPhysicalExam, + ); + }), + isExpand: isPhysicalExam, + ), ), ), + SizedBox( + height: 30, ), - SizedBox( - height: 30, - ), - ], + ], + ), ), - ), - ) - : Center( - child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, - )) - ], + ) + : Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + )) + ], + ), ), ), - ), + ], ), ), - ), + // ), ); } } diff --git a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart index 9735fe2c..e3322f98 100644 --- a/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/add_patient_sick_leave_screen.dart @@ -119,7 +119,7 @@ class _AddPatientSickLeaveScreenState extends State { addSickLeave.noOfDays = value; }); }, - validationError: isFormSubmitted && (addSickLeave.noOfDays == null) ? TranslationBase.of(context).pleaseEnterNoOfDays : "", + validationError: isFormSubmitted && (addSickLeave.noOfDays == null) ? TranslationBase.of(context).pleaseEnterNoOfDays : null, onClick: () {}, onFieldSubmitted: () {}, ), @@ -148,7 +148,7 @@ class _AddPatientSickLeaveScreenState extends State { addSickLeave.startDate = value; }); }, - validationError: isFormSubmitted && (addSickLeave.startDate == null) ? TranslationBase.of(context).pleaseEnterDate : "", + validationError: isFormSubmitted && (addSickLeave.startDate == null) ? TranslationBase.of(context).pleaseEnterDate : null, onFieldSubmitted: () {}, ), SizedBox( @@ -293,6 +293,7 @@ class _AddPatientSickLeaveScreenState extends State { addSickLeave.patientMRN = widget.patient!.patientMRN.toString(); addSickLeave.appointmentNo = widget.patient!.appointmentNo.toString(); await model.addSickLeave(addSickLeave); + print("the state is ${model.state}"); if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } else { diff --git a/lib/screens/patients/In_patient/in_patient_list_page.dart b/lib/screens/patients/In_patient/in_patient_list_page.dart index 3d5cdc5f..c5004a9e 100644 --- a/lib/screens/patients/In_patient/in_patient_list_page.dart +++ b/lib/screens/patients/In_patient/in_patient_list_page.dart @@ -158,10 +158,10 @@ class _InPatientListPageState extends State { onFieldSubmitted: () {}, ), widget.patientSearchViewModel!.state == ViewState.Idle - ? (widget.isMyInPatient && widget.patientSearchViewModel!.myIinPatientList.length > 0) + ? (widget.isMyInPatient && widget.patientSearchViewModel!.filteredMyInPatientItems.length > 0) ? ListOfMyInpatient(isAllClinic: widget.isAllClinic, hasQuery: hasQuery, patientSearchViewModel: widget.patientSearchViewModel!, isVidaPlusProject: widget.isVidaPlusProject,) : widget.patientSearchViewModel!.filteredInPatientItems.length > 0 - ? (widget.isMyInPatient && widget.patientSearchViewModel!.myIinPatientList.length == 0) + ? (widget.isMyInPatient && widget.patientSearchViewModel!.filteredMyInPatientItems.length == 0) ? NoData() : ListOfAllInPatient(isAllClinic: widget.isAllClinic, hasQuery: hasQuery, patientSearchViewModel: widget.patientSearchViewModel!, isVidaPlusProject: widget .isVidaPlusProject,query: _searchController.text, selectedClinicName: widget.selectedClinicName,isSortDes: isSortDes) diff --git a/lib/screens/patients/In_patient/in_patient_screen.dart b/lib/screens/patients/In_patient/in_patient_screen.dart index 0971142f..7ec5b3cf 100644 --- a/lib/screens/patients/In_patient/in_patient_screen.dart +++ b/lib/screens/patients/In_patient/in_patient_screen.dart @@ -67,6 +67,7 @@ class _InPatientScreenState extends State with SingleTickerProv return BaseView( onModelReady: (model) async { + model.noDataFoundText = TranslationBase.of(context).noDataAvailable; model.clearPatientList(); var doctorProfile = await model.getDoctorProfile(); if (widget.specialClinic != null && widget.specialClinic!.clinicID != null) { diff --git a/lib/screens/patients/insurance_approvals_details.dart b/lib/screens/patients/insurance_approvals_details.dart index 5066ace4..a74f0747 100644 --- a/lib/screens/patients/insurance_approvals_details.dart +++ b/lib/screens/patients/insurance_approvals_details.dart @@ -433,7 +433,7 @@ class _InsuranceApprovalsDetailsState extends State { TranslationBase.of(context).companyName + ": ", color: Colors.grey[500], ), - AppText('Sample') + Expanded(child: AppText(projectViewModel.isArabic?model.insuranceApproval[indexInsurance].companyNameN??'':model.insuranceApproval[indexInsurance].companyName??'')) ], ), Row( diff --git a/lib/screens/patients/profile/UCAF/widgets/pocedures_widget.dart b/lib/screens/patients/profile/UCAF/widgets/pocedures_widget.dart index 6e7a9654..83d57923 100644 --- a/lib/screens/patients/profile/UCAF/widgets/pocedures_widget.dart +++ b/lib/screens/patients/profile/UCAF/widgets/pocedures_widget.dart @@ -32,7 +32,7 @@ class ProceduresWidget extends StatelessWidget { SizedBox(width: 10,), CustomRow( label: "${TranslationBase.of(context).quantity}: ", - value: "${procedure.lineItemNo}", + value: "1",//done as prescribed https://cloudsolutions-sa.atlassian.net/browse/V4-40476?focusedCommentId=471705 isExpanded: false, valueSize: SizeConfig.textMultiplier! * 1.8, labelSize: SizeConfig.textMultiplier! * 1.6, diff --git a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart index 3daced66..1f2e41b1 100644 --- a/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/diabetic_chart/diabetic_details_blood_pressurewideget.dart @@ -86,8 +86,9 @@ class _VitalSignDetailsWidgetState extends State { List tableRow = []; widget.diabeticDetailsList!.forEach((diabetic) { var data = diabetic.resultValue; + //https://cloudsolutions-sa.atlassian.net/browse/V4-39217?focusedCommentId=47028722 DateTime elementDate = - AppDateUtils.getDateTimeFromServerFormat(diabetic.dateChart!); + AppDateUtils.parseDateTimeWithRiyadhTZ(diabetic.dateChart!); if (data != 0) tableRow.add(TableRow(children: [ Container( diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index a234e9e1..0d8a7daf 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -52,145 +52,159 @@ class _LabsHomePageState extends State { model.getLabs(patient!, isInpatient: false); model.isPrincipalCovered(patient: patient!); }, - builder: (context, ProcedureViewModel model, widget) => AppScaffold( - baseViewModel: model, - backgroundColor: Colors.grey[100]!, - isShowAppBar: true, - appBar: PatientProfileAppBar( - patient!, - isInpatient: isInpatient!, - ), - body: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: FractionallySizedBox( - widthFactor: 1.0, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - if ((model.patientLabOrdersList.isNotEmpty && patient!.patientStatusType != 43) || (patient!.patientStatusType != null && patient!.patientStatusType == 43)) - ServiceTitle( - title: TranslationBase.of(context).lab, - subTitle: TranslationBase.of(context).result, - ), - SizedBox( - height: 20, - ), - !model.isPrincipalCovered_ - ? Center( - child: AppText( - TranslationBase.of(context).principalCoveredOrNot, - color: Colors.red, - textAlign: TextAlign.center, - )) - : SizedBox(), - if ((patient!.patientStatusType != null && patient!.patientStatusType == 43) || (isFromLiveCare! && patient!.appointmentNo != null)) - AddNewOrder( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => BaseAddProcedureTabPage( - patient: patient!, - previousProcedureViewModel: model, - procedureType: ProcedureType.LAB_RESULT, - ), - settings: RouteSettings(name: 'AddProcedureTabPage'), - ), - ); - }, - label: TranslationBase.of(context).applyForNewLabOrder, - ), - ...List.generate( - model.patientLabOrdersList.length, - (index) => Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Colors.white, + builder: (context, ProcedureViewModel model, widget) => + + // AppScaffold( + // baseViewModel: model, + // backgroundColor: Colors.grey[100]!, + // isShowAppBar: true, + // appBar: PatientProfileAppBar( + // patient!, + // isInpatient: isInpatient!, + // ), + // body: + Material( + child: Column( + children: [ + PatientProfileAppBar( + patient!, + isInpatient: isInpatient!, + ), + Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: FractionallySizedBox( + widthFactor: 1.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + if ((model.patientLabOrdersList.isNotEmpty && patient!.patientStatusType != 43) || (patient!.patientStatusType != null && patient!.patientStatusType == 43)) + ServiceTitle( + title: TranslationBase.of(context).lab, + subTitle: TranslationBase.of(context).result, ), - borderRadius: BorderRadius.all( - Radius.circular(8.0), + SizedBox( + height: 20, + ), + !model.isPrincipalCovered_ + ? Center( + child: AppText( + TranslationBase.of(context).principalCoveredOrNot, + color: Colors.red, + textAlign: TextAlign.center, + )) + : SizedBox(), + if ((patient!.patientStatusType != null && patient!.patientStatusType == 43) || (isFromLiveCare! && patient!.appointmentNo != null)) + AddNewOrder( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => BaseAddProcedureTabPage( + patient: patient!, + previousProcedureViewModel: model, + procedureType: ProcedureType.LAB_RESULT, + ), + settings: RouteSettings(name: 'AddProcedureTabPage'), + ), + ); + }, + label: TranslationBase.of(context).applyForNewLabOrder, ), - color: Colors.white), - child: Stack( - children: [ - Positioned( - bottom: 1, - top: 1, - left: 1, - child: Container( - width: 20, - decoration: BoxDecoration( - color: model.patientLabOrdersList![index].isLiveCareAppointment! - ? Colors.red[900] - : !model.patientLabOrdersList[index].isInOutPatient! - ? Colors.black - : Color(0xffa9a089), - borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), - bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), - topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), - bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)), - ), - child: RotatedBox( - quarterTurns: 3, - child: Center( - child: Text( - model.patientLabOrdersList[index].isLiveCareAppointment! - ? TranslationBase.of(context).liveCare.toUpperCase() + ...List.generate( + model.patientLabOrdersList.length, + (index) => Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Colors.white, + ), + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + color: Colors.white), + child: Stack( + children: [ + Positioned( + bottom: 1, + top: 1, + left: 1, + child: Container( + width: 20, + decoration: BoxDecoration( + color: model.patientLabOrdersList![index].isLiveCareAppointment! + ? Colors.red[900] : !model.patientLabOrdersList[index].isInOutPatient! - ? TranslationBase.of(context).inPatientLabel.toUpperCase() - : TranslationBase.of(context).outpatient.toUpperCase(), - style: TextStyle(color: Colors.white), + ? Colors.black + : Color(0xffa9a089), + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), + bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)), ), - )), - ), - ), - Container( - color: Colors.white, - padding: EdgeInsets.all(0), - margin: EdgeInsets.only(left: 20), - child: DoctorCard( - isNoMargin: true, - onTap: () => Navigator.push( - context, - FadePage( - page: LaboratoryResultPage( - patientLabOrders: model.patientLabOrdersList[index], - patient: patient!, - isInpatient: isInpatient!, - arrivalType: arrivalType!, - patientType: patientType!, + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + model.patientLabOrdersList[index].isLiveCareAppointment! + ? TranslationBase.of(context).liveCare.toUpperCase() + : !model.patientLabOrdersList[index].isInOutPatient! + ? TranslationBase.of(context).inPatientLabel.toUpperCase() + : TranslationBase.of(context).outpatient.toUpperCase(), + style: TextStyle(color: Colors.white), + ), + )), + ), + ), + Container( + color: Colors.white, + padding: EdgeInsets.all(0), + margin: EdgeInsets.only(left: 20), + child: DoctorCard( + isNoMargin: true, + onTap: () => Navigator.push( + context, + FadePage( + page: LaboratoryResultPage( + patientLabOrders: model.patientLabOrdersList[index], + patient: patient!, + isInpatient: isInpatient!, + arrivalType: arrivalType!, + patientType: patientType!, + ), + ), + ), + doctorName: Utils.convertToTitleCase(model.patientLabOrdersList[index].doctorName), + invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}', + profileUrl: model.patientLabOrdersList[index].doctorImageURL, + branch: model.patientLabOrdersList[index].projectName, + clinic: Utils.convertToTitleCase(model.patientLabOrdersList[index].clinicDescription), + appointmentDate: model.patientLabOrdersList[index].createdOn, + orderNo: model.patientLabOrdersList[index].orderNo, + isShowTime: false, ), ), - ), - doctorName: Utils.convertToTitleCase(model.patientLabOrdersList[index].doctorName), - invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}', - profileUrl: model.patientLabOrdersList[index].doctorImageURL, - branch: model.patientLabOrdersList[index].projectName, - clinic: Utils.convertToTitleCase(model.patientLabOrdersList[index].clinicDescription), - appointmentDate: model.patientLabOrdersList[index].createdOn, - orderNo: model.patientLabOrdersList[index].orderNo, - isShowTime: false, + ], ), ), - ], - ), + ), + if (model.patientLabOrdersList.isEmpty && patient!.patientStatusType != 43) + Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + )) + ], ), ), - if (model.patientLabOrdersList.isEmpty && patient!.patientStatusType != 43) - Center( - child: ErrorMessage( - error: TranslationBase.of(context).noDataAvailable, - )) - ], - ), - ), - ), + ), + ), + ], + ), ), ); } diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index a039bb00..54a846a3 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -98,8 +98,8 @@ class _AddVerifyMedicalReportState extends State { if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); widget.medicalReport != null - ? await widget.model!.updateMedicalReport(widget.patient!, txtOfMedicalReport, widget.medicalReport != null ? widget.medicalReport!.lineItemNo! : 0, - widget.medicalReport != null ? widget.medicalReport!.invoiceNo! : "", widget.isVidaPlusProject) + ? await widget.model!.updateMedicalReport(widget.patient!, txtOfMedicalReport, widget.medicalReport != null ? widget.medicalReport!.lineItemNo??0: 0, + widget.medicalReport != null ? widget.medicalReport!.invoiceNo??"" : "", widget.isVidaPlusProject) : await widget.model!.addMedicalReport(widget.patient!, txtOfMedicalReport, widget.isVidaPlusProject); //model.getMedicalReportList(patient); @@ -128,6 +128,7 @@ class _AddVerifyMedicalReportState extends State { txtOfMedicalReport = (await _controller.getText())!; if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); + print("isVidaPlusProject: ${widget.isVidaPlusProject}"); await widget.model!.verifyMedicalReport(widget.patient!, widget.medicalReport!, widget.isVidaPlusProject); GifLoaderDialogUtils.hideDialog(context); Navigator.pop(context); diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index 777729f6..3da266fd 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -124,6 +124,7 @@ class _MedicalReportPageState extends State { model: model, medicalNote: model .medicalReportList[index].reportDataHtml, + isVidaPlusProject: isVidaPlusProject ), settings: RouteSettings(name: 'AddVerifyMedicalReport')), @@ -157,7 +158,10 @@ class _MedicalReportPageState extends State { children: [ AppText( model.medicalReportList[index].status == 1 - ? TranslationBase.of(context).onHold + ? isVidaPlusProject + ? TranslationBase.of(context) + .pending + : TranslationBase.of(context).onHold : TranslationBase.of(context).verified, color: model.medicalReportList[index].status == 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 7a632500..7fccacfb 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -267,6 +267,13 @@ String noteValidation =""; height: 30, ), onPressed: () async { + if(ProjectViewModel.getVidaPlusStatus() && !isInpatient){ + Navigator.of(context).pushNamed( + UPDATE_EPISODE_VIDA_PLUS, arguments: { + 'patient': patient + }); + return; + } if ((isFromLiveCare && patient.appointmentNo != null) || patient.patientStatusType == 43 || isInpatient) { createEpisode(patient: patient, model: model); } @@ -489,11 +496,12 @@ String noteValidation =""; eventAction: "Create Episode", ); GifLoaderDialogUtils.showMyDialog(context); - if (patient.admissionNo != null && patient.admissionNo!.isNotEmpty) { + var admissionNo = isVidaPlusProject?patient.admissionID?.toString()??"":patient.admissionNo??""; + if (admissionNo.isNotEmpty) { PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: isVidaPlusProject?patient.admissionID:int.parse(patient.admissionNo!), patientID: patient.patientId); await model.postEpisodeForInPatient(postEpisodeReqModel); } else { - PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(appointmentNo: int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN); + PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(appointmentNo: int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN); await model.postEpisode(postEpisodeReqModel); } diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index 9aae0cdd..7d4f9134 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -49,7 +49,7 @@ class RadiologyDetailsPage extends StatelessWidget { clinic: finalRadiology.clinicDescription, branch: finalRadiology.projectName, profileUrl: finalRadiology.doctorImageURL, - invoiceNO: finalRadiology.invoiceNo.toString(), + invoiceNO: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP.toString() : finalRadiology.invoiceNo.toString(), isAppointmentHeader: true, ), isShowAppBar: true, diff --git a/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart index 8900aa77..3c12a96d 100644 --- a/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart @@ -51,6 +51,7 @@ class _PatientMakeInPatientReferralScreenState extends State { patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}", isSameBranch: model.patientReferral[model.patientReferral.length - 1].isReferralDoctorSameBranch, isReferral: true, - remark: model.patientReferral[model.patientReferral.length - 1].remarksFromSource!, + remark: model.patientReferral[model.patientReferral.length - 1].remarksFromSource, nationality: model.patientReferral[model.patientReferral.length - 1].patientDetails!.nationalityName!, - nationalityFlag: model.patientReferral[model.patientReferral.length - 1].nationalityFlagUrl!, + nationalityFlag: model.patientReferral[model.patientReferral.length - 1].nationalityFlagUrl, doctorAvatar: model.patientReferral[model.patientReferral.length - 1].doctorImageUrl!, referralDoctorName: model.patientReferral[model.patientReferral.length - 1].referredByDoctorInfo!, clinicDescription: "", diff --git a/lib/screens/patients/profile/soap_update_vida_plus/objective/add_details_to_examination_vida_plus.dart b/lib/screens/patients/profile/soap_update_vida_plus/objective/add_details_to_examination_vida_plus.dart index 86d0bf15..40de420b 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/objective/add_details_to_examination_vida_plus.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/objective/add_details_to_examination_vida_plus.dart @@ -123,7 +123,7 @@ class _AddDetailsToExaminationVidaPlusState if (listOfSelectedCategory.isEmpty) { DrAppToastMsg.showErrorToast( TranslationBase.of(context) - .kindlySelectCategory); + .kindlySelectAllMandatoryField); return; } /* if (listOfSelectedCategory.any((value) { diff --git a/lib/screens/patients/profile/soap_update_vida_plus/objective/add_examination_page_vida_plus.dart b/lib/screens/patients/profile/soap_update_vida_plus/objective/add_examination_page_vida_plus.dart index 56140917..159e3a80 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/objective/add_examination_page_vida_plus.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/objective/add_examination_page_vida_plus.dart @@ -128,7 +128,7 @@ class _AddExaminationPageVidaPlusState fontWeight: FontWeight.w600, onPressed: () async { if(mySelectedExaminationLocal.isEmpty){ - DrAppToastMsg.showErrorToast(TranslationBase.of(context).kindlySelectCategory); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).kindlySelectAllMandatoryField); return; } pushAddExamination(mySelectedExaminationLocal); diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/present_illness/update_present_illness.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/present_illness/update_present_illness.dart index 70fb1250..97f8c846 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/present_illness/update_present_illness.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/present_illness/update_present_illness.dart @@ -240,11 +240,11 @@ class UpdatePresentIllnessState extends State { ); } saveHopi(SOAPViewModel model) async{ - GifLoaderDialogUtils.showMyDialog(context); if(patientController.text.isEmpty) { DrAppToastMsg.showErrorToast("Please Enter Remarks"); return; } + GifLoaderDialogUtils.showMyDialog(context); Map request = { "hpi": patientController.text, "isHpiTakenPatient": isPatientSelected, diff --git a/lib/screens/prescription/add_prescription/add_drug/add_drug_widget.dart b/lib/screens/prescription/add_prescription/add_drug/add_drug_widget.dart index ad3628cd..2a929a91 100644 --- a/lib/screens/prescription/add_prescription/add_drug/add_drug_widget.dart +++ b/lib/screens/prescription/add_prescription/add_drug/add_drug_widget.dart @@ -151,6 +151,7 @@ class _AddDrugWidgetState extends State { !.getPrescriptionListNew( appNo: widget.patient!.appointmentNo, mrn: widget.patient!.patientMRN, + episodeId: widget.patient!.episodeNo, isLocalBusy: true); GifLoaderDialogUtils.hideDialog(context); DrAppToastMsg.showSuccesToast( diff --git a/lib/screens/prescription/add_prescription/prescription_form_widget.dart b/lib/screens/prescription/add_prescription/prescription_form_widget.dart index 7af4b67b..bc066c34 100644 --- a/lib/screens/prescription/add_prescription/prescription_form_widget.dart +++ b/lib/screens/prescription/add_prescription/prescription_form_widget.dart @@ -160,32 +160,33 @@ getIcdCodeData() async{ SizedBox( height: 15.0, ), - Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - width: 6, - ), - AppText( - TranslationBase.of(context).orderType, - fontWeight: FontWeight.w500, - ), - SizedBox( - width: 18, - ), - Radio( - activeColor: AppGlobal.appRedColor, - value: 1, - groupValue: selectedType, - onChanged: (value) { - setSelectedType(value!); - }, - ), - Text(TranslationBase.of(context).regular), - ], - ), - ), + // Container( + // child: + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // SizedBox( + // width: 6, + // ), + // AppText( + // TranslationBase.of(context).orderType, + // fontWeight: FontWeight.w500, + // ), + // SizedBox( + // width: 18, + // ), + // Radio( + // activeColor: AppGlobal.appRedColor, + // value: 1, + // groupValue: selectedType, + // onChanged: (value) { + // setSelectedType(value!); + // }, + // ), + // Text(TranslationBase.of(context).regular), + // ], + // ), + // ), Row( children: [ Container( diff --git a/lib/screens/prescription/add_prescription/search_preescription_widget.dart b/lib/screens/prescription/add_prescription/search_preescription_widget.dart index 959dfee8..dfd5a2a5 100644 --- a/lib/screens/prescription/add_prescription/search_preescription_widget.dart +++ b/lib/screens/prescription/add_prescription/search_preescription_widget.dart @@ -14,15 +14,27 @@ import '../../../widgets/shared/network_base_view.dart'; import '../../../widgets/shared/text_fields/app_text_form_field.dart'; import '../../base/base_view.dart'; -final myController = TextEditingController(); -class SearchPrescriptionWidget extends StatelessWidget { +class SearchPrescriptionWidget extends StatefulWidget { final double? spaceBetweenTextFields; final MedicineViewModel? medicineViewModel; final PrescriptionViewModel? prescriptionViewModel; final Function(GetMedicationResponseModel)? onItemSelected; - const SearchPrescriptionWidget({Key? key, this.spaceBetweenTextFields, this.medicineViewModel, this.prescriptionViewModel, this.onItemSelected}) : super(key: key); + SearchPrescriptionWidget({Key? key, this.spaceBetweenTextFields, this.medicineViewModel, this.prescriptionViewModel, this.onItemSelected}) : super(key: key); + + @override + State createState() => _SearchPrescriptionWidgetState(); +} + +class _SearchPrescriptionWidgetState extends State { + final myController = TextEditingController(); + + @override + void initState() { + + super.initState(); + } @override Widget build(BuildContext context) { @@ -93,7 +105,7 @@ class SearchPrescriptionWidget extends StatelessWidget { GifLoaderDialogUtils.showMyDialog(context); await model.getItem(itemID: model.allMedicationList[index].itemId!, isLocalBusy: true); GifLoaderDialogUtils.hideDialog(context); - onItemSelected!(model.allMedicationList[index]); + widget.onItemSelected!(model.allMedicationList[index]); // uom = _selectedMedication.uom; }, ); @@ -104,7 +116,7 @@ class SearchPrescriptionWidget extends StatelessWidget { ), ), SizedBox( - height: spaceBetweenTextFields, + height: widget.spaceBetweenTextFields, ), ], ), diff --git a/lib/screens/prescription/new_prescriptions_page.dart b/lib/screens/prescription/new_prescriptions_page.dart index accf7ead..f88b2f9b 100644 --- a/lib/screens/prescription/new_prescriptions_page.dart +++ b/lib/screens/prescription/new_prescriptions_page.dart @@ -36,7 +36,9 @@ class NewPrescriptionsPage extends StatelessWidget { mrn: patient.patientMRN, appNo: patient.appointmentNo == null ? 0 - : int.parse(patient.appointmentNo.toString())); + : int.parse(patient.appointmentNo.toString()), + episodeId: patient.episodeNo, + ); // } await model.isPrincipalCovered(patient: patient); diff --git a/lib/screens/prescription/prescription_checkout_screen.dart b/lib/screens/prescription/prescription_checkout_screen.dart index 5f492074..9802c65c 100644 --- a/lib/screens/prescription/prescription_checkout_screen.dart +++ b/lib/screens/prescription/prescription_checkout_screen.dart @@ -217,15 +217,15 @@ class _PrescriptionCheckOutScreenState extends State }); GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(patientMRN: widget.patient.patientMRN, episodeID: widget.patient.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: widget.patient.appointmentNo); - if (model.medicationStrengthList.length == 0) { + // if (model.medicationStrengthList.length == 0) { await model.getMedicationStrength(); - } - if (model.medicationDurationList.length == 0) { + // } + // if (model.medicationDurationList.length == 0) { await model.getMedicationDuration(); - } - if (model.medicationDoseTimeList.length == 0) { + // } + // if (model.medicationDoseTimeList.length == 0) { await model.getMedicationDoseTime(); - } + // } await model.getPatientAssessment(getAssessmentReqModel); }, builder: ( diff --git a/lib/screens/procedures/add_procedure_page.dart b/lib/screens/procedures/add_procedure_page.dart index 31917808..761cf377 100644 --- a/lib/screens/procedures/add_procedure_page.dart +++ b/lib/screens/procedures/add_procedure_page.dart @@ -148,11 +148,14 @@ class _AddProcedurePageState extends State { model: widget.model, masterList: model.categoriesList[0].entityList!, removeProcedure: (item) { - setState(() { - entityList.remove(item); - }); - }, - addProcedure: (history) { + EntityList? itemToBeRemoved = entityList.firstWhere((element) => item.procedureId == element.procedureId, orElse: () => EntityList()); + if (itemToBeRemoved.procedureId != null) { + setState(() { + entityList.remove(itemToBeRemoved); + }); + } + }, + addProcedure: (history) { setState(() { entityList.add(history); }); diff --git a/lib/screens/procedures/base_add_procedure_tab_page.dart b/lib/screens/procedures/base_add_procedure_tab_page.dart index 565d4efa..6d1c7d29 100644 --- a/lib/screens/procedures/base_add_procedure_tab_page.dart +++ b/lib/screens/procedures/base_add_procedure_tab_page.dart @@ -60,7 +60,10 @@ class _BaseAddProcedureTabPageState extends State with onModelReady: (model) async { if (widget.previousProcedureViewModel == null) { await model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()); + }else{ + await model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId()); } + }, builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( baseViewModel: model, diff --git a/lib/screens/procedures/favorite_procedure/entity_list_fav_procedure.dart b/lib/screens/procedures/favorite_procedure/entity_list_fav_procedure.dart index a53ef481..75bc2ca8 100644 --- a/lib/screens/procedures/favorite_procedure/entity_list_fav_procedure.dart +++ b/lib/screens/procedures/favorite_procedure/entity_list_fav_procedure.dart @@ -61,13 +61,14 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State items = []; + List items = []; List itemsProcedure = []; List remarksList = []; List typeList = []; @override void initState() { + items = [...widget.model!.templateList]; super.initState(); } @@ -90,7 +91,11 @@ class _EntityListCheckboxSearchFavProceduresWidgetState extends State localizedValues['noRemarks']![locale.languageCode]!; String get kindlySelectCategory => localizedValues['kindlySelectCategory']![locale.languageCode]!; + String get kindlySelectAllMandatoryField => localizedValues['kindlySelectAllMandatoryField']![locale.languageCode]!; String get remarksCanNotBeEmpty => localizedValues['remarksCanNotBeEmpty']![locale.languageCode]!; String get selectedDiagnosis => localizedValues['selectedDiagnosis']![locale.languageCode]!; String get selectConditionFirst => localizedValues['selectConditionFirst']![locale.languageCode]!; diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index 5916466f..65ff02bb 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -94,9 +94,9 @@ class _ListSelectDialogState extends State { children: [ ...items .map((item) => RadioListTile( - title: Text("${Utils.convertToTitleCase(item[widget.attributeName].toString())}"), - groupValue: Utils.convertToTitleCase(widget.selectedValue[widget.attributeValueId].toString()), - value: item[widget.attributeValueId].toString(), + title: Text(Utils.convertToTitleCase(item[widget.attributeName].toString())), + groupValue: widget.selectedValue[widget.attributeValueId].toString().toLowerCase(), + value: item[widget.attributeValueId].toString().toLowerCase(), activeColor: AppGlobal.appRedColor, selected: item[widget.attributeValueId].toString() == widget.selectedValue[widget.attributeValueId].toString(), onChanged: (val) { diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart index 3dcb57d8..a40ae5b4 100644 --- a/lib/widgets/shared/user-guid/CusomRow.dart +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -42,13 +42,15 @@ class CustomRow extends StatelessWidget { SizedBox( width: 1, ), - AppText( - value, - fontSize: valueSize ?? SizeConfig.getTextMultiplierBasedOnWidth() * 2.9, - color: valueColor ?? Color(0xFF2B353E), - fontWeight: FontWeight.w700, - letterSpacing: -0.48, - isCopyable: isCopyable, + Expanded( + child: AppText( + value, + fontSize: valueSize ?? SizeConfig.getTextMultiplierBasedOnWidth() * 2.9, + color: valueColor ?? Color(0xFF2B353E), + fontWeight: FontWeight.w700, + letterSpacing: -0.48, + isCopyable: isCopyable, + ), ), ], ); diff --git a/pubspec.lock b/pubspec.lock index 2ddc7a71..3a3e313d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1594,6 +1594,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.6" + timezone: + dependency: "direct main" + description: + name: timezone + sha256: dd14a3b83cfd7cb19e7888f1cbc20f258b8d71b54c06f79ac585f14093a287d1 + url: "https://pub.dev" + source: hosted + version: "0.10.1" timing: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 8e50a48a..74f668ad 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -138,6 +138,7 @@ dependencies: flutter_zoom_videosdk: 1.12.10 dart_jsonwebtoken: ^2.14.0 two_dimensional_scrollables: ^0.3.3 + timezone: ^0.10.1 dependency_overrides: