diff --git a/lib/config/config.dart b/lib/config/config.dart index 86c42f8d..36f4f88d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,304 +5,215 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +//const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; -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 = - "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; - -const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = - "Services/Doctors.svc/REST/SearchDoctorsByTime"; - -const GET_CLINICS_FOR_DOCTOR = - 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor'; -const PATIENT_GET_LIST_REFERAL_URL = - "Services/Lists.svc/REST/GetList_STPReferralFrequency"; -const PATIENT_GET_CLINIC_BY_PROJECT_URL = - "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; +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 = "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; + +const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = "Services/Doctors.svc/REST/SearchDoctorsByTime"; + +const GET_CLINICS_FOR_DOCTOR = 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor'; +const PATIENT_GET_LIST_REFERAL_URL = "Services/Lists.svc/REST/GetList_STPReferralFrequency"; +const PATIENT_GET_CLINIC_BY_PROJECT_URL = "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo"; const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics"; -const GET_REFERRAL_FACILITIES = - 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; +const GET_REFERRAL_FACILITIES = 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo'; -const GET_PATIENT_VITAL_SIGN = - 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; -const GET_PATIENT_VITAL_SIGN_DATA = - 'Services/DoctorApplication.svc/REST/GetVitalSigns'; -const GET_PATIENT_LAB_OREDERS = - 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; +const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; +const GET_PATIENT_VITAL_SIGN_DATA = 'Services/DoctorApplication.svc/REST/GetVitalSigns'; +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'; +const GET_LIVECARE_PENDINGLIST = 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; const START_LIVE_CARE_CALL = 'LiveCareApi/DoctorApp/CallPatient'; const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = "Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor"; -const GET_PRESCRIPTION_REPORT = - 'Services/Patients.svc/REST/GetPrescriptionReport'; +const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/GetPrescriptionReport'; -const GT_MY_PATIENT_QUESTION = - 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; +const GT_MY_PATIENT_QUESTION = 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; -const PRM_SEARCH_PATIENT = - 'Services/Patients.svc/REST/GetPatientInformation_PRM'; +const PRM_SEARCH_PATIENT = 'Services/Patients.svc/REST/GetPatientInformation_PRM'; const GET_PATIENT = 'Services/DoctorApplication.svc/REST/'; -const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = - 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; +const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; -const GET_MY_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; +const GET_MY_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; const REFER_TO_DOCTOR = 'Services/DoctorApplication.svc/REST/ReferToDoctor'; -const ADD_REFERRED_DOCTOR_REMARKS = - 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; +const ADD_REFERRED_DOCTOR_REMARKS = 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; -const GET_MY_REFERRED_PATIENT = - 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; +const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; -const GET_PENDING_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/PendingReferrals'; +const GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals'; -const CREATE_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/CreateReferral'; +const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral'; -const RESPONSE_PENDING_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/RespondReferral'; +const RESPONSE_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/RespondReferral'; const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal'; const POST_UCAF = 'Services/DoctorApplication.svc/REST/PostUCAF'; -const GET_DOCTOR_WORKING_HOURS_TABLE = - 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; +const GET_DOCTOR_WORKING_HOURS_TABLE = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; -const GET_PATIENT_LAB_RESULTS = - 'Services/DoctorApplication.svc/REST/GetPatientLabResults'; +const GET_PATIENT_LAB_RESULTS = 'Services/DoctorApplication.svc/REST/GetPatientLabResults'; const LOGIN_URL = 'Services/Sentry.svc/REST/MemberLogIN_New'; -const INSERT_DEVICE_IMEI = - 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'; +const INSERT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'; // 'Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI'; // const SELECT_DEVICE_IMEI = // 'Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI'; -const SELECT_DEVICE_IMEI = - 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI'; +const SELECT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI'; const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; -const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = - 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; +const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; -const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = - 'Services/DoctorApplication.svc/REST/SendVerificationCode'; -const MEMBER_CHECK_ACTIVATION_CODE_NEW = - 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; +const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = 'Services/DoctorApplication.svc/REST/SendVerificationCode'; +const MEMBER_CHECK_ACTIVATION_CODE_NEW = 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; -const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = - 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; +const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; -const GET_DASHBOARD = - 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; -const GET_SICKLEAVE_STATISTIC = - 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; -const ARRIVED_PATIENT_URL = - 'Services/DoctorApplication.svc/REST/PatientArrivalList'; +const GET_DASHBOARD = 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; +const GET_SICKLEAVE_STATISTIC = 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; +const ARRIVED_PATIENT_URL = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; 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_COVERING_DOCTORS = - 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; +const GET_COVERING_DOCTORS = 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition'; -const UPDATE_RESCHDEULE = - 'Services/DoctorApplication.svc/REST/PatchRequisition'; -const GET_RESCHEDULE_LEAVE = - 'Services/DoctorApplication.svc/REST/GetRequisition'; -const GET_PRESCRIPTION_LIST = - 'Services/DoctorApplication.svc/REST/GetPrescription'; - -const POST_PRESCRIPTION_LIST = - 'Services/DoctorApplication.svc/REST/PostPrescription'; -const GET_PROCEDURE_LIST = - 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; +const UPDATE_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PatchRequisition'; +const GET_RESCHEDULE_LEAVE = 'Services/DoctorApplication.svc/REST/GetRequisition'; +const GET_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/GetPrescription'; + +const POST_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/PostPrescription'; +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_ARRIVAL_LIST = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; -const GET_PATIENT_IN_PATIENT_LIST = - 'Services/DoctorApplication.svc/REST/GetMyInPatient'; +const GET_PATIENT_IN_PATIENT_LIST = 'Services/DoctorApplication.svc/REST/GetMyInPatient'; -const Verify_Referral_Doctor_Remarks = - 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; +const Verify_Referral_Doctor_Remarks = 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; -const GET_Patient_LAB_SPECIAL_RESULT = - 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -const SEND_LAB_RESULT_EMAIL = - 'Services/Notifications.svc/REST/SendLabReportEmail'; -const GET_Patient_LAB_RESULT = - 'Services/Patients.svc/REST/GetPatientLabResults'; -const GET_Patient_LAB_ORDERS_RESULT = - 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; +const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; +const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; // SOAP const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; -const GET_MASTER_LOOKUP_LIST = - 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; +const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode'; const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; -const POST_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; -const POST_PHYSICAL_EXAM = - 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; -const POST_PROGRESS_NOTE = - '/Services/DoctorApplication.svc/REST/PostProgressNote'; +const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; +const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; +const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote'; const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment'; const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies'; const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory'; -const PATCH_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; +const PATCH_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; -const PATCH_PHYSICAL_EXAM = - 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; -const PATCH_PROGRESS_NOTE = - 'Services/DoctorApplication.svc/REST/PatchProgressNote'; +const PATCH_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; +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_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_ORDER_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; -const GET_LIST_CATEGORISE = - 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; +const GET_LIST_CATEGORISE = 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; -const GET_CATEGORISE_PROCEDURE = - 'Services/DoctorApplication.svc/REST/GetProcedure'; +const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure'; const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure'; -const UPDATE_PRESCRIPTION = - 'Services/DoctorApplication.svc/REST/PatchPrescription'; +const UPDATE_PRESCRIPTION = 'Services/DoctorApplication.svc/REST/PatchPrescription'; const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList'; -const DRUG_TO_DRUG = - 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; +const DRUG_TO_DRUG = 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors'; const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards'; -const GET_ROOM_CATEGORIES = - 'Services/DoctorApplication.svc/REST/GetRoomCategories'; -const GET_DIAGNOSIS_TYPES = - 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; +const GET_ROOM_CATEGORIES = 'Services/DoctorApplication.svc/REST/GetRoomCategories'; +const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes'; const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes'; -const POST_ADMISSION_REQUEST = - 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; -const GET_ITEM_BY_MEDICINE = - 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; +const POST_ADMISSION_REQUEST = 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; +const GET_ITEM_BY_MEDICINE = 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; -const GET_PROCEDURE_VALIDATION = - 'Services/DoctorApplication.svc/REST/ValidateProcedures'; -const GET_BOX_QUANTITY = - 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; +const GET_PROCEDURE_VALIDATION = 'Services/DoctorApplication.svc/REST/ValidateProcedures'; +const GET_BOX_QUANTITY = 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; ///GET ECG const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; -const GET_MY_REFERRAL_INPATIENT = - "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; +const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; -const GET_MY_DISCHARGE_PATIENT = - "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; -const GET_DISCHARGE_PATIENT = - "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; +const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; +const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; -const GET_PAtIENTS_INSURANCE_APPROVALS = - "Services/Patients.svc/REST/GetApprovalStatus"; +const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; -const GET_IN_PATIENT_ORDERS = - 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; +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 = - 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; -const SEND_PRESCRIPTION_EMAIL = - 'Services/Notifications.svc/REST/SendPrescriptionEmail'; -const GET_PRESCRIPTION_REPORT_ENH = - 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; +const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PRESCRIPTION_REPORT_NEW = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; +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 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_PRESCRIPTION_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; -const GET_INSURANCE_IN_PATIENT = - "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; +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"; - -const PATIENT_MEDICAL_REPORT_GET_LIST = - "Services/Patients.svc/REST/DAPP_ListMedicalReport"; -const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = - "Services/Patients.svc/REST/DAPP_GetTemplateByID"; -const PATIENT_MEDICAL_REPORT_INSERT = - "Services/Patients.svc/REST/DAPP_InsertMedicalReport"; -const PATIENT_MEDICAL_REPORT_VERIFIED = - "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport"; - -const GET_PROCEDURE_TEMPLETE = - 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet'; - -const GET_PROCEDURE_TEMPLETE_DETAILS = - "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; -const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = - 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp'; - -const DOCTOR_CHECK_HAS_LIVE_CARE = - "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare"; +const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient"; + +const PATIENT_MEDICAL_REPORT_GET_LIST = "Services/Patients.svc/REST/DAPP_ListMedicalReport"; +const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = "Services/Patients.svc/REST/DAPP_GetTemplateByID"; +const PATIENT_MEDICAL_REPORT_INSERT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport"; +const PATIENT_MEDICAL_REPORT_VERIFIED = "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport"; + +const GET_PROCEDURE_TEMPLETE = 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet'; + +const GET_PROCEDURE_TEMPLETE_DETAILS = "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; +const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp'; + +const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare"; var selectedPatientType = 1; diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index fc4609f3..d03e8f13 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -36,8 +36,7 @@ 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; -addPrescriptionForm(context, PrescriptionViewModel model, - PatiantInformtion patient, prescription) { +addPrescriptionForm(context, PrescriptionViewModel model, PatiantInformtion patient, prescription) { showModalBottomSheet( isScrollControlled: true, context: context, @@ -62,8 +61,7 @@ postProcedure( String icdCode, PatiantInformtion patient, String patientType}) async { - PostPrescriptionReqModel postProcedureReqModel = - new PostPrescriptionReqModel(); + PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); List sss = List(); postProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -131,8 +129,7 @@ class _PrescriptionFormWidgetState extends State { dynamic selectedDrug; int strengthChar; GetMedicationResponseModel _selectedMedication; - GlobalKey key = - new GlobalKey>(); + GlobalKey key = new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); @@ -177,10 +174,7 @@ class _PrescriptionFormWidgetState extends State { dynamic indication3 = {"id": 547, "name": "Hypertrichosis"}; dynamic indication4 = {"id": 548, "name": "Mild Dizziness"}; dynamic indication5 = {"id": 549, "name": "Enlargement of Facial Features"}; - dynamic indication6 = { - "id": 550, - "name": "Phenytoin Hypersensitivity Syndrome" - }; + dynamic indication6 = {"id": 550, "name": "Phenytoin Hypersensitivity Syndrome"}; dynamic indication7 = {"id": 551, "name": "Asterixis"}; dynamic indication8 = {"id": 552, "name": "Bullous Dermatitis"}; dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"}; @@ -207,8 +201,7 @@ class _PrescriptionFormWidgetState extends State { onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speech.initialize( - onStatus: statusListener, onError: errorListener); + bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); if (available) { speech.listen( onResult: resultListener, @@ -252,8 +245,7 @@ class _PrescriptionFormWidgetState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } @@ -310,15 +302,13 @@ class _PrescriptionFormWidgetState extends State { initialChildSize: 0.98, maxChildSize: 0.98, minChildSize: 0.9, - builder: - (BuildContext context, ScrollController scrollController) { + builder: (BuildContext context, ScrollController scrollController) { return SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 1.65, color: Color(0xffF8F8F8), child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 12.0, vertical: 10.0), + padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), child: Column( //crossAxisAlignment: CrossAxisAlignment.start, //mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -329,12 +319,10 @@ class _PrescriptionFormWidgetState extends State { height: 15, ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - TranslationBase.of(context) - .newPrescriptionOrder, + TranslationBase.of(context).newPrescriptionOrder, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -364,11 +352,8 @@ class _PrescriptionFormWidgetState extends State { widthFactor: 0.9, child: Container( decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(10), child: AppTextFormField( onTap: () { @@ -376,8 +361,7 @@ class _PrescriptionFormWidgetState extends State { visbiltySearch = true; }, borderColor: Colors.white, - hintText: TranslationBase.of(context) - .searchMedicineNameHere, + hintText: TranslationBase.of(context).searchMedicineNameHere, controller: myController, onSaved: (value) {}, onFieldSubmitted: (value) { @@ -403,12 +387,9 @@ class _PrescriptionFormWidgetState extends State { children: [ // TODO change it secondary button and add loading AppButton( - title: TranslationBase.of( - context) - .search, + title: TranslationBase.of(context).search, onPressed: () async { - await searchMedicine( - context, model); + await searchMedicine(context, model); }, ), ], @@ -417,50 +398,29 @@ class _PrescriptionFormWidgetState extends State { ), if (myController.text != '') Container( - height: MediaQuery.of(context) - .size - .height * - 0.5, + height: MediaQuery.of(context).size.height * 0.5, child: ListView.builder( - padding: const EdgeInsets.only( - top: 20), + padding: const EdgeInsets.only(top: 20), scrollDirection: Axis.vertical, // shrinkWrap: true, - itemCount: - model.allMedicationList == - null - ? 0 - : model - .allMedicationList - .length, - itemBuilder: - (BuildContext context, - int index) { + itemCount: model.allMedicationList == null + ? 0 + : model.allMedicationList.length, + itemBuilder: (BuildContext context, int index) { return InkWell( child: MedicineItemWidget( - label: model - .allMedicationList[ - index] - .description + label: model.allMedicationList[index].description // url: model // .pharmacyItemsList[ // index]["ImageSRCUrl"], ), onTap: () { - model.getItem( - itemID: model - .allMedicationList[ - index] - .itemId); - visbiltyPrescriptionForm = - true; + model.getItem(itemID: model.allMedicationList[index].itemId); + visbiltyPrescriptionForm = true; visbiltySearch = false; - _selectedMedication = - model.allMedicationList[ - index]; - uom = _selectedMedication - .uom; + _selectedMedication = model.allMedicationList[index]; + uom = _selectedMedication.uom; }, ); }, @@ -479,21 +439,18 @@ class _PrescriptionFormWidgetState extends State { child: Column( children: [ AppText( - _selectedMedication?.description ?? - "", + _selectedMedication?.description ?? "", bold: true, ), Container( child: Row( children: [ AppText( - TranslationBase.of(context) - .orderType, + TranslationBase.of(context).orderType, fontWeight: FontWeight.w600, ), Radio( - activeColor: - Color(0xFFB9382C), + activeColor: Color(0xFFB9382C), value: 1, groupValue: selectedType, onChanged: (value) { @@ -504,43 +461,32 @@ class _PrescriptionFormWidgetState extends State { ], ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( width: double.infinity, child: Row( children: [ Container( color: Colors.white, - width: MediaQuery.of(context) - .size - .width * - 0.35, + width: MediaQuery.of(context).size.width * 0.35, child: AppTextFieldCustom( height: 40, - validationError: - strengthError, - hintText: 'Strength', + validationError: strengthError, + hintText: 'Strength' + "*", isTextFieldHasSuffix: false, enabled: true, - controller: - strengthController, + controller: strengthController, onChanged: (String value) { setState(() { - strengthChar = - value.length; + strengthChar = value.length; }); if (strengthChar >= 5) { - DrAppToastMsg - .showErrorToast( - TranslationBase.of( - context) - .only5DigitsAllowedForStrength, + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).only5DigitsAllowedForStrength, ); } }, - inputType: TextInputType - .numberWithOptions( + inputType: TextInputType.numberWithOptions( decimal: true, ), // keyboardType: TextInputType @@ -554,133 +500,80 @@ class _PrescriptionFormWidgetState extends State { ), Container( color: Colors.white, - width: MediaQuery.of(context) - .size - .width * - 0.560, + width: MediaQuery.of(context).size.width * 0.560, child: InkWell( - onTap: - model.itemMedicineListUnit != - null - ? () { - Helpers - .hideKeyboard( - context); - ListSelectDialog - dialog = - ListSelectDialog( - list: model - .itemMedicineListUnit, - attributeName: - 'description', - attributeValueId: - 'parameterCode', - okText: TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState( - () { - units = - selectedValue; - units['isDefault'] = - true; - }); - }, - ); - showDialog( - barrierDismissible: - false, - context: - context, - builder: - (BuildContext - context) { - return dialog; - }, - ); - } - : null, + onTap: model.itemMedicineListUnit != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.itemMedicineListUnit, + attributeName: 'description', + attributeValueId: 'parameterCode', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + units = selectedValue; + units['isDefault'] = true; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, child: AppTextFieldCustom( hintText: 'Select', - isTextFieldHasSuffix: - true, - dropDownText: model - .itemMedicineListUnit - .length == - 1 - ? units = model - .itemMedicineListUnit[0] - ['description'] + isTextFieldHasSuffix: true, + dropDownText: model.itemMedicineListUnit.length == 1 + ? units = model.itemMedicineListUnit[0]['description'] : units != null - ? units['description'] - .toString() + ? units['description'].toString() : null, validationError: - model.itemMedicineListUnit - .length != - 1 - ? unitError - : null, + model.itemMedicineListUnit.length != 1 ? unitError : null, enabled: false), ), ), ], ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( //height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: - model.itemMedicineListRoute != - null - ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog - dialog = - ListSelectDialog( - list: model - .itemMedicineListRoute, - attributeName: - 'description', - attributeValueId: - 'parameterCode', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - route = - selectedValue; - route['isDefault'] = - true; - }); - if (route == - null) { - Helpers.showErrorToast( - 'plase fill'); - } - }, - ); - showDialog( - barrierDismissible: - false, - context: context, - builder: - (BuildContext - context) { - return dialog; - }, - ); - } - : null, + onTap: model.itemMedicineListRoute != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.itemMedicineListRoute, + attributeName: 'description', + attributeValueId: 'parameterCode', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + route = selectedValue; + route['isDefault'] = true; + }); + if (route == null) { + Helpers.showErrorToast('plase fill'); + } + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, child: AppTextFieldCustom( // decoration: // textFieldSelectorDecoration( @@ -698,179 +591,108 @@ class _PrescriptionFormWidgetState extends State { // 'description'] // : null, // true), - hintText: - TranslationBase.of(context) - .route, - dropDownText: model - .itemMedicineListRoute - .length == - 1 - ? model.itemMedicineListRoute[ - 0]['description'] + hintText: TranslationBase.of(context).route + "*", + dropDownText: model.itemMedicineListRoute.length == 1 + ? model.itemMedicineListRoute[0]['description'] : route != null ? route['description'] : null, isTextFieldHasSuffix: true, //height: 45, validationError: - model.itemMedicineListRoute - .length != - 1 - ? routeError - : null, + model.itemMedicineListRoute.length != 1 ? routeError : null, enabled: false, ), ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( //height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: - model.itemMedicineList != null - ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog - dialog = - ListSelectDialog( - list: model - .itemMedicineList, - attributeName: - 'description', - attributeValueId: - 'parameterCode', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - frequency = - selectedValue; - frequency[ - 'isDefault'] = - true; - if (_selectedMedication != null && - duration != - null && - frequency != - null && - strengthController - .text != - null) { - model.getBoxQuantity( - freq: frequency[ - 'parameterCode'], - duration: - duration[ - 'id'], - itemCode: - _selectedMedication - .itemId, - strength: - double.parse( - strengthController.text)); + onTap: model.itemMedicineList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.itemMedicineList, + attributeName: 'description', + attributeValueId: 'parameterCode', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + frequency = selectedValue; + frequency['isDefault'] = true; + if (_selectedMedication != null && + duration != null && + frequency != null && + strengthController.text != null) { + model.getBoxQuantity( + freq: frequency['parameterCode'], + duration: duration['id'], + itemCode: _selectedMedication.itemId, + strength: double.parse(strengthController.text)); - return; - } - }); - }, - ); - showDialog( - barrierDismissible: - false, - context: context, - builder: - (BuildContext - context) { - return dialog; - }, - ); - } - : null, + return; + } + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, child: AppTextFieldCustom( isTextFieldHasSuffix: true, - hintText: - TranslationBase.of(context) - .frequency, - dropDownText: model - .itemMedicineList - .length == - 1 - ? model.itemMedicineList[0] - ['description'] + hintText: TranslationBase.of(context).frequency + "*", + dropDownText: model.itemMedicineList.length == 1 + ? model.itemMedicineList[0]['description'] : frequency != null - ? frequency[ - 'description'] + ? frequency['description'] : null, - validationError: model - .itemMedicineList - .length != - 1 - ? frequencyError - : null, + validationError: + model.itemMedicineList.length != 1 ? frequencyError : null, enabled: false, ), ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( //height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: - model.medicationDoseTimeList != - null - ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog - dialog = - ListSelectDialog( - list: model - .medicationDoseTimeList, - attributeName: - 'nameEn', - attributeValueId: - 'id', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - doseTime = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: - false, - context: context, - builder: - (BuildContext - context) { - return dialog; - }, - ); - } - : null, + onTap: model.medicationDoseTimeList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.medicationDoseTimeList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + doseTime = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, child: AppTextFieldCustom( - hintText: - TranslationBase.of(context) - .doseTime, + hintText: TranslationBase.of(context).doseTime + "*", isTextFieldHasSuffix: true, - dropDownText: doseTime != null - ? doseTime['nameEn'] - : null, + dropDownText: doseTime != null ? doseTime['nameEn'] : null, //height: 45, enabled: false, @@ -878,10 +700,8 @@ class _PrescriptionFormWidgetState extends State { ), ), ), - SizedBox( - height: spaceBetweenTextFileds), - if (model - .patientAssessmentList.isNotEmpty) + SizedBox(height: spaceBetweenTextFileds), + if (model.patientAssessmentList.isNotEmpty) Container( height: screenSize.height * 0.070, width: double.infinity, @@ -889,68 +709,38 @@ class _PrescriptionFormWidgetState extends State { child: Row( children: [ Container( - width: - MediaQuery.of(context) - .size - .width * - 0.29, + width: MediaQuery.of(context).size.width * 0.29, child: InkWell( - onTap: - indicationList != null - ? () { - Helpers.hideKeyboard( - context); - } - : null, + onTap: indicationList != null + ? () { + Helpers.hideKeyboard(context); + } + : null, child: TextField( - decoration: - textFieldSelectorDecoration( - model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString(), - indication != - null - ? indication[ - 'name'] - : null, - false), + decoration: textFieldSelectorDecoration( + model.patientAssessmentList[0].icdCode10ID.toString(), + indication != null ? indication['name'] : null, + false), enabled: true, readOnly: true, ), ), ), Container( - width: - MediaQuery.of(context) - .size - .width * - 0.65, + width: MediaQuery.of(context).size.width * 0.65, color: Colors.white, child: InkWell( - onTap: - indicationList != null - ? () { - Helpers.hideKeyboard( - context); - } - : null, + onTap: indicationList != null + ? () { + Helpers.hideKeyboard(context); + } + : null, child: TextField( maxLines: 5, - decoration: - textFieldSelectorDecoration( - model - .patientAssessmentList[ - 0] - .asciiDesc - .toString(), - indication != - null - ? indication[ - 'name'] - : null, - false), + decoration: textFieldSelectorDecoration( + model.patientAssessmentList[0].asciiDesc.toString(), + indication != null ? indication['name'] : null, + false), enabled: true, readOnly: true, ), @@ -959,152 +749,101 @@ class _PrescriptionFormWidgetState extends State { ], ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: () => selectDate( - context, widget.model), + onTap: () => selectDate(context, widget.model), child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of( - context) - .date, - selectedDate != null - ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).date + "*", + selectedDate != null + ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), enabled: false, ), ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( //height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: - model.medicationDurationList != - null - ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog - dialog = - ListSelectDialog( - list: model - .medicationDurationList, - attributeName: - 'nameEn', - attributeValueId: - 'id', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - duration = - selectedValue; - if (_selectedMedication != null && - duration != - null && - frequency != - null && - strengthController - .text != - null) { - model - .getBoxQuantity( - freq: frequency[ - 'parameterCode'], - duration: - duration[ - 'id'], - itemCode: - _selectedMedication - .itemId, - strength: double.parse( - strengthController - .text), - ); - box = model - .boxQuintity; + onTap: model.medicationDurationList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.medicationDurationList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + duration = selectedValue; + if (_selectedMedication != null && + duration != null && + frequency != null && + strengthController.text != null) { + model.getBoxQuantity( + freq: frequency['parameterCode'], + duration: duration['id'], + itemCode: _selectedMedication.itemId, + strength: double.parse(strengthController.text), + ); + box = model.boxQuintity; - return; - } - }); - }, - ); - showDialog( - barrierDismissible: - false, - context: context, - builder: - (BuildContext - context) { - return dialog; - }, - ); - } - : null, + return; + } + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, child: AppTextFieldCustom( validationError: durationError, isTextFieldHasSuffix: true, - dropDownText: duration != null - ? duration['nameEn'] - : null, - hintText: - TranslationBase.of(context) - .duration, + dropDownText: duration != null ? duration['nameEn'] : null, + hintText: TranslationBase.of(context).duration + "*", enabled: false, ), ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: model.allMedicationList != - null + onTap: model.allMedicationList != null ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .allMedicationList, + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.allMedicationList, attributeName: 'nameEn', attributeValueId: 'id', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { setState(() { - duration = - selectedValue; + duration = selectedValue; }); }, ); showDialog( - barrierDismissible: - false, + barrierDismissible: false, context: context, - builder: (BuildContext - context) { + builder: (BuildContext context) { return dialog; }, ); @@ -1112,103 +851,70 @@ class _PrescriptionFormWidgetState extends State { : null, child: TextField( decoration: - textFieldSelectorDecoration( - "UOM", - uom != null - ? uom - : null, - false), + textFieldSelectorDecoration("UOM", uom != null ? uom : null, false), //enabled: false, readOnly: true, ), ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: model.allMedicationList != - null + onTap: model.allMedicationList != null ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .allMedicationList, + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( + list: model.allMedicationList, attributeName: 'nameEn', attributeValueId: 'id', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { setState(() { - duration = - selectedValue; + duration = selectedValue; }); }, ); showDialog( - barrierDismissible: - false, + barrierDismissible: false, context: context, - builder: (BuildContext - context) { + builder: (BuildContext context) { return dialog; }, ); } : null, child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of( - context) - .boxQuantity, - box != null - ? TranslationBase.of( - context) - .boxQuantity + - ": " + - model - .boxQuintity - .toString() - : null, - false), + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).boxQuantity, + box != null + ? TranslationBase.of(context).boxQuantity + + ": " + + model.boxQuintity.toString() + : null, + false), //enabled: false, readOnly: true, ), ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), child: Stack( children: [ TextFields( maxLines: 6, minLines: 4, - hintText: TranslationBase.of( - context) - .instruction, - controller: - instructionController, + hintText: TranslationBase.of(context).instruction, + controller: instructionController, //keyboardType: TextInputType.number, ), Positioned( - top: - 0, //MediaQuery.of(context).size.height * 0, + top: 0, //MediaQuery.of(context).size.height * 0, right: 15, child: IconButton( icon: Icon( @@ -1217,28 +923,22 @@ class _PrescriptionFormWidgetState extends State { size: 35, ), onPressed: () { - initSpeechState().then( - (value) => - {onVoiceText()}); + initSpeechState().then((value) => {onVoiceText()}); }, ), ), ], ), ), - SizedBox( - height: spaceBetweenTextFileds), + SizedBox(height: spaceBetweenTextFileds), Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Wrap( alignment: WrapAlignment.center, children: [ AppButton( color: Color(0xff359846), - title: TranslationBase.of( - context) - .addMedication, + title: TranslationBase.of(context).addMedication, fontWeight: FontWeight.w600, onPressed: () async { if (route != null && @@ -1247,41 +947,25 @@ class _PrescriptionFormWidgetState extends State { frequency != null && units != null && selectedDate != null && - strengthController - .text != - "") { - if (_selectedMedication - .isNarcotic == - true) { - DrAppToastMsg.showErrorToast( - TranslationBase.of( - context) - .narcoticMedicineCanOnlyBePrescribedFromVida); + strengthController.text != "") { + if (_selectedMedication.isNarcotic == true) { + DrAppToastMsg.showErrorToast(TranslationBase.of(context) + .narcoticMedicineCanOnlyBePrescribedFromVida); Navigator.pop(context); return; } - if (double.parse( - strengthController - .text) > - 1000.0) { - DrAppToastMsg - .showErrorToast( - "1000 is the MAX for the strength"); + if (double.parse(strengthController.text) > 1000.0) { + DrAppToastMsg.showErrorToast( + "1000 is the MAX for the strength"); return; } - if (double.parse( - strengthController - .text) < - 0.0) { - DrAppToastMsg - .showErrorToast( - "strength can't be zero"); + if (double.parse(strengthController.text) < 0.0) { + DrAppToastMsg.showErrorToast("strength can't be zero"); return; } - if (formKey.currentState - .validate()) { + if (formKey.currentState.validate()) { Navigator.pop(context); openDrugToDrug(model); { @@ -1370,52 +1054,32 @@ class _PrescriptionFormWidgetState extends State { } else { setState(() { if (duration == null) { - durationError = - TranslationBase.of( - context) - .fieldRequired; + durationError = TranslationBase.of(context).fieldRequired; } else { durationError = null; } if (doseTime == null) { - doseTimeError = - TranslationBase.of( - context) - .fieldRequired; + doseTimeError = TranslationBase.of(context).fieldRequired; } else { doseTimeError = null; } if (route == null) { - routeError = - TranslationBase.of( - context) - .fieldRequired; + routeError = TranslationBase.of(context).fieldRequired; } else { routeError = null; } if (frequency == null) { - frequencyError = - TranslationBase.of( - context) - .fieldRequired; + frequencyError = TranslationBase.of(context).fieldRequired; } else { frequencyError = null; } if (units == null) { - unitError = - TranslationBase.of( - context) - .fieldRequired; + unitError = TranslationBase.of(context).fieldRequired; } else { unitError = null; } - if (strengthController - .text == - "") { - strengthError = - TranslationBase.of( - context) - .fieldRequired; + if (strengthController.text == "") { + strengthError = TranslationBase.of(context).fieldRequired; } else { strengthError = null; } @@ -1489,8 +1153,7 @@ class _PrescriptionFormWidgetState extends State { } } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( @@ -1530,8 +1193,7 @@ class _PrescriptionFormWidgetState extends State { ); } - InputDecoration textFieldSelectorDecorationStreangrh( - String hintText, String selectedText, bool isDropDown, + InputDecoration textFieldSelectorDecorationStreangrh(String hintText, String selectedText, bool isDropDown, {Icon suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( @@ -1561,8 +1223,7 @@ class _PrescriptionFormWidgetState extends State { fontWeight: FontWeight.w600, ), hintText: selectedText == null || selectedText == "" ? hintText : null, - labelText: - selectedText != null && selectedText != "" ? '\n$selectedText' : null, + labelText: selectedText != null && selectedText != "" ? '\n$selectedText' : null, labelStyle: TextStyle( fontSize: 15, color: Color(0xff2E303A), @@ -1583,9 +1244,7 @@ class _PrescriptionFormWidgetState extends State { child: Column( // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - DrugToDrug( - widget.patient, - getPriscriptionforDrug(widget.prescriptionList, model), + DrugToDrug(widget.patient, getPriscriptionforDrug(widget.prescriptionList, model), model.patientAssessmentList), Container( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3), @@ -1596,11 +1255,9 @@ class _PrescriptionFormWidgetState extends State { postProcedure( icdCode: model.patientAssessmentList.isNotEmpty - ? model.patientAssessmentList[0].icdCode10ID - .isEmpty + ? model.patientAssessmentList[0].icdCode10ID.isEmpty ? "test" - : model.patientAssessmentList[0].icdCode10ID - .toString() + : model.patientAssessmentList[0].icdCode10ID.toString() : "test", // icdCode: model // .patientAssessmentList @@ -1611,20 +1268,17 @@ class _PrescriptionFormWidgetState extends State { // .join(' '), dose: strengthController.text, doseUnit: model.itemMedicineListUnit.length == 1 - ? model.itemMedicineListUnit[0]['parameterCode'] - .toString() + ? model.itemMedicineListUnit[0]['parameterCode'].toString() : units['parameterCode'].toString(), patient: widget.patient, doseTimeIn: doseTime['id'].toString(), model: widget.model, duration: duration['id'].toString(), frequency: model.itemMedicineList.length == 1 - ? model.itemMedicineList[0]['parameterCode'] - .toString() + ? model.itemMedicineList[0]['parameterCode'].toString() : frequency['parameterCode'].toString(), route: model.itemMedicineListRoute.length == 1 - ? model.itemMedicineListRoute[0]['parameterCode'] - .toString() + ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), drugId: _selectedMedication.itemId.toString(), strength: strengthController.text, @@ -1682,8 +1336,7 @@ class _PrescriptionFormWidgetState extends State { // // return selected; // // } - getPriscriptionforDrug( - List prescriptionList, MedicineViewModel model) { + getPriscriptionforDrug(List prescriptionList, MedicineViewModel model) { var prescriptionDetails = []; if (prescriptionList.length > 0) { prescriptionList[0].entityList.forEach((element) { diff --git a/pubspec.lock b/pubspec.lock index ad16d0c2..613c2753 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -587,7 +587,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: