DSTU2

This page is part of the FHIR Specification (v0.0.82: (v1.0.2: DSTU 1). 2). 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

6.18 Resource OperationDefinition - Content

This resource maintained by the
FHIR Management Group Infrastructure Work Group Maturity Level : 1 Compartments : Not linked to any defined compartments

A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction).

6.18.1 Scope and Usage

The OperationDefinition resource provides a formal computable definition of an operation or a named query . The OperationDefinition serves two principle principal purposes:

  • To allow for automatic determination of system compatibility
  • To allow for dynamic generation of forms to drive the operations

See below for further information about these, and about how Operations and Named Queries are executed.

6.18.2 Boundaries and Relationships

Operation Definitions are published to define operations that servers can implemnet implement in a common fashion. The FHIR specification itself describes a number (see below), and other organizations, including IHE, national programs, jurisdictions and vendors are able to publish additional operation definitions.

OperationDefinition resources are referred to from two different places:

  • From a Conformance Statement , to declare what operations a system does or should implement
  • From another OperationDefinition resource. This allows for a server to describe a limited implementation of a standard operation, or to allow traceability if the server has to rename the operation due to a name clash

This resource is referenced by [Conformance] conformance

6.18.3 Resource Content

Structure

Natural language description Why is this needed? ?! draft | active | retired ConformanceResourceStatus ( Required ) If for testing purposes, not real usage date 0..1 dateTime Date for this version of the operation definition kind 1..1 code I Parts of a Tuple Parameter Name of the parameter integer Maximum Cardinality (a number or *) Description of meaning/use code What type this parameter hs OperationParameterType ( Required ) profile Profile on the type
Name Flags Card. Type Description & Constraints doco
. . OperationDefinition DomainResource Definition of an operation or a named query
. . . url 0..1 uri Logical url URL to reference this operation definition
. . . version 0..1 string Logical id for this version of the operation definition
. . . name 1..1 string Informal name for this profile operation
. . . status ?! 1..1 code draft | active | retired
ConformanceResourceStatus ( Required )
... kind 1..1 code operation | query
OperationKind ( Required )
... experimental 0..1 boolean If for testing purposes, not real usage
... publisher Σ 0..1 string Name of the publisher (Organization or individual)
. . . contact Σ 0..* Element BackboneElement Contact details of the publisher
. . . . name Σ 0..1 string Name of a individual to contact
. . . . telecom Σ 0..* ContactPoint Contact details for individual or publisher
. . description . date 0..1 string dateTime Date for this version of the operation definition
. . requirements . description 0..1 string Natural language description of the operation
. . status . requirements 1..1 0..1 code string Why is this needed?
. . experimental . idempotent 0..1 boolean Whether content is unchanged by operation | query OperationKind ( Required )
. . . code 1..1 code Name used to invoke the operation
. . . notes 0..1 string Additional information about use
. . . base 0..1 Reference ( OperationDefinition ) Marks this as a profile of the base
. . . system 1..1 boolean Invoke at the system level?
. . . type 0..* code Invoke at resource level for these type
ResourceType ( Required )
. . . instance 1..1 boolean Invoke on an instance?
. . . parameter I 0..* Element BackboneElement Parameters for the operation/query
Either a type must be provided, or parts
. . . . name 1..1 code Name of the parameter in Parameters.parameter.name or in URL
. . . . use 1..1 code in | out
OperationParameterUse ( Required )
. . . . min 1..1 integer Minimum Cardinality
. . . . max 1..1 string Maximum Cardinality (a number or *)
. . . . documentation 0..1 string Description of meaning/use
. . . . type I 0..1 code What type this parameter hs has
OperationParameterType Parameter Types used in Operation Definitions ( Required )
. . . . profile 0..1 Reference ( StructureDefinition ) Profile on the type
. . . part . binding 0..* 0..1 Element BackboneElement ValueSet details if this is coded
. . . . name . strength 1..1 code required | extensible | preferred | example
BindingStrength ( Required )
. . . . min . valueSet[x] 1..1 Minimum Cardinality Source of value set
. . . . max . . valueSetUri 1..1 string uri
. . . documentation . . . valueSetReference 0..1 string Reference ( ValueSet )
. . . type . part I 1..1 0..* see parameter Parts of a Tuple Parameter
0..1
StructureDefinition doco Documentation for this format

UML Diagram

OperationDefinition ( DomainResource ) An absolute url URL that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should instance. This SHALL be a URL, SHOULD be globally unique uri) unique, and SHOULD be an address at which this operation definition is (or will be) published url : uri 0..1 [0..1] The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp version : string 0..1 [0..1] A free text natural language name identifying the Profile operation name : string 1..1 [1..1] The name of the individual or organization that published the operation definition publisher : string 0..1 A free text natural language description of the profile and its use description : string 0..1 Explains why this operation definition is needed and why it's been constrained as it has requirements : string 0..1 The status of the profile (this element modifies the meaning of other elements) status : code 1..1 [1..1] « The lifecycle status of a Value Set or Concept Map Map. (Strength=Required) ConformanceResourceStatus ! » Whether this is an operation or a named query kind : code [1..1] « Whether an operation is a normal operation or a query. (Strength=Required) OperationKind ! » This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage experimental : boolean 0..1 [0..1] The name of the individual or organization that published the operation definition publisher : string [0..1] The date that this version of the profile operation definition was published published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes date : dateTime 0..1 [0..1] A free text natural language description of the profile and its use description : string [0..1] Whether Explains why this is operation or named query definition is needed and why it's been constrained as it has kind requirements : code string 1..1 « [0..1] Whether Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation is a normal operation or instead of a query POST OperationKind idempotent » : boolean [0..1] The name used to invoke the operation code : code 1..1 [1..1] Additional information about how to use this operation or named query notes : string 0..1 [0..1] Indicates that this operation definition is a constraining profile on the base base : Reference ( [0..1] « OperationDefinition ) 0..1 » Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context) system : boolean 1..1 [1..1] Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context) type : code 0..* [0..*] « One of the resource types defined as part of FHIR FHIR. (Strength=Required) ResourceType ! » Indicates whether this operation can be invoked on a particular instance of one of the given types instance : boolean 1..1 [1..1] Contact The name of an individual to contact regarding the operation definition name : string 0..1 [0..1] Contact details for individual (if a name was provided) or the publisher telecom : ContactPoint 0..* [0..*] Parameter The name of used to identify the parameter name : code 1..1 [1..1] Whether this is an input or an output parameter use : code 1..1 [1..1] « Whether an operation parameter is an input or an output parameter parameter. (Strength=Required) OperationParameterUse ! » The minimum number of times this parameter SHALL appear in the request or response min : integer 1..1 [1..1] The maximum number of times this element is permitted to appear in the request or response max : string 1..1 [1..1] Describes the meaning or use of this parameter documentation : string 0..1 [0..1] The type for this parameter type : code 0..1 [0..1] « The type of a parameter parameter. (Strength=Required) OperationParameterType Parameter Types used in Opera... ! » A profile the specifies the rules that this parameter must conform to profile : Reference ( [0..1] « StructureDefinition ) 0..1 » Part The name of used to identify the parameter name : code 1..1 Binding The minimum number of times this parameter SHALL appear in Indicates the request or response min : integer 1..1 The maximum number degree of times conformance expectations associated with this element is permitted binding - that is, the degree to appear in which the request or response max : string 1..1 Describes provided value set must be adhered to in the meaning or use of this parameter documentation : string 0..1 The type for this parameter instances type strength : code 1..1 [1..1] « The type Indication of the degree of conformance expectations associated with a parameter binding. (Strength=Required) OperationParameterType BindingStrength ! » A profile the specifies Points to the rules value set or external definition (e.g. implicit value set) that this parameter must conform identifies the set of codes to be used profile valueSet[x] : Type [1..1] « uri | Reference ( StructureDefinition ValueSet ) 0..1 » Contacts to assist a user in finding and communicating with the publisher contact 0..* [0..*] Binds to a value set if this parameter is coded (code, Coding, CodeableConcept) binding [0..1] The parts of a Tuple Parameter part 0..* [0..*] The parameters for the operation/query parameter 0..* [0..*]

XML Template

<OperationDefinition xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <
 <
 <
 <

 <url value="[uri]"/><!-- 0..1 Logical URL to reference this operation definition -->
 <version value="[string]"/><!-- 0..1 Logical id for this version of the operation definition -->
 <name value="[string]"/><!-- 1..1 Informal name for this operation -->
 <status value="[code]"/><!-- 1..1 draft | active | retired -->
 <kind value="[code]"/><!-- 1..1 operation | query -->
 <experimental value="[boolean]"/><!-- 0..1 If for testing purposes, not real usage -->
 <publisher value="[string]"/><!-- 0..1 Name of the publisher (Organization or individual) -->

 <contact>  <!-- 0..* Contact details of the publisher -->
  <
  <</telecom>

  <name value="[string]"/><!-- 0..1 Name of a individual to contact -->
  <telecom><!-- 0..* ContactPoint Contact details for individual or publisher --></telecom>

 </contact>
 <
 <
 <
 <
 <
 <
 <
 <
 <</base>
 <
 <
 <

 <date value="[dateTime]"/><!-- 0..1 Date for this version of the operation definition -->
 <description value="[string]"/><!-- 0..1 Natural language description of the operation -->
 <requirements value="[string]"/><!-- 0..1 Why is this needed? -->
 <idempotent value="[boolean]"/><!-- 0..1 Whether content is unchanged by operation -->
 <code value="[code]"/><!-- 1..1 Name used to invoke the operation -->
 <notes value="[string]"/><!-- 0..1 Additional information about use -->
 <base><!-- 0..1 Reference(OperationDefinition) Marks this as a profile of the base --></base>
 <system value="[boolean]"/><!-- 1..1 Invoke at the system level? -->
 <type value="[code]"/><!-- 0..* Invoke at resource level for these type -->
 <instance value="[boolean]"/><!-- 1..1 Invoke on an instance? -->

 <parameter>  <!-- 0..* Parameters for the operation/query -->
  <
  <
  <
  <
  <
  <
  <</profile>
  <
   <
   <
   <
   <
   <
   <</profile>
  </part>

  <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 -->
  <profile><!-- 0..1 Reference(StructureDefinition) Profile on the type --></profile>
  <binding>  <!-- 0..1 ValueSet details if this is coded -->
   <strength value="[code]"/><!-- 1..1 required | extensible | preferred | example -->
   <valueSet[x]><!-- 1..1 uri|Reference(ValueSet) Source of value set --></valueSet[x]>
  </binding>
  <part><!-- ?? 0..* Content as for OperationDefinition.parameter Parts of a Tuple Parameter --></part>

 </parameter>
</OperationDefinition>

JSON Template

{doco
  "resourceType" : "OperationDefinition",
  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "
  "
  "
  "
  "
    "
    "

  "url" : "<uri>", // Logical URL to reference this operation definition
  "version" : "<string>", // Logical id for this version of the operation definition
  "name" : "<string>", // R!  Informal name for this operation
  "status" : "<code>", // R!  draft | active | retired
  "kind" : "<code>", // R!  operation | query
  "experimental" : <boolean>, // If for testing purposes, not real usage
  "publisher" : "<string>", // Name of the publisher (Organization or individual)
  "contact" : [{ // Contact details of the publisher
    "name" : "<string>", // Name of a individual to contact
    "telecom" : [{ ContactPoint }] // Contact details for individual or publisher

  }],
  "
  "
  "
  "
  "
  "
  "
  "
  "
  "
  "
  "
  "
    "
    "
    "
    "
    "
    "
    "
    "
      "
      "
      "
      "
      "
      "
    }]

  "date" : "<dateTime>", // Date for this version of the operation definition
  "description" : "<string>", // Natural language description of the operation
  "requirements" : "<string>", // Why is this needed?
  "idempotent" : <boolean>, // Whether content is unchanged by operation
  "code" : "<code>", // R!  Name used to invoke the operation
  "notes" : "<string>", // Additional information about use
  "base" : { Reference(OperationDefinition) }, // Marks this as a profile of the base
  "system" : <boolean>, // R!  Invoke at the system level?
  "type" : ["<code>"], // Invoke at resource level for these type
  "instance" : <boolean>, // R!  Invoke on an instance?
  "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
    "profile" : { Reference(StructureDefinition) }, // Profile on the type
    "binding" : { // ValueSet details if this is coded
      "strength" : "<code>", // R!  required | extensible | preferred | example
      // valueSet[x]: Source of value set. One of these 2:

      "valueSetUri" : "<uri>"
      "valueSetReference" : { Reference(ValueSet) }
    },
    "part" : [{ Content as for OperationDefinition.parameter }] // C? Parts of a Tuple Parameter

  }]
}

Structure

Natural language description Why is this needed? ?! draft | active | retired ConformanceResourceStatus ( Required ) If for testing purposes, not real usage date 0..1 dateTime Date for this version of the operation definition kind 1..1 code I Parts of a Tuple Parameter Name of the parameter integer Maximum Cardinality (a number or *) Description of meaning/use code What type this parameter hs OperationParameterType ( Required ) profile Profile on the type
Name Flags Card. Type Description & Constraints doco
. . OperationDefinition DomainResource Definition of an operation or a named query
. . . url 0..1 uri Logical url URL to reference this operation definition
. . . version 0..1 string Logical id for this version of the operation definition
. . . name 1..1 string Informal name for this profile operation
. . . status ?! 1..1 code draft | active | retired
ConformanceResourceStatus ( Required )
... kind 1..1 code operation | query
OperationKind ( Required )
... experimental 0..1 boolean If for testing purposes, not real usage
... publisher Σ 0..1 string Name of the publisher (Organization or individual)
. . . contact Σ 0..* Element BackboneElement Contact details of the publisher
. . . . name Σ 0..1 string Name of a individual to contact
. . . . telecom Σ 0..* ContactPoint Contact details for individual or publisher
. . description . date 0..1 string dateTime Date for this version of the operation definition
. . requirements . description 0..1 string Natural language description of the operation
. . status . requirements 1..1 0..1 code string Why is this needed?
. . experimental . idempotent 0..1 boolean Whether content is unchanged by operation | query OperationKind ( Required )
. . . code 1..1 code Name used to invoke the operation
. . . notes 0..1 string Additional information about use
. . . base 0..1 Reference ( OperationDefinition ) Marks this as a profile of the base
. . . system 1..1 boolean Invoke at the system level?
. . . type 0..* code Invoke at resource level for these type
ResourceType ( Required )
. . . instance 1..1 boolean Invoke on an instance?
. . . parameter I 0..* Element BackboneElement Parameters for the operation/query
Either a type must be provided, or parts
. . . . name 1..1 code Name of the parameter in Parameters.parameter.name or in URL
. . . . use 1..1 code in | out
OperationParameterUse ( Required )
. . . . min 1..1 integer Minimum Cardinality
. . . . max 1..1 string Maximum Cardinality (a number or *)
. . . . documentation 0..1 string Description of meaning/use
. . . . type I 0..1 code What type this parameter hs has
OperationParameterType Parameter Types used in Operation Definitions ( Required )
. . . . profile 0..1 Reference ( StructureDefinition ) Profile on the type
. . . part . binding 0..* 0..1 Element BackboneElement ValueSet details if this is coded
. . . . name . strength 1..1 code required | extensible | preferred | example
BindingStrength ( Required )
. . . . min . valueSet[x] 1..1 Minimum Cardinality Source of value set
. . . . max . . valueSetUri 1..1 string uri
. . . documentation . . . valueSetReference 0..1 string Reference ( ValueSet )
. . . type . part I 1..1 0..* see parameter Parts of a Tuple Parameter
0..1
StructureDefinition doco Documentation for this format

UML Diagram

OperationDefinition ( DomainResource ) An absolute url URL that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should instance. This SHALL be a URL, SHOULD be globally unique uri) unique, and SHOULD be an address at which this operation definition is (or will be) published url : uri 0..1 [0..1] The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp version : string 0..1 [0..1] A free text natural language name identifying the Profile operation name : string 1..1 [1..1] The name of the individual or organization that published the operation definition publisher : string 0..1 A free text natural language description of the profile and its use description : string 0..1 Explains why this operation definition is needed and why it's been constrained as it has requirements : string 0..1 The status of the profile (this element modifies the meaning of other elements) status : code 1..1 [1..1] « The lifecycle status of a Value Set or Concept Map Map. (Strength=Required) ConformanceResourceStatus ! » Whether this is an operation or a named query kind : code [1..1] « Whether an operation is a normal operation or a query. (Strength=Required) OperationKind ! » This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage experimental : boolean 0..1 [0..1] The name of the individual or organization that published the operation definition publisher : string [0..1] The date that this version of the profile operation definition was published published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes date : dateTime 0..1 [0..1] A free text natural language description of the profile and its use description : string [0..1] Whether Explains why this is operation or named query definition is needed and why it's been constrained as it has kind requirements : code string 1..1 « [0..1] Whether Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation is a normal operation or instead of a query POST OperationKind idempotent » : boolean [0..1] The name used to invoke the operation code : code 1..1 [1..1] Additional information about how to use this operation or named query notes : string 0..1 [0..1] Indicates that this operation definition is a constraining profile on the base base : Reference ( [0..1] « OperationDefinition ) 0..1 » Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context) system : boolean 1..1 [1..1] Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context) type : code 0..* [0..*] « One of the resource types defined as part of FHIR FHIR. (Strength=Required) ResourceType ! » Indicates whether this operation can be invoked on a particular instance of one of the given types instance : boolean 1..1 [1..1] Contact The name of an individual to contact regarding the operation definition name : string 0..1 [0..1] Contact details for individual (if a name was provided) or the publisher telecom : ContactPoint 0..* [0..*] Parameter The name of used to identify the parameter name : code 1..1 [1..1] Whether this is an input or an output parameter use : code 1..1 [1..1] « Whether an operation parameter is an input or an output parameter parameter. (Strength=Required) OperationParameterUse ! » The minimum number of times this parameter SHALL appear in the request or response min : integer 1..1 [1..1] The maximum number of times this element is permitted to appear in the request or response max : string 1..1 [1..1] Describes the meaning or use of this parameter documentation : string 0..1 [0..1] The type for this parameter type : code 0..1 [0..1] « The type of a parameter parameter. (Strength=Required) OperationParameterType Parameter Types used in Opera... ! » A profile the specifies the rules that this parameter must conform to profile : Reference ( [0..1] « StructureDefinition ) 0..1 » Part The name of used to identify the parameter name : code 1..1 Binding The minimum number of times this parameter SHALL appear in Indicates the request or response min : integer 1..1 The maximum number degree of times conformance expectations associated with this element is permitted binding - that is, the degree to appear in which the request or response max : string 1..1 Describes provided value set must be adhered to in the meaning or use of this parameter documentation : string 0..1 The type for this parameter instances type strength : code 1..1 [1..1] « The type Indication of the degree of conformance expectations associated with a parameter binding. (Strength=Required) OperationParameterType BindingStrength ! » A profile the specifies Points to the rules value set or external definition (e.g. implicit value set) that this parameter must conform identifies the set of codes to be used profile valueSet[x] : Type [1..1] « uri | Reference ( StructureDefinition ValueSet ) 0..1 » Contacts to assist a user in finding and communicating with the publisher contact 0..* [0..*] Binds to a value set if this parameter is coded (code, Coding, CodeableConcept) binding [0..1] The parts of a Tuple Parameter part 0..* [0..*] The parameters for the operation/query parameter 0..* [0..*]

XML Template

<OperationDefinition xmlns="http://hl7.org/fhir"> doco
 <!-- from Resource: id, meta, implicitRules, and language -->
 <!-- from DomainResource: text, contained, extension, and modifierExtension -->
 <
 <
 <
 <

 <url value="[uri]"/><!-- 0..1 Logical URL to reference this operation definition -->
 <version value="[string]"/><!-- 0..1 Logical id for this version of the operation definition -->
 <name value="[string]"/><!-- 1..1 Informal name for this operation -->
 <status value="[code]"/><!-- 1..1 draft | active | retired -->
 <kind value="[code]"/><!-- 1..1 operation | query -->
 <experimental value="[boolean]"/><!-- 0..1 If for testing purposes, not real usage -->
 <publisher value="[string]"/><!-- 0..1 Name of the publisher (Organization or individual) -->

 <contact>  <!-- 0..* Contact details of the publisher -->
  <
  <</telecom>

  <name value="[string]"/><!-- 0..1 Name of a individual to contact -->
  <telecom><!-- 0..* ContactPoint Contact details for individual or publisher --></telecom>

 </contact>
 <
 <
 <
 <
 <
 <
 <
 <
 <</base>
 <
 <
 <

 <date value="[dateTime]"/><!-- 0..1 Date for this version of the operation definition -->
 <description value="[string]"/><!-- 0..1 Natural language description of the operation -->
 <requirements value="[string]"/><!-- 0..1 Why is this needed? -->
 <idempotent value="[boolean]"/><!-- 0..1 Whether content is unchanged by operation -->
 <code value="[code]"/><!-- 1..1 Name used to invoke the operation -->
 <notes value="[string]"/><!-- 0..1 Additional information about use -->
 <base><!-- 0..1 Reference(OperationDefinition) Marks this as a profile of the base --></base>
 <system value="[boolean]"/><!-- 1..1 Invoke at the system level? -->
 <type value="[code]"/><!-- 0..* Invoke at resource level for these type -->
 <instance value="[boolean]"/><!-- 1..1 Invoke on an instance? -->

 <parameter>  <!-- 0..* Parameters for the operation/query -->
  <
  <
  <
  <
  <
  <
  <</profile>
  <
   <
   <
   <
   <
   <
   <</profile>
  </part>

  <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 -->
  <profile><!-- 0..1 Reference(StructureDefinition) Profile on the type --></profile>
  <binding>  <!-- 0..1 ValueSet details if this is coded -->
   <strength value="[code]"/><!-- 1..1 required | extensible | preferred | example -->
   <valueSet[x]><!-- 1..1 uri|Reference(ValueSet) Source of value set --></valueSet[x]>
  </binding>
  <part><!-- ?? 0..* Content as for OperationDefinition.parameter Parts of a Tuple Parameter --></part>

 </parameter>
</OperationDefinition>

JSON Template

{doco
  "resourceType" : "OperationDefinition",
  // from Resource: id, meta, implicitRules, and language
  // from DomainResource: text, contained, extension, and modifierExtension
  "
  "
  "
  "
  "
    "
    "

  "url" : "<uri>", // Logical URL to reference this operation definition
  "version" : "<string>", // Logical id for this version of the operation definition
  "name" : "<string>", // R!  Informal name for this operation
  "status" : "<code>", // R!  draft | active | retired
  "kind" : "<code>", // R!  operation | query
  "experimental" : <boolean>, // If for testing purposes, not real usage
  "publisher" : "<string>", // Name of the publisher (Organization or individual)
  "contact" : [{ // Contact details of the publisher
    "name" : "<string>", // Name of a individual to contact
    "telecom" : [{ ContactPoint }] // Contact details for individual or publisher

  }],
  "
  "
  "
  "
  "
  "
  "
  "
  "
  "
  "
  "
  "
    "
    "
    "
    "
    "
    "
    "
    "
      "
      "
      "
      "
      "
      "
    }]

  "date" : "<dateTime>", // Date for this version of the operation definition
  "description" : "<string>", // Natural language description of the operation
  "requirements" : "<string>", // Why is this needed?
  "idempotent" : <boolean>, // Whether content is unchanged by operation
  "code" : "<code>", // R!  Name used to invoke the operation
  "notes" : "<string>", // Additional information about use
  "base" : { Reference(OperationDefinition) }, // Marks this as a profile of the base
  "system" : <boolean>, // R!  Invoke at the system level?
  "type" : ["<code>"], // Invoke at resource level for these type
  "instance" : <boolean>, // R!  Invoke on an instance?
  "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
    "profile" : { Reference(StructureDefinition) }, // Profile on the type
    "binding" : { // ValueSet details if this is coded
      "strength" : "<code>", // R!  required | extensible | preferred | example
      // valueSet[x]: Source of value set. One of these 2:

      "valueSetUri" : "<uri>"
      "valueSetReference" : { Reference(ValueSet) }
    },
    "part" : [{ Content as for OperationDefinition.parameter }] // C? Parts of a Tuple Parameter

  }]
}

 

Alternate definitions: Schema / Schematron , Resource Profile ( XML , JSON ), Questionnaire

6.18.3.1 Terminology Bindings

Path Definition Type Reference
OperationDefinition.status The lifecycle status of a Value Set or Concept Map Map. Required http://hl7.org/fhir/conformance-resource-status ConformanceResourceStatus
OperationDefinition.kind Whether an operation is a normal operation or a query query. Required http://hl7.org/fhir/operation-kind OperationKind
OperationDefinition.type One of the resource types defined as part of FHIR FHIR. Required http://hl7.org/fhir/valueset/resource-types ResourceType
OperationDefinition.parameter.use Whether an operation parameter is an input or an output parameter parameter. Required http://hl7.org/fhir/operation-parameter-use OperationParameterUse
OperationDefinition.parameter.type OperationDefinition.parameter.part.type The type of a parameter parameter. Required http://hl7.org/fhir/operation-definition-parameter-type Parameter Types used in Operation Definitions
OperationDefinition.parameter.binding.strength Indication of the degree of conformance expectations associated with a binding. Required BindingStrength

6.18.3.2 Constraints

  • opd-1 : On OperationDefinition.parameter: Either a type must be provided, or parts (xpath on f:OperationDefinition/f:parameter: exists(f:type) or exists(f:part) )

6.18.3.3 Operations defined as part of this Specification

Batch Mode Validation
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
Operations Defined by Resource Types
Generate a Document [base]/Composition/$document
Concept Translation [base]/ConceptMap/$translate | [base]/ConceptMap/[id]/$translate
Batch Mode Translation Closure Table Maintenance [base]/ConceptMap/$batch [base]/$closure
Closure Table Maintenance Fetch Encounter Record [base]/$closure [base]/Encounter/[id]/$everything
Fetch Encounter Record Find a functional list [base]/Encounter/[id]/$everything [base]/List/$find
Process Message [base]/$process-message
Fetch Patient Record [base]/Patient/$everything | [base]/Patient/[id]/$everything
Populate Questionnaire [base]/Questionnaire/$populate | [base]/Questionnaire/[id]/$populate
Build Questionnaire [base]/StructureDefinition/$questionnaire | [base]/StructureDefinition/[id]/$questionnaire
Value Set Expansion [base]/ValueSet/$expand | [base]/ValueSet/[id]/$expand
Concept Look Up [base]/ValueSet/$lookup
Value Set based Validation [base]/ValueSet/$validate-code | [base]/ValueSet/[id]/$validate-code
Operations Defined by Implementation Guides [base]/ValueSet/$batch

6.18.3.4 Executing Operations and Named Queries

Operations are executed by POSTing to a URL that is defined by the operation definition . Named Queries 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 etc.

6.18.3.5 Passing Resources to Operations

There are also limited two ways to pass resources to an operation - directly, or by reference. Since the two forms havevery different behaviors and consequences, the definition of an Operation distinguishes between these two.

As an example, take the Questionnaire.$populate operation . This operation takes a single return questionnaire as a direct parameter. The type of the parameter "result" (though this may repeat). is defined as 'Questionnaire'. In a parameters resource, it would be represented like this:


  <parameter>
    <name value="questionnaire"/>
    <resource>
      <Questionnaire>
        <!-- Questionnaire contents -->
      </Questionnaire>
    </resource>
  </parameter> 

or, in JSON:


 "parameter": [
    {
      "name": "questionnaire",
      "resource": {
        "resourceType": "Questionnaire",
        // Questionnaire contents 
      }
    }
  ]

Other parameters are passed by reference. For example, populate takes a set of references to other resources that should be used to pre-populate the questionnaire. These are passed by reference, and the type of the parameter is 'Reference(Any)' - a reference to any kind of resource. In a parameters resource, it would be represented like this:


  <parameter>
    <name value="content"/>
    <valueReference>
      <reference value="Patient/123">
      </Questionnaire>
    </valueReference>
  </parameter> 

or, in JSON:


 "parameter": [
    {
      "name": "questionnaire",
      "valueReference" : {
        "reference" : "Patient/123"
      }
    }
  ]

Some operations can take either form; in that case, two different parameters must be defined, one for a resource directly, and one for a reference.

6.18.3.5 6.18.3.6 Renaming OperationDefinition.name

It's possible for two different organisations organizations to create different operation definitions that have the same name (or, perhaps more likely, to define equivalent operations that have the same name but incompatible approaches in their parameter lists).

It's also possible (though a little unlikely) possible, though unlikely, that a server will be required to support both of these operations. Should this be the case, the server is able to do this by giving on one of them a new name, and then referring to it by definition in the conformance statement. To illustrate this, let's assume that two different organisations 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 conformance statement will say:

<Conformance 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 -->
</Conformance>

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 conformance statement for the underlying definition URI, and then execute the name given in the conformance statement.

6.18.3.6 6.18.3.7 Determining System Compatibility

A client can determine the compatiblity compatibility of the server by iterating its conformance statement and seeing whether any of the operations it declares to support source from the same definitions as those the client depends on, and whether the paramters it uses are supported by server supports the server. parameters it uses. A client that does this can report a useful error to the user rather than allowing mystifying operational errors to occur.

Note, however, that there are fundamental limitations to this approach because there are many aspects of these operations that aren't (and can't be) defined in a formal fashion. (For example, co-occurrence constraints amongst parameters.)

In the same sense, a 3rd party tool can examine the conformance statements from a server and a client definition of an acceptable server and confirm whether those two system are would be unable to interoperate.

6.18.3.7 6.18.3.8 Dynamically Generating Forms

Finally, it is possible to generate user interface forms automatically from the operation definitions. The documentation in the form definition and the parameter documentation should be sufficiently useful to allow moderately technical users to guess at the correct content of the form. For this reason, highly technical documentation should go in OperationDefinition.notes.

Note also this is not expected to a be a tool of use to typical healthcare end-users; such users will usually need more support than can be offered in a generated form.

6.18.4 Search Parameters

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 Paths
base reference Marks this as a profile of the base OperationDefinition.base
( OperationDefinition )
code token Name used to invoke the operation OperationDefinition.code
date date Date for this version of the operation definition OperationDefinition.date
instance token Invoke on an instance? OperationDefinition.instance
kind token operation | query OperationDefinition.kind
name string Informal name for this profile operation OperationDefinition.name
profile reference Profile on the type OperationDefinition.parameter.profile
( StructureDefinition )
publisher string Name of the publisher (Organization or individual) OperationDefinition.publisher
status token draft | active | retired OperationDefinition.status
system token Invoke at the system level? OperationDefinition.system
type token Invoke at resource level for these type OperationDefinition.type
url uri Logical url URL to reference this operation definition OperationDefinition.url
version token Logical id for this version of the operation definition OperationDefinition.version