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

(feat) O3-2100: Unknown patient name and estimated D.O.B config #697

Merged
merged 25 commits into from
Jul 11, 2023

Conversation

Jexsie
Copy link
Contributor

@Jexsie Jexsie commented May 15, 2023

Requirements

Summary

This PR introduces the allowing/ restricting of registering unidentified patients and patients with estimated date of birth using the configuration.

The new configuration points added are:

{
  "@openmrs/esm-patient-registration-app": {
    "fieldConfigurations": {
      "name": {
        "allowUnidentifiedPatients": true,
        ...
      },
      "dateOfBirth": {
        "allowEstimatedDateOfBirth": true
        ...
      }
    }
  }
}

Screenshots

image
image

None.

Related Issue

Other

None.

@Jexsie Jexsie force-pushed the name branch 2 times, most recently from d1f9b0a to 14d22a7 Compare May 15, 2023 16:25
@Jexsie Jexsie requested a review from mseaton May 15, 2023 16:34
@Jexsie Jexsie force-pushed the name branch 3 times, most recently from c882b5b to ad533c3 Compare May 17, 2023 07:48
@vasharma05 vasharma05 changed the title (fix) O3-2100: Unkown patient name and estimated D.O.B config (fix) O3-2100: Unknown patient name and estimated D.O.B config May 17, 2023
@vasharma05 vasharma05 marked this pull request as draft May 24, 2023 15:17
Copy link
Member

@ibacher ibacher left a comment

Choose a reason for hiding this comment

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

A few small things I noticed reading through this.

@vasharma05
Copy link
Member

Hi @ibacher !
For the estimated birthdates, the FHIR APIs only return the estimated year of birth and not the month of birth, even though we send the estimated dob to the backend.

@ibacher
Copy link
Member

ibacher commented May 25, 2023

For the estimated birthdates, the FHIR APIs only return the estimated year of birth and not the month of birth, even though we send the estimated dob to the backend.

It’s slightly more complicated than that. For patients 5 and under, it will return the year + month. But anyone six or older it just sends the year. This is because the WHO guidelines for children are broken down by month(s) for children up to 5 years of age. Past that, it’s an estimated birthdate, so including other date parts gives false precision (technically, we always store a full date).

From a user perspective, I wouldn’t expect anyone to estimate an age as “30 years and 2 months”. The “2 months” are very unlikely to be clinically significant. However, for toddlers, infants, and newborns, 2 months can very clinically significant, so we return that data.

@vasharma05
Copy link
Member

This clears a lot.
Thanks @ibacher !

@ibacher
Copy link
Member

ibacher commented May 25, 2023

I'm actually surprised no one had asked about that before...

@vasharma05 vasharma05 changed the title (fix) O3-2100: Unknown patient name and estimated D.O.B config (feat) O3-2100: Unknown patient name and estimated D.O.B config May 30, 2023
@vasharma05 vasharma05 requested a review from ibacher May 30, 2023 08:00
Copy link
Member

@ibacher ibacher left a comment

Choose a reason for hiding this comment

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

Looks like this is in good shape to me. A few comments / questions to make sure we're adhering to requirements.

packages/esm-patient-registration-app/src/config-schema.ts Outdated Show resolved Hide resolved
@@ -25,7 +25,8 @@ export const DobField: React.FC = () => {
const { t } = useTranslation();
const {
fieldConfigurations: { dateOfBirth },
} = useConfig() as RegistrationConfig;
} = useConfig<RegistrationConfig>();
const allowEstimatedBirthDate = dateOfBirth?.allowEstimatedDateOfBirth;
const [dobUnknown] = useField('birthdateEstimated');
const dobKnown = !dobUnknown.value;
Copy link
Member

Choose a reason for hiding this comment

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

It's a little weird to create a variable which is !dobUnknown.value and then use it as !dobKnown. It might read more clearly just to have dobUnknown.value in the OR, no?

Copy link
Member

Choose a reason for hiding this comment

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

Can this be addressed?

@denniskigen
Copy link
Member

@Jexsie, could you respond to the comments raised in the PR review?

@vasharma05 vasharma05 requested a review from ibacher July 9, 2023 12:31
@ibacher
Copy link
Member

ibacher commented Jul 11, 2023

Can we resolve the e2e tests? After that, this should be good to merge.

@vasharma05
Copy link
Member

Hi @ibacher !
I tried to fix the tests for the past 2 hours, but due to lack of knowledge, I am not able to fix it.
I request you to please let the PR be merged with the test, and I'll cover this test along with the tests related to patient management.
Thanks!

@vasharma05
Copy link
Member

This is required for Cambodia's latest server.
Can you please take the PR ahead for now?
Thanks!

@ibacher
Copy link
Member

ibacher commented Jul 11, 2023

Can you please take the PR ahead for now?

So, one very small comment I had initially left; once that's addressed, I'm happy to merge this in and follow-up on the e2e tests later.

@vasharma05
Copy link
Member

I've made the requested changes @ibacher !

@ibacher
Copy link
Member

ibacher commented Jul 11, 2023

Looks like a syntax error...

@vasharma05
Copy link
Member

vasharma05 commented Jul 11, 2023

Fixed the error @ibacher and tested the changes locally too.

@ibacher ibacher merged commit 7dbf922 into openmrs:main Jul 11, 2023
6 of 7 checks passed
ayush-AI pushed a commit to ayush-AI/openmrs-esm-patient-management that referenced this pull request Jul 13, 2023
anjula-sack added a commit that referenced this pull request Jul 13, 2023
* added test for utils.ts

* resolved review commits

* (feat) Remove filtering todays queue entries on frontend (#752)

* (refactor): Display all active visits by removing filter for showing only today's active visits (#755)

* (refactor): changed  activeVisits.idNumber assignment for improved code robustness (#756)

* (feat) O3-2100: Unknown patient name and estimated DOB config (#697)

Co-authored-by: Vineet Sharma <[email protected]>

* (test) O3-2225/6: Add tests for cancel-patient-edit.component and delete-identifier-confirmation-modal (#750)

* removed the extra types

---------

Co-authored-by: Anjula Shanaka <[email protected]>
Co-authored-by: Dennis Kigen <[email protected]>
Co-authored-by: CynthiaKamau <[email protected]>
Co-authored-by: Donald Kibet <[email protected]>
Co-authored-by: Jexsie <[email protected]>
Co-authored-by: Vineet Sharma <[email protected]>
ayush-AI pushed a commit to ayush-AI/openmrs-esm-patient-management that referenced this pull request Jul 13, 2023
ayush-AI added a commit to ayush-AI/openmrs-esm-patient-management that referenced this pull request Jul 13, 2023
* added test for utils.ts

* resolved review commits

* (feat) Remove filtering todays queue entries on frontend (openmrs#752)

* (refactor): Display all active visits by removing filter for showing only today's active visits (openmrs#755)

* (refactor): changed  activeVisits.idNumber assignment for improved code robustness (openmrs#756)

* (feat) O3-2100: Unknown patient name and estimated DOB config (openmrs#697)

Co-authored-by: Vineet Sharma <[email protected]>

* (test) O3-2225/6: Add tests for cancel-patient-edit.component and delete-identifier-confirmation-modal (openmrs#750)

* removed the extra types

---------

Co-authored-by: Anjula Shanaka <[email protected]>
Co-authored-by: Dennis Kigen <[email protected]>
Co-authored-by: CynthiaKamau <[email protected]>
Co-authored-by: Donald Kibet <[email protected]>
Co-authored-by: Jexsie <[email protected]>
Co-authored-by: Vineet Sharma <[email protected]>
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.

6 participants