This
page
is
part
of
the
FHIR
Specification
(v3.3.0:
(v4.0.1:
R4
Ballot
2).
-
Mixed
Normative
and
STU
)
in
it's
permanent
home
(it
will
always
be
available
at
this
URL).
The
current
version
which
supercedes
this
version
is
5.0.0
.
For
a
full
list
of
available
versions,
see
the
Directory
of
published
versions
.
Page
versions:
R5
R4B
R4
R3
R2
FHIR
Infrastructure
Work
Group
|
Maturity
Level
:
|
Normative (from v4.0.0) | Security Category : Anonymous | Compartments : Not linked to any defined compartments |
|
|
This
page
standard.
See
the
Conformance
Package
|
A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).
The OperationDefinition resource provides a formal computable definition of an operation or a named query . The OperationDefinition serves two principal purposes:
See below for further information about these, and about how operations and named queries are executed.
OperationDefinitions are published to define operations that servers can implement in a common fashion. The FHIR specification itself describes some (see below), and other organizations (including IHE, national programs, jurisdictions and vendors) are able to publish additional OperationDefinitions.
OperationDefinition resources are referred to from two different places:
This
resource
is
referenced
by
capabilitystatement
CapabilityStatement
,
CarePlan
,
Communication
,
FamilyMemberHistory
,
itself
and
Procedure
Structure
| Name | Flags | Card. | Type |
Description
&
Constraints
|
|---|---|---|---|---|
|
I N | DomainResource |
Definition
of
an
operation
or
a
named
query
+ Warning: Name should be usable as an identifier for the module by machine processing applications such as code generation Elements defined in Ancestors: id , meta , implicitRules , language , text , contained , extension , modifierExtension |
|
|
Σ | 0..1 | uri | Canonical identifier for this operation definition, represented as a URI (globally unique) |
|
Σ | 0..1 | string | Business version of the operation definition |
|
Σ I | 1..1 | string | Name for this operation definition (computer friendly) |
| Σ | 0..1 | string | Name for this operation definition (human friendly) |
![]() ![]() |
?! Σ | 1..1 | code |
draft
|
active
|
retired
|
unknown
PublicationStatus ( Required ) |
|
Σ | 1..1 | code |
operation
|
query
OperationKind ( Required ) |
|
Σ | 0..1 | boolean | For testing purposes, not real usage |
|
Σ | 0..1 | dateTime | Date last changed |
|
Σ | 0..1 | string | Name of the publisher (organization or individual) |
|
Σ | 0..* | ContactDetail |
Contact
details
for
the
publisher
|
|
0..1 | markdown | Natural language description of the operation definition | |
|
Σ TU | 0..* | UsageContext |
The
context
that
the
content
is
intended
to
support
|
|
Σ | 0..* | CodeableConcept |
Intended
jurisdiction
for
operation
definition
(if
applicable)
Jurisdiction |
|
0..1 | markdown | Why this operation definition is defined | |
|
Σ | 0..1 | boolean |
Whether
content
is
|
|
Σ | 1..1 | code | Name used to invoke the operation |
|
0..1 | markdown | Additional information about use | |
|
Σ | 0..1 | canonical ( OperationDefinition ) | Marks this as a profile of the base |
|
Σ | 0..* | code |
Types
this
operation
applies
to
ResourceType ( Required ) |
|
Σ | 1..1 | boolean | Invoke at the system level? |
|
Σ | 1..1 | boolean | Invoke at the type level? |
|
Σ | 1..1 | boolean | Invoke on an instance? |
|
0..1 | canonical ( StructureDefinition ) | Validation information for in parameters | |
|
0..1 | canonical ( StructureDefinition ) | Validation information for out parameters | |
|
I | 0..* | BackboneElement |
Parameters
for
the
operation/query
+ Rule: Either a type must be provided, or parts + Rule: A search type can only be specified for parameters of type string + Rule: A targetProfile can only be specified for parameters of type Reference or Canonical |
|
1..1 | code | Name in Parameters.parameter.name or in URL | |
|
1..1 | code |
in
|
out
OperationParameterUse ( Required ) |
|
|
1..1 | integer | Minimum Cardinality | |
|
1..1 | string | Maximum Cardinality (a number or *) | |
|
0..1 | string | Description of meaning/use | |
|
I | 0..1 | code |
What
type
this
parameter
has
FHIRAllTypes ( Required ) |
|
0..* | canonical ( StructureDefinition ) |
If
type
is
|
|
|
I | 0..1 | code |
number
|
date
|
string
|
token
|
reference
|
composite
|
quantity
|
uri
|
special
SearchParamType ( Required ) |
|
0..1 | BackboneElement | ValueSet details if this is coded | |
|
1..1 | code |
required
|
extensible
|
preferred
|
example
BindingStrength ( Required ) |
|
|
1..1 | canonical ( ValueSet ) | Source of value set | |
| TU | 0..* | BackboneElement |
References
to
this
parameter
|
|
1..1 |
|
Referencing parameter | |
|
0..1 |
|
Element id of reference | |
|
I | 0..* | see parameter |
Parts
of
a
nested
Parameter
|
|
0..* | BackboneElement |
Define
overloaded
variants
for
when
generating
code
|
|
|
0..* | string |
Name
of
parameter
to
include
in
overload
|
|
|
0..1 | string | Comments to go on overload | |
Documentation
for
this
format
|
||||
UML Diagram ( Legend )
XML Template
<OperationDefinition xmlns="http://hl7.org/fhir"><!-- from Resource: id, meta, implicitRules, and language --> <!-- from DomainResource: text, contained, extension, and modifierExtension -->
<<url value="[uri]"/><!-- 0..1 Canonical identifier for this operation definition, represented as a URI (globally unique) --> <version value="[string]"/><!-- 0..1 Business version of the operation definition --><<name value="[string]"/><!--1..1 Name for this operation definition (computer friendly) --> <title value="[string]"/><!-- 0..1 Name for this operation definition (human friendly) --> <status value="[code]"/><!-- 1..1 draft | active | retired | unknown --> <kind value="[code]"/><!-- 1..1 operation | query -->
<<experimental value="[boolean]"/><!-- 0..1 For testing purposes, not real usage --> <date value="[dateTime]"/><!-- 0..1 Date last changed --> <publisher value="[string]"/><!-- 0..1 Name of the publisher (organization or individual) --> <contact><!-- 0..* ContactDetail Contact details for the publisher --></contact> <description value="[markdown]"/><!-- 0..1 Natural language description of the operation definition --><</useContext><useContext><!-- 0..* UsageContext The context that the content is intended to support --></useContext> <jurisdiction><!-- 0..* CodeableConcept Intended jurisdiction for operation definition (if applicable) --></jurisdiction> <purpose value="[markdown]"/><!-- 0..1 Why this operation definition is defined --><<affectsState value="[boolean]"/><!-- 0..1 Whether content is changed by the operation --> <code value="[code]"/><!-- 1..1 Name used to invoke the operation --> <comment value="[markdown]"/><!-- 0..1 Additional information about use --> <base><!-- 0..1 canonical(OperationDefinition) Marks this as a profile of the base --></base> <resource value="[code]"/><!-- 0..* Types this operation applies to --> <system value="[boolean]"/><!-- 1..1 Invoke at the system level? --> <type value="[boolean]"/><!-- 1..1 Invoke at the type level? --> <instance value="[boolean]"/><!-- 1..1 Invoke on an instance? --><</inputProfile> <</outputProfile><inputProfile><!-- 0..1 canonical(StructureDefinition) Validation information for in parameters --></inputProfile> <outputProfile><!-- 0..1 canonical(StructureDefinition) Validation information for out parameters --></outputProfile> <parameter> <!-- 0..* Parameters for the operation/query --> <name value="[code]"/><!-- 1..1 Name in Parameters.parameter.name or in URL --> <use value="[code]"/><!-- 1..1 in | out --> <min value="[integer]"/><!-- 1..1 Minimum Cardinality --> <max value="[string]"/><!-- 1..1 Maximum Cardinality (a number or *) --> <documentation value="[string]"/><!-- 0..1 Description of meaning/use --> <type value="[code]"/><!--0..1 What type this parameter has -->
<</targetProfile> <<targetProfile><!-- 0..* canonical(StructureDefinition) If type is Reference | canonical, allowed targets --></targetProfile> <searchType value="[code]"/><!--0..1 number | date | string | token | reference | composite | quantity | uri | special --> <binding> <!-- 0..1 ValueSet details if this is coded --> <strength value="[code]"/><!-- 1..1 required | extensible | preferred | example -->
<</valueSet[x]><valueSet><!-- 1..1 canonical(ValueSet) Source of value set --></valueSet> </binding> <referencedFrom> <!-- 0..* References to this parameter --> <source value="[string]"/><!-- 1..1 Referencing parameter --> <sourceId value="[string]"/><!-- 0..1 Element id of reference --> </referencedFrom> <part><!--0..* Content as for OperationDefinition.parameter Parts of a nested Parameter --></part> </parameter> <overload> <!-- 0..* Define overloaded variants for when generating code --> <parameterName value="[string]"/><!-- 0..* Name of parameter to include in overload --> <comment value="[string]"/><!-- 0..1 Comments to go on overload --> </overload> </OperationDefinition>
JSON Template
{
"resourceType" : "OperationDefinition",
// from Resource: id, meta, implicitRules, and language
// from DomainResource: text, contained, extension, and modifierExtension
"
"url" : "<uri>", // Canonical identifier for this operation definition, represented as a URI (globally unique)
"version" : "<string>", // Business version of the operation definition
"
"name" : "<string>", // C? R! Name for this operation definition (computer friendly)
"title" : "<string>", // Name for this operation definition (human friendly)
"status" : "<code>", // R! draft | active | retired | unknown
"kind" : "<code>", // R! operation | query
"
"experimental" : <boolean>, // For testing purposes, not real usage
"date" : "<dateTime>", // Date last changed
"publisher" : "<string>", // Name of the publisher (organization or individual)
"contact" : [{ ContactDetail }], // Contact details for the publisher
"description" : "<markdown>", // Natural language description of the operation definition
"
"useContext" : [{ UsageContext }], // The context that the content is intended to support
"jurisdiction" : [{ CodeableConcept }], // Intended jurisdiction for operation definition (if applicable)
"purpose" : "<markdown>", // Why this operation definition is defined
"
"affectsState" : <boolean>, // Whether content is changed by the operation
"code" : "<code>", // R! Name used to invoke the operation
"comment" : "<markdown>", // Additional information about use
"
"base" : { canonical(OperationDefinition) }, // Marks this as a profile of the base
"resource" : ["<code>"], // Types this operation applies to
"system" : <boolean>, // R! Invoke at the system level?
"type" : <boolean>, // R! Invoke at the type level?
"instance" : <boolean>, // R! Invoke on an instance?
"
"
"inputProfile" : { canonical(StructureDefinition) }, // Validation information for in parameters
"outputProfile" : { canonical(StructureDefinition) }, // Validation information for out parameters
"parameter" : [{ // Parameters for the operation/query
"name" : "<code>", // R! Name in Parameters.parameter.name or in URL
"use" : "<code>", // R! in | out
"min" : <integer>, // R! Minimum Cardinality
"max" : "<string>", // R! Maximum Cardinality (a number or *)
"documentation" : "<string>", // Description of meaning/use
"type" : "<code>", // C? What type this parameter has
"
"
"targetProfile" : [{ canonical(StructureDefinition) }], // If type is Reference | canonical, allowed targets
"searchType" : "<code>", // C? number | date | string | token | reference | composite | quantity | uri | special
"binding" : { // ValueSet details if this is coded
"strength" : "<code>", // R! required | extensible | preferred | example
">"
">"
"valueSet" : { canonical(ValueSet) } // R! Source of value set
},
"referencedFrom" : [{ // References to this parameter
"source" : "<string>", // R! Referencing parameter
"sourceId" : "<string>" // Element id of reference
}],
"part" : [{ Content as for OperationDefinition.parameter }] // C? Parts of a nested Parameter
}],
"overload" : [{ // Define overloaded variants for when generating code
"parameterName" : ["<string>"], // Name of parameter to include in overload
"comment" : "<string>" // Comments to go on overload
}]
}
Turtle Template
@prefix fhir: <http://hl7.org/fhir/> .[ a fhir:OperationDefinition; fhir:nodeRole fhir:treeRoot; # if this is the parser root # from Resource: .id, .meta, .implicitRules, and .language # from DomainResource: .text, .contained, .extension, and .modifierExtension
fhir:fhir:OperationDefinition.url [ uri ]; # 0..1 Canonical identifier for this operation definition, represented as a URI (globally unique) fhir:OperationDefinition.version [ string ]; # 0..1 Business version of the operation definition fhir:OperationDefinition.name [ string ]; # 1..1 Name for this operation definition (computer friendly) fhir:OperationDefinition.title [ string ]; # 0..1 Name for this operation definition (human friendly) fhir:OperationDefinition.status [ code ]; # 1..1 draft | active | retired | unknown fhir:OperationDefinition.kind [ code ]; # 1..1 operation | queryfhir:fhir:OperationDefinition.experimental [ boolean ]; # 0..1 For testing purposes, not real usage fhir:OperationDefinition.date [ dateTime ]; # 0..1 Date last changed fhir:OperationDefinition.publisher [ string ]; # 0..1 Name of the publisher (organization or individual) fhir:OperationDefinition.contact [ ContactDetail ], ... ; # 0..* Contact details for the publisher fhir:OperationDefinition.description [ markdown ]; # 0..1 Natural language description of the operation definitionfhir:fhir:OperationDefinition.useContext [ UsageContext ], ... ; # 0..* The context that the content is intended to support fhir:OperationDefinition.jurisdiction [ CodeableConcept ], ... ; # 0..* Intended jurisdiction for operation definition (if applicable) fhir:OperationDefinition.purpose [ markdown ]; # 0..1 Why this operation definition is definedfhir:fhir:OperationDefinition.affectsState [ boolean ]; # 0..1 Whether content is changed by the operation fhir:OperationDefinition.code [ code ]; # 1..1 Name used to invoke the operation fhir:OperationDefinition.comment [ markdown ]; # 0..1 Additional information about use fhir:OperationDefinition.base [ canonical(OperationDefinition) ]; # 0..1 Marks this as a profile of the base fhir:OperationDefinition.resource [ code ], ... ; # 0..* Types this operation applies to fhir:OperationDefinition.system [ boolean ]; # 1..1 Invoke at the system level? fhir:OperationDefinition.type [ boolean ]; # 1..1 Invoke at the type level? fhir:OperationDefinition.instance [ boolean ]; # 1..1 Invoke on an instance?fhir: fhir:fhir:OperationDefinition.inputProfile [ canonical(StructureDefinition) ]; # 0..1 Validation information for in parameters fhir:OperationDefinition.outputProfile [ canonical(StructureDefinition) ]; # 0..1 Validation information for out parameters fhir:OperationDefinition.parameter [ # 0..* Parameters for the operation/query fhir:OperationDefinition.parameter.name [ code ]; # 1..1 Name in Parameters.parameter.name or in URL fhir:OperationDefinition.parameter.use [ code ]; # 1..1 in | out fhir:OperationDefinition.parameter.min [ integer ]; # 1..1 Minimum Cardinality fhir:OperationDefinition.parameter.max [ string ]; # 1..1 Maximum Cardinality (a number or *) fhir:OperationDefinition.parameter.documentation [ string ]; # 0..1 Description of meaning/use fhir:OperationDefinition.parameter.type [ code ]; # 0..1 What type this parameter hasfhir: fhir:fhir:OperationDefinition.parameter.targetProfile [ canonical(StructureDefinition) ], ... ; # 0..* If type is Reference | canonical, allowed targets fhir:OperationDefinition.parameter.searchType [ code ]; # 0..1 number | date | string | token | reference | composite | quantity | uri | special fhir:OperationDefinition.parameter.binding [ # 0..1 ValueSet details if this is coded fhir:OperationDefinition.parameter.binding.strength [ code ]; # 1..1 required | extensible | preferred | example# . One of these 2 fhir: ] fhir:) ]fhir:OperationDefinition.parameter.binding.valueSet [ canonical(ValueSet) ]; # 1..1 Source of value set ]; fhir:OperationDefinition.parameter.referencedFrom [ # 0..* References to this parameter fhir:OperationDefinition.parameter.referencedFrom.source [ string ]; # 1..1 Referencing parameter fhir:OperationDefinition.parameter.referencedFrom.sourceId [ string ]; # 0..1 Element id of reference ], ...; fhir:OperationDefinition.parameter.part [ See OperationDefinition.parameter ], ... ; # 0..* Parts of a nested Parameter ], ...; fhir:OperationDefinition.overload [ # 0..* Define overloaded variants for when generating code fhir:OperationDefinition.overload.parameterName [ string ], ... ; # 0..* Name of parameter to include in overload fhir:OperationDefinition.overload.comment [ string ]; # 0..1 Comments to go on overload ], ...; ]
Changes since R3
| OperationDefinition | |
|
|
|
| OperationDefinition.status |
|
| OperationDefinition.kind |
|
| OperationDefinition.experimental |
|
| OperationDefinition.affectsState |
|
| OperationDefinition.comment |
|
| OperationDefinition.base |
|
| OperationDefinition.resource |
|
| OperationDefinition.inputProfile |
|
| OperationDefinition.outputProfile |
|
| OperationDefinition.parameter.use |
|
| OperationDefinition.parameter.type |
|
| OperationDefinition.parameter.targetProfile |
|
|
|
|
| OperationDefinition.parameter.binding.strength |
|
| OperationDefinition.parameter.binding.valueSet |
|
|
|
|
|
|
|
| OperationDefinition.parameter.referencedFrom.sourceId |
|
See the Full Difference for further information
This analysis is available as XML or JSON .
See
R2
<-->
R3
<-->
R4
Conversion
Maps
(status
=
18
37
tests
that
all
execute
ok.
1
fail
All
tests
pass
round-trip
testing
and
all
34
r3
resources
are
valid.).
Note:
these
have
note
yet
been
updated
to
be
R3
to
R4
invalid
(0
errors).
)
Structure
| Name | Flags | Card. | Type |
Description
&
Constraints
|
|---|---|---|---|---|
|
I N | DomainResource |
Definition
of
an
operation
or
a
named
query
+ Warning: Name should be usable as an identifier for the module by machine processing applications such as code generation Elements defined in Ancestors: id , meta , implicitRules , language , text , contained , extension , modifierExtension |
|
|
Σ | 0..1 | uri | Canonical identifier for this operation definition, represented as a URI (globally unique) |
|
Σ | 0..1 | string | Business version of the operation definition |
|
Σ I | 1..1 | string | Name for this operation definition (computer friendly) |
| Σ | 0..1 | string | Name for this operation definition (human friendly) |
![]() ![]() |
?! Σ | 1..1 | code |
draft
|
active
|
retired
|
unknown
PublicationStatus ( Required ) |
|
Σ | 1..1 | code |
operation
|
query
OperationKind ( Required ) |
|
Σ | 0..1 | boolean | For testing purposes, not real usage |
|
Σ | 0..1 | dateTime | Date last changed |
|
Σ | 0..1 | string | Name of the publisher (organization or individual) |
|
Σ | 0..* | ContactDetail |
Contact
details
for
the
publisher
|
|
0..1 | markdown | Natural language description of the operation definition | |
|
Σ TU | 0..* | UsageContext |
The
context
that
the
content
is
intended
to
support
|
|
Σ | 0..* | CodeableConcept |
Intended
jurisdiction
for
operation
definition
(if
applicable)
Jurisdiction |
|
0..1 | markdown | Why this operation definition is defined | |
|
Σ | 0..1 | boolean |
Whether
content
is
|
|
Σ | 1..1 | code | Name used to invoke the operation |
|
0..1 | markdown | Additional information about use | |
|
Σ | 0..1 | canonical ( OperationDefinition ) | Marks this as a profile of the base |
|
Σ | 0..* | code |
Types
this
operation
applies
to
ResourceType ( Required ) |
|
Σ | 1..1 | boolean | Invoke at the system level? |
|
Σ | 1..1 | boolean | Invoke at the type level? |
|
Σ | 1..1 | boolean | Invoke on an instance? |
|
0..1 | canonical ( StructureDefinition ) | Validation information for in parameters | |
|
0..1 | canonical ( StructureDefinition ) | Validation information for out parameters | |
|
I | 0..* | BackboneElement |
Parameters
for
the
operation/query
+ Rule: Either a type must be provided, or parts + Rule: A search type can only be specified for parameters of type string + Rule: A targetProfile can only be specified for parameters of type Reference or Canonical |
|
1..1 | code | Name in Parameters.parameter.name or in URL | |
|
1..1 | code |
in
|
out
OperationParameterUse ( Required ) |
|
|
1..1 | integer | Minimum Cardinality | |
|
1..1 | string | Maximum Cardinality (a number or *) | |
|
0..1 | string | Description of meaning/use | |
|
I | 0..1 | code |
What
type
this
parameter
has
FHIRAllTypes ( Required ) |
|
0..* | canonical ( StructureDefinition ) |
If
type
is
|
|
|
I | 0..1 | code |
number
|
date
|
string
|
token
|
reference
|
composite
|
quantity
|
uri
|
special
SearchParamType ( Required ) |
|
0..1 | BackboneElement | ValueSet details if this is coded | |
|
1..1 | code |
required
|
extensible
|
preferred
|
example
BindingStrength ( Required ) |
|
|
1..1 | canonical ( ValueSet ) | Source of value set | |
| TU | 0..* | BackboneElement |
References
to
this
parameter
|
|
1..1 |
|
Referencing parameter | |
|
0..1 |
|
Element id of reference | |
|
I | 0..* | see parameter |
Parts
of
a
nested
Parameter
|
|
0..* | BackboneElement |
Define
overloaded
variants
for
when
generating
code
|
|
|
0..* | string |
Name
of
parameter
to
include
in
overload
|
|
|
0..1 | string | Comments to go on overload | |
Documentation
for
this
format
|
||||
XML Template
<OperationDefinition xmlns="http://hl7.org/fhir"><!-- from Resource: id, meta, implicitRules, and language --> <!-- from DomainResource: text, contained, extension, and modifierExtension -->
<<url value="[uri]"/><!-- 0..1 Canonical identifier for this operation definition, represented as a URI (globally unique) --> <version value="[string]"/><!-- 0..1 Business version of the operation definition --><<name value="[string]"/><!--1..1 Name for this operation definition (computer friendly) --> <title value="[string]"/><!-- 0..1 Name for this operation definition (human friendly) --> <status value="[code]"/><!-- 1..1 draft | active | retired | unknown --> <kind value="[code]"/><!-- 1..1 operation | query -->
<<experimental value="[boolean]"/><!-- 0..1 For testing purposes, not real usage --> <date value="[dateTime]"/><!-- 0..1 Date last changed --> <publisher value="[string]"/><!-- 0..1 Name of the publisher (organization or individual) --> <contact><!-- 0..* ContactDetail Contact details for the publisher --></contact> <description value="[markdown]"/><!-- 0..1 Natural language description of the operation definition --><</useContext><useContext><!-- 0..* UsageContext The context that the content is intended to support --></useContext> <jurisdiction><!-- 0..* CodeableConcept Intended jurisdiction for operation definition (if applicable) --></jurisdiction> <purpose value="[markdown]"/><!-- 0..1 Why this operation definition is defined --><<affectsState value="[boolean]"/><!-- 0..1 Whether content is changed by the operation --> <code value="[code]"/><!-- 1..1 Name used to invoke the operation --> <comment value="[markdown]"/><!-- 0..1 Additional information about use --> <base><!-- 0..1 canonical(OperationDefinition) Marks this as a profile of the base --></base> <resource value="[code]"/><!-- 0..* Types this operation applies to --> <system value="[boolean]"/><!-- 1..1 Invoke at the system level? --> <type value="[boolean]"/><!-- 1..1 Invoke at the type level? --> <instance value="[boolean]"/><!-- 1..1 Invoke on an instance? --><</inputProfile> <</outputProfile><inputProfile><!-- 0..1 canonical(StructureDefinition) Validation information for in parameters --></inputProfile> <outputProfile><!-- 0..1 canonical(StructureDefinition) Validation information for out parameters --></outputProfile> <parameter> <!-- 0..* Parameters for the operation/query --> <name value="[code]"/><!-- 1..1 Name in Parameters.parameter.name or in URL --> <use value="[code]"/><!-- 1..1 in | out --> <min value="[integer]"/><!-- 1..1 Minimum Cardinality --> <max value="[string]"/><!-- 1..1 Maximum Cardinality (a number or *) --> <documentation value="[string]"/><!-- 0..1 Description of meaning/use --> <type value="[code]"/><!--0..1 What type this parameter has -->
<</targetProfile> <<targetProfile><!-- 0..* canonical(StructureDefinition) If type is Reference | canonical, allowed targets --></targetProfile> <searchType value="[code]"/><!--0..1 number | date | string | token | reference | composite | quantity | uri | special --> <binding> <!-- 0..1 ValueSet details if this is coded --> <strength value="[code]"/><!-- 1..1 required | extensible | preferred | example -->
<</valueSet[x]><valueSet><!-- 1..1 canonical(ValueSet) Source of value set --></valueSet> </binding> <referencedFrom> <!-- 0..* References to this parameter --> <source value="[string]"/><!-- 1..1 Referencing parameter --> <sourceId value="[string]"/><!-- 0..1 Element id of reference --> </referencedFrom> <part><!--0..* Content as for OperationDefinition.parameter Parts of a nested Parameter --></part> </parameter> <overload> <!-- 0..* Define overloaded variants for when generating code --> <parameterName value="[string]"/><!-- 0..* Name of parameter to include in overload --> <comment value="[string]"/><!-- 0..1 Comments to go on overload --> </overload> </OperationDefinition>
JSON Template
{
"resourceType" : "OperationDefinition",
// from Resource: id, meta, implicitRules, and language
// from DomainResource: text, contained, extension, and modifierExtension
"
"url" : "<uri>", // Canonical identifier for this operation definition, represented as a URI (globally unique)
"version" : "<string>", // Business version of the operation definition
"
"name" : "<string>", // C? R! Name for this operation definition (computer friendly)
"title" : "<string>", // Name for this operation definition (human friendly)
"status" : "<code>", // R! draft | active | retired | unknown
"kind" : "<code>", // R! operation | query
"
"experimental" : <boolean>, // For testing purposes, not real usage
"date" : "<dateTime>", // Date last changed
"publisher" : "<string>", // Name of the publisher (organization or individual)
"contact" : [{ ContactDetail }], // Contact details for the publisher
"description" : "<markdown>", // Natural language description of the operation definition
"
"useContext" : [{ UsageContext }], // The context that the content is intended to support
"jurisdiction" : [{ CodeableConcept }], // Intended jurisdiction for operation definition (if applicable)
"purpose" : "<markdown>", // Why this operation definition is defined
"
"affectsState" : <boolean>, // Whether content is changed by the operation
"code" : "<code>", // R! Name used to invoke the operation
"comment" : "<markdown>", // Additional information about use
"
"base" : { canonical(OperationDefinition) }, // Marks this as a profile of the base
"resource" : ["<code>"], // Types this operation applies to
"system" : <boolean>, // R! Invoke at the system level?
"type" : <boolean>, // R! Invoke at the type level?
"instance" : <boolean>, // R! Invoke on an instance?
"
"
"inputProfile" : { canonical(StructureDefinition) }, // Validation information for in parameters
"outputProfile" : { canonical(StructureDefinition) }, // Validation information for out parameters
"parameter" : [{ // Parameters for the operation/query
"name" : "<code>", // R! Name in Parameters.parameter.name or in URL
"use" : "<code>", // R! in | out
"min" : <integer>, // R! Minimum Cardinality
"max" : "<string>", // R! Maximum Cardinality (a number or *)
"documentation" : "<string>", // Description of meaning/use
"type" : "<code>", // C? What type this parameter has
"
"
"targetProfile" : [{ canonical(StructureDefinition) }], // If type is Reference | canonical, allowed targets
"searchType" : "<code>", // C? number | date | string | token | reference | composite | quantity | uri | special
"binding" : { // ValueSet details if this is coded
"strength" : "<code>", // R! required | extensible | preferred | example
">"
">"
"valueSet" : { canonical(ValueSet) } // R! Source of value set
},
"referencedFrom" : [{ // References to this parameter
"source" : "<string>", // R! Referencing parameter
"sourceId" : "<string>" // Element id of reference
}],
"part" : [{ Content as for OperationDefinition.parameter }] // C? Parts of a nested Parameter
}],
"overload" : [{ // Define overloaded variants for when generating code
"parameterName" : ["<string>"], // Name of parameter to include in overload
"comment" : "<string>" // Comments to go on overload
}]
}
Turtle Template
@prefix fhir: <http://hl7.org/fhir/> .[ a fhir:OperationDefinition; fhir:nodeRole fhir:treeRoot; # if this is the parser root # from Resource: .id, .meta, .implicitRules, and .language # from DomainResource: .text, .contained, .extension, and .modifierExtension
fhir:fhir:OperationDefinition.url [ uri ]; # 0..1 Canonical identifier for this operation definition, represented as a URI (globally unique) fhir:OperationDefinition.version [ string ]; # 0..1 Business version of the operation definition fhir:OperationDefinition.name [ string ]; # 1..1 Name for this operation definition (computer friendly) fhir:OperationDefinition.title [ string ]; # 0..1 Name for this operation definition (human friendly) fhir:OperationDefinition.status [ code ]; # 1..1 draft | active | retired | unknown fhir:OperationDefinition.kind [ code ]; # 1..1 operation | queryfhir:fhir:OperationDefinition.experimental [ boolean ]; # 0..1 For testing purposes, not real usage fhir:OperationDefinition.date [ dateTime ]; # 0..1 Date last changed fhir:OperationDefinition.publisher [ string ]; # 0..1 Name of the publisher (organization or individual) fhir:OperationDefinition.contact [ ContactDetail ], ... ; # 0..* Contact details for the publisher fhir:OperationDefinition.description [ markdown ]; # 0..1 Natural language description of the operation definitionfhir:fhir:OperationDefinition.useContext [ UsageContext ], ... ; # 0..* The context that the content is intended to support fhir:OperationDefinition.jurisdiction [ CodeableConcept ], ... ; # 0..* Intended jurisdiction for operation definition (if applicable) fhir:OperationDefinition.purpose [ markdown ]; # 0..1 Why this operation definition is definedfhir:fhir:OperationDefinition.affectsState [ boolean ]; # 0..1 Whether content is changed by the operation fhir:OperationDefinition.code [ code ]; # 1..1 Name used to invoke the operation fhir:OperationDefinition.comment [ markdown ]; # 0..1 Additional information about use fhir:OperationDefinition.base [ canonical(OperationDefinition) ]; # 0..1 Marks this as a profile of the base fhir:OperationDefinition.resource [ code ], ... ; # 0..* Types this operation applies to fhir:OperationDefinition.system [ boolean ]; # 1..1 Invoke at the system level? fhir:OperationDefinition.type [ boolean ]; # 1..1 Invoke at the type level? fhir:OperationDefinition.instance [ boolean ]; # 1..1 Invoke on an instance?fhir: fhir:fhir:OperationDefinition.inputProfile [ canonical(StructureDefinition) ]; # 0..1 Validation information for in parameters fhir:OperationDefinition.outputProfile [ canonical(StructureDefinition) ]; # 0..1 Validation information for out parameters fhir:OperationDefinition.parameter [ # 0..* Parameters for the operation/query fhir:OperationDefinition.parameter.name [ code ]; # 1..1 Name in Parameters.parameter.name or in URL fhir:OperationDefinition.parameter.use [ code ]; # 1..1 in | out fhir:OperationDefinition.parameter.min [ integer ]; # 1..1 Minimum Cardinality fhir:OperationDefinition.parameter.max [ string ]; # 1..1 Maximum Cardinality (a number or *) fhir:OperationDefinition.parameter.documentation [ string ]; # 0..1 Description of meaning/use fhir:OperationDefinition.parameter.type [ code ]; # 0..1 What type this parameter hasfhir: fhir:fhir:OperationDefinition.parameter.targetProfile [ canonical(StructureDefinition) ], ... ; # 0..* If type is Reference | canonical, allowed targets fhir:OperationDefinition.parameter.searchType [ code ]; # 0..1 number | date | string | token | reference | composite | quantity | uri | special fhir:OperationDefinition.parameter.binding [ # 0..1 ValueSet details if this is coded fhir:OperationDefinition.parameter.binding.strength [ code ]; # 1..1 required | extensible | preferred | example# . One of these 2 fhir: ] fhir:) ]fhir:OperationDefinition.parameter.binding.valueSet [ canonical(ValueSet) ]; # 1..1 Source of value set ]; fhir:OperationDefinition.parameter.referencedFrom [ # 0..* References to this parameter fhir:OperationDefinition.parameter.referencedFrom.source [ string ]; # 1..1 Referencing parameter fhir:OperationDefinition.parameter.referencedFrom.sourceId [ string ]; # 0..1 Element id of reference ], ...; fhir:OperationDefinition.parameter.part [ See OperationDefinition.parameter ], ... ; # 0..* Parts of a nested Parameter ], ...; fhir:OperationDefinition.overload [ # 0..* Define overloaded variants for when generating code fhir:OperationDefinition.overload.parameterName [ string ], ... ; # 0..* Name of parameter to include in overload fhir:OperationDefinition.overload.comment [ string ]; # 0..1 Comments to go on overload ], ...; ]
Changes
since
DSTU2
Release
3
| OperationDefinition | |
|
|
|
| OperationDefinition.status |
|
| OperationDefinition.kind |
|
| OperationDefinition.experimental |
|
| OperationDefinition.affectsState |
|
| OperationDefinition.comment |
|
| OperationDefinition.base |
|
| OperationDefinition.resource |
|
| OperationDefinition.inputProfile |
|
| OperationDefinition.outputProfile |
|
| OperationDefinition.parameter.use |
|
| OperationDefinition.parameter.type |
|
| OperationDefinition.parameter.targetProfile |
|
|
|
|
| OperationDefinition.parameter.binding.strength |
|
| OperationDefinition.parameter.binding.valueSet |
|
|
|
|
|
|
|
| OperationDefinition.parameter.referencedFrom.sourceId |
|
See the Full Difference for further information
This analysis is available as XML or JSON .
See
R2
<-->
R3
<-->
R4
Conversion
Maps
(status
=
18
37
tests
that
all
execute
ok.
1
fail
All
tests
pass
round-trip
testing
and
all
34
r3
resources
are
valid.).
Note:
these
have
note
yet
been
updated
to
be
R3
to
R4
invalid
(0
errors).
)
Alternate
See
the
Profiles
&
Extensions
and
the
alternate
definitions:
Master
Definition
XML
+
JSON
,
XML
Schema
/
Schematron
+
JSON
Schema
,
ShEx
(for
Turtle
)
+
see
the
extensions
&
the
dependency
analysis
| Path | Definition | Type | Reference |
|---|---|---|---|
| OperationDefinition.status | The lifecycle status of an artifact. | Required | PublicationStatus |
| OperationDefinition.kind | Whether an operation is a normal operation or a query. | Required | OperationKind |
| OperationDefinition.jurisdiction |
Countries
and
regions
within
which
this
artifact
is
targeted
for
|
Extensible | Jurisdiction ValueSet |
| OperationDefinition.resource | One of the resource types defined as part of this version of FHIR. | Required | Resource Types |
| OperationDefinition.parameter.use | Whether an operation parameter is an input or an output parameter. | Required | OperationParameterUse |
| OperationDefinition.parameter.type |
A
list
of
all
the
concrete
types
defined
in
this
version
of
the
FHIR
specification
-
Abstract
Types,
Data
Types
and
Resource
|
Required | All Types |
| OperationDefinition.parameter.searchType | Data types allowed to be used for search parameters. | Required | SearchParamType |
| OperationDefinition.parameter.binding.strength | Indication of the degree of conformance expectations associated with a binding. | Required | BindingStrength |
| id | Level | Location | Description | Expression |
| opd-0 | Warning | (base) | Name should be usable as an identifier for the module by machine processing applications such as code generation | name.matches('[A-Z]([A-Za-z0-9_]){0,254}') |
|
opd-1
|
Rule | OperationDefinition.parameter |
Either
a
type
must
be
provided,
or
parts
|
|
|
opd-2
|
Rule | OperationDefinition.parameter |
A
search
type
can
only
be
specified
for
parameters
of
type
string
|
|
| opd-3 | Rule | OperationDefinition.parameter | A targetProfile can only be specified for parameters of type Reference or Canonical | targetProfile.exists() implies (type = 'Reference' or type = 'canonical') |
| Base Operations (All resource types) | |
| Validate a resource | [base]/[Resource]/$validate | [base]/[Resource]/[id]/$validate |
| Access a list of profiles, tags, and security labels | [base]/$meta | [base]/[Resource]/$meta | [base]/[Resource]/[id]/$meta |
| Add profiles, tags, and security labels to a resource | [base]/[Resource]/[id]/$meta-add |
| Delete profiles, tags, and security labels for a resource | [base]/[Resource]/[id]/$meta-delete |
| Convert from one form to another | [base]/$convert |
| Execute a graphql statement | [base]/$graphql | [base]/[Resource]/[id]/$graphql |
| Return a graph of resources | [base]/[Resource]/[id]/$graph |
| Operations Defined by Resource Types | |
| Apply | [base]/ActivityDefinition/$apply | [base]/ActivityDefinition/[id]/$apply |
| Data Requirements | [base]/ActivityDefinition/[id]/$data-requirements |
| Fetch a subset of the CapabilityStatement resource | [base]/CapabilityStatement/$subset | [base]/CapabilityStatement/[id]/$subset |
| Test if a server implements a client's required operations | [base]/CapabilityStatement/$implements | [base]/CapabilityStatement/[id]/$implements |
| Test if a server implements a client's required operations | [base]/CapabilityStatement/$conforms |
| Discover what versions a server supports | [base]/$versions |
| Apply | [base]/ChargeItemDefinition/[id]/$apply |
| Submit a Claim resource for adjudication | [base]/Claim/$submit |
| Concept Look Up & Decomposition | [base]/CodeSystem/$lookup |
| Code System based Validation | [base]/CodeSystem/$validate-code | [base]/CodeSystem/[id]/$validate-code |
| Subsumption Testing | [base]/CodeSystem/$subsumes | [base]/CodeSystem/[id]/$subsumes |
|
|
|
| Generate a Document | [base]/Composition/$document | [base]/Composition/[id]/$document |
| Concept Translation | [base]/ConceptMap/$translate | [base]/ConceptMap/[id]/$translate |
| Closure Table Maintenance | [base]/$closure |
| Submit an EligibilityRequest resource for assessment |
|
| Fetch Encounter Record | [base]/Encounter/[id]/$everything |
| Fetch a group of Patient Records | [base]/Group/[id]/$everything |
| Data Requirements | [base]/$data-requirements | [base]/Library/[id]/$data-requirements |
| Find a functional list | [base]/List/$find |
| Evaluate Measure | [base]/Measure/$evaluate-measure | [base]/Measure/[id]/$evaluate-measure |
| Data Requirements | [base]/Measure/[id]/$data-requirements |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fetch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Build Questionnaire | [base]/StructureDefinition/$questionnaire | [base]/StructureDefinition/[id]/$questionnaire |
| Generate Snapshot | [base]/StructureDefinition/$snapshot | [base]/StructureDefinition/[id]/$snapshot |
| Model Instance Transformation | [base]/StructureMap/$transform | [base]/StructureMap/[id]/$transform |
| Value Set Expansion | [base]/ValueSet/$expand | [base]/ValueSet/[id]/$expand |
| Value Set based Validation | [base]/ValueSet/$validate-code | [base]/ValueSet/[id]/$validate-code |
There are 2 ways to describe the input and output parameters for an operation:
OperationDefinition.parameter
to
describe
the
parameters
OperationDefinition.inputProfile
and
OperationDefinition.outputProfile
The
parameters
is
a
simple
list
of
possible
parameters,
along
with
cardinalities
and
types.
The
profiles
allow
a
rich
set
of
validation
rules
etc.
to
be
provided.
OperationDefinitions
SHALL
always
define
the
parameters
using
OperationDefinition.parameter
in
the
resource,
and
MAY
also
provide
profiles
for
the
parameters.
If
present,
the
profiles
SHALL
NOT
disagree
with
the
parameters
defined
for
the
operation.
As an example, consider an operation that defines 3 parameters, 2 in and 1 out:
| In Parameters: | |||||
| Name | Cardinality | Type | Binding | Profile | Documentation |
| a | 0..1 | integer | An integer parameter | ||
| b | 0..1 | Patient | A patient parameter | ||
| Out Parameters: | |||||
| Name | Cardinality | Type | Binding | Profile | Documentation |
| c | 1..1 | decimal | A result parameter | ||
In addition to specifying the operation parameters directly, an operation definition can also provide a profile:
"inputProfile" : "http://example.org/StructureDefinition/op.x.in.profile"
This
profile
would
describe
a
parameters
resource
with
2
parameters
(using
slicing),
with
the
same
details
as
the
table
above.
The
operation
definition
would
still
list
the
parameters
directly
to
save
applications
consuming
the
definition
(e.g.
to
produce
an
OpenAPI
document
)
from
parsing
and
interpreting
the
profile.
Operations
OperationDefinitions
with
kind
=
operation
are
executed
by
POSTing
to
a
URL
that
is
as
defined
by
in
the
operation
definition
Operations
Framework
.
Named
queries
(OperationDefinitions
with
kind
=
query
)
are
executed
by
performing
a
search
with
the
value
of
the
search
parameter
"_query"
set
to
the
name
provided
in
the
definition.
If the named query is to be performed over the RESTful API, all the parameters must be simple search parameters, so that they can be represented directly in the URL without tricky encoding issues. Named queries always return a bundle containing a set of resources, so all the out parameters must be resources, not data types.
For named queries, all the standard search parameters are automatically in scope (though servers do not need to support them unless explicitly documented).
There are two ways to pass resources to an operation: directly or by reference. The definition of an operation distinguishes between these two, since they have very different behaviors and consequences.
As
an
example,
take
the
Questionnaire.$populate
ValueSet.$expand
operation
.
This
operation
takes
a
questionnaire
valueset
as
a
direct
parameter.
The
type
of
the
parameter
is
defined
as
'Questionnaire'.
'ValueSet'.
In
a
Parameters
resource,
it
would
be
represented
like
this:
<parameter><name value="questionnaire"/><name value="valueset"/> <resource><Questionnaire> <!-- Questionnaire contents --> </Questionnaire><ValueSet> <!-- Valueset contents --> </ValueSet> </resource> </parameter>
or, in JSON:
"parameter": [
{
"name": "questionnaire",
"name": "valueset",
"resource": {
"resourceType": "Questionnaire",
// Questionnaire contents
"resourceType": "ValueSet",
// Valueset contents
}
}
]
Other
parameters
are
passed
by
reference.
For
example,
$populate
the
ChargeItemDefinition.$apply
operation
takes
a
set
two
parameters
of
references
to
other
resources
that
should
be
used
type
Reference
-
one
to
pre-populate
the
questionnaire.
These
are
passed
by
reference,
chargeItem
and
the
other
to
the
account.
The
type
of
the
parameter
parameters
is
Reference(Any)
Reference(Charge)
-
a
reference
to
any
kind
and
Reference(Account)
,
respectively.
The
expectation
is
that
the
server
performing
the
operation
will
resolve
those
references
as
part
of
resource.
the
operation
execution.
In
a
parameters
resource,
it
the
chargeItem
parameter
would
be
represented
like
this:
<parameter><name value="content"/><name value="chargeItem"/> <valueReference><reference value="Patient/123"> </Questionnaire><reference value="ChargeItem/123"/> </valueReference> </parameter>
or, in JSON:
"parameter": [
{
"name": "questionnaire",
"name": "chargeItem",
"valueReference" : {
"reference" : "Patient/123"
"reference" : "ChargeItem/123"
}
}
]
Some
operations
can
take
either
form;
in
that
case,
two
distinct
parameters
must
be
defined,
defined:
one
for
a
resource
as
a
direct
parameter,
and
one
for
a
reference.
It is possible for two different organizations to create different operation definitions with the same name or, perhaps more likely, to define equivalent operations that have the same name but incompatible approaches in their parameter lists.
It is also possible, though unlikely, that a server will be required to support both of these operations. If this is the case, the server is able to do this by giving one of them a new name and referring to it by definition in the capability statement. To illustrate this, assume that two different organizations, "orgA" and "orgB", both define an operation called "dothis", and the definitions are incompatible. OrgA publishes its operation definition at http://orga.com/fhir/dothis.xml, and OrgB publishes its operation at http://fhir.orgb.com/meta/OperationDefinition/dothis. The server is able to implement both. Its capability statement will say:
<CapabilityStatement xmlns="http://hl7.org/fhir">
<!-- snip -->
<rest>
<!-- snip -->
<operation>
<name value="dothis"/>
<definition>
<reference value="http://orga.com/fhir/dothis.xml"/>
</definition>
</operation>
<operation>
<name value="dothis2"/>
<definition>
<reference value="http://fhir.orgb.com/meta/OperationDefinition/dothis"/>
</definition>
</operation>
<!-- snip -->
</rest>
<!-- snip -->
</CapabilityStatement>
If a general purpose cross server client is looking for the implementation of the http://fhir.orgb.com/meta/OperationDefinition/dothis operation and wants to be robust against this name clash problem, instead of simply executing the $dothis operation, it can look at the server's CapabilityStatement for the underlying definition URI and then execute the name given in the capability statement.
A client can determine the compatibility of the server by processing its capability statement and ensuring that the server implements the specific operation definitions and parameters required by the client. The client can then report a useful error to the user rather than allowing mystifying operational errors to occur.
However, there are fundamental limitations to this approach because there are many aspects of these operations that are not (or cannot be) defined in a formal fashion using OperationDefinition, for example, co-occurrence constraints among parameters.
In the same sense, a 3rd party tool can examine a server's CapabilityStatement and a client's definition of an acceptable server to determine whether those two system are interoperable or not.
Finally,
it
is
possible
to
generate
user
interface
forms
automatically
from
the
OperationDefinition.
The
documentation
in
the
OperationDefinition.description
and
OperationDefinition.parameter.documentation
should
be
sufficient
to
allow
moderately
technical
users
to
guess
at
the
correct
content
of
the
form.
For
this
reason,
highly
technical
documentation
should
go
in
OperationDefinition.comment
.
It is anticipated that this would be used to automate development processes, rather than to generate end-user forms: such users will usually need more support than can be offered in a generated form.
Search parameters for this resource. The common parameters also apply. See Searching for more information about searching in REST, messaging, and services.
| Name | Type | Description | Expression | In Common |
| base TU | reference | Marks this as a profile of the base |
OperationDefinition.base
( OperationDefinition ) |
|
| code TU | token | Name used to invoke the operation | OperationDefinition.code | |
| context TU | token | A use context assigned to the operation definition | (OperationDefinition.useContext.value as CodeableConcept) | |
| context-quantity TU | quantity | A quantity- or range-valued use context assigned to the operation definition | (OperationDefinition.useContext.value as Quantity) | (OperationDefinition.useContext.value as Range) | |
| context-type TU | token | A type of use context assigned to the operation definition | OperationDefinition.useContext.code | |
| context-type-quantity TU | composite | A use context type and quantity- or range-based value assigned to the operation definition |
On
OperationDefinition.useContext:
context-type: code context-quantity: value.as(Quantity) | value.as(Range) | |
| context-type-value TU | composite | A use context type and value assigned to the operation definition |
On
OperationDefinition.useContext:
context-type: code context: value.as(CodeableConcept) | |
| date TU | date | The operation definition publication date | OperationDefinition.date | |
| description TU | string | The description of the operation definition | OperationDefinition.description | |
| input-profile TU | reference | Validation information for in parameters |
OperationDefinition.inputProfile
( StructureDefinition ) |
|
| instance TU | token | Invoke on an instance? | OperationDefinition.instance | |
| jurisdiction TU | token | Intended jurisdiction for the operation definition | OperationDefinition.jurisdiction | |
| kind TU | token | operation | query | OperationDefinition.kind | |
| name TU | string | Computationally friendly name of the operation definition | OperationDefinition.name | |
| output-profile TU | reference | Validation information for out parameters |
OperationDefinition.outputProfile
( StructureDefinition ) |
|
| publisher TU | string | Name of the publisher of the operation definition | OperationDefinition.publisher | |
| status TU | token | The current status of the operation definition | OperationDefinition.status | |
| system TU | token | Invoke at the system level? | OperationDefinition.system | |
| title TU | string | The human-friendly name of the operation definition | OperationDefinition.title | |
| type TU | token | Invoke at the type level? | OperationDefinition.type | |
| url TU | uri | The uri that identifies the operation definition | OperationDefinition.url | |
| version TU | token | The business version of the operation definition | OperationDefinition.version |