-
Notifications
You must be signed in to change notification settings - Fork 248
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) add config to display encounter type in generic widgets #1450
(feat) add config to display encounter type in generic widgets #1450
Conversation
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 @icrc-jofrancisco! This mostly looks good. One small thing and one slightly bigger thing.
I would probably make useObs()
look like this:
export const useObs(patientUuid: string, includeEncounters: boolean = false) {
return includeEncounters ? useObsWithEncounters(patientUuid)) : useObsOnly(patientUuid);
}
The common stuff can be factored out into functions. For handling the obs, just take an optional callback that can add the encounter name to the obs result.
Also, please fix the typescript errors, if possible.
packages/esm-generic-patient-widgets-app/src/obs-table/obs-table.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-generic-patient-widgets-app/src/resources/useObs.ts
Outdated
Show resolved
Hide resolved
I don't think splitting it into two functions as suggested would have the most optimized version, because there are filters. However, I made a change to prevent encounters from being processed when they don't need to be. Could you review it again and see if it okay? Thank you @ibacher |
Requirements
Summary
This pull request introduces a new configuration option to the generic patient widgets, allowing users to display the encounter type column. By default, this feature is turned off, and to enable it, you can set the
showEncounterType
property totrue
.eg:
Screenshots
Related Issue
--
Other
--
I'm requesting a review of this pull request to ensure the changes are in line with our project's standards and requirements.
Thanks,
CC: @ibacher