|
|
|
|
@ -277,13 +277,45 @@ class _SubjectivePageState extends State<SubjectivePage> {
|
|
|
|
|
{SOAPViewModel model,
|
|
|
|
|
List<MySelectedAllergy> myAllergiesList,
|
|
|
|
|
List<MasterKeyModel> myHistoryList}) async {
|
|
|
|
|
await postChiefComplaint(model: model);
|
|
|
|
|
if (myHistoryList.length != 0)
|
|
|
|
|
await postHistories(model: model, myHistoryList: myHistoryList);
|
|
|
|
|
if (myAllergiesList.length != 0)
|
|
|
|
|
await postAllergy(myAllergiesList: myAllergiesList, model: model);
|
|
|
|
|
formKey.currentState.save();
|
|
|
|
|
formKey.currentState.validate();
|
|
|
|
|
if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) {
|
|
|
|
|
await postChiefComplaint(model: model);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
helpers.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
if (myHistoryList.length != 0) {
|
|
|
|
|
await postHistories(model: model, myHistoryList: myHistoryList);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
helpers.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
if (myAllergiesList.length != 0) {
|
|
|
|
|
await postAllergy(myAllergiesList: myAllergiesList, model: model);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
helpers.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
widget.changePageViewIndex(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (myAllergiesList.length != 0) {
|
|
|
|
|
await postAllergy(myAllergiesList: myAllergiesList, model: model);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
helpers.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
widget.changePageViewIndex(1);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
widget.changePageViewIndex(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
helpers.showErrorToast('Please add required field correctly');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
widget.changePageViewIndex(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
postAllergy(
|
|
|
|
|
@ -362,9 +394,6 @@ class _SubjectivePageState extends State<SubjectivePage> {
|
|
|
|
|
|
|
|
|
|
await model.postChiefComplaint(postChiefComplaintRequestModel);
|
|
|
|
|
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
helpers.showErrorToast(model.error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|