FHIR Chat · Observation basedOn · hapi

Stream: hapi

Topic: Observation basedOn


view this post on Zulip Thomas Stigsen (Mar 22 2018 at 08:24):

Dear HAPI implementers
I hope one of you can help me with a quick question...
I am trying to create an Observation resource in a locally hosted HAPI server instance.
...and I can't figure out how to decorate the basedOn property via the fluent Java client api?

view this post on Zulip Patrick Werner (Mar 22 2018 at 09:40):

i'm not sure what you are meaning with decorate, but this is how to do it:

Observation o = new Observation();
        o.addBasedOn(new Reference(new Observation()));

view this post on Zulip Thomas Stigsen (Mar 22 2018 at 10:27):

Hi Patrick
Thanks for the answer

...but I cannot see an addBasedOn method on the org.hl7.fhir.dstu3.model.Observation object :-|

I'm using the
ca.uhn.hapi.fhir:hapi-fhir-structures-dstu3:2.2
implementation
...what am I missing?
Thanks again

view this post on Zulip Patrick Werner (Mar 22 2018 at 12:34):

You are using a very old version of hapi (Dec 2016), back then DSTU3 wasn't normative and basedOn was introduced later. Just switch to the latest stable release of hapi.

view this post on Zulip Thomas Stigsen (Mar 22 2018 at 13:16):

That did it!
Thanks :-)


Last updated: Apr 12 2022 at 19:14 UTC