Skip to content

Commit c32bcf4

Browse files
authored
Merge pull request #209689 from msjasteppe/iot-minor-updates
Minor adjustments based on feedback.
2 parents 1825f1a + d2b5074 commit c32bcf4

File tree

2 files changed

+40
-36
lines changed

2 files changed

+40
-36
lines changed

articles/healthcare-apis/iot/how-to-use-custom-functions.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,17 @@ author: msjasteppe
55
ms.service: healthcare-apis
66
ms.subservice: fhir
77
ms.topic: how-to
8-
ms.date: 08/16/2022
8+
ms.date: 08/30/2022
99
ms.author: jasteppe
1010
---
1111

1212
# How to use custom functions
1313

1414
Many functions are available when using **JmesPath** as the expression language. Besides the functions available as part of the JmesPath specification, many more custom functions may also be used. This article describes the MedTech service-specific custom functions for use with the MedTech service [device mapping](how-to-use-device-mappings.md) during the device message [normalization](iot-data-flow.md#normalize) process.
1515

16-
> [!NOTE]
17-
>
16+
> [!TIP]
1817
> For more information on JmesPath functions, see the JmesPath [specification](https://jmespath.org/specification.html#built-in-functions).
1918
20-
>[!TIP]
21-
>
22-
> 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.
23-
2419
## Function signature
2520

2621
Each function has a signature that follows the JmesPath specification. This signature can be represented as:
@@ -32,7 +27,6 @@ return_type function_name(type $argname)
3227
The signature indicates the valid types for the arguments. If an invalid type is passed in for an argument, an error will occur.
3328

3429
> [!NOTE]
35-
>
3630
> When math-related functions are done, the end result **must** be able to fit within a C# [long](/dotnet/csharp/language-reference/builtin-types/integral-numeric-types#characteristics-of-the-integral-types) value. If the end result in unable to fit within a C# long value, then a mathematical error will occur.
3731
3832
## Exception handling
Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
2-
title: IotJsonPathContentTemplate mappings in MedTech service Device mappings - Azure Health Data Services
3-
description: This article describes how to use IotJsonPathContentTemplate mappings with MedTech service Device mappings templates.
2+
title: IotJsonPathContentTemplate mappings in MedTech service device mapping - Azure Health Data Services
3+
description: This article describes how to use IotJsonPathContentTemplate mappings with MedTech service device mapping.
44
author: msjasteppe
55
ms.service: healthcare-apis
66
ms.subservice: fhir
77
ms.topic: how-to
8-
ms.date: 03/22/2022
8+
ms.date: 08/31/2022
99
ms.author: jasteppe
1010
---
1111

1212
# How to use IotJsonPathContentTemplate mappings
1313

14+
This article describes how to use IoTJsonPathContentTemplate mappings with the MedTech service [device mapping](how-to-use-device-mappings.md).
15+
1416
> [!TIP]
1517
> 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.
1618
17-
This article describes how to use IoTJsonPathContentTemplate mappings with the MedTech service Device mappings templates.
18-
1919
## IotJsonPathContentTemplate
2020

2121
The IotJsonPathContentTemplate is similar to the JsonPathContentTemplate except the `DeviceIdExpression` and `TimestampExpression` aren't required.
@@ -27,7 +27,7 @@ When you're using these SDKs, the device identity and the timestamp of the messa
2727
>[!IMPORTANT]
2828
>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.
2929
30-
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
30+
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.
3131

3232
> [!NOTE]
3333
> When using `IotJsonPathContentTemplate`, the `TypeMatchExpression` should resolve to the entire message as a JToken. For more information, see the following examples:
@@ -39,6 +39,7 @@ If you're using Azure IoT Hub Device SDKs, you can still use the JsonPathContent
3939
*Message*
4040

4141
```json
42+
4243
{
4344
"Body": {
4445
"heartRate": "78"
@@ -50,34 +51,37 @@ If you're using Azure IoT Hub Device SDKs, you can still use the JsonPathContent
5051
"iothub-connection-device-id" : "device123"
5152
}
5253
}
54+
5355
```
5456

5557
*Template*
5658

5759
```json
5860

59-
"templateType": "JsonPathContent",
60-
"template": {
61-
"typeName": "heartrate",
62-
"typeMatchExpression": "$..[?(@Body.heartRate)]",
63-
"deviceIdExpression": "$.deviceId",
64-
"timestampExpression": "$.endDate",
65-
"values": [
66-
{
67-
"required": "true",
68-
"valueExpression": "$.Body.heartRate",
69-
"valueName": "hr"
70-
}
71-
]
72-
}
73-
}
61+
{
62+
"templateType": "IotJsonPathContentTemplate",
63+
"template": {
64+
"typeName": "heartrate",
65+
"typeMatchExpression": "$..[?(@Body.heartRate)]",
66+
"timestampExpression": "$.endDate",
67+
"values": [
68+
{
69+
"required": "true",
70+
"valueExpression": "$.Body.heartRate",
71+
"valueName": "hr"
72+
}
73+
]
74+
}
75+
}
76+
7477
```
7578

7679
**Blood pressure**
7780

7881
*Message*
7982

8083
```json
84+
8185
{
8286
"Body": {
8387
"systolic": "123",
@@ -90,37 +94,43 @@ If you're using Azure IoT Hub Device SDKs, you can still use the JsonPathContent
9094
"iothub-connection-device-id" : "device123"
9195
}
9296
}
97+
9398
```
9499

95100
*Template*
96101

97102
```json
103+
98104
{
105+
"templateType": "IotJsonPathContentTemplate",
106+
"template": {
99107
"typeName": "bloodpressure",
100108
"typeMatchExpression": "$..[?(@Body.systolic && @Body.diastolic)]",
101109
"values": [
102-
{
110+
{
103111
"required": "true",
104112
"valueExpression": "$.Body.systolic",
105113
"valueName": "systolic"
106-
},
107-
{
114+
},
115+
{
108116
"required": "true",
109117
"valueExpression": "$.Body.diastolic",
110118
"valueName": "diastolic"
111-
}
119+
}
112120
]
121+
}
113122
}
123+
114124
```
115125

116126
> [!TIP]
117127
> See the MedTech service [troubleshooting guide](./iot-troubleshoot-guide.md) for assistance fixing common errors and issues.
118128
119129
## Next steps
120130

121-
In this article, you learned how to use Device mappings. To learn how to use FHIR destination mappings, see
131+
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
122132

123133
>[!div class="nextstepaction"]
124-
>[How to use FHIR destination mappings](how-to-use-fhir-mappings.md)
134+
>[How to use FHIR destination mapping](how-to-use-fhir-mappings.md)
125135
126-
(FHIR®) is a registered trademark of [HL7](https://hl7.org/fhir/) and is used with the permission of HL7.
136+
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)