Skip to content
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

fix: Clean up gender support in registration app #911

Merged
merged 4 commits into from
Dec 24, 2023
Merged

Conversation

brandones
Copy link
Contributor

Requirements

Summary

Improves the registration config schema gender options. Cleans up the gender-related code. Cleans up some other code. Re-instates a validator that got commented out for some reason.

@@ -383,21 +383,13 @@ export class FormManager {
// provide a valid fhir.Patient object. The various patient chart modules should be able to handle
// such missing props correctly (and should be updated if they don't).

// Gender in the original object only uses a single letter. fhir.Patient expects a full string.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "original object" gender uses the full lowercase name, as FHIR expects.

@@ -60,7 +60,6 @@ function renderDob() {
identifierTypes: [],
values: formValues,
validationSchema: null,
setValidationSchema: (value) => {},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't imagine why the validationSchema had a setter. Anyway it was never used.

Copy link
Contributor

github-actions bot commented Dec 24, 2023

Size Change: -399 kB (-12%) 👏

Total Size: 2.84 MB

Filename Size Change
packages/esm-appointments-app/dist/549.js 0 B -246 kB (removed) 🏆
packages/esm-service-queues-app/dist/794.js 0 B -161 kB (removed) 🏆
ℹ️ View Unchanged
Filename Size Change
packages/esm-active-visits-app/dist/130.js 109 kB +1.25 kB (+1%)
packages/esm-active-visits-app/dist/255.js 2.21 kB 0 B
packages/esm-active-visits-app/dist/277.js 12.4 kB +4 B (0%)
packages/esm-active-visits-app/dist/316.js 42.9 kB 0 B
packages/esm-active-visits-app/dist/319.js 631 B 0 B
packages/esm-active-visits-app/dist/382.js 1.15 kB 0 B
packages/esm-active-visits-app/dist/460.js 727 B 0 B
packages/esm-active-visits-app/dist/574.js 553 B 0 B
packages/esm-active-visits-app/dist/588.js 6.66 kB 0 B
packages/esm-active-visits-app/dist/629.js 50.9 kB 0 B
packages/esm-active-visits-app/dist/635.js 1.15 kB 0 B
packages/esm-active-visits-app/dist/729.js 3.1 kB 0 B
packages/esm-active-visits-app/dist/757.js 649 B 0 B
packages/esm-active-visits-app/dist/784.js 2.63 kB 0 B
packages/esm-active-visits-app/dist/788.js 551 B 0 B
packages/esm-active-visits-app/dist/807.js 864 B 0 B
packages/esm-active-visits-app/dist/833.js 669 B 0 B
packages/esm-active-visits-app/dist/879.js 2.94 kB 0 B
packages/esm-active-visits-app/dist/main.js 67.6 kB +3 B (0%)
packages/esm-active-visits-app/dist/openmrs-esm-active-visits-app.js 3.33 kB +2 B (0%)
packages/esm-appointments-app/dist/130.js 109 kB +1.25 kB (+1%)
packages/esm-appointments-app/dist/152.js 257 B 0 B
packages/esm-appointments-app/dist/255.js 2.23 kB 0 B
packages/esm-appointments-app/dist/303.js 258 B 0 B
packages/esm-appointments-app/dist/319.js 1.99 kB 0 B
packages/esm-appointments-app/dist/460.js 2.18 kB 0 B
packages/esm-appointments-app/dist/469.js 6.65 kB 0 B
packages/esm-appointments-app/dist/530.js 246 kB 0 B
packages/esm-appointments-app/dist/574.js 1.74 kB 0 B
packages/esm-appointments-app/dist/591.js 16.9 kB 0 B
packages/esm-appointments-app/dist/610.js 6.71 kB 0 B
packages/esm-appointments-app/dist/729.js 3.1 kB 0 B
packages/esm-appointments-app/dist/757.js 1.75 kB 0 B
packages/esm-appointments-app/dist/784.js 2.63 kB 0 B
packages/esm-appointments-app/dist/788.js 1.75 kB 0 B
packages/esm-appointments-app/dist/799.js 48.2 kB +36 B (0%)
packages/esm-appointments-app/dist/80.js 2.53 kB +6 B (0%)
packages/esm-appointments-app/dist/807.js 2.4 kB 0 B
packages/esm-appointments-app/dist/833.js 1.99 kB 0 B
packages/esm-appointments-app/dist/main.js 298 kB +31 B (0%)
packages/esm-appointments-app/dist/openmrs-esm-appointments-app.js 3.29 kB -1 B (0%)
packages/esm-patient-list-management-app/dist/130.js 109 kB +1.25 kB (+1%)
packages/esm-patient-list-management-app/dist/255.js 2.21 kB 0 B
packages/esm-patient-list-management-app/dist/319.js 1.5 kB 0 B
packages/esm-patient-list-management-app/dist/382.js 1.15 kB 0 B
packages/esm-patient-list-management-app/dist/460.js 1.69 kB 0 B
packages/esm-patient-list-management-app/dist/493.js 21.6 kB +7 B (0%)
packages/esm-patient-list-management-app/dist/497.js 104 kB 0 B
packages/esm-patient-list-management-app/dist/574.js 1.31 kB 0 B
packages/esm-patient-list-management-app/dist/588.js 6.66 kB 0 B
packages/esm-patient-list-management-app/dist/591.js 16.9 kB 0 B
packages/esm-patient-list-management-app/dist/635.js 1.15 kB 0 B
packages/esm-patient-list-management-app/dist/716.js 4.65 kB 0 B
packages/esm-patient-list-management-app/dist/729.js 3.1 kB 0 B
packages/esm-patient-list-management-app/dist/757.js 1.47 kB 0 B
packages/esm-patient-list-management-app/dist/784.js 2.64 kB 0 B
packages/esm-patient-list-management-app/dist/788.js 1.3 kB 0 B
packages/esm-patient-list-management-app/dist/807.js 1.81 kB 0 B
packages/esm-patient-list-management-app/dist/833.js 1.55 kB 0 B
packages/esm-patient-list-management-app/dist/main.js 129 kB +7 B (0%)
packages/esm-patient-list-management-app/dist/openmrs-esm-patient-list-management-app.js 3.3 kB +1 B (0%)
packages/esm-patient-registration-app/dist/130.js 109 kB +1.25 kB (+1%)
packages/esm-patient-registration-app/dist/152.js 262 B 0 B
packages/esm-patient-registration-app/dist/255.js 2.21 kB 0 B
packages/esm-patient-registration-app/dist/303.js 260 B 0 B
packages/esm-patient-registration-app/dist/319.js 1.74 kB 0 B
packages/esm-patient-registration-app/dist/438.js 35.8 kB +196 B (+1%)
packages/esm-patient-registration-app/dist/460.js 1.79 kB 0 B
packages/esm-patient-registration-app/dist/492.js 118 kB -6 B (0%)
packages/esm-patient-registration-app/dist/537.js 2.35 kB +4 B (0%)
packages/esm-patient-registration-app/dist/574.js 1.49 kB 0 B
packages/esm-patient-registration-app/dist/591.js 16.9 kB 0 B
packages/esm-patient-registration-app/dist/62.js 6.86 kB 0 B
packages/esm-patient-registration-app/dist/729.js 3.1 kB 0 B
packages/esm-patient-registration-app/dist/735.js 464 B 0 B
packages/esm-patient-registration-app/dist/757.js 1.74 kB 0 B
packages/esm-patient-registration-app/dist/784.js 2.64 kB 0 B
packages/esm-patient-registration-app/dist/788.js 1.42 kB 0 B
packages/esm-patient-registration-app/dist/807.js 2.2 kB 0 B
packages/esm-patient-registration-app/dist/833.js 1.75 kB 0 B
packages/esm-patient-registration-app/dist/879.js 2.94 kB 0 B
packages/esm-patient-registration-app/dist/884.js 6.1 kB 0 B
packages/esm-patient-registration-app/dist/main.js 156 kB +27 B (0%)
packages/esm-patient-registration-app/dist/openmrs-esm-patient-registration-app.js 3.34 kB +1 B (0%)
packages/esm-patient-search-app/dist/130.js 109 kB +1.25 kB (+1%)
packages/esm-patient-search-app/dist/152.js 261 B 0 B
packages/esm-patient-search-app/dist/255.js 2.21 kB 0 B
packages/esm-patient-search-app/dist/303.js 260 B 0 B
packages/esm-patient-search-app/dist/319.js 936 B 0 B
packages/esm-patient-search-app/dist/382.js 1.15 kB 0 B
packages/esm-patient-search-app/dist/423.js 25.2 kB +5 B (0%)
packages/esm-patient-search-app/dist/460.js 1.06 kB 0 B
packages/esm-patient-search-app/dist/574.js 781 B 0 B
packages/esm-patient-search-app/dist/588.js 6.66 kB 0 B
packages/esm-patient-search-app/dist/591.js 16.9 kB 0 B
packages/esm-patient-search-app/dist/635.js 1.15 kB 0 B
packages/esm-patient-search-app/dist/729.js 3.1 kB 0 B
packages/esm-patient-search-app/dist/757.js 938 B 0 B
packages/esm-patient-search-app/dist/784.js 2.63 kB 0 B
packages/esm-patient-search-app/dist/788.js 776 B 0 B
packages/esm-patient-search-app/dist/807.js 1.11 kB 0 B
packages/esm-patient-search-app/dist/832.js 26 kB 0 B
packages/esm-patient-search-app/dist/833.js 964 B 0 B
packages/esm-patient-search-app/dist/main.js 54.5 kB +6 B (0%)
packages/esm-patient-search-app/dist/openmrs-esm-patient-search-app.js 3.34 kB 0 B
packages/esm-service-queues-app/dist/130.js 109 kB +1.25 kB (+1%)
packages/esm-service-queues-app/dist/152.js 262 B 0 B
packages/esm-service-queues-app/dist/255.js 2.23 kB 0 B
packages/esm-service-queues-app/dist/303.js 261 B 0 B
packages/esm-service-queues-app/dist/319.js 3.14 kB 0 B
packages/esm-service-queues-app/dist/328.js 3.09 kB +4 B (0%)
packages/esm-service-queues-app/dist/389.js 2.42 kB -1 B (0%)
packages/esm-service-queues-app/dist/425.js 2.06 kB +2 B (0%)
packages/esm-service-queues-app/dist/460.js 3.98 kB 0 B
packages/esm-service-queues-app/dist/469.js 6.66 kB 0 B
packages/esm-service-queues-app/dist/564.js 161 kB 0 B
packages/esm-service-queues-app/dist/574.js 3.14 kB 0 B
packages/esm-service-queues-app/dist/591.js 16.9 kB 0 B
packages/esm-service-queues-app/dist/610.js 6.71 kB 0 B
packages/esm-service-queues-app/dist/616.js 2.71 kB +5 B (0%)
packages/esm-service-queues-app/dist/694.js 2.64 kB 0 B
packages/esm-service-queues-app/dist/729.js 3.1 kB 0 B
packages/esm-service-queues-app/dist/757.js 3.14 kB 0 B
packages/esm-service-queues-app/dist/784.js 2.63 kB 0 B
packages/esm-service-queues-app/dist/788.js 3.13 kB 0 B
packages/esm-service-queues-app/dist/807.js 4.37 kB 0 B
packages/esm-service-queues-app/dist/833.js 3.63 kB 0 B
packages/esm-service-queues-app/dist/89.js 52.7 kB +8 B (0%)
packages/esm-service-queues-app/dist/981.js 2.93 kB +6 B (0%)
packages/esm-service-queues-app/dist/main.js 217 kB +4 B (0%)
packages/esm-service-queues-app/dist/openmrs-esm-service-queues-app.js 3.31 kB +1 B (0%)

compressed-size-action

is: true,
then: Yup.string().required('identifierValueRequired'),
otherwise: Yup.string().notRequired(),
export function getValidationSchema(config: RegistrationConfig) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sets us up for more validated form configurability :)

Copy link
Member

@denniskigen denniskigen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, @brandones. Could you look into the failing tests?. Does anything stand out for you, @ibacher?

@brandones
Copy link
Contributor Author

Whoops, my bad. I've got the tests failing locally. Fixing that up.

@brandones
Copy link
Contributor Author

Okay, fixed up the tests. Needs a core update though, pending openmrs/openmrs-esm-core#862 .

@denniskigen
Copy link
Member

I've just merged that PR

@denniskigen
Copy link
Member

Looks like e2e tests are failing because of gender labels

readonly sexRadioButton = (sex: PatientRegistrationSex) => this.page.locator(`label[for=${sex}]`);

@brandones
Copy link
Contributor Author

Thanks for pointing me to the place, @denniskigen ! Fixing.

@brandones brandones merged commit ac9eb39 into main Dec 24, 2023
6 checks passed
@brandones brandones deleted the registration-gender branch December 24, 2023 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants