CDSHooks order-select

post/cds-hooks/v1/sources/{sourceId}/cds-services/{serviceId}

These API events help facilitate real-time, immediate clinical decision support (CDS). CDS hooks are events that are triggered during the provider's workflow, typically appearing as a popup modal or separate iFrame. The most common hooks are triggered upon:

  • opening a patient chart
  • signing an order
  • creating an order
  • scheduling

We support these type of hooks that allow you to:

  • request a list of supported CDS hooks within the EHR system;
  • return a list of supported CDS hooks within the EHR system;
  • view context for a patient upon opening or interacting with their chart;
  • view context when creating and selecting an order from a list of order types; and
  • view order context and insights when signing an order.

order-select

Return order context when a clinician selects one or more new orders from a list of order types. This is typically triggered at the beginning of the order workflow when an order enters a draft status.

Beta

Request Parameters

  • sourceId
    required, string

    Displays the unique identifier of a source within a given environment.

  • serviceId
    required, string

    Identifys the destination system for the CDS Hook call

Request Body Schema

  • Meta
    required, object
    • DataModel
      required, string
      Reliable

      CDSHooks

    • EventType
      required, string
      Reliable

      order-select

    • EventDateTime
      string, null
      Reliable

      Displays the UTC date and time that an outgoing request is delivered or an incoming request is received.
      ISO 8601 Format

    • Test
      boolean, null
      Reliable

      Indicates whether the request is a test or not.

    • Source
      object

      Contains the information for the system initiating the message, including the source ID and name.
      Included in messages from Redox

      • ID
        string, null
        Reliable

        Identifies the system initiating the message. If you have multiple OAuth API keys per environment type, this value is required. If you have only one OAuth API key per environment type, or you're using legacy API keys, this value is optional.
        UUID

      • Name
        string, null
        Reliable

        Displays the name of the system initiating the message.

    • Destinations
      Array of object

      Contains the information for the endpoint(s) receiving the request. A request must contain at least one destination, but asynchronous requests can have more than one destination. Synchronous requests like queries can only support one destination.
      Required when sending data to Redox.

      • ID
        string, null
        Reliable

        Identifies the endpoint that the request is directed to.
        UUID

      • Name
        string, null
        Reliable

        Displays the name of the endpoint that the request is directed to.

    • Logs
      Array of object

      Contains the log identifier(s) for the request.

      • ID
        string, null
        Reliable

        Identifies the request log(s) that correspond to this request. You can use this value to locate the relevant log in the Redox dashboard for support and reference.
        UUID

      • AttemptID
        string, null
        Reliable

        Identifies the request log attempt value, which is useful when retries are possible.
        UUID

    • FacilityCode
      string, null
      Possible

      Code for the facility related to the message.
      Only use this field if a health system indicates you should. The code is specific to the health system's EHR and might not be unique across health systems. In general, the facility fields within the data models (e.g. OrderingFacility) are more reliable and informative.

  • hook
    required, string

    Specifies the type of event that triggered this CDS service call.

  • hookInstance
    required, string

    Contains a universally unique identifier (UUID) for this specific hook instance.

  • fhirServer
    required, string

    Contains the base URL of the CDS client's FHIR server.
    If fhirAuthorization is provided, this field is required.

  • context
    required, object

    Contains contextual data about the hook, or triggered event, that the CDS service will need.

    • patientId
      required, string
      Reliable

      Contains the unique identifier of the patient that the order is being placed for.

    • selections
      required, Array of string

      Contains a list of selected items within the order.
      This is typically a list of medications or procedures that the clinician has selected for the patient.

    • userId
      string, null
      Reliable

      The user ID of the user who triggered the hook.
      Must be in the format [ResourceType]/[id]. For this hook, the user is expected to be of type Practitioner, PractitionerRole, Patient, or RelatedPerson. Patient or RelatedPerson are appropriate when a patient or their proxy are viewing the record. For example, Practitioner/abc or Patient/123.

    • encounterId
      string, null
      Probable

      Identifier of the encounter associated with the order.
      This is typically a FHIR resource ID such as Encounter/12345.

    • draftOrders
      object

      Lists all unsigned orders in the current session, including newly selected ones, in a FHIR bundle.
      This may include details such as the medications, dosages, and instructions for the order.

      • resourceType
        string, null

        Describes the type of resource being drafted. Typically, this is a FHIR resource type (e.g., Bundle, MedicationRequest, or ServiceRequest)

      • id
        string, null

        Contains a unique identifier for the unsigned, draft order. This ID is used to reference the order within the EHR system.

      • entry
        Array of object

        Lists unsigned, draft orders. Each entry represents a specific item in the order.

        • resource
          object

          Specifies the resource being drafted.This is typically a FHIR resource type such as MedicationRequest or ServiceRequest.

          • resourceType
            string, null

            Describes the type of resource being drafted. Typically, this is a FHIR resource type such as MedicationRequest or ServiceRequest.

          • id
            string, null

            Contains a unique identifier for the unsigned, draft order. This ID is used to reference the order within the EHR system.

  • user
    string, null

    Identifies the user who triggered the event. Typically, this is the clinician or healthcare provider viewing the patient record.
    If fhirAuthorization is present, the user field should match the subject in the OAuth token.

  • fhirAuthorization
    object

    Defines the OAuth 2.0 bearer access token (including supplemental information) that grants the CDS service access to FHIR resources.

    • accessToken
      string, null
      Probable

      Contains the token that authorizes access to the FHIR server.

    • tokenType
      string, null
      Probable

      Describes the type of access token.

    • expiresIn
      string, null
      Probable

      Specifies the access token's expiration time (in seconds).

    • scope
      string, null
      Probable

      Defines the scope, or access granted, with the token.

  • prefetch
    object

    Defines the FHIR data (e.g., Patient, Condition) that the EHR system should retrieve in advance to include in the CDS service request when the event is triggered. This reduces latency by fetching required data ahead of time and ensures that the CDS service has the necessary context to make informed decisions.

    • {{key}}
      string, null
      Possible

      Defines additional fields under the prefetch object, where each key represents a FHIR query defined by the EHR. These queries are used to retrieve data in advance to optimize CDS service performance.

Example
json
1
{
2
"Meta": {
3
"Logs": [
4
{
5
"ID": "d9f5d293-7110-461e-a875-3beb089e79f3",
6
"AttemptID": "925d1617-2fe0-468c-a14c-f8c04b572c54"
7
}
8
],
9
"Test": true,
10
"EventDateTime": "2026-05-28T22:44:52.399Z",
11
"Source": {
12
"ID": "7ce6f387-c33c-417d-8682-81e83628cbd9",
13
"Name": "Redox Dev Tools"
14
},
15
"Destinations": [
16
{
17
"ID": "af394f14-b34a-464f-8d24-895f370af4c9",
18
"Name": "Redox EMR"
19
}
20
],
21
"DataModel": "CDSHooks",
22
"EventType": "order-select",
23
"FacilityCode": null
24
},
25
"hookInstance": "550e8400-e29b-41d4-a716-446655440000",
26
"hook": "order-select",
27
"user": "Practitioner/123",
28
"fhirServer": "https://ehr.example.com/fhir",
29
"fhirAuthorization": {
30
"access_token": "some-opaque-fhir-access-token",
31
"token_type": "Bearer",
32
"expires_in": 300,
33
"scope": "user/MedicationRequest.read user/MedicationStatement.read",
34
"subject": "Practitioner/123"
35
},
36
"context": {
37
"patientId": "1288992",
38
"selections": [
39
"order1",
40
"order2"
41
],
42
"draftOrders": {
43
"resourceType": "Bundle",
44
"id": "12345678",
45
"entry": [
46
{
47
"resource": {
48
"resourceType": "MedicationRequest",
49
"id": "order1",
50
"status": "active",
51
"medicationCodeableConcept": {
52
"text": "Aspirin 81mg"
53
}
54
}
55
},
56
{
57
"resource": {
58
"resourceType": "MedicationRequest",
59
"id": "order2",
60
"status": "active",
61
"medicationCodeableConcept": {
62
"text": "Lisinopril 10mg"
63
}
64
}
65
}
66
]
67
}
68
}
69
}

FHIR® is a registered trademark of Health Level Seven International (HL7) and is used with the permission of HL7. Use of this trademark does not constitute an endorsement of products/services by HL7®.