Specialty Medication Enrollment
2.1.0 - CI Build

Specialty Medication Enrollment, published by HL7 International - Pharmacy. This is not an authorized publication; it is the continuous build for version 2.1.0). This version is based on the current content of https://github.com/HL7/fhir-specialty-rx/ and changes regularly. See the Directory of published versions

## Resource Profile: Specialty Rx Bundle - Search Result

Official URL: http://hl7.org/fhir/us/specialty-rx/StructureDefinition/specialty-rx-bundle-search-result | Version: 2.1.0
Active as of 2020-07-19 | Computable Name: SpecialtyRxBundleSearchResult

This profile constrains a Bundle resource to carry the query results from a Specialty Rx Query

The profile reflects typical population of a searchset bundle, ensuring the presence of information the Data Consumer system needs to process the search results.

The profile implements FHIR searchset response guidance that allows the Data Consumer to be confident about what search parameters were used as criteria when processing the request. The Data Source system SHALL populate `Bundle.link.relation` with “self” and `Bundle.link.url` with the parameters that were actually used to process the search. For example:

    "link" : [
      {
       "relation" : "self",
       "url" : "Coverage?patient=patientEHR"
      }
    ]

Examples. This profile is illustrated in the following full message examples:

- Specialty Rx Query Response 1
- Specialty Rx Query Response 2
- Specialty Rx Query Response 3 with operation outcome
- Specialty Rx Query Response Unsolicited 1

Usage:

- Use this Resource Profile: Specialty Rx Bundle - Query Response - Unsolicited Message and Specialty Rx Bundle - Query Response Message
- Refer to this Resource Profile: Specialty Rx Parameters - Query Response - Unsolicited and Specialty Rx Parameters - Query Response

### Formal Views of Profile Content

Description of Profiles, Differentials, Snapshots and how the different presentations work.

- Differential Table
- Key Elements Table
- Snapshot Table
- Statistics/References
- All

This structure is derived from Bundle

Name | Flags | Card. | Type | Description & Constraints
--- | --- | --- | --- | ---
Bundle |  | 0..* | Bundle | Contains a collection of resources
type | S | 1..1 | code | document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection Fixed Value: searchset
total | S | 0..1 | unsignedInt | If search, the total number of matches
Slices for link | S | 1..* | BackboneElement | Links related to this Bundle Slice: Unordered, Open by value:relation
link:self | S | 1..* | BackboneElement | Links related to this Bundle
relation | S | 1..1 | string | Executed search Fixed Value: self
entry | S | 0..* | BackboneElement | Entry in the bundle - will have a resource or information
resource | S | 1..1 | Resource | A resource in the bundle
search | S | 0..1 | BackboneElement | Search related information
mode | S | 0..1 | code | match | include | outcome - why this is in the result set
request |  | 0..0 |  |
response |  | 0..0 |  |
Documentation for this format

Name | Flags | Card. | Type | Description & Constraints
--- | --- | --- | --- | ---
Bundle | C | 0..* | Bundle | Contains a collection of resources
implicitRules | ?!Σ | 0..1 | uri | A set of rules under which this content was created
type | S Σ | 1..1 | code | document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection Binding: BundleType (required): Indicates the purpose of a bundle - how it is intended to be used. Fixed Value: searchset
total | S Σ C | 0..1 | unsignedInt | If search, the total number of matches
Slices for link | S Σ | 1..* | BackboneElement | Links related to this Bundle Slice: Unordered, Open by value:relation
link:All Slices |  |  |  | Content/Rules for all slices
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
relation | Σ | 1..1 | string | See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1
url | Σ | 1..1 | uri | Reference details for the link
link:self | S Σ | 1..* | BackboneElement | Links related to this Bundle
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
relation | S Σ | 1..1 | string | Executed search Fixed Value: self
url | Σ | 1..1 | uri | Reference details for the link
entry | S Σ C | 0..* | BackboneElement | Entry in the bundle - will have a resource or information This repeating element order: For bundles of type 'document' and 'message', the first resource is special (must be Composition or MessageHeader respectively). For all bundles, the meaning of the order of entries depends on the bundle type
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
resource | S Σ | 1..1 | Resource | A resource in the bundle
search | S Σ C | 0..1 | BackboneElement | Search related information
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
mode | S Σ | 0..1 | code | match | include | outcome - why this is in the result set Binding: SearchEntryMode (required): Why an entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process.
Documentation for this format

#### Terminology Bindings

Path | Conformance | ValueSet / Code
Bundle.type | required | Fixed Value: searchset
Bundle.entry.search.mode | required | SearchEntryMode
Bundle.entry.request.method | required | HTTPVerb

#### Constraints

Id | Grade | Path(s) | Details | Requirements
bdl-1 | error | Bundle | total only when a search or history : total.empty() or (type = 'searchset') or (type = 'history') |
bdl-2 | error | Bundle | entry.search only when a search : entry.search.empty() or (type = 'searchset') |
bdl-3 | error | Bundle | entry.request mandatory for batch/transaction/history, otherwise prohibited : entry.all(request.exists() = (%resource.type = 'batch' or %resource.type = 'transaction' or %resource.type = 'history')) |
bdl-4 | error | Bundle | entry.response mandatory for batch-response/transaction-response/history, otherwise prohibited : entry.all(response.exists() = (%resource.type = 'batch-response' or %resource.type = 'transaction-response' or %resource.type = 'history')) |
bdl-5 | error | Bundle.entry | must be a resource unless there's a request or response : resource.exists() or request.exists() or response.exists() |
bdl-7 | error | Bundle | FullUrl must be unique in a bundle, or else entries with the same fullUrl must have different meta.versionId (except in history bundles) : (type = 'history') or entry.where(fullUrl.exists()).select(fullUrl&resource.meta.versionId).isDistinct() |
bdl-8 | error | Bundle.entry | fullUrl cannot be a version specific reference : fullUrl.contains('/_history/').not() |
bdl-9 | error | Bundle | A document must have an identifier with a system and a value : type = 'document' implies (identifier.system.exists() and identifier.value.exists()) |
bdl-10 | error | Bundle | A document must have a date : type = 'document' implies (timestamp.hasValue()) |
bdl-11 | error | Bundle | A document must have a Composition as the first resource : type = 'document' implies entry.first().resource.is(Composition) |
bdl-12 | error | Bundle | A message must have a MessageHeader as the first resource : type = 'message' implies entry.first().resource.is(MessageHeader) |
ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children : hasValue() or (children().count() > id.count()) |
ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both : extension.exists() != value.exists() |

Name | Flags | Card. | Type | Description & Constraints
--- | --- | --- | --- | ---
Bundle | C | 0..* | Bundle | Contains a collection of resources
id | Σ | 0..1 | id | Logical id of this artifact
meta | Σ | 0..1 | Meta | Metadata about the resource
implicitRules | ?!Σ | 0..1 | uri | A set of rules under which this content was created
language |  | 0..1 | code | Language of the resource content Binding: CommonLanguages (preferred): A human language.
Additional Bindings | Purpose
AllLanguages | Max Binding
identifier | Σ | 0..1 | Identifier | Persistent identifier for the bundle
type | S Σ | 1..1 | code | document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection Binding: BundleType (required): Indicates the purpose of a bundle - how it is intended to be used. Fixed Value: searchset
timestamp | Σ | 0..1 | instant | When the bundle was assembled
total | S Σ C | 0..1 | unsignedInt | If search, the total number of matches
Slices for link | S Σ | 1..* | BackboneElement | Links related to this Bundle Slice: Unordered, Open by value:relation
link:All Slices |  |  |  | Content/Rules for all slices
id |  | 0..1 | string | Unique id for inter-element referencing
extension |  | 0..* | Extension | Additional content defined by implementations
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
relation | Σ | 1..1 | string | See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1
url | Σ | 1..1 | uri | Reference details for the link
link:self | S Σ | 1..* | BackboneElement | Links related to this Bundle
id |  | 0..1 | string | Unique id for inter-element referencing
extension |  | 0..* | Extension | Additional content defined by implementations
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
relation | S Σ | 1..1 | string | Executed search Fixed Value: self
url | Σ | 1..1 | uri | Reference details for the link
entry | S Σ C | 0..* | BackboneElement | Entry in the bundle - will have a resource or information This repeating element order: For bundles of type 'document' and 'message', the first resource is special (must be Composition or MessageHeader respectively). For all bundles, the meaning of the order of entries depends on the bundle type
id |  | 0..1 | string | Unique id for inter-element referencing
extension |  | 0..* | Extension | Additional content defined by implementations
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
link | Σ | 0..* | See link (Bundle) | Links related to this entry
fullUrl | Σ | 0..1 | uri | URI for resource (Absolute URL server address or URI for UUID/OID)
resource | S Σ | 1..1 | Resource | A resource in the bundle
search | S Σ C | 0..1 | BackboneElement | Search related information
id |  | 0..1 | string | Unique id for inter-element referencing
extension |  | 0..* | Extension | Additional content defined by implementations
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
mode | S Σ | 0..1 | code | match | include | outcome - why this is in the result set Binding: SearchEntryMode (required): Why an entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process.
score | Σ | 0..1 | decimal | Search ranking (between 0 and 1)
signature | Σ TU | 0..1 | Signature | Digital Signature
Documentation for this format

#### Terminology Bindings

Path | Conformance | ValueSet / Code
Bundle.language | preferred | CommonLanguages
Additional Bindings | Purpose
AllLanguages | Max Binding
Bundle.type | required | Fixed Value: searchset
Bundle.entry.search.mode | required | SearchEntryMode
Bundle.entry.request.method | required | HTTPVerb

#### Constraints

Id | Grade | Path(s) | Details | Requirements
bdl-5 | error | Bundle.entry | must be a resource unless there's a request or response : resource.exists() or request.exists() or response.exists() |
bdl-8 | error | Bundle.entry | fullUrl cannot be a version specific reference : fullUrl.contains('/_history/').not() |
ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children : hasValue() or (children().count() > id.count()) |
ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both : extension.exists() != value.exists() |

This structure is derived from Bundle

Summary

Mandatory: 3 elements (1 nested mandatory element)
Must-Support: 9 elements
Fixed Value: 2 elements
Prohibited: 2 elements

Slices

This structure defines the following Slices:

- The element Bundle.link is sliced based on the value of value:relation

Differential View

This structure is derived from Bundle

Name | Flags | Card. | Type | Description & Constraints
--- | --- | --- | --- | ---
Bundle |  | 0..* | Bundle | Contains a collection of resources
type | S | 1..1 | code | document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection Fixed Value: searchset
total | S | 0..1 | unsignedInt | If search, the total number of matches
Slices for link | S | 1..* | BackboneElement | Links related to this Bundle Slice: Unordered, Open by value:relation
link:self | S | 1..* | BackboneElement | Links related to this Bundle
relation | S | 1..1 | string | Executed search Fixed Value: self
entry | S | 0..* | BackboneElement | Entry in the bundle - will have a resource or information
resource | S | 1..1 | Resource | A resource in the bundle
search | S | 0..1 | BackboneElement | Search related information
mode | S | 0..1 | code | match | include | outcome - why this is in the result set
request |  | 0..0 |  |
response |  | 0..0 |  |
Documentation for this format

Key Elements View

Name | Flags | Card. | Type | Description & Constraints
--- | --- | --- | --- | ---
Bundle | C | 0..* | Bundle | Contains a collection of resources
implicitRules | ?!Σ | 0..1 | uri | A set of rules under which this content was created
type | S Σ | 1..1 | code | document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection Binding: BundleType (required): Indicates the purpose of a bundle - how it is intended to be used. Fixed Value: searchset
total | S Σ C | 0..1 | unsignedInt | If search, the total number of matches
Slices for link | S Σ | 1..* | BackboneElement | Links related to this Bundle Slice: Unordered, Open by value:relation
link:All Slices |  |  |  | Content/Rules for all slices
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
relation | Σ | 1..1 | string | See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1
url | Σ | 1..1 | uri | Reference details for the link
link:self | S Σ | 1..* | BackboneElement | Links related to this Bundle
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
relation | S Σ | 1..1 | string | Executed search Fixed Value: self
url | Σ | 1..1 | uri | Reference details for the link
entry | S Σ C | 0..* | BackboneElement | Entry in the bundle - will have a resource or information This repeating element order: For bundles of type 'document' and 'message', the first resource is special (must be Composition or MessageHeader respectively). For all bundles, the meaning of the order of entries depends on the bundle type
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
resource | S Σ | 1..1 | Resource | A resource in the bundle
search | S Σ C | 0..1 | BackboneElement | Search related information
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
mode | S Σ | 0..1 | code | match | include | outcome - why this is in the result set Binding: SearchEntryMode (required): Why an entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process.
Documentation for this format

#### Terminology Bindings

Path | Conformance | ValueSet / Code
Bundle.type | required | Fixed Value: searchset
Bundle.entry.search.mode | required | SearchEntryMode
Bundle.entry.request.method | required | HTTPVerb

#### Constraints

Id | Grade | Path(s) | Details | Requirements
bdl-1 | error | Bundle | total only when a search or history : total.empty() or (type = 'searchset') or (type = 'history') |
bdl-2 | error | Bundle | entry.search only when a search : entry.search.empty() or (type = 'searchset') |
bdl-3 | error | Bundle | entry.request mandatory for batch/transaction/history, otherwise prohibited : entry.all(request.exists() = (%resource.type = 'batch' or %resource.type = 'transaction' or %resource.type = 'history')) |
bdl-4 | error | Bundle | entry.response mandatory for batch-response/transaction-response/history, otherwise prohibited : entry.all(response.exists() = (%resource.type = 'batch-response' or %resource.type = 'transaction-response' or %resource.type = 'history')) |
bdl-5 | error | Bundle.entry | must be a resource unless there's a request or response : resource.exists() or request.exists() or response.exists() |
bdl-7 | error | Bundle | FullUrl must be unique in a bundle, or else entries with the same fullUrl must have different meta.versionId (except in history bundles) : (type = 'history') or entry.where(fullUrl.exists()).select(fullUrl&resource.meta.versionId).isDistinct() |
bdl-8 | error | Bundle.entry | fullUrl cannot be a version specific reference : fullUrl.contains('/_history/').not() |
bdl-9 | error | Bundle | A document must have an identifier with a system and a value : type = 'document' implies (identifier.system.exists() and identifier.value.exists()) |
bdl-10 | error | Bundle | A document must have a date : type = 'document' implies (timestamp.hasValue()) |
bdl-11 | error | Bundle | A document must have a Composition as the first resource : type = 'document' implies entry.first().resource.is(Composition) |
bdl-12 | error | Bundle | A message must have a MessageHeader as the first resource : type = 'message' implies entry.first().resource.is(MessageHeader) |
ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children : hasValue() or (children().count() > id.count()) |
ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both : extension.exists() != value.exists() |

Snapshot View

Name | Flags | Card. | Type | Description & Constraints
--- | --- | --- | --- | ---
Bundle | C | 0..* | Bundle | Contains a collection of resources
id | Σ | 0..1 | id | Logical id of this artifact
meta | Σ | 0..1 | Meta | Metadata about the resource
implicitRules | ?!Σ | 0..1 | uri | A set of rules under which this content was created
language |  | 0..1 | code | Language of the resource content Binding: CommonLanguages (preferred): A human language.
Additional Bindings | Purpose
AllLanguages | Max Binding
identifier | Σ | 0..1 | Identifier | Persistent identifier for the bundle
type | S Σ | 1..1 | code | document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection Binding: BundleType (required): Indicates the purpose of a bundle - how it is intended to be used. Fixed Value: searchset
timestamp | Σ | 0..1 | instant | When the bundle was assembled
total | S Σ C | 0..1 | unsignedInt | If search, the total number of matches
Slices for link | S Σ | 1..* | BackboneElement | Links related to this Bundle Slice: Unordered, Open by value:relation
link:All Slices |  |  |  | Content/Rules for all slices
id |  | 0..1 | string | Unique id for inter-element referencing
extension |  | 0..* | Extension | Additional content defined by implementations
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
relation | Σ | 1..1 | string | See http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1
url | Σ | 1..1 | uri | Reference details for the link
link:self | S Σ | 1..* | BackboneElement | Links related to this Bundle
id |  | 0..1 | string | Unique id for inter-element referencing
extension |  | 0..* | Extension | Additional content defined by implementations
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
relation | S Σ | 1..1 | string | Executed search Fixed Value: self
url | Σ | 1..1 | uri | Reference details for the link
entry | S Σ C | 0..* | BackboneElement | Entry in the bundle - will have a resource or information This repeating element order: For bundles of type 'document' and 'message', the first resource is special (must be Composition or MessageHeader respectively). For all bundles, the meaning of the order of entries depends on the bundle type
id |  | 0..1 | string | Unique id for inter-element referencing
extension |  | 0..* | Extension | Additional content defined by implementations
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
link | Σ | 0..* | See link (Bundle) | Links related to this entry
fullUrl | Σ | 0..1 | uri | URI for resource (Absolute URL server address or URI for UUID/OID)
resource | S Σ | 1..1 | Resource | A resource in the bundle
search | S Σ C | 0..1 | BackboneElement | Search related information
id |  | 0..1 | string | Unique id for inter-element referencing
extension |  | 0..* | Extension | Additional content defined by implementations
modifierExtension | ?!Σ | 0..* | Extension | Extensions that cannot be ignored even if unrecognized
mode | S Σ | 0..1 | code | match | include | outcome - why this is in the result set Binding: SearchEntryMode (required): Why an entry is in the result set - whether it's included as a match or because of an _include requirement, or to convey information or warning information about the search process.
score | Σ | 0..1 | decimal | Search ranking (between 0 and 1)
signature | Σ TU | 0..1 | Signature | Digital Signature
Documentation for this format

#### Terminology Bindings

Path | Conformance | ValueSet / Code
Bundle.language | preferred | CommonLanguages
Additional Bindings | Purpose
AllLanguages | Max Binding
Bundle.type | required | Fixed Value: searchset
Bundle.entry.search.mode | required | SearchEntryMode
Bundle.entry.request.method | required | HTTPVerb

#### Constraints

Id | Grade | Path(s) | Details | Requirements
bdl-5 | error | Bundle.entry | must be a resource unless there's a request or response : resource.exists() or request.exists() or response.exists() |
bdl-8 | error | Bundle.entry | fullUrl cannot be a version specific reference : fullUrl.contains('/_history/').not() |
ele-1 | error | **ALL** elements | All FHIR elements must have a @value or children : hasValue() or (children().count() > id.count()) |
ext-1 | error | **ALL** extensions | Must have either extensions or value[x], not both : extension.exists() != value.exists() |

This structure is derived from Bundle

Summary

Mandatory: 3 elements (1 nested mandatory element)
Must-Support: 9 elements
Fixed Value: 2 elements
Prohibited: 2 elements

Slices

This structure defines the following Slices:

- The element Bundle.link is sliced based on the value of value:relation

Other representations of profile: CSV, Excel, Schematron