|
|
|
@ -2,16 +2,16 @@ import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
|
|
|
|
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
|
|
|
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/note/note_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/note/note_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/note/update_note_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/note/update_note_model.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/patient/progress_note_request.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/provider/robot_provider.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
|
|
|
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
|
|
|
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/core/model/patient/progress_note_request.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
|
|
|
|
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
import 'package:doctor_app_flutter/util/helpers.dart';
|
|
|
|
@ -26,6 +26,8 @@ import 'package:permission_handler/permission_handler.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:speech_to_text/speech_recognition_error.dart';
|
|
|
|
import 'package:speech_to_text/speech_recognition_error.dart';
|
|
|
|
import 'package:speech_to_text/speech_to_text.dart' as stt;
|
|
|
|
import 'package:speech_to_text/speech_to_text.dart' as stt;
|
|
|
|
|
|
|
|
import '../../../../../widgets/shared/dialogs/dailog-list-select.dart';
|
|
|
|
|
|
|
|
import '../../../../base/base_view.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class UpdateNoteOrder extends StatefulWidget {
|
|
|
|
class UpdateNoteOrder extends StatefulWidget {
|
|
|
|
final NoteModel note;
|
|
|
|
final NoteModel note;
|
|
|
|
@ -33,6 +35,8 @@ class UpdateNoteOrder extends StatefulWidget {
|
|
|
|
final PatiantInformtion patient;
|
|
|
|
final PatiantInformtion patient;
|
|
|
|
final int visitType;
|
|
|
|
final int visitType;
|
|
|
|
final bool isUpdate;
|
|
|
|
final bool isUpdate;
|
|
|
|
|
|
|
|
final List<dynamic> elementList;
|
|
|
|
|
|
|
|
final Function(dynamic) okFunction;
|
|
|
|
|
|
|
|
|
|
|
|
const UpdateNoteOrder(
|
|
|
|
const UpdateNoteOrder(
|
|
|
|
{Key key,
|
|
|
|
{Key key,
|
|
|
|
@ -40,7 +44,9 @@ class UpdateNoteOrder extends StatefulWidget {
|
|
|
|
this.patientModel,
|
|
|
|
this.patientModel,
|
|
|
|
this.patient,
|
|
|
|
this.patient,
|
|
|
|
this.visitType,
|
|
|
|
this.visitType,
|
|
|
|
this.isUpdate})
|
|
|
|
this.isUpdate,
|
|
|
|
|
|
|
|
this.elementList,
|
|
|
|
|
|
|
|
this.okFunction})
|
|
|
|
: super(key: key);
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
@ -48,6 +54,7 @@ class UpdateNoteOrder extends StatefulWidget {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
|
|
|
|
dynamic selectValue;
|
|
|
|
int selectedType;
|
|
|
|
int selectedType;
|
|
|
|
bool isSubmitted = false;
|
|
|
|
bool isSubmitted = false;
|
|
|
|
stt.SpeechToText speech = stt.SpeechToText();
|
|
|
|
stt.SpeechToText speech = stt.SpeechToText();
|
|
|
|
@ -78,13 +85,24 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
String keyId = 'ParameterCode';
|
|
|
|
|
|
|
|
|
|
|
|
projectViewModel = Provider.of(context);
|
|
|
|
projectViewModel = Provider.of(context);
|
|
|
|
|
|
|
|
|
|
|
|
if (widget.note != null) {
|
|
|
|
if (widget.note != null) {
|
|
|
|
progressNoteController.text = widget.note.notes;
|
|
|
|
progressNoteController.text = widget.note.notes;
|
|
|
|
|
|
|
|
if(selectValue==null)
|
|
|
|
|
|
|
|
selectValue={};
|
|
|
|
|
|
|
|
selectValue['parameterCode'] = widget.note.condition;
|
|
|
|
|
|
|
|
selectValue['description'] = widget.note.conditionDescription;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return AppScaffold(
|
|
|
|
return BaseView<PatientViewModel>(
|
|
|
|
|
|
|
|
onModelReady: (model) {
|
|
|
|
|
|
|
|
model.getStpMasterList(isLocalBusy: false);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
isShowAppBar: false,
|
|
|
|
isShowAppBar: false,
|
|
|
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
@ -109,6 +127,52 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
SizedBox(
|
|
|
|
SizedBox(
|
|
|
|
height: 10.0,
|
|
|
|
height: 10.0,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(right: 20, left: 20),
|
|
|
|
|
|
|
|
child: InkWell(
|
|
|
|
|
|
|
|
onTap: model.stpMasterList != null
|
|
|
|
|
|
|
|
? () {
|
|
|
|
|
|
|
|
Helpers.hideKeyboard(context);
|
|
|
|
|
|
|
|
ListSelectDialog dialog = ListSelectDialog(
|
|
|
|
|
|
|
|
list: model.stpMasterList,
|
|
|
|
|
|
|
|
attributeName: 'Description',
|
|
|
|
|
|
|
|
attributeValueId:
|
|
|
|
|
|
|
|
model.stpMasterList.length == 1
|
|
|
|
|
|
|
|
? model.stpMasterList[0]['${keyId}']
|
|
|
|
|
|
|
|
.toString()
|
|
|
|
|
|
|
|
: '${keyId}',
|
|
|
|
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
|
|
|
|
okFunction: (selectedValue) => {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
selectValue = selectedValue;
|
|
|
|
|
|
|
|
selectValue['isDefault'] = true;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
showDialog(
|
|
|
|
|
|
|
|
barrierDismissible: false,
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
|
|
|
return dialog;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
child: AppTextFieldCustom(
|
|
|
|
|
|
|
|
hintText: TranslationBase.of(context).selectCondition,//'Select Condition',
|
|
|
|
|
|
|
|
dropDownText: model.stpMasterList.length == 1
|
|
|
|
|
|
|
|
? model.stpMasterList[0]['Description']
|
|
|
|
|
|
|
|
: selectValue == null
|
|
|
|
|
|
|
|
? null
|
|
|
|
|
|
|
|
: selectValue['Description'],
|
|
|
|
|
|
|
|
enabled: false,
|
|
|
|
|
|
|
|
isTextFieldHasSuffix: true,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 10.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
Center(
|
|
|
|
Center(
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
widthFactor: 0.9,
|
|
|
|
widthFactor: 0.9,
|
|
|
|
@ -129,7 +193,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
.noteUpdate
|
|
|
|
.noteUpdate
|
|
|
|
: TranslationBase.of(context)
|
|
|
|
: TranslationBase.of(context)
|
|
|
|
.noteAdd) +
|
|
|
|
.noteAdd) +
|
|
|
|
TranslationBase.of(context).progressNote,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
|
|
|
.progressNote,
|
|
|
|
//TranslationBase.of(context).addProgressNote,
|
|
|
|
//TranslationBase.of(context).addProgressNote,
|
|
|
|
controller: progressNoteController,
|
|
|
|
controller: progressNoteController,
|
|
|
|
maxLines: 35,
|
|
|
|
maxLines: 35,
|
|
|
|
@ -137,15 +202,15 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
hasBorder: true,
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
validationError:
|
|
|
|
validationError: progressNoteController
|
|
|
|
progressNoteController.text.isEmpty &&
|
|
|
|
.text.isEmpty &&
|
|
|
|
isSubmitted
|
|
|
|
isSubmitted
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
Positioned(
|
|
|
|
top:
|
|
|
|
top: -2,
|
|
|
|
-2, //MediaQuery.of(context).size.height * 0,
|
|
|
|
//MediaQuery.of(context).size.height * 0,
|
|
|
|
right: projectViewModel.isArabic
|
|
|
|
right: projectViewModel.isArabic
|
|
|
|
? MediaQuery.of(context).size.width * 0.75
|
|
|
|
? MediaQuery.of(context).size.width * 0.75
|
|
|
|
: 15,
|
|
|
|
: 15,
|
|
|
|
@ -217,7 +282,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
|
|
|
|
|
|
|
|
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: widget.note.lineItemNo,
|
|
|
|
lineItemNo: widget.note.lineItemNo,
|
|
|
|
createdBy: widget.note.createdBy,
|
|
|
|
createdBy: widget.note.createdBy,
|
|
|
|
@ -225,7 +291,7 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
verifiedNote: false,
|
|
|
|
verifiedNote: false,
|
|
|
|
patientTypeID: widget.patient.patientType,
|
|
|
|
patientTypeID: widget.patient.patientType,
|
|
|
|
patientOutSA: false,
|
|
|
|
patientOutSA: false,
|
|
|
|
);
|
|
|
|
conditionId: selectValue['ParameterCode']);
|
|
|
|
await widget.patientModel
|
|
|
|
await widget.patientModel
|
|
|
|
.updatePatientProgressNote(reqModel);
|
|
|
|
.updatePatientProgressNote(reqModel);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -238,13 +304,15 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
nursingRemarks: ' ',
|
|
|
|
nursingRemarks: ' ',
|
|
|
|
patientTypeID: widget.patient.patientType,
|
|
|
|
patientTypeID: widget.patient.patientType,
|
|
|
|
patientOutSA: false,
|
|
|
|
patientOutSA: false,
|
|
|
|
notes: progressNoteController.text);
|
|
|
|
notes: progressNoteController.text,
|
|
|
|
|
|
|
|
conditionId: selectValue['ParameterCode']);
|
|
|
|
|
|
|
|
|
|
|
|
await widget.patientModel
|
|
|
|
await widget.patientModel
|
|
|
|
.createPatientProgressNote(reqModel);
|
|
|
|
.createPatientProgressNote(reqModel);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (widget.patientModel.state == ViewState.ErrorLocal) {
|
|
|
|
if (widget.patientModel.state ==
|
|
|
|
|
|
|
|
ViewState.ErrorLocal) {
|
|
|
|
Helpers.showErrorToast(widget.patientModel.error);
|
|
|
|
Helpers.showErrorToast(widget.patientModel.error);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ProgressNoteRequest progressNoteRequest =
|
|
|
|
ProgressNoteRequest progressNoteRequest =
|
|
|
|
@ -261,15 +329,16 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
DrAppToastMsg.showSuccesToast(
|
|
|
|
DrAppToastMsg.showSuccesToast(
|
|
|
|
"Your Order added Successfully");
|
|
|
|
TranslationBase.of(context).yourOrderAddedSuccessfully);
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Helpers.showErrorToast("You cant add only spaces");
|
|
|
|
Helpers.showErrorToast(TranslationBase.of(context).youCannotAddOnlySpaces);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})),
|
|
|
|
})),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|