-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
(feat) O3-4078 - Ward App - Simplify patient card configurations #1339
Conversation
Size Change: -119 kB (-1.8%) Total Size: 6.46 MB
ℹ️ View Unchanged
|
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.
Thanks for slogging through this, @chibongho ! Yeah, I didn't make it 100% through this, but generally looks good and I agreed with the strategy based on our discussion earlier this week about this.
identifierElementDefinitions: Array<IdentifierElementDefinition>; | ||
addressElementDefinitions: Array<AddressElementDefinition>; | ||
cardDefinitions: Array<WardPatientCardDefinition>; | ||
patientCardElements: { |
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.
Potential rabbit-hole... I guess I was thinking that each WardView would have it's own config object? When we get to the point where a custom WardView can be defined outside the Ward App ESM, is there a way for the developers of new Ward Views to define new config parameters without adding to the Ward View config? (For discussion, let's not let this be a blocker for merging)
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.
For a custom WardView outside this ESM, it can have patient cards with a mixture of elements defined in this ESM and outside it. I think ideally we'd have the elements configurations be tied to whichever ESM it's defined in. We'll want to be careful as what useConfig()
returns is dependent on which ESM / extension the component is in. I haven't done something like this before, but it feels doable.
obsElementDefinitions: { | ||
patientCardElements: { | ||
_description: | ||
'Configuration of various patient card elements. Each configured element must have an unique id, defined in the ward React component being used.', |
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.
Fixing some small grammar:
Configuration of various patient card elements. Each configured element must have a unique id, defined in the ward React component being used.
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.
If we could have a way to automatically generate the keys, it would significantly reduce the risk of human error.
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.
If we could have a way to automatically generate the keys, it would significantly reduce the risk of human error.
This might be difficult, with how the ward view can be an extension outside the ward app.
_type: Type.Array, | ||
_description: `Defines patient identifier elements that can be included in the card header or footer. The default element 'patient-identifier' displays the preferred identifier.`, | ||
_description: `Configures patient identifier to display. An unconfigured element displays the preferred identifier.`, | ||
_default: [ |
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 like the _default
should be an empty array, provided the default object passed is missing some keys i.e identifierTypeUuid
} | ||
|
||
export interface PendingItemsDefinition { | ||
export interface PendingItemsElementConfig { |
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 think you missed the id
here.
id: string; | ||
fields: Array<AddressField>; | ||
} | ||
|
||
export interface WardPatientCardDefinition { | ||
export interface AdmissionRequestNoteElementConfig { |
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.
Same here, id
was missed.
Thanks @chibongho , I have a few comments. |
Thanks for the comments. I was getting a bit sloppy with the config documentations. I'm going to merge this in. Post-hoc comments welcome. |
Requirements
Summary
See O3-4078 and relevant slack thread.
This refactoring touches a lot of files (sorry), but there is almost no functional change besides how we configure the patient cards.
DefaultWardView
andMaternalWardView
both define their own data fetching and card rendering. What elements appear in those cards are hard-coded (thus not configurable). If another implementation wants a different looking ward, they will need to make their own WardView. (Currently, they can only make that within the esm ward app).DefaultWardView
orMaternalWardView
, and the element configuration requires specifying the id. This means whoever is configuring the elements will need to know what id's are hard-coded into the WardView they want to use.Most relevant files to review:
With this change, the configuration for maternal wards in MCOE is simpler:
Screenshots
Related Issue
Other
I introduced a bug with the baby row appearing twice within a mother's patient card sometimes (highlighted in screenshot). I will address that in this ticket.