Skip to content

Commit b2b0a38

Browse files
authored
Merge pull request #210255 from msjasteppe/iot-hub-updates
Updating templates and additional verbiage.
2 parents 11daeb2 + 2bf84db commit b2b0a38

File tree

1 file changed

+92
-34
lines changed

1 file changed

+92
-34
lines changed

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

Lines changed: 92 additions & 34 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: 09/02/2022
8+
ms.date: 09/06/2022
99
ms.author: jasteppe
1010
---
1111

@@ -41,8 +41,8 @@ If you're using Azure IoT Hub Device SDKs, you can still use the JsonPathContent
4141
```json
4242

4343
{
44-
"Body": {
45-
"heartRate": "78"
44+
"Body": {
45+
"heartRate": "78"
4646
},
4747
"Properties": {
4848
"iothub-creation-time-utc" : "2021-02-01T22:46:01.8750000Z"
@@ -59,19 +59,24 @@ If you're using Azure IoT Hub Device SDKs, you can still use the JsonPathContent
5959
```json
6060

6161
{
62-
"templateType": "IotJsonPathContentTemplate",
63-
"template": {
64-
"typeName": "heartrate",
65-
"typeMatchExpression": "$..[?(@Body.heartRate)]"
66-
"values": [
62+
"templateType": "CollectionContent",
63+
"template": [
6764
{
68-
"required": "true",
69-
"valueExpression": "$.Body.heartRate",
70-
"valueName": "hr"
65+
"templateType": "IotJsonPathContentTemplate",
66+
"template": {
67+
"typeName": "heartrate",
68+
"typeMatchExpression": "$..[?(@Body.heartRate)]",
69+
"values": [
70+
{
71+
"required": "true",
72+
"valueExpression": "$.Body.heartRate",
73+
"valueName": "hr"
74+
}
75+
]
7176
}
72-
]
73-
}
74-
}
77+
}
78+
]
79+
}
7580

7681
```
7782

@@ -82,42 +87,95 @@ If you're using Azure IoT Hub Device SDKs, you can still use the JsonPathContent
8287
```json
8388

8489
{
85-
"Body": {
86-
"systolic": "123",
87-
"diastolic" : "87"
88-
},
89-
"Properties": {
90-
"iothub-creation-time-utc" : "2021-02-01T22:46:01.8750000Z"
91-
},
92-
"SystemProperties": {
93-
"iothub-connection-device-id" : "device123"
90+
"Body": {
91+
"systolic": "123",
92+
"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+
}
100+
}
101+
102+
```
103+
104+
*Template*
105+
106+
```json
107+
108+
{
109+
"templateType": "CollectionContent",
110+
"template": [
111+
{
112+
"templateType": "IotJsonPathContentTemplate",
113+
"template": {
114+
"typeName": "bloodpressure",
115+
"typeMatchExpression": "$..[?(@Body.systolic && @Body.diastolic)]",
116+
"values": [
117+
{
118+
"required": "true",
119+
"valueExpression": "$.Body.systolic",
120+
"valueName": "systolic"
121+
},
122+
{
123+
"required": "true",
124+
"valueExpression": "$.Body.diastolic",
125+
"valueName": "diastolic"
126+
}
127+
]
128+
}
94129
}
130+
]
95131
}
96132

97133
```
98134

135+
> [!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.
137+
99138
*Template*
100139

101140
```json
102141

103142
{
104-
"templateType": "IotJsonPathContentTemplate",
105-
"template": {
106-
"typeName": "bloodpressure",
107-
"typeMatchExpression": "$..[?(@Body.systolic && @Body.diastolic)]",
108-
"values": [
109-
{
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+
}
158+
},
159+
{
160+
"templateType": "IotJsonPathContentTemplate",
161+
"template": {
162+
"typeName": "bloodpressure",
163+
"typeMatchExpression": "$..[?(@Body.systolic && @Body.diastolic)]",
164+
"values": [
165+
{
110166
"required": "true",
111167
"valueExpression": "$.Body.systolic",
112168
"valueName": "systolic"
113-
},
114-
{
169+
},
170+
{
115171
"required": "true",
116172
"valueExpression": "$.Body.diastolic",
117173
"valueName": "diastolic"
174+
}
175+
]
118176
}
119-
]
120-
}
177+
}
178+
]
121179
}
122180

123181
```
@@ -130,6 +188,6 @@ If you're using Azure IoT Hub Device SDKs, you can still use the JsonPathContent
130188
In this article, you learned how to use IotJsonPathContentTemplate mappings with the MedTech service device mapping. To learn how to use MedTech service FHIR destination mapping, see
131189

132190
>[!div class="nextstepaction"]
133-
>[How to use FHIR destination mapping](how-to-use-fhir-mappings.md)
191+
>[How to use the FHIR destination mapping](how-to-use-fhir-mappings.md)
134192
135193
FHIR® is a registered trademark of Health Level Seven International, registered in the U.S. Trademark Office and is used with their permission.

0 commit comments

Comments
 (0)