R6 Ballot (1st Draft)

This page is part of the FHIR Specification v6.0.0-ballot1: Release 6 Ballot (1st Draft) (see Ballot Notes). The current version is 5.0.0. For a full list of available versions, see the Directory of published versions

Example OperationDefinition/ActivityDefinition-apply (JSON)

Clinical Decision Support Work GroupMaturity Level: N/AStandards Status: Informative

Raw JSON (canonical form + also see JSON Format Specification)

Operation Definition

{
  "resourceType" : "OperationDefinition",
  "id" : "ActivityDefinition-apply",
  "text" : {
    "status" : "extensions",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p>URL: [base]/ActivityDefinition/$apply</p><p>URL: [base]/ActivityDefinition/[id]/$apply</p><p>Parameters</p><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Scope</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>activityDefinition</td><td>type</td><td>0..1</td><td><a href=\"activitydefinition.html\">ActivityDefinition</a></td><td/><td><div><p>The activity definition to apply. If the operation is invoked on an instance, this parameter is not allowed. If the operation is invoked at the type level, this parameter is required</p>\n</div></td></tr><tr><td>IN</td><td>subject</td><td/><td>1..*</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>The subject(s) that is/are the target of the activity definition to be applied. The subject may be a Patient, Practitioner, Organization, Location, Device, or Group. Subjects provided in this parameter will be resolved as the subject of the PlanDefinition based on the type of the subject. If multiple subjects of the same type are provided, the behavior is implementation-defined</p>\n</div></td></tr><tr><td>IN</td><td>encounter</td><td/><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>The encounter in context, if any</p>\n</div></td></tr><tr><td>IN</td><td>practitioner</td><td/><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>The practitioner in context</p>\n</div></td></tr><tr><td>IN</td><td>organization</td><td/><td>0..1</td><td><a href=\"datatypes.html#string\">string</a><br/>(<a href=\"search.html#reference\">reference</a>)</td><td/><td><div><p>The organization in context</p>\n</div></td></tr><tr><td>IN</td><td>userType</td><td/><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>The type of user initiating the request, e.g. patient, healthcare provider, or specific type of healthcare provider (physician, nurse, etc.)</p>\n</div></td></tr><tr><td>IN</td><td>userLanguage</td><td/><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>Preferred language of the person using the system</p>\n</div></td></tr><tr><td>IN</td><td>userTaskContext</td><td/><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>The task the system user is performing, e.g. laboratory results review, medication list review, etc. This information can be used to tailor decision support outputs, such as recommended information resources</p>\n</div></td></tr><tr><td>IN</td><td>setting</td><td/><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>The current setting of the request (inpatient, outpatient, etc.)</p>\n</div></td></tr><tr><td>IN</td><td>settingContext</td><td/><td>0..1</td><td><a href=\"datatypes.html#CodeableConcept\">CodeableConcept</a></td><td/><td><div><p>Additional detail about the setting of the request, if any</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td/><td>1..1</td><td><a href=\"resource.html\">Resource</a></td><td/><td><div><p>The resource that is the result of applying the definition</p>\n</div></td></tr></table><div><p>The result of invoking this operation is a resource of the type specified by the activity definition, with all the definitions resolved as appropriate for the type of resource. Any dynamicValue elements will be evaluated (in the order in which they appear in the resource) and the results applied to the returned resource.  If the ActivityDefinition includes library references, those libraries will be available to the evaluated expressions. If those libraries have parameters, those parameters will be bound by name to the parameters given to the operation. In addition, parameters to the $apply operation are available within dynamicValue expressions as context variables, accessible by the name of the parameter, prefixed with a percent (%) symbol. For a more detailed description, refer to the ActivityDefinition resource. Note that result of this operation is transient (i.e. none of the resources created by the operation are persisted in the server, they are all returned as contained resources in the result). The result effectively represents a proposed set of activities, and it is up to the caller to determine whether and how those activities are actually carried out.</p>\n</div></div>"
  },
  "extension" : [{
    "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
    "valueInteger" : 3
  },
  {
    "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
    "valueCode" : "trial-use"
  },
  {
    "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
    "valueCode" : "cds"
  }],
  "url" : "http://hl7.org/fhir/OperationDefinition/ActivityDefinition-apply",
  "version" : "6.0.0-ballot1",
  "name" : "Apply",
  "title" : "Apply",
  "status" : "draft",
  "kind" : "operation",
  "experimental" : false,
  "date" : "2023-12-18T15:12:07+11:00",
  "publisher" : "HL7 International / Clinical Decision Support",
  "contact" : [{
    "telecom" : [{
      "system" : "url",
      "value" : "http://hl7.org/fhir"
    },
    {
      "system" : "email",
      "value" : "fhir@lists.hl7.org"
    }]
  },
  {
    "telecom" : [{
      "system" : "url",
      "value" : "http://www.hl7.org/Special/committees/dss"
    }]
  }],
  "description" : "The apply operation applies a definition in a specific context",
  "jurisdiction" : [{
    "coding" : [{
      "system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
      "code" : "001",
      "display" : "World"
    }]
  }],
  "affectsState" : false,
  "code" : "apply",
  "comment" : "The result of invoking this operation is a resource of the type specified by the activity definition, with all the definitions resolved as appropriate for the type of resource. Any dynamicValue elements will be evaluated (in the order in which they appear in the resource) and the results applied to the returned resource.  If the ActivityDefinition includes library references, those libraries will be available to the evaluated expressions. If those libraries have parameters, those parameters will be bound by name to the parameters given to the operation. In addition, parameters to the $apply operation are available within dynamicValue expressions as context variables, accessible by the name of the parameter, prefixed with a percent (%) symbol. For a more detailed description, refer to the ActivityDefinition resource. Note that result of this operation is transient (i.e. none of the resources created by the operation are persisted in the server, they are all returned as contained resources in the result). The result effectively represents a proposed set of activities, and it is up to the caller to determine whether and how those activities are actually carried out.",
  "resource" : ["ActivityDefinition"],
  "system" : false,
  "type" : true,
  "instance" : true,
  "parameter" : [{
    "name" : "activityDefinition",
    "use" : "in",
    "scope" : ["type"],
    "min" : 0,
    "max" : "1",
    "documentation" : "The activity definition to apply. If the operation is invoked on an instance, this parameter is not allowed. If the operation is invoked at the type level, this parameter is required",
    "type" : "ActivityDefinition"
  },
  {
    "name" : "subject",
    "use" : "in",
    "min" : 1,
    "max" : "*",
    "documentation" : "The subject(s) that is/are the target of the activity definition to be applied. The subject may be a Patient, Practitioner, Organization, Location, Device, or Group. Subjects provided in this parameter will be resolved as the subject of the PlanDefinition based on the type of the subject. If multiple subjects of the same type are provided, the behavior is implementation-defined",
    "type" : "string",
    "searchType" : "reference"
  },
  {
    "name" : "encounter",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "The encounter in context, if any",
    "type" : "string",
    "searchType" : "reference"
  },
  {
    "name" : "practitioner",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "The practitioner in context",
    "type" : "string",
    "searchType" : "reference"
  },
  {
    "name" : "organization",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "The organization in context",
    "type" : "string",
    "searchType" : "reference"
  },
  {
    "name" : "userType",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "The type of user initiating the request, e.g. patient, healthcare provider, or specific type of healthcare provider (physician, nurse, etc.)",
    "type" : "CodeableConcept"
  },
  {
    "name" : "userLanguage",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "Preferred language of the person using the system",
    "type" : "CodeableConcept"
  },
  {
    "name" : "userTaskContext",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "The task the system user is performing, e.g. laboratory results review, medication list review, etc. This information can be used to tailor decision support outputs, such as recommended information resources",
    "type" : "CodeableConcept"
  },
  {
    "name" : "setting",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "The current setting of the request (inpatient, outpatient, etc.)",
    "type" : "CodeableConcept"
  },
  {
    "name" : "settingContext",
    "use" : "in",
    "min" : 0,
    "max" : "1",
    "documentation" : "Additional detail about the setting of the request, if any",
    "type" : "CodeableConcept"
  },
  {
    "name" : "return",
    "use" : "out",
    "min" : 1,
    "max" : "1",
    "documentation" : "The resource that is the result of applying the definition",
    "type" : "Resource"
  }]
}

Usage note: every effort has been made to ensure that the examples are correct and useful, but they are not a normative part of the specification.