|
|
@ -28,13 +28,11 @@ class UpdateObjectivePage extends StatefulWidget {
|
|
|
|
final Function changePageViewIndex;
|
|
|
|
final Function changePageViewIndex;
|
|
|
|
final Function changeLoadingState;
|
|
|
|
final Function changeLoadingState;
|
|
|
|
final int currentIndex;
|
|
|
|
final int currentIndex;
|
|
|
|
final List<MySelectedExamination> mySelectedExamination;
|
|
|
|
|
|
|
|
final PatiantInformtion patientInfo;
|
|
|
|
final PatiantInformtion patientInfo;
|
|
|
|
|
|
|
|
|
|
|
|
UpdateObjectivePage(
|
|
|
|
UpdateObjectivePage(
|
|
|
|
{Key key,
|
|
|
|
{Key key,
|
|
|
|
this.changePageViewIndex,
|
|
|
|
this.changePageViewIndex,
|
|
|
|
this.mySelectedExamination,
|
|
|
|
|
|
|
|
this.patientInfo,
|
|
|
|
this.patientInfo,
|
|
|
|
this.changeLoadingState,
|
|
|
|
this.changeLoadingState,
|
|
|
|
this.currentIndex});
|
|
|
|
this.currentIndex});
|
|
|
@ -45,8 +43,10 @@ class UpdateObjectivePage extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
|
|
class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
|
|
|
|
class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
|
|
|
|
bool isSysExaminationExpand = false;
|
|
|
|
bool isSysExaminationExpand = false;
|
|
|
|
|
|
|
|
List<MySelectedExamination> mySelectedExamination = List();
|
|
|
|
|
|
|
|
|
|
|
|
BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) {
|
|
|
|
BoxDecoration containerBorderDecoration(
|
|
|
|
|
|
|
|
Color containerColor, Color borderColor) {
|
|
|
|
return BoxDecoration(
|
|
|
|
return BoxDecoration(
|
|
|
|
color: containerColor,
|
|
|
|
color: containerColor,
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
@ -62,11 +62,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return BaseView<SOAPViewModel>(
|
|
|
|
return BaseView<SOAPViewModel>(
|
|
|
|
onModelReady: (model) async {
|
|
|
|
onModelReady: (model) async {
|
|
|
|
widget.mySelectedExamination.clear();
|
|
|
|
mySelectedExamination.clear();
|
|
|
|
GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel(
|
|
|
|
GetPhysicalExamReqModel getPhysicalExamReqModel =
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
GetPhysicalExamReqModel(
|
|
|
|
episodeID: widget.patientInfo.episodeNo.toString(),
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()));
|
|
|
|
episodeID: widget.patientInfo.episodeNo.toString(),
|
|
|
|
|
|
|
|
appointmentNo:
|
|
|
|
|
|
|
|
int.parse(widget.patientInfo.appointmentNo.toString()));
|
|
|
|
|
|
|
|
|
|
|
|
await model.getPatientPhysicalExam(getPhysicalExamReqModel);
|
|
|
|
await model.getPatientPhysicalExam(getPhysicalExamReqModel);
|
|
|
|
if (model.patientPhysicalExamList.isNotEmpty) {
|
|
|
|
if (model.patientPhysicalExamList.isNotEmpty) {
|
|
|
@ -79,16 +81,18 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
|
|
|
|
id: element.examId,
|
|
|
|
id: element.examId,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
MySelectedExamination tempEam = MySelectedExamination(
|
|
|
|
MySelectedExamination tempEam = MySelectedExamination(
|
|
|
|
selectedExamination: examMaster,
|
|
|
|
selectedExamination: examMaster,
|
|
|
|
remark: element.remarks,
|
|
|
|
remark: element.remarks,
|
|
|
|
isNormal: element.isNormal,
|
|
|
|
isNormal: element.isNormal,
|
|
|
|
createdBy: element.createdBy,
|
|
|
|
createdBy: element.createdBy,
|
|
|
|
createdOn:element.createdOn ,
|
|
|
|
createdOn: element.createdOn,
|
|
|
|
editedOn: element.editedOn,
|
|
|
|
editedOn: element.editedOn,
|
|
|
|
notExamined: element.notExamined,
|
|
|
|
notExamined: element.notExamined,
|
|
|
|
isNew: element.isNew,
|
|
|
|
isNew: element.isNew,
|
|
|
|
isAbnormal: element.isAbnormal,);
|
|
|
|
isLocal: false,
|
|
|
|
widget.mySelectedExamination.add(tempEam);
|
|
|
|
isAbnormal: element.isAbnormal,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
mySelectedExamination.add(tempEam);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -104,9 +108,12 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SOAPStepHeader(currentIndex: widget.currentIndex, changePageViewIndex: widget.changePageViewIndex),
|
|
|
|
SOAPStepHeader(
|
|
|
|
|
|
|
|
currentIndex: widget.currentIndex,
|
|
|
|
|
|
|
|
changePageViewIndex: widget.changePageViewIndex),
|
|
|
|
ExpandableSOAPWidget(
|
|
|
|
ExpandableSOAPWidget(
|
|
|
|
headerTitle: TranslationBase.of(context).physicalSystemExamination,
|
|
|
|
headerTitle:
|
|
|
|
|
|
|
|
TranslationBase.of(context).physicalSystemExamination,
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
isSysExaminationExpand = !isSysExaminationExpand;
|
|
|
|
isSysExaminationExpand = !isSysExaminationExpand;
|
|
|
@ -115,15 +122,17 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SOAPOpenItems(
|
|
|
|
SOAPOpenItems(
|
|
|
|
label: "${TranslationBase.of(context).addExamination}",
|
|
|
|
label:
|
|
|
|
|
|
|
|
"${TranslationBase.of(context).addExamination}",
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
openExaminationList(context);
|
|
|
|
openExaminationList(context);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
children: widget.mySelectedExamination.map((examination) {
|
|
|
|
children: mySelectedExamination.map((examination) {
|
|
|
|
return ExaminationItemCard(examination, () {
|
|
|
|
return ExaminationItemCard(examination, () {
|
|
|
|
removeExamination(examination.selectedExamination);
|
|
|
|
removeExamination(
|
|
|
|
|
|
|
|
examination.selectedExamination);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}).toList(),
|
|
|
|
}).toList(),
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -200,41 +209,45 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
submitUpdateObjectivePage(SOAPViewModel model) async {
|
|
|
|
submitUpdateObjectivePage(SOAPViewModel model) async {
|
|
|
|
if (widget.mySelectedExamination.isNotEmpty) {
|
|
|
|
if (mySelectedExamination.isNotEmpty) {
|
|
|
|
|
|
|
|
widget.changeLoadingState(true);
|
|
|
|
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
|
|
|
|
|
|
|
|
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
|
|
|
|
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
|
|
|
|
PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel();
|
|
|
|
PostPhysicalExamRequestModel postPhysicalExamRequestModel =
|
|
|
|
widget.mySelectedExamination.forEach((exam) {
|
|
|
|
new PostPhysicalExamRequestModel();
|
|
|
|
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == null)
|
|
|
|
mySelectedExamination.forEach((exam) {
|
|
|
|
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = [];
|
|
|
|
if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM ==
|
|
|
|
|
|
|
|
null)
|
|
|
|
|
|
|
|
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM =
|
|
|
|
|
|
|
|
[];
|
|
|
|
|
|
|
|
|
|
|
|
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(ListHisProgNotePhysicalExaminationVM(
|
|
|
|
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
.add(ListHisProgNotePhysicalExaminationVM(
|
|
|
|
episodeId: widget.patientInfo.episodeNo,
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
appointmentNo: widget.patientInfo.appointmentNo,
|
|
|
|
episodeId: widget.patientInfo.episodeNo,
|
|
|
|
remarks: exam.remark ?? '',
|
|
|
|
appointmentNo: widget.patientInfo.appointmentNo,
|
|
|
|
createdBy: exam.createdBy ?? doctorProfile.doctorID,
|
|
|
|
remarks: exam.remark ?? '',
|
|
|
|
createdOn: exam.createdOn??
|
|
|
|
createdBy: exam.createdBy ?? doctorProfile.doctorID,
|
|
|
|
DateTime.now().toIso8601String(),
|
|
|
|
createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
|
|
|
|
editedBy: doctorProfile.doctorID,
|
|
|
|
editedBy: doctorProfile.doctorID,
|
|
|
|
editedOn: DateTime.now().toIso8601String(),
|
|
|
|
editedOn: DateTime.now().toIso8601String(),
|
|
|
|
examId: exam.selectedExamination.id,
|
|
|
|
examId: exam.selectedExamination.id,
|
|
|
|
examType: exam.selectedExamination.typeId,
|
|
|
|
examType: exam.selectedExamination.typeId,
|
|
|
|
isAbnormal: exam.isAbnormal,
|
|
|
|
isAbnormal: exam.isAbnormal,
|
|
|
|
isNormal: exam.isNormal,
|
|
|
|
isNormal: exam.isNormal,
|
|
|
|
notExamined: exam.notExamined,
|
|
|
|
notExamined: exam.notExamined,
|
|
|
|
examinationType: exam.isNormal
|
|
|
|
examinationType: exam.isNormal
|
|
|
|
? 1
|
|
|
|
? 1
|
|
|
|
: exam.isAbnormal
|
|
|
|
: exam.isAbnormal
|
|
|
|
? 2
|
|
|
|
? 2
|
|
|
|
: 3,
|
|
|
|
: 3,
|
|
|
|
examinationTypeName: exam.isNormal
|
|
|
|
examinationTypeName: exam.isNormal
|
|
|
|
? "Normal"
|
|
|
|
? "Normal"
|
|
|
|
: exam.isAbnormal
|
|
|
|
: exam.isAbnormal
|
|
|
|
? 'AbNormal'
|
|
|
|
? 'AbNormal'
|
|
|
|
: "Not Examined",
|
|
|
|
: "Not Examined",
|
|
|
|
isNew: exam.isNew));
|
|
|
|
isNew: exam.isNew));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
if (model.patientPhysicalExamList.isEmpty) {
|
|
|
|
if (model.patientPhysicalExamList.isEmpty) {
|
|
|
@ -244,11 +257,14 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
|
|
|
widget.changeLoadingState(false);
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
widget.changeLoadingState(true);
|
|
|
|
widget.changeLoadingState(false);
|
|
|
|
|
|
|
|
// TODO Elham* return this
|
|
|
|
|
|
|
|
// widget.changeLoadingState(true);
|
|
|
|
|
|
|
|
|
|
|
|
widget.changePageViewIndex(2);
|
|
|
|
//widget.changePageViewIndex(2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg);
|
|
|
|
Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg);
|
|
|
@ -256,12 +272,14 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
removeExamination(MasterKeyModel masterKey) {
|
|
|
|
removeExamination(MasterKeyModel masterKey) {
|
|
|
|
Iterable<MySelectedExamination> history = widget.mySelectedExamination.where((element) =>
|
|
|
|
Iterable<MySelectedExamination> history = mySelectedExamination.where(
|
|
|
|
masterKey.id == element.selectedExamination.id && masterKey.typeId == element.selectedExamination.typeId);
|
|
|
|
(element) =>
|
|
|
|
|
|
|
|
masterKey.id == element.selectedExamination.id &&
|
|
|
|
|
|
|
|
masterKey.typeId == element.selectedExamination.typeId);
|
|
|
|
|
|
|
|
|
|
|
|
if (history.length > 0)
|
|
|
|
if (history.length > 0)
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
widget.mySelectedExamination.remove(history.first);
|
|
|
|
mySelectedExamination.remove(history.first);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -270,7 +288,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
FadePage(
|
|
|
|
FadePage(
|
|
|
|
page: AddExaminationPage(
|
|
|
|
page: AddExaminationPage(
|
|
|
|
mySelectedExamination: widget.mySelectedExamination,
|
|
|
|
mySelectedExamination: mySelectedExamination,
|
|
|
|
addSelectedExamination: () {
|
|
|
|
addSelectedExamination: () {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
Navigator.of(context).pop();
|
|
|
@ -287,7 +305,11 @@ class AddExaminationDailog extends StatefulWidget {
|
|
|
|
final Function addSelectedExamination;
|
|
|
|
final Function addSelectedExamination;
|
|
|
|
final Function(MasterKeyModel) removeExamination;
|
|
|
|
final Function(MasterKeyModel) removeExamination;
|
|
|
|
|
|
|
|
|
|
|
|
const AddExaminationDailog({Key key, this.mySelectedExamination, this.addSelectedExamination, this.removeExamination})
|
|
|
|
const AddExaminationDailog(
|
|
|
|
|
|
|
|
{Key key,
|
|
|
|
|
|
|
|
this.mySelectedExamination,
|
|
|
|
|
|
|
|
this.addSelectedExamination,
|
|
|
|
|
|
|
|
this.removeExamination})
|
|
|
|
: super(key: key);
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
@ -302,7 +324,8 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
|
|
|
|
child: BaseView<SOAPViewModel>(
|
|
|
|
child: BaseView<SOAPViewModel>(
|
|
|
|
onModelReady: (model) async {
|
|
|
|
onModelReady: (model) async {
|
|
|
|
if (model.physicalExaminationList.length == 0) {
|
|
|
|
if (model.physicalExaminationList.length == 0) {
|
|
|
|
await model.getMasterLookup(MasterKeysService.PhysicalExamination);
|
|
|
|
await model
|
|
|
|
|
|
|
|
.getMasterLookup(MasterKeysService.PhysicalExamination);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
@ -312,19 +335,21 @@ class _AddExaminationDailogState extends State<AddExaminationDailog> {
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
widthFactor: 0.9,
|
|
|
|
widthFactor: 0.9,
|
|
|
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
|
|
|
child: Column(
|
|
|
|
SizedBox(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
height: 16,
|
|
|
|
children: [
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
AppText(
|
|
|
|
height: 16,
|
|
|
|
TranslationBase.of(context).physicalSystemExamination,
|
|
|
|
),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
AppText(
|
|
|
|
fontSize: 16,
|
|
|
|
TranslationBase.of(context).physicalSystemExamination,
|
|
|
|
),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
SizedBox(
|
|
|
|
fontSize: 16,
|
|
|
|
height: 16,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(
|
|
|
|
]),
|
|
|
|
height: 16,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
]),
|
|
|
|
))),
|
|
|
|
))),
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
);
|
|
|
|
);
|
|
|
|