FHIR Chat · Custom SearchParameter multi scope · hapi

Stream: hapi

Topic: Custom SearchParameter multi scope


view this post on Zulip Andrew Broadbent (Aug 10 2017 at 18:20):

Hi all,

I'm trying to author a search parameter that searches for the value of a reference within an extension that could be present at the root level of any resource (in my case, I have an organisation resource, which is referenced by all of the resources which are governed by it).

I've had a look in the docs for SearchParameters, and it suggests that it's possible to have a search parameter that has a scope of multiple resource types, and to do so you set the base to 'DomainResource'. It doesn't say what the expression should be set to though, and when I try to upload it without an expression, I get an error from HAPI saying that it's missing.

I'm uploading to HAPI 2.5-snapshot, and my resource looks like this, however when I perform a search like this, I get an error back saying the search parameter does not exist:
[base]/Basic?annotation=Basic/2

<SearchParameter xmlns="http://hl7.org/fhir">
<name value="Annotation"/>
<status value="active"/>
<code value="annotation"/>
<base value="DomainResource"/>
<type value="reference"/>
<xpath value="f:DocumentReference/f:extension[@url='http://www.elabdev.org/StructureDefinition/AnnotationRef']"/>
<xpathUsage value="normal"/>
</SearchParameter>

If I change the search parameter to look like this, the same search works and returns the expected resources:

<SearchParameter xmlns="http://hl7.org/fhir">
<name value="Annotation"/>
<status value="active"/>
<code value="annotation"/>
<base value="Basic"/>
<type value="reference"/>
<expression value="DocumentReference.extension('http://www.elabdev.org/StructureDefinition/AnnotationRef')"/>
<xpathUsage value="normal"/>
</SearchParameter>

However as expected I then cannot use this same search parameter to search for Patients which have the same extension in them.

Any ideas?


Last updated: Apr 12 2022 at 19:14 UTC