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: docs/runtime_suite/therapy-and-monitoring-manager/10_overview.md
+55-17Lines changed: 55 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -177,7 +177,7 @@ For each prototype you need to define:
177
177
- the name;
178
178
- the schema;
179
179
- the labels for the schema fields (**required** only if you use the TMM with the companion FE component);
180
-
- the values for the schema fields (**required** only if you use the TMM with the companion FE component);
180
+
- the values for the schema fields;
181
181
- the hints for the schema fields (only for therapy directives, should provide a list of admitted or suggested values for a schema field).
182
182
183
183
TMM supports localization for `name`, `labels` and `hints`, using a syntax like the following (`en` is ISO 639-1 language code for English, `it` for Italian):
@@ -423,48 +423,86 @@ The integrated validation system currently supports the following threshold vali
423
423
}
424
424
```
425
425
426
-
:::warning
426
+
:::danger
427
+
428
+
The integrated validation system is designed under two assumptions.
429
+
430
+
- The property of the detection referred by a threshold contains one or two numeric values; if the value is not a number or an array of two numbers, depending on the operator, an error is returned.
431
+
- The `propertyName` is treated as the path of the field in the detection containing the value to compare against the threshold, unless a different path is specified under prototype `values`; see the next section for more information.
432
+
433
+
:::
434
+
435
+
Additional information about the API requirements and the setup of the external validation service are available in the [*Configuration* section][thresholds-validation].
436
+
437
+
### Threshold evaluation
438
+
439
+
When a detection is submitted, its value is checked against each threshold defined in the associated monitoring plan.
427
440
428
-
The value of the `propertyName` should be the path to the value of the specific attributes in the prototype schema. If your schema is not a plan object you can use the `values` on the prototype to specify the path.
429
-
Here you can find the examples:
441
+
In this context, the threshold `propertyName` is treated as the path of the field in the detection `value` object containing the numeric value to be validated.
442
+
443
+
So, given a threshold looking like this:
444
+
445
+
```json
446
+
{
447
+
"propertyName": "systolicBloodPresure",
448
+
"thresholdOperator": "gt",
449
+
"thresholdValue": 130
450
+
}
451
+
```
452
+
453
+
and a detection looking like this:
430
454
431
-
- If you have a plane object the `propertyName` will be simply equal to that record like `systolicBloodPresure` or `diastolicBloodPresure`.
432
455
```json
433
456
{
434
457
"systolicBloodPresure": 120,
435
-
"diastolicBloodPresure": 66
458
+
"diastolicBloodPresure": 75
436
459
}
437
460
```
438
461
439
-
- If you have a a complicated schema the `propertyName` should be equal to that path of the value like `observations[0].value` for `systolicBloodPresure` and `observations[1].value` for the value of `diastolicBloodPresure`.
462
+
the TMM can assert that the `systolicBloodPresure` has a safe value, since `120` is lower than `130`.
463
+
464
+
If your schema is not a plain object, but for example has array and/or nested fields, we recommend using the `values` field on the prototype to map the `propertyName` to the actual `path` and make the prototype configuration more human readable.
465
+
466
+
So, given the same threshold as before and a detection looking like this:
467
+
440
468
```json
441
469
{
442
470
"period": {
443
-
"startDate": "2024-01-01"
471
+
"start": "2024-01-07T19:10:00Z",
444
472
},
445
473
"observations": [
446
474
{
447
-
"code": "systolicBloodPresure",
475
+
"name": "Diastolic blood pressure",
448
476
"unit": "mmHg",
449
-
"value": 120
477
+
"value": 75
450
478
},
451
479
{
452
-
"code": "diastolicBloodPresure",
480
+
"name": "Systolic blood pressure",
453
481
"unit": "mmHg",
454
-
"value": 66
482
+
"value": 120
455
483
}
456
484
]
457
485
}
458
486
```
459
-
:::
460
487
461
-
:::danger
488
+
you can add the following `values` to the prototype:
462
489
463
-
The integrated validation system is designed under the assumption that the property of the detection value referred by a threshold contains one or two numeric values. If the value is not a number or an array of two numbers, depending on the operator, an error is returned.
490
+
```json
491
+
{
492
+
"values": {
493
+
"diastolicBloodPresure": {
494
+
"path": "observations[0].value"
495
+
},
496
+
"systolicBloodPresure": {
497
+
"path": "observations[1].value"
498
+
}
499
+
}
500
+
}
501
+
```
464
502
465
-
:::
503
+
which is basically a way to tell the TMM that the values of the `diastolicBloodPresure` and `systolicBloodPresure` properties can be found in the `value` field of the first and second object inside the `observations` array field, respectively.
466
504
467
-
Additional information about the API requirements and the setup of the external validation service are available in the [*Configuration* section][thresholds-validation].
505
+
When the TMM needs to compare a detection against a thresholds, it first performs a lookup on the prototype `values` based on the threshold `propertyName`: if there is a match, like in our example for `systolicBloodPresure`, the TMM gets the value from the detection at the path specified in the `path` field of the prototype value (in our case `observations[1].value`).
Copy file name to clipboardExpand all lines: docs/runtime_suite/therapy-and-monitoring-manager/20_configuration.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -182,7 +182,7 @@ Note that, modifying an identifier in an already running system can lead to inco
182
182
183
183
***Labels**: the labels for the schema fields, each one can be a string or translation object.
184
184
185
-
***values**: the values for the schema fields, each one must be an object containing the path of the field in the detection value containing the corresponding value to compare against the thresholds.
185
+
***Values**: the values for the schema fields, each one must be an object containing the path of the field in the detections containing the value to compare against the thresholds.
186
186
187
187
***Hints**: the hints for the schema fields, each one can be a string or translation object. This is only supported by therapy directives, to provide a list of admitted or suggested values for the field.
188
188
@@ -348,12 +348,12 @@ By default, the TMM does not validate detections against the thresholds. If you
348
348
349
349
- set the TMM **VALIDATION_SERVICE**[environment variable][environment-variables] to `internal` or `external`;
350
350
- if you are using an external service:
351
-
- deploy a custom microservice exposing a HTTP API following the specifications provided in the [section below][external-validation-service-api];
351
+
- deploy a custom microservice exposing a HTTP API following the specifications provided in the [section below][external-validation];
352
352
- set the TMM **VALIDATION_SERVICE_URL**[environment variable][environment-variables] to the HTTP(s) address of your service (both public and internal cluster URLs will work).
353
353
354
-
### External Validation Service API
354
+
### External validation
355
355
356
-
The External Validation Service must expose the following endpoints:
356
+
The External validation relies on a service exposing an HTTP interface with the the following endpoints:
357
357
358
358
-`POST /validations/` to validate a detection against the monitoring thresholds.
359
359
@@ -405,6 +405,6 @@ The TMM currently generates the following events you can refer in the configurat
Copy file name to clipboardExpand all lines: docs/runtime_suite/therapy-and-monitoring-manager/30_usage.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ The therapy data model add the concept of `directives`, which is an object follo
58
58
59
59
The monitoring data model add the concept of `notes` and `thresholds`. The notes field contains the physician prescriptions, while a threshold is an object with the following properties:
60
60
61
-
*`propertyName`: name of the property on which the threshold is evaluated;
61
+
*`propertyName`: name of the property on which the threshold is evaluated; it should correspond to the path of the detection field containing the value to compare against the threshold, if your detection have nested or array fields you should specify the mapping between the `propertyName` and its path under the prototype `values` field (more details in the [Overview section][threshold-evaluation]);
62
62
*`thresholdOperator`: operator to use in the threshold evaluation. Available options are: `gt`, `lt`, `gte`, `lte`, `eq`, `between`, `notBetween`;
63
63
*`thresholdValue`: the value with which to evaluate the threshold (a single number for `gt`, `lt`, `gte`, `lte` and `eq` operators, an array of two numbers indicating a range for the `between` and `notBetween` operators).
64
64
@@ -946,6 +946,7 @@ The computation is performed for each plan according to the following algorithm,
946
946
947
947
[overview]: ./10_overview.md"Overview page"
948
948
[adherence-compliance]: ./10_overview.md#adherence-and-compliance"Adherence and compliance | Overview"
Copy file name to clipboardExpand all lines: docs/runtime_suite/therapy-and-monitoring-manager/40_migration.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,12 @@ Instead, modify the source file and run the aggregator to regenerate this file.
12
12
13
13
This document provides information to migrate from a previous version of the service.
14
14
15
+
## 0.5.1
16
+
17
+
No change required from previous version.
18
+
19
+
If you use the [`ck-threshold-modal` Care Kit component][care-kit-ck-threshold-modal] and any of your prototypes includes the `values` field, please note that this version of the TMM is not compatible with Care Kit v2.9.0.
20
+
15
21
## 0.5.0
16
22
17
23
### CRUD collections
@@ -42,3 +48,5 @@ Add the following fields to the [detections CRUD collection][crud-detections]:
0 commit comments