简体   繁体   中英

FHIR search in the reference resource

I have a Slot resource which has the reference to a Schedule resource. The schedule resource has a list of actors including Patient and Practitioner and all. If i want to retrieve a booked slot with the assigned Practitioner name, what will be the correct FHIR server query?

Example data inside Schedule reference:

 "actor": [
                    {
                        "reference": "Practitioner/{id}",
                        "display": "Dr.John"
                    }, 
           ...]

I tried with "[base]/{resource with id}&_include=Slot:schedule&_include:iterate=Practitioner:actor[0]". But it is not working.

A few issues:

  • If you're going to have _include, you have to do 'search', not 'read'. Search must be done against the type, not resource type + id. If you want to filter to a specific resource, that needs to be expressed as a search criteria, not as part of the base path.
  • You can't specify a repetition to include. Ie no "[0]". If you include, you get them all.
  • The second include needs to refer to the path to practitioner from Slot. You can filter by what type you want if desired. I've done that below.

So the search should look like this:

[base]/Slot?_id=123&_include=Slot:schedule&_include:iterate=Schedule:actor:Practitioner

Be aware that not all servers will support all _includes, or even support _include at all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM