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/how-to-use-custom-functions.md
+2-8Lines changed: 2 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,22 +5,17 @@ author: msjasteppe
5
5
ms.service: healthcare-apis
6
6
ms.subservice: fhir
7
7
ms.topic: how-to
8
-
ms.date: 08/16/2022
8
+
ms.date: 08/30/2022
9
9
ms.author: jasteppe
10
10
---
11
11
12
12
# How to use custom functions
13
13
14
14
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.
15
15
16
-
> [!NOTE]
17
-
>
16
+
> [!TIP]
18
17
> For more information on JmesPath functions, see the JmesPath [specification](https://jmespath.org/specification.html#built-in-functions).
19
18
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
-
24
19
## Function signature
25
20
26
21
Each function has a signature that follows the JmesPath specification. This signature can be represented as:
The signature indicates the valid types for the arguments. If an invalid type is passed in for an argument, an error will occur.
33
28
34
29
> [!NOTE]
35
-
>
36
30
> 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.
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.
4
4
author: msjasteppe
5
5
ms.service: healthcare-apis
6
6
ms.subservice: fhir
7
7
ms.topic: how-to
8
-
ms.date: 03/22/2022
8
+
ms.date: 08/31/2022
9
9
ms.author: jasteppe
10
10
---
11
11
12
12
# How to use IotJsonPathContentTemplate mappings
13
13
14
+
This article describes how to use IoTJsonPathContentTemplate mappings with the MedTech service [device mapping](how-to-use-device-mappings.md).
15
+
14
16
> [!TIP]
15
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.
16
18
17
-
This article describes how to use IoTJsonPathContentTemplate mappings with the MedTech service Device mappings templates.
18
-
19
19
## IotJsonPathContentTemplate
20
20
21
21
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
27
27
>[!IMPORTANT]
28
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.
29
29
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.
31
31
32
32
> [!NOTE]
33
33
> 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
39
39
*Message*
40
40
41
41
```json
42
+
42
43
{
43
44
"Body": {
44
45
"heartRate": "78"
@@ -50,34 +51,37 @@ If you're using Azure IoT Hub Device SDKs, you can still use the JsonPathContent
50
51
"iothub-connection-device-id" : "device123"
51
52
}
52
53
}
54
+
53
55
```
54
56
55
57
*Template*
56
58
57
59
```json
58
60
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
+
74
77
```
75
78
76
79
**Blood pressure**
77
80
78
81
*Message*
79
82
80
83
```json
84
+
81
85
{
82
86
"Body": {
83
87
"systolic": "123",
@@ -90,37 +94,43 @@ If you're using Azure IoT Hub Device SDKs, you can still use the JsonPathContent
> See the MedTech service [troubleshooting guide](./iot-troubleshoot-guide.md) for assistance fixing common errors and issues.
118
128
119
129
## Next steps
120
130
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
122
132
123
133
>[!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)
125
135
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