add commented code

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

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

@ -320,43 +320,46 @@ class _ObjectivePageState extends State<ObjectivePage> {
} }
submitObjectivePage(SOAPViewModel model) async { submitObjectivePage(SOAPViewModel model) async {
if(widget.mySelectedExamination.isNotEmpty){ // if(widget.mySelectedExamination.isNotEmpty){
PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); // PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel();
widget.mySelectedExamination.forEach((exam) { // widget.mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == // if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
null) // null)
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = [];
//
// postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(
// ListHisProgNotePhysicalExaminationVM(
// patientMRN: 3120690,
// episodeId: 200012117,
// appointmentNo: 2016054573,
// remarks: exam.remark ?? '',
// createdBy: 1485,
// createdOn: DateTime.now().toIso8601String(),
// editedBy: 1485,
// editedOn: DateTime.now().toIso8601String(),
// examId: exam.selectedExamination.id,
// examType: exam.selectedExamination.typeId,
// isAbnormal: exam.isAbnormal,
// isNormal: exam.isNormal,
// masterDescription: exam.selectedExamination,
// notExamined: false
//
// ));
// });
//
// await model.postPhysicalExam(postPhysicalExamRequestModel);
//
// if (model.state == ViewState.ErrorLocal) {
// helpers.showErrorToast(model.error);
// } else {
// widget.changePageViewIndex(2);
// }
// } else {
// helpers.showErrorToast('Please add required field correctly');
// }
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add( widget.changePageViewIndex(2);
ListHisProgNotePhysicalExaminationVM(
patientMRN: 3120690,
episodeId: 200012117,
appointmentNo: 2016054573,
remarks: exam.remark ?? '',
createdBy: 1485,
createdOn: DateTime.now().toIso8601String(),
editedBy: 1485,
editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id,
examType: exam.selectedExamination.typeId,
isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal,
masterDescription: exam.selectedExamination,
notExamined: false
));
});
await model.postPhysicalExam(postPhysicalExamRequestModel);
if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error);
} else {
widget.changePageViewIndex(2);
}
} else {
helpers.showErrorToast('Please add required field correctly');
}
} }

@ -279,42 +279,45 @@ class _SubjectivePageState extends State<SubjectivePage> {
List<MasterKeyModel> myHistoryList}) async { List<MasterKeyModel> myHistoryList}) async {
formKey.currentState.save(); formKey.currentState.save();
formKey.currentState.validate(); 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);
}
}
} widget.changePageViewIndex(1);
} else {
if (myAllergiesList.length != 0) { // if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) {
await postAllergy(myAllergiesList: myAllergiesList, model: model); // await postChiefComplaint(model: model);
if (model.state == ViewState.ErrorLocal) { // if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); // helpers.showErrorToast(model.error);
} else { // } else {
widget.changePageViewIndex(1); // if (myHistoryList.length != 0) {
} // await postHistories(model: model, myHistoryList: myHistoryList);
} else { // if (model.state == ViewState.ErrorLocal) {
widget.changePageViewIndex(1); // helpers.showErrorToast(model.error);
} // } else {
} // if (myAllergiesList.length != 0) {
} // await postAllergy(myAllergiesList: myAllergiesList, model: model);
} else { // if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast('Please add required field correctly'); // 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');
// }
} }

Loading…
Cancel
Save