Skip to content

Commit 79f18a3

Browse files
authored
Merge pull request #228044 from ShawnJackson/how-to-use-calculatedcontent-mappings
[AQ] edit pass: how-to-use-calculatedcontent-mappings
2 parents a4e1245 + adfb39c commit 79f18a3

File tree

1 file changed

+50
-50
lines changed

1 file changed

+50
-50
lines changed

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

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
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.
44
author: msjasteppe
55
ms.service: healthcare-apis
66
ms.subservice: fhir
@@ -11,14 +11,14 @@ ms.author: jasteppe
1111

1212
# How to use CalculatedContent mappings
1313

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.
1515

16-
## CalculatedContent mappings
16+
## Overview of CalculatedContent mappings
1717

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.
1919

2020
> [!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.
2222
2323
An expression is defined as:
2424

@@ -29,7 +29,7 @@ An expression is defined as:
2929
}
3030
```
3131

32-
In the example below, *typeMatchExpression* is defined as:
32+
In the following example, `typeMatchExpression` is defined as:
3333

3434
```json
3535
"templateType": "CalculatedContent",
@@ -44,7 +44,7 @@ In the example below, *typeMatchExpression* is defined as:
4444
```
4545

4646
> [!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.
4848
4949
```json
5050
"templateType": "CalculatedContent",
@@ -55,7 +55,7 @@ In the example below, *typeMatchExpression* is defined as:
5555
}
5656
```
5757

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:
5959

6060
```json
6161
"templateType": "CalculatedContent",
@@ -67,48 +67,48 @@ The default expression language to use for a MedTech service device mappings can
6767
}
6868
```
6969

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:
7171

7272
|Property|Description|Example|
7373
|--------|-----------|-------|
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 destination mapping 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 |
9090
|---------------------|--------------|
91-
| JSONPath | **JsonPath** |
92-
| JMESPath | **JmesPath** |
91+
| JSONPath | `JsonPath` |
92+
| JMESPath | `JmesPath` |
9393

9494
>[!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.
9696
>
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.
9898
99-
### Custom functions
99+
## Custom functions
100100

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).
102102

103-
### Matched Token
103+
## Matched token
104104

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.
106106

107-
All later expressions are evaluated against a new JToken. This new JToken contains both the original EventData payload and the extracted JToken matched 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.
108108

109-
In this way, the original payload and the matched object are available to each later expression. The extracted JToken will 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`.
110110

111-
Given this example message:
111+
Here's an example message:
112112

113113
*Message*
114114

@@ -165,7 +165,7 @@ Given this example message:
165165
}
166166
```
167167

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:
169169

170170
```json
171171
{
@@ -223,9 +223,9 @@ And
223223
}
224224
```
225225

226-
### Examples
226+
## Examples
227227

228-
**Heart Rate**
228+
### Heart rate
229229

230230
*Message*
231231

@@ -262,7 +262,7 @@ And
262262
}
263263
```
264264

265-
**Blood Pressure**
265+
### Blood pressure
266266

267267
*Message*
268268

@@ -305,7 +305,7 @@ And
305305
}
306306
```
307307

308-
**Project Multiple Measurements from Single Message**
308+
### Projection of multiple measurements from a single message
309309

310310
*Message*
311311

@@ -364,7 +364,7 @@ And
364364
}
365365
```
366366

367-
**Project Multiple Measurements from Array in Message**
367+
### Projection of multiple measurements from an array in a message
368368

369369
*Message*
370370

@@ -413,7 +413,7 @@ And
413413
}
414414
```
415415

416-
**Project Data From Matched Token And Original Event**
416+
### Projection of data from a matched token and an original event
417417

418418
*Message*
419419

@@ -465,9 +465,9 @@ And
465465
}
466466
```
467467

468-
**Select and transform incoming data**
468+
### Selection and transformation of incoming data
469469

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.
471471

472472
*Message*
473473

@@ -538,15 +538,15 @@ In the below example, height data arrives in either inches or meters. We want al
538538
```
539539

540540
> [!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).
542542
543543
## Next steps
544544

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.
546546

547-
To learn how to configure FHIR destination mappings, see
547+
To learn how to configure FHIR destination mappings, see:
548548

549549
> [!div class="nextstepaction"]
550550
> [How to configure FHIR destination mappings](how-to-configure-fhir-mappings.md)
551551
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

Comments
 (0)