|
|
|
@ -28,6 +28,8 @@ class UpdatePlanPage extends StatefulWidget {
|
|
|
|
final Function changePageViewIndex;
|
|
|
|
final Function changePageViewIndex;
|
|
|
|
final PatiantInformtion patientInfo;
|
|
|
|
final PatiantInformtion patientInfo;
|
|
|
|
final Function changeLoadingState;
|
|
|
|
final Function changeLoadingState;
|
|
|
|
|
|
|
|
final Function changeStateFun;
|
|
|
|
|
|
|
|
final SOAPViewModel sOAPViewModel;
|
|
|
|
|
|
|
|
|
|
|
|
final int currentIndex;
|
|
|
|
final int currentIndex;
|
|
|
|
|
|
|
|
|
|
|
|
@ -36,7 +38,7 @@ class UpdatePlanPage extends StatefulWidget {
|
|
|
|
this.changePageViewIndex,
|
|
|
|
this.changePageViewIndex,
|
|
|
|
this.patientInfo,
|
|
|
|
this.patientInfo,
|
|
|
|
this.changeLoadingState,
|
|
|
|
this.changeLoadingState,
|
|
|
|
this.currentIndex});
|
|
|
|
this.currentIndex, this.sOAPViewModel, this.changeStateFun});
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_UpdatePlanPageState createState() => _UpdatePlanPageState();
|
|
|
|
_UpdatePlanPageState createState() => _UpdatePlanPageState();
|
|
|
|
@ -84,26 +86,27 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
|
|
|
|
episodeID: widget.patientInfo.episodeNo.toString(),
|
|
|
|
episodeID: widget.patientInfo.episodeNo.toString(),
|
|
|
|
editedBy: '',
|
|
|
|
editedBy: '',
|
|
|
|
doctorID: '');
|
|
|
|
doctorID: '');
|
|
|
|
await model.getPatientProgressNote(getGetProgressNoteReqModel);
|
|
|
|
await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel);
|
|
|
|
///TODO set progressNote in model;
|
|
|
|
///TODO set progressNote in model;
|
|
|
|
if (model.patientProgressNoteList.isNotEmpty) {
|
|
|
|
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
|
|
|
|
progressNoteController.text = Helpers.parseHtmlString(
|
|
|
|
progressNoteController.text = Helpers.parseHtmlString(
|
|
|
|
model.patientProgressNoteList[0].planNote);
|
|
|
|
widget.sOAPViewModel.patientProgressNoteList[0].planNote);
|
|
|
|
patientProgressNote.planNote = progressNoteController.text;
|
|
|
|
patientProgressNote.planNote = progressNoteController.text;
|
|
|
|
|
|
|
|
|
|
|
|
patientProgressNote.createdByName =
|
|
|
|
patientProgressNote.createdByName =
|
|
|
|
model.patientProgressNoteList[0].createdByName;
|
|
|
|
widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
|
|
|
|
patientProgressNote.createdOn =
|
|
|
|
patientProgressNote.createdOn =
|
|
|
|
model.patientProgressNoteList[0].createdOn;
|
|
|
|
widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
|
|
|
|
patientProgressNote.editedOn =
|
|
|
|
patientProgressNote.editedOn =
|
|
|
|
model.patientProgressNoteList[0].editedOn;
|
|
|
|
widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
|
|
|
|
patientProgressNote.editedByName =
|
|
|
|
patientProgressNote.editedByName =
|
|
|
|
model.patientProgressNoteList[0].editedByName;
|
|
|
|
widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
|
|
|
|
patientProgressNote.appointmentNo =
|
|
|
|
patientProgressNote.appointmentNo =
|
|
|
|
model.patientProgressNoteList[0].appointmentNo;
|
|
|
|
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
isAddProgress = isAddProgress;
|
|
|
|
isAddProgress = isAddProgress;
|
|
|
|
model.isAddProgress = isAddProgress;
|
|
|
|
widget.sOAPViewModel.isAddProgress = isAddProgress;
|
|
|
|
|
|
|
|
widget.sOAPViewModel.progressNoteText = progressNoteController.text;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -112,7 +115,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return BaseView<SOAPViewModel>(
|
|
|
|
return BaseView<SOAPViewModel>(
|
|
|
|
onModelReady: (model) async {
|
|
|
|
onModelReady: (model) async {
|
|
|
|
model.setPlanCallBack(this);
|
|
|
|
widget.sOAPViewModel.setPlanCallBack(this);
|
|
|
|
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
|
|
|
|
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
|
|
|
|
GetGetProgressNoteReqModel(
|
|
|
|
GetGetProgressNoteReqModel(
|
|
|
|
appointmentNo:
|
|
|
|
appointmentNo:
|
|
|
|
@ -121,26 +124,27 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
|
|
|
|
episodeID: widget.patientInfo.episodeNo.toString(),
|
|
|
|
episodeID: widget.patientInfo.episodeNo.toString(),
|
|
|
|
editedBy: '',
|
|
|
|
editedBy: '',
|
|
|
|
doctorID: '');
|
|
|
|
doctorID: '');
|
|
|
|
await model.getPatientProgressNote(getGetProgressNoteReqModel);
|
|
|
|
await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel);
|
|
|
|
|
|
|
|
|
|
|
|
if (model.patientProgressNoteList.isNotEmpty) {
|
|
|
|
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
|
|
|
|
progressNoteController.text = Helpers.parseHtmlString(
|
|
|
|
progressNoteController.text = Helpers.parseHtmlString(
|
|
|
|
model.patientProgressNoteList[0].planNote);
|
|
|
|
widget.sOAPViewModel.patientProgressNoteList[0].planNote);
|
|
|
|
patientProgressNote.planNote = progressNoteController.text;
|
|
|
|
patientProgressNote.planNote = progressNoteController.text;
|
|
|
|
patientProgressNote.createdByName =
|
|
|
|
patientProgressNote.createdByName =
|
|
|
|
model.patientProgressNoteList[0].createdByName;
|
|
|
|
widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
|
|
|
|
patientProgressNote.createdOn =
|
|
|
|
patientProgressNote.createdOn =
|
|
|
|
model.patientProgressNoteList[0].createdOn;
|
|
|
|
widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
|
|
|
|
patientProgressNote.editedOn =
|
|
|
|
patientProgressNote.editedOn =
|
|
|
|
model.patientProgressNoteList[0].editedOn;
|
|
|
|
widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
|
|
|
|
patientProgressNote.editedByName =
|
|
|
|
patientProgressNote.editedByName =
|
|
|
|
model.patientProgressNoteList[0].editedByName;
|
|
|
|
widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
|
|
|
|
patientProgressNote.appointmentNo =
|
|
|
|
patientProgressNote.appointmentNo =
|
|
|
|
model.patientProgressNoteList[0].appointmentNo;
|
|
|
|
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
|
|
|
|
|
|
|
|
widget.sOAPViewModel.progressNoteText = progressNoteController.text;
|
|
|
|
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
isAddProgress = false;
|
|
|
|
isAddProgress = false;
|
|
|
|
model.isAddProgress = false;
|
|
|
|
widget.sOAPViewModel.isAddProgress = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
widget.changeLoadingState(false);
|
|
|
|
widget.changeLoadingState(false);
|
|
|
|
@ -188,6 +192,8 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
|
|
|
|
onChanged: (value) {
|
|
|
|
onChanged: (value) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
patientProgressNote.planNote = value;
|
|
|
|
patientProgressNote.planNote = value;
|
|
|
|
|
|
|
|
model.progressNoteText = value;
|
|
|
|
|
|
|
|
widget.changeStateFun();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -301,6 +307,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
isAddProgress = true;
|
|
|
|
isAddProgress = true;
|
|
|
|
|
|
|
|
widget.sOAPViewModel.isAddProgress = true;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Icon(
|
|
|
|
child: Icon(
|
|
|
|
@ -342,17 +349,17 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
|
|
|
|
doctorID: '',
|
|
|
|
doctorID: '',
|
|
|
|
editedBy: '');
|
|
|
|
editedBy: '');
|
|
|
|
|
|
|
|
|
|
|
|
if (model.patientProgressNoteList.isEmpty) {
|
|
|
|
if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) {
|
|
|
|
await model.postProgressNote(postProgressNoteRequestModel);
|
|
|
|
await widget.sOAPViewModel.postProgressNote(postProgressNoteRequestModel);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
|
|
|
|
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
|
|
|
|
postProgressNoteRequestModel.editedBy = doctorProfile.doctorID;
|
|
|
|
postProgressNoteRequestModel.editedBy = doctorProfile.doctorID;
|
|
|
|
await model.patchProgressNote(postProgressNoteRequestModel);
|
|
|
|
await widget.sOAPViewModel.patchProgressNote(postProgressNoteRequestModel);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
if (widget.sOAPViewModel.state == ViewState.ErrorLocal) {
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
Helpers.showErrorToast(widget.sOAPViewModel.error);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
|
|
|
|
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
|
|
|
|
@ -363,25 +370,25 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> implements PlanCallBack
|
|
|
|
episodeID: widget.patientInfo.episodeNo.toString(),
|
|
|
|
episodeID: widget.patientInfo.episodeNo.toString(),
|
|
|
|
editedBy: '',
|
|
|
|
editedBy: '',
|
|
|
|
doctorID: '');
|
|
|
|
doctorID: '');
|
|
|
|
await model.getPatientProgressNote(getGetProgressNoteReqModel);
|
|
|
|
await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel);
|
|
|
|
if (model.patientProgressNoteList.isNotEmpty) {
|
|
|
|
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
|
|
|
|
progressNoteController.text = Helpers.parseHtmlString(
|
|
|
|
progressNoteController.text = Helpers.parseHtmlString(
|
|
|
|
model.patientProgressNoteList[0].planNote);
|
|
|
|
widget.sOAPViewModel.patientProgressNoteList[0].planNote);
|
|
|
|
patientProgressNote.planNote = progressNoteController.text;
|
|
|
|
patientProgressNote.planNote = progressNoteController.text;
|
|
|
|
patientProgressNote.createdByName =
|
|
|
|
patientProgressNote.createdByName =
|
|
|
|
model.patientProgressNoteList[0].createdByName;
|
|
|
|
widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
|
|
|
|
patientProgressNote.createdOn =
|
|
|
|
patientProgressNote.createdOn =
|
|
|
|
model.patientProgressNoteList[0].createdOn;
|
|
|
|
widget.sOAPViewModel.patientProgressNoteList[0].createdOn;
|
|
|
|
patientProgressNote.editedOn =
|
|
|
|
patientProgressNote.editedOn =
|
|
|
|
model.patientProgressNoteList[0].editedOn;
|
|
|
|
widget.sOAPViewModel.patientProgressNoteList[0].editedOn;
|
|
|
|
patientProgressNote.editedByName =
|
|
|
|
patientProgressNote.editedByName =
|
|
|
|
model.patientProgressNoteList[0].editedByName;
|
|
|
|
widget.sOAPViewModel.patientProgressNoteList[0].editedByName;
|
|
|
|
patientProgressNote.appointmentNo =
|
|
|
|
patientProgressNote.appointmentNo =
|
|
|
|
model.patientProgressNoteList[0].appointmentNo;
|
|
|
|
widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo;
|
|
|
|
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
isAddProgress = false;
|
|
|
|
isAddProgress = false;
|
|
|
|
model.isAddProgress = false;
|
|
|
|
widget.sOAPViewModel.isAddProgress = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|