FHIR Chat · Select specific fields · hapi

Stream: hapi

Topic: Select specific fields


view this post on Zulip Kishore Karanam (Jun 04 2020 at 13:12):

Hi Team,

Is there any way to to select specific fields in a resource by using REST Search operations? like query only category, effectiveDateTime, issued, subject only from Observation

Regards,
Kishore

view this post on Zulip James Agnew (Jun 04 2020 at 15:16):

Probably the easiest way to do this is with the _elements parameter, e.g.

http://hapi.fhir.org/baseR4/Patient?_elements=name,gender

You could also do this with GraphQL, but that is more involved: http://hl7.org/fhir/graphql.html

view this post on Zulip Kishore Karanam (Jun 04 2020 at 15:25):

Thanks James. This works

view this post on Zulip Kishore Karanam (Jun 04 2020 at 16:00):

One more question James, shall we exclude fields like meta etc because they are coming by default

view this post on Zulip James Agnew (Jun 07 2020 at 17:21):

HAPI FHIR allows you to specify excludes, so you can omit meta if you want. This is not a standard FHIR feature though so be warned it's not cross-platform compatible: http://hapi.fhir.org/baseR4/Patient?_elements=name,gender&_elements:exclude=Patient.meta

view this post on Zulip Kishore Karanam (Jun 08 2020 at 14:08):

Ok noted and thanks for the update. It works as expected


Last updated: Apr 12 2022 at 19:14 UTC