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/device-messages-through-iot-hub.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,7 +124,7 @@ When deployment is completed, the following resources and access roles are creat
124
124
125
125
***Azure Event Hubs Data Sender** role. In this deployment, the sender role is named *devicedatasender* and can be used to provide access to the event hub using a shared access signature (SAS). To learn more about authorizing access using a SAS, see [Authorizing access to Event Hubs resources using Shared Access Signatures](../../event-hubs/authorize-access-shared-access-signature.md). The **Azure Event Hubs Data Sender** role isn't used in this tutorial.
126
126
127
-
* IoT hub with [message routing](../../iot-hub/iot-hub-devguide-messages-d2c.md) configured to send device messages to the event hub.
127
+
* IoT hub with [message routing](../../iot-hub/iot-hub-devguide-messages-d2c.md) configured to route device messages to the event hub.
128
128
129
129
*[User-assigned managed identity](../../active-directory/managed-identities-azure-resources/overview.md), which provides send access from the IoT hub to the event hub. The managed identity has the **Azure Event Hubs Data Sender** role in the [Access control section (IAM)](../../role-based-access-control/overview.md) of the event hub.
130
130
@@ -211,7 +211,7 @@ You complete the steps by using Visual Studio Code with the Azure IoT Hub extens
211
211
After you select **Send**, it might take up to five minutes for the FHIR resources to be available in the FHIR service.
212
212
213
213
> [!IMPORTANT]
214
-
> To avoid device spoofing in device-to-cloud (D2C) messages, Azure IoT Hub enriches all device messages with additional properties before sending it to the MedTech service device event hub. For example: **Properties**: `iothub-creation-time-utc` and **SystemProperties**: `iothub-connection-device-id`. For more information, see [Anti-spoofing properties](../../iot-hub/iot-hub-devguide-messages-construct.md#anti-spoofing-properties) and [How to use IotJsonPathContent mappings](how-to-use-iot-jsonpath-content-mappings.md).
214
+
> To avoid device spoofing in device-to-cloud (D2C) messages, Azure IoT Hub enriches all device messages with additional properties before routing them to the event hub. For example: **Properties**: `iothub-creation-time-utc` and **SystemProperties**: `iothub-connection-device-id`. For more information, see [Anti-spoofing properties](../../iot-hub/iot-hub-devguide-messages-construct.md#anti-spoofing-properties) and [How to use IotJsonPathContent templates with the MedTech service device mapping](how-to-use-iotjsonpathcontent-templates.md).
215
215
>
216
216
> You do not want to send this example device message to your IoT hub as the enrichments will be duplicated by the IoT hub and cause an error with your MedTech service. This is only an example of how your device messages are enriched by the IoT hub.
Copy file name to clipboardExpand all lines: articles/healthcare-apis/iot/how-to-use-calculatedcontent-templates.md
+62-53Lines changed: 62 additions & 53 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: 06/07/2023
8
+
ms.date: 07/20/2023
9
9
ms.author: jasteppe
10
10
---
11
11
@@ -48,8 +48,8 @@ In the following example, `typeMatchExpression` is defined as:
48
48
49
49
The CalculatedContent templates allow matching on and extracting values from a device message read from an Azure Event Hubs event hub through the following expressions:
|typeMatchExpression|The expression that the MedTech service evaluates against the device message payload. If the service finds a matching token value, it considers the template a match. The service evaluates all later expressions against the extracted token value matched here.|`$..[?(@heartRate)]`|``[Body][?contains(keys(@), `heartRate`)] \| @[0]``|
54
54
|deviceIdExpression|The expression to extract the device identifier.|`$.matchedToken.deviceId`|`@.matchedToken.deviceId`|
55
55
|timestampExpression|The expression to extract the timestamp value for the measurement's `OccurrenceTimeUtc` value.|`$.matchedToken.endDate`|`@.matchedToken.endDate`|
@@ -58,6 +58,9 @@ 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
+
> [!NOTE]
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 MedTech service **Resolution type**, see [Configure the Destination tab](deploy-manual-portal.md#configure-the-destination-tab).
63
+
61
64
## Expression languages
62
65
63
66
When you're specifying the language to use for the expression, the following values are valid:
@@ -67,7 +70,7 @@ When you're specifying the language to use for the expression, the following val
67
70
| JSONPath |`JsonPath`|
68
71
| JMESPath |`JmesPath`|
69
72
70
-
Because JSONPath is the default expression language, it's not required to include the expression language within a CalculatedContent template:
73
+
Because JSONPath is the default expression language, it's not required to include the expression language within a CalculatedContent template.
71
74
72
75
```json
73
76
"templateType": "CalculatedContent",
@@ -110,49 +113,50 @@ In this example, we're using a device message that is capturing `heartRate` data
110
113
111
114
```json
112
115
{
113
-
"heartRate": "78",
114
-
"endDate": "2023-03-13T22:46:01.8750000",
115
-
"deviceId": "device01"
116
+
"heartRate": "78",
117
+
"endDate": "2023-03-13T22:46:01.8750000",
118
+
"deviceId": "device01"
116
119
}
117
120
```
118
121
119
122
The event hub enriches the device message before the MedTech service reads the device message from the event hub:
120
123
121
124
```json
122
125
{
123
-
"Body": {
124
-
"heartRate": "78",
125
-
"endDate": "2023-03-13T22:46:01.8750000",
126
-
"deviceId": "device01"
127
-
}
126
+
"Body": {
127
+
"heartRate": "78",
128
+
"endDate": "2023-03-13T22:46:01.8750000",
129
+
"deviceId": "device01"
130
+
}
128
131
}
129
132
```
130
133
131
134
We're using this device mapping for the normalization stage:
132
135
133
136
```json
134
137
{
135
-
"templateType": "CollectionContent",
136
-
"template": [
137
-
{
138
-
"templateType": "CalculatedContent",
139
-
"template": {
140
-
"typeName": "heartrate",
141
-
"typeMatchExpression": "$..[?(@heartRate)]",
142
-
"deviceIdExpression": "$.matchedToken.deviceId",
143
-
"timestampExpression": "$.matchedToken.endDate",
144
-
"values": [
145
-
{
146
-
"required": true,
147
-
"valueExpression": "$.matchedToken.heartRate",
148
-
"valueName": "hr"
149
-
}
150
-
]
151
-
}
152
-
}
153
-
]
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
+
]
154
157
}
155
158
```
159
+
156
160
> [!IMPORTANT]
157
161
> 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.
158
162
>
@@ -162,34 +166,34 @@ We're using this device mapping for the normalization stage:
162
166
163
167
```json
164
168
{
165
-
"Body": {
166
-
"heartRate": "78",
167
-
"endDate": "2023-03-13T22:46:01.8750000",
168
-
"deviceId": "device01"
169
-
},
170
-
"matchedToken": {
171
-
"heartRate": "78",
172
-
"endDate": "2023-03-13T22:46:01.8750000",
173
-
"deviceId": "device01"
174
-
}
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
+
}
175
179
}
176
180
```
177
181
178
182
The resulting normalized message will look like this after the normalization stage:
179
183
180
184
```json
181
185
[
182
-
{
183
-
"type": "heartrate",
184
-
"occurrenceTimeUtc": "2023-03-13T22:46:01.875Z",
185
-
"deviceId": "device01",
186
-
"properties": [
187
-
{
188
-
"name": "hr",
189
-
"value": "78"
190
-
}
191
-
]
192
-
}
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
+
}
193
197
]
194
198
```
195
199
@@ -202,9 +206,14 @@ The resulting normalized message will look like this after the normalization sta
202
206
203
207
In this article, you learned how to use CalculatedContent templates with the MedTech service device mapping.
204
208
205
-
To learn how to use the MedTech service custom functions, see:
209
+
To learn how to use the MedTech service custom functions, see
206
210
207
211
> [!div class="nextstepaction"]
208
212
> [How to use custom functions with the MedTech service device mapping](how-to-use-custom-functions.md)
209
213
214
+
For an overview of the MedTech service FHIR destination mapping, see
215
+
216
+
> [!div class="nextstepaction"]
217
+
> [Overview of the FHIR destination mapping](overview-of-fhir-destination-mapping.md)
218
+
210
219
FHIR® is a registered trademark of Health Level Seven International, registered in the U.S. Trademark Office, and is used with permission.
0 commit comments