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..ed22d4ff9 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 @@ -25,11 +25,17 @@ export const NameField = () => { }, } = useConfig() as RegistrationConfig; const { t } = useTranslation(); - const { setCapturePhotoProps, currentPhoto, setFieldValue } = useContext(PatientRegistrationContext); - const { fieldConfigurations } = useConfig(); + const { setCapturePhotoProps, currentPhoto, setFieldValue, initialFormValues } = + useContext(PatientRegistrationContext); + const { fieldConfigurations } = useConfig(); const fieldConfigs = fieldConfigurations?.name; const [{ value: unidentified }] = useField('unidentifiedPatient'); const nameKnown = !unidentified; + const showToggleUnknownName = + fieldConfigs?.unidentifiedPatient || + (initialFormValues?.familyName === 'UNKNOWN' && initialFormValues?.givenName === 'UNKNOWN') + ? true + : false; const onCapturePhoto = useCallback( (dataUri: string, photoDateTime: string) => { @@ -68,13 +74,20 @@ export const NameField = () => { )}
-
- {t('patientNameKnown', "Patient's Name is Known?")} -
- - - - + {showToggleUnknownName && ( + <> +
+ {t('patientNameKnown', "Patient's Name is Known?")} +
+ + + + + + )} {nameKnown && ( <>