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_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";

@ -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);}
}
}

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

@ -103,12 +103,12 @@ class _AddVerifyMedicalReportState extends State<AddVerifyMedicalReport> {
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);

@ -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,
),
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(

Loading…
Cancel
Save