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: articles/healthcare-apis/iot/how-to-use-calculatedcontent-templates.md
+50-50Lines changed: 50 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ author: msjasteppe
5
5
ms.service: healthcare-apis
6
6
ms.subservice: fhir
7
7
ms.topic: how-to
8
-
ms.date: 07/07/2023
8
+
ms.date: 07/10/2023
9
9
ms.author: jasteppe
10
10
---
11
11
@@ -58,7 +58,7 @@ The CalculatedContent templates allow matching on and extracting values from a d
58
58
|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`|
59
59
|values[].valueExpression|The expression to extract the wanted value.|`$.matchedToken.heartRate`|`@.matchedToken.heartRate`|
60
60
61
-
> [!IMPORTANT]
61
+
> [!NOTE]
62
62
> 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).
63
63
64
64
## Expression languages
@@ -113,47 +113,47 @@ In this example, we're using a device message that is capturing `heartRate` data
113
113
114
114
```json
115
115
{
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"
119
119
}
120
120
```
121
121
122
122
The event hub enriches the device message before the MedTech service reads the device message from the event hub:
123
123
124
124
```json
125
125
{
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
+
}
131
131
}
132
132
```
133
133
134
134
We're using this device mapping for the normalization stage:
135
135
136
136
```json
137
137
{
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
+
]
157
157
}
158
158
```
159
159
@@ -166,34 +166,34 @@ We're using this device mapping for the normalization stage:
166
166
167
167
```json
168
168
{
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
+
}
179
179
}
180
180
```
181
181
182
182
The resulting normalized message will look like this after the normalization stage:
Copy file name to clipboardExpand all lines: articles/healthcare-apis/iot/how-to-use-iotjsonpathcontent-templates.md
+46-51Lines changed: 46 additions & 51 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ author: msjasteppe
5
5
ms.service: healthcare-apis
6
6
ms.subservice: fhir
7
7
ms.topic: how-to
8
-
ms.date: 07/07/2023
8
+
ms.date: 07/10/2023
9
9
ms.author: jasteppe
10
10
---
11
11
@@ -18,6 +18,8 @@ This article provides an overview of how to use IotJsonPathContent templates wit
18
18
19
19
## IotJsonPathContent template basics
20
20
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
+
21
23
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.
22
24
23
25
> [!IMPORTANT]
@@ -26,10 +28,7 @@ The MedTech service IotJsonPathContent templates support the JSON expression lan
26
28
An expression is defined as:
27
29
28
30
```json
29
-
<name of expression> : {
30
-
"value" : <the expression>,
31
-
"language": <the expression language>
32
-
}
31
+
<name of expression> : <the expression>
33
32
```
34
33
35
34
In the following example, `typeMatchExpression` is defined as:
@@ -38,12 +37,8 @@ In the following example, `typeMatchExpression` is defined as:
38
37
"templateType": "IotJsonPathContent",
39
38
"template": {
40
39
"typeName": "heartrate",
41
-
"typeMatchExpression": {
42
-
"value" : "$..[?(@heartRate)]",
43
-
"language": "JsonPath"
44
-
},
45
-
...
46
-
}
40
+
"typeMatchExpression": "$..[?(@heartRate)]"
41
+
},
47
42
```
48
43
49
44
> [!IMPORTANT]
@@ -61,7 +56,7 @@ The IotJsonPathContent templates allow matching on and extracting values from a
61
56
|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`|
62
57
|values[].valueExpression|The expression to extract the wanted value.|`$.matchedToken.heartRate`|
63
58
64
-
> [!IMPORTANT]
59
+
> [!NOTE]
65
60
> 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).
66
61
67
62
## Expression languages
@@ -99,7 +94,7 @@ In this example, we're using a device message that is capturing `heartRate` data
99
94
100
95
```json
101
96
{
102
-
“heartRate” : “78”
97
+
heartRate” : “78”
103
98
}
104
99
```
105
100
@@ -112,58 +107,58 @@ The IoT hub enriches and routes the device message to the event hub before the M
> 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.
153
148
154
149
The resulting normalized message will look like this after the normalization stage:
0 commit comments