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) {
Helpers.showErrorToast(
TranslationBase.of(context)
.assessmentErrorMsg);
} else {
widget.changeLoadingState(true);
widget.changePageViewIndex(3); widget.changePageViewIndex(3);
// if (mySelectedAssessmentList.isEmpty) { }
// Helpers.showErrorToast(
// TranslationBase.of(context)
// .assessmentErrorMsg);
// } else {
// 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);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
PostPhysicalExamRequestModel postPhysicalExamRequestModel =
new PostPhysicalExamRequestModel();
mySelectedExamination.forEach((exam) {
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
null)
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
[];
ListHisProgNotePhysicalExaminationVM
listHisProgNotePhysicalExaminationVM =
ListHisProgNotePhysicalExaminationVM(
patientMRN: widget.patientInfo.patientMRN,
episodeId: widget.patientInfo.episodeNo == null?0: widget.patientInfo.episodeNo,
appointmentNo: widget.patientInfo.appointmentNo == null?0:widget.patientInfo.appointmentNo,
remarks: exam.remark ?? '',
createdBy: exam.createdBy ?? doctorProfile.doctorID,
createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id,
examType: exam.selectedExamination.typeId,
isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal,
notExamined: exam.notExamined,
examinationType: exam.isNormal
? 1
: exam.isAbnormal
? 2
: 3,
examinationTypeName: exam.isNormal
? "Normal"
: exam.isAbnormal
? 'AbNormal'
: "Not Examined",
isNew: exam.isNew,
);
if (widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) {
listHisProgNotePhysicalExaminationVM.admissionNo =
int.parse(widget.patientInfo.admissionNo);
}
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
.add(listHisProgNotePhysicalExaminationVM);
});
if (model.patientPhysicalExamList.isEmpty) {
await model.postPhysicalExam(postPhysicalExamRequestModel);
} else {
await model.patchPhysicalExam(postPhysicalExamRequestModel);
}
/// TODO Elham* move this logic to view model if (model.state == ViewState.ErrorLocal) {
// if (mySelectedExamination.isNotEmpty) { widget.changeLoadingState(false);
// widget.changeLoadingState(true); Helpers.showErrorToast(model.error);
// Map profile = await sharedPref.getObj(DOCTOR_PROFILE); } else {
// widget.changeLoadingState(true);
// DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); widget.changePageViewIndex(2);
// PostPhysicalExamRequestModel postPhysicalExamRequestModel = }
// new PostPhysicalExamRequestModel(); } else {
// mySelectedExamination.forEach((exam) { Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg);
// if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == }
// null)
// postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
// [];
// ListHisProgNotePhysicalExaminationVM
// listHisProgNotePhysicalExaminationVM =
// ListHisProgNotePhysicalExaminationVM(
// patientMRN: widget.patientInfo.patientMRN,
// episodeId: widget.patientInfo.episodeNo,
// appointmentNo: widget.patientInfo.appointmentNo,
// remarks: exam.remark ?? '',
// createdBy: exam.createdBy ?? doctorProfile.doctorID,
// createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
// editedBy: doctorProfile.doctorID,
// editedOn: DateTime.now().toIso8601String(),
// examId: exam.selectedExamination.id,
// examType: exam.selectedExamination.typeId,
// isAbnormal: exam.isAbnormal,
// isNormal: exam.isNormal,
// notExamined: exam.notExamined,
// examinationType: exam.isNormal
// ? 1
// : exam.isAbnormal
// ? 2
// : 3,
// examinationTypeName: exam.isNormal
// ? "Normal"
// : exam.isAbnormal
// ? 'AbNormal'
// : "Not Examined",
// isNew: exam.isNew,
// );
// if (widget.patientInfo.admissionNo != null &&
// widget.patientInfo.admissionNo.isNotEmpty) {
// listHisProgNotePhysicalExaminationVM.admissionNo =
// int.parse(widget.patientInfo.admissionNo);
// }
// postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
// .add(listHisProgNotePhysicalExaminationVM);
// });
//
// if (model.patientPhysicalExamList.isEmpty) {
// await model.postPhysicalExam(postPhysicalExamRequestModel);
// } else {
// await model.patchPhysicalExam(postPhysicalExamRequestModel);
// }
//
// if (model.state == ViewState.ErrorLocal) {
// widget.changeLoadingState(false);
// Helpers.showErrorToast(model.error);
// } else {
// 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);
///TODO Elham*
///
widget.changePageViewIndex(1); widget.changePageViewIndex(1);
// if (complaintsController.text.isNotEmpty && } else {
// illnessController.text.isNotEmpty && setState(() {
// complaintsController.text.length > 25) { if (complaintsController.text.isEmpty) {
// await postChiefComplaint(model: model); complaintsControllerError = TranslationBase.of(context).emptyMessage;
// if (model.state == ViewState.ErrorLocal) { } else if (complaintsController.text.length < 25) {
// Helpers.showErrorToast(model.error); complaintsControllerError =
// } TranslationBase.of(context).chiefComplaintLength;
// if (myHistoryList.length != 0) { }
// await postHistories(model: model, myHistoryList: myHistoryList);
// if (model.state == ViewState.ErrorLocal) { if (illnessController.text.isEmpty) {
// Helpers.showErrorToast(model.error); illnessControllerError = TranslationBase.of(context).emptyMessage;
// } }
// }
// if (myAllergiesList.length != 0) { if (medicationController.text.isEmpty) {
// await postAllergy(myAllergiesList: myAllergiesList, model: model); medicationControllerError = TranslationBase.of(context).emptyMessage;
// if (model.state == ViewState.ErrorLocal) { }
// Helpers.showErrorToast(model.error); });
// }
// } widget.changeLoadingState(false);
// widget.changeLoadingState(true); Helpers.showErrorToast(
// TranslationBase.of(context).chiefComplaintErrorMsg);
// 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