References
 HL7 UK | Care Connect Profile:  | 
         User Stories: -  | 
Redirect to a new ServiceDefinition
Within the Clinical Decision Support API implementation, the ActivityDefinition resource will be used to carry a redirection to a different ServiceDefinition where required by the CDSS.
To achieve this, the GuidanceResponse will reference a RequestGroup which will reference an ActivityDefinition in its action.resource element in the form of the logical id of the ActivityDefinition.
Request Headers
The following HTTP request headers are supported in the event of the EMS requesting the referenced ActivityDefinition from the CDSS:
| Header | Value | Conformance | 
|---|---|---|
Accept | 
      The Accept header indicates the format of the response the client is able to understand, this will be one of the following application/fhir+json or application/fhir+xml. See the RESTful API Content types section. | 
      MAY | 
Authorization | 
      The Authorization header MUST carry a base64url encoded JSON web token. | 
      MUST | 
Implementation Guidance
The table below gives implementation guidance in relation to the elements within an ActivityDefinition:
| Name | Cardinality | Type | FHIR Documentation | CDS Implementation Guidance | 
|---|---|---|---|---|
url | 
    0..1 | 
    uri | Logical URI to reference this activity definition (globally unique) | |
identifier | 
   0..* | 
    Identifier | Additional identifier for the activity definition | |
version | 
        0..1 | 
    string | Business version of the activity definition | |
name | 
     0..1 | 
    string | Name for this activity definition (computer friendly) | |
title | 
      0..1 | 
    string | Name for this activity definition (human friendly) | |
status | 
      1..1 | 
    Reference (Encounter)  | 
    Populated by valueset PublicationStatus (Required) | This MUST be populated with the value of 'active'. | 
experimental | 
        0..1 | 
    boolean | For testing purposes, not real usage | This MUST be populated with the value of 'false'. | 
date | 
        0..1 | 
    dateTime | Date this was last changed | |
publisher | 
      0..1 | 
    string | Name of the publisher (organization or individual) | |
description | 
      0..1 | 
    markdown | Natural language description of the activity definition | |
purpose | 
      0..1 | 
     markdown | Why this activity definition is defined | |
usage | 
        0..1 | 
  string | Describes the clinical usage of the asset | |
approvalDate | 
        0..1 | 
   date | When the activity definition was approved by publisher | |
lastReviewDate | 
      0..1 | 
    date | When the activity definition was last reviewed | |
effectivePeriod | 
      0..1 | 
     Period | When the activity definition is expected to be used | |
useContext | 
      0..* | 
     UsageContext | The current setting of the request (inpatient, outpatient, etc). | This MUST match the useContext of the calling and receiving ServiceDefinitions. | 
  
jurisdiction | 
      0..* | 
    CodeableConcept | Intended jurisdiction for activity definition (if applicable) Jurisdiction ValueSet (Extensible) | This MUST match the jurisdiction of the calling and receiving ServiceDefinitions. | 
 
topic | 
      0..* | 
    CodeableConcept | E.g. Education, Treatment, Assessment, etc DefinitionTopic (Example) | This MUST be populated with the value of 'assessment'. | 
contributor | 
      0..* | 
    Contributor | A content contributor | |
contact | 
      0..* | 
    ContactDetail | Contact details for the publisher | |
copyright | 
      0..1 | 
    markdown | Use and/or publishing restrictions | |
relatedArtifact | 
      0..* | 
    relatedArtifact | Additional documentation, citations, etc | |
library | 
      0..* | 
    reference(Library) | Logic used by the asset | A CDSS MUST populate the referenced Library.dataRequirement element to match the contents of the ServiceDefinition.trigger.eventData element for the ServiceDefinition to which the EMS is to be re-directed. | 
 
kind | 
      0..1 | 
    code | Kind of resource ResourceType (Required) | This MUST NOT be populated. | 
code | 
      0..1 | 
    CodeableConcept | Detail type of activity Procedure Codes (SNOMED CT) (Example) | This MUST NOT be populated. | 
timing[x] | 
      0..1 | 
    Timing dateTime Period Range  | 
    When activity is to occur | This MUST NOT be populated. | 
location | 
      0..1 | 
    Reference(Location) | Where it should happen | This MUST NOT be populated. | 
product[x] | 
      0..1 | 
    Reference(Medication | Substance) CodeableConcept  | 
    What's administered/supplied SNOMED CT Medication Codes (Example) | This MUST NOT be populated. | 
quantity | 
      0..1 | 
    simpleQuantity | How much is administered/consumed/supplied | This MUST NOT be populated. | 
dosage | 
      0..* | 
    Dosage | Detailed dosage instructions | This MUST NOT be populated. | 
bodySite | 
      0..* | 
    CodeableConcept | What part of body to perform on SNOMED CT Body Structures (Example) | This MUST NOT be populated. | 
transform | 
      0..1 | 
    Reference(StructureMap) | Transform to apply the template | This MUST NOT be populated. | 
transform | 
      0..1 | 
    Reference(StructureMap) | Transform to apply the template | This MUST NOT be populated. | 
dynamicValue | 
      0..* | 
    BackboneElement | Dynamic aspects of the definition | This MUST NOT be populated. | 
description | 
      0..1 | 
    string | Natural language description of the dynamic value | |
path | 
      0..1 | 
    string | The path to the element to be set dynamically | |
language | 
      0..1 | 
    string | Language of the expression | |
expression | 
      0..1 | 
    string | An expression that provides the dynamic value for the customization | 
ActivityDefinition elements of note
Element(s) in ActivityDefinition of particular significance to implementers are noted below:
Library element of ActivityDefinition
This element references the Library resource and this resource will carry the formal logic utilised by the CDSS.
Thus at the stage in a triage journey when the CDSS is able to return a GuidanceResponse with a status of ‘success’ and recommending a referral to another service, it will populate the ActivityDefinition.library element with the contents of the eventData element of the selected ServiceDefinition.
This logic will be used by the CDSS to choose an appropriate ServiceDefinition and it will be passed to the EMS to enable it to select that ServiceDefinition when re-directed in a triage journey.
In the event that the logic provided to an EMS yields more than one ServiceDefinition, a local process between implementers will determine which ServiceDefinition should be selected by the EMS.