diff --git a/lib/config/config.dart b/lib/config/config.dart index 11c6dfbc..16628fda 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -13,8 +13,6 @@ const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; const PATIENT_INSURANCE_APPROVALS_URL = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; -const PATIENT_ORDERS_URL = - "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; const PATIENT_REFER_TO_DOCTOR_URL = "Services/DoctorApplication.svc/REST/ReferToDoctor"; const PATIENT_GET_DOCTOR_BY_CLINIC_URL = @@ -44,7 +42,6 @@ const GET_PATIENT_VITAL_SIGN_DATA = const GET_PATIENT_LAB_OREDERS = 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; const GET_PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; -const GET_RADIOLOGY = 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; const GET_LIVECARE_PENDINGLIST = 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; @@ -138,7 +135,7 @@ const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; const GET_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; -const GET_OFFTIME = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; +const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const GET_COVERING_DOCTORS = 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition'; @@ -155,8 +152,6 @@ const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; -const GET_PATIENT_ARRIVAL_LIST = - 'Services/DoctorApplication.svc/REST/PatientArrivalList'; const GET_PATIENT_IN_PATIENT_LIST = 'Services/DoctorApplication.svc/REST/GetMyInPatient'; @@ -180,8 +175,6 @@ const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION = // SOAP const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; -const GET_MASTER_LOOKUP_LIST = - 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode'; const POST_EPISODE_FOR_IN_PATIENT = @@ -208,15 +201,13 @@ const PATCH_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PatchProgressNote'; const PATCH_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PatchAssessment'; -const GET_ALLERGY = 'Services/DoctorApplication.svc/REST/GetAllergies'; const GET_HISTORY = 'Services/DoctorApplication.svc/REST/GetHistory'; const GET_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote'; const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment'; -const GET_ORDER_PROCEDURE = - 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; + const GET_LIST_CATEGORISE = 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; @@ -271,7 +262,6 @@ const GET_IN_PATIENT_ORDERS = 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; ///Prescriptions -const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; const GET_PRESCRIPTION_REPORT_NEW = @@ -280,18 +270,11 @@ const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; -const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; const CREATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; -const GET_PRESCRIPTION_IN_PATIENT = - 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; - -const GET_INSURANCE_IN_PATIENT = - "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; - const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave"; const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient"; @@ -398,6 +381,9 @@ const GET_INTERVENTION_MEDICATION_HISTORY = const SET_ACCEPTED_OR_REJECTED = "Services/DoctorApplication.svc/REST/DoctorApp_AcceptOrRejectIntervention"; +const GET_STP_MASTER_LIST = + "Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 719f75f7..eb052bc5 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1138,4 +1138,8 @@ const Map> localizedValues = { "old": {"en": "Old", "ar":"القديمه"}, "orderTypeDescription": {"en": "Order Type Description", "ar":"وصف نوع الطلب"}, "doseDetails": {"en": "Dose Details", "ar":"تفاصيل الجرعة"}, + "selectCondition": {"en": "Select Condition", "ar":"قم بتحديد الشرط"}, + "yourOrderAddedSuccessfully": {"en": "Your Order Added Successfully", "ar":"تم إضافة طلبك بنجاح"}, + "youCannotAddOnlySpaces": {"en": "You Can't Add Only Spaces", "ar":""}, + "conditionDescription": {"en": "Condition Description", "ar":"لا يمكنك إضافة مسافات فقط"}, }; diff --git a/lib/core/model/note/CreateNoteModel.dart b/lib/core/model/note/CreateNoteModel.dart index db672fcf..20e27289 100644 --- a/lib/core/model/note/CreateNoteModel.dart +++ b/lib/core/model/note/CreateNoteModel.dart @@ -18,6 +18,7 @@ class CreateNoteModel { String sessionID; bool isLoginForDoctorApp; bool patientOutSA; + int conditionId; CreateNoteModel( {this.visitType, @@ -38,7 +39,8 @@ class CreateNoteModel { this.tokenID, this.sessionID, this.isLoginForDoctorApp, - this.patientOutSA}); + this.patientOutSA, + this.conditionId}); CreateNoteModel.fromJson(Map json) { visitType = json['VisitType']; @@ -60,6 +62,7 @@ class CreateNoteModel { sessionID = json['SessionID']; isLoginForDoctorApp = json['IsLoginForDoctorApp']; patientOutSA = json['PatientOutSA']; + conditionId = json['ConditionId']; } Map toJson() { @@ -83,6 +86,7 @@ class CreateNoteModel { data['SessionID'] = this.sessionID; data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; data['PatientOutSA'] = this.patientOutSA; + data['ConditionId'] = this.conditionId; return data; } } diff --git a/lib/core/model/note/note_model.dart b/lib/core/model/note/note_model.dart index 29a891fa..bef3a973 100644 --- a/lib/core/model/note/note_model.dart +++ b/lib/core/model/note/note_model.dart @@ -19,6 +19,8 @@ class NoteModel { Null doctorClinicName; String doctorName; String visitTypeDesc; + int condition; + String conditionDescription; NoteModel( {this.setupID, @@ -40,7 +42,10 @@ class NoteModel { this.admissionClinicName, this.doctorClinicName, this.doctorName, - this.visitTypeDesc}); + this.visitTypeDesc, + this.condition, + this.conditionDescription, + }); NoteModel.fromJson(Map json) { setupID = json['SetupID']; @@ -63,6 +68,8 @@ class NoteModel { doctorClinicName = json['DoctorClinicName']; doctorName = json['DoctorName']; visitTypeDesc = json['VisitTypeDesc']; + condition = json['Condition']; + conditionDescription = json['ConditionDescription']; } Map toJson() { @@ -87,6 +94,8 @@ class NoteModel { data['DoctorClinicName'] = this.doctorClinicName; data['DoctorName'] = this.doctorName; data['VisitTypeDesc'] = this.visitTypeDesc; + data['Condition'] = this.condition; + data['ConditionDescription'] = this.conditionDescription; return data; } } diff --git a/lib/core/model/note/stp_master_list_req_model.dart b/lib/core/model/note/stp_master_list_req_model.dart new file mode 100644 index 00000000..067a1623 --- /dev/null +++ b/lib/core/model/note/stp_master_list_req_model.dart @@ -0,0 +1,32 @@ +class StpMasterListRequestModel { + bool isDentalAllowedBackend; + int languageID; + int projectID; + int parameterGroup; + int parameterType; + + StpMasterListRequestModel( + {this.isDentalAllowedBackend, + this.languageID, + this.projectID, + this.parameterGroup, + this.parameterType}); + + StpMasterListRequestModel.fromJson(Map json) { + isDentalAllowedBackend = json['isDentalAllowedBackend']; + languageID = json['LanguageID']; + projectID = json['ProjectID']; + parameterGroup = json['parameterGroup']; + parameterType = json['parameterType']; + } + + Map toJson() { + final Map data = new Map(); + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['LanguageID'] = this.languageID; + data['ProjectID'] = this.projectID; + data['parameterGroup'] = this.parameterGroup; + data['parameterType'] = this.parameterType; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/note/stp_master_list_res_model.dart b/lib/core/model/note/stp_master_list_res_model.dart new file mode 100644 index 00000000..2533605a --- /dev/null +++ b/lib/core/model/note/stp_master_list_res_model.dart @@ -0,0 +1,22 @@ +class StpMasterListResponseModel { + int parameterCode; + String description; + Null descriptionN; + + StpMasterListResponseModel( + {this.parameterCode, this.description, this.descriptionN}); + + StpMasterListResponseModel.fromJson(Map json) { + parameterCode = json['ParameterCode']; + description = json['Description']; + descriptionN = json['DescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['ParameterCode'] = this.parameterCode; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + return data; + } +} \ No newline at end of file diff --git a/lib/core/model/note/update_note_model.dart b/lib/core/model/note/update_note_model.dart index f2d845ff..faedb6f7 100644 --- a/lib/core/model/note/update_note_model.dart +++ b/lib/core/model/note/update_note_model.dart @@ -16,6 +16,7 @@ class UpdateNoteReqModel { bool isLoginForDoctorApp; bool patientOutSA; int patientTypeID; + int conditionId; UpdateNoteReqModel( {this.projectID, @@ -34,7 +35,8 @@ class UpdateNoteReqModel { this.sessionID, this.isLoginForDoctorApp, this.patientOutSA, - this.patientTypeID}); + this.patientTypeID, + this.conditionId}); UpdateNoteReqModel.fromJson(Map json) { projectID = json['ProjectID']; @@ -54,6 +56,7 @@ class UpdateNoteReqModel { isLoginForDoctorApp = json['IsLoginForDoctorApp']; patientOutSA = json['PatientOutSA']; patientTypeID = json['PatientTypeID']; + conditionId = json['ConditionId']; } Map toJson() { @@ -75,6 +78,7 @@ class UpdateNoteReqModel { data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; data['PatientOutSA'] = this.patientOutSA; data['PatientTypeID'] = this.patientTypeID; + data['ConditionId'] = this.conditionId; return data; } } diff --git a/lib/core/service/patient/patient_service.dart b/lib/core/service/patient/patient_service.dart index 437e5186..7db9fd1b 100644 --- a/lib/core/service/patient/patient_service.dart +++ b/lib/core/service/patient/patient_service.dart @@ -5,14 +5,14 @@ import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartVal import 'package:doctor_app_flutter/core/model/diabetic_chart/GetDiabeticChartValuesResponseModel.dart'; import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientRequestModel.dart'; import 'package:doctor_app_flutter/core/model/diagnosis/GetDiagnosisForInPatientResponseModel.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.dart'; import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteResposeModel.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; +import 'package:doctor_app_flutter/core/model/note/stp_master_list_req_model.dart'; +import 'package:doctor_app_flutter/core/model/note/stp_master_list_res_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; -import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; -import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/patient/get_clinic_by_project_id_request.dart'; import 'package:doctor_app_flutter/core/model/patient/get_doctor_by_clinic_id_request.dart'; import 'package:doctor_app_flutter/core/model/patient/get_list_stp_referral_frequency_request.dart'; @@ -26,6 +26,8 @@ import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_ import 'package:doctor_app_flutter/core/model/patient/radiology/radiology_res_model.dart'; import 'package:doctor_app_flutter/core/model/patient/refer_to_doctor_request.dart'; import 'package:doctor_app_flutter/core/model/patient/vital_sign/vital_sign_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class PatientService extends BaseService { List _patientVitalSignList = []; @@ -78,6 +80,8 @@ class PatientService extends BaseService { List get diabeticChartValuesList => _diabeticChartValuesList; + List stpMasterList = []; + // TODO: replace var with model var _insuranceApporvalsList = []; @@ -270,7 +274,7 @@ class PatientService extends BaseService { Future getPatientRadiology(patient) async { hasError = false; await baseAppClient.post( - GET_RADIOLOGY, + GET_IN_PATIENT_ORDERS, onSuccess: (dynamic response, int statusCode) { _patientRadiologyList = []; response['List_GetRadOreders'].forEach((v) { @@ -558,4 +562,22 @@ class PatientService extends BaseService { body: getDiabeticChartValuesRequestModel.toJson(), ); } + + Future getStpMasterList( + StpMasterListRequestModel stpMasterListRequestModel) async { + hasError = false; + + await baseAppClient.post( + GET_STP_MASTER_LIST, + onSuccess: (dynamic response, int statusCode) { + stpMasterList = []; + stpMasterList = response['List_STPMasterList']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: stpMasterListRequestModel.toJson(), + ); + } } diff --git a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart index 0cd23047..1fcc4f78 100644 --- a/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart +++ b/lib/core/service/patient_medical_file/insurance/InsuranceCardService.dart @@ -34,7 +34,7 @@ class InsuranceCardService extends BaseService { hasError = false; insuranceApprovalInPatient.clear(); - await baseAppClient.post(GET_INSURANCE_IN_PATIENT, + await baseAppClient.post(PATIENT_INSURANCE_APPROVALS_URL, onSuccess: (dynamic response, int statusCode) { //prescriptionsList.clear(); response['List_ApprovalMain_InPatient'].forEach((prescriptions) { diff --git a/lib/core/service/patient_medical_file/prescription/prescription_service.dart b/lib/core/service/patient_medical_file/prescription/prescription_service.dart index 99d24fb4..217a5c2f 100644 --- a/lib/core/service/patient_medical_file/prescription/prescription_service.dart +++ b/lib/core/service/patient_medical_file/prescription/prescription_service.dart @@ -275,7 +275,7 @@ class PrescriptionService extends LookupService { hasError = false; Map body = Map(); body['isDentalAllowedBackend'] = false; - await baseAppClient.postPatient(PRESCRIPTIONS, patient: patient, + await baseAppClient.postPatient(GET_PRESCRIPTION, patient: patient, onSuccess: (dynamic response, int statusCode) { prescriptionsList.clear(); response['PatientPrescriptionList'].forEach((prescriptions) { diff --git a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index ea97f02b..333ffeea 100644 --- a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -186,7 +186,7 @@ class SickLeaveService extends BaseService { hasError = false; await baseAppClient.post( - GET_OFFTIME, + GET_MASTER_LOOKUP_LIST, onSuccess: (dynamic response, int statusCode) { offTime = []; response['MasterLookUpList']['entityList'].forEach((item) => { @@ -208,7 +208,7 @@ class SickLeaveService extends BaseService { hasError = false; await baseAppClient.post( - GET_OFFTIME, + GET_MASTER_LOOKUP_LIST, onSuccess: (dynamic response, int statusCode) { reasonse = []; reasonse = response['MasterLookUpList']['entityList']; diff --git a/lib/core/service/patient_medical_file/soap/SOAP_service.dart b/lib/core/service/patient_medical_file/soap/SOAP_service.dart index 909e83cc..b8c187a3 100644 --- a/lib/core/service/patient_medical_file/soap/SOAP_service.dart +++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart @@ -229,7 +229,7 @@ class SOAPService extends LookupService { Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async { hasError = false; - await baseAppClient.post(GET_ALLERGY, + await baseAppClient.post(GET_ALLERGIES, onSuccess: (dynamic response, int statusCode) { print("Success"); patientAllergiesList.clear(); diff --git a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart index cc2e203a..4305dbec 100644 --- a/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart +++ b/lib/core/service/patient_medical_file/ucaf/patient-ucaf-service.dart @@ -159,7 +159,7 @@ class UcafService extends LookupService { body['AppointmentNo'] = patient.appointmentNo; body['EpisodeID'] = patient.episodeNo; - await baseAppClient.post(GET_ORDER_PROCEDURE, + await baseAppClient.post(GET_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) { print("Success"); orderProcedureList.clear(); diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index b36b5e5b..242ba6c3 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -8,8 +8,6 @@ import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequest import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteResposeModel.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; -import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; -import 'package:doctor_app_flutter/core/service/patient/patient_service.dart'; import 'package:doctor_app_flutter/core/model/patient/lab_orders/lab_orders_res_model.dart'; import 'package:doctor_app_flutter/core/model/patient/lab_result/lab_result.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; @@ -18,10 +16,12 @@ import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_ import 'package:doctor_app_flutter/core/model/patient/prescription/prescription_res_model.dart'; import 'package:doctor_app_flutter/core/model/patient/radiology/radiology_res_model.dart'; import 'package:doctor_app_flutter/core/model/patient/vital_sign/vital_sign_res_model.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:flutter/cupertino.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; +import 'package:doctor_app_flutter/core/service/patient/patient_service.dart'; import '../../locator.dart'; +import '../model/note/stp_master_list_req_model.dart'; +import '../model/note/stp_master_list_res_model.dart'; import 'base_view_model.dart'; class PatientViewModel extends BaseViewModel { @@ -73,6 +73,9 @@ class PatientViewModel extends BaseViewModel { List get referralFrequencyList => _patientService.referalFrequancyList; + List get stpMasterList => + _patientService.stpMasterList; + Future getPatientList(patient, patientType, {bool isBusyLocal = false, isView}) async { var localRes; @@ -353,6 +356,32 @@ class PatientViewModel extends BaseViewModel { resultType: resultType, setupID: "010266"); await _patientService.getDiabeticChartValues(requestModel); + if (_patientService.hasError) { + error = _patientService.error; + if (isLocalBusy) + setState(ViewState.ErrorLocal); + else + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + Future getStpMasterList({bool isLocalBusy = false}) async { + if (isLocalBusy) + setState(ViewState.BusyLocal); + else + setState(ViewState.Busy); + + StpMasterListRequestModel requestModel = StpMasterListRequestModel( + isDentalAllowedBackend: false, + languageID: 1, + projectID: 15, + parameterGroup: 7, + parameterType: 362); + + await _patientService.getStpMasterList(requestModel); + if (_patientService.hasError) { error = _patientService.error; if (isLocalBusy) diff --git a/lib/screens/patients/profile/notes/note/progress_note_screen.dart b/lib/screens/patients/profile/notes/note/progress_note_screen.dart index 8f9664ea..657e5ed6 100644 --- a/lib/screens/patients/profile/notes/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/notes/note/progress_note_screen.dart @@ -456,7 +456,7 @@ class _ProgressNoteState extends State { AppText( TranslationBase.of( context) - .createdBy, + .createdBy + ' ', fontSize: 10, ), Expanded( @@ -474,6 +474,26 @@ class _ProgressNoteState extends State { ), ], ), + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of(context).conditionDescription + ' : ', + fontSize: 10, + ), + Expanded( + child: AppText( + model.patientProgressNoteList[index].conditionDescription ?? '', + fontWeight: + FontWeight.w600, + fontSize: 12, + isCopyable: true, + ), + ), + ], + ), ], ), ), diff --git a/lib/screens/patients/profile/notes/note/update_note.dart b/lib/screens/patients/profile/notes/note/update_note.dart index 10b3c30d..be42eb59 100644 --- a/lib/screens/patients/profile/notes/note/update_note.dart +++ b/lib/screens/patients/profile/notes/note/update_note.dart @@ -2,16 +2,16 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/note/CreateNoteModel.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_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/core/model/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -26,6 +26,8 @@ import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; +import '../../../../../widgets/shared/dialogs/dailog-list-select.dart'; +import '../../../../base/base_view.dart'; class UpdateNoteOrder extends StatefulWidget { final NoteModel note; @@ -33,6 +35,8 @@ class UpdateNoteOrder extends StatefulWidget { final PatiantInformtion patient; final int visitType; final bool isUpdate; + final List elementList; + final Function(dynamic) okFunction; const UpdateNoteOrder( {Key key, @@ -40,7 +44,9 @@ class UpdateNoteOrder extends StatefulWidget { this.patientModel, this.patient, this.visitType, - this.isUpdate}) + this.isUpdate, + this.elementList, + this.okFunction}) : super(key: key); @override @@ -48,6 +54,7 @@ class UpdateNoteOrder extends StatefulWidget { } class _UpdateNoteOrderState extends State { + dynamic selectValue; int selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); @@ -78,120 +85,35 @@ class _UpdateNoteOrderState extends State { @override Widget build(BuildContext context) { + String keyId = 'ParameterCode'; + projectViewModel = Provider.of(context); if (widget.note != null) { progressNoteController.text = widget.note.notes; - } + if(selectValue==null) + selectValue={}; + selectValue['parameterCode'] = widget.note.condition; + selectValue['description'] = widget.note.conditionDescription; - return AppScaffold( - isShowAppBar: false, - backgroundColor: Theme.of(context).scaffoldBackgroundColor, - body: SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 1.0, - child: Padding( - padding: EdgeInsets.all(0.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - BottomSheetTitle( - title: widget.visitType == 3 - ? (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate - ? TranslationBase.of(context).noteUpdate - : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, - ), - SizedBox( - height: 10.0, - ), - Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - Stack( - children: [ - AppTextFieldCustom( - hintText: widget.visitType == 3 - ? (widget.isUpdate - ? TranslationBase.of(context) - .noteUpdate - : TranslationBase.of(context) - .noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate - ? TranslationBase.of(context) - .noteUpdate - : TranslationBase.of(context) - .noteAdd) + - TranslationBase.of(context).progressNote, - //TranslationBase.of(context).addProgressNote, - controller: progressNoteController, - maxLines: 35, - minLines: 25, - hasBorder: true, + } - // isTextFieldHasSuffix: true, - validationError: - progressNoteController.text.isEmpty && - isSubmitted - ? TranslationBase.of(context).emptyMessage - : null, - ), - Positioned( - top: - -2, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic - ? MediaQuery.of(context).size.width * 0.75 - : 15, - child: Column( - children: [ - IconButton( - icon: Icon(DoctorApp.speechtotext, - color: Colors.black, size: 35), - onPressed: () { - initSpeechState() - .then((value) => {onVoiceText()}); - }, - ), - ], - )) - ], - ), - ], - ), - ), - ), - ], - ), - ), - ), - ), - bottomSheet: Container( - height: progressNoteController.text.isNotEmpty ? 130 : 70, - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Column( - children: [ - if (progressNoteController.text.isNotEmpty) - Container( - margin: EdgeInsets.all(5), - child: AppButton( - title: TranslationBase.of(context).clearText, - onPressed: () { - setState(() { - progressNoteController.text = ''; - }); - }, - ), - ), - Container( - margin: EdgeInsets.all(5), - child: AppButton( + return BaseView( + onModelReady: (model) { + model.getStpMasterList(isLocalBusy: false); + }, + builder: (_, model, w) => AppScaffold( + isShowAppBar: false, + backgroundColor: Theme.of(context).scaffoldBackgroundColor, + body: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.0, + child: Padding( + padding: EdgeInsets.all(0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BottomSheetTitle( title: widget.visitType == 3 ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate @@ -201,73 +123,220 @@ class _UpdateNoteOrderState extends State { ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).progressNote, - color: AppGlobal.appGreenColor, - // disabled: progressNoteController.text.isEmpty, - fontWeight: FontWeight.w700, - onPressed: () async { + ), + SizedBox( + height: 10.0, + ), + Container( + padding: EdgeInsets.only(right: 20, left: 20), + child: InkWell( + onTap: model.stpMasterList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.stpMasterList, + attributeName: 'Description', + attributeValueId: + model.stpMasterList.length == 1 + ? model.stpMasterList[0]['${keyId}'] + .toString() + : '${keyId}', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) => { + setState(() { + selectValue = selectedValue; + selectValue['isDefault'] = true; + }) + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).selectCondition,//'Select Condition', + dropDownText: model.stpMasterList.length == 1 + ? model.stpMasterList[0]['Description'] + : selectValue == null + ? null + : selectValue['Description'], + enabled: false, + isTextFieldHasSuffix: true, + ), + ), + ), + SizedBox( + height: 10.0, + ), + Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Stack( + children: [ + AppTextFieldCustom( + hintText: widget.visitType == 3 + ? (widget.isUpdate + ? TranslationBase.of(context) + .noteUpdate + : TranslationBase.of(context) + .noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context) + .noteUpdate + : TranslationBase.of(context) + .noteAdd) + + TranslationBase.of(context) + .progressNote, + //TranslationBase.of(context).addProgressNote, + controller: progressNoteController, + maxLines: 35, + minLines: 25, + hasBorder: true, + + // isTextFieldHasSuffix: true, + validationError: progressNoteController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, + ), + Positioned( + top: -2, + //MediaQuery.of(context).size.height * 0, + right: projectViewModel.isArabic + ? MediaQuery.of(context).size.width * 0.75 + : 15, + child: Column( + children: [ + IconButton( + icon: Icon(DoctorApp.speechtotext, + color: Colors.black, size: 35), + onPressed: () { + initSpeechState() + .then((value) => {onVoiceText()}); + }, + ), + ], + )) + ], + ), + ], + ), + ), + ), + ], + ), + ), + ), + ), + bottomSheet: Container( + height: progressNoteController.text.isNotEmpty ? 130 : 70, + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Column( + children: [ + if (progressNoteController.text.isNotEmpty) + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: TranslationBase.of(context).clearText, + onPressed: () { setState(() { - isSubmitted = true; + progressNoteController.text = ''; }); - if (progressNoteController.text.trim().isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + }, + ), + ), + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: widget.visitType == 3 + ? (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, + color: AppGlobal.appGreenColor, + // disabled: progressNoteController.text.isEmpty, + fontWeight: FontWeight.w700, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + if (progressNoteController.text.trim().isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = - DoctorProfileModel.fromJson(profile); + DoctorProfileModel doctorProfile = + DoctorProfileModel.fromJson(profile); - if (widget.isUpdate) { - UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(widget.patient.admissionNo), - cancelledNote: false, - lineItemNo: widget.note.lineItemNo, - createdBy: widget.note.createdBy, - notes: progressNoteController.text, - 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); + if (widget.isUpdate) { + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: + int.parse(widget.patient.admissionNo), + cancelledNote: false, + lineItemNo: widget.note.lineItemNo, + createdBy: widget.note.createdBy, + notes: progressNoteController.text, + verifiedNote: false, + patientTypeID: widget.patient.patientType, + patientOutSA: false, + conditionId: selectValue['ParameterCode']); + 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, + conditionId: selectValue['ParameterCode']); - await widget.patientModel - .createPatientProgressNote(reqModel); - } + await widget.patientModel + .createPatientProgressNote(reqModel); + } - if (widget.patientModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.patientModel.error); + if (widget.patientModel.state == + ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.patientModel.error); + } else { + ProgressNoteRequest progressNoteRequest = + ProgressNoteRequest( + 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( + TranslationBase.of(context).yourOrderAddedSuccessfully); + Navigator.of(context).pop(); } else { - ProgressNoteRequest progressNoteRequest = - ProgressNoteRequest( - 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()); + Helpers.showErrorToast(TranslationBase.of(context).youCannotAddOnlySpaces); } - GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast( - "Your Order added Successfully"); - Navigator.of(context).pop(); - } else { - Helpers.showErrorToast("You cant add only spaces"); - } - })), - ], + })), + ], + ), ), ), ); diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 7d9cdee0..e433df63 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1716,6 +1716,14 @@ class TranslationBase { String get doseDetails => localizedValues['doseDetails'][locale.languageCode]; + String get selectCondition => localizedValues['selectCondition'][locale.languageCode]; + + String get yourOrderAddedSuccessfully => localizedValues['yourOrderAddedSuccessfully'][locale.languageCode]; + + String get youCannotAddOnlySpaces => localizedValues['youCannotAddOnlySpaces'][locale.languageCode]; + + String get conditionDescription => localizedValues['conditionDescription'][locale.languageCode]; + }