-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(feat) O3-4065 Allow manual entry of auto generated identifiers #1338
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ynurmahomed ... I defer to others regarding the code, but asked a question regarding the need for a new config parameter (see my comment)
const { identifierTypes } = useContext(ResourcesContext); | ||
const { isOffline, values, setFieldValue } = useContext(PatientRegistrationContext); | ||
const identifierType = useMemo( | ||
() => identifierTypes.find((identifierType) => identifierType.uuid === patientIdentifier.identifierTypeUuid), | ||
[patientIdentifier, identifierTypes], | ||
); | ||
const { autoGeneration, initialValue, identifierValue, identifierName, required } = patientIdentifier; | ||
const manualEntryEnabled = | ||
fieldConfigurations.id.allowAutoGenerationManualEntry && selectedSource?.autoGenerationOption?.manualEntryEnabled; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there reason we need to add the new O3 config property here (ie "allowAutoGenerationManulEntry") instead of entirely relying on the "autogenerationOption.manualEntryEnabled" config that comes from the IDGen module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mogoodrich The config property is because I was not sure if this feat should be enabled by default. It can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we need extra configuration here. Makes sense to remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Couple of small things, but mostly looks good.
<p className={styles.label}>{identifierName}</p> | ||
<p data-testid="identifier-label" className={styles.bodyShort02}> | ||
<p data-testid="identifier-label" className={styles.label}> | ||
{required ? identifierName : `${identifierName} (${t('optional', 'optional')})`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Different languages have different requirements around word order, so it would be better to make this whole thing translatable. See the i18next docs.
const { identifierTypes } = useContext(ResourcesContext); | ||
const { isOffline, values, setFieldValue } = useContext(PatientRegistrationContext); | ||
const identifierType = useMemo( | ||
() => identifierTypes.find((identifierType) => identifierType.uuid === patientIdentifier.identifierTypeUuid), | ||
[patientIdentifier, identifierTypes], | ||
); | ||
const { autoGeneration, initialValue, identifierValue, identifierName, required } = patientIdentifier; | ||
const manualEntryEnabled = | ||
fieldConfigurations.id.allowAutoGenerationManualEntry && selectedSource?.autoGenerationOption?.manualEntryEnabled; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we need extra configuration here. Makes sense to remove it.
Interpolate optional identifier label
@ibacher I implemented the review comments. Not sure why E2E tests are failing. |
@ynurmahomed looks like something went wonky in the CI (likely resources ran out - nothing related to your changes). I've restarted the build. |
Requirements
Summary
Screenshots
Related Issue
Other