What's the correct way to add resources to an existing one? #2085
Replies: 1 comment 4 replies
-
To update the patient, the best practice is indeed to request the current data first, then make changes and send an update request to the server. Or you could do a PATCH instead, if you do not want to fetch the patient first. Since you mention 'partial update', it would be good to take a look at PATCH (http://hl7.org/fhir/http.html#patch) and see if your server supports it. For the other additions, make sure they have the references set correctly, so they will get connected to your patient and each other. Then you can either do separate POST calls for each, or create a transaction Bundle with the transaction builder. Which one is the best approach will depend on a number of things.
If you use a transaction, you can add your Patient update or patch interaction to it as well. |
Beta Was this translation helpful? Give feedback.
-
If I fetch a patient, and then want to send back some changes - for instance, I change the Patient's address and add an Encounter with some vitals... what is the correct way to do this?
Do I firsts fetch the patient record to get the latest version, then modify that patient.Address, then add that patient and a new encounter with a new observation as three resources to a bundle?
Do I use transaction builder?
I am not finding any documentation that walks through how to deal with these kinds of partial update and additions?
Beta Was this translation helpful? Give feedback.
All reactions