|
|
|
|
@ -71,7 +71,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
|
|
|
|
|
await model.getMasterLookup(MasterKeysService.PhysicalExamination);
|
|
|
|
|
}
|
|
|
|
|
model.patientPhysicalExamList.forEach((element) {
|
|
|
|
|
MasterKeyModel examMaster = model.getOneMasterKey(
|
|
|
|
|
MasterKeyModel? examMaster = model.getOneMasterKey(
|
|
|
|
|
masterKeys: MasterKeysService.PhysicalExamination,
|
|
|
|
|
id: element.examId,
|
|
|
|
|
);
|
|
|
|
|
@ -152,7 +152,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
|
|
|
|
|
.map((examination) {
|
|
|
|
|
return ExaminationItemCard(examination, () {
|
|
|
|
|
removeExamination(
|
|
|
|
|
examination.selectedExamination);
|
|
|
|
|
examination!.selectedExamination!);
|
|
|
|
|
});
|
|
|
|
|
}).toList(),
|
|
|
|
|
),
|
|
|
|
|
@ -181,7 +181,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
|
|
|
|
|
.map((examination) {
|
|
|
|
|
return ExaminationItemCard(examination, () {
|
|
|
|
|
removeExamination(
|
|
|
|
|
examination.selectedExamination);
|
|
|
|
|
examination.selectedExamination!);
|
|
|
|
|
});
|
|
|
|
|
}).toList(),
|
|
|
|
|
)
|
|
|
|
|
@ -205,7 +205,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
|
|
|
|
|
submitUpdateObjectivePage(SOAPViewModel model) async {
|
|
|
|
|
if (mySelectedExamination.isNotEmpty) {
|
|
|
|
|
if(!model.isAddExamInProgress && widget.patientInfo.admissionNo != null &&
|
|
|
|
|
widget.patientInfo.admissionNo.isNotEmpty) {
|
|
|
|
|
widget.patientInfo.admissionNo!.isNotEmpty) {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
}else{
|
|
|
|
|
widget.changeLoadingState(true);
|
|
|
|
|
@ -230,8 +230,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
|
|
|
|
|
createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
|
|
|
|
|
editedBy: doctorProfile.doctorID,
|
|
|
|
|
editedOn: DateTime.now().toIso8601String(),
|
|
|
|
|
examId: exam.selectedExamination.id,
|
|
|
|
|
examType: exam.selectedExamination.typeId,
|
|
|
|
|
examId: exam.selectedExamination!.id,
|
|
|
|
|
examType: exam.selectedExamination!.typeId,
|
|
|
|
|
isAbnormal: exam.isAbnormal,
|
|
|
|
|
isNormal: exam.isNormal,
|
|
|
|
|
notExamined: exam.notExamined,
|
|
|
|
|
@ -248,13 +248,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
|
|
|
|
|
isNew: exam.isNew,
|
|
|
|
|
);
|
|
|
|
|
if (widget.patientInfo.admissionNo != null &&
|
|
|
|
|
widget.patientInfo.admissionNo.isNotEmpty) {
|
|
|
|
|
widget.patientInfo.admissionNo!.isNotEmpty) {
|
|
|
|
|
listHisProgNotePhysicalExaminationVM.admissionNo =
|
|
|
|
|
int.parse(widget.patientInfo.admissionNo);
|
|
|
|
|
int.parse(widget.patientInfo.admissionNo!);
|
|
|
|
|
} else {
|
|
|
|
|
listHisProgNotePhysicalExaminationVM.admissionNo = 0;
|
|
|
|
|
}
|
|
|
|
|
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
|
|
|
|
|
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM!
|
|
|
|
|
.add(listHisProgNotePhysicalExaminationVM);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@ -268,13 +268,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
|
|
|
|
|
widget.changeLoadingState(false);
|
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
|
if(widget.patientInfo.admissionNo != null &&
|
|
|
|
|
widget.patientInfo.admissionNo.isNotEmpty) {
|
|
|
|
|
widget.patientInfo.admissionNo!.isNotEmpty) {
|
|
|
|
|
// Navigator.of(context).pop();
|
|
|
|
|
model.isAddExamInProgress = false;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if(widget.patientInfo.admissionNo != null &&
|
|
|
|
|
widget.patientInfo.admissionNo.isNotEmpty) {
|
|
|
|
|
widget.patientInfo.admissionNo!.isNotEmpty) {
|
|
|
|
|
// Navigator.of(context).pop();
|
|
|
|
|
widget.changeLoadingState(false);
|
|
|
|
|
model.isAddExamInProgress = false;
|
|
|
|
|
@ -322,9 +322,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
|
|
|
|
|
mySelectedExaminationLocal.forEach((element) {
|
|
|
|
|
if ((mySelectedExamination.singleWhere(
|
|
|
|
|
(it) =>
|
|
|
|
|
it.selectedExamination.id ==
|
|
|
|
|
element.selectedExamination.id,
|
|
|
|
|
orElse: () => null)) ==
|
|
|
|
|
it.selectedExamination!.id ==
|
|
|
|
|
element.selectedExamination!.id)) ==
|
|
|
|
|
null) {
|
|
|
|
|
mySelectedExamination.insert(0,element);
|
|
|
|
|
}
|
|
|
|
|
@ -335,16 +334,16 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
|
|
|
|
|
mySelectedExamination.forEach((element) {
|
|
|
|
|
if ((mySelectedExaminationLocal.singleWhere(
|
|
|
|
|
(it) =>
|
|
|
|
|
it.selectedExamination.id ==
|
|
|
|
|
element.selectedExamination.id,
|
|
|
|
|
orElse: () => null)) ==
|
|
|
|
|
it.selectedExamination!.id ==
|
|
|
|
|
element.selectedExamination!.id,
|
|
|
|
|
)) ==
|
|
|
|
|
null) {
|
|
|
|
|
removedList.add(element);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
removedList.forEach((element) {
|
|
|
|
|
removeExamination(element.selectedExamination);
|
|
|
|
|
removeExamination(element.selectedExamination!);
|
|
|
|
|
});
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
}
|
|
|
|
|
|