CRDHooksRequest
type: StructureDefinition
node role: treeRoot
id:
  v: CRDHooksRequest
text:
  status:
    v: extensions
  div:
    v: Generated Narrative: StructureDefinition CRDHooksRequest Name Flags Card. Type Description & Constraints<img src="[binary]" alt="doco" style="background-color: inherit"/> CDSHooksRequest 0..* CDSHooksRequest Request for decision support #xD; extension 0..1 CDSHooksExtensions Extension #xD; hook S 1..1 code Hook event triggering call Binding: CDS Hook Types Value Set (required) #xD; hookInstance S 1..1 uuid Unique id for hook invocation #xD; fhirServer S 1..1 url Location to query for data #xD; fhirAuthorization S 1..1 CDSHooksElement Auth to use in queries #xD; accessToken S 1..1 string Auth token for query header #xD; tokenType S 1..1 code Bearer #xD; expiresIn S 1..1 integer Seconds token is valid #xD; scope S 1..1 string Granted access scopes #xD; subject S 1..1 string Patient id for access #xD; context S 1..1 CDSHookContext Context for decision support JSON: If%resource.hook = 'appointment-book'then the type is http://hl7.org/fhir/us/davnci-crd/StructureDefinition/CRDHookAppointmentBookContext JSON: If%resource.hook = 'encounter-start'then the type is http://hl7.org/fhir/tools/StructureDefinition/CDSEncounterStartContext JSON: If%resource.hook = 'encounter-discharge'then the type is http://hl7.org/fhir/tools/StructureDefinition/CDSEncounterDischargeContext JSON: If%resource.hook = 'order-dispatch'then the type is http://hl7.org/fhir/us/davnci-crd/StructureDefinition/CRDOrderDispatchContext JSON: If%resource.hook = 'order-select'then the type is http://hl7.org/fhir/us/davnci-crd/StructureDefinition/CRDHookOrderSignContext JSON: If%resource.hook = 'order-sign'then the type is http://hl7.org/fhir/us/davnci-crd/StructureDefinition/CRDHookOrderSignContext #xD; prefetch S 0..* Base Prefetch info requested by server #xD; key S 1..1 code Key as specfied in server prefetch config #xD; value S 1..1 Resource Resource(s) matching prefetch criteria #xD; <img src="[binary]" alt="doco" style="background-color: inherit"/> Documentation for this format
extension:
  url:
    v: http://hl7.org/fhir/tools/StructureDefinition/json-suppress-resourcetype
    l: json-suppress-resourcetype
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-wg
    l: structuredefinition-wg
  value: Code
    v: fm
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm
    l: structuredefinition-fmm
  value: Integer
    v: 4
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom
        l: structuredefinition-conformance-derivedFrom
      value: Canonical
        v: http://hl7.org/fhir/us/davinci-crd/ImplementationGuide/davinci-crd
        l: davinci-crd
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status
    l: structuredefinition-standards-status
  value: Code
    v: trial-use
    extension:
      url:
        v: http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom
        l: structuredefinition-conformance-derivedFrom
      value: Canonical
        v: http://hl7.org/fhir/us/davinci-crd/ImplementationGuide/davinci-crd
        l: davinci-crd
url:
  v: http://hl7.org/fhir/us/davinci-crd/StructureDefinition/CRDHooksRequest
  l: CRDHooksRequest
identifier:
  system:
    v: urn:ietf:rfc:3986
    l: 3986
  value:
    v: urn:oid:2.16.840.1.113883.4.642.40.18.42.34
version:
  v: 2.2.1
name:
  v: CRDHooksRequest
title:
  v: CRD CDSHooks Request (Logical Definition)
status:
  v: active
date:
  v: 2026-03-26T15:54:25+00:00
publisher:
  v: HL7 International / Financial Management
contact:
  telecom:
    system:
      v: url
    value:
      v: http://www.hl7.org/Special/committees/fm
description:
  v: Defines CRD-specific constraints on the CDS Hooks Request logical model
jurisdiction:
  coding:
    system:
      v: urn:iso:std:iso:3166
      l: 3166
    code:
      v: US
fhir version:
  v: 4.0.1
kind:
  v: logical
abstract:
  v: false
type:
  v: http://hl7.org/fhir/tools/StructureDefinition/CDSHooksRequest
  l: CDSHooksRequest
base definition:
  v: http://hl7.org/fhir/tools/StructureDefinition/CDSHooksRequest
  l: CDSHooksRequest
derivation:
  v: constraint
snapshot:
  extension:
    url:
      v: http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version
      l: snapshot-base-version
    value: String
      v: 1.1.2
  element:
    id:
      v: CDSHooksRequest
    path:
      v: CDSHooksRequest
    short:
      v: Request for decision support
    definition:
      v: The data structure that used when invoking a CDS Hook service
    min:
      v: 0
    max:
      v: *
    base:
      path:
        v: Base
      min:
        v: 0
      max:
        v: *
    constraint:
      key:
        v: cds-r-1
      severity:
        v: error
      human:
        v: if fhirAuthorization details are provided, a fhirServer SHALL be specified
      expression:
        v: fhirAuthorization.exists() implies fhirServer.exists()
      source:
        v: http://hl7.org/fhir/tools/StructureDefinition/CDSHooksRequest
        l: CDSHooksRequest
    is modifier:
      v: false
  element:
    id:
      v: CDSHooksRequest.extension
    path:
      v: CDSHooksRequest.extension
    short:
      v: Extension
    definition:
      v: An Extension
    min:
      v: 0
    max:
      v: 1
    base:
      path:
        v: CDSHooksElement.extension
      min:
        v: 0
      max:
        v: 1
    type:
      code:
        v: http://hl7.org/fhir/tools/StructureDefinition/CDSHooksExtensions
        l: CDSHooksExtensions
  element:
    id:
      v: CDSHooksRequest.hook
    path:
      v: CDSHooksRequest.hook
    short:
      v: Hook event triggering call
    definition:
      v: The hook that triggered this CDS Service call
    min:
      v: 1
    max:
      v: 1
    base:
      path:
        v: CDSHooksRequest.hook
      min:
        v: 1
      max:
        v: 1
    type:
      code:
        v: code
        l: code
    must support:
      v: true
    binding:
      strength:
        v: required
      value set:
        v: http://hl7.org/fhir/us/davinci-crd/ValueSet/cdsHookType
        l: cdsHookType
  element:
    id:
      v: CDSHooksRequest.hookInstance
    extension:
      url:
        v: http://hl7.org/fhir/tools/StructureDefinition/implied-string-prefix
        l: implied-string-prefix
      value: String
        v: urn:uuid:

v: CDSHooksRequest.hookInstance

v: Unique id for hook invocation

v: While working in the CDS Client, a user can perform multiple actions in series or in parallel. For example, a clinician might prescribe two drugs in a row; each prescription action would be assigned a unique hookInstance. This allows a CDS Service to uniquely identify each hook invocation

v: Note: the hookInstance is globally unique and should contain enough entropy to be un-guessable.

v: 1

v: 1

path:
  v: CDSHooksRequest.hookInstance
min:
  v: 1
max:
  v: 1

code:
  v: uuid
  l: uuid

v: true

id:
  v: CDSHooksRequest.fhirServer
path:
  v: CDSHooksRequest.fhirServer
short:
  v: Location to query for data
definition:
  v: The base URL of the CDS Client's FHIR server. If fhirAuthorization is provided, this field is REQUIRED. The scheme MUST be https when production data is exchanged
min:
  v: 1
max:
  v: 1
base:
  path:
    v: CDSHooksRequest.fhirServer
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: url
    l: url
must support:
  v: true

id:
  v: CDSHooksRequest.fhirAuthorization
path:
  v: CDSHooksRequest.fhirAuthorization
short:
  v: Auth to use in queries
definition:
  v: A structure holding an OAuth 2.0 bearer access token granting the CDS Service access to FHIR resources, along with supplemental information relating to the token
min:
  v: 1
max:
  v: 1
base:
  path:
    v: CDSHooksRequest.fhirAuthorization
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: http://hl7.org/fhir/tools/StructureDefinition/CDSHooksElement
    l: CDSHooksElement
constraint:
  key:
    v: cds-r-2
  severity:
    v: error
  human:
    v: If the granted SMART scopes include patient scopes (i.e. 'patient/'), the patient field SHOULD be populated to identify the FHIR id of that patient.
  expression:
    v: scope.contains('Patient/') implies patient.exists()
  source:
    v: http://hl7.org/fhir/tools/StructureDefinition/CDSHooksRequest
    l: CDSHooksRequest
must support:
  v: true

id:
  v: CDSHooksRequest.fhirAuthorization.extension
path:
  v: CDSHooksRequest.fhirAuthorization.extension
short:
  v: Object that has Named Extension Properties
definition:
  v: A JSON object that has properties where the names are defined by the extension definitions
comment:
  v: Extension structures SHOULD use a strategy for naming that ensures global uniqueness, such as reverse-domain-name notation, e.g. com.cds-hooks.sandbox.myextension-practitionerspecialty. How to handle complex extensions (objects) is not defined
min:
  v: 0
max:
  v: 1
base:
  path:
    v: CDSHooksElement.extension
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: http://hl7.org/fhir/tools/StructureDefinition/CDSHooksExtensions
    l: CDSHooksExtensions

id:
  v: CDSHooksRequest.fhirAuthorization.accessToken
extension:
  url:
    v: http://hl7.org/fhir/tools/StructureDefinition/json-name
    l: json-name
  value: String
    v: access_token
path:
  v: CDSHooksRequest.fhirAuthorization.accessToken
short:
  v: Auth token for query header
definition:
  v: This is the OAuth 2.0 access token that provides access to the FHIR server
min:
  v: 1
max:
  v: 1
base:
  path:
    v: CDSHooksRequest.fhirAuthorization.accessToken
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: string
    l: string
must support:
  v: true

id:
  v: CDSHooksRequest.fhirAuthorization.tokenType
extension:
  url:
    v: http://hl7.org/fhir/tools/StructureDefinition/json-name
    l: json-name
  value: String
    v: token_type
path:
  v: CDSHooksRequest.fhirAuthorization.tokenType
short:
  v: Bearer
definition:
  v: The type of token provided. (Present to support future extensibility)
min:
  v: 1
max:
  v: 1
base:
  path:
    v: CDSHooksRequest.fhirAuthorization.tokenType
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: code
    l: code
fixed: Code
  v: Bearer
must support:
  v: true

id:
  v: CDSHooksRequest.fhirAuthorization.expiresIn
extension:
  url:
    v: http://hl7.org/fhir/tools/StructureDefinition/json-name
    l: json-name
  value: String
    v: expires_in
path:
  v: CDSHooksRequest.fhirAuthorization.expiresIn
short:
  v: Seconds token is valid
definition:
  v: The lifetime in seconds of the access token.
min:
  v: 1
max:
  v: 1
base:
  path:
    v: CDSHooksRequest.fhirAuthorization.expiresIn
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: integer
    l: integer
must support:
  v: true

id:
  v: CDSHooksRequest.fhirAuthorization.scope
path:
  v: CDSHooksRequest.fhirAuthorization.scope
short:
  v: Granted access scopes
definition:
  v: The scopes the access token grants the CDS Service
min:
  v: 1
max:
  v: 1
base:
  path:
    v: CDSHooksRequest.fhirAuthorization.scope
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: string
    l: string
must support:
  v: true

id:
  v: CDSHooksRequest.fhirAuthorization.subject
path:
  v: CDSHooksRequest.fhirAuthorization.subject
short:
  v: Patient id for access
definition:
  v: If the granted SMART scopes include patient scopes (i.e. 'patient/'), the access token is restricted to a specific patient. This field SHOULD be populated to identify the FHIR id of that patient.
min:
  v: 1
max:
  v: 1
base:
  path:
    v: CDSHooksRequest.fhirAuthorization.subject
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: string
    l: string
must support:
  v: true

id:
  v: CDSHooksRequest.fhirAuthorization.patient
path:
  v: CDSHooksRequest.fhirAuthorization.patient
short:
  v: OAuth 2.0 client identifier of the CDS Service
definition:
  v: The OAuth 2.0 client identifier of the CDS Service, as registered with the CDS Client's authorization server
min:
  v: 0
max:
  v: 1
base:
  path:
    v: CDSHooksRequest.fhirAuthorization.patient
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: id
    l: id

id:
  v: CDSHooksRequest.context
extension:
  extension:
    url:
      v: condition
      l: condition
    value: String
      v: %resource.hook = 'appointment-book'
  extension:
    url:
      v: type
      l: type
    value: Code
      v: http://hl7.org/fhir/tools/StructureDefinition/CDSHookAppointmentBookContext
  url:
    v: http://hl7.org/fhir/tools/StructureDefinition/type-specifier
    l: type-specifier
extension:
  extension:
    url:
      v: condition
      l: condition
    value: String
      v: %resource.hook = 'encounter-start'
  extension:
    url:
      v: type
      l: type
    value: Code
      v: http://hl7.org/fhir/tools/StructureDefinition/CDSHookEncounterStartContext
  url:
    v: http://hl7.org/fhir/tools/StructureDefinition/type-specifier
    l: type-specifier
extension:
  extension:
    url:
      v: condition
      l: condition
    value: String
      v: %resource.hook = 'encounter-discharge'
  extension:
    url:
      v: type
      l: type
    value: Code
      v: http://hl7.org/fhir/tools/StructureDefinition/CDSHookEncounterDischargeContext
  url:
    v: http://hl7.org/fhir/tools/StructureDefinition/type-specifier
    l: type-specifier
extension:
  extension:
    url:
      v: condition
      l: condition
    value: String
      v: %resource.hook = 'patient-view'
  extension:
    url:
      v: type
      l: type
    value: Code
      v: http://hl7.org/fhir/tools/StructureDefinition/CDSHookPatientViewContext
  url:
    v: http://hl7.org/fhir/tools/StructureDefinition/type-specifier
    l: type-specifier
extension:
  extension:
    url:
      v: condition
      l: condition
    value: String
      v: %resource.hook = 'order-dispatch'
  extension:
    url:
      v: type
      l: type
    value: Code
      v: http://hl7.org/fhir/tools/StructureDefinition/CDSHookOrderDispatchContext
  url:
    v: http://hl7.org/fhir/tools/StructureDefinition/type-specifier
    l: type-specifier
extension:
  extension:
    url:
      v: condition
      l: condition
    value: String
      v: %resource.hook = 'order-sign'
  extension:
    url:
      v: type
      l: type
    value: Code
      v: http://hl7.org/fhir/tools/StructureDefinition/CDSHookOrderSignContext
  url:
    v: http://hl7.org/fhir/tools/StructureDefinition/type-specifier
    l: type-specifier
extension:
  extension:
    url:
      v: condition
      l: condition
    value: String
      v: %resource.hook = 'order-select'
  extension:
    url:
      v: type
      l: type
    value: Code
      v: http://hl7.org/fhir/tools/StructureDefinition/CDSHookOrderSelectContext
  url:
    v: http://hl7.org/fhir/tools/StructureDefinition/type-specifier
    l: type-specifier
path:
  v: CDSHooksRequest.context
short:
  v: Context for decision support
definition:
  v: Hook-specific contextual data that the CDS service will need
min:
  v: 1
max:
  v: 1
base:
  path:
    v: CDSHooksRequest.context
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: http://hl7.org/fhir/tools/StructureDefinition/CDSHookContext
    l: CDSHookContext
must support:
  v: true

id:
  v: CDSHooksRequest.prefetch
extension:
  url:
    v: http://hl7.org/fhir/tools/StructureDefinition/json-property-key
    l: json-property-key
  value: Code
    v: key
path:
  v: CDSHooksRequest.prefetch
short:
  v: Prefetch info requested by server
definition:
  v: An object containing key/value pairs of FHIR queries that this Request is requesting the CDS Client to perform and provide on each Request call. The key is a string that describes the type of data being requested and the value is a string representing the FHIR query
comment:
  v: While this is mustSupport, CRD clients are not required to pass any or all prefetch data requested by the CRD server.
min:
  v: 0
max:
  v: *
base:
  path:
    v: CDSHooksRequest.prefetch
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Base
    l: Base
must support:
  v: true

id:
  v: CDSHooksRequest.prefetch.key
path:
  v: CDSHooksRequest.prefetch.key
short:
  v: Key as specfied in server prefetch config
definition:
  v: Name of the FHIR query/read from the CDS Hooks Services object provided by the server
min:
  v: 1
max:
  v: 1
base:
  path:
    v: CDSHooksRequest.prefetch.key
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: code
    l: code
must support:
  v: true

id:
  v: CDSHooksRequest.prefetch.value
extension:
  url:
    v: http://hl7.org/fhir/tools/StructureDefinition/json-nullable
    l: json-nullable
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/tools/StructureDefinition/id-expectation
    l: id-expectation
  value: Code
    v: optional
path:
  v: CDSHooksRequest.prefetch.value
short:
  v: Resource(s) matching prefetch criteria
definition:
  v: What was found by executing the search or read requested by the CDS Hooks Service in the context of this particular hook invocation
min:
  v: 1
max:
  v: 1
base:
  path:
    v: CDSHooksRequest.prefetch.value
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: Resource
    l: Resource
must support:
  v: true

element:
  id:
    v: CDSHooksRequest
  path:
    v: CDSHooksRequest
  short:
    v: Request for decision support
element:
  id:
    v: CDSHooksRequest.extension
  path:
    v: CDSHooksRequest.extension
element:
  id:
    v: CDSHooksRequest.hook
  path:
    v: CDSHooksRequest.hook
  short:
    v: Hook event triggering call
  type:
    code:
      v: code
      l: code
  must support:
    v: true
  binding:
    strength:
      v: required
    value set:
      v: http://hl7.org/fhir/us/davinci-crd/ValueSet/cdsHookType
      l: cdsHookType
element:
  id:
    v: CDSHooksRequest.hookInstance
  path:
    v: CDSHooksRequest.hookInstance
  short:
    v: Unique id for hook invocation
  must support:
    v: true
element:
  id:
    v: CDSHooksRequest.fhirServer
  path:
    v: CDSHooksRequest.fhirServer
  short:
    v: Location to query for data
  min:
    v: 1
  must support:
    v: true
element:
  id:
    v: CDSHooksRequest.fhirAuthorization
  path:
    v: CDSHooksRequest.fhirAuthorization
  short:
    v: Auth to use in queries
  min:
    v: 1
  must support:
    v: true
element:
  id:
    v: CDSHooksRequest.fhirAuthorization.accessToken
  path:
    v: CDSHooksRequest.fhirAuthorization.accessToken
  short:
    v: Auth token for query header
  must support:
    v: true
element:
  id:
    v: CDSHooksRequest.fhirAuthorization.tokenType
  path:
    v: CDSHooksRequest.fhirAuthorization.tokenType
  must support:
    v: true
element:
  id:
    v: CDSHooksRequest.fhirAuthorization.expiresIn
  path:
    v: CDSHooksRequest.fhirAuthorization.expiresIn
  short:
    v: Seconds token is valid
  must support:
    v: true
element:
  id:
    v: CDSHooksRequest.fhirAuthorization.scope
  path:
    v: CDSHooksRequest.fhirAuthorization.scope
  short:
    v: Granted access scopes
  must support:
    v: true
element:
  id:
    v: CDSHooksRequest.fhirAuthorization.subject
  path:
    v: CDSHooksRequest.fhirAuthorization.subject
  short:
    v: Patient id for access
  definition:
    v: If the granted SMART scopes include patient scopes (i.e. 'patient/'), the access token is restricted to a specific patient. This field SHOULD be populated to identify the FHIR id of that patient.
  must support:
    v: true
element:
  id:
    v: CDSHooksRequest.context
  extension:
    extension:
      url:
        v: condition
        l: condition
      value: String
        v: %resource.hook = 'appointment-book'
    extension:
      url:
        v: type
        l: type
      value: Code
        v: http://hl7.org/fhir/us/davnci-crd/StructureDefinition/CRDHookAppointmentBookContext
    url:
      v: http://hl7.org/fhir/tools/StructureDefinition/type-specifier
      l: type-specifier
  extension:
    extension:
      url:
        v: condition
        l: condition
      value: String
        v: %resource.hook = 'encounter-start'
    extension:
      url:
        v: type
        l: type
      value: Code
        v: http://hl7.org/fhir/tools/StructureDefinition/CDSEncounterStartContext
    url:
      v: http://hl7.org/fhir/tools/StructureDefinition/type-specifier
      l: type-specifier
  extension:
    extension:
      url:
        v: condition
        l: condition
      value: String
        v: %resource.hook = 'encounter-discharge'
    extension:
      url:
        v: type
        l: type
      value: Code
        v: http://hl7.org/fhir/tools/StructureDefinition/CDSEncounterDischargeContext
    url:
      v: http://hl7.org/fhir/tools/StructureDefinition/type-specifier
      l: type-specifier
  extension:
    extension:
      url:
        v: condition
        l: condition
      value: String
        v: %resource.hook = 'order-dispatch'
    extension:
      url:
        v: type
        l: type
      value: Code
        v: http://hl7.org/fhir/us/davnci-crd/StructureDefinition/CRDOrderDispatchContext
    url:
      v: http://hl7.org/fhir/tools/StructureDefinition/type-specifier
      l: type-specifier
  extension:
    extension:
      url:
        v: condition
        l: condition
      value: String
        v: %resource.hook = 'order-select'
    extension:
      url:
        v: type
        l: type
      value: Code
        v: http://hl7.org/fhir/us/davnci-crd/StructureDefinition/CRDHookOrderSignContext
    url:
      v: http://hl7.org/fhir/tools/StructureDefinition/type-specifier
      l: type-specifier
  extension:
    extension:
      url:
        v: condition
        l: condition
      value: String
        v: %resource.hook = 'order-sign'
    extension:
      url:
        v: type
        l: type
      value: Code
        v: http://hl7.org/fhir/us/davnci-crd/StructureDefinition/CRDHookOrderSignContext

v: CDSHooksRequest.context

v: Context for decision support

v: true

id:
  v: CDSHooksRequest.prefetch
path:
  v: CDSHooksRequest.prefetch
short:
  v: Prefetch info requested by server
comment:
  v: While this is mustSupport, CRD clients are not required to pass any or all prefetch data requested by the CRD server.
must support:
  v: true

id:
  v: CDSHooksRequest.prefetch.key
path:
  v: CDSHooksRequest.prefetch.key
short:
  v: Key as specfied in server prefetch config
must support:
  v: true

id:
  v: CDSHooksRequest.prefetch.value
path:
  v: CDSHooksRequest.prefetch.value
short:
  v: Resource(s) matching prefetch criteria
must support:
  v: true