-
Notifications
You must be signed in to change notification settings - Fork 246
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
(fix) O3-2654: Unable to edit visit attributes when editing visit details #1562
(fix) O3-2654: Unable to edit visit attributes when editing visit details #1562
Conversation
packages/esm-patient-chart-app/src/visit/visit-form/visit-form.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-chart-app/src/visit/visit-form/visit-form.component.tsx
Outdated
Show resolved
Hide resolved
packages/esm-patient-chart-app/src/visit/visit-form/visit-form.component.tsx
Outdated
Show resolved
Hide resolved
Hi @dkayiwa ! |
@vasharma05 @usamaidrsk The way to deal with issues like this would be to open in a Jira ticket in the Webservices.REST project that says something like: "Add ability to update attributes as part of the visit payload" with a description of what you're trying to accomplish and what syntax should be supported. You can add the tag "community-priority" in Jira and it should show up on the appropriate board. In most cases like these you're simply looking for a feature no one has ever asked for before, so ask for the feature (which is what a ticket is for). |
Expecting a better solution with REST Ticket: https://openmrs.atlassian.net/browse/RESTWS-926 |
@vasharma05 hmmm… actually there is an issue with updates vs creates and it comes down to ambiguity in JSON. Ideally, what we want to submit as an edit is something that records the changes we want to make. There are some specified syntaxes for this (JSON Patch and XML Patch) which we don’t support. Without either an explicit patching syntax or sending the full resource with each request, the backend has no way to differentiate between an “append this attribute” request vs a “delete all attributes but this one” request or even a “delete all attributes”. Theoretically, the principles of REST mean that we should be sending the entire representation of the resource as part of the PUT request, so we do need to be sure (on the front end side) that the update includes the full visit payload with the modifications made. |
The main implication of the above is that we cannot request a partial resource and that modifications need to be applied to the fully downloaded resource, which may mean that we need slightly different code to handle “creates” vs “edits”. |
This is what I also encountered in the patient registration, when dealing with identifiers. If you see, there were cases handled where a few identifiers were updated, deleted and added simultaneously, which I belive cannot be done in a single REST request, hence I asked @usamaidrsk to follow the same steps here as well. |
Requirements
Summary
Screenshots
update-visit-attributes.mp4
Related Issue
O3-2654
Other