Fix medical report issues

merge-requests/764/head
Mohammad Aljammal 3 years ago
parent 8bfb37d4c0
commit e8f9c958b1

@ -5,8 +5,8 @@ const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient";

@ -60,10 +60,12 @@ class PatientMedicalReportViewModel extends BaseViewModel {
await _service.addMedicalReport(patient, htmlText); await _service.addMedicalReport(patient, htmlText);
if (_service.hasError) { if (_service.hasError) {
error = _service.error; error = _service.error;
await getMedicalReportList(patient);
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
await getMedicalReportList(patient); { await getMedicalReportList(patient);
setState(ViewState.Idle); setState(ViewState.Idle);
}
} }
Future updateMedicalReport(PatiantInformtion patient, String htmlText, int limitNumber, String invoiceNumber) async { 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); await _service.updateMedicalReport(patient, htmlText, limitNumber, invoiceNumber);
if (_service.hasError) { if (_service.hasError) {
error = _service.error; error = _service.error;
await getMedicalReportList(patient);
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
await getMedicalReportList(patient); {
setState(ViewState.Idle); await getMedicalReportList(patient);
setState(ViewState.Idle);}
} }
} }

@ -107,8 +107,8 @@ class ProjectViewModel with ChangeNotifier {
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
print(error); //print(error);
throw error; //throw error;
} }
} }

@ -103,12 +103,12 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
if (txtOfMedicalReport.isNotEmpty) { if (txtOfMedicalReport.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.medicalReport != null widget.medicalReport != null
? widget.model.updateMedicalReport( ?await widget.model.updateMedicalReport(
widget.patient, widget.patient,
txtOfMedicalReport, txtOfMedicalReport,
widget.medicalReport != null ? widget.medicalReport.lineItemNo : null, widget.medicalReport != null ? widget.medicalReport.lineItemNo : null,
widget.medicalReport != null ? widget.medicalReport.invoiceNo : null) widget.medicalReport != null ? widget.medicalReport.invoiceNo : null)
: widget.model.addMedicalReport(widget.patient, txtOfMedicalReport); : await widget.model.addMedicalReport(widget.patient, txtOfMedicalReport);
//model.getMedicalReportList(patient); //model.getMedicalReportList(patient);
Navigator.pop(context); Navigator.pop(context);

@ -92,29 +92,15 @@ class _MedicalReportPageState extends State<MedicalReportPage> {
)), )),
); );
// 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, label: TranslationBase.of(context).createNewMedicalReport,
), ),
if (model.state != ViewState.ErrorLocal) // if (model.state != ViewState.ErrorLocal)ß
...List.generate( ...List.generate(
model.medicalReportList.length, model.medicalReportList.length,
(index) => InkWell( (index) => InkWell(
onTap: () { onTap: () {
if (model.medicalReportList[index].status == 1) { 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( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(

Loading…
Cancel
Save