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-3243: Ward App - add configurable extension to include patient identifier #1197

Merged
merged 6 commits into from
Jul 24, 2024

Conversation

kb019
Copy link
Contributor

@kb019 kb019 commented Jun 20, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

Ability to incoporate patient-identifier into the patient card header.If multiple identifiers are found for the same identifier type,then the once which has preffered:true takes precedence,else if both the identifiers have same precedence the one with the most recent date takes precedence.

Related Issue

https://openmrs.atlassian.net/browse/O3-3243

@kb019
Copy link
Contributor Author

kb019 commented Jun 20, 2024

Hi @chibongho , @mseaton , @mogoodrich , @brandones , @vasharma05 , @usamaidrsk.Please share your feedback.

export const defaultPatientCardElementConfig: PatientCardElementConfig = {
addressFields: defaultPatientAddressFields,
identifierTypeUuid: defaultIdentifierTypeUuid,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd just make this set to null by default, and have the element use the preferred patient identifier by default. (See comment below)

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. Without a specific identifierType configured, it should not default to restrict to a particular type

packages/esm-ward-app/src/config-schema.ts Outdated Show resolved Hide resolved
packages/esm-ward-app/src/config-schema.ts Outdated Show resolved Hide resolved
export const defaultPatientCardElementConfig: PatientCardElementConfig = {
addressFields: defaultPatientAddressFields,
identifierTypeUuid: defaultIdentifierTypeUuid,
Copy link
Member

Choose a reason for hiding this comment

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

Agreed. Without a specific identifierType configured, it should not default to restrict to a particular type

packages/esm-ward-app/src/config-schema.ts Outdated Show resolved Hide resolved

return (
<div>
<Tag>{`${patientIdentifier?.identifierType.name}:`}</Tag>
Copy link
Member

Choose a reason for hiding this comment

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

I would not assume that we always want to display the identifier type name, and even if we did want to always have a label, identifierType name may not be appropriate as it is not localized.

We will want to do something like what @chibongho is doing with the obs element, where one can configure a custom label, or no label, or choose (via configuration) to use the type as the label.

Copy link
Contributor Author

@kb019 kb019 Jun 20, 2024

Choose a reason for hiding this comment

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

hi @mseaton , i have made the changes for displaying patient identifier name with the value specified in config. Please let me know for any other changes. Thank you.

@kb019 kb019 force-pushed the feat/patientIdentifier branch 2 times, most recently from 46714ea to d5e78f3 Compare June 20, 2024 16:03
@kb019 kb019 requested review from chibongho and mseaton June 20, 2024 16:22
@kb019 kb019 force-pushed the feat/patientIdentifier branch from d5e78f3 to d525e31 Compare June 20, 2024 17:55
import { useTranslation } from 'react-i18next';

const identifierCompareFunction = (pi1: PatientIdentifier, pi2: PatientIdentifier) => {
//check if preferred is set to true in any of patient identifier, if preferred is true
Copy link
Contributor

Choose a reason for hiding this comment

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

comment on the intent instead of what the code is doing line-by-line. Something like "sort the identifiers by preferred first, then (dateChanged or dateCreated) in descending order."

packages/esm-ward-app/src/config-schema.ts Outdated Show resolved Hide resolved
packages/esm-ward-app/src/config-schema.ts Outdated Show resolved Hide resolved
@brandones
Copy link
Contributor

@chibongho @kb019 What's the next step on this?

@kb019
Copy link
Contributor Author

kb019 commented Jul 24, 2024

@chibongho @kb019 What's the next step on this?

Hi @brandones , sorry for late reply.I am not sure what are the next steps. I will defer that to @chibongho . But i have resolved the conflicts. Thanks.

Copy link
Contributor

@chibongho chibongho left a comment

Choose a reason for hiding this comment

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

Looks good, although failing on E2E tests. I'll take a look into why.

@chibongho chibongho self-requested a review July 24, 2024 23:31
@chibongho chibongho merged commit 80ef84c into openmrs:main Jul 24, 2024
6 checks passed
@denniskigen denniskigen mentioned this pull request Aug 29, 2024
3 tasks
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.

4 participants