Merge branch 'operation_details' into 'development'

Operation details

See merge request Cloud_Solution/doctor_app_flutter!869
merge-requests/871/merge
Mohammad Aljammal 5 years ago
commit e371d105c4

@ -345,8 +345,14 @@ const GET_MEDICATION_FOR_IN_PATIENT =
"Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient";
const GET_EPISODE_FOR_INPATIENT =
"/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient";
const GET_OPERATION_REPORT =
///Operation Details Services
const GET_RESERVATIONS =
"Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails";
const GET_OPERATION_DETAILS =
"Services/DoctorApplication.svc/REST/DoctorApp_GetOperationDetails";
const UPDATE_OPERATION_REPORT =
"Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport";

@ -1,27 +1,52 @@
import 'package:doctor_app_flutter/config/config.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_request_model.dart';
import 'package:doctor_app_flutter/models/operation_report/get_operation_details_request_modle.dart';
import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart';
import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart';
import 'package:doctor_app_flutter/models/operation_report/get_reservations_request_model.dart';
class OperationReportService extends BaseService {
List<GetOperationReportModel> _operationReportList = [];
List<GetOperationReportModel> get operationReportList => _operationReportList;
List<GetReservationsResponseModel> _reservationList = [];
List<GetReservationsResponseModel> get reservationList => _reservationList;
Future getOperationReport(
{GetOperationReportRequestModel getOperationReportRequestModel,
List<GetOperationDetailsResponseModel> _operationDetailsList = [];
List<GetOperationDetailsResponseModel> get operationDetailsList => _operationDetailsList;
Future getReservations(
{GetReservationsRequestModel getReservationsRequestModel,
int patientId}) async {
getOperationReportRequestModel =
GetOperationReportRequestModel(patientID: patientId, doctorID: "");
getReservationsRequestModel =
GetReservationsRequestModel(patientID: patientId, doctorID: "");
hasError = false;
await baseAppClient.post(GET_OPERATION_REPORT,
await baseAppClient.post(GET_RESERVATIONS,
onSuccess: (dynamic response, int statusCode) {
print("Success");
_operationReportList.clear();
_reservationList.clear();
response['List_OTReservationDetails'].forEach(
(v) {
_operationReportList.add(GetOperationReportModel.fromJson(v));
_reservationList.add(GetReservationsResponseModel.fromJson(v));
},
);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getReservationsRequestModel.toJson());
}
Future getOperationReportDetails(
{GetOperationDetailsRequestModel getOperationReportRequestModel,
}) async {
hasError = false;
await baseAppClient.post(GET_OPERATION_DETAILS,
onSuccess: (dynamic response, int statusCode) {
print("Success");
_operationDetailsList.clear();
response['List_OperationDetails'].forEach(
(v) {
_operationDetailsList.add(GetOperationDetailsResponseModel.fromJson(v));
},
);
}, onFailure: (String error, int statusCode) {

@ -3,20 +3,38 @@ 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/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_details_request_modle.dart';
import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart';
import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_model.dart';
class OperationReportViewModel extends BaseViewModel {
bool hasError = false;
OperationReportService _operationReportService =
locator<OperationReportService>();
List<GetOperationReportModel> get operationReportList =>
_operationReportService.operationReportList;
List<GetReservationsResponseModel> get reservationList =>
_operationReportService.reservationList;
Future getOperationReport(int patientId) async {
List<GetOperationDetailsResponseModel> get operationDetailsList =>
_operationReportService.operationDetailsList;
Future getReservations(int patientId) async {
hasError = false;
setState(ViewState.Busy);
await _operationReportService.getReservations(patientId: patientId);
if (_operationReportService.hasError) {
error = _operationReportService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
Future getOperationReportDetails(GetReservationsResponseModel reservation) async {
hasError = false;
setState(ViewState.Busy);
await _operationReportService.getOperationReport(patientId: patientId);
GetOperationDetailsRequestModel getOperationReportRequestModel = GetOperationDetailsRequestModel(reservationNo:reservation.oTReservationID, patientID: reservation.patientID, setupID: "010266" );
await _operationReportService.getOperationReportDetails(getOperationReportRequestModel:getOperationReportRequestModel);
if (_operationReportService.hasError) {
error = _operationReportService.error;
setState(ViewState.ErrorLocal);

@ -0,0 +1,68 @@
class GetOperationDetailsRequestModel {
bool isDentalAllowedBackend;
double versionID;
int channel;
int languageID;
String iPAdress;
String generalid;
int deviceTypeID;
String tokenID;
int patientID;
int reservationNo;
String sessionID;
int projectID;
String setupID;
bool patientOutSA;
GetOperationDetailsRequestModel(
{this.isDentalAllowedBackend = false,
this.versionID,
this.channel,
this.languageID,
this.iPAdress,
this.generalid,
this.deviceTypeID,
this.tokenID,
this.patientID,
this.reservationNo,
this.sessionID,
this.projectID,
this.setupID,
this.patientOutSA});
GetOperationDetailsRequestModel.fromJson(Map<String, dynamic> json) {
isDentalAllowedBackend = json['isDentalAllowedBackend'];
versionID = json['VersionID'];
channel = json['Channel'];
languageID = json['LanguageID'];
iPAdress = json['IPAdress'];
generalid = json['generalid'];
deviceTypeID = json['DeviceTypeID'];
tokenID = json['TokenID'];
patientID = json['PatientID'];
reservationNo = json['reservationNo'];
sessionID = json['SessionID'];
projectID = json['ProjectID'];
setupID = json['SetupID'];
patientOutSA = json['PatientOutSA'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid;
data['DeviceTypeID'] = this.deviceTypeID;
data['TokenID'] = this.tokenID;
data['PatientID'] = this.patientID;
data['reservationNo'] = this.reservationNo;
data['SessionID'] = this.sessionID;
data['ProjectID'] = this.projectID;
data['SetupID'] = this.setupID;
data['PatientOutSA'] = this.patientOutSA;
return data;
}
}

@ -0,0 +1,148 @@
class GetOperationDetailsResponseModel {
String setupID;
int projectID;
int reservationNo;
int patientID;
int admissionID;
dynamic surgeryDate;
String preOpDiagnosis;
String postOpDiagnosis;
String surgeon;
String assistant;
String anasthetist;
String operation;
String inasion;
String finding;
String surgeryProcedure;
String postOpInstruction;
bool isActive;
int createdBy;
String createdName;
dynamic createdNameN;
String createdOn;
dynamic editedBy;
dynamic editedByName;
dynamic editedByNameN;
dynamic editedOn;
dynamic oRBookStatus;
String complicationDetail;
String bloodLossDetail;
String histopathSpecimen;
String microbiologySpecimen;
String otherSpecimen;
dynamic scrubNurse;
dynamic circulatingNurse;
dynamic bloodTransfusedDetail;
GetOperationDetailsResponseModel(
{this.setupID,
this.projectID,
this.reservationNo,
this.patientID,
this.admissionID,
this.surgeryDate,
this.preOpDiagnosis,
this.postOpDiagnosis,
this.surgeon,
this.assistant,
this.anasthetist,
this.operation,
this.inasion,
this.finding,
this.surgeryProcedure,
this.postOpInstruction,
this.isActive,
this.createdBy,
this.createdName,
this.createdNameN,
this.createdOn,
this.editedBy,
this.editedByName,
this.editedByNameN,
this.editedOn,
this.oRBookStatus,
this.complicationDetail,
this.bloodLossDetail,
this.histopathSpecimen,
this.microbiologySpecimen,
this.otherSpecimen,
this.scrubNurse,
this.circulatingNurse,
this.bloodTransfusedDetail});
GetOperationDetailsResponseModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
reservationNo = json['ReservationNo'];
patientID = json['PatientID'];
admissionID = json['AdmissionID'];
surgeryDate = json['SurgeryDate'];
preOpDiagnosis = json['PreOpDiagnosis'];
postOpDiagnosis = json['PostOpDiagnosis'];
surgeon = json['Surgeon'];
assistant = json['Assistant'];
anasthetist = json['Anasthetist'];
operation = json['Operation'];
inasion = json['Inasion'];
finding = json['Finding'];
surgeryProcedure = json['SurgeryProcedure'];
postOpInstruction = json['PostOpInstruction'];
isActive = json['IsActive'];
createdBy = json['CreatedBy'];
createdName = json['CreatedName'];
createdNameN = json['CreatedNameN'];
createdOn = json['CreatedOn'];
editedBy = json['EditedBy'];
editedByName = json['EditedByName'];
editedByNameN = json['EditedByNameN'];
editedOn = json['EditedOn'];
oRBookStatus = json['ORBookStatus'];
complicationDetail = json['ComplicationDetail'];
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['ProjectID'] = this.projectID;
data['ReservationNo'] = this.reservationNo;
data['PatientID'] = this.patientID;
data['AdmissionID'] = this.admissionID;
data['SurgeryDate'] = this.surgeryDate;
data['PreOpDiagnosis'] = this.preOpDiagnosis;
data['PostOpDiagnosis'] = this.postOpDiagnosis;
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['IsActive'] = this.isActive;
data['CreatedBy'] = this.createdBy;
data['CreatedName'] = this.createdName;
data['CreatedNameN'] = this.createdNameN;
data['CreatedOn'] = this.createdOn;
data['EditedBy'] = this.editedBy;
data['EditedByName'] = this.editedByName;
data['EditedByNameN'] = this.editedByNameN;
data['EditedOn'] = this.editedOn;
data['ORBookStatus'] = this.oRBookStatus;
data['ComplicationDetail'] = this.complicationDetail;
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;
}
}

@ -1,4 +1,4 @@
class GetOperationReportRequestModel {
class GetReservationsRequestModel {
int patientID;
int projectID;
String doctorID;
@ -13,7 +13,7 @@ class GetOperationReportRequestModel {
String tokenID;
String sessionID;
GetOperationReportRequestModel(
GetReservationsRequestModel(
{this.patientID,
this.projectID,
this.doctorID,
@ -28,7 +28,7 @@ class GetOperationReportRequestModel {
this.tokenID,
this.sessionID});
GetOperationReportRequestModel.fromJson(Map<String, dynamic> json) {
GetReservationsRequestModel.fromJson(Map<String, dynamic> json) {
patientID = json['PatientID'];
projectID = json['ProjectID'];
doctorID = json['DoctorID'];

@ -1,4 +1,4 @@
class GetOperationReportModel {
class GetReservationsResponseModel {
String setupID;
int projectID;
int oTReservationID;
@ -35,7 +35,7 @@ class GetOperationReportModel {
String clinicDescription;
Null clinicDescriptionN;
GetOperationReportModel(
GetReservationsResponseModel(
{this.setupID,
this.projectID,
this.oTReservationID,
@ -72,7 +72,7 @@ class GetOperationReportModel {
this.clinicDescription,
this.clinicDescriptionN});
GetOperationReportModel.fromJson(Map<String, dynamic> json) {
GetReservationsResponseModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
oTReservationID = json['OTReservationID'];

@ -55,7 +55,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
if (routeArgs.containsKey('isDischargedPatient'))
isDischargedPatient = routeArgs['isDischargedPatient'];
return BaseView<OperationReportViewModel>(
onModelReady: (model) => model.getOperationReport(patient.patientMRN),
onModelReady: (model) => model.getReservations(patient.patientMRN),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
@ -68,14 +68,14 @@ class _ProgressNoteState extends State<OperationReportScreen> {
color: Colors.grey[200],
child: Column(
children: <Widget>[
model.operationReportList == null ||
model.operationReportList.length == 0
model.reservationList == null ||
model.reservationList.length == 0
? DrAppEmbeddedError(
error: TranslationBase.of(context).errorNoProgressNote)
: Expanded(
child: Container(
child: ListView.builder(
itemCount: model.operationReportList.length,
itemCount: model.reservationList.length,
itemBuilder: (BuildContext ctxt, int index) {
return FractionallySizedBox(
widthFactor: 0.95,
@ -119,7 +119,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
Expanded(
child: AppText(
model
.operationReportList[
.reservationList[
index]
.doctorName ??
'',
@ -137,14 +137,14 @@ class _ProgressNoteState extends State<OperationReportScreen> {
children: [
AppText(
model
.operationReportList[
.reservationList[
index]
.createdOn !=
null
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils
.getDateTimeFromServerFormat(model
.operationReportList[
.reservationList[
index]
.createdOn),
isArabic:
@ -162,14 +162,14 @@ class _ProgressNoteState extends State<OperationReportScreen> {
),
AppText(
model
.operationReportList[
.reservationList[
index]
.createdOn !=
null
? AppDateUtils.getHour(
AppDateUtils
.getDateTimeFromServerFormat(model
.operationReportList[
.reservationList[
index]
.createdOn))
: AppDateUtils.getHour(
@ -186,7 +186,25 @@ class _ProgressNoteState extends State<OperationReportScreen> {
SizedBox(
height: 8,
),
if (model.operationReportList[index]
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
AppText(
"Reservation: ",
fontSize: 10,
),
Expanded(
child: AppText(
model.reservationList[index].oTReservationID.toString(),
fontSize: 10,
),
)
]),
SizedBox(
height: 8,
),
if (model.reservationList[index]
.operationDate !=
null)
Row(
@ -202,7 +220,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils
.getDateTimeFromServerFormat(model
.operationReportList[
.reservationList[
index]
.operationDate),
isArabic:
@ -213,7 +231,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
),
)
]),
if (model.operationReportList[index]
if (model.reservationList[index]
.timeStart !=
null)
Row(
@ -227,14 +245,14 @@ class _ProgressNoteState extends State<OperationReportScreen> {
Expanded(
child: AppText(
model
.operationReportList[
.reservationList[
index]
.timeStart,
fontSize: 10,
),
)
]),
if (model.operationReportList[index]
if (model.reservationList[index]
.remarks !=
null)
Row(
@ -248,7 +266,7 @@ class _ProgressNoteState extends State<OperationReportScreen> {
Expanded(
child: AppText(
model
.operationReportList[
.reservationList[
index]
.remarks ??
'',
@ -290,11 +308,9 @@ class _ProgressNoteState extends State<OperationReportScreen> {
MaterialPageRoute(
builder: (context) =>
UpdateOperationReport(
operationReport: model
.operationReportList[
reservation: model
.reservationList[
index],
operationReportViewModel:
model,
patient: patient,
isUpdate: true,
)),

@ -12,9 +12,11 @@ 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/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/operation_report/get_operation_report_model.dart';
import 'package:doctor_app_flutter/models/operation_report/get_operation_details_response_modle.dart';
import 'package:doctor_app_flutter/models/operation_report/get_reservations_response_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/screens/base/base_view.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/helpers.dart';
@ -31,19 +33,19 @@ import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
class UpdateOperationReport extends StatefulWidget {
final GetOperationReportModel operationReport;
final OperationReportViewModel operationReportViewModel;
final GetReservationsResponseModel reservation;
// final OperationReportViewModel operationReportViewModel;
final PatiantInformtion patient;
final int visitType;
final bool isUpdate;
const UpdateOperationReport(
{Key key,
this.operationReportViewModel,
// this.operationReportViewModel,
this.patient,
this.visitType,
this.isUpdate,
this.operationReport})
this.reservation})
: super(key: key);
@override
@ -94,17 +96,46 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
if(widget.isUpdate)
OTReservationID.text = widget.operationReport.oTReservationID.toString();
//TODO Elham* add translation to hints
return AppScaffold(
return BaseView<OperationReportViewModel>(
onModelReady: (model) async {
await model
.getOperationReportDetails(widget.reservation);
OTReservationID.text = widget.reservation.oTReservationID.toString();
if (model.operationDetailsList.isNotEmpty) {
GetOperationDetailsResponseModel oldDetails =
model.operationDetailsList[0];
postOpDiagmosisNoteController.text = oldDetails.postOpInstruction;
preOpDiagmosisController.text = oldDetails.preOpDiagnosis;
surgeonController.text = oldDetails.surgeon;
assistantNoteController.text = oldDetails.assistant;
operationController.text = oldDetails.operation;
inasionController.text = oldDetails.inasion;
findingController.text = oldDetails.finding;
surgeryProcedureController.text = oldDetails.surgeryProcedure;
postOpInstructionController.text = oldDetails.postOpInstruction;
complicationDetailsController.text = oldDetails.complicationDetail;
bloodLossDetailController.text = oldDetails.bloodLossDetail;
histopathSpecimenController.text = oldDetails.histopathSpecimen;
microbiologySpecimenController.text =
oldDetails.microbiologySpecimen;
otherSpecimenController.text = oldDetails.otherSpecimen;
scrubNurseController.text = oldDetails.scrubNurse;
circulatingNurseController.text = oldDetails.circulatingNurse;
BloodTransfusedDetailController.text =
oldDetails.bloodTransfusedDetail;
anasthetistController.text = oldDetails.anasthetist;
}
},
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
baseViewModel: model,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: BottomSheetTitle(
title: (widget.isUpdate
? TranslationBase.of(context).noteUpdate
: TranslationBase.of(context).noteAdd) +
TranslationBase.of(context).operationReports,
title: TranslationBase.of(context).operationReports,
),
body: SingleChildScrollView(
child: Container(
@ -145,10 +176,11 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
preOpDiagmosisController.text.isEmpty &&
validationError: preOpDiagmosisController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
@ -164,9 +196,11 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true,
validationError:
postOpDiagmosisNoteController.text.isEmpty &&
postOpDiagmosisNoteController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
@ -182,8 +216,10 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true,
validationError:
surgeonController.text.isEmpty && isSubmitted
? TranslationBase.of(context).emptyMessage
surgeonController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
@ -198,10 +234,11 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
assistantNoteController.text.isEmpty &&
validationError: assistantNoteController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
@ -219,7 +256,8 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
validationError:
operationController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
@ -235,8 +273,10 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true,
validationError:
inasionController.text.isEmpty && isSubmitted
? TranslationBase.of(context).emptyMessage
inasionController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
@ -252,8 +292,10 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true,
validationError:
findingController.text.isEmpty && isSubmitted
? TranslationBase.of(context).emptyMessage
findingController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
@ -269,9 +311,11 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true,
validationError:
surgeryProcedureController.text.isEmpty &&
surgeryProcedureController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
@ -287,9 +331,11 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true,
validationError:
postOpInstructionController.text.isEmpty &&
postOpInstructionController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
@ -305,9 +351,11 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true,
validationError:
complicationDetailsController.text.isEmpty &&
complicationDetailsController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
@ -322,10 +370,11 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
bloodLossDetailController.text.isEmpty &&
validationError: bloodLossDetailController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
@ -341,9 +390,11 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true,
validationError:
histopathSpecimenController.text.isEmpty &&
histopathSpecimenController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
@ -352,16 +403,19 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
AppTextFieldCustom(
hintText: "microbiology Specimen ",
//TranslationBase.of(context).addoperationReports,
controller: microbiologySpecimenController,
controller:
microbiologySpecimenController,
maxLines: 1,
minLines: 1,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
microbiologySpecimenController.text.isEmpty &&
microbiologySpecimenController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
@ -376,10 +430,11 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError:
otherSpecimenController.text.isEmpty &&
validationError: otherSpecimenController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
@ -397,7 +452,8 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
validationError:
scrubNurseController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
@ -413,9 +469,11 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
// isTextFieldHasSuffix: true,
validationError:
circulatingNurseController.text.isEmpty &&
circulatingNurseController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
@ -424,16 +482,19 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
AppTextFieldCustom(
hintText: "Blood Transfused Detail",
//TranslationBase.of(context).addoperationReports,
controller: BloodTransfusedDetailController,
controller:
BloodTransfusedDetailController,
maxLines: 1,
minLines: 1,
hasBorder: true,
// isTextFieldHasSuffix: true,
validationError: BloodTransfusedDetailController
validationError:
BloodTransfusedDetailController
.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
@ -451,7 +512,8 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
validationError:
anasthetistController.text.isEmpty &&
isSubmitted
? TranslationBase.of(context).emptyMessage
? TranslationBase.of(context)
.emptyMessage
: null,
),
SizedBox(
@ -468,7 +530,7 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
),
),
),
bottomSheet: Container(
bottomSheet: model.state != ViewState.Idle?Container(height: 0,): Container(
height: 70,
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Column(
@ -489,7 +551,8 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
});
if (isFormValid()) {
GifLoaderDialogUtils.showMyDialog(context);
await widget.operationReportViewModel.getDoctorProfile();
await model
.getDoctorProfile();
CreateUpdateOperationReportRequestModel
createUpdateOperationReportRequestModel =
@ -497,41 +560,50 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
inasion: inasionController.text,
/// TODO Elham* Add dynamic reservation
reservationNo:widget.operationReport.oTReservationID ,
preOpDiagmosis: preOpDiagmosisController.text,
postOpDiagmosis: postOpDiagmosisNoteController.text,
reservationNo:
widget.reservation.oTReservationID,
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,
postOpInstruction:
postOpInstructionController.text,
complicationDetails:
complicationDetailsController.text,
bloodLossDetail: bloodLossDetailController.text,
histopathSpecimen: histopathSpecimenController.text,
bloodLossDetail:
bloodLossDetailController.text,
histopathSpecimen:
histopathSpecimenController.text,
microbiologySpecimen:
microbiologySpecimenController.text,
otherSpecimen: otherSpecimenController.text,
scrubNurse: surgeonController.text,
circulatingNurse: circulatingNurseController.text,
circulatingNurse:
circulatingNurseController.text,
bloodTransfusedDetail:
bloodLossDetailController.text,
patientID: widget.patient.patientId,
admissionNo: int.parse(widget.patient.admissionNo),
createdBy: widget.operationReportViewModel
admissionNo:
int.parse(widget.patient.admissionNo),
createdBy: model
.doctorProfile.doctorID,
setupID: SETUP_ID);
await widget.operationReportViewModel.updateOperationReport(
setupID: "010266");
await model
.updateOperationReport(
createUpdateOperationReportRequestModel);
if (widget.operationReportViewModel.state ==
if (model.state ==
ViewState.ErrorLocal) {
Helpers.showErrorToast(
widget.operationReportViewModel.error);
model.error);
} else {
// await widget.operationReportViewModel.(
// await model.(
// operationReportsRequest.toJson());
DrAppToastMsg.showSuccesToast(
@ -546,7 +618,7 @@ class _UpdateOperationReportState extends State<UpdateOperationReport> {
],
),
),
);
));
}
isFormValid() {

Loading…
Cancel
Save