View raw Markdown
type: resourceresource: SearchParameter

SearchParameter

Introduction

Scope and Usage

A SearchParameter resource specifies a search parameter that may be used on the RESTful API to search or filter on a resource. The SearchParameter resource declares:

Boundaries and Relationships

Background and Context

Implementers should be familiar with the background and concepts described in Search on the RESTful API before working with this resource.

There is a registry of all Search Parameters.

Notes

Naming Conventions for Search Parameters

HL7-defined search parameters follow these naming conventions:

Notes

Use of FHIRPath in Expressions

Balloter feedback requested: We are seeking input on approaches to managing the balance between expressiveness and performance impact on servers from the use of various FHIRPath features in search parameter expressions.

SearchParameters on Extensions

The SearchParameter resource may be used to define searches on extensions. A simple definition defines the code, the base resource the extension can be found in, and a type, and an expression. Assume that the extension is http://example.org/fhir/StructureDefinition/extension-thumb-length which has a value that is a quantity, and that is used on patient, then an appropriate SearchParameter would be:

"code" : "thumb-length", "base" : ["Patient"], "type" : "quantity", "expression" : "Patient.extension('http://example.org/fhir/StructureDefinition/extension-thumb-length').value"

Servers MAY attempt to process expressions that just select the extension without the .value, but this is not required and may be discouraged or deprecated in the future.

Extensions may have multiple types with different search behaviors, so the type can be specifically selected:

"code" : "thumb-length-code", "base" : ["Patient"], "type" : "token", "expression" : "Patient.extension('http://example.org/fhir/StructureDefinition/extension-thumb-length').value.ofType(CodeableConcept)"

This example would select coded thumb lengths and index them only for the thumb-length-code search parameter. When an extension can have multiple types with incompatible search behavior, the search parameters have to do this. Note that is type casting the extension directly (e.g. Patient.extension('...').ofType(CodeableConcept)) will lead to an empty index, since the extension is not a CodeableConcept itself.

When extensions can be used in multiple places, these places are enumerated in the expression:

Patient.extension('http://example.org/fhir/StructureDefinition/extension-thumb-length').value | Patient.contact.extension('http://example.org/fhir/StructureDefinition/extension-thumb-length').value | Practitioner.extension('http://example.org/fhir/StructureDefinition/extension-thumb-length').value

Search Parameter Aliases

To support evolution toward consistent naming conventions while maintaining backward compatibility, SearchParameter resources MAY define one or more aliasCode values. These aliases represent suggested alternative codes that can be used to reference the search parameter in addition to the primary code value.

Usage Guidelines:

Example: A search parameter previously named authoredon might be updated to use authored as the primary code (for consistency with other resources) while retaining authoredon as an alias for backward compatibility.

Deriving Search Parameters

When one SearchParameter has a derivedFrom referencing another SearchParameter, the following rules SHOULD be followed. Note that these rules are asserted as SHOULD rather than SHALL only because they were introduced after the resource became normative. Systems that fail to follow these rules are likely to result in unsafe interoperability.

A derived SearchParameter:

Request for ballot feedback: We would like the 'SHOULD' assertions above to become 'SHALL' assertions. We are invoking our usual implementer outreach process to find out whether anyone else objects, but please file tickets for any rules you do not believe can be enforced that way.

StructureDefinition

Elements (Simplified)

Mappings

Implementation Guide

implementationguide-SearchParameter-core.xml

<?xml version="1.0" encoding="UTF-8"?>

<ImplementationGuide xmlns="http://hl7.org/fhir">
  <id value="SearchParameter-core"/>
  <name value="StandardSearchParameterExtensions"/>
  <title value="Standard  Search  Parameter  Extensions"/>
  <status value="draft"/>
  <date value="2014-01-31T00:00:00.000"/>
  <publisher value="Health Level Seven, Inc. - [WG Name] WG"/>
  <description value="This profile describes common extensions that are used with Search Parameters"/>
</ImplementationGuide>

Resource Packs

list-SearchParameter-packs.xml

<?xml version="1.0" encoding="UTF-8"?>

<List xmlns="http://hl7.org/fhir">
  <id value="SearchParameter-packs"/>
  <status value="current"/>
  <mode value="working"/>
  <entry>
    <item>
      <reference value="ImplementationGuide/SearchParameter-core"/>
    </item>
  </entry>
</List>

Search Parameters

Full Search Parameters

Examples

Full Examples

Mapping Exceptions

searchparameter-fivews-mapping-exceptions.xml

Unmapped Elements