Skip to content

Commit 8975a79

Browse files
authored
Merge pull request #212580 from msjasteppe/iot-hub-updates
Updating to address customer feedback.
2 parents bb2219b + b4b45ac commit 8975a79

File tree

2 files changed

+140
-58
lines changed

2 files changed

+140
-58
lines changed

articles/healthcare-apis/iot/device-data-through-iot-hub.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: msjasteppe
66
ms.service: healthcare-apis
77
ms.subservice: iomt
88
ms.topic: tutorial
9-
ms.date: 03/25/2022
9+
ms.date: 09/29/2022
1010
ms.author: jasteppe
1111
---
1212

@@ -39,17 +39,24 @@ For more information on Azure role-based access control, see [Azure role-based a
3939

4040
## Connect IoT Hub with the MedTech service
4141

42-
Azure IoT Hub supports a feature called [message routing](../../iot-hub/iot-hub-devguide-messages-d2c.md). Message routing provides the capability to send device data to various Azure services (for example: event hub, Storage Accounts, and Service Buses). MedTech service uses this feature to allow an IoT Hub to connect and send device messages to the MedTech service device message event hub endpoint.
42+
Azure IoT Hub supports a feature called [message routing](/azure/iot-hub/iot-hub-devguide-messages-d2c.md). Message routing provides the capability to send device data to various Azure services (for example: event hub, Storage Accounts, and Service Buses). MedTech service uses this feature to allow an IoT Hub to connect and send device messages to the MedTech service device message event hub endpoint.
4343

44-
Follow these directions to grant access to the IoT Hub user-assigned managed identity to your MedTech service device message event hub and set up message routing: [Configure message routing with managed identities](../../iot-hub/iot-hub-managed-identity.md#egress-connectivity-from-iot-hub-to-other-azure-resources).
44+
Follow these directions to grant access to the IoT Hub system-assigned managed identity to your MedTech service device message event hub and set up message routing: [Configure message routing with managed identities](/azure-pipelines.yml/iot-hub/iot-hub-managed-identitymd#egress-connectivity-from-iot-hub-to-other-azure-resources)
4545

4646
## Send device message to IoT Hub
4747

4848
Use your device (real or simulated) to send the sample heart rate message shown below to the IoT Hub.
4949

5050
This message will get routed to MedTech service, where the message will be transformed into a FHIR Observation resource and stored into FHIR service.
5151

52+
> [!IMPORTANT]
53+
> To avoid device spoofing in device-to-cloud messages, Azure IoT Hub enriches all messages with additional properties. To learn more about these properties, see [Anti-spoofing properties](/azure/iot-hub/iot-hub-devguide-messages-construct#anti-spoofing-properties)
54+
55+
> [!TIP]
56+
> To learn about IoT Hub device message enrichment and IotJsonPathContentTemplate mappings usage with the MedTech service device mapping, see [How to use IotJsonPathContentTemplate mappings](how-to-use-iot-jsonpath-content-mappings.md)
57+
5258
```json
59+
5360
{
5461
"HeartRate": 80,
5562
"RespiratoryRate": 12,
@@ -61,7 +68,9 @@ This message will get routed to MedTech service, where the message will be trans
6168
},
6269
"Activity": "walking"
6370
}
71+
6472
```
73+
6574
> [!IMPORTANT]
6675
> Make sure to send the device message that conforms to the [Device mappings](how-to-use-device-mappings.md) and [FHIR destinations mappings](how-to-use-fhir-mappings.md) configured with your MedTech service.
6776
@@ -81,4 +90,4 @@ To learn about the different stages of data flow within MedTech service, see
8190
>[!div class="nextstepaction"]
8291
>[MedTech service data flow](iot-data-flow.md)
8392
84-
(FHIR®) is a registered trademark of HL7 and is used with the permission of HL7.
93+
FHIR® is a registered trademark of Health Level Seven International, registered in the U.S. Trademark Office and is used with their permission.

articles/healthcare-apis/iot/how-to-use-iot-jsonpath-content-mappings.md

Lines changed: 127 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,14 @@ author: msjasteppe
55
ms.service: healthcare-apis
66
ms.subservice: fhir
77
ms.topic: how-to
8-
ms.date: 09/06/2022
8+
ms.date: 09/26/2022
99
ms.author: jasteppe
1010
---
1111

1212
# How to use IotJsonPathContentTemplate mappings
1313

1414
This article describes how to use IoTJsonPathContentTemplate mappings with the MedTech service [device mapping](how-to-use-device-mappings.md).
1515

16-
> [!TIP]
17-
> Check out the [IoMT Connector Data Mapper](https://github.com/microsoft/iomt-fhir/tree/master/tools/data-mapper) tool for editing, testing, and troubleshooting the MedTech service Device and FHIR destination mappings. Export mappings for uploading to the MedTech service in the Azure portal or use with the [open-source version](https://github.com/microsoft/iomt-fhir) of the MedTech service.
18-
1916
## IotJsonPathContentTemplate
2017

2118
The IotJsonPathContentTemplate is similar to the JsonPathContentTemplate except the `DeviceIdExpression` and `TimestampExpression` aren't required.
@@ -25,7 +22,7 @@ The assumption, when using this template, is the messages being evaluated were s
2522
When you're using these SDKs, the device identity and the timestamp of the message are known.
2623

2724
>[!IMPORTANT]
28-
>Make sure that you're using a device identifier from Azure Iot Hub or Azure IoT Central that is registered as an identifier for a device resource on the destination FHIR service.
25+
>Make sure that you're using a device identifier from Azure Iot Hub or Azure IoT Central that is registered as an identifier for a device resource on the destination Fast Healthcare Interoperability Resource (FHIR®) service.
2926
3027
If you're using Azure IoT Hub Device SDKs, you can still use the JsonPathContentTemplate, assuming that you're using custom properties in the message body for the device identity or measurement timestamp.
3128

@@ -34,9 +31,29 @@ If you're using Azure IoT Hub Device SDKs, you can still use the JsonPathContent
3431
3532
### Examples
3633

34+
With each of these examples, you're provided with:
35+
* A valid IoT device message.
36+
* An example of what the IoT device message will look like after being received and processed by the IoT Hub.
37+
* A valid MedTech service device mapping for normalizing the IoT device message after IoT Hub processing.
38+
* An example of what the MedTech service device message will look like after normalization.
39+
40+
> [!IMPORTANT]
41+
> To avoid device spoofing in device-to-cloud messages, Azure IoT Hub enriches all messages with additional properties. To learn more about these properties, see [Anti-spoofing properties](/azure/iot-hub/iot-hub-devguide-messages-construct#anti-spoofing-properties)
42+
3743
**Heart rate**
3844

39-
*Message*
45+
**A valid IoT device message.**
46+
47+
```json
48+
49+
{“heartrate” : “78”}
50+
51+
```
52+
53+
**An example of what the IoT device message will look like after being received and processed by the IoT Hub.**
54+
55+
> [!NOTE]
56+
> The IoT Hub enriches the device message before sending it to the MedTech service device event hub with all properties starting with **iothub**. For example: **iothub-creation-time-utc**.
4057
4158
```json
4259

@@ -49,12 +66,12 @@ If you're using Azure IoT Hub Device SDKs, you can still use the JsonPathContent
4966
},
5067
"SystemProperties": {
5168
"iothub-connection-device-id" : "device123"
52-
}
53-
}
69+
}
70+
}
5471

5572
```
5673

57-
*Template*
74+
**A valid MedTech service device mapping for normalizing the IoT device message after IoT Hub processing.**
5875

5976
```json
6077

@@ -80,28 +97,60 @@ If you're using Azure IoT Hub Device SDKs, you can still use the JsonPathContent
8097

8198
```
8299

100+
**An example of what the MedTech service device message will look like after the normalization process.**
101+
102+
```json
103+
104+
{
105+
"type": "heartrate",
106+
"occurrenceTimeUtc": "2021-02-01T22:46:01.875Z",
107+
"deviceId": "device123",
108+
"properties": [
109+
{
110+
"name": "hr",
111+
"value": "78"
112+
}
113+
]
114+
}
115+
116+
```
117+
83118
**Blood pressure**
84119

85-
*Message*
120+
**A valid IoT device message.**
121+
122+
```json
123+
124+
{
125+
"systolic": "123",
126+
"diastolic": "87"
127+
}
128+
129+
```
130+
131+
**An example of what the IoT device message will look like after being received and processed by the IoT Hub.**
132+
133+
> [!NOTE]
134+
> The IoT Hub enriches the device message before sending it to the MedTech service device event hub with all properties starting with **iothub**. For example: **iothub-creation-time-utc**.
86135
87136
```json
88137

89138
{
90139
"Body": {
91140
"systolic": "123",
92141
"diastolic" : "87"
93-
},
94-
"Properties": {
95-
"iothub-creation-time-utc" : "2021-02-01T22:46:01.8750000Z"
96-
},
97-
"SystemProperties": {
98-
"iothub-connection-device-id" : "device123"
99-
}
142+
},
143+
"Properties": {
144+
"iothub-creation-time-utc" : "2021-02-01T22:46:01.8750000Z"
145+
},
146+
"SystemProperties": {
147+
"iothub-connection-device-id" : "device123"
148+
}
100149
}
101150

102151
```
103152

104-
*Template*
153+
**A valid MedTech service device mapping for normalizing the IoT device message after IoT Hub processing.**
105154

106155
```json
107156

@@ -132,50 +181,74 @@ If you're using Azure IoT Hub Device SDKs, you can still use the JsonPathContent
132181

133182
```
134183

184+
**An example of what the MedTech service device message will look like after the normalization process.**
185+
186+
```json
187+
188+
{
189+
"type": "bloodpressure",
190+
"occurrenceTimeUtc": "2021-02-01T22:46:01.875Z",
191+
"deviceId": "device123",
192+
"properties": [
193+
{
194+
"name": "systolic",
195+
"value": "123"
196+
},
197+
{
198+
"name": "diastolic",
199+
"value": "87"
200+
}
201+
]
202+
}
203+
204+
```
205+
135206
> [!TIP]
136-
> The above IotJsonPathTemplate examples will work separately with your MedTech service device mapping or you can combine them into a single MedTech service device mapping as shown below. Additionally, the IotJasonPathTemplates can also be combined with with other template types such as [JasonPathContentTemplate mappings](how-to-use-jsonpath-content-mappings.md) to create and tune your MedTech service device mapping to meet your individual needs and scenarios.
207+
> The IotJsonPathTemplate device mapping examples provided in this article may be combined into a single MedTech service device mapping as shown below.
208+
>
209+
> Additionally, the IotJasonPathTemplates can also be combined with with other template types such as [JasonPathContentTemplate mappings](how-to-use-jsonpath-content-mappings.md) to further expand your MedTech service device mapping.
137210
138-
*Template*
211+
**Combined heart rate and blood pressure MedTech service device mapping example.**
139212

140213
```json
141214

142215
{
143-
"templateType": "CollectionContent",
144-
"template": [
145-
{
146-
"templateType": "IotJsonPathContentTemplate",
147-
"template": {
148-
"typeName": "heartrate",
149-
"typeMatchExpression": "$..[?(@Body.heartRate)]",
150-
"values": [
151-
{
152-
"required": "true",
153-
"valueExpression": "$.Body.heartRate",
154-
"valueName": "hr"
155-
}
156-
]
157-
}
216+
"templateType": "CollectionContent",
217+
"template": [
218+
{
219+
"templateType": "IotJsonPathContentTemplate",
220+
"template": {
221+
"typeName": "heartrate",
222+
"typeMatchExpression": "$..[?(@Body.heartRate)]",
223+
"values": [
224+
{
225+
"required": "true",
226+
"valueExpression": "$.Body.heartRate",
227+
"valueName": "hr"
228+
}
229+
]
230+
}
158231
},
159232
{
160-
"templateType": "IotJsonPathContentTemplate",
161-
"template": {
162-
"typeName": "bloodpressure",
163-
"typeMatchExpression": "$..[?(@Body.systolic && @Body.diastolic)]",
164-
"values": [
165-
{
166-
"required": "true",
167-
"valueExpression": "$.Body.systolic",
168-
"valueName": "systolic"
169-
},
170-
{
171-
"required": "true",
172-
"valueExpression": "$.Body.diastolic",
173-
"valueName": "diastolic"
174-
}
175-
]
176-
}
177-
}
178-
]
233+
"templateType": "IotJsonPathContentTemplate",
234+
"template": {
235+
"typeName": "bloodpressure",
236+
"typeMatchExpression": "$..[?(@Body.systolic && @Body.diastolic)]",
237+
"values": [
238+
{
239+
"required": "true",
240+
"valueExpression": "$.Body.systolic",
241+
"valueName": "systolic"
242+
},
243+
{
244+
"required": "true",
245+
"valueExpression": "$.Body.diastolic",
246+
"valueName": "diastolic"
247+
}
248+
]
249+
}
250+
}
251+
]
179252
}
180253

181254
```

0 commit comments

Comments
 (0)