|
|
|
|
@ -71,6 +71,38 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getPatientProgressNote(model, {bool isAddProgress = false}) async {
|
|
|
|
|
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
|
|
|
|
|
GetGetProgressNoteReqModel(
|
|
|
|
|
appointmentNo:
|
|
|
|
|
int.parse(widget.patientInfo.appointmentNo.toString()),
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
episodeID: widget.patientInfo.episodeNo.toString(),
|
|
|
|
|
editedBy: '',
|
|
|
|
|
doctorID: '');
|
|
|
|
|
await model.getPatientProgressNote(getGetProgressNoteReqModel);
|
|
|
|
|
|
|
|
|
|
if (model.patientProgressNoteList.isNotEmpty) {
|
|
|
|
|
progressNoteController.text = Helpers.parseHtmlString(
|
|
|
|
|
model.patientProgressNoteList[0].planNote);
|
|
|
|
|
patientProgressNote.planNote = progressNoteController.text;
|
|
|
|
|
patientProgressNote.createdByName =
|
|
|
|
|
model.patientProgressNoteList[0].createdByName;
|
|
|
|
|
patientProgressNote.createdOn =
|
|
|
|
|
model.patientProgressNoteList[0].createdOn;
|
|
|
|
|
patientProgressNote.editedOn =
|
|
|
|
|
model.patientProgressNoteList[0].editedOn;
|
|
|
|
|
patientProgressNote.editedByName =
|
|
|
|
|
model.patientProgressNoteList[0].editedByName;
|
|
|
|
|
patientProgressNote.appointmentNo =
|
|
|
|
|
model.patientProgressNoteList[0].appointmentNo;
|
|
|
|
|
setState(() {
|
|
|
|
|
isAddProgress = isAddProgress;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return BaseView<SOAPViewModel>(
|
|
|
|
|
@ -210,22 +242,22 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
MainAxisAlignment.end,
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
'Condition: ',
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
patientProgressNote.mName ??
|
|
|
|
|
'',
|
|
|
|
|
fontWeight: FontWeight.w600),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// 'Condition: ',
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// ),
|
|
|
|
|
// AppText(
|
|
|
|
|
// patientProgressNote.mName ??
|
|
|
|
|
// '',
|
|
|
|
|
// fontWeight: FontWeight.w600),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
AppText(
|
|
|
|
|
patientProgressNote.createdOn !=
|
|
|
|
|
null
|
|
|
|
|
@ -326,21 +358,6 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
if (progressNoteController.text.isNotEmpty) {
|
|
|
|
|
if (isAddProgress) {
|
|
|
|
|
Map profile =
|
|
|
|
|
await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
|
DoctorProfileModel doctorProfile =
|
|
|
|
|
DoctorProfileModel.fromJson(profile);
|
|
|
|
|
setState(() {
|
|
|
|
|
patientProgressNote.createdByName =
|
|
|
|
|
patientProgressNote.createdByName ??
|
|
|
|
|
doctorProfile.doctorName;
|
|
|
|
|
patientProgressNote.editedByName =
|
|
|
|
|
doctorProfile.doctorName;
|
|
|
|
|
patientProgressNote.createdOn =
|
|
|
|
|
DateTime.now().toString();
|
|
|
|
|
patientProgressNote.planNote =
|
|
|
|
|
progressNoteController.text;
|
|
|
|
|
});
|
|
|
|
|
submitPlan(model);
|
|
|
|
|
} else {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
@ -391,10 +408,35 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
Helpers.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
setState(() {
|
|
|
|
|
isAddProgress = !isAddProgress;
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
GetGetProgressNoteReqModel getGetProgressNoteReqModel =
|
|
|
|
|
GetGetProgressNoteReqModel(
|
|
|
|
|
appointmentNo:
|
|
|
|
|
int.parse(widget.patientInfo.appointmentNo.toString()),
|
|
|
|
|
patientMRN: widget.patientInfo.patientMRN,
|
|
|
|
|
episodeID: widget.patientInfo.episodeNo.toString(),
|
|
|
|
|
editedBy: '',
|
|
|
|
|
doctorID: '');
|
|
|
|
|
await model.getPatientProgressNote(getGetProgressNoteReqModel);
|
|
|
|
|
if (model.patientProgressNoteList.isNotEmpty) {
|
|
|
|
|
progressNoteController.text = Helpers.parseHtmlString(
|
|
|
|
|
model.patientProgressNoteList[0].planNote);
|
|
|
|
|
patientProgressNote.planNote = progressNoteController.text;
|
|
|
|
|
patientProgressNote.createdByName =
|
|
|
|
|
model.patientProgressNoteList[0].createdByName;
|
|
|
|
|
patientProgressNote.createdOn =
|
|
|
|
|
model.patientProgressNoteList[0].createdOn;
|
|
|
|
|
patientProgressNote.editedOn =
|
|
|
|
|
model.patientProgressNoteList[0].editedOn;
|
|
|
|
|
patientProgressNote.editedByName =
|
|
|
|
|
model.patientProgressNoteList[0].editedByName;
|
|
|
|
|
patientProgressNote.appointmentNo =
|
|
|
|
|
model.patientProgressNoteList[0].appointmentNo;
|
|
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
isAddProgress = false;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
widget.changeLoadingState(false);
|
|
|
|
|
} else {
|
|
|
|
|
|