return the function code back

merge-requests/787/head
Elham Rababh 5 years ago
parent 8147d20fc6
commit 6db5191e07

@ -363,8 +363,8 @@ class SOAPViewModel extends BaseViewModel {
GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel getPhysicalExamReqModel =
GetPhysicalExamReqModel( GetPhysicalExamReqModel(
patientMRN: patientInfo.patientMRN, patientMRN: patientInfo.patientMRN,
episodeID: patientInfo.episodeNo.toString(), episodeID: patientInfo.episodeNo == null?"0":patientInfo.episodeNo.toString(),
appointmentNo: int.parse( appointmentNo: patientInfo.appointmentNo == null ?0:int.parse(
patientInfo.appointmentNo.toString(), patientInfo.appointmentNo.toString(),
), ),
); );

@ -507,15 +507,13 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> implements
@override @override
nextFunction(model) { nextFunction(model) {
// TODO Elham* if (mySelectedAssessmentList.isEmpty) {
widget.changePageViewIndex(3); Helpers.showErrorToast(
// if (mySelectedAssessmentList.isEmpty) { TranslationBase.of(context)
// Helpers.showErrorToast( .assessmentErrorMsg);
// TranslationBase.of(context) } else {
// .assessmentErrorMsg); widget.changeLoadingState(true);
// } else { widget.changePageViewIndex(3);
// widget.changeLoadingState(true); }
// widget.changePageViewIndex(3);
// }
} }
} }

@ -205,75 +205,71 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
} }
submitUpdateObjectivePage(SOAPViewModel model) async { submitUpdateObjectivePage(SOAPViewModel model) async {
// TODO Elham* if (mySelectedExamination.isNotEmpty) {
widget.changePageViewIndex(2); widget.changeLoadingState(true);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
/// TODO Elham* move this logic to view model DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
// if (mySelectedExamination.isNotEmpty) { PostPhysicalExamRequestModel postPhysicalExamRequestModel =
// widget.changeLoadingState(true); new PostPhysicalExamRequestModel();
// Map profile = await sharedPref.getObj(DOCTOR_PROFILE); mySelectedExamination.forEach((exam) {
// if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
// DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); null)
// PostPhysicalExamRequestModel postPhysicalExamRequestModel = postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
// new PostPhysicalExamRequestModel(); [];
// mySelectedExamination.forEach((exam) { ListHisProgNotePhysicalExaminationVM
// if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == listHisProgNotePhysicalExaminationVM =
// null) ListHisProgNotePhysicalExaminationVM(
// postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = patientMRN: widget.patientInfo.patientMRN,
// []; episodeId: widget.patientInfo.episodeNo == null?0: widget.patientInfo.episodeNo,
// ListHisProgNotePhysicalExaminationVM appointmentNo: widget.patientInfo.appointmentNo == null?0:widget.patientInfo.appointmentNo,
// listHisProgNotePhysicalExaminationVM = remarks: exam.remark ?? '',
// ListHisProgNotePhysicalExaminationVM( createdBy: exam.createdBy ?? doctorProfile.doctorID,
// patientMRN: widget.patientInfo.patientMRN, createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
// episodeId: widget.patientInfo.episodeNo, editedBy: doctorProfile.doctorID,
// appointmentNo: widget.patientInfo.appointmentNo, editedOn: DateTime.now().toIso8601String(),
// remarks: exam.remark ?? '', examId: exam.selectedExamination.id,
// createdBy: exam.createdBy ?? doctorProfile.doctorID, examType: exam.selectedExamination.typeId,
// createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), isAbnormal: exam.isAbnormal,
// editedBy: doctorProfile.doctorID, isNormal: exam.isNormal,
// editedOn: DateTime.now().toIso8601String(), notExamined: exam.notExamined,
// examId: exam.selectedExamination.id, examinationType: exam.isNormal
// examType: exam.selectedExamination.typeId, ? 1
// isAbnormal: exam.isAbnormal, : exam.isAbnormal
// isNormal: exam.isNormal, ? 2
// notExamined: exam.notExamined, : 3,
// examinationType: exam.isNormal examinationTypeName: exam.isNormal
// ? 1 ? "Normal"
// : exam.isAbnormal : exam.isAbnormal
// ? 2 ? 'AbNormal'
// : 3, : "Not Examined",
// examinationTypeName: exam.isNormal isNew: exam.isNew,
// ? "Normal" );
// : exam.isAbnormal if (widget.patientInfo.admissionNo != null &&
// ? 'AbNormal' widget.patientInfo.admissionNo.isNotEmpty) {
// : "Not Examined", listHisProgNotePhysicalExaminationVM.admissionNo =
// isNew: exam.isNew, int.parse(widget.patientInfo.admissionNo);
// ); }
// if (widget.patientInfo.admissionNo != null && postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
// widget.patientInfo.admissionNo.isNotEmpty) { .add(listHisProgNotePhysicalExaminationVM);
// listHisProgNotePhysicalExaminationVM.admissionNo = });
// int.parse(widget.patientInfo.admissionNo);
// } if (model.patientPhysicalExamList.isEmpty) {
// postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM await model.postPhysicalExam(postPhysicalExamRequestModel);
// .add(listHisProgNotePhysicalExaminationVM); } else {
// }); await model.patchPhysicalExam(postPhysicalExamRequestModel);
// }
// if (model.patientPhysicalExamList.isEmpty) {
// await model.postPhysicalExam(postPhysicalExamRequestModel); if (model.state == ViewState.ErrorLocal) {
// } else { widget.changeLoadingState(false);
// await model.patchPhysicalExam(postPhysicalExamRequestModel); Helpers.showErrorToast(model.error);
// } } else {
// widget.changeLoadingState(true);
// if (model.state == ViewState.ErrorLocal) { widget.changePageViewIndex(2);
// widget.changeLoadingState(false); }
// Helpers.showErrorToast(model.error); } else {
// } else { Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg);
// widget.changeLoadingState(true); }
// widget.changePageViewIndex(2);
// }
// } else {
// Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg);
// }
} }
removeExamination(MasterKeyModel masterKey) { removeExamination(MasterKeyModel masterKey) {

@ -400,7 +400,6 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
@override @override
nextFunction(model) { nextFunction(model) {
print("dfdfdf");
if (progressNoteController.text.isNotEmpty) { if (progressNoteController.text.isNotEmpty) {
if (isAddProgress) { if (isAddProgress) {
submitPlan(model); submitPlan(model);

@ -334,54 +334,50 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
complaintsControllerError = ''; complaintsControllerError = '';
medicationControllerError = ''; medicationControllerError = '';
illnessControllerError = ''; illnessControllerError = '';
if (complaintsController.text.isNotEmpty &&
illnessController.text.isNotEmpty &&
complaintsController.text.length > 25) {
await postChiefComplaint(model: model);
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
}
if (myHistoryList.length != 0) {
await postHistories(model: model, myHistoryList: myHistoryList);
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
}
}
if (myAllergiesList.length != 0) {
await postAllergy(myAllergiesList: myAllergiesList, model: model);
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
}
}
widget.changeLoadingState(true);
widget.changePageViewIndex(1);
} else {
setState(() {
if (complaintsController.text.isEmpty) {
complaintsControllerError = TranslationBase.of(context).emptyMessage;
} else if (complaintsController.text.length < 25) {
complaintsControllerError =
TranslationBase.of(context).chiefComplaintLength;
}
if (illnessController.text.isEmpty) {
illnessControllerError = TranslationBase.of(context).emptyMessage;
}
///TODO Elham* if (medicationController.text.isEmpty) {
/// medicationControllerError = TranslationBase.of(context).emptyMessage;
widget.changePageViewIndex(1); }
// if (complaintsController.text.isNotEmpty && });
// illnessController.text.isNotEmpty &&
// complaintsController.text.length > 25) { widget.changeLoadingState(false);
// await postChiefComplaint(model: model); Helpers.showErrorToast(
// if (model.state == ViewState.ErrorLocal) { TranslationBase.of(context).chiefComplaintErrorMsg);
// Helpers.showErrorToast(model.error); }
// }
// if (myHistoryList.length != 0) {
// await postHistories(model: model, myHistoryList: myHistoryList);
// if (model.state == ViewState.ErrorLocal) {
// Helpers.showErrorToast(model.error);
// }
// }
// if (myAllergiesList.length != 0) {
// await postAllergy(myAllergiesList: myAllergiesList, model: model);
// if (model.state == ViewState.ErrorLocal) {
// Helpers.showErrorToast(model.error);
// }
// }
// widget.changeLoadingState(true);
//
// widget.changePageViewIndex(1);
// } else {
// setState(() {
// if (complaintsController.text.isEmpty) {
// complaintsControllerError = TranslationBase.of(context).emptyMessage;
// } else if (complaintsController.text.length < 25) {
// complaintsControllerError =
// TranslationBase.of(context).chiefComplaintLength;
// }
//
// if (illnessController.text.isEmpty) {
// illnessControllerError = TranslationBase.of(context).emptyMessage;
// }
//
// if (medicationController.text.isEmpty) {
// medicationControllerError = TranslationBase.of(context).emptyMessage;
// }
// });
//
// widget.changeLoadingState(false);
// Helpers.showErrorToast(
// TranslationBase.of(context).chiefComplaintErrorMsg);
// }
} }
postAllergy( postAllergy(

Loading…
Cancel
Save