I have implemented the workflow as per my need. But i am stucked at updating records of patient using Patch Request.
Issues:
- In Patient endpoint, Updating rest of the records but not updating the address part. How can i update the specific address using PATCH request.
PATCH: http://localhost:8080/openmrs/ws/fhir2/R4/Practitioner/4bcdc9b3-1157-4966-96f1-6b315aa1a20c
Payload:
[
{
"op": "replace",
"path": "/address/0/city",
"value": "New City"
},
{
"op": "replace",
"path": "/address/0/state",
"value": "CA"
},
{
"op": "replace",
"path": "/address/0/postalCode",
"value": "458562"
},
{
"op": "replace",
"path": "/address/0/country",
"value": "USA"
},
{
"op": "replace",
"path": "/gender",
"value": "male"
},
{
"op": "replace",
"path": "/birthDate",
"value": "1985-06-15"
}
]
Response:
{"resourceType":"Practitioner","id":"4bcdc9b3-1157-4966-96f1-6b315aa1a20c","meta":{"versionId":"1743002100000","lastUpdated":"2025-03-26T20:45:00.000+05:30"},"text":{"status":"generated","div":"<div xmlns=\"http://www.w3.org/1999/xhtml\"><table class=\"hapiPropertyTable\"><tbody><tr><td>Id:</td><td>4bcdc9b3-1157-4966-96f1-6b315aa1a20c</td></tr><tr><td>Identifier:</td><td><div>111aaabbc122334</div></td></tr><tr><td>Active:</td><td>true</td></tr><tr><td>Name:</td><td> Donald <b>DUCK </b></td></tr><tr><td>Address:</td><td><span>Anytown </span><span>NY </span><span>USA </span></td></tr><tr><td>Gender:</td><td>MALE</td></tr><tr><td>Birth Date:</td><td>15/06/1985</td></tr></tbody></table></div>"},"identifier":[{"system":"http://fhir.openmrs.org/ext/provider/identifier","value":"111aaabbc122334"}],"active":true,"name":[{"id":"bb9fe2fb-c4c4-444d-8e14-0fac3c3175b6","text":"Donald Duck","family":"Duck","given":["Donald"]}],"address":[{"id":"f393725e-44ee-48d1-8bc5-846589c224ae","use":"home","city":"Anytown","state":"NY","postalCode":"12345","country":"USA"}],"gender":"male","birthDate":"1985-06-15"}
Note: Same issue with Patient endpoint, having partially update and on updating address it is showing response as:
{
"resourceType": "OperationOutcome",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td><pre>no such path in target JSON document</pre></td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>"
},
"issue": [
{
"severity": "error",
"code": "processing",
"diagnostics": "no such path in target JSON document"
}
]
}
@ibacher @mherman22