|
|
|
@ -44,7 +44,8 @@ class UpdateObjectivePage extends StatefulWidget {
|
|
|
|
|
_UpdateObjectivePageState createState() => _UpdateObjectivePageState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements ObjectiveCallBack {
|
|
|
|
|
class _UpdateObjectivePageState extends State<UpdateObjectivePage>
|
|
|
|
|
implements ObjectiveCallBack {
|
|
|
|
|
bool isSysExaminationExpand = false;
|
|
|
|
|
List<MySelectedExamination> mySelectedExamination = List();
|
|
|
|
|
|
|
|
|
@ -67,13 +68,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
|
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
model.setObjectiveCallBack(this);
|
|
|
|
|
mySelectedExamination.clear();
|
|
|
|
|
GetPhysicalExamReqModel getPhysicalExamReqModel =
|
|
|
|
|
GetPhysicalExamReqModel(
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
episodeID: widget.patientInfo.episodeNo.toString(),
|
|
|
|
|
appointmentNo:
|
|
|
|
|
int.parse(widget.patientInfo.appointmentNo.toString()));
|
|
|
|
|
await model.getPatientPhysicalExam(getPhysicalExamReqModel);
|
|
|
|
|
|
|
|
|
|
await model.getPatientPhysicalExam(widget.patientInfo);
|
|
|
|
|
if (model.patientPhysicalExamList.isNotEmpty) {
|
|
|
|
|
if (model.physicalExaminationList.length == 0) {
|
|
|
|
|
await model.getMasterLookup(MasterKeysService.PhysicalExamination);
|
|
|
|
@ -102,109 +98,108 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
|
|
|
|
|
widget.changeLoadingState(false);
|
|
|
|
|
},
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
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,
|
|
|
|
|
changePageViewIndex: widget.changePageViewIndex),
|
|
|
|
|
ExpandableSOAPWidget(
|
|
|
|
|
headerTitle:
|
|
|
|
|
TranslationBase.of(context).physicalSystemExamination,
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isSysExaminationExpand = !isSysExaminationExpand;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
SOAPOpenItems(
|
|
|
|
|
label:
|
|
|
|
|
"${TranslationBase.of(context).addExamination}",
|
|
|
|
|
onTap: () {
|
|
|
|
|
openExaminationList(context);
|
|
|
|
|
},
|
|
|
|
|
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,
|
|
|
|
|
changePageViewIndex: widget.changePageViewIndex),
|
|
|
|
|
ExpandableSOAPWidget(
|
|
|
|
|
headerTitle:
|
|
|
|
|
TranslationBase.of(context).physicalSystemExamination,
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
isSysExaminationExpand = !isSysExaminationExpand;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
SOAPOpenItems(
|
|
|
|
|
label:
|
|
|
|
|
"${TranslationBase.of(context).addExamination}",
|
|
|
|
|
onTap: () {
|
|
|
|
|
openExaminationList(context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
if (mySelectedExamination.isNotEmpty &&
|
|
|
|
|
mySelectedExamination.first.isLocal)
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
"New",
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
color: Color(0xFFCC9B14),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
if (mySelectedExamination.isNotEmpty &&
|
|
|
|
|
mySelectedExamination.first.isLocal)
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
"New",
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
color: Color(0xFFCC9B14),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: mySelectedExamination
|
|
|
|
|
.sublist(
|
|
|
|
|
0,
|
|
|
|
|
model.getFirstIndexForOldExamination(
|
|
|
|
|
mySelectedExamination) ==
|
|
|
|
|
-1
|
|
|
|
|
? 0
|
|
|
|
|
: model.getFirstIndexForOldExamination(
|
|
|
|
|
mySelectedExamination))
|
|
|
|
|
.map((examination) {
|
|
|
|
|
return ExaminationItemCard(examination, () {
|
|
|
|
|
removeExamination(
|
|
|
|
|
examination.selectedExamination);
|
|
|
|
|
});
|
|
|
|
|
}).toList(),
|
|
|
|
|
Column(
|
|
|
|
|
children: mySelectedExamination
|
|
|
|
|
.sublist(
|
|
|
|
|
0,
|
|
|
|
|
model.getFirstIndexForOldExamination(
|
|
|
|
|
mySelectedExamination) ==
|
|
|
|
|
-1
|
|
|
|
|
? 0
|
|
|
|
|
: model.getFirstIndexForOldExamination(
|
|
|
|
|
mySelectedExamination))
|
|
|
|
|
.map((examination) {
|
|
|
|
|
return ExaminationItemCard(examination, () {
|
|
|
|
|
removeExamination(
|
|
|
|
|
examination.selectedExamination);
|
|
|
|
|
});
|
|
|
|
|
}).toList(),
|
|
|
|
|
),
|
|
|
|
|
if (mySelectedExamination.isNotEmpty &&
|
|
|
|
|
model.getFirstIndexForOldExamination(
|
|
|
|
|
mySelectedExamination) >
|
|
|
|
|
-1)
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
"Verified",
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
if (mySelectedExamination.isNotEmpty &&
|
|
|
|
|
model.getFirstIndexForOldExamination(
|
|
|
|
|
mySelectedExamination) >
|
|
|
|
|
-1)
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
"Verified",
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: mySelectedExamination
|
|
|
|
|
.sublist(model.getFirstIndexForOldExamination(
|
|
|
|
|
mySelectedExamination) ==
|
|
|
|
|
-1
|
|
|
|
|
? 0
|
|
|
|
|
: model.getFirstIndexForOldExamination(
|
|
|
|
|
mySelectedExamination))
|
|
|
|
|
.map((examination) {
|
|
|
|
|
return ExaminationItemCard(examination, () {
|
|
|
|
|
removeExamination(
|
|
|
|
|
examination.selectedExamination);
|
|
|
|
|
});
|
|
|
|
|
}).toList(),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
isExpanded: isSysExaminationExpand,
|
|
|
|
|
Column(
|
|
|
|
|
children: mySelectedExamination
|
|
|
|
|
.sublist(model.getFirstIndexForOldExamination(
|
|
|
|
|
mySelectedExamination) ==
|
|
|
|
|
-1
|
|
|
|
|
? 0
|
|
|
|
|
: model.getFirstIndexForOldExamination(
|
|
|
|
|
mySelectedExamination))
|
|
|
|
|
.map((examination) {
|
|
|
|
|
return ExaminationItemCard(examination, () {
|
|
|
|
|
removeExamination(
|
|
|
|
|
examination.selectedExamination);
|
|
|
|
|
});
|
|
|
|
|
}).toList(),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: SizeConfig.heightMultiplier *
|
|
|
|
|
(SizeConfig.isHeightVeryShort ? 14 : 12),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
isExpanded: isSysExaminationExpand,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: SizeConfig.heightMultiplier *
|
|
|
|
|
(SizeConfig.isHeightVeryShort ? 14 : 12),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
@ -213,6 +208,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
|
|
|
|
|
// TODO Elham*
|
|
|
|
|
widget.changePageViewIndex(2);
|
|
|
|
|
|
|
|
|
|
/// TODO Elham* move this logic to view model
|
|
|
|
|
// if (mySelectedExamination.isNotEmpty) {
|
|
|
|
|
// widget.changeLoadingState(true);
|
|
|
|
|
// Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
@ -225,33 +221,41 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
|
|
|
|
|
// 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(
|
|
|
|
|
// 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));
|
|
|
|
|
// .add(listHisProgNotePhysicalExaminationVM);
|
|
|
|
|
// });
|
|
|
|
|
//
|
|
|
|
|
// if (model.patientPhysicalExamList.isEmpty) {
|
|
|
|
@ -297,15 +301,16 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
|
|
|
|
|
FadePage(
|
|
|
|
|
page: AddExaminationPage(
|
|
|
|
|
mySelectedExamination: mySelectedExamination,
|
|
|
|
|
addSelectedExamination: (List<MySelectedExamination> mySelectedExaminationLocal ) {
|
|
|
|
|
addSelectedExamination:
|
|
|
|
|
(List<MySelectedExamination> mySelectedExaminationLocal) {
|
|
|
|
|
setState(() {
|
|
|
|
|
{
|
|
|
|
|
mySelectedExaminationLocal.forEach((element) {
|
|
|
|
|
{
|
|
|
|
|
mySelectedExaminationLocal.forEach((element) {
|
|
|
|
|
if ((mySelectedExamination.singleWhere(
|
|
|
|
|
(it) =>
|
|
|
|
|
it.selectedExamination.id ==
|
|
|
|
|
element.selectedExamination.id,
|
|
|
|
|
orElse: () => null)) ==
|
|
|
|
|
it.selectedExamination.id ==
|
|
|
|
|
element.selectedExamination.id,
|
|
|
|
|
orElse: () => null)) ==
|
|
|
|
|
null) {
|
|
|
|
|
mySelectedExamination.add(element);
|
|
|
|
|
}
|
|
|
|
@ -313,12 +318,12 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
|
|
|
|
|
|
|
|
|
|
/// remove items.
|
|
|
|
|
List<MySelectedExamination> removedList = [];
|
|
|
|
|
mySelectedExamination.forEach((element) {
|
|
|
|
|
mySelectedExamination.forEach((element) {
|
|
|
|
|
if ((mySelectedExaminationLocal.singleWhere(
|
|
|
|
|
(it) =>
|
|
|
|
|
it.selectedExamination.id ==
|
|
|
|
|
element.selectedExamination.id,
|
|
|
|
|
orElse: () => null)) ==
|
|
|
|
|
it.selectedExamination.id ==
|
|
|
|
|
element.selectedExamination.id,
|
|
|
|
|
orElse: () => null)) ==
|
|
|
|
|
null) {
|
|
|
|
|
removedList.add(element);
|
|
|
|
|
}
|
|
|
|
@ -337,7 +342,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
nextFunction(model) async {
|
|
|
|
|
nextFunction(model) async {
|
|
|
|
|
await submitUpdateObjectivePage(model);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|