# CDSHooks patient-view-response

These API events help facilitate real-time, immediate clinical decision support (CDS). <u>CDS hooks</u> 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.

Respond with a 200 HTTP response to `PatientView`. This response also contains decision support guidance (e.g., suggestions, links, narrative information) from the CDS service. 

Status: Beta

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `Meta` | object | Yes |  |
| `Meta.DataModel` | string | Yes | CDSHooks |
| `Meta.EventType` | string | Yes | patient-view-response |
| `Meta.EventDateTime` | string or null | No | Displays the UTC date and time that an outgoing request is delivered or an incoming request is received. *[ISO 8601 Format](http://en.wikipedia.org/wiki/ISO_8601)* |
| `Meta.Test` | boolean or null | No | Indicates whether the request is a test or not. |
| `Meta.Source` | object | No | Contains the information for the system initiating the message, including the source ID and name. *Included in messages from Redox* |
| `Meta.Source.ID` | string or null | No | 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* |
| `Meta.Source.Name` | string or null | No | Displays the name of the system initiating the message. |
| `Meta.Destinations` | Array of object | No | 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.* |
| `Meta.Destinations[].ID` | string or null | No | Identifies the endpoint that the request is directed to. *UUID* |
| `Meta.Destinations[].Name` | string or null | No | Displays the name of the endpoint that the request is directed to. |
| `Meta.Logs` | Array of object | No | Contains the log identifier(s) for the request. |
| `Meta.Logs[].ID` | string or null | No | 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* |
| `Meta.Logs[].AttemptID` | string or null | No | Identifies the request log attempt value, which is useful when retries are possible. *UUID* |
| `Meta.FacilityCode` | string or null | No | 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.* |
| `cards` | Array of object | Yes | Contain one or more cards with suggestions, links, or guidance. |
| `cards[].summary` | string | Yes | Provide a short message shown in the UI to summarize the card's intent. |
| `cards[].indicator` | string | Yes | Indicate the importance/severity (e.g., `info`, `warning`, or `critical`). |
| `cards[].uuid` | string or null | No | Contains a unique identifier for the card. This ID is used to reference the card within the EHR system. |
| `cards[].detail` | string or null | No | Add detailed guidance, rationale, or documentation. *If provided, this field must be represented in GitHub Flavored Markdown (GFM) format.* |
| `cards[].source` | object | No | Identify the system that generated the card. |
| `cards[].source.label` | string or null | No | Display the name of the source. |
| `cards[].source.url` | string or null | No | Link to more info about the source. |
| `cards[].suggestions` | Array of object | No | Recommend actions the user could take based on the hook context. |
| `cards[].suggestions[].label` | string or null | No | Display the name of the suggestion. |
| `cards[].suggestions[].uuid` | string or null | No | Identify the suggestion for tracking. |
| `cards[].suggestions[].actions` | Array of object | No | Define what FHIR resources or operations the suggestion performs. |
| `cards[].suggestions[].actions[].type` | string or null | No | Specify the type of action (e.g., `create`, `update`, or `delete`). |
| `cards[].suggestions[].actions[].description` | string or null | No | Provide a description of the suggested action may be presented. |
| `cards[].suggestions[].actions[].resource` | object | No | Define the FHIR resource to be created, updated, or deleted. |
| `cards[].suggestions[].actions[].resource.resourceType` | string or null | No | Specify the type of FHIR resource (e.g., `MedicationRequest` or `ServiceRequest`). |
| `cards[].selectionsBehavior` | string or null | No | Control how many suggestions can be selected: `at-most-one`, `any`, `exactly-one`. *Required if `suggestions` is present.* |
| `cards[].overrideReasons` | Array of object | No | Define valid reasons for overriding a recommendation. |
| `cards[].overrideReasons[].code` | string or null | No | Specify the code for the override reason. |
| `cards[].overrideReasons[].system` | string or null | No | Specify the system for the override reason. |
| `cards[].overrideReasons[].display` | string or null | No | Display the reason for the override. |
| `cards[].links` | Array of object | No | Provide links to additional information or resources. |
| `cards[].links[].label` | string or null | No | Display the name of the link. |
| `cards[].links[].url` | string or null | No | Link to more information. |
| `cards[].links[].type` | string or null | No | Specify the type of link (e.g., `action`, `related`, or `documentation`). |
| `systemActions` | Array of object | No | Contain an array of Actions that the CDS Service proposes to auto-apply |
| `systemActions[].type` | string or null | No | Specify the type of action (e.g., `create`, `update`, or `delete`). |
| `systemActions[].resource` | object | No | Define the FHIR resource to be created, updated, or deleted. |
| `systemActions[].resource.resourceType` | string or null | No | Specify the type of FHIR resource (e.g., `MedicationRequest` or `ServiceRequest`). |

## Example

```json
{
  "Meta": {
    "Logs": [
      {
        "ID": "d9f5d293-7110-461e-a875-3beb089e79f3",
        "AttemptID": "925d1617-2fe0-468c-a14c-f8c04b572c54"
      }
    ],
    "Test": true,
    "EventDateTime": "2026-11-20T23:35:51.576Z",
    "Source": {
      "ID": "7ce6f387-c33c-417d-8682-81e83628cbd9",
      "Name": "Redox Dev Tools"
    },
    "Destinations": [
      {
        "ID": "af394f14-b34a-464f-8d24-895f370af4c9",
        "Name": "Redox EMR"
      }
    ],
    "DataModel": "CDSHooks",
    "EventType": "patient-view-response",
    "FacilityCode": null
  },
  "cards": [
    {
      "summary": "Patient due for flu vaccine",
      "indicator": "info",
      "detail": "Patient is due for flu vaccine based on age and health history.",
      "source": {
        "label": "Flu Vaccine Reminder",
        "url": "https://example.com/flu-vaccine-reminder"
      },
      "suggestions": [
        {
          "label": "Schedule Flu Vaccine",
          "actions": [
            {
              "type": "create",
              "description": "Schedule Appointment"
            }
          ]
        }
      ],
      "selectionBehavior": "at-most-one",
      "links": [
        {
          "label": "CDC Guidelines",
          "url": "https://www.cdc.gov/vaccines/schedules/index.html",
          "type": "absolute"
        }
      ]
    }
  ]
}
```
