|
|
|
@ -36,10 +36,10 @@ class UpdateNoteOrder extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
|
|
class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
int selectedType;
|
|
|
|
int selectedType;
|
|
|
|
|
|
|
|
bool isSubmitted = false;
|
|
|
|
|
|
|
|
|
|
|
|
TextEditingController progressNoteController = TextEditingController();
|
|
|
|
TextEditingController progressNoteController = TextEditingController();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setSelectedType(int val) {
|
|
|
|
setSelectedType(int val) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
selectedType = val;
|
|
|
|
selectedType = val;
|
|
|
|
@ -51,9 +51,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
if (widget.note != null) {
|
|
|
|
if (widget.note != null) {
|
|
|
|
progressNoteController.text = widget.note.notes;
|
|
|
|
progressNoteController.text = widget.note.notes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return BaseView<PatientViewModel>(
|
|
|
|
|
|
|
|
builder: (BuildContext context, PatientViewModel model, Widget child) =>
|
|
|
|
return AppScaffold(
|
|
|
|
AppScaffold(
|
|
|
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
isShowAppBar: false,
|
|
|
|
backgroundColor: Theme
|
|
|
|
backgroundColor: Theme
|
|
|
|
.of(context)
|
|
|
|
.of(context)
|
|
|
|
@ -69,7 +68,9 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
BottomSheetTitle(title: 'Add Progress Note',),
|
|
|
|
BottomSheetTitle(title: widget.visitType == 3
|
|
|
|
|
|
|
|
? 'Add Order Sheet'
|
|
|
|
|
|
|
|
: 'Add Progress Note',),
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 10.0,
|
|
|
|
height: 10.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -80,12 +81,15 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
AppTextFieldCustom(
|
|
|
|
AppTextFieldCustom(
|
|
|
|
hintText: TranslationBase.of(context).addProgressNote,
|
|
|
|
hintText: widget.visitType == 3
|
|
|
|
|
|
|
|
? 'Add Order Sheet'
|
|
|
|
|
|
|
|
: 'Add Progress Note',
|
|
|
|
|
|
|
|
//TranslationBase.of(context).addProgressNote,
|
|
|
|
controller: progressNoteController,
|
|
|
|
controller: progressNoteController,
|
|
|
|
maxLines: 25,
|
|
|
|
maxLines: 25,
|
|
|
|
minLines: 7,
|
|
|
|
minLines: 10,
|
|
|
|
hasBorder: true,
|
|
|
|
hasBorder: true,
|
|
|
|
// validationError:complaintsController.text.isEmpty ,
|
|
|
|
validationError:progressNoteController.text.isEmpty&&isSubmitted?TranslationBase.of(context).emptyMessage:null ,
|
|
|
|
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -104,20 +108,28 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
AppButton(
|
|
|
|
AppButton(
|
|
|
|
title: 'Add Progress Note',
|
|
|
|
title: widget.visitType == 3
|
|
|
|
|
|
|
|
? 'Add Order Sheet'
|
|
|
|
|
|
|
|
: 'Add Progress Note',
|
|
|
|
color: Color(0xff359846),
|
|
|
|
color: Color(0xff359846),
|
|
|
|
// disabled: progressNoteController.text.isEmpty,
|
|
|
|
// disabled: progressNoteController.text.isEmpty,
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
isSubmitted = true;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
if (progressNoteController.text.isNotEmpty) {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
|
|
|
|
|
|
|
|
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
|
|
|
|
DoctorProfileModel doctorProfile = DoctorProfileModel
|
|
|
|
|
|
|
|
.fromJson(profile);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (widget.isUpdate) {
|
|
|
|
if (widget.isUpdate) {
|
|
|
|
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
|
|
|
|
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
|
|
|
|
admissionNo: int.parse(widget.patient.admissionNo),
|
|
|
|
admissionNo: int.parse(widget.patient
|
|
|
|
|
|
|
|
.admissionNo),
|
|
|
|
cancelledNote: false,
|
|
|
|
cancelledNote: false,
|
|
|
|
lineItemNo: 30,
|
|
|
|
lineItemNo: 30,
|
|
|
|
createdBy: widget.note.createdBy,
|
|
|
|
createdBy: widget.note.createdBy,
|
|
|
|
@ -129,10 +141,11 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
patientTypeID: widget.patient.patientType,
|
|
|
|
patientTypeID: widget.patient.patientType,
|
|
|
|
patientOutSA: false,
|
|
|
|
patientOutSA: false,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
await model.updatePatientProgressNote(reqModel);
|
|
|
|
await widget.patientModel.updatePatientProgressNote(reqModel);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
CreateNoteModel reqModel = CreateNoteModel(
|
|
|
|
CreateNoteModel reqModel = CreateNoteModel(
|
|
|
|
admissionNo: int.parse(widget.patient.admissionNo),
|
|
|
|
admissionNo: int.parse(widget.patient
|
|
|
|
|
|
|
|
.admissionNo),
|
|
|
|
createdBy: doctorProfile.doctorID,
|
|
|
|
createdBy: doctorProfile.doctorID,
|
|
|
|
visitType: widget.visitType,
|
|
|
|
visitType: widget.visitType,
|
|
|
|
patientID: widget.patient.patientId,
|
|
|
|
patientID: widget.patient.patientId,
|
|
|
|
@ -143,17 +156,19 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
notes: progressNoteController.text
|
|
|
|
notes: progressNoteController.text
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
await model.createPatientProgressNote(reqModel);
|
|
|
|
await widget.patientModel.createPatientProgressNote(reqModel);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
if (widget.patientModel.state == ViewState.ErrorLocal) {
|
|
|
|
Helpers.showErrorToast("Error");
|
|
|
|
Helpers.showErrorToast(
|
|
|
|
|
|
|
|
Helpers.generateContactAdminMsg());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ProgressNoteRequest progressNoteRequest =
|
|
|
|
ProgressNoteRequest progressNoteRequest =
|
|
|
|
ProgressNoteRequest(
|
|
|
|
ProgressNoteRequest(
|
|
|
|
visitType: widget.visitType,
|
|
|
|
visitType: widget.visitType,
|
|
|
|
// if equal 5 then this will return progress note
|
|
|
|
// if equal 5 then this will return progress note
|
|
|
|
admissionNo: int.parse(widget.patient.admissionNo),
|
|
|
|
admissionNo: int.parse(widget.patient
|
|
|
|
|
|
|
|
.admissionNo),
|
|
|
|
projectID: widget.patient.projectId,
|
|
|
|
projectID: widget.patient.projectId,
|
|
|
|
patientTypeID: widget.patient.patientType,
|
|
|
|
patientTypeID: widget.patient.patientType,
|
|
|
|
languageID: 2);
|
|
|
|
languageID: 2);
|
|
|
|
@ -163,12 +178,148 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
// return BaseView<PatientViewModel>(
|
|
|
|
|
|
|
|
// builder: (BuildContext context, PatientViewModel model, Widget child) =>
|
|
|
|
|
|
|
|
// AppScaffold(
|
|
|
|
|
|
|
|
// isShowAppBar: false,
|
|
|
|
|
|
|
|
// backgroundColor: Theme
|
|
|
|
|
|
|
|
// .of(context)
|
|
|
|
|
|
|
|
// .scaffoldBackgroundColor,
|
|
|
|
|
|
|
|
// body: SingleChildScrollView(
|
|
|
|
|
|
|
|
// child: Container(
|
|
|
|
|
|
|
|
// height: MediaQuery
|
|
|
|
|
|
|
|
// .of(context)
|
|
|
|
|
|
|
|
// .size
|
|
|
|
|
|
|
|
// .height * 1.0,
|
|
|
|
|
|
|
|
// child: Padding(
|
|
|
|
|
|
|
|
// padding: EdgeInsets.all(0.0),
|
|
|
|
|
|
|
|
// child: Column(
|
|
|
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// BottomSheetTitle(title: widget.visitType == 3
|
|
|
|
|
|
|
|
// ? 'Add Order Sheet'
|
|
|
|
|
|
|
|
// : 'Add Progress Note',),
|
|
|
|
|
|
|
|
// SizedBox(
|
|
|
|
|
|
|
|
// height: 10.0,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Center(
|
|
|
|
|
|
|
|
// child: FractionallySizedBox(
|
|
|
|
|
|
|
|
// widthFactor: 0.9,
|
|
|
|
|
|
|
|
// child: Column(
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// AppTextFieldCustom(
|
|
|
|
|
|
|
|
// hintText: widget.visitType == 3
|
|
|
|
|
|
|
|
// ? 'Add Order Sheet'
|
|
|
|
|
|
|
|
// : 'Add Progress Note',
|
|
|
|
|
|
|
|
// //TranslationBase.of(context).addProgressNote,
|
|
|
|
|
|
|
|
// controller: progressNoteController,
|
|
|
|
|
|
|
|
// maxLines: 25,
|
|
|
|
|
|
|
|
// minLines: 10,
|
|
|
|
|
|
|
|
// hasBorder: true,
|
|
|
|
|
|
|
|
// validationError:progressNoteController.text.isEmpty&&isSubmitted?TranslationBase.of(context).emptyMessage:null ,
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// bottomSheet: Container(
|
|
|
|
|
|
|
|
// margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
|
|
|
|
|
|
|
|
// child: Wrap(
|
|
|
|
|
|
|
|
// alignment: WrapAlignment.center,
|
|
|
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
|
|
|
// AppButton(
|
|
|
|
|
|
|
|
// title: widget.visitType == 3
|
|
|
|
|
|
|
|
// ? 'Add Order Sheet'
|
|
|
|
|
|
|
|
// : 'Add Progress Note',
|
|
|
|
|
|
|
|
// color: Color(0xff359846),
|
|
|
|
|
|
|
|
// // disabled: progressNoteController.text.isEmpty,
|
|
|
|
|
|
|
|
// fontWeight: FontWeight.w700,
|
|
|
|
|
|
|
|
// onPressed: () async {
|
|
|
|
|
|
|
|
// setState(() {
|
|
|
|
|
|
|
|
// isSubmitted = true;
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// if (progressNoteController.text.isNotEmpty) {
|
|
|
|
|
|
|
|
// GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
|
|
|
// Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// DoctorProfileModel doctorProfile = DoctorProfileModel
|
|
|
|
|
|
|
|
// .fromJson(profile);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// if (widget.isUpdate) {
|
|
|
|
|
|
|
|
// UpdateNoteReqModel reqModel = UpdateNoteReqModel(
|
|
|
|
|
|
|
|
// admissionNo: int.parse(widget.patient
|
|
|
|
|
|
|
|
// .admissionNo),
|
|
|
|
|
|
|
|
// cancelledNote: false,
|
|
|
|
|
|
|
|
// lineItemNo: 30,
|
|
|
|
|
|
|
|
// createdBy: widget.note.createdBy,
|
|
|
|
|
|
|
|
// notes: progressNoteController.text
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// ,
|
|
|
|
|
|
|
|
// verifiedNote: false,
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// patientTypeID: widget.patient.patientType,
|
|
|
|
|
|
|
|
// patientOutSA: false,
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
// await model.updatePatientProgressNote(reqModel);
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// CreateNoteModel reqModel = CreateNoteModel(
|
|
|
|
|
|
|
|
// admissionNo: int.parse(widget.patient
|
|
|
|
|
|
|
|
// .admissionNo),
|
|
|
|
|
|
|
|
// createdBy: doctorProfile.doctorID,
|
|
|
|
|
|
|
|
// visitType: widget.visitType,
|
|
|
|
|
|
|
|
// patientID: widget.patient.patientId,
|
|
|
|
|
|
|
|
// nursingRemarks: ' ',
|
|
|
|
|
|
|
|
// patientTypeID: widget.patient.patientType,
|
|
|
|
|
|
|
|
// patientOutSA: false,
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// notes: progressNoteController.text
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// await model.createPatientProgressNote(reqModel);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
|
|
|
// Helpers.showErrorToast(
|
|
|
|
|
|
|
|
// Helpers.generateContactAdminMsg());
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// ProgressNoteRequest progressNoteRequest =
|
|
|
|
|
|
|
|
// ProgressNoteRequest(
|
|
|
|
|
|
|
|
// visitType: widget.visitType,
|
|
|
|
|
|
|
|
// // if equal 5 then this will return progress note
|
|
|
|
|
|
|
|
// admissionNo: int.parse(widget.patient
|
|
|
|
|
|
|
|
// .admissionNo),
|
|
|
|
|
|
|
|
// projectID: widget.patient.projectId,
|
|
|
|
|
|
|
|
// patientTypeID: widget.patient.patientType,
|
|
|
|
|
|
|
|
// languageID: 2);
|
|
|
|
|
|
|
|
// await widget.patientModel.getPatientProgressNote(
|
|
|
|
|
|
|
|
// progressNoteRequest.toJson());
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
|
|
|
// Navigator.of(context).pop();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|