FHIR Chat · R4 _include on reference · implementers

Stream: implementers

Topic: R4 _include on reference


view this post on Zulip Marcelo Cabello (Jul 23 2019 at 22:25):

Hi @Christiaan Knaap , I'm trying to build a search using _include. It looks like: url/RequestGroup?id=001&_include=RequestGroup:basedOn
The goal is to get MedicationRequest resources, which are referenced in RequestGroup.

I have some experience to build simple SP based on token, string, date, so the first attempt was to build a SearchParameter with the type:reference. Then I guess I should define elements such as target, chain, usw. in SP, but I'm not totally sure about that. ¿?

The SP looks now:

{
    "resourceType": "SearchParameter",
    "id": "basedOn",
    "url": "http://cens.cl/fhir/Search/basedOn",
    "name": "basedOn",
    "status": "active",
    "code": "basedOn",
    "base": [
        "RequestGroup"
    ],
    "type": "reference",
    "description": "Get MedicationRequests resources",
    "expression": "RequestGroup.basedOn",
    "chain": "getBasedOn",
    "xpathUsage": "normal",
    "target": [
          "MedicationRequest"
        ]
}

view this post on Zulip Christiaan Knaap (Jul 24 2019 at 11:27):

Looks quite allright to me. Just 'chain' is incorrect - it should be an array and can only list searchparameters that are defined on the target resourcetype (MedicationRequest in this case). But Vonk simply supports all the parameters on the target resourcetype automatically. You can try it ,the searchparameter and see whether it works with your own copy of Vonk, see the doc
(PS: Others will need to help you further for the next few weeks - I'll be on holiday from now on, without Zulip)

view this post on Zulip Marcelo Cabello (Aug 01 2019 at 12:23):

Back to the orignal question: Retrieve a list MedicationRequests resources from RequestGroup.
_include can retrieve more than one MedicationRequest resources???


Last updated: Apr 12 2022 at 19:14 UTC