|
|
@ -11,6 +11,7 @@ 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/models/doctor/doctor_profile_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/patient/progress_note_request.dart';
|
|
|
|
import 'package:doctor_app_flutter/models/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';
|
|
|
@ -28,27 +29,27 @@ 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;
|
|
|
|
|
|
|
|
|
|
|
|
class UpdateOperatiomReport extends StatefulWidget {
|
|
|
|
class UpdateOperationReport extends StatefulWidget {
|
|
|
|
final NoteModel note;
|
|
|
|
final NoteModel note;
|
|
|
|
final OperationReportViewModel patientModel;
|
|
|
|
final OperationReportViewModel operationReportViewModel;
|
|
|
|
final PatiantInformtion patient;
|
|
|
|
final PatiantInformtion patient;
|
|
|
|
final int visitType;
|
|
|
|
final int visitType;
|
|
|
|
final bool isUpdate;
|
|
|
|
final bool isUpdate;
|
|
|
|
|
|
|
|
|
|
|
|
const UpdateOperatiomReport(
|
|
|
|
const UpdateOperationReport(
|
|
|
|
{Key key,
|
|
|
|
{Key key,
|
|
|
|
this.note,
|
|
|
|
this.note,
|
|
|
|
this.patientModel,
|
|
|
|
this.operationReportViewModel,
|
|
|
|
this.patient,
|
|
|
|
this.patient,
|
|
|
|
this.visitType,
|
|
|
|
this.visitType,
|
|
|
|
this.isUpdate})
|
|
|
|
this.isUpdate})
|
|
|
|
: super(key: key);
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_UpdateOperatiomReportState createState() => _UpdateOperatiomReportState();
|
|
|
|
_UpdateOperationReportState createState() => _UpdateOperationReportState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _UpdateOperatiomReportState extends State<UpdateOperatiomReport> {
|
|
|
|
class _UpdateOperationReportState extends State<UpdateOperationReport> {
|
|
|
|
int selectedType;
|
|
|
|
int selectedType;
|
|
|
|
bool isSubmitted = false;
|
|
|
|
bool isSubmitted = false;
|
|
|
|
stt.SpeechToText speech = stt.SpeechToText();
|
|
|
|
stt.SpeechToText speech = stt.SpeechToText();
|
|
|
@ -56,7 +57,26 @@ class _UpdateOperatiomReportState extends State<UpdateOperatiomReport> {
|
|
|
|
var event = RobotProvider();
|
|
|
|
var event = RobotProvider();
|
|
|
|
ProjectViewModel projectViewModel;
|
|
|
|
ProjectViewModel projectViewModel;
|
|
|
|
|
|
|
|
|
|
|
|
TextEditingController progressNoteController = TextEditingController();
|
|
|
|
TextEditingController preOpDiagmosisController = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController postOpDiagmosisNoteController = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController surgeonController = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController assistantNoteController = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController operationController = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController inasionController = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController findingController = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController surgeryProcedureController = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController postOpInstructionController = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController complicationDetailsController = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController bloodLossDetailController = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController histopathSpecimenController = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController microbiologySpecimenController =
|
|
|
|
|
|
|
|
TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController otherSpecimenController = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController scrubNurseController = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController circulatingNurseController = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController BloodTransfusedDetailController =
|
|
|
|
|
|
|
|
TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController anasthetistController = TextEditingController();
|
|
|
|
|
|
|
|
|
|
|
|
setSelectedType(int val) {
|
|
|
|
setSelectedType(int val) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
@ -66,265 +86,491 @@ class _UpdateOperatiomReportState extends State<UpdateOperatiomReport> {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
requestPermissions();
|
|
|
|
|
|
|
|
event.controller.stream.listen((p) {
|
|
|
|
|
|
|
|
if (p['startPopUp'] == 'true') {
|
|
|
|
|
|
|
|
if (this.mounted) {
|
|
|
|
|
|
|
|
initSpeechState().then((value) => {onVoiceText()});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
projectViewModel = Provider.of(context);
|
|
|
|
projectViewModel = Provider.of(context);
|
|
|
|
|
|
|
|
//TODO Elham* add translation to hints
|
|
|
|
if (widget.note != null) {
|
|
|
|
|
|
|
|
progressNoteController.text = widget.note.notes;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return AppScaffold(
|
|
|
|
return AppScaffold(
|
|
|
|
isShowAppBar: false,
|
|
|
|
isShowAppBar: true,
|
|
|
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
|
|
|
appBar: BottomSheetTitle(
|
|
|
|
|
|
|
|
title: (widget.isUpdate
|
|
|
|
|
|
|
|
? TranslationBase.of(context).noteUpdate
|
|
|
|
|
|
|
|
: TranslationBase.of(context).noteAdd) +
|
|
|
|
|
|
|
|
TranslationBase.of(context).operationReports,
|
|
|
|
|
|
|
|
),
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
height: MediaQuery.of(context).size.height * 1.0,
|
|
|
|
height: MediaQuery.of(context).size.height * 1.0,
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.all(0.0),
|
|
|
|
padding: EdgeInsets.all(0.0),
|
|
|
|
child: Column(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
BottomSheetTitle(
|
|
|
|
children: [
|
|
|
|
title: widget.visitType == 3
|
|
|
|
SizedBox(
|
|
|
|
? (widget.isUpdate
|
|
|
|
height: 10.0,
|
|
|
|
? TranslationBase.of(context).noteUpdate
|
|
|
|
),
|
|
|
|
: TranslationBase.of(context).noteAdd) +
|
|
|
|
SingleChildScrollView(
|
|
|
|
TranslationBase.of(context).orderSheet
|
|
|
|
child: Center(
|
|
|
|
: (widget.isUpdate
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
? TranslationBase.of(context).noteUpdate
|
|
|
|
widthFactor: 0.9,
|
|
|
|
: TranslationBase.of(context).noteAdd) +
|
|
|
|
child: Column(
|
|
|
|
TranslationBase.of(context).progressNote,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 10.0,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Center(
|
|
|
|
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
|
|
|
|
widthFactor: 0.9,
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Stack(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
AppTextFieldCustom(
|
|
|
|
AppTextFieldCustom(
|
|
|
|
hintText: widget.visitType == 3
|
|
|
|
hintText: "Pre Op Diagmosis",
|
|
|
|
? (widget.isUpdate
|
|
|
|
//TranslationBase.of(context).addoperationReports,
|
|
|
|
? TranslationBase.of(context)
|
|
|
|
controller: preOpDiagmosisController,
|
|
|
|
.noteUpdate
|
|
|
|
maxLines: 1,
|
|
|
|
: TranslationBase.of(context)
|
|
|
|
minLines: 1,
|
|
|
|
.noteAdd) +
|
|
|
|
hasBorder: true,
|
|
|
|
TranslationBase.of(context).orderSheet
|
|
|
|
|
|
|
|
: (widget.isUpdate
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
? TranslationBase.of(context)
|
|
|
|
validationError:
|
|
|
|
.noteUpdate
|
|
|
|
preOpDiagmosisController.text.isEmpty &&
|
|
|
|
: TranslationBase.of(context)
|
|
|
|
isSubmitted
|
|
|
|
.noteAdd) +
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
TranslationBase.of(context).progressNote,
|
|
|
|
: null,
|
|
|
|
//TranslationBase.of(context).addProgressNote,
|
|
|
|
),
|
|
|
|
controller: progressNoteController,
|
|
|
|
SizedBox(
|
|
|
|
maxLines: 35,
|
|
|
|
height: 4,
|
|
|
|
minLines: 25,
|
|
|
|
),
|
|
|
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
|
|
|
hintText: "Post Op Diagmosis",
|
|
|
|
|
|
|
|
//TranslationBase.of(context).addoperationReports,
|
|
|
|
|
|
|
|
controller: postOpDiagmosisNoteController,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
minLines: 1,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
|
|
|
|
validationError:
|
|
|
|
|
|
|
|
postOpDiagmosisNoteController.text.isEmpty &&
|
|
|
|
|
|
|
|
isSubmitted
|
|
|
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
|
|
|
hintText: "Surgeon",
|
|
|
|
|
|
|
|
//TranslationBase.of(context).addoperationReports,
|
|
|
|
|
|
|
|
controller: surgeonController,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
minLines: 1,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
|
|
|
|
validationError:
|
|
|
|
|
|
|
|
surgeonController.text.isEmpty && isSubmitted
|
|
|
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
|
|
|
hintText: "assistant",
|
|
|
|
|
|
|
|
//TranslationBase.of(context).addoperationReports,
|
|
|
|
|
|
|
|
controller: assistantNoteController,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
minLines: 1,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
|
|
|
|
validationError:
|
|
|
|
|
|
|
|
assistantNoteController.text.isEmpty &&
|
|
|
|
|
|
|
|
isSubmitted
|
|
|
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
|
|
|
hintText: "Operation",
|
|
|
|
|
|
|
|
//TranslationBase.of(context).addoperationReports,
|
|
|
|
|
|
|
|
controller: operationController,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
minLines: 1,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
|
|
|
|
validationError:
|
|
|
|
|
|
|
|
operationController.text.isEmpty &&
|
|
|
|
|
|
|
|
isSubmitted
|
|
|
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
|
|
|
hintText: "inasion",
|
|
|
|
|
|
|
|
//TranslationBase.of(context).addoperationReports,
|
|
|
|
|
|
|
|
controller: inasionController,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
minLines: 1,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
|
|
|
|
validationError:
|
|
|
|
|
|
|
|
inasionController.text.isEmpty && isSubmitted
|
|
|
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
|
|
|
hintText: "finding",
|
|
|
|
|
|
|
|
//TranslationBase.of(context).addoperationReports,
|
|
|
|
|
|
|
|
controller: findingController,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
minLines: 1,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
|
|
|
|
validationError:
|
|
|
|
|
|
|
|
findingController.text.isEmpty && isSubmitted
|
|
|
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
|
|
|
hintText: "Surgery Procedure",
|
|
|
|
|
|
|
|
//TranslationBase.of(context).addoperationReports,
|
|
|
|
|
|
|
|
controller: surgeryProcedureController,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
minLines: 1,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
|
|
|
|
validationError:
|
|
|
|
|
|
|
|
surgeryProcedureController.text.isEmpty &&
|
|
|
|
|
|
|
|
isSubmitted
|
|
|
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
|
|
|
hintText: "Post Op Instruction",
|
|
|
|
|
|
|
|
//TranslationBase.of(context).addoperationReports,
|
|
|
|
|
|
|
|
controller: postOpInstructionController,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
minLines: 1,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
|
|
|
|
validationError:
|
|
|
|
|
|
|
|
postOpInstructionController.text.isEmpty &&
|
|
|
|
|
|
|
|
isSubmitted
|
|
|
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
|
|
|
hintText: "Complication Details",
|
|
|
|
|
|
|
|
//TranslationBase.of(context).addoperationReports,
|
|
|
|
|
|
|
|
controller: complicationDetailsController,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
minLines: 1,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
|
|
|
|
validationError:
|
|
|
|
|
|
|
|
complicationDetailsController.text.isEmpty &&
|
|
|
|
|
|
|
|
isSubmitted
|
|
|
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
|
|
|
hintText: "Blood Loss Detail",
|
|
|
|
|
|
|
|
//TranslationBase.of(context).addoperationReports,
|
|
|
|
|
|
|
|
controller: bloodLossDetailController,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
minLines: 1,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
|
|
|
|
validationError:
|
|
|
|
|
|
|
|
bloodLossDetailController.text.isEmpty &&
|
|
|
|
|
|
|
|
isSubmitted
|
|
|
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
|
|
|
hintText: "histopal the Specimen",
|
|
|
|
|
|
|
|
//TranslationBase.of(context).addoperationReports,
|
|
|
|
|
|
|
|
controller: histopathSpecimenController,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
minLines: 1,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
|
|
|
|
validationError:
|
|
|
|
|
|
|
|
histopathSpecimenController.text.isEmpty &&
|
|
|
|
|
|
|
|
isSubmitted
|
|
|
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
|
|
|
hintText: "microbiology Specimen ",
|
|
|
|
|
|
|
|
//TranslationBase.of(context).addoperationReports,
|
|
|
|
|
|
|
|
controller: microbiologySpecimenController,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
minLines: 1,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
|
|
|
|
validationError:
|
|
|
|
|
|
|
|
microbiologySpecimenController.text.isEmpty &&
|
|
|
|
|
|
|
|
isSubmitted
|
|
|
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
|
|
|
hintText: "other Specimen",
|
|
|
|
|
|
|
|
//TranslationBase.of(context).addoperationReports,
|
|
|
|
|
|
|
|
controller: otherSpecimenController,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
minLines: 1,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
|
|
|
|
validationError:
|
|
|
|
|
|
|
|
otherSpecimenController.text.isEmpty &&
|
|
|
|
|
|
|
|
isSubmitted
|
|
|
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
|
|
|
hintText: "scrub Nurse",
|
|
|
|
|
|
|
|
//TranslationBase.of(context).addoperationReports,
|
|
|
|
|
|
|
|
controller: scrubNurseController,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
minLines: 1,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
|
|
|
|
validationError:
|
|
|
|
|
|
|
|
scrubNurseController.text.isEmpty &&
|
|
|
|
|
|
|
|
isSubmitted
|
|
|
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
|
|
|
hintText: "circulating Nurse",
|
|
|
|
|
|
|
|
//TranslationBase.of(context).addoperationReports,
|
|
|
|
|
|
|
|
controller: circulatingNurseController,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
minLines: 1,
|
|
|
|
hasBorder: true,
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
validationError:
|
|
|
|
validationError:
|
|
|
|
progressNoteController.text.isEmpty &&
|
|
|
|
circulatingNurseController.text.isEmpty &&
|
|
|
|
isSubmitted
|
|
|
|
isSubmitted
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
SizedBox(
|
|
|
|
top:
|
|
|
|
height: 4,
|
|
|
|
-2, //MediaQuery.of(context).size.height * 0,
|
|
|
|
),
|
|
|
|
right: projectViewModel.isArabic
|
|
|
|
AppTextFieldCustom(
|
|
|
|
? MediaQuery.of(context).size.width * 0.75
|
|
|
|
hintText: "Blood Transfused Detail",
|
|
|
|
: 15,
|
|
|
|
//TranslationBase.of(context).addoperationReports,
|
|
|
|
child: Column(
|
|
|
|
controller: BloodTransfusedDetailController,
|
|
|
|
children: [
|
|
|
|
maxLines: 1,
|
|
|
|
IconButton(
|
|
|
|
minLines: 1,
|
|
|
|
icon: Icon(DoctorApp.speechtotext,
|
|
|
|
hasBorder: true,
|
|
|
|
color: Colors.black, size: 35),
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
initSpeechState()
|
|
|
|
validationError: BloodTransfusedDetailController
|
|
|
|
.then((value) => {onVoiceText()});
|
|
|
|
.text.isEmpty &&
|
|
|
|
},
|
|
|
|
isSubmitted
|
|
|
|
),
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
],
|
|
|
|
: null,
|
|
|
|
))
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 4,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
AppTextFieldCustom(
|
|
|
|
|
|
|
|
hintText: "Anasthetist",
|
|
|
|
|
|
|
|
//TranslationBase.of(context).addoperationReports,
|
|
|
|
|
|
|
|
controller: anasthetistController,
|
|
|
|
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
minLines: 1,
|
|
|
|
|
|
|
|
hasBorder: true,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// isTextFieldHasSuffix: true,
|
|
|
|
|
|
|
|
validationError:
|
|
|
|
|
|
|
|
anasthetistController.text.isEmpty &&
|
|
|
|
|
|
|
|
isSubmitted
|
|
|
|
|
|
|
|
? TranslationBase.of(context).emptyMessage
|
|
|
|
|
|
|
|
: null,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(
|
|
|
|
|
|
|
|
height: 250,
|
|
|
|
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
bottomSheet: Container(
|
|
|
|
bottomSheet: Container(
|
|
|
|
height: progressNoteController.text.isNotEmpty ? 130 : 70,
|
|
|
|
height: 70,
|
|
|
|
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
|
|
|
|
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
if (progressNoteController.text.isNotEmpty)
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
margin: EdgeInsets.all(5),
|
|
|
|
|
|
|
|
child: AppButton(
|
|
|
|
|
|
|
|
title: TranslationBase.of(context).clearText,
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
progressNoteController.text = '';
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.all(5),
|
|
|
|
margin: EdgeInsets.all(5),
|
|
|
|
child: AppButton(
|
|
|
|
child: AppButton(
|
|
|
|
title: widget.visitType == 3
|
|
|
|
title: (widget.isUpdate
|
|
|
|
? (widget.isUpdate
|
|
|
|
? TranslationBase.of(context).noteUpdate
|
|
|
|
? TranslationBase.of(context).noteUpdate
|
|
|
|
: TranslationBase.of(context).noteAdd) +
|
|
|
|
: TranslationBase.of(context).noteAdd) +
|
|
|
|
TranslationBase.of(context).operationReports,
|
|
|
|
TranslationBase.of(context).orderSheet
|
|
|
|
color: Color(0xff359846),
|
|
|
|
: (widget.isUpdate
|
|
|
|
// disabled: operationReportsController.text.isEmpty,
|
|
|
|
? TranslationBase.of(context).noteUpdate
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
: TranslationBase.of(context).noteAdd) +
|
|
|
|
onPressed: () async {
|
|
|
|
TranslationBase.of(context).progressNote,
|
|
|
|
setState(() {
|
|
|
|
color: Color(0xff359846),
|
|
|
|
isSubmitted = true;
|
|
|
|
// disabled: progressNoteController.text.isEmpty,
|
|
|
|
});
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
if (isFormValid()) {
|
|
|
|
onPressed: () async {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
setState(() {
|
|
|
|
await widget.operationReportViewModel.getDoctorProfile();
|
|
|
|
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) {
|
|
|
|
CreateUpdateOperationReportRequestModel
|
|
|
|
UpdateNoteReqModel reqModel = UpdateNoteReqModel(
|
|
|
|
createUpdateOperationReportRequestModel =
|
|
|
|
|
|
|
|
CreateUpdateOperationReportRequestModel(
|
|
|
|
|
|
|
|
inasion: inasionController.text,
|
|
|
|
|
|
|
|
/// TODO Elham* Add dynamic reservation
|
|
|
|
|
|
|
|
reservationNo: 0,
|
|
|
|
|
|
|
|
preOpDiagmosis: preOpDiagmosisController.text,
|
|
|
|
|
|
|
|
postOpDiagmosis: postOpDiagmosisNoteController.text,
|
|
|
|
|
|
|
|
surgeon: surgeonController.text,
|
|
|
|
|
|
|
|
assistant: assistantNoteController.text,
|
|
|
|
|
|
|
|
anasthetist: assistantNoteController.text,
|
|
|
|
|
|
|
|
operation: operationController.text,
|
|
|
|
|
|
|
|
finding: findingController.text,
|
|
|
|
|
|
|
|
surgeryProcedure: surgeonController.text,
|
|
|
|
|
|
|
|
postOpInstruction: postOpInstructionController.text,
|
|
|
|
|
|
|
|
complicationDetails:
|
|
|
|
|
|
|
|
complicationDetailsController.text,
|
|
|
|
|
|
|
|
bloodLossDetail: bloodLossDetailController.text,
|
|
|
|
|
|
|
|
histopathSpecimen: histopathSpecimenController.text,
|
|
|
|
|
|
|
|
microbiologySpecimen:
|
|
|
|
|
|
|
|
microbiologySpecimenController.text,
|
|
|
|
|
|
|
|
otherSpecimen: otherSpecimenController.text,
|
|
|
|
|
|
|
|
scrubNurse: surgeonController.text,
|
|
|
|
|
|
|
|
circulatingNurse: circulatingNurseController.text,
|
|
|
|
|
|
|
|
bloodTransfusedDetail:
|
|
|
|
|
|
|
|
bloodLossDetailController.text,
|
|
|
|
|
|
|
|
patientID: widget.patient.patientId,
|
|
|
|
admissionNo: int.parse(widget.patient.admissionNo),
|
|
|
|
admissionNo: int.parse(widget.patient.admissionNo),
|
|
|
|
cancelledNote: false,
|
|
|
|
createdBy: widget.operationReportViewModel.doctorProfile.doctorID,
|
|
|
|
lineItemNo: widget.note.lineItemNo,
|
|
|
|
setupID: SETUP_ID);
|
|
|
|
createdBy: widget.note.createdBy,
|
|
|
|
await widget.operationReportViewModel.updateOperationReport(
|
|
|
|
notes: progressNoteController.text,
|
|
|
|
createUpdateOperationReportRequestModel);
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// await widget.patientModel
|
|
|
|
if (widget.operationReportViewModel.state ==
|
|
|
|
// .createPatientProgressNote(reqModel);
|
|
|
|
ViewState.ErrorLocal) {
|
|
|
|
}
|
|
|
|
Helpers.showErrorToast(
|
|
|
|
|
|
|
|
widget.operationReportViewModel.error);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// await widget.operationReportViewModel.(
|
|
|
|
|
|
|
|
// operationReportsRequest.toJson());
|
|
|
|
|
|
|
|
|
|
|
|
if (widget.patientModel.state == ViewState.ErrorLocal) {
|
|
|
|
DrAppToastMsg.showSuccesToast(
|
|
|
|
Helpers.showErrorToast(widget.patientModel.error);
|
|
|
|
"Your Order added Successfully");
|
|
|
|
} else {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
ProgressNoteRequest progressNoteRequest =
|
|
|
|
}
|
|
|
|
ProgressNoteRequest(
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
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");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onVoiceText() async {
|
|
|
|
isFormValid() {
|
|
|
|
new SpeechToText(context: context).showAlertDialog(context);
|
|
|
|
if (preOpDiagmosisController.text != null &&
|
|
|
|
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
|
|
|
|
preOpDiagmosisController.text.isNotEmpty &&
|
|
|
|
bool available = await speech.initialize(
|
|
|
|
postOpDiagmosisNoteController.text != null &&
|
|
|
|
onStatus: statusListener, onError: errorListener);
|
|
|
|
postOpDiagmosisNoteController.text.isNotEmpty &&
|
|
|
|
if (available) {
|
|
|
|
surgeonController.text != null &&
|
|
|
|
speech.listen(
|
|
|
|
surgeonController.text.isNotEmpty &&
|
|
|
|
onResult: resultListener,
|
|
|
|
assistantNoteController.text != null &&
|
|
|
|
listenMode: stt.ListenMode.confirmation,
|
|
|
|
assistantNoteController.text.isNotEmpty &&
|
|
|
|
localeId: lang == 'en' ? 'en-US' : 'ar-SA',
|
|
|
|
operationController.text != null &&
|
|
|
|
);
|
|
|
|
operationController.text.isNotEmpty &&
|
|
|
|
|
|
|
|
inasionController.text != null &&
|
|
|
|
|
|
|
|
inasionController.text.isNotEmpty &&
|
|
|
|
|
|
|
|
findingController.text != null &&
|
|
|
|
|
|
|
|
findingController.text.isNotEmpty &&
|
|
|
|
|
|
|
|
surgeryProcedureController.text != null &&
|
|
|
|
|
|
|
|
surgeryProcedureController.text.isNotEmpty &&
|
|
|
|
|
|
|
|
postOpInstructionController.text != null &&
|
|
|
|
|
|
|
|
postOpInstructionController.text.isNotEmpty &&
|
|
|
|
|
|
|
|
complicationDetailsController.text != null &&
|
|
|
|
|
|
|
|
complicationDetailsController.text.isNotEmpty &&
|
|
|
|
|
|
|
|
bloodLossDetailController.text != null &&
|
|
|
|
|
|
|
|
bloodLossDetailController.text.isNotEmpty &&
|
|
|
|
|
|
|
|
histopathSpecimenController.text != null &&
|
|
|
|
|
|
|
|
histopathSpecimenController.text.isNotEmpty &&
|
|
|
|
|
|
|
|
microbiologySpecimenController.text != null &&
|
|
|
|
|
|
|
|
microbiologySpecimenController.text.isNotEmpty &&
|
|
|
|
|
|
|
|
otherSpecimenController.text != null &&
|
|
|
|
|
|
|
|
otherSpecimenController.text.isNotEmpty &&
|
|
|
|
|
|
|
|
scrubNurseController.text != null &&
|
|
|
|
|
|
|
|
scrubNurseController.text.isNotEmpty &&
|
|
|
|
|
|
|
|
circulatingNurseController.text != null &&
|
|
|
|
|
|
|
|
circulatingNurseController.text.isNotEmpty &&
|
|
|
|
|
|
|
|
BloodTransfusedDetailController.text != null &&
|
|
|
|
|
|
|
|
BloodTransfusedDetailController.text.isNotEmpty &&
|
|
|
|
|
|
|
|
anasthetistController.text != null &&
|
|
|
|
|
|
|
|
anasthetistController.text.isNotEmpty) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
print("The user has denied the use of speech recognition.");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void errorListener(SpeechRecognitionError error) {
|
|
|
|
|
|
|
|
event.setValue({"searchText": 'null'});
|
|
|
|
|
|
|
|
//SpeechToText.closeAlertDialog(context);
|
|
|
|
|
|
|
|
print(error);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void statusListener(String status) {
|
|
|
|
|
|
|
|
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void requestPermissions() async {
|
|
|
|
|
|
|
|
Map<Permission, PermissionStatus> statuses = await [
|
|
|
|
|
|
|
|
Permission.microphone,
|
|
|
|
|
|
|
|
].request();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void resultListener(result) {
|
|
|
|
|
|
|
|
reconizedWord = result.recognizedWords;
|
|
|
|
|
|
|
|
event.setValue({"searchText": reconizedWord});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (result.finalResult == true) {
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
SpeechToText.closeAlertDialog(context);
|
|
|
|
|
|
|
|
speech.stop();
|
|
|
|
|
|
|
|
progressNoteController.text += reconizedWord + '\n';
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
print(result.finalResult);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Future<void> initSpeechState() async {
|
|
|
|
|
|
|
|
bool hasSpeech = await speech.initialize(
|
|
|
|
|
|
|
|
onError: errorListener, onStatus: statusListener);
|
|
|
|
|
|
|
|
print(hasSpeech);
|
|
|
|
|
|
|
|
if (!mounted) return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|