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
Copy file name to clipboardExpand all lines: docs/hooks/index.md
+12-9Lines changed: 12 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,13 +111,7 @@ All fields defined by the hook's context MUST be defined in a table where each f
111
111
- Type: The type of the field in the context JSON object, expressed as the JSON type, or the name of a FHIR Resource type. Valid types are *boolean*, *string*, *number*, *object*, *array*, or the name of a FHIR resource type. When a field can be of multiple types, type names MUST be separated by a *pipe* (`|`)
112
112
- Description: A functional description of the context value. If this value can change according to the FHIR version in use, the description SHOULD describe the value for each supported FHIR version.
113
113
114
-
### FHIR resources in context
115
-
116
-
When potentially multiple FHIR resources value a single context field, these resources SHOULD be formatted as a FHIR Bundle. For example, multiple FHIR resources are necessary to describe all of the orders under review in the `order-review` hook's `orders` field. Hook definitions SHOULD prefer the use of FHIR Bundles over other bespoke data structures.
117
-
118
-
Often, context is populated with in-progress or in-memory data that may not yet be available from the FHIR server. For example, `medication-prescribe` and `order-review` define context fields containing FHIR resources that represent draft resources. In this case, the EHR should only provide these draft resources and not the full set of orders available from its FHIR server. The CDS service MAY pre-fetch or query for FHIR resources with other statuses.
119
-
120
-
All FHIR resources in context MUST be based on the same FHIR version.
114
+
The below illustrates a sample table.
121
115
122
116
Field | Optionality | Prefetch Token | Type | Description
123
117
----- | -------- | ---- | ---- | ----
@@ -127,6 +121,14 @@ Field | Optionality | Prefetch Token | Type | Description
127
121
`moreObjects` | OPTIONAL | No | *array* | A clear description of the items in this array.
128
122
`allFHIR` | OPTIONAL | No | *object* | A FHIR Bundle of the following FHIR resources using a specific version of FHIR.
129
123
124
+
### FHIR resources in context
125
+
126
+
When potentially multiple FHIR resources value a single context field, these resources SHOULD be formatted as a FHIR Bundle. For example, multiple FHIR resources are necessary to describe all of the orders under review in the `order-review` hook's `orders` field. Hook definitions SHOULD prefer the use of FHIR Bundles over other bespoke data structures.
127
+
128
+
Often, context is populated with in-progress or in-memory data that may not yet be available from the FHIR server. For example, `medication-prescribe` and `order-review` define context fields containing FHIR resources that represent draft resources. In this case, the EHR should only provide these draft resources and not the full set of orders available from its FHIR server. The CDS service MAY pre-fetch or query for FHIR resources with other statuses.
129
+
130
+
All FHIR resources in context MUST be based on the same FHIR version.
131
+
130
132
### Examples
131
133
132
134
Hook creators SHOULD include examples of the context.
@@ -167,15 +169,16 @@ To help ensure the stability of CDS Hooks implementations, once a hook has been
167
169
168
170
In particular, the semantics of a hook (i.e. the meaning of the hook from the perspective of the EHR) cannot be changed. EHRs that implement specific hooks are responsible for ensuring the hook is called from the appropriate point in the workflow.
169
171
170
-
Note that this means that the name of the hook carries major version semantics. That is not to say that the name must include the major version, that is left as a choice by users of the specification. Clean hook names increase usability. Ideally, an active hook name accurately defines the meaning and workflow of the hook in actual words.
172
+
Note that this means that the name of the hook carries major version semantics. That is not to say that the name must include the major version, that is left as a choice to authors of the specification. For example, following version 1.x, the major version MAY be included in the name as "-2", "-3", etc. Eg: patient-view-2, patient-view-3, etc. Clean hook names increase usability. Ideally, an active hook name accurately defines the meaning and workflow of the hook in actual words.
171
173
172
174
The following types of changes are possible for a hook definition:
173
175
174
176
Change | Version Impact
175
177
------ | ----
176
178
Clarifications and corrections to documentation that do not impact functionality | Patch
177
179
Change of prefetch token status of an existing context field | Patch
178
-
Addition of a new field to the context | Minor
180
+
Addition of a new, REQUIRED field to the context | Major
181
+
Addition of a new, OPTIONAL field to the context | Minor
179
182
Change of optionality of an existing context field | Major
180
183
Change of type or cardinality of an existing context field | Major
Copy file name to clipboardExpand all lines: docs/hooks/medication-prescribe.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,13 @@ The user is in the process of prescribing one or more new medications.
11
11
12
12
## Context
13
13
14
-
The set of medications proposed or in progress of being prescribed. All FHIR resources in this context MUST be based on the same FHIR version.
14
+
The set of medications proposed or in progress of being prescribed. All FHIR resources in this context MUST be based on the same FHIR version. All FHIR resources in the medications object MUST have a status of _draft_.
15
15
16
16
Field | Optionality | Prefetch Token | Type | Description
17
17
----- | -------- | ---- | ---- | ----
18
18
`patientId` | REQUIRED | Yes | *string* | The FHIR `Patient.id` of the current patient in context
19
19
`encounterId` | OPTIONAL | Yes | *string* | The FHIR `Encounter.id` of the current encounter in context
20
-
`medications` | REQUIRED | No | *object* | DSTU2 - FHIR Bundle of MedicationOrder resources <br/> STU3 - FHIR Bundle of MedicationOrder
20
+
`medications` | REQUIRED | No | *object* | DSTU2 - FHIR Bundle of _draft_MedicationOrder resources <br/> STU3 - FHIR Bundle of _draft_ MedicationRequest resources
Copy file name to clipboardExpand all lines: docs/hooks/order-review.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,13 +11,13 @@ The user is in the process of reviewing a set of orders to sign.
11
11
12
12
## Context
13
13
14
-
The set of orders being reviewed for signature on-screen. All FHIR resources in this _context_ MUST be based on the same FHIR version.
14
+
The set of orders being reviewed for signature on-screen. All FHIR resources in this _context_ MUST be based on the same FHIR version. All FHIR resources in the medications object MUST have a status of _draft_.
15
15
16
16
Field | Optionality | Prefetch Token | Type | Description
17
17
----- | -------- | ---- | ---- | ----
18
18
`patientId` | REQUIRED | Yes | *string* | The FHIR `Patient.id` of the current patient in context
19
19
`encounterId` | OPTIONAL | Yes | *string* | The FHIR `Encounter.id` of the current encounter in context
A CDS Service is an external service that responds to EHR requests through cards. There are several steps to setting up a CDS Service:
9
+
A CDS Service is an external service that responds to EHR requests through cards. A card can optionally link to a SMART app. There are several steps to setting up a CDS Service:
10
10
11
11
1. Create an endpoint for discovery
12
12
2. Develop a service
13
13
3. Test the service with the [sandbox](http://sandbox.cds-hooks.org/)
14
-
4.Create a SMART app (or [borrow one](https://apps.smarthealthit.org/apps/pricing/open-source))
15
-
5. Test the service andSMART app with an EHR
14
+
4.If applicable, create a SMART app (or [borrow one](https://apps.smarthealthit.org/apps/pricing/open-source))
15
+
5. Test the service (and, if applicable, SMART app) with an EHR
16
16
17
17
This tutorial recommends implementing the CDS Hooks [security model](specification/1.0/#security-and-safety) after successful open access testing.
18
18
@@ -80,20 +80,20 @@ Delete the existing hooks, and then do a quick add with a reference to your CDS
80
80
81
81
After testing with the sandbox, you are ready to connect with an EHR service.
82
82
83
-
## Building an EHR Service
83
+
## Integrating CDS Services into an EHR
84
84
Build out following sections:
85
85
86
-
1.Calls discovery endpoint
86
+
1.Call discovery endpoint
87
87
2. Invoke service on patient-view
88
-
3. Support for FHIR resources on request (context or pre-fetch)
89
-
4.Exposed non-secured FHIR server
88
+
3. Support FHIR resource on CDS requests (context or pre-fetch)
89
+
4.Expose non-secured FHIR server for testing
90
90
5. Render card
91
91
6. Launch SMART app
92
-
7.Tested with external CDS Service
92
+
7.Test with external CDS Service
93
93
94
94
This tutorial recommends implementing the CDS Hooks [security model](specification/1.0/#security-and-safety) after successful open access testing.
95
95
96
-
### Calls discovery endpoint
96
+
### Call discovery endpoint
97
97
The CDS discovery endpoint provides the list of services a CDS provider supports, and the hooks a service should be invoked on. An EHR may configure their system to support a set of hooks at a certain location in their users work flow, or build a dynamic capability to interact with a CDS Service provider within a work flow. For the best end-user experience, this guide recommends a business analyst configure which hooks an EHR will support.
98
98
99
99
Below is an example work flow where a business analyst accesses this list of available services by calling
@@ -109,7 +109,7 @@ This image captures a business analyst reviewing services from one CDS provider.
109
109
### Invoke service on patient-view hook
110
110
The `patient-view` hook is invoked when a patient chart is opened. It's one of the most basic since the logic doesn't have any prior workflow dependencies. The service called on the `patient-view` hook could be dependent on patient characteristics, for example: sex, problems in problems list, active medications, etc. The current version of the CDS Hooks specification allows the EHR to decide which characteristics to consider.
111
111
112
-
### Support for FHIR resources on request or prefetch
112
+
### Support FHIR resource on CDS requests (context or pre-fetch)
113
113
Often a CDS Service will require additional information from the EHR to perform the decision support logic, or determine the appropriate SMART app to return. Prefetch provides the EHR the capability to pass a resource when invoking a service. For example, with a patient resource included a service could do a geography search for potential environmental risk factors. Below is an example request invoked on patient-view with a patient included:
114
114
115
115
```json
@@ -140,8 +140,8 @@ In some cases, additional information beyond what is included in the prefetch ma
140
140
141
141
It is recommended FHIR servers implement, and CDS Services follow, locale specific implementation guides. In the US, the recommended implementation guides to follow are the [Argonaut Data Query Guide (DSTU2)](http://www.fhir.org/guides/argonaut/r2/) or [HL7 US Core (STU3)](http://hl7.org/fhir/us/core/index.html). Each profile page within these implementation guides includes queries FHIR servers are required to support.
142
142
143
-
### Exposed non-secured FHIR server
144
-
A nonsecured FHIR server is important to support testing with a CDS Service. When the EHR moves a hook to production the system is expected to follow the guidelines in the [security](specification/1.0/#security-and-safety) requirements.
143
+
### Expose non-secured FHIR server for testing
144
+
A non-secured FHIR server is important to support testing with a CDS Service. When the EHR moves a hook to production the system is expected to follow the guidelines in the [security](specification/1.0/#security-and-safety) requirements.
145
145
146
146
### Render card
147
147
The CDS Service will provide a response in the form a of a 'card'. Your EHR needs to be able to display the card.
@@ -174,7 +174,7 @@ Example card rendered: .
176
176
177
-
## Test with an external CDS Service
177
+
## Test with external CDS Service
178
178
179
179
No development is complete without testing with a CDS Service provider. Find a member in the [community](community) and test away.
0 commit comments