- A search parameter defines a named search item that can be used to search/filter on a FHIR resource.
- A SearchParameter resource is a FHIR resource that can be used to define/describe a search parameter supported by a given server.
Default Search Parameter Registry :- http://hl7.org/fhir/searchparameter-registry.html.
Type | Definition |
---|---|
Number | Whole number or decimal |
Date/DateTime | Date and time parameter formatted as:
|
String | Simple string. Case and accent insensitive. May contain spaces. |
URI | Uniform Resource Identifier. Example:
|
Token | Used for values that are part of a code system or namespace. Includes:
Examples.
|
Quantity | Used for quantity values that include a numeric value and possibly a unit of measure code.The unit of measure code will include a code value and optionally a code system. Examples:
|
Reference | Used for values that represent references between resources. For example an Observation resource will normally have a subject element which references a Patient resource for the patient that then Observation relates to. Can include :
|
Composite | Used in cases where a single search definition requires two or more values. SearchParameter values appear in the search request as a list of single values joined with a $ character. Examples:
$ :
|
_filter | Used to specify a query expression that can be used in a Search operation. Example:
|
near | Used only with Location resource. Specifies a set of coordinates expressed as coordinates expressed as [latitude]|[longitude]|[distance]|[units] |
- Modifiers may be specified as a suffix to the SearchParameter values and are separated by a colon.
- Example: gender:missing=true
Parameter Type | Operator | Description |
---|---|---|
All Parameter types | :missing |
|
String Parameter | :exact | Resources which have an exact match for the parameter, including case and character. |
Token Parameter | :text | Matches on text portion of CodeableConcept or Coding element. |
Token Parameter | :not | Match resources that do not have the code value. |
Token Parameter | :above | Match where coding subsumes the search code parameter. |
Token Parameter | :below | Match where coding is subsumed by the search code parameter. |
Token Parameter | :in | Match where coding is in a value set specified by the parameter. |
Token Parameter | :not-in | Match where coding is not in the value set specified by the parameter |
Token Parameter | :of-type | Match where identifier element is of specified type. |
Reference Parameter | :[type] | Specify the name of the resource type for reference |
Reference Parameter | :identifier | Search by identifier rather than literal reference. |
Reference Parameter | :above | Search for references in hierarchy |
Reference Parameter | :below | Search for references in hierarchy |
URI Parameter | :above | Partial matching (e.g. URLs that include a version number) |
URI Parameter | :below | Partial matching |
- Prefixes can be used to vary the type of matching done for ordered parameter types such as number, date and quantity:
- GET [base]/Observation?_lastUpdated=gt2010-10-01
Operator | Description |
---|---|
eq | Value in resource matches or is contained in value for parameter |
gt | Value in resource is greater than value in parameter. |
lt | Value in resource is less than value parameter. |
ge | Value in resource is greater than or equal to value in parameter. |
le | Value in resource is less than or equal to value in parameter. |
sa | Value in the resource starts after value in parameter. |
eb | Value in the resource ends before value in parameter. |
ap | Value in the resource is approximately the same as that in the parameter. |
Element Name | Type | Description |
---|---|---|
url | uri | Canonical identifier for the resource |
name | string | Computer friendly name for the resource |
status | code | Status of the resource |
description | markdown | Natural language description for the search parameter |
code | code | Code used to reference the search parameter in a search request |
base | code | Resource type(s) that this search parameter applies to |
type | code | The data type for the search parameter value |
Element Name | Type | Description |
---|---|---|
expression | string | FHIRPath expression used to extract an element from a resource.
|
xpath | string | XPath expression used to extract an element from a resource.
|
multipleOr | boolean | Whether to allow multiple values (or) |
multipleAnd | boolean | Whether to allow multiple values (and) |
comparator | code | A list of one or more comparators that can be supported by the SearchParameter: eq | ne | gt | lt | ge | le | sa | eb | ap |
modifier | code | A list of one or more modifiers that can be supported by the SearchParameter: missing | exact | contains | not | text | in | not-in | below | above | type | identifier | ofType |
chain | string | Names of one or more SearchParameters that will be chained together to form the current SearchParameter. |
component | BackboneElement | Used for composite SearchParameters. Defines each of the components that can be included in the SearchParameter type. Each component includes:
|