{
  "resourceType": "OperationDefinition",
  "id": "ActivityDefinition-apply",
  "meta": {
    "lastUpdated": "2017-04-18T21:44:43.294+00:00"
  },
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Apply</h2><p>OPERATION: Apply</p><p>The official URL for this operation definition is: </p><pre>http://hl7.org/fhir/OperationDefinition/ActivityDefinition-apply</pre><div><p>The apply operation realizes a definition in a specific context</p></div><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>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>patient</td><td>1..1</td><td>Reference</td><td /><td><div><p>The patient that is the target of the activity to be applied</p></div></td></tr><tr><td>IN</td><td>encounter</td><td>0..1</td><td>Reference</td><td /><td><div><p>The encounter in context, if any</p></div></td></tr><tr><td>IN</td><td>practitioner</td><td>0..1</td><td>Reference</td><td /><td><div><p>The practitioner in context</p></div></td></tr><tr><td>IN</td><td>organization</td><td>0..1</td><td>Reference</td><td /><td><div><p>The organization in context</p></div></td></tr><tr><td>IN</td><td>userType</td><td>0..1</td><td>CodeableConcept</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></div></td></tr><tr><td>IN</td><td>userLanguage</td><td>0..1</td><td>CodeableConcept</td><td /><td><div><p>Preferred language of the person using the system</p></div></td></tr><tr><td>IN</td><td>userTaskContext</td><td>0..1</td><td>CodeableConcept</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></div></td></tr><tr><td>IN</td><td>setting</td><td>0..1</td><td>CodeableConcept</td><td /><td><div><p>The current setting of the request (inpatient, outpatient, etc)</p></div></td></tr><tr><td>IN</td><td>settingContext</td><td>0..1</td><td>CodeableConcept</td><td /><td><div><p>Additional detail about the setting of the request, if any</p></div></td></tr><tr><td>OUT</td><td>return</td><td>1..1</td><td>Any</td><td /><td><div><p>The resource that is the result of applying the definition</p></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 and the resulting value used for the values of the appropriate elements of 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</p></div></div>"
  },
  "url": "http://hl7.org/fhir/OperationDefinition/ActivityDefinition-apply",
  "name": "Apply",
  "status": "draft",
  "kind": "operation",
  "date": "2017-04-18T21:44:43+00:00",
  "publisher": "HL7 (FHIR Project)",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://hl7.org/fhir"
        },
        {
          "system": "email",
          "value": "fhir@lists.hl7.org"
        }
      ]
    }
  ],
  "description": "The apply operation realizes a definition in a specific context",
  "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 and the resulting value used for the values of the appropriate elements of 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",
  "resource": [
    "ActivityDefinition"
  ],
  "system": false,
  "type": false,
  "instance": true,
  "parameter": [
    {
      "name": "patient",
      "use": "in",
      "min": 1,
      "max": "1",
      "documentation": "The patient that is the target of the activity to be applied",
      "type": "Reference",
      "profile": {
        "reference": "http://hl7.org/fhir/StructureDefinition/Patient"
      }
    },
    {
      "name": "encounter",
      "use": "in",
      "min": 0,
      "max": "1",
      "documentation": "The encounter in context, if any",
      "type": "Reference",
      "profile": {
        "reference": "http://hl7.org/fhir/StructureDefinition/Encounter"
      }
    },
    {
      "name": "practitioner",
      "use": "in",
      "min": 0,
      "max": "1",
      "documentation": "The practitioner in context",
      "type": "Reference",
      "profile": {
        "reference": "http://hl7.org/fhir/StructureDefinition/Practitioner"
      }
    },
    {
      "name": "organization",
      "use": "in",
      "min": 0,
      "max": "1",
      "documentation": "The organization in context",
      "type": "Reference",
      "profile": {
        "reference": "http://hl7.org/fhir/StructureDefinition/Organization"
      }
    },
    {
      "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": "Any"
    }
  ]
}