|
|
|
|
@ -97,10 +97,14 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
|
children: [
|
|
|
|
|
BottomSheetTitle(
|
|
|
|
|
title: widget.visitType == 3
|
|
|
|
|
? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) +
|
|
|
|
|
TranslationBase.of(context).orderSheet
|
|
|
|
|
: (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) +
|
|
|
|
|
TranslationBase.of(context).progressNote,
|
|
|
|
|
? (widget.isUpdate
|
|
|
|
|
? TranslationBase.of(context).noteUpdate
|
|
|
|
|
: TranslationBase.of(context).noteAdd) +
|
|
|
|
|
TranslationBase.of(context).orderSheet
|
|
|
|
|
: (widget.isUpdate
|
|
|
|
|
? TranslationBase.of(context).noteUpdate
|
|
|
|
|
: TranslationBase.of(context).noteAdd) +
|
|
|
|
|
TranslationBase.of(context).progressNote,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10.0,
|
|
|
|
|
@ -114,10 +118,18 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
|
children: [
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
hintText: widget.visitType == 3
|
|
|
|
|
? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) +
|
|
|
|
|
TranslationBase.of(context).orderSheet
|
|
|
|
|
: (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) +
|
|
|
|
|
TranslationBase.of(context).progressNote,
|
|
|
|
|
? (widget.isUpdate
|
|
|
|
|
? TranslationBase.of(context)
|
|
|
|
|
.noteUpdate
|
|
|
|
|
: TranslationBase.of(context)
|
|
|
|
|
.noteAdd) +
|
|
|
|
|
TranslationBase.of(context).orderSheet
|
|
|
|
|
: (widget.isUpdate
|
|
|
|
|
? TranslationBase.of(context)
|
|
|
|
|
.noteUpdate
|
|
|
|
|
: TranslationBase.of(context)
|
|
|
|
|
.noteAdd) +
|
|
|
|
|
TranslationBase.of(context).progressNote,
|
|
|
|
|
//TranslationBase.of(context).addProgressNote,
|
|
|
|
|
controller: progressNoteController,
|
|
|
|
|
maxLines: 35,
|
|
|
|
|
@ -132,19 +144,23 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
|
: null,
|
|
|
|
|
),
|
|
|
|
|
Positioned(
|
|
|
|
|
top: -2, //MediaQuery.of(context).size.height * 0,
|
|
|
|
|
right: projectViewModel.isArabic? MediaQuery.of(context).size.width * 0.75 : 15,
|
|
|
|
|
child: IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
DoctorApp.speechtotext,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
initSpeechState()
|
|
|
|
|
.then((value) => {onVoiceText()});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
top:
|
|
|
|
|
-2, //MediaQuery.of(context).size.height * 0,
|
|
|
|
|
right: projectViewModel.isArabic
|
|
|
|
|
? MediaQuery.of(context).size.width * 0.75
|
|
|
|
|
: 15,
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
IconButton(
|
|
|
|
|
icon: Icon(DoctorApp.speechtotext,
|
|
|
|
|
color: Colors.black, size: 35),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
initSpeechState()
|
|
|
|
|
.then((value) => {onVoiceText()});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -161,77 +177,97 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
|
child: Wrap(
|
|
|
|
|
alignment: WrapAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
AppButton(
|
|
|
|
|
title: widget.visitType == 3
|
|
|
|
|
? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) +
|
|
|
|
|
TranslationBase.of(context).orderSheet
|
|
|
|
|
: (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) +
|
|
|
|
|
TranslationBase.of(context).progressNote,
|
|
|
|
|
color: Color(0xff359846),
|
|
|
|
|
// disabled: progressNoteController.text.isEmpty,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
setState(() {
|
|
|
|
|
isSubmitted = true;
|
|
|
|
|
});
|
|
|
|
|
if (progressNoteController.text.trim().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: widget.note.lineItemNo,
|
|
|
|
|
createdBy: widget.note.createdBy,
|
|
|
|
|
notes: progressNoteController.text,
|
|
|
|
|
verifiedNote: false,
|
|
|
|
|
patientTypeID: widget.patient.patientType,
|
|
|
|
|
patientOutSA: false,
|
|
|
|
|
);
|
|
|
|
|
await widget.patientModel
|
|
|
|
|
.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);
|
|
|
|
|
progressNoteController.text.isEmpty
|
|
|
|
|
? SizedBox()
|
|
|
|
|
: Container(
|
|
|
|
|
margin: EdgeInsets.all(5),
|
|
|
|
|
child: AppButton(
|
|
|
|
|
title: TranslationBase.of(context).clearText,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
progressNoteController.text = '';
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(5),
|
|
|
|
|
child: AppButton(
|
|
|
|
|
title: widget.visitType == 3
|
|
|
|
|
? (widget.isUpdate
|
|
|
|
|
? TranslationBase.of(context).noteUpdate
|
|
|
|
|
: TranslationBase.of(context).noteAdd) +
|
|
|
|
|
TranslationBase.of(context).orderSheet
|
|
|
|
|
: (widget.isUpdate
|
|
|
|
|
? TranslationBase.of(context).noteUpdate
|
|
|
|
|
: TranslationBase.of(context).noteAdd) +
|
|
|
|
|
TranslationBase.of(context).progressNote,
|
|
|
|
|
color: Color(0xff359846),
|
|
|
|
|
// disabled: progressNoteController.text.isEmpty,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
setState(() {
|
|
|
|
|
isSubmitted = true;
|
|
|
|
|
});
|
|
|
|
|
if (progressNoteController.text.trim().isNotEmpty) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
|
|
|
|
|
|
await widget.patientModel
|
|
|
|
|
.createPatientProgressNote(reqModel);
|
|
|
|
|
}
|
|
|
|
|
DoctorProfileModel doctorProfile =
|
|
|
|
|
DoctorProfileModel.fromJson(profile);
|
|
|
|
|
|
|
|
|
|
if (widget.patientModel.state == ViewState.ErrorLocal) {
|
|
|
|
|
Helpers.showErrorToast(widget.patientModel.error);
|
|
|
|
|
} else {
|
|
|
|
|
ProgressNoteRequest progressNoteRequest =
|
|
|
|
|
ProgressNoteRequest(
|
|
|
|
|
visitType: widget.visitType,
|
|
|
|
|
// if equal 5 then this will return progress note
|
|
|
|
|
if (widget.isUpdate) {
|
|
|
|
|
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
|
|
|
|
|
admissionNo: int.parse(widget.patient.admissionNo),
|
|
|
|
|
cancelledNote: false,
|
|
|
|
|
lineItemNo: widget.note.lineItemNo,
|
|
|
|
|
createdBy: widget.note.createdBy,
|
|
|
|
|
notes: progressNoteController.text,
|
|
|
|
|
verifiedNote: false,
|
|
|
|
|
patientTypeID: widget.patient.patientType,
|
|
|
|
|
patientOutSA: false,
|
|
|
|
|
);
|
|
|
|
|
await widget.patientModel
|
|
|
|
|
.updatePatientProgressNote(reqModel);
|
|
|
|
|
} else {
|
|
|
|
|
CreateNoteModel reqModel = CreateNoteModel(
|
|
|
|
|
admissionNo:
|
|
|
|
|
int.parse(widget.patient.admissionNo),
|
|
|
|
|
projectID: widget.patient.projectId,
|
|
|
|
|
createdBy: doctorProfile.doctorID,
|
|
|
|
|
visitType: widget.visitType,
|
|
|
|
|
patientID: widget.patient.patientId,
|
|
|
|
|
nursingRemarks: ' ',
|
|
|
|
|
patientTypeID: widget.patient.patientType,
|
|
|
|
|
languageID: 2);
|
|
|
|
|
await widget.patientModel
|
|
|
|
|
.getPatientProgressNote(progressNoteRequest.toJson());
|
|
|
|
|
}
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
DrAppToastMsg.showSuccesToast(
|
|
|
|
|
"Your Order added Successfully");
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
} else {
|
|
|
|
|
Helpers.showErrorToast("You cant add only spaces");
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
patientOutSA: false,
|
|
|
|
|
notes: progressNoteController.text);
|
|
|
|
|
|
|
|
|
|
await widget.patientModel
|
|
|
|
|
.createPatientProgressNote(reqModel);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (widget.patientModel.state == ViewState.ErrorLocal) {
|
|
|
|
|
Helpers.showErrorToast(widget.patientModel.error);
|
|
|
|
|
} 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);
|
|
|
|
|
DrAppToastMsg.showSuccesToast(
|
|
|
|
|
"Your Order added Successfully");
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
} else {
|
|
|
|
|
Helpers.showErrorToast("You cant add only spaces");
|
|
|
|
|
}
|
|
|
|
|
})),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -278,7 +314,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
|
setState(() {
|
|
|
|
|
SpeechToText.closeAlertDialog(context);
|
|
|
|
|
speech.stop();
|
|
|
|
|
progressNoteController.text = reconizedWord;
|
|
|
|
|
progressNoteController.text += reconizedWord + '\n';
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
print(result.finalResult);
|
|
|
|
|
|