FHIR Chat · PUTting Encounter resource with location reference · hapi

Stream: hapi

Topic: PUTting Encounter resource with location reference


view this post on Zulip David Meyers (Jul 02 2021 at 12:03):

Im currently trying to put an encounter resource into a hapi 5.4 server with a reference to the location in the "location" field like this:

"location": [
                    {
                        "reference": "Location?identifier=10228"
                    }
                ]

Resolving other business identifiers has not been a problem so far, but with the location reference the Hapi server complains that it cannot do anything with the field:

Unknown element 'reference' found while parsing

Is this not implemented yet ? Is there a workaround or is my syntax just wrong here? :)
ty in advance

view this post on Zulip Diane (Jul 04 2021 at 17:56):

I am a newby, so my advice could be really wrong here.

Today and tomorrow are Federal US holidays and I think it is a long weekend for the Canadian holiday as well, so you might not get any other answers for a few days.

When I see the error message about an Unknown element:

Unknown element 'reference' found while parsing

I have found in the past that the tag such as "reference" is what HAPI is objecting to.

In looking at the example https://www.hl7.org/fhir/encounter-example-emerg.json.html and at the detailed descriptions for the Encounter resource showing the element Encounter.location.location, I think the syntax should be closer to:

"location": [
{
"location": {
"reference": "Location?identifier=10228"
}
}
]

view this post on Zulip David Meyers (Jul 05 2021 at 09:19):

Hello @Diane and thanks for ur help.
Unfortunately im getting the same server warning msg (unknown element) when using ur proposed syntax. :(

view this post on Zulip Diane (Jul 05 2021 at 20:43):

I hope that some of the experts will be back soon from their holiday celebrations to help you.

The hapi R4 test server at hapi.fhir.org has this encounter resource with a location reference:. Maybe that will get you closer to the solution?

http://hapi.fhir.org/baseR4/Encounter/4e56a322-18b3-4367-a44a-b60847a464c4/_history/1?_pretty=true&_format=json

view this post on Zulip David Meyers (Jul 06 2021 at 08:57):

Hey @Diane , shame on me, you were right of course. With extended encapsulation (location in location), the server persisted the Encounter resource as expected and completely. The warning message was caused by another resource in the bundle and misinterpreted by me. Thank you very much, because I also became suspicious when I saw that the HAPI server in your example had persisted the location references in a resolvable way.

view this post on Zulip Diane (Jul 08 2021 at 16:17):

@David Meyers No worries. Glad that you got your Encounter resource working.


Last updated: Apr 12 2022 at 19:14 UTC