You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#232: Move "user" from the request to each individual hook (#425)
* #232: Removed "user" from the request and added it to each of the defined hooks as "userId". Updated relevant examples, yaml, and removed the "user" prefetch token defined by the spec.
* Incorporated changes from #220Fixes#232Fixes#307
Copy file name to clipboardExpand all lines: docs/hooks/medication-prescribe.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ The set of medications proposed or in progress of being prescribed. All FHIR res
15
15
16
16
Field | Optionality | Prefetch Token | Type | Description
17
17
----- | -------- | ---- | ---- | ----
18
+
`userId` | REQUIRED | Yes | *string* | The id of the current user.<br />For this hook, the user is expected to be of type [Practitioner](https://www.hl7.org/fhir/practitioner.html).<br />For example, `Practitioner/123`
18
19
`patientId` | REQUIRED | Yes | *string* | The FHIR `Patient.id` of the current patient in context
19
20
`encounterId` | OPTIONAL | Yes | *string* | The FHIR `Encounter.id` of the current encounter in context
20
21
`medications` | REQUIRED | No | *object* | DSTU2 - FHIR Bundle of _draft_ MedicationOrder resources <br/> STU3 - FHIR Bundle of _draft_ MedicationRequest resources
@@ -24,6 +25,7 @@ Field | Optionality | Prefetch Token | Type | Description
24
25
```json
25
26
{
26
27
"context":{
28
+
"userId":"Practitioner/123",
27
29
"patientId":"1288992",
28
30
"encounterId":"89284",
29
31
"medications":{
@@ -168,6 +170,7 @@ Field | Optionality | Prefetch Token | Type | Description
Copy file name to clipboardExpand all lines: docs/hooks/order-review.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ The set of orders being reviewed for signature on-screen. All FHIR resources in
15
15
16
16
Field | Optionality | Prefetch Token | Type | Description
17
17
----- | -------- | ---- | ---- | ----
18
+
`userId` | REQUIRED | Yes | *string* | The id of the current user.<br />For this hook, the user is expected to be of type [Practitioner](https://www.hl7.org/fhir/practitioner.html).<br />For example, `Practitioner/123`
18
19
`patientId` | REQUIRED | Yes | *string* | The FHIR `Patient.id` of the current patient in context
19
20
`encounterId` | OPTIONAL | Yes | *string* | The FHIR `Encounter.id` of the current encounter in context
20
21
`orders` | REQUIRED | No | *object* | DSTU2 - FHIR Bundle of MedicationOrder, DiagnosticOrder, DeviceUseRequest, ReferralRequest, ProcedureRequest, NutritionOrder, VisionPrescription with _draft_ status <br/> STU3 - FHIR Bundle of MedicationRequest, ReferralRequest, ProcedureRequest, NutritionOrder, VisionPrescription with _draft_ status
@@ -24,6 +25,7 @@ Field | Optionality | Prefetch Token | Type | Description
24
25
```json
25
26
{
26
27
"context":{
28
+
"userId":"Practitioner/123",
27
29
"patientId":"1288992",
28
30
"encounterId":"89284",
29
31
"orders":{
@@ -202,6 +204,7 @@ Field | Optionality | Prefetch Token | Type | Description
Copy file name to clipboardExpand all lines: docs/hooks/patient-view.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,19 +15,22 @@ The patient whose record was opened, including their encounter, if applicable.
15
15
16
16
Field | Optionality | Prefetch Token | Type | Description
17
17
----- | -------- | ---- | ---- | ----
18
+
`userId` | REQUIRED | Yes | *string* | The id of the current user.<br />For example, if the user represents a FHIR resource on the given FHIR server, the resource type would be one of [Practitioner](https://www.hl7.org/fhir/practitioner.html), [Patient](https://www.hl7.org/fhir/patient.html), or [RelatedPerson](https://www.hl7.org/fhir/relatedperson.html).<br />If the user was a Practitioner, this value would be `Practitioner/123`
18
19
`patientId` | REQUIRED | Yes | *string* | The FHIR `Patient.id` of the current patient in context
19
20
`encounterId` | OPTIONAL | Yes | *string* | The FHIR `Encounter.id` of the current encounter in context
Copy file name to clipboardExpand all lines: docs/specification/1.0.md
+5-10Lines changed: 5 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,7 +111,6 @@ Field | Optionality | Type | Description
111
111
<nobr>`hookInstance`</nobr> | REQUIRED | *string* | A UUID for this particular hook call (see more information below).
112
112
`fhirServer` | OPTIONAL | *URL* | The base URL EHR's [FHIR](https://www.hl7.org/fhir/) server. If fhirAuthorization is provided, this field is REQUIRED. The scheme should be `https`
113
113
`fhirAuthorization` | OPTIONAL | *object* | A structure holding an [OAuth 2.0][OAuth 2.0] bearer access token granting the CDS Service access to FHIR resources, along with supplemental information relating to the token. See the [FHIR Resource Access](#fhir-resource-access) section for more information.
114
-
`user` | REQUIRED | *string* | The id of the current user.<br />For example, if the user represents a FHIR resource on the given FHIR server, the resource type would be one of [Practitioner](https://www.hl7.org/fhir/practitioner.html), [Patient](https://www.hl7.org/fhir/patient.html), or [RelatedPerson](https://www.hl7.org/fhir/relatedperson.html).<br />If the user was a Practitioner, this value would be `Practitioner/123`
115
114
`context` | REQUIRED | *object* | Hook-specific contextual data that the CDS service will need.<br />For example, with the `patient-view` hook this will include the FHIR identifier of the [Patient](https://www.hl7.org/fhir/patient.html) being viewed. For details, see the Hooks specification page.
116
115
`prefetch` | OPTIONAL | *object* | The FHIR data that was prefetched by the EHR (see more information below).
@@ -178,12 +177,6 @@ relevant data. In order to allow for prefetch templates that are dependent upon
178
177
179
178
Prefetch tokens MUST be delimited by `{{` and `}}`, MUST be named based upon the field they correspond to, and MUST have a primitive value.
180
179
181
-
The CDS Hooks specification defines just one prefetch token:
182
-
183
-
|Variable|Meaning|
184
-
---------|--------
185
-
|`{{user}}`|The value of the `user` field from this CDS Service request (e.g. `Practitioner/123`).|
186
-
187
180
Individual hooks specify which of their `context` fields can be used as prefetch tokens. Only root-level fields with a primitive value within the `context` object are eligible to be used as prefetch tokens.
188
181
189
182
For instance, given a hook of `example-hook` with the following context in which the `patientId` and `medicationId` fields are both denoted as prefix tokens:
@@ -224,7 +217,7 @@ The CDS Service MUST NOT receive any prefetch template key that the EHR chooses
0 commit comments