Skip to content

Commit 3b5f875

Browse files
authored
Clarify hooks example context table
Fixes #331
1 parent 28965d7 commit 3b5f875

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

docs/hooks/index.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,7 @@ All fields defined by the hook's context MUST be defined in a table where each f
111111
- 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* (`|`)
112112
- 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.
113113

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

122116
Field | Optionality | Prefetch Token | Type | Description
123117
----- | -------- | ---- | ---- | ----
@@ -127,6 +121,14 @@ Field | Optionality | Prefetch Token | Type | Description
127121
`moreObjects` | OPTIONAL | No | *array* | A clear description of the items in this array.
128122
`allFHIR` | OPTIONAL | No | *object* | A FHIR Bundle of the following FHIR resources using a specific version of FHIR.
129123

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+
130132
### Examples
131133

132134
Hook creators SHOULD include examples of the context.

0 commit comments

Comments
 (0)