{"resourceType":"StructureDefinition","id":"CDSHooksRequest","language":"en","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm","valueInteger":1},{"url":"http://hl7.org/fhir/tools/StructureDefinition/json-suppress-resourcetype","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-wg","valueCode":"fhir"}],"url":"http://hl7.org/fhir/tools/StructureDefinition/CDSHooksRequest","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:oid:2.16.840.1.113883.4.642.40.1.42.6"}],"version":"1.1.0","name":"CDSHooksRequest","title":"CDSHooks Request (Logical Definition)","status":"draft","experimental":true,"date":"2026-03-03T22:50:55+11:00","publisher":"HL7 International / FHIR Infrastructure","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/fiwg"}]}],"description":"This structure is defined to allow the FHIR Validator to validate a CDSHooks Request Body. TODO: This content will be moved to the CDS Hooks specification in the future","jurisdiction":[{"coding":[{"system":"http://unstats.un.org/unsd/methods/m49/m49.htm","code":"001"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"}],"kind":"logical","abstract":false,"type":"http://hl7.org/fhir/tools/StructureDefinition/CDSHooksRequest","baseDefinition":"http://hl7.org/fhir/tools/StructureDefinition/CDSHooksElement","derivation":"specialization","snapshot":{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version","valueString":"1.1.0"}],"element":[{"id":"CDSHooksRequest","path":"CDSHooksRequest","short":"A request for decision support","definition":"The data structure that used when invoking a CDS Hook service","min":0,"max":"*","base":{"path":"Base","min":0,"max":"*"},"constraint":[{"key":"cds-r-1","severity":"error","human":"if fhirAuthorization details are provided, a fhirServer SHALL be specified","expression":"fhirAuthorization.exists() implies fhirServer.exists()"}],"isModifier":false},{"id":"CDSHooksRequest.extension","path":"CDSHooksRequest.extension","short":"Object that has Named Extension Properties","definition":"A JSON object that has properties where the names are defined by the extension definitions","comment":"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":0,"max":"1","base":{"path":"CDSHooksElement.extension","min":0,"max":"1"},"type":[{"code":"http://hl7.org/fhir/tools/StructureDefinition/CDSHooksExtensions"}]},{"id":"CDSHooksRequest.hook","path":"CDSHooksRequest.hook","short":"The hook that triggered this CDS Service call","definition":"The hook that triggered this CDS Service call","min":1,"max":"1","base":{"path":"CDSHooksRequest.hook","min":1,"max":"1"},"type":[{"code":"code"}]},{"id":"CDSHooksRequest.hookInstance","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/implied-string-prefix","valueString":"urn:uuid:"}],"path":"CDSHooksRequest.hookInstance","short":"A UUID for this particular hook call","definition":"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","comment":"Note: the hookInstance is globally unique and should contain enough entropy to be un-guessable.","min":1,"max":"1","base":{"path":"CDSHooksRequest.hookInstance","min":1,"max":"1"},"type":[{"code":"uuid"}]},{"id":"CDSHooksRequest.fhirServer","path":"CDSHooksRequest.fhirServer","short":"The base URL of the CDS Client's FHIR server","definition":"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":0,"max":"1","base":{"path":"CDSHooksRequest.fhirServer","min":0,"max":"1"},"type":[{"code":"url"}]},{"id":"CDSHooksRequest.fhirAuthorization","path":"CDSHooksRequest.fhirAuthorization","short":"Authorization info for service to use when querying","definition":"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":0,"max":"1","base":{"path":"CDSHooksRequest.fhirAuthorization","min":0,"max":"1"},"type":[{"code":"http://hl7.org/fhir/tools/StructureDefinition/CDSHooksElement"}],"constraint":[{"key":"cds-r-2","severity":"error","human":"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":"scope.contains('Patient/') implies patient.exists()"}]},{"id":"CDSHooksRequest.fhirAuthorization.extension","path":"CDSHooksRequest.fhirAuthorization.extension","short":"Object that has Named Extension Properties","definition":"A JSON object that has properties where the names are defined by the extension definitions","comment":"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":0,"max":"1","base":{"path":"CDSHooksElement.extension","min":0,"max":"1"},"type":[{"code":"http://hl7.org/fhir/tools/StructureDefinition/CDSHooksExtensions"}]},{"id":"CDSHooksRequest.fhirAuthorization.accessToken","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/json-name","valueString":"access_token"}],"path":"CDSHooksRequest.fhirAuthorization.accessToken","short":"OAuth 2.0 access token giving access to FHIR server","definition":"This is the OAuth 2.0 access token that provides access to the FHIR server","min":1,"max":"1","base":{"path":"CDSHooksRequest.fhirAuthorization.accessToken","min":1,"max":"1"},"type":[{"code":"string"}]},{"id":"CDSHooksRequest.fhirAuthorization.tokenType","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/json-name","valueString":"token_type"}],"path":"CDSHooksRequest.fhirAuthorization.tokenType","short":"Bearer","definition":"The type of token provided.  (Present to support future extensibility)","min":1,"max":"1","base":{"path":"CDSHooksRequest.fhirAuthorization.tokenType","min":1,"max":"1"},"type":[{"code":"code"}],"fixedCode":"Bearer"},{"id":"CDSHooksRequest.fhirAuthorization.expiresIn","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/json-name","valueString":"expires_in"}],"path":"CDSHooksRequest.fhirAuthorization.expiresIn","short":"The lifetime in seconds of the access token","definition":"The lifetime in seconds of the access token.","min":1,"max":"1","base":{"path":"CDSHooksRequest.fhirAuthorization.expiresIn","min":1,"max":"1"},"type":[{"code":"integer"}]},{"id":"CDSHooksRequest.fhirAuthorization.scope","path":"CDSHooksRequest.fhirAuthorization.scope","short":"Scopes granted by access token","definition":"The scopes the access token grants the CDS Service","min":1,"max":"1","base":{"path":"CDSHooksRequest.fhirAuthorization.scope","min":1,"max":"1"},"type":[{"code":"string"}]},{"id":"CDSHooksRequest.fhirAuthorization.subject","path":"CDSHooksRequest.fhirAuthorization.subject","short":"OAuth 2.0 client identifier of the CDS Service","definition":"The OAuth 2.0 client identifier of the CDS Service, as registered with the CDS Client's authorization server","min":1,"max":"1","base":{"path":"CDSHooksRequest.fhirAuthorization.subject","min":1,"max":"1"},"type":[{"code":"string"}]},{"id":"CDSHooksRequest.fhirAuthorization.patient","path":"CDSHooksRequest.fhirAuthorization.patient","short":"OAuth 2.0 client identifier of the CDS Service","definition":"The OAuth 2.0 client identifier of the CDS Service, as registered with the CDS Client's authorization server","min":0,"max":"1","base":{"path":"CDSHooksRequest.fhirAuthorization.patient","min":0,"max":"1"},"type":[{"code":"id"}]},{"id":"CDSHooksRequest.context","extension":[{"extension":[{"url":"condition","valueString":"%resource.hook = 'appointment-book'"},{"url":"type","valueCode":"http://hl7.org/fhir/tools/StructureDefinition/CDSHookAppointmentBookContext"}],"url":"http://hl7.org/fhir/tools/StructureDefinition/type-specifier"},{"extension":[{"url":"condition","valueString":"%resource.hook = 'encounter-start'"},{"url":"type","valueCode":"http://hl7.org/fhir/tools/StructureDefinition/CDSHookEncounterStartContext"}],"url":"http://hl7.org/fhir/tools/StructureDefinition/type-specifier"},{"extension":[{"url":"condition","valueString":"%resource.hook = 'encounter-discharge'"},{"url":"type","valueCode":"http://hl7.org/fhir/tools/StructureDefinition/CDSHookEncounterDischargeContext"}],"url":"http://hl7.org/fhir/tools/StructureDefinition/type-specifier"},{"extension":[{"url":"condition","valueString":"%resource.hook = 'patient-view'"},{"url":"type","valueCode":"http://hl7.org/fhir/tools/StructureDefinition/CDSHookPatientViewContext"}],"url":"http://hl7.org/fhir/tools/StructureDefinition/type-specifier"},{"extension":[{"url":"condition","valueString":"%resource.hook = 'order-dispatch'"},{"url":"type","valueCode":"http://hl7.org/fhir/tools/StructureDefinition/CDSHookOrderDispatchContext"}],"url":"http://hl7.org/fhir/tools/StructureDefinition/type-specifier"},{"extension":[{"url":"condition","valueString":"%resource.hook = 'order-sign'"},{"url":"type","valueCode":"http://hl7.org/fhir/tools/StructureDefinition/CDSHookOrderSignContext"}],"url":"http://hl7.org/fhir/tools/StructureDefinition/type-specifier"},{"extension":[{"url":"condition","valueString":"%resource.hook = 'order-select'"},{"url":"type","valueCode":"http://hl7.org/fhir/tools/StructureDefinition/CDSHookOrderSelectContext"}],"url":"http://hl7.org/fhir/tools/StructureDefinition/type-specifier"}],"path":"CDSHooksRequest.context","short":"Contextual data always needed for this hook type","definition":"Hook-specific contextual data that the CDS service will need","min":1,"max":"1","base":{"path":"CDSHooksRequest.context","min":1,"max":"1"},"type":[{"code":"http://hl7.org/fhir/tools/StructureDefinition/CDSHookContext"}]},{"id":"CDSHooksRequest.prefetch","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/json-property-key","valueCode":"key"}],"path":"CDSHooksRequest.prefetch","short":"Additional information requested by service for this hook type","definition":"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","min":0,"max":"*","base":{"path":"CDSHooksRequest.prefetch","min":0,"max":"*"},"type":[{"code":"Base"}]},{"id":"CDSHooksRequest.prefetch.key","path":"CDSHooksRequest.prefetch.key","short":"Key of FHIR query","definition":"Name of the FHIR query/read from the CDS Hooks Services object provided by the server","min":1,"max":"1","base":{"path":"CDSHooksRequest.prefetch.key","min":1,"max":"1"},"type":[{"code":"code"}]},{"id":"CDSHooksRequest.prefetch.value","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/json-nullable","valueBoolean":true},{"url":"http://hl7.org/fhir/tools/StructureDefinition/id-expectation","valueCode":"optional"}],"path":"CDSHooksRequest.prefetch.value","short":"Results of query/read","definition":"What was found by executing the search or read requested by the CDS Hooks Service in the context of this particular hook invocation","min":1,"max":"1","base":{"path":"CDSHooksRequest.prefetch.value","min":1,"max":"1"},"type":[{"code":"Resource"}]}]},"differential":{"element":[{"id":"CDSHooksRequest","path":"CDSHooksRequest","short":"A request for decision support","definition":"The data structure that used when invoking a CDS Hook service","constraint":[{"key":"cds-r-1","severity":"error","human":"if fhirAuthorization details are provided, a fhirServer SHALL be specified","expression":"fhirAuthorization.exists() implies fhirServer.exists()"}]},{"id":"CDSHooksRequest.hook","path":"CDSHooksRequest.hook","short":"The hook that triggered this CDS Service call","definition":"The hook that triggered this CDS Service call","min":1,"max":"1","type":[{"code":"code"}]},{"id":"CDSHooksRequest.hookInstance","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/implied-string-prefix","valueString":"urn:uuid:"}],"path":"CDSHooksRequest.hookInstance","short":"A UUID for this particular hook call","definition":"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","comment":"Note: the hookInstance is globally unique and should contain enough entropy to be un-guessable.","min":1,"max":"1","type":[{"code":"uuid"}]},{"id":"CDSHooksRequest.fhirServer","path":"CDSHooksRequest.fhirServer","short":"The base URL of the CDS Client's FHIR server","definition":"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":0,"max":"1","type":[{"code":"url"}]},{"id":"CDSHooksRequest.fhirAuthorization","path":"CDSHooksRequest.fhirAuthorization","short":"Authorization info for service to use when querying","definition":"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":0,"max":"1","type":[{"code":"http://hl7.org/fhir/tools/StructureDefinition/CDSHooksElement"}],"constraint":[{"key":"cds-r-2","severity":"error","human":"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":"scope.contains('Patient/') implies patient.exists()"}]},{"id":"CDSHooksRequest.fhirAuthorization.accessToken","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/json-name","valueString":"access_token"}],"path":"CDSHooksRequest.fhirAuthorization.accessToken","short":"OAuth 2.0 access token giving access to FHIR server","definition":"This is the OAuth 2.0 access token that provides access to the FHIR server","min":1,"max":"1","type":[{"code":"string"}]},{"id":"CDSHooksRequest.fhirAuthorization.tokenType","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/json-name","valueString":"token_type"}],"path":"CDSHooksRequest.fhirAuthorization.tokenType","short":"Bearer","definition":"The type of token provided.  (Present to support future extensibility)","min":1,"max":"1","type":[{"code":"code"}],"fixedCode":"Bearer"},{"id":"CDSHooksRequest.fhirAuthorization.expiresIn","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/json-name","valueString":"expires_in"}],"path":"CDSHooksRequest.fhirAuthorization.expiresIn","short":"The lifetime in seconds of the access token","definition":"The lifetime in seconds of the access token.","min":1,"max":"1","type":[{"code":"integer"}]},{"id":"CDSHooksRequest.fhirAuthorization.scope","path":"CDSHooksRequest.fhirAuthorization.scope","short":"Scopes granted by access token","definition":"The scopes the access token grants the CDS Service","min":1,"max":"1","type":[{"code":"string"}]},{"id":"CDSHooksRequest.fhirAuthorization.subject","path":"CDSHooksRequest.fhirAuthorization.subject","short":"OAuth 2.0 client identifier of the CDS Service","definition":"The OAuth 2.0 client identifier of the CDS Service, as registered with the CDS Client's authorization server","min":1,"max":"1","type":[{"code":"string"}]},{"id":"CDSHooksRequest.fhirAuthorization.patient","path":"CDSHooksRequest.fhirAuthorization.patient","short":"OAuth 2.0 client identifier of the CDS Service","definition":"The OAuth 2.0 client identifier of the CDS Service, as registered with the CDS Client's authorization server","min":0,"max":"1","type":[{"code":"id"}]},{"id":"CDSHooksRequest.context","extension":[{"extension":[{"url":"condition","valueString":"%resource.hook = 'appointment-book'"},{"url":"type","valueCode":"http://hl7.org/fhir/tools/StructureDefinition/CDSHookAppointmentBookContext"}],"url":"http://hl7.org/fhir/tools/StructureDefinition/type-specifier"},{"extension":[{"url":"condition","valueString":"%resource.hook = 'encounter-start'"},{"url":"type","valueCode":"http://hl7.org/fhir/tools/StructureDefinition/CDSHookEncounterStartContext"}],"url":"http://hl7.org/fhir/tools/StructureDefinition/type-specifier"},{"extension":[{"url":"condition","valueString":"%resource.hook = 'encounter-discharge'"},{"url":"type","valueCode":"http://hl7.org/fhir/tools/StructureDefinition/CDSHookEncounterDischargeContext"}],"url":"http://hl7.org/fhir/tools/StructureDefinition/type-specifier"},{"extension":[{"url":"condition","valueString":"%resource.hook = 'patient-view'"},{"url":"type","valueCode":"http://hl7.org/fhir/tools/StructureDefinition/CDSHookPatientViewContext"}],"url":"http://hl7.org/fhir/tools/StructureDefinition/type-specifier"},{"extension":[{"url":"condition","valueString":"%resource.hook = 'order-dispatch'"},{"url":"type","valueCode":"http://hl7.org/fhir/tools/StructureDefinition/CDSHookOrderDispatchContext"}],"url":"http://hl7.org/fhir/tools/StructureDefinition/type-specifier"},{"extension":[{"url":"condition","valueString":"%resource.hook = 'order-sign'"},{"url":"type","valueCode":"http://hl7.org/fhir/tools/StructureDefinition/CDSHookOrderSignContext"}],"url":"http://hl7.org/fhir/tools/StructureDefinition/type-specifier"},{"extension":[{"url":"condition","valueString":"%resource.hook = 'order-select'"},{"url":"type","valueCode":"http://hl7.org/fhir/tools/StructureDefinition/CDSHookOrderSelectContext"}],"url":"http://hl7.org/fhir/tools/StructureDefinition/type-specifier"}],"path":"CDSHooksRequest.context","short":"Contextual data always needed for this hook type","definition":"Hook-specific contextual data that the CDS service will need","min":1,"max":"1","type":[{"code":"http://hl7.org/fhir/tools/StructureDefinition/CDSHookContext"}]},{"id":"CDSHooksRequest.prefetch","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/json-property-key","valueCode":"key"}],"path":"CDSHooksRequest.prefetch","short":"Additional information requested by service for this hook type","definition":"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","min":0,"max":"*","type":[{"code":"Base"}]},{"id":"CDSHooksRequest.prefetch.key","path":"CDSHooksRequest.prefetch.key","short":"Key of FHIR query","definition":"Name of the FHIR query/read from the CDS Hooks Services object provided by the server","min":1,"max":"1","type":[{"code":"code"}]},{"id":"CDSHooksRequest.prefetch.value","extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/json-nullable","valueBoolean":true},{"url":"http://hl7.org/fhir/tools/StructureDefinition/id-expectation","valueCode":"optional"}],"path":"CDSHooksRequest.prefetch.value","short":"Results of query/read","definition":"What was found by executing the search or read requested by the CDS Hooks Service in the context of this particular hook invocation","min":1,"max":"1","type":[{"code":"Resource"}]}]}}