Fhir.patch

125 views
Skip to first unread message

Robby610

unread,
Mar 28, 2023, 4:08:01 PM3/28/23
to HAPI FHIR
Hi, I'm trying to patch Encounter.hospitalization.dischargeDisposition.  As a starting point I'm executing my call from postman with the json pasted below. I know the encounter exists and I'm calling it with the ID in the URL. I do receive a response code of 200 however resource is no "patched". What am I missing? 

I also tried putting the element as part of the path but same result

Content-Type: application/fhir+json

{
  "resourceType""Parameters",
  "parameter": [
    {
      "name""operation",
      "part": [
        {
            "name""type",
            "valueString""add"
        },
        {
            "name""path",
            "valueString""Encounter.hospitalization"
        },
        {
            "name""name",
            "valueString""dischargeDisposition"
        },
        {
            "name""value",
            "valueCodeableConcept"
            {
                "text""Example discharge disposition",
                "coding": [
                  {
                    "system""http://example.com/codes",
                    "code""1234",
                    "display""Example code"
                  }
                ]
            }
        }
      ]
    }
  ]
}

Thanks

btab...@meditech-int-services.com

unread,
Mar 29, 2023, 9:42:21 PM3/29/23
to HAPI FHIR
Hi there

Without knowing the specifics of your server implementation, it's hard to say exactly what might be causing the issue. However, here are a few things you could maybe look at:

1. Verify that the FHIR server supports the "add" operation, it's possible that your server implementation doesn't but I am guessing you already confirmed it does support it.

2. Verify that the "hospitalization" element already exists within the Encounter resource. If the element does not exist, it's safe to say you won't be able to add anything to it.

3. Verify that the "dischargeDisposition" element does not already exist within the "hospitalization" element. If the element already exists, you may need to use a different operation (e.g., "replace" or "delete" followed by "add") to modify its value, see https://fhirblog.com/2019/08/13/updating-a-resource-using-patch/

Lastly, check the response body of your API call for any error messages or additional information about why the patch operation may have failed.

Hope that helps.

Robby610

unread,
Mar 30, 2023, 9:41:28 AM3/30/23
to HAPI FHIR
#2 was my issue. I made an assumption that since hospitalization being a backbone element I could just include it in the path and it would created it. I was wrong.
Thank you for your help.
Reply all
Reply to author
Forward
0 new messages