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-3249: Introduce helper function to get well-formatted patient display name. #1003

Merged
merged 6 commits into from
May 21, 2024

Conversation

xprl-gjf
Copy link
Contributor

@xprl-gjf xprl-gjf commented May 19, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. Ensure your PR title includes a conventional commit label (such as feat, fix, or chore, among others). See existing PR titles for inspiration.

For changes to apps

If applicable

  • My work includes tests or is validated by existing tests.
  • I have updated the esm-framework mock to reflect any API changes I have made.
    (No API changes made)

Summary

FHIR patient responses may now include a well-formatted display name as per FM2-631.

Despite this, there are many locations in the O3 frontend where a patient name is displayed explicitly as ${givenName} ${familyName}.

In going through the codebase to fix this, it becomes apparent that there is value in adopting a consistent approach to getting the patient display name.

Screenshots

N/A

Related Issue

https://openmrs.atlassian.net/browse/O3-3249
https://openmrs.atlassian.net/browse/O3-2115

Other

I already have open pull requests on openmrs-esm-patient-management:

I will pause those changes until this pull request is completed.

@xprl-gjf
Copy link
Contributor Author

@ibacher I'd like to know if you think this is the correct place for this code, or should it be somewhere else such as esm-patient-common-lib. I don't know if esm-patient-common-lib is available for every module that needs this functionality, perhaps including cohort app, laboratory app, etc.

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.

Thanks @xprl-gjf! A couple of notes:

  1. This isn't a refactor at all. It's adding a new function to the library, so it's a (feat).
  2. We prefer to have tickets versus just PRs (the description here is fine for a ticket).
  3. When adding a new file to one of the libraries, please include a /** @category */ comment at the top.
  4. Remember to actually run the commit scripts, particularly the documentation script.

packages/framework/esm-utils/src/patient-helpers.ts Outdated Show resolved Hide resolved
packages/framework/esm-utils/src/patient-helpers.ts Outdated Show resolved Hide resolved
@ibacher
Copy link
Member

ibacher commented May 20, 2024

PS Yes, it's perfectly acceptable to put something like this here.

@xprl-gjf xprl-gjf changed the title (refactor) Introduce helper function to get well-formatted patient display name. (feat) Introduce helper function to get well-formatted patient display name. May 20, 2024
@xprl-gjf xprl-gjf changed the title (feat) Introduce helper function to get well-formatted patient display name. (feat) O3-3249: Introduce helper function to get well-formatted patient display name. May 20, 2024
@xprl-gjf xprl-gjf requested a review from ibacher May 21, 2024 03:53
@ibacher ibacher merged commit 27ab80e into openmrs:main May 21, 2024
11 checks passed
@xprl-gjf xprl-gjf deleted the patient-helpers branch May 23, 2024 00:46
@gracepotma
Copy link
Contributor

Wow, thank you @xprl-gjf!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants