@tellescope/sdk 1.89.1 → 1.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/tests/tests.js +382 -31
- package/lib/cjs/tests/tests.js.map +1 -1
- package/lib/esm/tests/tests.js +382 -31
- package/lib/esm/tests/tests.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/tests/tests.ts +316 -3
- package/test_generated.pdf +0 -0
package/lib/cjs/tests/tests.js
CHANGED
|
@@ -8351,7 +8351,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8351
8351
|
var e, configurations, triggers;
|
|
8352
8352
|
return __generator(this, function (_b) {
|
|
8353
8353
|
switch (_b.label) {
|
|
8354
|
-
case 0: return [4 /*yield*/, sdk.api.endusers.createOne({})];
|
|
8354
|
+
case 0: return [4 /*yield*/, sdk.api.endusers.createOne({ weight: { unit: 'LB', value: 180 } })];
|
|
8355
8355
|
case 1:
|
|
8356
8356
|
e = _b.sent();
|
|
8357
8357
|
return [4 /*yield*/, sdk.api.vital_configurations.createSome(_configurations.map(function (c, i) { return (__assign({ title: "configuration ".concat(i) }, c)); }))];
|
|
@@ -8390,6 +8390,327 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8390
8390
|
});
|
|
8391
8391
|
});
|
|
8392
8392
|
};
|
|
8393
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8394
|
+
title: "Any Meal Passing (Unset)",
|
|
8395
|
+
shouldTrigger: true,
|
|
8396
|
+
configurations: [{
|
|
8397
|
+
unit: 'mg/dL',
|
|
8398
|
+
// no meal status
|
|
8399
|
+
// mealStatus: 'Before',
|
|
8400
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8401
|
+
}],
|
|
8402
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8403
|
+
vitals: [{
|
|
8404
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8405
|
+
timestamp: new Date(),
|
|
8406
|
+
}]
|
|
8407
|
+
})];
|
|
8408
|
+
case 1:
|
|
8409
|
+
_a.sent();
|
|
8410
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8411
|
+
title: "Any Meal Passing (Unset) [Before]",
|
|
8412
|
+
shouldTrigger: true,
|
|
8413
|
+
configurations: [{
|
|
8414
|
+
unit: 'mg/dL',
|
|
8415
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8416
|
+
}],
|
|
8417
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8418
|
+
vitals: [{
|
|
8419
|
+
beforeMeal: true,
|
|
8420
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8421
|
+
timestamp: new Date(),
|
|
8422
|
+
}]
|
|
8423
|
+
})];
|
|
8424
|
+
case 2:
|
|
8425
|
+
_a.sent();
|
|
8426
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8427
|
+
title: "Any Meal Passing (Unset) [After]",
|
|
8428
|
+
shouldTrigger: true,
|
|
8429
|
+
configurations: [{
|
|
8430
|
+
unit: 'mg/dL',
|
|
8431
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8432
|
+
}],
|
|
8433
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8434
|
+
vitals: [{
|
|
8435
|
+
beforeMeal: false,
|
|
8436
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8437
|
+
timestamp: new Date(),
|
|
8438
|
+
}]
|
|
8439
|
+
})];
|
|
8440
|
+
case 3:
|
|
8441
|
+
_a.sent();
|
|
8442
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8443
|
+
title: "Any Meal Passing",
|
|
8444
|
+
shouldTrigger: true,
|
|
8445
|
+
configurations: [{
|
|
8446
|
+
unit: 'mg/dL',
|
|
8447
|
+
mealStatus: 'Any',
|
|
8448
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8449
|
+
}],
|
|
8450
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8451
|
+
vitals: [{
|
|
8452
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8453
|
+
timestamp: new Date(),
|
|
8454
|
+
}]
|
|
8455
|
+
})];
|
|
8456
|
+
case 4:
|
|
8457
|
+
_a.sent();
|
|
8458
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8459
|
+
title: "Before Meal Passing",
|
|
8460
|
+
shouldTrigger: true,
|
|
8461
|
+
configurations: [{
|
|
8462
|
+
unit: 'mg/dL',
|
|
8463
|
+
mealStatus: 'Before',
|
|
8464
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8465
|
+
}],
|
|
8466
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8467
|
+
vitals: [{
|
|
8468
|
+
beforeMeal: true,
|
|
8469
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8470
|
+
timestamp: new Date(),
|
|
8471
|
+
}]
|
|
8472
|
+
})];
|
|
8473
|
+
case 5:
|
|
8474
|
+
_a.sent();
|
|
8475
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8476
|
+
title: "Before Meal Failing (omitted)",
|
|
8477
|
+
shouldTrigger: false,
|
|
8478
|
+
configurations: [{
|
|
8479
|
+
unit: 'mg/dL',
|
|
8480
|
+
mealStatus: 'Before',
|
|
8481
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8482
|
+
}],
|
|
8483
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8484
|
+
vitals: [{
|
|
8485
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8486
|
+
timestamp: new Date(),
|
|
8487
|
+
}]
|
|
8488
|
+
})];
|
|
8489
|
+
case 6:
|
|
8490
|
+
_a.sent();
|
|
8491
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8492
|
+
title: "Before Meal Failing",
|
|
8493
|
+
shouldTrigger: false,
|
|
8494
|
+
configurations: [{
|
|
8495
|
+
unit: 'mg/dL',
|
|
8496
|
+
mealStatus: 'Before',
|
|
8497
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8498
|
+
}],
|
|
8499
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8500
|
+
vitals: [{
|
|
8501
|
+
beforeMeal: false,
|
|
8502
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8503
|
+
timestamp: new Date(),
|
|
8504
|
+
}]
|
|
8505
|
+
})];
|
|
8506
|
+
case 7:
|
|
8507
|
+
_a.sent();
|
|
8508
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8509
|
+
title: "After Meal Passing",
|
|
8510
|
+
shouldTrigger: true,
|
|
8511
|
+
configurations: [{
|
|
8512
|
+
unit: 'mg/dL',
|
|
8513
|
+
mealStatus: 'After',
|
|
8514
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8515
|
+
}],
|
|
8516
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8517
|
+
vitals: [{
|
|
8518
|
+
beforeMeal: false,
|
|
8519
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8520
|
+
timestamp: new Date(),
|
|
8521
|
+
}]
|
|
8522
|
+
})];
|
|
8523
|
+
case 8:
|
|
8524
|
+
_a.sent();
|
|
8525
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8526
|
+
title: "After Meal Failing (omitted)",
|
|
8527
|
+
shouldTrigger: false,
|
|
8528
|
+
configurations: [{
|
|
8529
|
+
unit: 'mg/dL',
|
|
8530
|
+
mealStatus: 'After',
|
|
8531
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8532
|
+
}],
|
|
8533
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8534
|
+
vitals: [{
|
|
8535
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8536
|
+
timestamp: new Date(),
|
|
8537
|
+
}]
|
|
8538
|
+
})];
|
|
8539
|
+
case 9:
|
|
8540
|
+
_a.sent();
|
|
8541
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8542
|
+
title: "After Meal Failing",
|
|
8543
|
+
shouldTrigger: false,
|
|
8544
|
+
configurations: [{
|
|
8545
|
+
unit: 'mg/dL',
|
|
8546
|
+
mealStatus: 'After',
|
|
8547
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8548
|
+
}],
|
|
8549
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8550
|
+
vitals: [{
|
|
8551
|
+
beforeMeal: true,
|
|
8552
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8553
|
+
timestamp: new Date(),
|
|
8554
|
+
}]
|
|
8555
|
+
})];
|
|
8556
|
+
case 10:
|
|
8557
|
+
_a.sent();
|
|
8558
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8559
|
+
title: "Before meal trend passing",
|
|
8560
|
+
shouldTrigger: true,
|
|
8561
|
+
configurations: [{
|
|
8562
|
+
mealStatus: 'Before',
|
|
8563
|
+
unit: 'mg/dL',
|
|
8564
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Less Than', value: 1 }, trendIntervalInMS: 1000 },],
|
|
8565
|
+
}],
|
|
8566
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8567
|
+
vitals: [
|
|
8568
|
+
{ beforeMeal: true, measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date() },
|
|
8569
|
+
{ beforeMeal: true, measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
8570
|
+
]
|
|
8571
|
+
})];
|
|
8572
|
+
case 11:
|
|
8573
|
+
_a.sent();
|
|
8574
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8575
|
+
title: "Before meal trend failing, undefined",
|
|
8576
|
+
shouldTrigger: false,
|
|
8577
|
+
configurations: [{
|
|
8578
|
+
mealStatus: 'Before',
|
|
8579
|
+
unit: 'mg/dL',
|
|
8580
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Less Than', value: 1 }, trendIntervalInMS: 1000 },],
|
|
8581
|
+
}],
|
|
8582
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8583
|
+
vitals: [
|
|
8584
|
+
{ measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date() },
|
|
8585
|
+
{ measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
8586
|
+
]
|
|
8587
|
+
})];
|
|
8588
|
+
case 12:
|
|
8589
|
+
_a.sent();
|
|
8590
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8591
|
+
title: "Before meal trend failing",
|
|
8592
|
+
shouldTrigger: false,
|
|
8593
|
+
configurations: [{
|
|
8594
|
+
mealStatus: 'Before',
|
|
8595
|
+
unit: 'mg/dL',
|
|
8596
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Less Than', value: 1 }, trendIntervalInMS: 1000 },],
|
|
8597
|
+
}],
|
|
8598
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8599
|
+
vitals: [
|
|
8600
|
+
{ beforeMeal: false, measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date() },
|
|
8601
|
+
{ beforeMeal: false, measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
8602
|
+
]
|
|
8603
|
+
})];
|
|
8604
|
+
case 13:
|
|
8605
|
+
_a.sent();
|
|
8606
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8607
|
+
title: "After meal trend passing",
|
|
8608
|
+
shouldTrigger: true,
|
|
8609
|
+
configurations: [{
|
|
8610
|
+
mealStatus: 'After',
|
|
8611
|
+
unit: 'mg/dL',
|
|
8612
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Less Than', value: 1 }, trendIntervalInMS: 1000 },],
|
|
8613
|
+
}],
|
|
8614
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8615
|
+
vitals: [
|
|
8616
|
+
{ beforeMeal: false, measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date() },
|
|
8617
|
+
{ beforeMeal: false, measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
8618
|
+
]
|
|
8619
|
+
})];
|
|
8620
|
+
case 14:
|
|
8621
|
+
_a.sent();
|
|
8622
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8623
|
+
title: "After meal trend failing, undefined",
|
|
8624
|
+
shouldTrigger: false,
|
|
8625
|
+
configurations: [{
|
|
8626
|
+
mealStatus: 'After',
|
|
8627
|
+
unit: 'mg/dL',
|
|
8628
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Less Than', value: 1 }, trendIntervalInMS: 1000 },],
|
|
8629
|
+
}],
|
|
8630
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8631
|
+
vitals: [
|
|
8632
|
+
{ measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date() },
|
|
8633
|
+
{ measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
8634
|
+
]
|
|
8635
|
+
})];
|
|
8636
|
+
case 15:
|
|
8637
|
+
_a.sent();
|
|
8638
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8639
|
+
title: "After meal trend failing",
|
|
8640
|
+
shouldTrigger: false,
|
|
8641
|
+
configurations: [{
|
|
8642
|
+
mealStatus: 'After',
|
|
8643
|
+
unit: 'mg/dL',
|
|
8644
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Less Than', value: 1 }, trendIntervalInMS: 1000 },],
|
|
8645
|
+
}],
|
|
8646
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8647
|
+
vitals: [
|
|
8648
|
+
{ beforeMeal: true, measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date() },
|
|
8649
|
+
{ beforeMeal: true, measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
8650
|
+
]
|
|
8651
|
+
})];
|
|
8652
|
+
case 16:
|
|
8653
|
+
_a.sent();
|
|
8654
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8655
|
+
title: "Weight Trend from Profile (positive, not enough)",
|
|
8656
|
+
shouldTrigger: false,
|
|
8657
|
+
configurations: [{
|
|
8658
|
+
unit: 'LB',
|
|
8659
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, deviationFromProfileWeight: true, trendIntervalInMS: 0 },],
|
|
8660
|
+
}],
|
|
8661
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8662
|
+
vitals: [{
|
|
8663
|
+
measurement: { unit: 'LB', value: 180 },
|
|
8664
|
+
timestamp: new Date(),
|
|
8665
|
+
}]
|
|
8666
|
+
})];
|
|
8667
|
+
case 17:
|
|
8668
|
+
_a.sent();
|
|
8669
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8670
|
+
title: "Weight Trend from Profile (negative, not enough)",
|
|
8671
|
+
shouldTrigger: false,
|
|
8672
|
+
configurations: [{
|
|
8673
|
+
unit: 'LB',
|
|
8674
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: -1 }, deviationFromProfileWeight: true, trendIntervalInMS: 0 },],
|
|
8675
|
+
}],
|
|
8676
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8677
|
+
vitals: [{
|
|
8678
|
+
measurement: { unit: 'LB', value: 180 },
|
|
8679
|
+
timestamp: new Date(),
|
|
8680
|
+
}]
|
|
8681
|
+
})];
|
|
8682
|
+
case 18:
|
|
8683
|
+
_a.sent();
|
|
8684
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8685
|
+
title: "Weight Trend from Profile",
|
|
8686
|
+
shouldTrigger: true,
|
|
8687
|
+
configurations: [{
|
|
8688
|
+
unit: 'LB',
|
|
8689
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, deviationFromProfileWeight: true, trendIntervalInMS: 0 },],
|
|
8690
|
+
}],
|
|
8691
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8692
|
+
vitals: [{
|
|
8693
|
+
measurement: { unit: 'LB', value: 182 },
|
|
8694
|
+
timestamp: new Date(),
|
|
8695
|
+
}]
|
|
8696
|
+
})];
|
|
8697
|
+
case 19:
|
|
8698
|
+
_a.sent();
|
|
8699
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8700
|
+
title: "Weight Trend from Profile (negative)",
|
|
8701
|
+
shouldTrigger: true,
|
|
8702
|
+
configurations: [{
|
|
8703
|
+
unit: 'LB',
|
|
8704
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Less Than', value: -1 }, deviationFromProfileWeight: true, trendIntervalInMS: 0 },],
|
|
8705
|
+
}],
|
|
8706
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8707
|
+
vitals: [{
|
|
8708
|
+
measurement: { unit: 'LB', value: 178 },
|
|
8709
|
+
timestamp: new Date(),
|
|
8710
|
+
}]
|
|
8711
|
+
})];
|
|
8712
|
+
case 20:
|
|
8713
|
+
_a.sent();
|
|
8393
8714
|
return [4 /*yield*/, runTriggerTest({
|
|
8394
8715
|
title: "Basic Passing Test (Less Than Sucess)",
|
|
8395
8716
|
shouldTrigger: true,
|
|
@@ -8403,7 +8724,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8403
8724
|
timestamp: new Date(),
|
|
8404
8725
|
}]
|
|
8405
8726
|
})];
|
|
8406
|
-
case
|
|
8727
|
+
case 21:
|
|
8407
8728
|
_a.sent();
|
|
8408
8729
|
return [4 /*yield*/, runTriggerTest({
|
|
8409
8730
|
title: "Less Than Fail",
|
|
@@ -8418,7 +8739,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8418
8739
|
timestamp: new Date(),
|
|
8419
8740
|
}]
|
|
8420
8741
|
})];
|
|
8421
|
-
case
|
|
8742
|
+
case 22:
|
|
8422
8743
|
_a.sent();
|
|
8423
8744
|
return [4 /*yield*/, runTriggerTest({
|
|
8424
8745
|
title: "Greater Than Success",
|
|
@@ -8433,7 +8754,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8433
8754
|
timestamp: new Date(),
|
|
8434
8755
|
}]
|
|
8435
8756
|
})];
|
|
8436
|
-
case
|
|
8757
|
+
case 23:
|
|
8437
8758
|
_a.sent();
|
|
8438
8759
|
return [4 /*yield*/, runTriggerTest({
|
|
8439
8760
|
title: "Greater Than Fail",
|
|
@@ -8448,7 +8769,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8448
8769
|
timestamp: new Date(),
|
|
8449
8770
|
}]
|
|
8450
8771
|
})];
|
|
8451
|
-
case
|
|
8772
|
+
case 24:
|
|
8452
8773
|
_a.sent();
|
|
8453
8774
|
return [4 /*yield*/, runTriggerTest({
|
|
8454
8775
|
title: "Between Low Bound",
|
|
@@ -8463,7 +8784,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8463
8784
|
timestamp: new Date(),
|
|
8464
8785
|
}]
|
|
8465
8786
|
})];
|
|
8466
|
-
case
|
|
8787
|
+
case 25:
|
|
8467
8788
|
_a.sent();
|
|
8468
8789
|
return [4 /*yield*/, runTriggerTest({
|
|
8469
8790
|
title: "Between Upper Bound",
|
|
@@ -8478,7 +8799,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8478
8799
|
timestamp: new Date(),
|
|
8479
8800
|
}]
|
|
8480
8801
|
})];
|
|
8481
|
-
case
|
|
8802
|
+
case 26:
|
|
8482
8803
|
_a.sent();
|
|
8483
8804
|
return [4 /*yield*/, runTriggerTest({
|
|
8484
8805
|
title: "Between Middle",
|
|
@@ -8493,7 +8814,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8493
8814
|
timestamp: new Date(),
|
|
8494
8815
|
}]
|
|
8495
8816
|
})];
|
|
8496
|
-
case
|
|
8817
|
+
case 27:
|
|
8497
8818
|
_a.sent();
|
|
8498
8819
|
return [4 /*yield*/, runTriggerTest({
|
|
8499
8820
|
title: "Between Below Low Bound",
|
|
@@ -8508,7 +8829,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8508
8829
|
timestamp: new Date(),
|
|
8509
8830
|
}]
|
|
8510
8831
|
})];
|
|
8511
|
-
case
|
|
8832
|
+
case 28:
|
|
8512
8833
|
_a.sent();
|
|
8513
8834
|
return [4 /*yield*/, runTriggerTest({
|
|
8514
8835
|
title: "Between Above Upper Bound",
|
|
@@ -8523,7 +8844,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8523
8844
|
timestamp: new Date(),
|
|
8524
8845
|
}]
|
|
8525
8846
|
})];
|
|
8526
|
-
case
|
|
8847
|
+
case 29:
|
|
8527
8848
|
_a.sent();
|
|
8528
8849
|
return [4 /*yield*/, runTriggerTest({
|
|
8529
8850
|
title: "Mismatch Unit",
|
|
@@ -8538,7 +8859,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8538
8859
|
timestamp: new Date(),
|
|
8539
8860
|
}]
|
|
8540
8861
|
})];
|
|
8541
|
-
case
|
|
8862
|
+
case 30:
|
|
8542
8863
|
_a.sent();
|
|
8543
8864
|
return [4 /*yield*/, runTriggerTest({
|
|
8544
8865
|
title: "Mismatch Classification",
|
|
@@ -8553,7 +8874,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8553
8874
|
timestamp: new Date(),
|
|
8554
8875
|
}]
|
|
8555
8876
|
})];
|
|
8556
|
-
case
|
|
8877
|
+
case 31:
|
|
8557
8878
|
_a.sent();
|
|
8558
8879
|
return [4 /*yield*/, runTriggerTest({
|
|
8559
8880
|
title: "Multiple Configurations, first considered works",
|
|
@@ -8571,7 +8892,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8571
8892
|
timestamp: new Date(),
|
|
8572
8893
|
}]
|
|
8573
8894
|
})];
|
|
8574
|
-
case
|
|
8895
|
+
case 32:
|
|
8575
8896
|
_a.sent();
|
|
8576
8897
|
return [4 /*yield*/, runTriggerTest({
|
|
8577
8898
|
title: "Multiple Configurations, first considered fails",
|
|
@@ -8589,7 +8910,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8589
8910
|
timestamp: new Date(),
|
|
8590
8911
|
}]
|
|
8591
8912
|
})];
|
|
8592
|
-
case
|
|
8913
|
+
case 33:
|
|
8593
8914
|
_a.sent();
|
|
8594
8915
|
return [4 /*yield*/, runTriggerTest({
|
|
8595
8916
|
title: "Multiple Configurations (Comparisons)",
|
|
@@ -8607,7 +8928,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8607
8928
|
timestamp: new Date(),
|
|
8608
8929
|
}]
|
|
8609
8930
|
})];
|
|
8610
|
-
case
|
|
8931
|
+
case 34:
|
|
8611
8932
|
_a.sent();
|
|
8612
8933
|
return [4 /*yield*/, runTriggerTest({
|
|
8613
8934
|
title: "Multiple vitals, 0 passes",
|
|
@@ -8623,7 +8944,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8623
8944
|
{ measurement: { unit: 'LB', value: 250 }, timestamp: new Date(Date.now() - 250) },
|
|
8624
8945
|
]
|
|
8625
8946
|
})];
|
|
8626
|
-
case
|
|
8947
|
+
case 35:
|
|
8627
8948
|
_a.sent();
|
|
8628
8949
|
return [4 /*yield*/, runTriggerTest({
|
|
8629
8950
|
title: "Multiple vitals, 1 passes",
|
|
@@ -8639,7 +8960,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8639
8960
|
{ measurement: { unit: 'LB', value: 250 }, timestamp: new Date(Date.now() - 250) },
|
|
8640
8961
|
]
|
|
8641
8962
|
})];
|
|
8642
|
-
case
|
|
8963
|
+
case 36:
|
|
8643
8964
|
_a.sent();
|
|
8644
8965
|
return [4 /*yield*/, runTriggerTest({
|
|
8645
8966
|
title: "Multiple vitals, multiple pass",
|
|
@@ -8657,7 +8978,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8657
8978
|
})
|
|
8658
8979
|
// trend tests
|
|
8659
8980
|
];
|
|
8660
|
-
case
|
|
8981
|
+
case 37:
|
|
8661
8982
|
_a.sent();
|
|
8662
8983
|
// trend tests
|
|
8663
8984
|
return [4 /*yield*/, runTriggerTest({
|
|
@@ -8673,7 +8994,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8673
8994
|
timestamp: new Date(),
|
|
8674
8995
|
}]
|
|
8675
8996
|
})];
|
|
8676
|
-
case
|
|
8997
|
+
case 38:
|
|
8677
8998
|
// trend tests
|
|
8678
8999
|
_a.sent();
|
|
8679
9000
|
return [4 /*yield*/, runTriggerTest({
|
|
@@ -8689,7 +9010,37 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8689
9010
|
{ measurement: { unit: 'LB', value: 1 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
8690
9011
|
]
|
|
8691
9012
|
})];
|
|
8692
|
-
case
|
|
9013
|
+
case 39:
|
|
9014
|
+
_a.sent();
|
|
9015
|
+
return [4 /*yield*/, runTriggerTest({
|
|
9016
|
+
title: "2-point trend passing (negative)",
|
|
9017
|
+
shouldTrigger: true,
|
|
9018
|
+
configurations: [{
|
|
9019
|
+
unit: 'LB',
|
|
9020
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Less Than', value: -1 }, trendIntervalInMS: 1000 },],
|
|
9021
|
+
}],
|
|
9022
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
9023
|
+
vitals: [
|
|
9024
|
+
{ measurement: { unit: 'LB', value: 1 }, timestamp: new Date() },
|
|
9025
|
+
{ measurement: { unit: 'LB', value: 10 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
9026
|
+
]
|
|
9027
|
+
})];
|
|
9028
|
+
case 40:
|
|
9029
|
+
_a.sent();
|
|
9030
|
+
return [4 /*yield*/, runTriggerTest({
|
|
9031
|
+
title: "2-point trend failing (negative)",
|
|
9032
|
+
shouldTrigger: false,
|
|
9033
|
+
configurations: [{
|
|
9034
|
+
unit: 'LB',
|
|
9035
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Less Than', value: -1 }, trendIntervalInMS: 1000 },],
|
|
9036
|
+
}],
|
|
9037
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
9038
|
+
vitals: [
|
|
9039
|
+
{ measurement: { unit: 'LB', value: 1 }, timestamp: new Date() },
|
|
9040
|
+
{ measurement: { unit: 'LB', value: 2 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
9041
|
+
]
|
|
9042
|
+
})];
|
|
9043
|
+
case 41:
|
|
8693
9044
|
_a.sent();
|
|
8694
9045
|
return [4 /*yield*/, runTriggerTest({
|
|
8695
9046
|
title: "2-point trend failing for difference too small",
|
|
@@ -8704,7 +9055,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8704
9055
|
{ measurement: { unit: 'LB', value: 0 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
8705
9056
|
]
|
|
8706
9057
|
})];
|
|
8707
|
-
case
|
|
9058
|
+
case 42:
|
|
8708
9059
|
_a.sent();
|
|
8709
9060
|
return [4 /*yield*/, runTriggerTest({
|
|
8710
9061
|
title: "2-point trend failing for point out of time range",
|
|
@@ -8719,7 +9070,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8719
9070
|
{ measurement: { unit: 'LB', value: 0 }, timestamp: new Date(new Date().getTime() - 1001) },
|
|
8720
9071
|
]
|
|
8721
9072
|
})];
|
|
8722
|
-
case
|
|
9073
|
+
case 43:
|
|
8723
9074
|
_a.sent();
|
|
8724
9075
|
return [4 /*yield*/, runTriggerTest({
|
|
8725
9076
|
title: "3-point trend passing (1 point of out range)",
|
|
@@ -8735,7 +9086,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8735
9086
|
{ measurement: { unit: 'LB', value: 0 }, timestamp: new Date(new Date().getTime() - 1001) },
|
|
8736
9087
|
]
|
|
8737
9088
|
})];
|
|
8738
|
-
case
|
|
9089
|
+
case 44:
|
|
8739
9090
|
_a.sent();
|
|
8740
9091
|
return [4 /*yield*/, runTriggerTest({
|
|
8741
9092
|
title: "3-point trend passing (1 point wrong unit)",
|
|
@@ -8751,7 +9102,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8751
9102
|
{ measurement: { unit: 'OTHER', value: 0 }, timestamp: new Date(new Date().getTime() - 200) },
|
|
8752
9103
|
]
|
|
8753
9104
|
})];
|
|
8754
|
-
case
|
|
9105
|
+
case 45:
|
|
8755
9106
|
_a.sent();
|
|
8756
9107
|
return [4 /*yield*/, runTriggerTest({
|
|
8757
9108
|
title: "3-point trend failing (1 point of out range)",
|
|
@@ -8767,7 +9118,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8767
9118
|
{ measurement: { unit: 'LB', value: 1 }, timestamp: new Date(new Date().getTime() - 1001) },
|
|
8768
9119
|
]
|
|
8769
9120
|
})];
|
|
8770
|
-
case
|
|
9121
|
+
case 46:
|
|
8771
9122
|
_a.sent();
|
|
8772
9123
|
return [4 /*yield*/, runTriggerTest({
|
|
8773
9124
|
title: "3-point trend failing (1 point wrong unit)",
|
|
@@ -8783,7 +9134,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8783
9134
|
{ measurement: { unit: 'OTHER', value: 1 }, timestamp: new Date(new Date().getTime() - 200) },
|
|
8784
9135
|
]
|
|
8785
9136
|
})];
|
|
8786
|
-
case
|
|
9137
|
+
case 47:
|
|
8787
9138
|
_a.sent();
|
|
8788
9139
|
return [4 /*yield*/, runTriggerTest({
|
|
8789
9140
|
title: "multiple trend passing",
|
|
@@ -8799,7 +9150,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8799
9150
|
{ measurement: { unit: 'LB', value: 1 }, timestamp: new Date(new Date().getTime() - 200) },
|
|
8800
9151
|
]
|
|
8801
9152
|
})];
|
|
8802
|
-
case
|
|
9153
|
+
case 48:
|
|
8803
9154
|
_a.sent();
|
|
8804
9155
|
return [4 /*yield*/, runTriggerTest({
|
|
8805
9156
|
title: "multiple trend failing (not enough)",
|
|
@@ -8815,7 +9166,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8815
9166
|
{ measurement: { unit: 'LB', value: 1 }, timestamp: new Date(new Date().getTime() - 200) },
|
|
8816
9167
|
]
|
|
8817
9168
|
})];
|
|
8818
|
-
case
|
|
9169
|
+
case 49:
|
|
8819
9170
|
_a.sent();
|
|
8820
9171
|
return [4 /*yield*/, runTriggerTest({
|
|
8821
9172
|
title: "multiple trend failing (wrong order)",
|
|
@@ -8831,7 +9182,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8831
9182
|
{ measurement: { unit: 'LB', value: 3 }, timestamp: new Date(new Date().getTime() - 200) },
|
|
8832
9183
|
]
|
|
8833
9184
|
})];
|
|
8834
|
-
case
|
|
9185
|
+
case 50:
|
|
8835
9186
|
_a.sent();
|
|
8836
9187
|
return [4 /*yield*/, runTriggerTest({
|
|
8837
9188
|
title: "multiple trend failing (not enough, and wrong order)",
|
|
@@ -8847,7 +9198,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8847
9198
|
{ measurement: { unit: 'LB', value: 2 }, timestamp: new Date(new Date().getTime() - 200) },
|
|
8848
9199
|
]
|
|
8849
9200
|
})];
|
|
8850
|
-
case
|
|
9201
|
+
case 51:
|
|
8851
9202
|
_a.sent();
|
|
8852
9203
|
return [4 /*yield*/, runTriggerTest({
|
|
8853
9204
|
title: "multiple trend failing (lots)",
|
|
@@ -8867,7 +9218,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8867
9218
|
{ measurement: { unit: 'LB', value: 1 }, timestamp: new Date(new Date().getTime() - 600) },
|
|
8868
9219
|
]
|
|
8869
9220
|
})];
|
|
8870
|
-
case
|
|
9221
|
+
case 52:
|
|
8871
9222
|
_a.sent();
|
|
8872
9223
|
return [2 /*return*/];
|
|
8873
9224
|
}
|