Skip to content

Commit 78d9824

Browse files
Merge pull request #246272 from msjasteppe/iotjsonpathcontent-updates
Fixing JSON examples
2 parents 8a52b94 + b4c85b3 commit 78d9824

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

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

Lines changed: 22 additions & 18 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/20/2023
8+
ms.date: 07/25/2023
99
ms.author: jasteppe
1010
---
1111

@@ -89,7 +89,8 @@ In this example, we're using a device message that is capturing `heartRate` data
8989

9090
```json
9191
{
92-
"heartRate" : "78"
92+
"PatientId": "patient1",
93+
"HeartRate" : "78"
9394
}
9495
```
9596

@@ -103,13 +104,15 @@ The IoT hub enriches and routes the device message to the event hub before the M
103104
```json
104105
{
105106
"Body": {
106-
"heartRate": "78"
107-
},
108-
"Properties": {
109-
"iothub-creation-time-utc": "2023-03-13T22:46:01.87500000"
107+
"PatientId": "patient1",
108+
"HeartRate": 78
110109
},
111110
"SystemProperties": {
112-
"iothub-connection-device-id": "device01"
111+
"iothub-enqueuedtime": "2023-07-25T20:41:26.046Z",
112+
"iothub-connection-device-id": "sampleDeviceId"
113+
},
114+
"Properties": {
115+
"iothub-creation-time-utc": "2023-07-25T20:41:26.046Z"
113116
}
114117
}
115118
```
@@ -122,32 +125,33 @@ We're using this device mapping for the normalization stage:
122125
{
123126
"templateType": "IotJsonPathContent",
124127
"template": {
125-
"typeName": "heartRate",
126-
"typeMatchExpression": "$..[?(@Body.heartRate)]",
127-
"patientIdExpression": "$.SystemProperties.iothub-connection-device-id",
128+
"typeName": "HeartRate",
129+
"typeMatchExpression": "$..[?(@Body.HeartRate)]",
130+
"patientIdExpression": "$.Body.PatientId",
128131
"values": [
129132
{
130-
"required": "true",
131-
"valueExpression": "$.Body.heartRate",
132-
"valueName": "hr"
133+
"required": true,
134+
"valueExpression": "$.Body.HeartRate",
135+
"valueName": "HeartRate"
133136
}
134137
]
135138
}
136139
}
137-
]
140+
]
138141
}
139142
```
140143

141144
The resulting normalized message will look like this after the normalization stage:
142145

143146
```json
144147
{
145-
"type": "heartRate",
146-
"occurrenceTimeUtc": "2023-03-13T22:46:01.875Z",
147-
"deviceId": "device01",
148+
"type": "HeartRate",
149+
"occurrenceTimeUtc": "2023-07-25T20:41:26.046Z",
150+
"deviceId": "sampleDeviceId",
151+
"patientId": "patient1",
148152
"properties": [
149153
{
150-
"name": "hr",
154+
"name": "HeartRate",
151155
"value": "78"
152156
}
153157
]

0 commit comments

Comments
 (0)