This page is part of the FHIR Specification (v1.6.0: STU 3 Ballot 4). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions
This is the narrative for the resource. See also the XML or JSON format.
OPERATION: The CDS Hook operation is the core API request for CDS Hooks
It represents an outbound call from the EHR, in the context of a user session, and in the context of a specific activity within that user sesssion (e.g. opening a patient record; prescribing a new med; or reviewing orders before signing them).
URL: [base]/$cds-hook
Parameters
Use | Name | Cardinality | Type | Binding | Documentation |
IN | activity | 1..1 | Coding | Name of the Activity (expressed as a coding, preferably drawn from SMART's activity catalog) that the user is performing in the EHR, and for which this hook was triggered (e.g. patient-view, or medication-prescribe) | |
IN | activityInstance | 1..1 | string | While working in the EHR, a user can perform multiple activities in series or in parallel. For example, a clinician might prescribe two drugs in a row; each prescription activity would be assigned a unique activityInstance. The activity catalog provides a description of what events should initiate and terminate a given activity. This allows an external service to associate requests with activity state, which is necessary to support the following app-centric decision sequence, where the steps are tied together by a common activityInstance: EHR invokes CDS hook CDS service returns app link card User clicks app link and interacts with app Flow returns to EHR, which re-invokes CDS hook CDS service returns decision with user's choice Note: the activityInstance is globally unique and should contain enough entropy to be un-guessable. | |
IN | fhirServer | 0..1 | uri | Base URL for the calling EHR's FHIR server. The scheme should be https | |
IN | oauth | 0..1 | Security details allowing the CDS service to connect to the EHR's FHIR server. These fields allow the CDS service to access EHR data in a context limited by the current user's privileges | ||
IN | oauth.token | 1..1 | string | is a bearer token to be presented with any API calls the CDS service makes to the EHR, by including it in an Authorization header like: Authorization: Bearer {{token}} | |
IN | oauth.scope | 1..1 | string | Represents the set of scopes assigned to this token (see SMART on FHIR scopes) | |
IN | oauth.expires | 1..1 | integer | Expresses the token lifetime as an integer number of seconds | |
IN | redirect | 1..1 | uri | This field is only used by services that will return an app link card: when a user clicks the card's link to launch an app, it becomes the app's job to send the user to this redirect URL upon completion of user interaction. (Design note: this field is supplied up-front, as part of the initial request, to avoid requiring the EHR to append any content to app launch links. This helps support an important "degenerate" use case for app link cards: pointing to static content. See below for details.) | |
IN | user | 0..1 | string | ||
IN | patient | 0..1 | id | The FHIR resource id of the current patient. For example, 123. | |
IN | encounter | 0..1 | id | The FHIR resource id of the current encounter. For example, 123 | |
IN | context | 0..* | Any | activity-specific contextual data (see Activity) that an external service needs. (For exampe, with the order-review activity this will include MedicationOrder and Diagnostic resources, among others) | |
IN | preFetchData | 0..1 | Bundle | as a performance tweak, the EHR may pass along data according to the service's Prefetch-Template. This helps provide the service with all the data it needs to efficiently compute a set of recommendations. (Note that in the absence of preFetchData, an external service can always execute FHIR REST API calls against the EHR server to obtain additional data ad-hoc.) | |
IN | card | 1..1 | one CDS result for the EHR to present to the user. Cards can provide a combination of information (for reading), suggested actions (to be applied if a user selects them), and links (to launch an app if the user selects them). The EHR decides how to display cards, but we recommend displaying suggestions using buttons, and links using underlined text. | ||
IN | card.summary | 1..1 | string | one-sentence, <140-character summary message for display to the user inside of this card. | |
IN | card.detail | 0..1 | string | optional detailed information to display, represented in Markdown. (For non-urgent cards, the EHR may hide these details until the user clicks a link like "view more details...".) | |
IN | card.indicator | 1..1 | code | Urgency/importance of what this card conveys. Allowed values, in order of increasing urgency, are: success, info, warning, hard-stop. The EHR can use this field to help make UI display decisions such as sort order or coloring. The value hard-stop indicates that the workflow should not be allowed to proceed.R[-12]C | |
IN | card.source | 1..1 | grouping structure for a short, human-readable description (in source.label) of the source of the information displayed on this card, with an optional link (in source.url) where the user can learn more about the organization or data set that provided the information on this card. Note that source.url should not be used to supply a context-specific "drill-down" view of the information on this card. For that, use link.url instead. | ||
IN | card.source.label | 1..1 | string | human-readable description (in source.label) of the source of the information displayed on this card | |
IN | card.source.url | 0..1 | uri | Link (in source.url) where the user can learn more about the organization or data set that provided the information on this card | |
IN | card.suggestion | 0..* | grouping structure for suggestion cards, which allow a service to suggest a set of changes in the context of the current activity (e.g. changing the dose of the medication currently being prescribed, for the medication-prescribe activity) | ||
IN | card.suggestion.label | 0..1 | string | human-readable label to display for this suggestion (e.g. the EHR might render this as the text on a button tied to this suggestion). | |
IN | card.suggestion.create | 0..* | Resource | new resource(s) that this suggestion applies within the current activity (e.g. for medication-prescribe, this holds the updated prescription as proposed by the suggestion). | |
IN | card.suggestion.delete | 0..* | id | id(s) of any resources to remove from the current activity (e.g. for the order-review activity, this would provide a way to remove orders from the pending list). In activities like medication-prescribe where only one "content" resource is ever relevant, this field may be omitted | |
IN | card.link | 0..* | grouping structure for a link to an app that the user might want to run for additional information or to help guide a decision | ||
IN | card.link.label | 0..1 | string | human-readable label to display for this link (e.g. the EHR might render this as the underlined text of a clickable link) | |
IN | card.link.url | 0..1 | uri | URL to load when a user clicks on this link. Note that this may be a "deep link" with context embedded in path segments, query parameters, or a hash. In general this URL should embed enough context for the app to determine the activityInstance, and redirect url upon downstream launch, because the EHR will simply use this url as-is, without appending any parameters at launch time. | |
OUT | decision | 0..* | grouping structure representing a decision to be applied directly to the user session. Note that a CDS service may only return a decision after interacting with the user through an app link. Decisions are designed to convey any choices the user made in an app session | ||
OUT | decision.create | 0..* | Resource | new resource(s) that the EHR should create within the current activity (e.g. for medication-prescribe, this would be the updated prescription that a user had authored in an app session). | |
OUT | decision.delete | 0..* | id | id(s) of any resources to remove from the current activity (e.g. for the order-review activity, this would provide a way to remove orders from the pending list). In activities like medication-prescribe where only one "content" resource is ever relevant, this field may be omitted |
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.