diff --git a/lib/config/config.dart b/lib/config/config.dart index 2d8e4ea2..d6836827 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; diff --git a/lib/core/viewModel/PatientMedicalReportViewModel.dart b/lib/core/viewModel/PatientMedicalReportViewModel.dart index ac5ecdeb..e7d343b4 100644 --- a/lib/core/viewModel/PatientMedicalReportViewModel.dart +++ b/lib/core/viewModel/PatientMedicalReportViewModel.dart @@ -60,10 +60,12 @@ class PatientMedicalReportViewModel extends BaseViewModel { await _service.addMedicalReport(patient, htmlText); if (_service.hasError) { error = _service.error; + await getMedicalReportList(patient); setState(ViewState.ErrorLocal); } else - await getMedicalReportList(patient); - setState(ViewState.Idle); + { await getMedicalReportList(patient); + setState(ViewState.Idle); + } } Future updateMedicalReport(PatiantInformtion patient, String htmlText, int limitNumber, String invoiceNumber) async { @@ -71,9 +73,11 @@ class PatientMedicalReportViewModel extends BaseViewModel { await _service.updateMedicalReport(patient, htmlText, limitNumber, invoiceNumber); if (_service.hasError) { error = _service.error; + await getMedicalReportList(patient); setState(ViewState.ErrorLocal); } else - await getMedicalReportList(patient); - setState(ViewState.Idle); + { + await getMedicalReportList(patient); + setState(ViewState.Idle);} } } diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index f464df0e..e7b7a80f 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -107,8 +107,8 @@ class ProjectViewModel with ChangeNotifier { return Future.value(localRes); } catch (error) { - print(error); - throw error; + //print(error); + //throw error; } } diff --git a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart index 4a6be6c8..b3714edd 100644 --- a/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart +++ b/lib/screens/patients/profile/medical_report/AddVerifyMedicalReport.dart @@ -103,12 +103,12 @@ class _AddVerifyMedicalReportState extends State { if (txtOfMedicalReport.isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); widget.medicalReport != null - ? widget.model.updateMedicalReport( + ?await widget.model.updateMedicalReport( widget.patient, txtOfMedicalReport, widget.medicalReport != null ? widget.medicalReport.lineItemNo : null, widget.medicalReport != null ? widget.medicalReport.invoiceNo : null) - : widget.model.addMedicalReport(widget.patient, txtOfMedicalReport); + : await widget.model.addMedicalReport(widget.patient, txtOfMedicalReport); //model.getMedicalReportList(patient); Navigator.pop(context); diff --git a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart index 22645520..a5c367de 100644 --- a/lib/screens/patients/profile/medical_report/MedicalReportPage.dart +++ b/lib/screens/patients/profile/medical_report/MedicalReportPage.dart @@ -92,29 +92,15 @@ class _MedicalReportPageState extends State { )), ); - // Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_INSERT, arguments: { - // 'patient': patient, - // 'patientType': patientType, - // 'arrivalType': arrivalType, - // 'type': MedicalReportStatus.ADD, - // 'model': model, - // }); }, label: TranslationBase.of(context).createNewMedicalReport, ), - if (model.state != ViewState.ErrorLocal) + // if (model.state != ViewState.ErrorLocal)ß ...List.generate( model.medicalReportList.length, (index) => InkWell( onTap: () { if (model.medicalReportList[index].status == 1) { - // Navigator.of(context).pushNamed(PATIENT_MEDICAL_REPORT_INSERT, arguments: { - // 'patient': patient, - // 'patientType': patientType, - // 'arrivalType': arrivalType, - // 'medicalReport': model.medicalReportList[index], - // 'model': model, - // }); Navigator.push( context, MaterialPageRoute(