-
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) O3-2953: Add the ability to edit and delete vitals and biometrics #1812
(feat) O3-2953: Add the ability to edit and delete vitals and biometrics #1812
Conversation
bfd0a01
to
7685482
Compare
Rebasing against main and then doing a hard reload in your browser should fix this. |
thanks @denniskigen. Working as expected! |
f046907
to
52628d5
Compare
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 this! A few comments and things that should be addressed.
...m-patient-vitals-app/src/vitals-biometrics-form/delete-vitals-biometrics-modal.component.tsx
Outdated
Show resolved
Hide resolved
...sm-patient-vitals-app/src/vitals-biometrics-form/vitals-biometrics-action-menu.component.tsx
Show resolved
Hide resolved
...m-patient-vitals-app/src/vitals-biometrics-form/delete-vitals-biometrics-modal.component.tsx
Outdated
Show resolved
Hide resolved
} catch (error) { | ||
createErrorHandler(); | ||
showSnackbar({ | ||
title: t('vitalsAndBiometricsDeleteError', 'Error Deleting Vitals and Biometrics'), |
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.
title: t('vitalsAndBiometricsDeleteError', 'Error Deleting Vitals and Biometrics'), | |
title: t('vitalsAndBiometricsDeleteError', 'Error deleting Vitals and Biometrics'), |
...m-patient-vitals-app/src/vitals-biometrics-form/delete-vitals-biometrics-modal.component.tsx
Outdated
Show resolved
Hide resolved
...m-patient-vitals-app/src/vitals-biometrics-form/delete-vitals-biometrics-modal.component.tsx
Outdated
Show resolved
Hide resolved
...m-patient-vitals-app/src/vitals-biometrics-form/delete-vitals-biometrics-modal.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-vitals-app/src/vitals/vitals-overview.component.tsx
Outdated
Show resolved
Hide resolved
@senthil-k8s so one of the main things to take care of here is that deleting vitals and biometrics data should void the observations instead of deleting the encounter. |
27b225c
to
0dd058f
Compare
@ibacher so what's the ideal approach for @senthil-k8s to pursue w.r.t to voiding the observations using the Delete action? |
0f74de6
to
e41cb59
Compare
@denniskigen When editing vitals and biometrics (i.e., updating existing observations), my current approach results in creating a new observation each time a user edits the vitals. Is there a better approach to edit the vitals without creating new observations every time? |
@samuelmale do you mind clarifying what the approach should look like? |
I think this is where EMR API could actually be helpful, but I'm not sure what the specific API to use there is. Otherwise, yes, I think the only real option is a request-per-obs. |
I think we just have to grep and group obs by a derived category ie. "vitals" vs "biometrics" and then simply mark them as function getVitalsObs(encounter: Encounter): Array<OpenmrsResource> {
// return vitals specific observations
}
function deleteVitals(encounter: Encounter) {
const vitalsToBeVoided = getVitalsObs(encounter).map(obs => ({ uuid: obs.uuid, voided: true }));
// You can either save them all at once as part of the encounter OR save them individually using the Obs endpoint.
} I prefer saving all the voided obs apart of the encounter object in a single shot. |
@samuelmale, @denniskigen, could you please let me know if my approach makes sense? |
ded9476
to
31c7b22
Compare
@senthil-k8s I've squashed your commits into a single one to ensure a cleaner commit history. This should simplify future rebasing and merges. Thank you for your understanding and contributions! |
31c7b22
to
9e8e6a2
Compare
...m-patient-vitals-app/src/vitals-biometrics-form/delete-vitals-biometrics-modal.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-vitals-app/src/vitals-biometrics-form/vitals-biometrics-form.workspace.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-vitals-app/src/vitals-biometrics-form/vitals-biometrics-form.workspace.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-vitals-app/src/vitals-biometrics-form/vitals-biometrics-form.workspace.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-vitals-app/src/vitals-biometrics-form/vitals-biometrics-form.workspace.tsx
Show resolved
Hide resolved
483caaf
to
6a6eac3
Compare
...m-patient-vitals-app/src/vitals-biometrics-form/delete-vitals-biometrics-modal.component.tsx
Show resolved
Hide resolved
6a6eac3
to
67450f5
Compare
Ok, thanks, guys! Looks like this is good to go! |
Requirements
Summary
This PR enables editing or deleting vitals and biometrics data from the Patient Chart. In edit mode, obs are retrieved using the encounter UUID and displayed in the form. When deleting data, the encounter UUID is used to void observations.
Screenshots
https://www.loom.com/share/b47c4ddf00724b6d97c17d71513d37c8?sid=19a6b632-fea9-4c09-9c84-03e41a7f6847
Related Issue
https://openmrs.atlassian.net/browse/O3-2953