fix things

merge-requests/202/head
Elham Rababah 5 years ago
parent efee00c79e
commit 14955201a9

@ -308,28 +308,34 @@ class _AssessmentPageState extends State<AssessmentPage> {
}
submitAssessment(SOAPViewModel model) async {
PostAssessmentRequestModel postAssessmentRequestModel =
new PostAssessmentRequestModel(
patientMRN: 3120690,
episodeId: 200012117,
appointmentNo: 2016054573,
icdCodeDetails: [new IcdCodeDetails(
remarks: widget.mySelectedAssessment.remark,
complexDiagnosis: true,
conditionId: widget.mySelectedAssessment.selectedDiagnosisCondition.id,
diagnosisTypeId: widget.mySelectedAssessment.selectedDiagnosisType.id ,
icdcode10Id: "1"
)]
);
if (widget.mySelectedAssessment.selectedDiagnosisCondition != null &&
widget.mySelectedAssessment.selectedDiagnosisType != null) {
PostAssessmentRequestModel postAssessmentRequestModel =
new PostAssessmentRequestModel(
patientMRN: 3120690,
episodeId: 200012117,
appointmentNo: 2016054573,
icdCodeDetails: [
new IcdCodeDetails(
remarks: widget.mySelectedAssessment.remark,
complexDiagnosis: true,
conditionId:
widget.mySelectedAssessment.selectedDiagnosisCondition.id,
diagnosisTypeId:
widget.mySelectedAssessment.selectedDiagnosisType.id,
icdcode10Id: "1")
]);
await model.postAssessment(postAssessmentRequestModel);
await model.postAssessment(postAssessmentRequestModel);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
} else {
widget.changePageViewIndex(3);
}
} else {
widget.changePageViewIndex(3);
helpers.showErrorToast('Please add required field correctly');
}
}
openAssessmentDialog(BuildContext context) {

@ -352,11 +352,12 @@ class _ObjectivePageState extends State<ObjectivePage> {
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
} else {
widget.changePageViewIndex(2);
}
} else {
helpers.showErrorToast('Please add required field correctly');
}
// TODO move it back to else stat when it work.
widget.changePageViewIndex(2);
}

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

Loading…
Cancel
Save