diff --git a/packages/esm-patient-registration-app/src/patient-registration/field/dob/dob.component.tsx b/packages/esm-patient-registration-app/src/patient-registration/field/dob/dob.component.tsx index a3db5b409..0b536802b 100644 --- a/packages/esm-patient-registration-app/src/patient-registration/field/dob/dob.component.tsx +++ b/packages/esm-patient-registration-app/src/patient-registration/field/dob/dob.component.tsx @@ -25,7 +25,8 @@ export const DobField: React.FC = () => { const { t } = useTranslation(); const { fieldConfigurations: { dateOfBirth }, - } = useConfig() as RegistrationConfig; + } = useConfig(); + const allowEstimatedBirthDate = dateOfBirth?.useEstimatedDateOfBirth?.enabled; const [dobUnknown] = useField('birthdateEstimated'); const dobKnown = !dobUnknown.value; const [birthdate, birthdateMeta] = useField('birthdate'); @@ -75,15 +76,17 @@ export const DobField: React.FC = () => { return (

{t('birthFieldLabelText', 'Birth')}

-
-
- {t('dobToggleLabelText', 'Date of Birth Known?')} + {allowEstimatedBirthDate && ( +
+
+ {t('dobToggleLabelText', 'Date of Birth Known?')} +
+ + + +
- - - - -
+ )} {dobKnown ? (
diff --git a/packages/esm-patient-registration-app/src/patient-registration/field/name/name-field.component.tsx b/packages/esm-patient-registration-app/src/patient-registration/field/name/name-field.component.tsx index a82244468..73a92bb22 100644 --- a/packages/esm-patient-registration-app/src/patient-registration/field/name/name-field.component.tsx +++ b/packages/esm-patient-registration-app/src/patient-registration/field/name/name-field.component.tsx @@ -26,8 +26,9 @@ export const NameField = () => { } = useConfig() as RegistrationConfig; const { t } = useTranslation(); const { setCapturePhotoProps, currentPhoto, setFieldValue } = useContext(PatientRegistrationContext); - const { fieldConfigurations } = useConfig(); + const { fieldConfigurations } = useConfig(); const fieldConfigs = fieldConfigurations?.name; + const allowUnknownName = fieldConfigs?.unidentifiedPatient; const [{ value: unidentified }] = useField('unidentifiedPatient'); const nameKnown = !unidentified; @@ -68,13 +69,17 @@ export const NameField = () => { )}
-
- {t('patientNameKnown', "Patient's Name is Known?")} -
- - - - + {allowUnknownName && ( + <> +
+ {t('patientNameKnown', "Patient's Name is Known?")} +
+ + + + + + )} {nameKnown && ( <>