|
|
|
|
@ -104,11 +104,14 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
|
widthFactor: 0.9,
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
SOAPStepHeader(
|
|
|
|
|
currentIndex: widget.currentIndex,
|
|
|
|
|
@ -269,63 +272,66 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
submitUpdateObjectivePage(SOAPViewModel model) async {
|
|
|
|
|
if (mySelectedExamination.isNotEmpty) {
|
|
|
|
|
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 =
|
|
|
|
|
[];
|
|
|
|
|
|
|
|
|
|
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
|
|
|
|
|
.add(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 (model.patientPhysicalExamList.isEmpty) {
|
|
|
|
|
await model.postPhysicalExam(postPhysicalExamRequestModel);
|
|
|
|
|
} else {
|
|
|
|
|
await model.patchPhysicalExam(postPhysicalExamRequestModel);
|
|
|
|
|
}
|
|
|
|
|
// TODO Elham*
|
|
|
|
|
widget.changePageViewIndex(2);
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
// if (mySelectedExamination.isNotEmpty) {
|
|
|
|
|
// 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 =
|
|
|
|
|
// [];
|
|
|
|
|
//
|
|
|
|
|
// postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
|
|
|
|
|
// .add(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 (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) {
|
|
|
|
|
|