-
Notifications
You must be signed in to change notification settings - Fork 233
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
Conversation
Hi @chibongho , @mseaton , @mogoodrich , @brandones , @vasharma05 , @usamaidrsk.Please share your feedback. |
packages/esm-ward-app/src/ward-patient-card/row-elements/ward-patient-identifier.tsx
Outdated
Show resolved
Hide resolved
packages/esm-ward-app/src/ward-patient-card/row-elements/ward-patient-identifier.tsx
Outdated
Show resolved
Hide resolved
export const defaultPatientCardElementConfig: PatientCardElementConfig = { | ||
addressFields: defaultPatientAddressFields, | ||
identifierTypeUuid: defaultIdentifierTypeUuid, |
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'd just make this set to null
by default, and have the element use the preferred patient identifier by default. (See comment below)
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.
Agreed. Without a specific identifierType configured, it should not default to restrict to a particular type
export const defaultPatientCardElementConfig: PatientCardElementConfig = { | ||
addressFields: defaultPatientAddressFields, | ||
identifierTypeUuid: defaultIdentifierTypeUuid, |
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.
Agreed. Without a specific identifierType configured, it should not default to restrict to a particular type
packages/esm-ward-app/src/ward-patient-card/row-elements/ward-patient-identifier.tsx
Outdated
Show resolved
Hide resolved
packages/esm-ward-app/src/ward-patient-card/row-elements/ward-patient-identifier.tsx
Outdated
Show resolved
Hide resolved
|
||
return ( | ||
<div> | ||
<Tag>{`${patientIdentifier?.identifierType.name}:`}</Tag> |
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 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.
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.
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.
46714ea
to
d5e78f3
Compare
d5e78f3
to
d525e31
Compare
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 |
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.
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."
@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. |
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.
Looks good, although failing on E2E tests. I'll take a look into why.
Requirements
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