From 93bcfff7a0b5527331e133b1c3d1847d2254ea49 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Tue, 26 Oct 2021 15:26:10 +0300 Subject: [PATCH] fix doctors name --- lib/config/config.dart | 2 +- ...GetDiagnosisForInPatientResponseModel.dart | 6 +- .../GetNursingProgressNoteResposeModel.dart | 18 +- .../service/operation_report_servive.dart | 5 +- lib/routes.dart | 2 + .../profile/diagnosis/diagnosis_screen.dart | 2 +- .../nursing_note/nursing_note_screen.dart | 2 +- .../operation_report/operation_report.dart | 455 ++++++------------ .../update_operation_report.dart | 30 +- 9 files changed, 192 insertions(+), 330 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index fd14ecc6..078cfdc0 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -346,7 +346,7 @@ const GET_MEDICATION_FOR_IN_PATIENT = const GET_EPISODE_FOR_INPATIENT = "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; 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"; diff --git a/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart b/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart index c4a4e528..1ec48964 100644 --- a/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart +++ b/lib/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart @@ -8,6 +8,8 @@ class GetDiagnosisForInPatientResponseModel { String createdOn; int editedBy; String editedOn; + String createdByName; + String editedByName; GetDiagnosisForInPatientResponseModel( {this.iCDCode10ID, @@ -18,7 +20,7 @@ class GetDiagnosisForInPatientResponseModel { this.createdBy, this.createdOn, this.editedBy, - this.editedOn}); + this.editedOn, this.createdByName}); GetDiagnosisForInPatientResponseModel.fromJson(Map json) { iCDCode10ID = json['ICDCode10ID']; @@ -30,6 +32,8 @@ class GetDiagnosisForInPatientResponseModel { createdOn = json['CreatedOn']; editedBy = json['EditedBy']; editedOn = json['EditedOn']; + createdByName = json['CreatedByName']; + editedByName = json['EditedByName']; } Map toJson() { diff --git a/lib/core/model/note/GetNursingProgressNoteResposeModel.dart b/lib/core/model/note/GetNursingProgressNoteResposeModel.dart index 55ede866..fb7fbcec 100644 --- a/lib/core/model/note/GetNursingProgressNoteResposeModel.dart +++ b/lib/core/model/note/GetNursingProgressNoteResposeModel.dart @@ -6,13 +6,19 @@ class GetNursingProgressNoteResposeModel { dynamic editedBy; dynamic editedOn; + String createdByName; + + String editedByName; + GetNursingProgressNoteResposeModel( {this.notes, - this.conditionType, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn}); + this.conditionType, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.editedByName, + this.createdByName}); GetNursingProgressNoteResposeModel.fromJson(Map json) { notes = json['Notes']; @@ -21,6 +27,8 @@ class GetNursingProgressNoteResposeModel { createdOn = json['CreatedOn']; editedBy = json['EditedBy']; editedOn = json['EditedOn']; + createdByName = json['CreatedByName']; + editedByName = json['EditedByName']; } Map toJson() { diff --git a/lib/core/service/operation_report_servive.dart b/lib/core/service/operation_report_servive.dart index 4eb7ad8d..16a6ccec 100644 --- a/lib/core/service/operation_report_servive.dart +++ b/lib/core/service/operation_report_servive.dart @@ -5,14 +5,15 @@ import 'package:doctor_app_flutter/models/operation_report/get_operation_report_ import 'package:doctor_app_flutter/models/operation_report/get_operation_report_request_model.dart'; class OperationReportService extends BaseService { - List get _operationReportList => List(); + + List _operationReportList = []; List get operationReportList => _operationReportList; Future getOperationReport( {GetOperationReportRequestModel getOperationReportRequestModel, int patientId}) async { getOperationReportRequestModel = - GetOperationReportRequestModel(patientID: patientId); + GetOperationReportRequestModel(patientID: patientId, doctorID: ""); hasError = false; await baseAppClient.post(GET_OPERATION_REPORT, diff --git a/lib/routes.dart b/lib/routes.dart index 4e6cd2e2..da56ce33 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -124,6 +124,8 @@ var routes = { ALL_SPECIAL_LAB_RESULT: (_) => AllLabSpecialResult(), GET_OPERATION_REPORT: (_) => OperationReportScreen(), PENDING_ORDERS: (_) => PendingOrdersScreen(), + NURSING_PROGRESS_NOTE: (_) => NursingProgressNoteScreen(), + DIAGNOSIS_FOR_IN_PATIENT: (_) => DiagnosisScreen(), ADMISSION_ORDERS: (_) => AdmissionOrdersScreen(), DIABETIC_CHART_VALUES: (_) => DiabeticChart(), }; diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index 2abc55ea..65e483b5 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -133,7 +133,7 @@ class _ProgressNoteState extends State { model .diagnosisForInPatientList[ index] - .createdBy + .createdByName .toString() ?? '', fontWeight: diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart index d683bab4..0fbac8bf 100644 --- a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -135,7 +135,7 @@ class _ProgressNoteState extends State { model .patientNursingProgressNoteList[ index] - .createdBy + .createdByName .toString() ?? '', fontWeight: diff --git a/lib/screens/patients/profile/operation_report/operation_report.dart b/lib/screens/patients/profile/operation_report/operation_report.dart index 5e41092d..e02bb191 100644 --- a/lib/screens/patients/profile/operation_report/operation_report.dart +++ b/lib/screens/patients/profile/operation_report/operation_report.dart @@ -46,37 +46,12 @@ class _ProgressNoteState extends State { AuthenticationViewModel authenticationViewModel; ProjectViewModel projectViewModel; - getProgressNoteList(BuildContext context, PatientViewModel model, - {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String token = await sharedPref.getString(TOKEN); - String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); - - print(type); - ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( - visitType: widget.visitType, - // if equal 5 then this will return progress note - admissionNo: int.parse(patient.admissionNo), - projectID: patient.projectId, - tokenID: token, - patientTypeID: patient.patientType, - languageID: 2); - model - .getPatientProgressNote(progressNoteRequest.toJson(), - isLocalBusy: isLocalBusy) - .then((c) { - notesList = model.patientProgressNoteList; - }); - } - @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - String arrivalType = routeArgs['arrivalType']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( @@ -133,283 +108,9 @@ class _ProgressNoteState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, children: [ - if (model.operationReportList[index] - .status == - 1 && - authenticationViewModel - .doctorProfile.doctorID != - model - .operationReportList[ - index] - .createdBy) - AppText( - TranslationBase.of(context) - .notePending, - fontWeight: FontWeight.bold, - color: Color(0xFFCC9B14), - fontSize: 12, - ), - if (model.operationReportList[index] - .status == - 4) - AppText( - TranslationBase.of(context) - .noteCanceled, - fontWeight: FontWeight.bold, - color: Colors.red.shade700, - fontSize: 12, - ), - if (model.operationReportList[index] - .status == - 2) - AppText( - TranslationBase.of(context) - .noteVerified, - fontWeight: FontWeight.bold, - color: Colors.green[600], - fontSize: 12, - ), - if (model.operationReportList[index] - .status != - 2 && - model.operationReportList[index] - .status != - 4 && - authenticationViewModel - .doctorProfile.doctorID == - model - .operationReportList[ - index] - .createdBy) - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - InkWell( - // onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // UpdateNoteOrder( - // note: model - // .operationReportList[ - // index], - // patientModel: - // model, - // patient: - // patient, - // visitType: widget - // .visitType, - // isUpdate: true, - // )), - // ); - // }, - child: Container( - decoration: BoxDecoration( - color: Colors.grey[600], - borderRadius: - BorderRadius.circular( - 10), - ), - // color:Colors.red[600], - - child: Row( - children: [ - Icon( - DoctorApp.edit_1, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - TranslationBase.of( - context) - .update, - fontSize: 10, - color: Colors.white, - ), - ], - ), - padding: EdgeInsets.all(6), - ), - ), - SizedBox( - width: 10, - ), - // InkWell( - // onTap: () async { - // showMyDialog( - // context: context, - // actionName: "verify", - // confirmFun: () async { - // GifLoaderDialogUtils - // .showMyDialog( - // context); - // UpdateNoteReqModel - // reqModel = - // UpdateNoteReqModel( - // admissionNo: int - // .parse(patient - // .admissionNo), - // cancelledNote: - // false, - // lineItemNo: model - // .patientProgressNoteList[ - // index] - // .lineItemNo, - // createdBy: model - // .patientProgressNoteList[ - // index] - // .createdBy, - // notes: model - // .patientProgressNoteList[ - // index] - // .notes, - // verifiedNote: true, - // patientTypeID: - // patient - // .patientType, - // patientOutSA: false, - // ); - // await model - // .updatePatientProgressNote( - // reqModel); - // await getProgressNoteList( - // context, model, - // isLocalBusy: - // true); - // GifLoaderDialogUtils - // .hideDialog( - // context); - // }); - // }, - // child: Container( - // decoration: BoxDecoration( - // color: Colors.green[600], - // borderRadius: - // BorderRadius.circular( - // 10), - // ), - // // color:Colors.red[600], - // - // child: Row( - // children: [ - // Icon( - // FontAwesomeIcons - // .check, - // size: 12, - // color: Colors.white, - // ), - // SizedBox( - // width: 2, - // ), - // AppText( - // TranslationBase.of( - // context) - // .noteVerify, - // fontSize: 10, - // color: Colors.white, - // ), - // ], - // ), - // padding: EdgeInsets.all(6), - // ), - // ), - SizedBox( - width: 10, - ), - // InkWell( - // onTap: () async { - // showMyDialog( - // context: context, - // actionName: - // TranslationBase.of( - // context) - // .cancel, - // confirmFun: () async { - // GifLoaderDialogUtils - // .showMyDialog( - // context, - // ); - // UpdateNoteReqModel - // reqModel = - // UpdateNoteReqModel( - // admissionNo: int - // .parse(patient - // .admissionNo), - // cancelledNote: true, - // lineItemNo: model - // .patientProgressNoteList[ - // index] - // .lineItemNo, - // createdBy: model - // .patientProgressNoteList[ - // index] - // .createdBy, - // notes: model - // .patientProgressNoteList[ - // index] - // .notes, - // verifiedNote: false, - // patientTypeID: - // patient - // .patientType, - // patientOutSA: false, - // ); - // await model - // .updatePatientProgressNote( - // reqModel); - // await getProgressNoteList( - // context, model, - // isLocalBusy: - // true); - // GifLoaderDialogUtils - // .hideDialog( - // context); - // }); - // }, - // child: Container( - // decoration: BoxDecoration( - // color: Colors.red[600], - // borderRadius: - // BorderRadius.circular( - // 10), - // ), - // // color:Colors.red[600], - // - // child: Row( - // children: [ - // Icon( - // FontAwesomeIcons - // .trash, - // size: 12, - // color: Colors.white, - // ), - // SizedBox( - // width: 2, - // ), - // AppText( - // 'Cancel', - // fontSize: 10, - // color: Colors.white, - // ), - // ], - // ), - // padding: EdgeInsets.all(6), - // ), - // ), - SizedBox( - width: 10, - ) - ], - ), - SizedBox( - height: 10, - ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -506,25 +207,153 @@ class _ProgressNoteState extends State { SizedBox( height: 8, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - child: AppText( - model - .operationReportList[ - index] - .remarks, + if (model.operationReportList[index] + .operationDate != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Operation Date : ", fontSize: 10, ), - ), - ]) + Expanded( + child: AppText( + AppDateUtils.getDayMonthYearDateFormatted( + AppDateUtils + .getDateTimeFromServerFormat(model + .operationReportList[ + index] + .operationDate), + isArabic: + projectViewModel + .isArabic, + isMonthShort: true), + fontSize: 10, + ), + ) + ]), + + if (model.operationReportList[index] + .timeStart != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Operation Time Start : ", + fontSize: 10, + ), + Expanded( + child: AppText( + model.operationReportList[index] + .timeStart, + fontSize: 10, + ), + ) + ]), + if (model.operationReportList[index] + .remarks != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Remarks : ", + fontSize: 10, + ), + Expanded( + child: AppText( + model + .operationReportList[ + index] + .remarks ?? + '', + fontSize: 10, + ), + ), + ]) ], ), + SizedBox( height: 20, ), + + // if ( + // authenticationViewModel + // .doctorProfile.doctorID == + // model + // .operationReportList[ + // index] + // .createdBy) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + UpdateOperationReport( + operationReport: model + .operationReportList[ + index], + operationReportViewModel: + model, + patient: patient, + isUpdate: true, + )), + ); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.green[600], + borderRadius: + BorderRadius.circular(10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + DoctorApp.edit_1, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + TranslationBase.of(context) + .update, + fontSize: 10, + color: Colors.white, + ), + ], + ), + padding: EdgeInsets.all(6), + ), + ), + SizedBox( + width: 10, + ), + SizedBox( + width: 10, + ), + ], + ), + + SizedBox( + height: 10, + ), ], ), ), diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index dc64acb5..a60c0cab 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -12,6 +12,7 @@ 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/patient/patiant_info_model.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'; @@ -30,7 +31,7 @@ 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 NoteModel note; + final GetOperationReportModel operationReport; final OperationReportViewModel operationReportViewModel; final PatiantInformtion patient; final int visitType; @@ -38,11 +39,11 @@ class UpdateOperationReport extends StatefulWidget { const UpdateOperationReport( {Key key, - this.note, this.operationReportViewModel, this.patient, this.visitType, - this.isUpdate}) + this.isUpdate, + this.operationReport}) : super(key: key); @override @@ -77,6 +78,7 @@ class _UpdateOperationReportState extends State { TextEditingController BloodTransfusedDetailController = TextEditingController(); TextEditingController anasthetistController = TextEditingController(); + TextEditingController OTReservationID = TextEditingController(); setSelectedType(int val) { setState(() { @@ -92,6 +94,8 @@ class _UpdateOperationReportState extends State { @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( isShowAppBar: true, @@ -120,6 +124,18 @@ class _UpdateOperationReportState extends State { widthFactor: 0.9, child: Column( children: [ + AppTextFieldCustom( + hintText: "Reservation No", + //TranslationBase.of(context).addoperationReports, + controller: OTReservationID, + maxLines: 1, + minLines: 1, + enabled: false, + hasBorder: true, + ), + SizedBox( + height: 4, + ), AppTextFieldCustom( hintText: "Pre Op Diagmosis", //TranslationBase.of(context).addoperationReports, @@ -473,14 +489,15 @@ class _UpdateOperationReportState extends State { }); if (isFormValid()) { GifLoaderDialogUtils.showMyDialog(context); - await widget.operationReportViewModel.getDoctorProfile(); + await widget.operationReportViewModel.getDoctorProfile(); CreateUpdateOperationReportRequestModel createUpdateOperationReportRequestModel = CreateUpdateOperationReportRequestModel( inasion: inasionController.text, + /// TODO Elham* Add dynamic reservation - reservationNo: 0, + reservationNo:widget.operationReport.oTReservationID , preOpDiagmosis: preOpDiagmosisController.text, postOpDiagmosis: postOpDiagmosisNoteController.text, surgeon: surgeonController.text, @@ -503,7 +520,8 @@ class _UpdateOperationReportState extends State { bloodLossDetailController.text, patientID: widget.patient.patientId, admissionNo: int.parse(widget.patient.admissionNo), - createdBy: widget.operationReportViewModel.doctorProfile.doctorID, + createdBy: widget.operationReportViewModel + .doctorProfile.doctorID, setupID: SETUP_ID); await widget.operationReportViewModel.updateOperationReport( createUpdateOperationReportRequestModel);