From 19c84e996f423c3d4b824b256f1ce43015fb0a39 Mon Sep 17 00:00:00 2001 From: Isaac Vetter Date: Thu, 15 Nov 2018 16:29:01 -0600 Subject: [PATCH 1/8] create allergyintolerance-create.md --- docs/hooks/allergyintolerance-create.md | 112 ++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 docs/hooks/allergyintolerance-create.md diff --git a/docs/hooks/allergyintolerance-create.md b/docs/hooks/allergyintolerance-create.md new file mode 100644 index 00000000..3aebf38f --- /dev/null +++ b/docs/hooks/allergyintolerance-create.md @@ -0,0 +1,112 @@ +# `allergyintolerance-create` + +| Metadata | Value +| ---- | ---- +| specificationVersion | 1.0 +| hookVersion | 0.1.0 + +## Workflow + +The `allergyintolerance-create` hook fires when when a clinician adds one or more new allergies or intolerances to a patient's list of allergies. +This hook may fire with one or more newly added, active allergies or draft allergies that are not yet finalized. +The context of the hook includes these new AllergyIntolerances. + +## Context + +Field | Optionality | Prefetch Token | Type | Description +----- | -------- | ---- | ---- | ---- +`userId` | REQUIRED | Yes | *string* | The id of the current user.
For this hook, the user is expected to be of type [Practitioner](https://www.hl7.org/fhir/practitioner.html).
For example, `Practitioner/123` +`patientId` | REQUIRED | Yes | *string* | The FHIR `Patient.id` of the current patient in context +`encounterId` | OPTIONAL | Yes | *string* | The FHIR `Encounter.id` of the current encounter in context +`allergyIntolerances` | REQUIRED | No | *object* | DSTU2 - FHIR Bundle of AllergyIntolerance
STU3 - FHIR Bundle of AllergyIntolerance + + +### Examples + +### Examples + ### Example (STU3) + ```json +{ + "context":{ + "userId":"Practitioner/123", + "patientId":"1288992", + "encounterId":"89284", + "allergyIntolerances":{ + "resourceType":"Bundle", + "entry":[ + { + "resource":{ + "resourceType":"AllergyIntolerance", + "id":"RES163672", + "clinicalStatus":"active", + "verificationStatus":"confirmed", + "type":"allergy", + "category":[ + "food" + ], + "criticality":"high", + "code":{ + "coding":[ + { + "system":"http://snomed.info/sct", + "code":"424213003", + "display":"Allergy to bee venom" + } + ] + }, + "patient":{ + "reference":"Patient/1288992" + }, + "assertedDate":"2018-11-15T07:05:57-05:00" + } + } + ] + } + } +} +``` + + ### Example (DSTU2) + ```json +{ + "context":{ + "userId":"Practitioner/123", + "patientId":"1288992", + "encounterId":"89284", + "allergyIntolerances":{ + "resourceType":"Bundle", + "entry":[ + { + "resource":{ + "resourceType":"AllergyIntolerance", + "id":"RES443610", + "recordedDate":"1992-05-28T17:22:05-04:00", + "patient":{ + "reference":"Patient/1288992" + }, + "substance":{ + "coding":[ + { + "system":"http://snomed.info/sct", + "code":"424213003", + "display":"Allergy to bee venom" + } + ] + }, + "status":"active", + "criticality":"low", + "type":"allergy", + "category":"food" + } + } + ] + } + } +} +``` + +## Change Log + +Version | Description +---- | ---- +0.1.0 | Initial Release From fcf22fd62e748d74e2a652b1390c2a4b5a1f7efa Mon Sep 17 00:00:00 2001 From: Isaac Vetter Date: Mon, 19 Nov 2018 16:22:04 -0600 Subject: [PATCH 2/8] add menu item --- mkdocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/mkdocs.yml b/mkdocs.yml index e00528bd..ef429b85 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -16,6 +16,7 @@ nav: - '1.0': 'specification/1.0.md' - Hooks: - 'new-hook-template' : 'hooks/template.md' + - allergyintolerance-create : 'hooks/allergyintolerance-create.md' - 'patient-view' : 'hooks/patient-view.md' - 'medication-prescribe' : 'hooks/medication-prescribe.md' - 'order-review' : 'hooks/order-review.md' From 92539e2bee140217658149eb385010a8f280f281 Mon Sep 17 00:00:00 2001 From: Isaac Vetter Date: Mon, 19 Nov 2018 16:28:47 -0600 Subject: [PATCH 3/8] formatting clean-up interesting differences in markdown interpretation between mkdocs & github .... --- docs/hooks/allergyintolerance-create.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/hooks/allergyintolerance-create.md b/docs/hooks/allergyintolerance-create.md index 3aebf38f..d0395a9b 100644 --- a/docs/hooks/allergyintolerance-create.md +++ b/docs/hooks/allergyintolerance-create.md @@ -23,8 +23,8 @@ Field | Optionality | Prefetch Token | Type | Description ### Examples -### Examples - ### Example (STU3) +### Example (STU3) + ```json { "context":{ @@ -67,6 +67,7 @@ Field | Optionality | Prefetch Token | Type | Description ``` ### Example (DSTU2) + ```json { "context":{ From 2f09922a57d7a5998ac123e312cc36e586b19df0 Mon Sep 17 00:00:00 2001 From: Isaac Vetter Date: Mon, 19 Nov 2018 16:31:18 -0600 Subject: [PATCH 4/8] 3rd time's the charm remove leading space in front of ```json --- docs/hooks/allergyintolerance-create.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/hooks/allergyintolerance-create.md b/docs/hooks/allergyintolerance-create.md index d0395a9b..4fa92a31 100644 --- a/docs/hooks/allergyintolerance-create.md +++ b/docs/hooks/allergyintolerance-create.md @@ -25,7 +25,7 @@ Field | Optionality | Prefetch Token | Type | Description ### Example (STU3) - ```json +```json { "context":{ "userId":"Practitioner/123", @@ -68,7 +68,7 @@ Field | Optionality | Prefetch Token | Type | Description ### Example (DSTU2) - ```json +```json { "context":{ "userId":"Practitioner/123", From 38421d7c822d1336f9dbecc16b120da3aea6b4e3 Mon Sep 17 00:00:00 2001 From: Isaac Vetter Date: Mon, 19 Nov 2018 16:32:45 -0600 Subject: [PATCH 5/8] formatting --- docs/hooks/allergyintolerance-create.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hooks/allergyintolerance-create.md b/docs/hooks/allergyintolerance-create.md index 4fa92a31..f56be61f 100644 --- a/docs/hooks/allergyintolerance-create.md +++ b/docs/hooks/allergyintolerance-create.md @@ -66,7 +66,7 @@ Field | Optionality | Prefetch Token | Type | Description } ``` - ### Example (DSTU2) +### Example (DSTU2) ```json { From 8617ebf7abca3757746e3c3c4305b1b5b774ecb1 Mon Sep 17 00:00:00 2001 From: Isaac Vetter Date: Wed, 6 Jan 2021 10:30:32 -0600 Subject: [PATCH 6/8] update for R4 --- docs/hooks/allergyintolerance-create.md | 46 ++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/docs/hooks/allergyintolerance-create.md b/docs/hooks/allergyintolerance-create.md index f56be61f..da4e32c5 100644 --- a/docs/hooks/allergyintolerance-create.md +++ b/docs/hooks/allergyintolerance-create.md @@ -18,11 +18,55 @@ Field | Optionality | Prefetch Token | Type | Description `userId` | REQUIRED | Yes | *string* | The id of the current user.
For this hook, the user is expected to be of type [Practitioner](https://www.hl7.org/fhir/practitioner.html).
For example, `Practitioner/123` `patientId` | REQUIRED | Yes | *string* | The FHIR `Patient.id` of the current patient in context `encounterId` | OPTIONAL | Yes | *string* | The FHIR `Encounter.id` of the current encounter in context -`allergyIntolerances` | REQUIRED | No | *object* | DSTU2 - FHIR Bundle of AllergyIntolerance
STU3 - FHIR Bundle of AllergyIntolerance +`allergyIntolerances` | REQUIRED | No | *object* | DSTU2 - FHIR Bundle of AllergyIntolerance
STU3 - FHIR Bundle of AllergyIntolerance
R4 - FHIR Bundle of AllergyIntolerance ### Examples +### Example (R4) + +```json +{ + "context":{ + "userId":"Practitioner/123", + "patientId":"1288992", + "encounterId":"89284", + "allergyIntolerances":{ + "resourceType":"Bundle", + "entry":[ + { + "resource":{ + "resourceType":"AllergyIntolerance", + "id":"RES163672", + "clinicalStatus":"active", + "verificationStatus":"confirmed", + "type":"allergy", + "category":[ + "food" + ], + "criticality":"high", + "code":{ + "coding":[ + { + "system":"http://snomed.info/sct", + "code":"424213003", + "display":"Allergy to bee venom" + } + ] + }, + "patient":{ + "reference":"Patient/1288992" + }, + "assertedDate":"2018-11-15T07:05:57-05:00" + } + } + ] + } + } +} +``` + + ### Example (STU3) ```json From cd1465a761341dbecb11b3af3352aff8883a8c83 Mon Sep 17 00:00:00 2001 From: Isaac Vetter Date: Fri, 16 Jun 2023 10:22:21 -0500 Subject: [PATCH 7/8] update workflow from bundle to instance of allergyintolerance to better reflect typical clinical workflow of one allergy added at a time. --- docs/hooks/allergyintolerance-create.md | 207 ++++++++++++------------ 1 file changed, 101 insertions(+), 106 deletions(-) diff --git a/docs/hooks/allergyintolerance-create.md b/docs/hooks/allergyintolerance-create.md index da4e32c5..f82348b2 100644 --- a/docs/hooks/allergyintolerance-create.md +++ b/docs/hooks/allergyintolerance-create.md @@ -4,12 +4,12 @@ | ---- | ---- | specificationVersion | 1.0 | hookVersion | 0.1.0 +| hookMaturity | 1 - Submitted ## Workflow -The `allergyintolerance-create` hook fires when when a clinician adds one or more new allergies or intolerances to a patient's list of allergies. -This hook may fire with one or more newly added, active allergies or draft allergies that are not yet finalized. -The context of the hook includes these new AllergyIntolerances. +The `allergyintolerance-create` hook fires when when a clinician adds a new allergy or intolerance to a patient's list of allergies. +This hook fires during the act of finalizing the entry of a new allergy, such that the decision support returned from the CDS Service can guide the clinician to cancel the addition of the allergy. The context of the hook include the AllergyIntolerance resource that's about to be added to the patient's list of allergies. ## Context @@ -18,7 +18,7 @@ Field | Optionality | Prefetch Token | Type | Description `userId` | REQUIRED | Yes | *string* | The id of the current user.
For this hook, the user is expected to be of type [Practitioner](https://www.hl7.org/fhir/practitioner.html).
For example, `Practitioner/123` `patientId` | REQUIRED | Yes | *string* | The FHIR `Patient.id` of the current patient in context `encounterId` | OPTIONAL | Yes | *string* | The FHIR `Encounter.id` of the current encounter in context -`allergyIntolerances` | REQUIRED | No | *object* | DSTU2 - FHIR Bundle of AllergyIntolerance
STU3 - FHIR Bundle of AllergyIntolerance
R4 - FHIR Bundle of AllergyIntolerance +`allergyIntolerance` | REQUIRED | No | *object* | R4/STU3/DSTU2 - FHIR AllergyIntolerance isntance ### Examples @@ -27,42 +27,37 @@ Field | Optionality | Prefetch Token | Type | Description ```json { - "context":{ - "userId":"Practitioner/123", - "patientId":"1288992", - "encounterId":"89284", - "allergyIntolerances":{ - "resourceType":"Bundle", - "entry":[ + "context": { + "userId": "Practitioner/123", + "patientId": "1288992", + "encounterId": "89284", + "allergyIntolerance": { + "resource": { + "resourceType": "AllergyIntolerance", + "id": "RES163672", + "clinicalStatus": "active", + "verificationStatus": "confirmed", + "type": "allergy", + "category": [ + "food" + ], + "criticality": "high", + "code": { + "coding": [ { - "resource":{ - "resourceType":"AllergyIntolerance", - "id":"RES163672", - "clinicalStatus":"active", - "verificationStatus":"confirmed", - "type":"allergy", - "category":[ - "food" - ], - "criticality":"high", - "code":{ - "coding":[ - { - "system":"http://snomed.info/sct", - "code":"424213003", - "display":"Allergy to bee venom" - } - ] - }, - "patient":{ - "reference":"Patient/1288992" - }, - "assertedDate":"2018-11-15T07:05:57-05:00" - } + "system": "http://snomed.info/sct", + "code": "424213003", + "display": "Allergy to bee venom" } - ] + ] + }, + "patient": { + "reference": "Patient/1288992" + }, + "assertedDate": "2018-11-15T07:05:57-05:00" } - } + } + } } ``` @@ -71,42 +66,42 @@ Field | Optionality | Prefetch Token | Type | Description ```json { - "context":{ - "userId":"Practitioner/123", - "patientId":"1288992", - "encounterId":"89284", - "allergyIntolerances":{ - "resourceType":"Bundle", - "entry":[ - { - "resource":{ - "resourceType":"AllergyIntolerance", - "id":"RES163672", - "clinicalStatus":"active", - "verificationStatus":"confirmed", - "type":"allergy", - "category":[ - "food" - ], - "criticality":"high", - "code":{ - "coding":[ - { - "system":"http://snomed.info/sct", - "code":"424213003", - "display":"Allergy to bee venom" - } - ] - }, - "patient":{ - "reference":"Patient/1288992" - }, - "assertedDate":"2018-11-15T07:05:57-05:00" - } - } - ] - } - } + "context": { + "userId": "Practitioner/123", + "patientId": "1288992", + "encounterId": "89284", + "allergyIntolerances": { + "resourceType": "Bundle", + "entry": [ + { + "resource": { + "resourceType": "AllergyIntolerance", + "id": "RES163672", + "clinicalStatus": "active", + "verificationStatus": "confirmed", + "type": "allergy", + "category": [ + "food" + ], + "criticality": "high", + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "424213003", + "display": "Allergy to bee venom" + } + ] + }, + "patient": { + "reference": "Patient/1288992" + }, + "assertedDate": "2018-11-15T07:05:57-05:00" + } + } + ] + } + } } ``` @@ -114,39 +109,39 @@ Field | Optionality | Prefetch Token | Type | Description ```json { - "context":{ - "userId":"Practitioner/123", - "patientId":"1288992", - "encounterId":"89284", - "allergyIntolerances":{ - "resourceType":"Bundle", - "entry":[ - { - "resource":{ - "resourceType":"AllergyIntolerance", - "id":"RES443610", - "recordedDate":"1992-05-28T17:22:05-04:00", - "patient":{ - "reference":"Patient/1288992" - }, - "substance":{ - "coding":[ - { - "system":"http://snomed.info/sct", - "code":"424213003", - "display":"Allergy to bee venom" - } - ] - }, - "status":"active", - "criticality":"low", - "type":"allergy", - "category":"food" - } - } - ] - } - } + "context": { + "userId": "Practitioner/123", + "patientId": "1288992", + "encounterId": "89284", + "allergyIntolerances": { + "resourceType": "Bundle", + "entry": [ + { + "resource": { + "resourceType": "AllergyIntolerance", + "id": "RES443610", + "recordedDate": "1992-05-28T17:22:05-04:00", + "patient": { + "reference": "Patient/1288992" + }, + "substance": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "424213003", + "display": "Allergy to bee venom" + } + ] + }, + "status": "active", + "criticality": "low", + "type": "allergy", + "category": "food" + } + } + ] + } + } } ``` From a9956ebf5bddf30d7d27249aa948cb2a8d7d9bcb Mon Sep 17 00:00:00 2001 From: Isaac Vetter Date: Wed, 3 Jan 2024 08:32:25 -0600 Subject: [PATCH 8/8] Update docs/hooks/allergyintolerance-create.md Co-authored-by: Vadim Peretokin --- docs/hooks/allergyintolerance-create.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hooks/allergyintolerance-create.md b/docs/hooks/allergyintolerance-create.md index f82348b2..f9c78007 100644 --- a/docs/hooks/allergyintolerance-create.md +++ b/docs/hooks/allergyintolerance-create.md @@ -18,7 +18,7 @@ Field | Optionality | Prefetch Token | Type | Description `userId` | REQUIRED | Yes | *string* | The id of the current user.
For this hook, the user is expected to be of type [Practitioner](https://www.hl7.org/fhir/practitioner.html).
For example, `Practitioner/123` `patientId` | REQUIRED | Yes | *string* | The FHIR `Patient.id` of the current patient in context `encounterId` | OPTIONAL | Yes | *string* | The FHIR `Encounter.id` of the current encounter in context -`allergyIntolerance` | REQUIRED | No | *object* | R4/STU3/DSTU2 - FHIR AllergyIntolerance isntance +`allergyIntolerance` | REQUIRED | No | *object* | R4/STU3/DSTU2 - FHIR AllergyIntolerance instance ### Examples