diff --git a/package-lock.json b/package-lock.json index dec462f006f..14fd0262607 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19258,4 +19258,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/Components/ExternalResult/ResultUpdate.tsx b/src/Components/ExternalResult/ResultUpdate.tsx index 482c320457e..3e892940ac8 100644 --- a/src/Components/ExternalResult/ResultUpdate.tsx +++ b/src/Components/ExternalResult/ResultUpdate.tsx @@ -289,7 +289,7 @@ export default function UpdateResult(props: any) { ]} value={state.form.patient_created} onChange={handleChange} - optionDisplay={(option) => option.label} + optionLabel={(option) => option.label} optionValue={(option) => option.value} error={state.errors.patient_created} /> diff --git a/src/Components/Facility/FacilityCreate.tsx b/src/Components/Facility/FacilityCreate.tsx index a2ef08b7679..73d108dd216 100644 --- a/src/Components/Facility/FacilityCreate.tsx +++ b/src/Components/Facility/FacilityCreate.tsx @@ -929,7 +929,7 @@ export const FacilityCreate = (props: FacilityProps) => { {...field("kasp_empanelled")} label={`Is this facility ${careConfig.kasp.string} empanelled?`} options={[true, false]} - optionDisplay={(o) => (o ? "Yes" : "No")} + optionLabel={(o) => (o ? "Yes" : "No")} optionValue={(o) => String(o)} /> )} diff --git a/src/Components/Form/FormFields/RadioFormField.tsx b/src/Components/Form/FormFields/RadioFormField.tsx index c881bc66f94..ddb9178c6e9 100644 --- a/src/Components/Form/FormFields/RadioFormField.tsx +++ b/src/Components/Form/FormFields/RadioFormField.tsx @@ -5,7 +5,7 @@ import { FormFieldBaseProps, useFormFieldPropsResolver } from "./Utils"; type Props = FormFieldBaseProps & { options: readonly T[]; - optionDisplay: (option: T) => React.ReactNode; + optionLabel: (option: T) => React.ReactNode; optionValue: (option: T) => V; containerClassName?: string; unselectLabel?: string; @@ -47,7 +47,7 @@ const RadioFormField = (props: Props) => { { label="Frequency" name="insulin_intake_frequency" options={INSULIN_INTAKE_FREQUENCY_OPTIONS} - optionDisplay={(c) => t(`INSULIN_INTAKE_FREQUENCY__${c}`)} + optionLabel={(c) => t(`INSULIN_INTAKE_FREQUENCY__${c}`)} optionValue={(c) => c} value={log.insulin_intake_frequency} onChange={(c) => diff --git a/src/Components/LogUpdate/Sections/NeurologicalMonitoring.tsx b/src/Components/LogUpdate/Sections/NeurologicalMonitoring.tsx index 0d237aafd49..7ef98c4010b 100644 --- a/src/Components/LogUpdate/Sections/NeurologicalMonitoring.tsx +++ b/src/Components/LogUpdate/Sections/NeurologicalMonitoring.tsx @@ -31,7 +31,7 @@ const NeurologicalMonitoring = ({ log, onChange }: LogUpdateSectionProps) => { t(`CONSCIOUSNESS_LEVEL__${c.value}`)} + optionLabel={(c) => t(`CONSCIOUSNESS_LEVEL__${c.value}`)} optionValue={(c) => c.value} value={log.consciousness_level} onChange={(c) => @@ -60,7 +60,7 @@ const NeurologicalMonitoring = ({ log, onChange }: LogUpdateSectionProps) => { (o) => o.value !== "UNKNOWN", )} id={`${d}_reaction`} - optionDisplay={(c) => t(`PUPIL_REACTION__${c.value}`)} + optionLabel={(c) => t(`PUPIL_REACTION__${c.value}`)} optionValue={(c) => c.value} name={`${d}_pupil_light_reaction`} value={log[`${d}_pupil_light_reaction`]} @@ -98,7 +98,7 @@ const NeurologicalMonitoring = ({ log, onChange }: LogUpdateSectionProps) => { Eye Opening Response} options={EYE_OPEN_SCALE} - optionDisplay={(c) => c.value + " - " + c.text} + optionLabel={(c) => c.value + " - " + c.text} optionValue={(c) => `${c.value}`} name="eye_opening_response" value={`${log.glasgow_eye_open}`} @@ -110,7 +110,7 @@ const NeurologicalMonitoring = ({ log, onChange }: LogUpdateSectionProps) => { Verbal Response} options={VERBAL_RESPONSE_SCALE} - optionDisplay={(c) => c.value + " - " + c.text} + optionLabel={(c) => c.value + " - " + c.text} optionValue={(c) => `${c.value}`} name="verbal_response" value={`${log.glasgow_verbal_response}`} @@ -124,7 +124,7 @@ const NeurologicalMonitoring = ({ log, onChange }: LogUpdateSectionProps) => { Motor Response} options={MOTOR_RESPONSE_SCALE} - optionDisplay={(c) => c.value + " - " + c.text} + optionLabel={(c) => c.value + " - " + c.text} optionValue={(c) => `${c.value}`} name="motor_response" value={`${log.glasgow_motor_response}`} @@ -164,7 +164,7 @@ const NeurologicalMonitoring = ({ log, onChange }: LogUpdateSectionProps) => { } options={LIMB_RESPONSE_OPTIONS.filter((o) => o.value !== "UNKNOWN")} - optionDisplay={(c) => t(`LIMB_RESPONSE__${c.value}`)} + optionLabel={(c) => t(`LIMB_RESPONSE__${c.value}`)} optionValue={(c) => c.value} name={key} value={log[key]} diff --git a/src/Components/LogUpdate/Sections/RespiratorySupport/OxygenSupport.tsx b/src/Components/LogUpdate/Sections/RespiratorySupport/OxygenSupport.tsx index cefcf2ddb0e..758b49613ce 100644 --- a/src/Components/LogUpdate/Sections/RespiratorySupport/OxygenSupport.tsx +++ b/src/Components/LogUpdate/Sections/RespiratorySupport/OxygenSupport.tsx @@ -13,7 +13,7 @@ const OxygenRespiratorySupport = ({ log, onChange }: LogUpdateSectionProps) => { Oxygen Modality} options={OXYGEN_MODALITY_OPTIONS} - optionDisplay={(c) => t(`OXYGEN_MODALITY__${c.value}`)} + optionLabel={(c) => t(`OXYGEN_MODALITY__${c.value}`)} optionValue={(c) => c.value} name="ventilator_oxygen_modality" value={log.ventilator_oxygen_modality} diff --git a/src/Components/LogUpdate/Sections/RespiratorySupport/index.tsx b/src/Components/LogUpdate/Sections/RespiratorySupport/index.tsx index 8d558820843..6c58d0bfa72 100644 --- a/src/Components/LogUpdate/Sections/RespiratorySupport/index.tsx +++ b/src/Components/LogUpdate/Sections/RespiratorySupport/index.tsx @@ -57,7 +57,7 @@ const RespiratorySupport = ({ log, onChange }: LogUpdateSectionProps) => { label="Bilateral Air Entry" labelClassName="text-lg sm:font-bold" options={[true, false]} - optionDisplay={(c) => (c ? "Yes" : "No")} + optionLabel={(c) => (c ? "Yes" : "No")} optionValue={(c) => JSON.stringify(c)} name="bilateral_air_entry" value={ @@ -90,7 +90,7 @@ const RespiratorySupport = ({ log, onChange }: LogUpdateSectionProps) => { Respiratory Support} options={RESPIRATORY_SUPPORT} - optionDisplay={(c) => t(`RESPIRATORY_SUPPORT__${c.value}`)} + optionLabel={(c) => t(`RESPIRATORY_SUPPORT__${c.value}`)} optionValue={(c) => c.value} name="respiratory_support" value={log.ventilator_interface} diff --git a/src/Components/LogUpdate/Sections/Vitals.tsx b/src/Components/LogUpdate/Sections/Vitals.tsx index 1fa4b3f3aac..8592f004370 100644 --- a/src/Components/LogUpdate/Sections/Vitals.tsx +++ b/src/Components/LogUpdate/Sections/Vitals.tsx @@ -140,7 +140,7 @@ const Vitals = ({ log, onChange }: LogUpdateSectionProps) => { label={t("heartbeat_rhythm")} name="heartbeat-rythm" options={HEARTBEAT_RHYTHM_CHOICES} - optionDisplay={(c) => t(`HEARTBEAT_RHYTHM__${c}`)} + optionLabel={(c) => t(`HEARTBEAT_RHYTHM__${c}`)} optionValue={(c) => c} value={log.rhythm} onChange={(c) => onChange({ rhythm: c.value ?? undefined })} diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index 0f0c7396f5e..7335e5c6983 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -770,7 +770,7 @@ export const DailyRounds = (props: any) => { label: t(`CONSCIOUSNESS_LEVEL__${level.value}`), value: level.value, }))} - optionDisplay={(option) => option.label} + optionLabel={(option) => option.label} optionValue={(option) => option.value} unselectLabel="Unknown" layout="vertical" diff --git a/src/Components/Patient/PatientRegister.tsx b/src/Components/Patient/PatientRegister.tsx index c25a6365e70..4472baae39c 100644 --- a/src/Components/Patient/PatientRegister.tsx +++ b/src/Components/Patient/PatientRegister.tsx @@ -1468,7 +1468,7 @@ export const PatientRegister = (props: PatientRegisterProps) => { { label: "Yes", value: "true" }, { label: "No", value: "false" }, ]} - optionDisplay={(option) => option.label} + optionLabel={(option) => option.label} optionValue={(option) => option.value} /> @@ -1501,7 +1501,7 @@ export const PatientRegister = (props: PatientRegisterProps) => { { label: "Yes", value: "true" }, { label: "No", value: "false" }, ]} - optionDisplay={(option) => option.label} + optionLabel={(option) => option.label} optionValue={(option) => option.value} /> @@ -1781,7 +1781,7 @@ export const PatientRegister = (props: PatientRegisterProps) => { { label: "Yes", value: "true" }, { label: "No", value: "false" }, ]} - optionDisplay={(option) => option.label} + optionLabel={(option) => option.label} optionValue={(option) => option.value} /> @@ -1815,7 +1815,7 @@ export const PatientRegister = (props: PatientRegisterProps) => { value: "3", }, ]} - optionDisplay={(option) => option.label} + optionLabel={(option) => option.label} optionValue={(option) => option.value} /> @@ -1850,7 +1850,7 @@ export const PatientRegister = (props: PatientRegisterProps) => { { label: "Yes", value: "true" }, { label: "No", value: "false" }, ]} - optionDisplay={(option) => option.label} + optionLabel={(option) => option.label} optionValue={(option) => option.value} /> (o ? t("yes") : t("no"))} + optionLabel={(o) => (o ? t("yes") : t("no"))} optionValue={(o) => String(o)} value={state.form.emergency} onChange={handleChange} diff --git a/src/Components/Resource/ResourceDetailsUpdate.tsx b/src/Components/Resource/ResourceDetailsUpdate.tsx index 178ab596148..6d293f05df5 100644 --- a/src/Components/Resource/ResourceDetailsUpdate.tsx +++ b/src/Components/Resource/ResourceDetailsUpdate.tsx @@ -298,7 +298,7 @@ export const ResourceDetailsUpdate = (props: resourceProps) => { onChange={handleChange} label={"Is this an emergency?"} options={[true, false]} - optionDisplay={(o) => (o ? "Yes" : "No")} + optionLabel={(o) => (o ? "Yes" : "No")} optionValue={(o) => String(o)} value={String(state.form.emergency)} error={state.errors.emergency} diff --git a/src/Components/Shifting/ShiftDetailsUpdate.tsx b/src/Components/Shifting/ShiftDetailsUpdate.tsx index 8e6fb582906..ccf808ecda9 100644 --- a/src/Components/Shifting/ShiftDetailsUpdate.tsx +++ b/src/Components/Shifting/ShiftDetailsUpdate.tsx @@ -420,7 +420,7 @@ export const ShiftDetailsUpdate = (props: patientShiftProps) => { { label: t("yes"), value: "true" }, { label: t("no"), value: "false" }, ]} - optionDisplay={(option) => option.label} + optionLabel={(option) => option.label} optionValue={(option) => option.value} /> @@ -434,7 +434,7 @@ export const ShiftDetailsUpdate = (props: patientShiftProps) => { { label: t("no"), value: "false" }, ]} optionValue={(option) => option.value} - optionDisplay={(option) => option.label} + optionLabel={(option) => option.label} onChange={handleFormFieldChange} /> )} @@ -448,7 +448,7 @@ export const ShiftDetailsUpdate = (props: patientShiftProps) => { { label: t("no"), value: "false" }, ]} optionValue={(option) => option.value} - optionDisplay={(option) => option.label} + optionLabel={(option) => option.label} onChange={handleFormFieldChange} />