Merge branch 'get_operation_report' into 'development'

Get operation report

See merge request Cloud_Solution/doctor_app_flutter!862
merge-requests/863/merge
Mohammad Aljammal 3 years ago
commit 52e5b86f6c

@ -347,6 +347,8 @@ const GET_EPISODE_FOR_INPATIENT =
"/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient";
const GET_OPERATION_REPORT = const GET_OPERATION_REPORT =
"/Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; "/Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails";
const UPDATE_OPERATION_REPORT =
"Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport";
const NURSING_PROGRESS_NOTE = const NURSING_PROGRESS_NOTE =
"Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote"; "Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote";

@ -709,5 +709,6 @@ const Map<String, Map<String, String>> localizedValues = {
"en":"Request Type", "en":"Request Type",
"ar":"نوع الطلب"}, "ar":"نوع الطلب"},
"special": {"en": "Special", "ar": "خاص"}, "special": {"en": "Special", "ar": "خاص"},
"allClinic": {"en": "All Clinics", "ar": "جميع العيادات"} "allClinic": {"en": "All Clinics", "ar": "جميع العيادات"} ,
"operationReports": {"en": "Operation Reports", "ar": "تقارير العملية"}
}; };

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart';
import 'package:doctor_app_flutter/models/operation_report/get_operation_report_model.dart'; import 'package:doctor_app_flutter/models/operation_report/get_operation_report_model.dart';
import 'package:doctor_app_flutter/models/operation_report/get_operation_report_request_model.dart'; import 'package:doctor_app_flutter/models/operation_report/get_operation_report_request_model.dart';
@ -28,4 +29,14 @@ class OperationReportService extends BaseService {
super.error = error; super.error = error;
}, body: getOperationReportRequestModel.toJson()); }, body: getOperationReportRequestModel.toJson());
} }
Future updateOperationReport(CreateUpdateOperationReportRequestModel createUpdateOperationReport) async {
await baseAppClient.post(UPDATE_OPERATION_REPORT,
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: createUpdateOperationReport.toJson(),isFallLanguage: true);
}
} }

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/operation_report_servive.dart'; import 'package:doctor_app_flutter/core/service/operation_report_servive.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/operation_report/create_update_operation_report_request_model.dart';
import 'package:doctor_app_flutter/models/operation_report/get_operation_report_model.dart'; import 'package:doctor_app_flutter/models/operation_report/get_operation_report_model.dart';
class OperationReportViewModel extends BaseViewModel { class OperationReportViewModel extends BaseViewModel {
@ -23,4 +24,18 @@ class OperationReportViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future updateOperationReport(
CreateUpdateOperationReportRequestModel
createUpdateOperationReport) async {
setState(ViewState.BusyLocal);
await _operationReportService.updateOperationReport(createUpdateOperationReport);
if (_operationReportService.hasError) {
error = _operationReportService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
} }

@ -0,0 +1,108 @@
class CreateUpdateOperationReportRequestModel {
String setupID;
int patientID;
int reservationNo;
int admissionNo;
String preOpDiagmosis;
String postOpDiagmosis;
String surgeon;
String assistant;
String anasthetist;
String operation;
String inasion;
String finding;
String surgeryProcedure;
String postOpInstruction;
int createdBy;
int editedBy;
String complicationDetails;
String bloodLossDetail;
String histopathSpecimen;
String microbiologySpecimen;
String otherSpecimen;
String scrubNurse;
String circulatingNurse;
String bloodTransfusedDetail;
CreateUpdateOperationReportRequestModel(
{this.setupID,
this.patientID,
this.reservationNo,
this.admissionNo,
this.preOpDiagmosis,
this.postOpDiagmosis,
this.surgeon,
this.assistant,
this.anasthetist,
this.operation,
this.inasion,
this.finding,
this.surgeryProcedure,
this.postOpInstruction,
this.createdBy,
this.editedBy,
this.complicationDetails,
this.bloodLossDetail,
this.histopathSpecimen,
this.microbiologySpecimen,
this.otherSpecimen,
this.scrubNurse,
this.circulatingNurse,
this.bloodTransfusedDetail});
CreateUpdateOperationReportRequestModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
patientID = json['PatientID'];
reservationNo = json['reservationNo'];
admissionNo = json['AdmissionNo'];
preOpDiagmosis = json['preOpDiagmosis'];
postOpDiagmosis = json['postOpDiagmosis'];
surgeon = json['surgeon'];
assistant = json['assistant'];
anasthetist = json['anasthetist'];
operation = json['operation'];
inasion = json['inasion'];
finding = json['finding'];
surgeryProcedure = json['surgeryProcedure'];
postOpInstruction = json['postOpInstruction'];
createdBy = json['CreatedBy'];
editedBy = json['EditedBy'];
complicationDetails = json['complicationDetails'];
bloodLossDetail = json['bloodLossDetail'];
histopathSpecimen = json['histopathSpecimen'];
microbiologySpecimen = json['microbiologySpecimen'];
otherSpecimen = json['otherSpecimen'];
scrubNurse = json['scrubNurse'];
circulatingNurse = json['circulatingNurse'];
bloodTransfusedDetail = json['BloodTransfusedDetail'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['PatientID'] = this.patientID;
data['reservationNo'] = this.reservationNo;
data['AdmissionNo'] = this.admissionNo;
data['preOpDiagmosis'] = this.preOpDiagmosis;
data['postOpDiagmosis'] = this.postOpDiagmosis;
data['surgeon'] = this.surgeon;
data['assistant'] = this.assistant;
data['anasthetist'] = this.anasthetist;
data['operation'] = this.operation;
data['inasion'] = this.inasion;
data['finding'] = this.finding;
data['surgeryProcedure'] = this.surgeryProcedure;
data['postOpInstruction'] = this.postOpInstruction;
data['CreatedBy'] = this.createdBy;
data['EditedBy'] = this.editedBy;
data['complicationDetails'] = this.complicationDetails;
data['bloodLossDetail'] = this.bloodLossDetail;
data['histopathSpecimen'] = this.histopathSpecimen;
data['microbiologySpecimen'] = this.microbiologySpecimen;
data['otherSpecimen'] = this.otherSpecimen;
data['scrubNurse'] = this.scrubNurse;
data['circulatingNurse'] = this.circulatingNurse;
data['BloodTransfusedDetail'] = this.bloodTransfusedDetail;
return data;
}
}

@ -89,15 +89,11 @@ class _ProgressNoteState extends State<OperationReportScreen> {
patient, patient,
isInpatient: true, isInpatient: true,
), ),
body: model.operationReportList == null || body:
model.operationReportList.length == 0 Container(
? DrAppEmbeddedError(
error: TranslationBase.of(context).errorNoProgressNote)
: Container(
color: Colors.grey[200], color: Colors.grey[200],
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
if (!isDischargedPatient)
AddNewOrder( AddNewOrder(
onTap: () async { onTap: () async {
await locator<AnalyticsService>().logEvent( await locator<AnalyticsService>().logEvent(
@ -107,8 +103,8 @@ class _ProgressNoteState extends State<OperationReportScreen> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => UpdateOperatiomReport( builder: (context) => UpdateOperationReport(
patientModel: model, operationReportViewModel: model,
patient: patient, patient: patient,
visitType: widget.visitType, visitType: widget.visitType,
isUpdate: false, isUpdate: false,
@ -117,11 +113,12 @@ class _ProgressNoteState extends State<OperationReportScreen> {
), ),
); );
}, },
label: widget.visitType == 3 label: TranslationBase.of(context).operationReports,
? TranslationBase.of(context).addNewOrderSheet
: TranslationBase.of(context).addProgressNote,
), ),
Expanded( model.operationReportList == null ||
model.operationReportList.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).errorNoProgressNote):Expanded(
child: Container( child: Container(
child: ListView.builder( child: ListView.builder(
itemCount: model.operationReportList.length, itemCount: model.operationReportList.length,
@ -557,97 +554,4 @@ class _ProgressNoteState extends State<OperationReportScreen> {
), ),
); );
} }
showMyDialog({BuildContext context, Function confirmFun, String actionName}) {
showDialog(
context: context,
builder: (ctx) => Center(
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
height: 200,
child: AppScaffold(
isShowAppBar: false,
body: Container(
color: Colors.white,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// SizedBox(height: 20,),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
TranslationBase.of(context).noteConfirm,
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
),
],
),
SizedBox(
height: 10,
),
DividerWithSpacesAround(),
SizedBox(
height: 12,
),
Container(
padding: EdgeInsets.all(20),
color: Colors.white,
child: AppText(
projectViewModel.isArabic
? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟"
: 'Are you sure you want $actionName this order?',
fontSize: 15,
textAlign: TextAlign.center,
),
),
SizedBox(
height: 8,
),
DividerWithSpacesAround(),
FractionallySizedBox(
widthFactor: 0.75,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
FlatButton(
child: AppText(
TranslationBase.of(context).cancel,
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
), //Text("Cancel"),
onPressed: () {
Navigator.of(context).pop();
}),
FlatButton(
child: AppText(
TranslationBase.of(context).noteConfirm,
fontWeight: FontWeight.w600,
color: Colors.red.shade700,
fontSize: 16,
), //Text("Confirm", ),
onPressed: () async {
await confirmFun();
Navigator.of(context).pop();
})
],
),
)
],
),
),
),
),
),
));
}
} }

@ -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;
}
} }

@ -212,6 +212,7 @@ class TranslationBase {
String get replay => localizedValues['replay'][locale.languageCode]; String get replay => localizedValues['replay'][locale.languageCode];
String get progressNote => localizedValues['progressNote'][locale.languageCode]; String get progressNote => localizedValues['progressNote'][locale.languageCode];
String get operationReports => localizedValues['operationReports'][locale.languageCode];
String get progress => localizedValues['progress'][locale.languageCode]; String get progress => localizedValues['progress'][locale.languageCode];

Loading…
Cancel
Save