Skip to content

Commit e393f7c

Browse files
committed
Updates and edits from meeting sync
1 parent c400dce commit e393f7c

File tree

2 files changed

+96
-101
lines changed

2 files changed

+96
-101
lines changed

articles/healthcare-apis/iot/how-to-use-calculatedcontent-templates.md

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: msjasteppe
55
ms.service: healthcare-apis
66
ms.subservice: fhir
77
ms.topic: how-to
8-
ms.date: 07/07/2023
8+
ms.date: 07/10/2023
99
ms.author: jasteppe
1010
---
1111

@@ -58,7 +58,7 @@ The CalculatedContent templates allow matching on and extracting values from a d
5858
|correlationIdExpression|*Optional*: The expression to extract the correlation identifier. You can use this output to group values into a single observation in the FHIR destination mapping.|`$.matchedToken.correlationId`|`@.matchedToken.correlationId`|
5959
|values[].valueExpression|The expression to extract the wanted value.|`$.matchedToken.heartRate`|`@.matchedToken.heartRate`|
6060

61-
> [!IMPORTANT]
61+
> [!NOTE]
6262
> The **Resolution type** specifies how the MedTech service associates device data with Device resources and Patient resources. The MedTech service reads Device and Patient resources from the FHIR service using [device identifiers](https://www.hl7.org/fhir/r4/device-definitions.html#Device.identifier) and [patient identifiers](https://www.hl7.org/fhir/r4/patient-definitions.html#Patient.identifier). If an [encounter identifier](https://hl7.org/fhir/r4/encounter-definitions.html#Encounter.identifier) is specified and extracted from the device data payload, it's linked to the observation if an encounter exists on the FHIR service with that identifier. If the [encounter identifier](../../healthcare-apis/release-notes.md#medtech-service) is successfully normalized, but no FHIR Encounter exists with that encounter identifier, a **FhirResourceNotFound** exception is thrown. For more information on configuring the the MedTech service **Resolution type**, see [Configure the Destination tab](deploy-manual-portal.md#configure-the-destination-tab).
6363
6464
## Expression languages
@@ -113,47 +113,47 @@ In this example, we're using a device message that is capturing `heartRate` data
113113

114114
```json
115115
{
116-
"heartRate": "78",
117-
"endDate": "2023-03-13T22:46:01.8750000",
118-
"deviceId": "device01"
116+
"heartRate": "78",
117+
"endDate": "2023-03-13T22:46:01.8750000",
118+
"deviceId": "device01"
119119
}
120120
```
121121

122122
The event hub enriches the device message before the MedTech service reads the device message from the event hub:
123123

124124
```json
125125
{
126-
"Body": {
127-
"heartRate": "78",
128-
"endDate": "2023-03-13T22:46:01.8750000",
129-
"deviceId": "device01"
130-
}
126+
"Body": {
127+
"heartRate": "78",
128+
"endDate": "2023-03-13T22:46:01.8750000",
129+
"deviceId": "device01"
130+
}
131131
}
132132
```
133133

134134
We're using this device mapping for the normalization stage:
135135

136136
```json
137137
{
138-
"templateType": "CollectionContent",
139-
"template": [
140-
{
141-
"templateType": "CalculatedContent",
142-
"template": {
143-
"typeName": "heartrate",
144-
"typeMatchExpression": "$..[?(@heartRate)]",
145-
"deviceIdExpression": "$.matchedToken.deviceId",
146-
"timestampExpression": "$.matchedToken.endDate",
147-
"values": [
148-
{
149-
"required": true,
150-
"valueExpression": "$.matchedToken.heartRate",
151-
"valueName": "hr"
152-
}
153-
]
154-
}
155-
}
156-
]
138+
"templateType": "CollectionContent",
139+
"template": [
140+
{
141+
"templateType": "CalculatedContent",
142+
"template": {
143+
"typeName": "heartrate",
144+
"typeMatchExpression": "$..[?(@heartRate)]",
145+
"deviceIdExpression": "$.matchedToken.deviceId",
146+
"timestampExpression": "$.matchedToken.endDate",
147+
"values": [
148+
{
149+
"required": true,
150+
"valueExpression": "$.matchedToken.heartRate",
151+
"valueName": "hr"
152+
}
153+
]
154+
}
155+
}
156+
]
157157
}
158158
```
159159

@@ -166,34 +166,34 @@ We're using this device mapping for the normalization stage:
166166
167167
```json
168168
{
169-
"Body": {
170-
"heartRate": "78",
171-
"endDate": "2023-03-13T22:46:01.8750000",
172-
"deviceId": "device01"
173-
},
174-
"matchedToken": {
175-
"heartRate": "78",
176-
"endDate": "2023-03-13T22:46:01.8750000",
177-
"deviceId": "device01"
178-
}
169+
"Body": {
170+
"heartRate": "78",
171+
"endDate": "2023-03-13T22:46:01.8750000",
172+
"deviceId": "device01"
173+
},
174+
"matchedToken": {
175+
"heartRate": "78",
176+
"endDate": "2023-03-13T22:46:01.8750000",
177+
"deviceId": "device01"
178+
}
179179
}
180180
```
181181

182182
The resulting normalized message will look like this after the normalization stage:
183183

184184
```json
185185
[
186-
{
187-
"type": "heartrate",
188-
"occurrenceTimeUtc": "2023-03-13T22:46:01.875Z",
189-
"deviceId": "device01",
190-
"properties": [
191-
{
192-
"name": "hr",
193-
"value": "78"
194-
}
195-
]
196-
}
186+
{
187+
"type": "heartrate",
188+
"occurrenceTimeUtc": "2023-03-13T22:46:01.875Z",
189+
"deviceId": "device01",
190+
"properties": [
191+
{
192+
"name": "hr",
193+
"value": "78"
194+
}
195+
]
196+
}
197197
]
198198
```
199199

articles/healthcare-apis/iot/how-to-use-iotjsonpathcontent-templates.md

Lines changed: 46 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: msjasteppe
55
ms.service: healthcare-apis
66
ms.subservice: fhir
77
ms.topic: how-to
8-
ms.date: 07/07/2023
8+
ms.date: 07/10/2023
99
ms.author: jasteppe
1010
---
1111

@@ -18,6 +18,8 @@ This article provides an overview of how to use IotJsonPathContent templates wit
1818

1919
## IotJsonPathContent template basics
2020

21+
IotJsonPathContent templates can be used when the MedTech service ingests device messages [routed](../../iot-hub/iot-concepts-and-iot-hub.md#message-routing-sends-data-to-other-endpoints) from an [Azure IoT Hub](../../iot-hub/iot-concepts-and-iot-hub.md). When IotJsonPathContent templates are used within the [device mapping](overview-of-device-mapping.md), the MedTech service extracts the device ID and measurement timestamp from metadata provided by an IoT hub. The TimestampExpression and DeviceIdExpression shouldn't be included in IotJsonPathContent templates.
22+
2123
The MedTech service IotJsonPathContent templates support the JSON expression language JSONPath. Expressions are used to identify which template to use with a given JSON device message (for example: TypeMatchExpression) and to extract specific values that are required to create a normalized message (for example: PatientIdExpression, ValueExpression, etc.). IotJsonPathContent templates are similar to the CalculatedContent templates except the DeviceIdExpression and TimestampExpression aren't supported.
2224

2325
> [!IMPORTANT]
@@ -26,10 +28,7 @@ The MedTech service IotJsonPathContent templates support the JSON expression lan
2628
An expression is defined as:
2729

2830
```json
29-
<name of expression> : {
30-
"value" : <the expression>,
31-
"language": <the expression language>
32-
}
31+
<name of expression> : <the expression>
3332
```
3433

3534
In the following example, `typeMatchExpression` is defined as:
@@ -38,12 +37,8 @@ In the following example, `typeMatchExpression` is defined as:
3837
"templateType": "IotJsonPathContent",
3938
"template": {
4039
"typeName": "heartrate",
41-
"typeMatchExpression": {
42-
"value" : "$..[?(@heartRate)]",
43-
"language": "JsonPath"
44-
},
45-
...
46-
}
40+
"typeMatchExpression": "$..[?(@heartRate)]"
41+
},
4742
```
4843

4944
> [!IMPORTANT]
@@ -61,7 +56,7 @@ The IotJsonPathContent templates allow matching on and extracting values from a
6156
|correlationIdExpression|*Optional*: The expression to extract the correlation identifier. You can use this output to group values into a single observation in the FHIR destination mapping.|`$.matchedToken.correlationId`|
6257
|values[].valueExpression|The expression to extract the wanted value.|`$.matchedToken.heartRate`|
6358

64-
> [!IMPORTANT]
59+
> [!NOTE]
6560
> The **Resolution type** specifies how the MedTech service associates device data with Device resources and Patient resources. The MedTech service reads Device and Patient resources from the FHIR service using [device identifiers](https://www.hl7.org/fhir/r4/device-definitions.html#Device.identifier) and [patient identifiers](https://www.hl7.org/fhir/r4/patient-definitions.html#Patient.identifier). If an [encounter identifier](https://hl7.org/fhir/r4/encounter-definitions.html#Encounter.identifier) is specified and extracted from the device data payload, it's linked to the observation if an encounter exists on the FHIR service with that identifier. If the [encounter identifier](../../healthcare-apis/release-notes.md#medtech-service) is successfully normalized, but no FHIR Encounter exists with that encounter identifier, a **FhirResourceNotFound** exception is thrown. For more information on configuring the the MedTech service **Resolution type**, see [Configure the Destination tab](deploy-manual-portal.md#configure-the-destination-tab).
6661
6762
## Expression languages
@@ -99,7 +94,7 @@ In this example, we're using a device message that is capturing `heartRate` data
9994

10095
```json
10196
{
102-
heartRate” : “78”
97+
heartRate” : “78”
10398
}
10499
```
105100

@@ -112,58 +107,58 @@ The IoT hub enriches and routes the device message to the event hub before the M
112107

113108
```json
114109
{
115-
"Body": {
116-
"heartRate": "78"
117-
},
118-
"Properties": {
119-
"iothub-creation-time-utc": "2023-03-13T22:46:01.87500000"
120-
},
121-
"SystemProperties": {
122-
"iothub-connection-device-id": "device01"
123-
}
124-
}
110+
"Body": {
111+
"heartRate": "78"
112+
},
113+
"Properties": {
114+
"iothub-creation-time-utc": "2023-03-13T22:46:01.87500000"
115+
},
116+
"SystemProperties": {
117+
"iothub-connection-device-id": "device01"
118+
}
119+
}
125120
```
126121
We're using this device mapping for the normalization stage:
127122

128123
```json
129124
{
130-
"templateType": "CollectionContent",
131-
"template": [
132-
{
133-
"templateType": "IotJsonPathContent",
134-
"template": {
135-
"typeName": "heartRate",
136-
"typeMatchExpression": "$..[?(@Body.heartRate)]",
137-
"patientIdExpression": "$.SystemProperties.iothub-connection-device-id",
138-
"values": [
139-
{
140-
"required": "true",
141-
"valueExpression": "$.Body.heartRate",
142-
"valueName": "hr"
143-
}
144-
]
145-
}
146-
}
147-
]
125+
"templateType": "CollectionContent",
126+
"template": [
127+
{
128+
"templateType": "IotJsonPathContent",
129+
"template": {
130+
"typeName": "heartRate",
131+
"typeMatchExpression": "$..[?(@Body.heartRate)]",
132+
"patientIdExpression": "$.SystemProperties.iothub-connection-device-id",
133+
"values": [
134+
{
135+
"required": "true",
136+
"valueExpression": "$.Body.heartRate",
137+
"valueName": "hr"
138+
}
139+
]
140+
}
141+
}
142+
]
148143
}
149144
```
150145

151-
> [!IMPORTANT]
146+
> [!NOTE]
152147
> The MedTech service evaluates `typeMatchExpression` against the incoming device data payload. If the service finds a matching token value, it considers the template a match.
153148
154149
The resulting normalized message will look like this after the normalization stage:
155150

156151
```json
157152
{
158-
"type": "heartRate",
159-
"occurrenceTimeUtc": "2023-03-13T22:46:01.875Z",
160-
"deviceId": "device01",
161-
"properties": [
162-
{
163-
"name": "hr",
164-
"value": "78"
165-
}
166-
]
153+
"type": "heartRate",
154+
"occurrenceTimeUtc": "2023-03-13T22:46:01.875Z",
155+
"deviceId": "device01",
156+
"properties": [
157+
{
158+
"name": "hr",
159+
"value": "78"
160+
}
161+
]
167162
}
168163
```
169164

0 commit comments

Comments
 (0)