STU 3 Candidate

This page is part of the FHIR Specification (v1.4.0: STU 3 Ballot 3). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions

Operation-resource-cds-hook

This is the narrative for the resource. See also the XML or JSON format.


The CDS Hook operation is the core API request for CDS Hooks

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

UseNameCardinalityTypeBindingDocumentation
INactivity1..1Coding

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)

INactivityInstance1..1string

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.

INfhirServer0..1uri

Base URL for the calling EHR's FHIR server. The scheme should be https

INoauth0..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

INoauth.token1..1string

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}}

INoauth.scope1..1string

Represents the set of scopes assigned to this token (see SMART on FHIR scopes)

INoauth.expires1..1integer

Expresses the token lifetime as an integer number of seconds

INredirect1..1uri

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.)

INuser0..1string
INpatient0..1id

The FHIR resource id of the current patient. For example, 123.

INencounter0..1id

The FHIR resource id of the current encounter. For example, 123

INcontext0..*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)

INpreFetchData0..1Bundle

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.)

INcard1..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.

INcard.summary1..1string

one-sentence, <140-character summary message for display to the user inside of this card.

INcard.detail0..1string

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...".)

INcard.indicator1..1code

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

INcard.source1..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.

INcard.source.label1..1string

human-readable description (in source.label) of the source of the information displayed on this card

INcard.source.url0..1uri

Link (in source.url) where the user can learn more about the organization or data set that provided the information on this card

INcard.suggestion0..*

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)

INcard.suggestion.label0..1string

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).

INcard.suggestion.create0..*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).

INcard.suggestion.delete0..*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

INcard.link0..*

grouping structure for a link to an app that the user might want to run for additional information or to help guide a decision

INcard.link.label0..1string

human-readable label to display for this link (e.g. the EHR might render this as the underlined text of a clickable link)

INcard.link.url0..1uri

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.

OUTdecision0..*

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

OUTdecision.create0..*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).

OUTdecision.delete0..*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.