Skip to content

Commit 5b08d08

Browse files
committed
Add support for Trace-Context
Fixes IHE#94
1 parent 20959f7 commit 5b08d08

9 files changed

+36
-25
lines changed

input/fsh/PatientCreate.fsh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,17 @@ A basic AuditEvent profile for when a RESTful Create action happens successfully
5252
* agent[user].network 0..0 // users are not network devices
5353
* agent[user].purposeOfUse MS // if the OAuth token includes a PurposeOfUse it is recorded here
5454
* source MS // what agent recorded the event. Likely the client or server but might be an intermediary
55-
* entity ^slicing.discriminator.type = #pattern
55+
* entity ^slicing.discriminator.type = #value
5656
* entity ^slicing.discriminator.path = "type"
5757
* entity ^slicing.rules = #open
5858
* entity 1..
5959
* entity contains
6060
transaction 0..1 and
6161
data 1..1
62-
* entity[transaction].type = BasicAuditEntityType#XrequestId
62+
* entity[transaction].type.system = "https://profiles.ihe.net/ITI/BALP/CodeSystem/BasicAuditEntityType"
63+
* entity[transaction].type from BasicAuditEntityTypesVS (required)
6364
* entity[transaction].what.identifier.value 1..1
64-
* entity[transaction].what.identifier.value ^short = "the value of X-Request-Id"
65+
* entity[transaction].what.identifier.value ^short = "the value of the transaction identifier"
6566
* entity[data].type = http://terminology.hl7.org/CodeSystem/audit-entity-type#2 // "System Object"
6667
* entity[data].role from RestObjectRoles (required)
6768
* entity[data].role 1..

input/fsh/PatientDelete.fsh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,17 @@ A basic AuditEvent profile for when a RESTful Delete action happens successfully
5252
* agent[user].network 0..0 // users are not network devices
5353
* agent[user].purposeOfUse MS // if the OAuth token includes a PurposeOfUse it is recorded here
5454
* source MS // what agent recorded the event. Likely the client or server but might be an intermediary
55-
* entity ^slicing.discriminator.type = #pattern
55+
* entity ^slicing.discriminator.type = #value
5656
* entity ^slicing.discriminator.path = "type"
5757
* entity ^slicing.rules = #open
5858
* entity 1..
5959
* entity contains
6060
transaction 0..1 and
6161
data 1..1
62-
* entity[transaction].type = BasicAuditEntityType#XrequestId
62+
* entity[transaction].type.system = "https://profiles.ihe.net/ITI/BALP/CodeSystem/BasicAuditEntityType"
63+
* entity[transaction].type from BasicAuditEntityTypesVS (required)
6364
* entity[transaction].what.identifier.value 1..1
64-
* entity[transaction].what.identifier.value ^short = "the value of X-Request-Id"
65+
* entity[transaction].what.identifier.value ^short = "the value of the transaction identifier"
6566
* entity[data].type = http://terminology.hl7.org/CodeSystem/audit-entity-type#2 // "System Object"
6667
* entity[data].role from RestObjectRoles (required)
6768
* entity[data].role 1..

input/fsh/PatientQuery.fsh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,17 @@ Note: the pattern defined in DICOM and IHE have the client is identified as the
7171
* agent[user].network 0..0 // users are not network devices
7272
* agent[user].purposeOfUse MS // if the OAuth token includes a PurposeOfUse it is recorded here
7373
* source MS // what agent recorded the event. Likely the client or server but might be an intermediary
74-
* entity ^slicing.discriminator.type = #pattern
74+
* entity ^slicing.discriminator.type = #value
7575
* entity ^slicing.discriminator.path = "type"
7676
* entity ^slicing.rules = #open
7777
* entity 1..
7878
* entity contains
7979
transaction 0..1 and
8080
query 1..1
81-
* entity[transaction].type = BasicAuditEntityType#XrequestId
81+
* entity[transaction].type.system = "https://profiles.ihe.net/ITI/BALP/CodeSystem/BasicAuditEntityType"
82+
* entity[transaction].type from BasicAuditEntityTypesVS (required)
8283
* entity[transaction].what.identifier.value 1..1
83-
* entity[transaction].what.identifier.value ^short = "the value of X-Request-Id"
84+
* entity[transaction].what.identifier.value ^short = "the value of the transaction identifier"
8485
* entity[query].type = http://terminology.hl7.org/CodeSystem/audit-entity-type#2 // "System Object"
8586
* entity[query].role = http://terminology.hl7.org/CodeSystem/object-role#24 // "Query"
8687
* entity[query].role 1..

input/fsh/PatientRead.fsh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,17 @@ A basic AuditEvent profile for when a RESTful Read action happens successfully.
5858
* agent[user].network 0..0 // users are not network devices
5959
* agent[user].purposeOfUse MS // if the OAuth token includes a PurposeOfUse it is recorded here
6060
* source MS // what agent recorded the event. Likely the client or server but might be an intermediary
61-
* entity ^slicing.discriminator.type = #pattern
61+
* entity ^slicing.discriminator.type = #value
6262
* entity ^slicing.discriminator.path = "type"
6363
* entity ^slicing.rules = #open
6464
* entity 1..
6565
* entity contains
6666
transaction 0..1 and
6767
data 1..1
68-
* entity[transaction].type = BasicAuditEntityType#XrequestId
68+
* entity[transaction].type.system = "https://profiles.ihe.net/ITI/BALP/CodeSystem/BasicAuditEntityType"
69+
* entity[transaction].type from BasicAuditEntityTypesVS (required)
6970
* entity[transaction].what.identifier.value 1..1
70-
* entity[transaction].what.identifier.value ^short = "the value of X-Request-Id"
71+
* entity[transaction].what.identifier.value ^short = "the value of the transaction identifier"
7172
* entity[data].type = http://terminology.hl7.org/CodeSystem/audit-entity-type#2 // "System Object"
7273
* entity[data].role from RestObjectRoles (required)
7374
* entity[data].what 1..1

input/fsh/PatientUpdate.fsh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,17 @@ A basic AuditEvent profile for when a RESTful Update action happens successfully
6161
* agent[user].network 0..0 // users are not network devices
6262
* agent[user].purposeOfUse MS // if the OAuth token includes a PurposeOfUse it is recorded here
6363
* source MS // what agent recorded the event. Likely the client or server but might be an intermediary
64-
* entity ^slicing.discriminator.type = #pattern
64+
* entity ^slicing.discriminator.type = #value
6565
* entity ^slicing.discriminator.path = "type"
6666
* entity ^slicing.rules = #open
6767
* entity 1..
6868
* entity contains
6969
transaction 0..1 and
7070
data 1..1
71-
* entity[transaction].type = BasicAuditEntityType#XrequestId
71+
* entity[transaction].type.system = "https://profiles.ihe.net/ITI/BALP/CodeSystem/BasicAuditEntityType"
72+
* entity[transaction].type from BasicAuditEntityTypesVS (required)
7273
* entity[transaction].what.identifier.value 1..1
73-
* entity[transaction].what.identifier.value ^short = "the value of X-Request-Id"
74+
* entity[transaction].what.identifier.value ^short = "the value of the transaction identifier"
7475
* entity[data].type = http://terminology.hl7.org/CodeSystem/audit-entity-type#2 // "System Object"
7576
* entity[data].role from RestObjectRoles (required)
7677
* entity[data].role 1..

input/fsh/ex-patientQuery.fsh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Audit Example for a RESTful Query using GET with a patient subject, recorded by
116116
- user is John Smith
117117
- query is for an Observation for given patient
118118
- patient is specified
119-
- X-Request-Id is specified
119+
- traceparent is specified
120120
"""
121121
* meta.security = http://terminology.hl7.org/CodeSystem/v3-ActReason#HTEST
122122
* type = http://terminology.hl7.org/CodeSystem/audit-event-type#rest "Restful Operation"
@@ -148,11 +148,11 @@ Audit Example for a RESTful Query using GET with a patient subject, recorded by
148148
* entity[query].description = """
149149
GET test.fhir.org/r4/Observation?patient=ex-patient&_lastUpdated=gt2020-11-06T21:52:30.300Z&_sort=_lastUpdated&_count=10
150150
Accept: application/fhir+json; fhirVersion=4.0
151-
X-Request-Id: cc6d168e-5871-11ec-bf63-0242ac130002
151+
traceparent: 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01
152152
"""
153-
* entity[query].query = "R0VUIHRlc3QuZmhpci5vcmcvcjQvT2JzZXJ2YXRpb24/cGF0aWVudD1leC1wYXRpZW50Jl9sYXN0VXBkYXRlZD1ndDIwMjAtMTEtMDZUMjE6NTI6MzAuMzAwWiZfc29ydD1fbGFzdFVwZGF0ZWQmX2NvdW50PTEwCkFjY2VwdDogYXBwbGljYXRpb24vZmhpcitqc29uOyBmaGlyVmVyc2lvbj00LjAKWC1SZXF1ZXN0LUlkOiBjYzZkMTY4ZS01ODcxLTExZWMtYmY2My0wMjQyYWMxMzAwMDI="
154-
* entity[transaction].type = BasicAuditEntityType#XrequestId
155-
* entity[transaction].what.identifier.value = "cc6d168e-5871-11ec-bf63-0242ac130002"
153+
* entity[query].query = "R0VUIHRlc3QuZmhpci5vcmcvcjQvT2JzZXJ2YXRpb24/cGF0aWVudD1leC1wYXRpZW50Jl9sYXN0VXBkYXRlZD1ndDIwMjAtMTEtMDZUMjE6NTI6MzAuMzAwWiZfc29ydD1fbGFzdFVwZGF0ZWQmX2NvdW50PTEwCkFjY2VwdDogYXBwbGljYXRpb24vZmhpcitqc29uOyBmaGlyVmVyc2lvbj00LjAKdHJhY2VwYXJlbnQ6IDAwLTBhZjc2NTE5MTZjZDQzZGQ4NDQ4ZWIyMTFjODAzMTljLWI3YWQ2YjcxNjkyMDMzMzEtMDE="
154+
* entity[transaction].type = BasicAuditEntityType#Traceparent
155+
* entity[transaction].what.identifier.value = "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01"
156156

157157

158158

input/fsh/terms.fsh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This FSH file contains vocabulary unique to BasicAudit, that is used by many profiles.
2-
// Some vocabulary are specific to one profile, and is thus defiend with that profile.
2+
// Some vocabulary are specific to one profile, and is thus defined with that profile.
33

44
CodeSystem: BasicAuditEntityType
55
Title: "Entity Types that are defined in IHE BasicAudit"
@@ -9,6 +9,8 @@ These are new codes used in BasicAudit IG, where AuditEvent.entity is used to ho
99
* ^caseSensitive = true
1010
* ^experimental = false
1111
* #XrequestId "transport specific unique identifier where http X-Request-Id is used"
12+
* #Traceparent "transport specific unique identifier where http traceparent is used"
13+
* #Tracestate "transport specific unique identifier where http tracestate is used"
1214

1315

1416

input/pagecontent/AuditEvent-ex-auditBasicQueryGetClient-intro.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ Audit Example for a RESTful Query using GET with a patient subject, recorded by
88
- user is John Smith
99
- query is for an Observation for given patient
1010
- patient is specified
11-
- X-Request-Id is specified
11+
- traceparent is specified
1212

1313
The http GET requested
1414

1515
```
1616
GET test.fhir.org/r4/Observation?patient=ex-patient&_lastUpdated=gt2020-11-06T21:52:30.300Z&_sort=_lastUpdated&_count=10
1717
Accept: application/fhir+json; fhirVersion=4.0
18-
X-Request-Id: cc6d168e-5871-11ec-bf63-0242ac130002
18+
traceparent: 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01
1919
```

input/pagecontent/content.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,13 @@ Execute (search and query) | [Query](StructureDefinition-IHE.BasicAudit.Query.ht
3030

3131
An example of an auditable event being recorded by the client and server is represented by the Create examples.
3232

33-
#### 3:5.7.3.1 X-Request-Id header
33+
#### 3:5.7.3.1 Transaction identifiers
3434

35-
Where it is known that an http RESTful transaction included an X-Request-Id, that value should be recorded in an .entity dedicated to X-Request-Id. This ID can be used to correlated AuditEvents from client and server, and may aid with correlation on further activities recorded caused by the transaction. This means that the .entity holding the X-Request-Id may appear in AuditEvents beyond those defined here.
35+
When a transaction contains an identifier (such as the `X-Request-Id` and `traceparent`/`tracestate` HTTP headers), that
36+
value should be recorded in an .entity dedicated to transaction identifiers. This ID can be used to correlated
37+
AuditEvents from client and server, and may aid with correlation on further activities recorded caused by the
38+
transaction. This means that the .entity holding the transaction identifier may appear in AuditEvents beyond those
39+
defined here.
3640

3741
### 3:5.7.4 SAML Security Token
3842

0 commit comments

Comments
 (0)