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-calculatedcontent-mappings.md
+50-50Lines changed: 50 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
-
title: How to use CalculatedContentT mappings with the MedTech service device mappings - Azure Health Data Services
3
-
description: This article describes how to use CalculatedContent mappings with the MedTech service device mappings.
2
+
title: How to use CalculatedContent mappings - Azure Health Data Services
3
+
description: Learn how to use CalculatedContent mappings with the MedTech service device mappings.
4
4
author: msjasteppe
5
5
ms.service: healthcare-apis
6
6
ms.subservice: fhir
@@ -11,14 +11,14 @@ ms.author: jasteppe
11
11
12
12
# How to use CalculatedContent mappings
13
13
14
-
This article describes how to use CalculatedContent mappings with MedTech service device mappings.
14
+
This article describes how to use CalculatedContent mappings with MedTech service device mappings in Azure Health Data Services.
15
15
16
-
## CalculatedContent mappings
16
+
## Overview of CalculatedContent mappings
17
17
18
-
The MedTech service provides an expression-based content template to both match the wanted template and extract values. **Expressions** may be used by either JSONPath or JMESPath. Each expression within the template may choose its own expression language.
18
+
The MedTech service provides an expression-based content template to both match the wanted template and extract values. Either JSONPath or JMESPath can use expressions. Each expression within the template can use its own expression language.
19
19
20
20
> [!NOTE]
21
-
> If an expression language isn't defined, the default expression language configured for the template will be used. The default is JSONPath but can be overwritten if needed.
21
+
> If you don't define an expression language, MedTech service device mappings use the default expression language that's configured for the template. The default is JSONPath, but you can overwrite it if necessary.
22
22
23
23
An expression is defined as:
24
24
@@ -29,7 +29,7 @@ An expression is defined as:
29
29
}
30
30
```
31
31
32
-
In the example below, *typeMatchExpression* is defined as:
32
+
In the following example, `typeMatchExpression` is defined as:
33
33
34
34
```json
35
35
"templateType": "CalculatedContent",
@@ -44,7 +44,7 @@ In the example below, *typeMatchExpression* is defined as:
44
44
```
45
45
46
46
> [!TIP]
47
-
> The default expression language to use for a MedTech service device mappings is JsonPath. If you want to use JsonPath, the expression alone may be supplied.
47
+
> If you want to use JSON instead of the default JSONPath expression language, you can supply the expression alone.
48
48
49
49
```json
50
50
"templateType": "CalculatedContent",
@@ -55,7 +55,7 @@ In the example below, *typeMatchExpression* is defined as:
55
55
}
56
56
```
57
57
58
-
The default expression language to use for a MedTech service device mappings can be explicitly set using the `defaultExpressionLanguage` parameter:
58
+
You can explicitly set the default expression language for MedTech service device mappings by using the `defaultExpressionLanguage` parameter:
59
59
60
60
```json
61
61
"templateType": "CalculatedContent",
@@ -67,48 +67,48 @@ The default expression language to use for a MedTech service device mappings can
67
67
}
68
68
```
69
69
70
-
The CalculatedContent mappings allow matching on and extracting values from an Azure Event Hubs message using **Expressions** as defined below:
70
+
CalculatedContent mappings allow matching on, and extracting values from, an Azure Event Hubs message through the following expressions:
71
71
72
72
|Property|Description|Example|
73
73
|--------|-----------|-------|
74
-
|TypeName|The type to associate with measurements that match the template|`heartrate`|
75
-
|TypeMatchExpression|The expression that is evaluated against the EventData payload. If a matching JToken is found, the template is considered a match. All later expressions are evaluated against the extracted JToken matched here.|`$..[?(@heartRate)]`|
76
-
|TimestampExpression|The expression to extract the timestamp value for the measurement's OccurrenceTimeUtc.|`$.matchedToken.endDate`|
77
-
|DeviceIdExpression|The expression to extract the device identifier.|`$.matchedToken.deviceId`|
78
-
|PatientIdExpression|*Required* when IdentityResolution is in **Create** mode and *Optional* when IdentityResolution is in **Lookup** mode. The expression to extract the patient identifier.|`$.matchedToken.patientId`|
79
-
|EncounterIdExpression|*Optional*: The expression to extract the encounter identifier.|`$.matchedToken.encounterId`|
80
-
|CorrelationIdExpression|*Optional*: The expression to extract the correlation identifier. This output can be used to group values into a single observation in the FHIR destination mappings.|`$.matchedToken.correlationId`|
81
-
|Values[].ValueName|The name to associate with the value extracted by the next expression. Used to bind the wanted value/component in the FHIR destinationmapping template.|`hr`|
82
-
|Values[].ValueExpression|The expression to extract the wanted value.|`$.matchedToken.heartRate`|
83
-
|Values[].Required|Will require the value to be present in the payload. If not found, a measurement won't be generated, and an InvalidOperationException will be created.|`true`|
84
-
85
-
###Expression Languages
86
-
87
-
When specifying the language to use for the expression, the below values are valid:
88
-
89
-
| Expression Language| Value |
74
+
|`TypeName`|The type to associate with measurements that match the template.|`heartrate`|
75
+
|`TypeMatchExpression`|The expression that the MedTech service evaluates against the `EventData` payload. If the service finds a matching `JToken` value, it considers the template a match. The service evaluates all later expressions against the extracted `JToken` value matched here.|`$..[?(@heartRate)]`|
76
+
|`TimestampExpression`|The expression to extract the timestamp value for the measurement's `OccurrenceTimeUtc` value.|`$.matchedToken.endDate`|
77
+
|`DeviceIdExpression`|The expression to extract the device identifier.|`$.matchedToken.deviceId`|
78
+
|`PatientIdExpression`|The expression to extract the patient identifier. *Required* when `IdentityResolution` is in `Create` mode, and *optional* when `IdentityResolution` is in `Lookup` mode.|`$.matchedToken.patientId`|
79
+
|`EncounterIdExpression`|*Optional*: The expression to extract the encounter identifier.|`$.matchedToken.encounterId`|
80
+
|`CorrelationIdExpression`|*Optional*: The expression to extract the correlation identifier. You can use this output to group values into a single observation in the FHIR destination mappings.|`$.matchedToken.correlationId`|
81
+
|`Values[].ValueName`|The name to associate with the value that the next expression extracts. Used to bind the wanted value or component in the FHIR destination-mapping template.|`hr`|
82
+
|`Values[].ValueExpression`|The expression to extract the wanted value.|`$.matchedToken.heartRate`|
83
+
|`Values[].Required`|Requires the value to be present in the payload. If the MedTech service doesn't find the value, it won't generate a measurement, and it will create an `InvalidOperationException` instance.|`true`|
84
+
85
+
## Expression languages
86
+
87
+
When you're specifying the language to use for the expression, the following values are valid:
88
+
89
+
| Expression language| Value |
90
90
|---------------------|--------------|
91
-
| JSONPath |**JsonPath**|
92
-
| JMESPath |**JmesPath**|
91
+
| JSONPath |`JsonPath`|
92
+
| JMESPath |`JmesPath`|
93
93
94
94
>[!TIP]
95
-
> For more information on JSONPath, see [JSONPath](https://goessner.net/articles/JsonPath/). CalculatedContent mappings use the [JSON .NET implementation](https://www.newtonsoft.com/json/help/html/QueryJsonSelectTokenJsonPath.htm) for resolving JSONPath expressions.
95
+
> For more information on JSONPath, see [JSONPath - XPath for JSON](https://goessner.net/articles/JsonPath/). CalculatedContent mappings use the [JSON .NET implementation](https://www.newtonsoft.com/json/help/html/QueryJsonSelectTokenJsonPath.htm) for resolving JSONPath expressions.
96
96
>
97
-
> For more information on JMESPath, see [JMESPath](https://jmespath.org/specification.html). CalculatedContent mappings use the [JMESPath .NET implementation](https://github.com/jdevillard/JmesPath.Net) for resolving JMESPath expressions.
97
+
> For more information on JMESPath, see [JMESPath Specification](https://jmespath.org/specification.html). CalculatedContent mappings use the [JMESPath .NET implementation](https://github.com/jdevillard/JmesPath.Net) for resolving JMESPath expressions.
98
98
99
-
###Custom functions
99
+
## Custom functions
100
100
101
-
A set of MedTech service custom functions are also available. The MedTech service custom functions are outside of the functions provided as part of the JMESPath specification. For more information on the MedTech service custom functions, see [How to use MedTech service custom functions](how-to-use-custom-functions.md).
101
+
A set of custom functions for the MedTech service is also available. The MedTech service custom functions are outside the functions provided as part of the JMESPath specification. For more information on the MedTech service custom functions, see [How to use custom functions with device mappings](how-to-use-custom-functions.md).
102
102
103
-
###Matched Token
103
+
## Matched token
104
104
105
-
The **TypeMatchExpression** is evaluated against the incoming EventData payload. If a matching JToken is found, the template is considered a match.
105
+
The MedTech service evaluates `TypeMatchExpression`against the incoming `EventData` payload. If the service finds a matching `JToken` value, it considers the template a match.
106
106
107
-
All later expressions are evaluated against a new JToken. This new JTokencontains both the original EventData payload and the extracted JTokenmatched here.
107
+
The MedTech service evaluates all later expressions against a new `JToken` value. This new `JToken` value contains both the original `EventData` payload and the extracted `JToken` value matched here.
108
108
109
-
In this way, the original payload and the matched object are available to each later expression. The extracted JTokenwill be available as the property **matchedToken**.
109
+
In this way, the original payload and the matched object are available to each later expression. The extracted `JToken` value will be available as the property `matchedToken`.
110
110
111
-
Given this example message:
111
+
Here's an example message:
112
112
113
113
*Message*
114
114
@@ -165,7 +165,7 @@ Given this example message:
165
165
}
166
166
```
167
167
168
-
Two matches will be extracted using the above expression and used to create JTokens. Later expressions will be evaluated using the following JTokens:
168
+
The MedTech service extracts two matches by using the preceding expression and uses them to create `JToken` values. The MedTech service will evaluate later expressions by using the following `JToken` values:
169
169
170
170
```json
171
171
{
@@ -223,9 +223,9 @@ And
223
223
}
224
224
```
225
225
226
-
###Examples
226
+
## Examples
227
227
228
-
**Heart Rate**
228
+
### Heart rate
229
229
230
230
*Message*
231
231
@@ -262,7 +262,7 @@ And
262
262
}
263
263
```
264
264
265
-
**Blood Pressure**
265
+
### Blood pressure
266
266
267
267
*Message*
268
268
@@ -305,7 +305,7 @@ And
305
305
}
306
306
```
307
307
308
-
**Project Multiple Measurements from Single Message**
308
+
### Projection of multiple measurements from a single message
309
309
310
310
*Message*
311
311
@@ -364,7 +364,7 @@ And
364
364
}
365
365
```
366
366
367
-
**Project Multiple Measurements from Array in Message**
367
+
### Projection of multiple measurements from an array in a message
368
368
369
369
*Message*
370
370
@@ -413,7 +413,7 @@ And
413
413
}
414
414
```
415
415
416
-
**Project Data From Matched Token And Original Event**
416
+
### Projection of data from a matched token and an original event
417
417
418
418
*Message*
419
419
@@ -465,9 +465,9 @@ And
465
465
}
466
466
```
467
467
468
-
**Select and transform incoming data**
468
+
### Selection and transformation of incoming data
469
469
470
-
In the below example, height data arrives in either inches or meters. We want all normalized height data to be in meters. To achieve this outcome, we create a template that targets only height data in inches and transforms it into meters. Another template targets height data in meters and simply stores it as is.
470
+
In the following example, height data arrives in either inches or meters. Assume that you want all normalized height data to be in meters. To achieve this outcome, you create a template that targets only height data in inches and transforms it into meters. Another template targets height data in meters and simply stores it as is.
471
471
472
472
*Message*
473
473
@@ -538,15 +538,15 @@ In the below example, height data arrives in either inches or meters. We want al
538
538
```
539
539
540
540
> [!TIP]
541
-
> See the MedTech service article [Troubleshoot MedTech service errors](troubleshoot-errors.md) for assistance fixing MedTech service errors.
541
+
> For assistance in fixing MedTech service errors, see [Troubleshoot MedTech service errors](troubleshoot-errors.md).
542
542
543
543
## Next steps
544
544
545
-
In this article, you learned how to configure the MedTech service device mappings using CalculatedContent mappings.
545
+
In this article, you learned how to configure MedTech service device mappings by using CalculatedContent mappings.
546
546
547
-
To learn how to configure FHIR destination mappings, see
547
+
To learn how to configure FHIR destination mappings, see:
548
548
549
549
> [!div class="nextstepaction"]
550
550
> [How to configure FHIR destination mappings](how-to-configure-fhir-mappings.md)
551
551
552
-
(FHIR®) is a registered trademark of Health Level Seven International, registered in the U.S. Trademark Office and is used with their permission.
552
+
FHIR® is a registered trademark of Health Level Seven International, registered in the U.S. Trademark Office, and is used with permission.
0 commit comments