|
|
|
|
@ -68,16 +68,30 @@ class MedicineViewModel extends BaseViewModel {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future getItem({int itemID}) async {
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
Future getItem({int itemID, bool isLocalBusy = false}) async {
|
|
|
|
|
if (isLocalBusy) {
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
} else {
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
}
|
|
|
|
|
await _prescriptionService.getItem(itemID: itemID);
|
|
|
|
|
if (_prescriptionService.hasError) {
|
|
|
|
|
error = _prescriptionService.error;
|
|
|
|
|
setState(ViewState.Error);
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// async {
|
|
|
|
|
// setState(ViewState.BusyLocal);
|
|
|
|
|
// await _prescriptionService.getItem(itemID: itemID);
|
|
|
|
|
// if (_prescriptionService.hasError) {
|
|
|
|
|
// error = _prescriptionService.error;
|
|
|
|
|
// setState(ViewState.ErrorLocal);
|
|
|
|
|
// } else
|
|
|
|
|
// setState(ViewState.Idle);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
setTemplateListDependOnId() {
|
|
|
|
|
procedureTemplate.forEach((element) {
|
|
|
|
|
List<ProcedureTempleteDetailsModelList> templateListData = templateList
|
|
|
|
|
@ -180,10 +194,7 @@ class MedicineViewModel extends BaseViewModel {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future getAssessmentList ({
|
|
|
|
|
PatiantInformtion patientInfo,
|
|
|
|
|
bool isLocalBusy = false
|
|
|
|
|
}) async {
|
|
|
|
|
Future getAssessmentList ({PatiantInformtion patientInfo, bool isLocalBusy = false}) async {
|
|
|
|
|
if (isLocalBusy) {
|
|
|
|
|
setState(ViewState.BusyLocal);
|
|
|
|
|
} else {
|
|
|
|
|
@ -196,13 +207,13 @@ class MedicineViewModel extends BaseViewModel {
|
|
|
|
|
doctorID: '',
|
|
|
|
|
appointmentNo: patientInfo.appointmentNo);
|
|
|
|
|
if (medicationStrengthList.length == 0) {
|
|
|
|
|
await getMedicationStrength();
|
|
|
|
|
await getMedicationStrength(isLocalBusy: true);
|
|
|
|
|
}
|
|
|
|
|
if (medicationDurationList.length == 0) {
|
|
|
|
|
await getMedicationDuration();
|
|
|
|
|
await getMedicationDuration(isLocalBusy: true);
|
|
|
|
|
}
|
|
|
|
|
if (medicationDoseTimeList.length == 0) {
|
|
|
|
|
await getMedicationDoseTime();
|
|
|
|
|
await getMedicationDoseTime(isLocalBusy: true);
|
|
|
|
|
}
|
|
|
|
|
await getPatientAssessment(getAssessmentReqModel, isLocalBusy: true);
|
|
|
|
|
if (_prescriptionService.hasError) {
|
|
|
|
|
@ -217,18 +228,7 @@ class MedicineViewModel extends BaseViewModel {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future getProcedureTemplate({String categoryID}) async {
|
|
|
|
|
hasError = false;
|
|
|
|
|
setState(ViewState.Busy);
|
|
|
|
|
await _procedureService.getProcedureTemplate(categoryID: categoryID);
|
|
|
|
|
if (_procedureService.hasError) {
|
|
|
|
|
error = _procedureService.error;
|
|
|
|
|
setState(ViewState.ErrorLocal);
|
|
|
|
|
} else {
|
|
|
|
|
setTemplateListDependOnId();
|
|
|
|
|
setState(ViewState.Idle);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future getPrescription({int mrn}) async {
|
|
|
|
|
//hasError = false;
|
|
|
|
|
|