@tellescope/sdk 1.89.0 → 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/sdk.d.ts +1 -0
- package/lib/cjs/sdk.d.ts.map +1 -1
- package/lib/cjs/sdk.js +1 -0
- package/lib/cjs/sdk.js.map +1 -1
- package/lib/cjs/tests/tests.js +382 -31
- package/lib/cjs/tests/tests.js.map +1 -1
- package/lib/esm/sdk.d.ts +1 -0
- package/lib/esm/sdk.d.ts.map +1 -1
- package/lib/esm/sdk.js +1 -0
- package/lib/esm/sdk.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/sdk.ts +4 -0
- package/src/tests/tests.ts +316 -3
- package/test_generated.pdf +0 -0
package/lib/esm/tests/tests.js
CHANGED
|
@@ -8305,7 +8305,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8305
8305
|
var e, configurations, triggers;
|
|
8306
8306
|
return __generator(this, function (_b) {
|
|
8307
8307
|
switch (_b.label) {
|
|
8308
|
-
case 0: return [4 /*yield*/, sdk.api.endusers.createOne({})];
|
|
8308
|
+
case 0: return [4 /*yield*/, sdk.api.endusers.createOne({ weight: { unit: 'LB', value: 180 } })];
|
|
8309
8309
|
case 1:
|
|
8310
8310
|
e = _b.sent();
|
|
8311
8311
|
return [4 /*yield*/, sdk.api.vital_configurations.createSome(_configurations.map(function (c, i) { return (__assign({ title: "configuration ".concat(i) }, c)); }))];
|
|
@@ -8344,6 +8344,327 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8344
8344
|
});
|
|
8345
8345
|
});
|
|
8346
8346
|
};
|
|
8347
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8348
|
+
title: "Any Meal Passing (Unset)",
|
|
8349
|
+
shouldTrigger: true,
|
|
8350
|
+
configurations: [{
|
|
8351
|
+
unit: 'mg/dL',
|
|
8352
|
+
// no meal status
|
|
8353
|
+
// mealStatus: 'Before',
|
|
8354
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8355
|
+
}],
|
|
8356
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8357
|
+
vitals: [{
|
|
8358
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8359
|
+
timestamp: new Date(),
|
|
8360
|
+
}]
|
|
8361
|
+
})];
|
|
8362
|
+
case 1:
|
|
8363
|
+
_a.sent();
|
|
8364
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8365
|
+
title: "Any Meal Passing (Unset) [Before]",
|
|
8366
|
+
shouldTrigger: true,
|
|
8367
|
+
configurations: [{
|
|
8368
|
+
unit: 'mg/dL',
|
|
8369
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8370
|
+
}],
|
|
8371
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8372
|
+
vitals: [{
|
|
8373
|
+
beforeMeal: true,
|
|
8374
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8375
|
+
timestamp: new Date(),
|
|
8376
|
+
}]
|
|
8377
|
+
})];
|
|
8378
|
+
case 2:
|
|
8379
|
+
_a.sent();
|
|
8380
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8381
|
+
title: "Any Meal Passing (Unset) [After]",
|
|
8382
|
+
shouldTrigger: true,
|
|
8383
|
+
configurations: [{
|
|
8384
|
+
unit: 'mg/dL',
|
|
8385
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8386
|
+
}],
|
|
8387
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8388
|
+
vitals: [{
|
|
8389
|
+
beforeMeal: false,
|
|
8390
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8391
|
+
timestamp: new Date(),
|
|
8392
|
+
}]
|
|
8393
|
+
})];
|
|
8394
|
+
case 3:
|
|
8395
|
+
_a.sent();
|
|
8396
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8397
|
+
title: "Any Meal Passing",
|
|
8398
|
+
shouldTrigger: true,
|
|
8399
|
+
configurations: [{
|
|
8400
|
+
unit: 'mg/dL',
|
|
8401
|
+
mealStatus: 'Any',
|
|
8402
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8403
|
+
}],
|
|
8404
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8405
|
+
vitals: [{
|
|
8406
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8407
|
+
timestamp: new Date(),
|
|
8408
|
+
}]
|
|
8409
|
+
})];
|
|
8410
|
+
case 4:
|
|
8411
|
+
_a.sent();
|
|
8412
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8413
|
+
title: "Before Meal Passing",
|
|
8414
|
+
shouldTrigger: true,
|
|
8415
|
+
configurations: [{
|
|
8416
|
+
unit: 'mg/dL',
|
|
8417
|
+
mealStatus: 'Before',
|
|
8418
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8419
|
+
}],
|
|
8420
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8421
|
+
vitals: [{
|
|
8422
|
+
beforeMeal: true,
|
|
8423
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8424
|
+
timestamp: new Date(),
|
|
8425
|
+
}]
|
|
8426
|
+
})];
|
|
8427
|
+
case 5:
|
|
8428
|
+
_a.sent();
|
|
8429
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8430
|
+
title: "Before Meal Failing (omitted)",
|
|
8431
|
+
shouldTrigger: false,
|
|
8432
|
+
configurations: [{
|
|
8433
|
+
unit: 'mg/dL',
|
|
8434
|
+
mealStatus: 'Before',
|
|
8435
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8436
|
+
}],
|
|
8437
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8438
|
+
vitals: [{
|
|
8439
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8440
|
+
timestamp: new Date(),
|
|
8441
|
+
}]
|
|
8442
|
+
})];
|
|
8443
|
+
case 6:
|
|
8444
|
+
_a.sent();
|
|
8445
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8446
|
+
title: "Before Meal Failing",
|
|
8447
|
+
shouldTrigger: false,
|
|
8448
|
+
configurations: [{
|
|
8449
|
+
unit: 'mg/dL',
|
|
8450
|
+
mealStatus: 'Before',
|
|
8451
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8452
|
+
}],
|
|
8453
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8454
|
+
vitals: [{
|
|
8455
|
+
beforeMeal: false,
|
|
8456
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8457
|
+
timestamp: new Date(),
|
|
8458
|
+
}]
|
|
8459
|
+
})];
|
|
8460
|
+
case 7:
|
|
8461
|
+
_a.sent();
|
|
8462
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8463
|
+
title: "After Meal Passing",
|
|
8464
|
+
shouldTrigger: true,
|
|
8465
|
+
configurations: [{
|
|
8466
|
+
unit: 'mg/dL',
|
|
8467
|
+
mealStatus: 'After',
|
|
8468
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8469
|
+
}],
|
|
8470
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8471
|
+
vitals: [{
|
|
8472
|
+
beforeMeal: false,
|
|
8473
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8474
|
+
timestamp: new Date(),
|
|
8475
|
+
}]
|
|
8476
|
+
})];
|
|
8477
|
+
case 8:
|
|
8478
|
+
_a.sent();
|
|
8479
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8480
|
+
title: "After Meal Failing (omitted)",
|
|
8481
|
+
shouldTrigger: false,
|
|
8482
|
+
configurations: [{
|
|
8483
|
+
unit: 'mg/dL',
|
|
8484
|
+
mealStatus: 'After',
|
|
8485
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8486
|
+
}],
|
|
8487
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8488
|
+
vitals: [{
|
|
8489
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8490
|
+
timestamp: new Date(),
|
|
8491
|
+
}]
|
|
8492
|
+
})];
|
|
8493
|
+
case 9:
|
|
8494
|
+
_a.sent();
|
|
8495
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8496
|
+
title: "After Meal Failing",
|
|
8497
|
+
shouldTrigger: false,
|
|
8498
|
+
configurations: [{
|
|
8499
|
+
unit: 'mg/dL',
|
|
8500
|
+
mealStatus: 'After',
|
|
8501
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, trendIntervalInMS: 0 },],
|
|
8502
|
+
}],
|
|
8503
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8504
|
+
vitals: [{
|
|
8505
|
+
beforeMeal: true,
|
|
8506
|
+
measurement: { unit: 'mg/dL', value: 100 },
|
|
8507
|
+
timestamp: new Date(),
|
|
8508
|
+
}]
|
|
8509
|
+
})];
|
|
8510
|
+
case 10:
|
|
8511
|
+
_a.sent();
|
|
8512
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8513
|
+
title: "Before meal trend passing",
|
|
8514
|
+
shouldTrigger: true,
|
|
8515
|
+
configurations: [{
|
|
8516
|
+
mealStatus: 'Before',
|
|
8517
|
+
unit: 'mg/dL',
|
|
8518
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Less Than', value: 1 }, trendIntervalInMS: 1000 },],
|
|
8519
|
+
}],
|
|
8520
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8521
|
+
vitals: [
|
|
8522
|
+
{ beforeMeal: true, measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date() },
|
|
8523
|
+
{ beforeMeal: true, measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
8524
|
+
]
|
|
8525
|
+
})];
|
|
8526
|
+
case 11:
|
|
8527
|
+
_a.sent();
|
|
8528
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8529
|
+
title: "Before meal trend failing, undefined",
|
|
8530
|
+
shouldTrigger: false,
|
|
8531
|
+
configurations: [{
|
|
8532
|
+
mealStatus: 'Before',
|
|
8533
|
+
unit: 'mg/dL',
|
|
8534
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Less Than', value: 1 }, trendIntervalInMS: 1000 },],
|
|
8535
|
+
}],
|
|
8536
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8537
|
+
vitals: [
|
|
8538
|
+
{ measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date() },
|
|
8539
|
+
{ measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
8540
|
+
]
|
|
8541
|
+
})];
|
|
8542
|
+
case 12:
|
|
8543
|
+
_a.sent();
|
|
8544
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8545
|
+
title: "Before meal trend failing",
|
|
8546
|
+
shouldTrigger: false,
|
|
8547
|
+
configurations: [{
|
|
8548
|
+
mealStatus: 'Before',
|
|
8549
|
+
unit: 'mg/dL',
|
|
8550
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Less Than', value: 1 }, trendIntervalInMS: 1000 },],
|
|
8551
|
+
}],
|
|
8552
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8553
|
+
vitals: [
|
|
8554
|
+
{ beforeMeal: false, measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date() },
|
|
8555
|
+
{ beforeMeal: false, measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
8556
|
+
]
|
|
8557
|
+
})];
|
|
8558
|
+
case 13:
|
|
8559
|
+
_a.sent();
|
|
8560
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8561
|
+
title: "After meal trend passing",
|
|
8562
|
+
shouldTrigger: true,
|
|
8563
|
+
configurations: [{
|
|
8564
|
+
mealStatus: 'After',
|
|
8565
|
+
unit: 'mg/dL',
|
|
8566
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Less Than', value: 1 }, trendIntervalInMS: 1000 },],
|
|
8567
|
+
}],
|
|
8568
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8569
|
+
vitals: [
|
|
8570
|
+
{ beforeMeal: false, measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date() },
|
|
8571
|
+
{ beforeMeal: false, measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
8572
|
+
]
|
|
8573
|
+
})];
|
|
8574
|
+
case 14:
|
|
8575
|
+
_a.sent();
|
|
8576
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8577
|
+
title: "After meal trend failing, undefined",
|
|
8578
|
+
shouldTrigger: false,
|
|
8579
|
+
configurations: [{
|
|
8580
|
+
mealStatus: 'After',
|
|
8581
|
+
unit: 'mg/dL',
|
|
8582
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Less Than', value: 1 }, trendIntervalInMS: 1000 },],
|
|
8583
|
+
}],
|
|
8584
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8585
|
+
vitals: [
|
|
8586
|
+
{ measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date() },
|
|
8587
|
+
{ measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
8588
|
+
]
|
|
8589
|
+
})];
|
|
8590
|
+
case 15:
|
|
8591
|
+
_a.sent();
|
|
8592
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8593
|
+
title: "After meal trend failing",
|
|
8594
|
+
shouldTrigger: false,
|
|
8595
|
+
configurations: [{
|
|
8596
|
+
mealStatus: 'After',
|
|
8597
|
+
unit: 'mg/dL',
|
|
8598
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Less Than', value: 1 }, trendIntervalInMS: 1000 },],
|
|
8599
|
+
}],
|
|
8600
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8601
|
+
vitals: [
|
|
8602
|
+
{ beforeMeal: true, measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date() },
|
|
8603
|
+
{ beforeMeal: true, measurement: { unit: 'mg/dL', value: 1 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
8604
|
+
]
|
|
8605
|
+
})];
|
|
8606
|
+
case 16:
|
|
8607
|
+
_a.sent();
|
|
8608
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8609
|
+
title: "Weight Trend from Profile (positive, not enough)",
|
|
8610
|
+
shouldTrigger: false,
|
|
8611
|
+
configurations: [{
|
|
8612
|
+
unit: 'LB',
|
|
8613
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, deviationFromProfileWeight: true, trendIntervalInMS: 0 },],
|
|
8614
|
+
}],
|
|
8615
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8616
|
+
vitals: [{
|
|
8617
|
+
measurement: { unit: 'LB', value: 180 },
|
|
8618
|
+
timestamp: new Date(),
|
|
8619
|
+
}]
|
|
8620
|
+
})];
|
|
8621
|
+
case 17:
|
|
8622
|
+
_a.sent();
|
|
8623
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8624
|
+
title: "Weight Trend from Profile (negative, not enough)",
|
|
8625
|
+
shouldTrigger: false,
|
|
8626
|
+
configurations: [{
|
|
8627
|
+
unit: 'LB',
|
|
8628
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: -1 }, deviationFromProfileWeight: true, trendIntervalInMS: 0 },],
|
|
8629
|
+
}],
|
|
8630
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8631
|
+
vitals: [{
|
|
8632
|
+
measurement: { unit: 'LB', value: 180 },
|
|
8633
|
+
timestamp: new Date(),
|
|
8634
|
+
}]
|
|
8635
|
+
})];
|
|
8636
|
+
case 18:
|
|
8637
|
+
_a.sent();
|
|
8638
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8639
|
+
title: "Weight Trend from Profile",
|
|
8640
|
+
shouldTrigger: true,
|
|
8641
|
+
configurations: [{
|
|
8642
|
+
unit: 'LB',
|
|
8643
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Greater Than', value: 1 }, deviationFromProfileWeight: true, trendIntervalInMS: 0 },],
|
|
8644
|
+
}],
|
|
8645
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8646
|
+
vitals: [{
|
|
8647
|
+
measurement: { unit: 'LB', value: 182 },
|
|
8648
|
+
timestamp: new Date(),
|
|
8649
|
+
}]
|
|
8650
|
+
})];
|
|
8651
|
+
case 19:
|
|
8652
|
+
_a.sent();
|
|
8653
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8654
|
+
title: "Weight Trend from Profile (negative)",
|
|
8655
|
+
shouldTrigger: true,
|
|
8656
|
+
configurations: [{
|
|
8657
|
+
unit: 'LB',
|
|
8658
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Less Than', value: -1 }, deviationFromProfileWeight: true, trendIntervalInMS: 0 },],
|
|
8659
|
+
}],
|
|
8660
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8661
|
+
vitals: [{
|
|
8662
|
+
measurement: { unit: 'LB', value: 178 },
|
|
8663
|
+
timestamp: new Date(),
|
|
8664
|
+
}]
|
|
8665
|
+
})];
|
|
8666
|
+
case 20:
|
|
8667
|
+
_a.sent();
|
|
8347
8668
|
return [4 /*yield*/, runTriggerTest({
|
|
8348
8669
|
title: "Basic Passing Test (Less Than Sucess)",
|
|
8349
8670
|
shouldTrigger: true,
|
|
@@ -8357,7 +8678,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8357
8678
|
timestamp: new Date(),
|
|
8358
8679
|
}]
|
|
8359
8680
|
})];
|
|
8360
|
-
case
|
|
8681
|
+
case 21:
|
|
8361
8682
|
_a.sent();
|
|
8362
8683
|
return [4 /*yield*/, runTriggerTest({
|
|
8363
8684
|
title: "Less Than Fail",
|
|
@@ -8372,7 +8693,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8372
8693
|
timestamp: new Date(),
|
|
8373
8694
|
}]
|
|
8374
8695
|
})];
|
|
8375
|
-
case
|
|
8696
|
+
case 22:
|
|
8376
8697
|
_a.sent();
|
|
8377
8698
|
return [4 /*yield*/, runTriggerTest({
|
|
8378
8699
|
title: "Greater Than Success",
|
|
@@ -8387,7 +8708,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8387
8708
|
timestamp: new Date(),
|
|
8388
8709
|
}]
|
|
8389
8710
|
})];
|
|
8390
|
-
case
|
|
8711
|
+
case 23:
|
|
8391
8712
|
_a.sent();
|
|
8392
8713
|
return [4 /*yield*/, runTriggerTest({
|
|
8393
8714
|
title: "Greater Than Fail",
|
|
@@ -8402,7 +8723,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8402
8723
|
timestamp: new Date(),
|
|
8403
8724
|
}]
|
|
8404
8725
|
})];
|
|
8405
|
-
case
|
|
8726
|
+
case 24:
|
|
8406
8727
|
_a.sent();
|
|
8407
8728
|
return [4 /*yield*/, runTriggerTest({
|
|
8408
8729
|
title: "Between Low Bound",
|
|
@@ -8417,7 +8738,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8417
8738
|
timestamp: new Date(),
|
|
8418
8739
|
}]
|
|
8419
8740
|
})];
|
|
8420
|
-
case
|
|
8741
|
+
case 25:
|
|
8421
8742
|
_a.sent();
|
|
8422
8743
|
return [4 /*yield*/, runTriggerTest({
|
|
8423
8744
|
title: "Between Upper Bound",
|
|
@@ -8432,7 +8753,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8432
8753
|
timestamp: new Date(),
|
|
8433
8754
|
}]
|
|
8434
8755
|
})];
|
|
8435
|
-
case
|
|
8756
|
+
case 26:
|
|
8436
8757
|
_a.sent();
|
|
8437
8758
|
return [4 /*yield*/, runTriggerTest({
|
|
8438
8759
|
title: "Between Middle",
|
|
@@ -8447,7 +8768,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8447
8768
|
timestamp: new Date(),
|
|
8448
8769
|
}]
|
|
8449
8770
|
})];
|
|
8450
|
-
case
|
|
8771
|
+
case 27:
|
|
8451
8772
|
_a.sent();
|
|
8452
8773
|
return [4 /*yield*/, runTriggerTest({
|
|
8453
8774
|
title: "Between Below Low Bound",
|
|
@@ -8462,7 +8783,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8462
8783
|
timestamp: new Date(),
|
|
8463
8784
|
}]
|
|
8464
8785
|
})];
|
|
8465
|
-
case
|
|
8786
|
+
case 28:
|
|
8466
8787
|
_a.sent();
|
|
8467
8788
|
return [4 /*yield*/, runTriggerTest({
|
|
8468
8789
|
title: "Between Above Upper Bound",
|
|
@@ -8477,7 +8798,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8477
8798
|
timestamp: new Date(),
|
|
8478
8799
|
}]
|
|
8479
8800
|
})];
|
|
8480
|
-
case
|
|
8801
|
+
case 29:
|
|
8481
8802
|
_a.sent();
|
|
8482
8803
|
return [4 /*yield*/, runTriggerTest({
|
|
8483
8804
|
title: "Mismatch Unit",
|
|
@@ -8492,7 +8813,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8492
8813
|
timestamp: new Date(),
|
|
8493
8814
|
}]
|
|
8494
8815
|
})];
|
|
8495
|
-
case
|
|
8816
|
+
case 30:
|
|
8496
8817
|
_a.sent();
|
|
8497
8818
|
return [4 /*yield*/, runTriggerTest({
|
|
8498
8819
|
title: "Mismatch Classification",
|
|
@@ -8507,7 +8828,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8507
8828
|
timestamp: new Date(),
|
|
8508
8829
|
}]
|
|
8509
8830
|
})];
|
|
8510
|
-
case
|
|
8831
|
+
case 31:
|
|
8511
8832
|
_a.sent();
|
|
8512
8833
|
return [4 /*yield*/, runTriggerTest({
|
|
8513
8834
|
title: "Multiple Configurations, first considered works",
|
|
@@ -8525,7 +8846,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8525
8846
|
timestamp: new Date(),
|
|
8526
8847
|
}]
|
|
8527
8848
|
})];
|
|
8528
|
-
case
|
|
8849
|
+
case 32:
|
|
8529
8850
|
_a.sent();
|
|
8530
8851
|
return [4 /*yield*/, runTriggerTest({
|
|
8531
8852
|
title: "Multiple Configurations, first considered fails",
|
|
@@ -8543,7 +8864,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8543
8864
|
timestamp: new Date(),
|
|
8544
8865
|
}]
|
|
8545
8866
|
})];
|
|
8546
|
-
case
|
|
8867
|
+
case 33:
|
|
8547
8868
|
_a.sent();
|
|
8548
8869
|
return [4 /*yield*/, runTriggerTest({
|
|
8549
8870
|
title: "Multiple Configurations (Comparisons)",
|
|
@@ -8561,7 +8882,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8561
8882
|
timestamp: new Date(),
|
|
8562
8883
|
}]
|
|
8563
8884
|
})];
|
|
8564
|
-
case
|
|
8885
|
+
case 34:
|
|
8565
8886
|
_a.sent();
|
|
8566
8887
|
return [4 /*yield*/, runTriggerTest({
|
|
8567
8888
|
title: "Multiple vitals, 0 passes",
|
|
@@ -8577,7 +8898,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8577
8898
|
{ measurement: { unit: 'LB', value: 250 }, timestamp: new Date(Date.now() - 250) },
|
|
8578
8899
|
]
|
|
8579
8900
|
})];
|
|
8580
|
-
case
|
|
8901
|
+
case 35:
|
|
8581
8902
|
_a.sent();
|
|
8582
8903
|
return [4 /*yield*/, runTriggerTest({
|
|
8583
8904
|
title: "Multiple vitals, 1 passes",
|
|
@@ -8593,7 +8914,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8593
8914
|
{ measurement: { unit: 'LB', value: 250 }, timestamp: new Date(Date.now() - 250) },
|
|
8594
8915
|
]
|
|
8595
8916
|
})];
|
|
8596
|
-
case
|
|
8917
|
+
case 36:
|
|
8597
8918
|
_a.sent();
|
|
8598
8919
|
return [4 /*yield*/, runTriggerTest({
|
|
8599
8920
|
title: "Multiple vitals, multiple pass",
|
|
@@ -8611,7 +8932,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8611
8932
|
})
|
|
8612
8933
|
// trend tests
|
|
8613
8934
|
];
|
|
8614
|
-
case
|
|
8935
|
+
case 37:
|
|
8615
8936
|
_a.sent();
|
|
8616
8937
|
// trend tests
|
|
8617
8938
|
return [4 /*yield*/, runTriggerTest({
|
|
@@ -8627,7 +8948,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8627
8948
|
timestamp: new Date(),
|
|
8628
8949
|
}]
|
|
8629
8950
|
})];
|
|
8630
|
-
case
|
|
8951
|
+
case 38:
|
|
8631
8952
|
// trend tests
|
|
8632
8953
|
_a.sent();
|
|
8633
8954
|
return [4 /*yield*/, runTriggerTest({
|
|
@@ -8643,7 +8964,37 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8643
8964
|
{ measurement: { unit: 'LB', value: 1 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
8644
8965
|
]
|
|
8645
8966
|
})];
|
|
8646
|
-
case
|
|
8967
|
+
case 39:
|
|
8968
|
+
_a.sent();
|
|
8969
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8970
|
+
title: "2-point trend passing (negative)",
|
|
8971
|
+
shouldTrigger: true,
|
|
8972
|
+
configurations: [{
|
|
8973
|
+
unit: 'LB',
|
|
8974
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Less Than', value: -1 }, trendIntervalInMS: 1000 },],
|
|
8975
|
+
}],
|
|
8976
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8977
|
+
vitals: [
|
|
8978
|
+
{ measurement: { unit: 'LB', value: 1 }, timestamp: new Date() },
|
|
8979
|
+
{ measurement: { unit: 'LB', value: 10 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
8980
|
+
]
|
|
8981
|
+
})];
|
|
8982
|
+
case 40:
|
|
8983
|
+
_a.sent();
|
|
8984
|
+
return [4 /*yield*/, runTriggerTest({
|
|
8985
|
+
title: "2-point trend failing (negative)",
|
|
8986
|
+
shouldTrigger: false,
|
|
8987
|
+
configurations: [{
|
|
8988
|
+
unit: 'LB',
|
|
8989
|
+
ranges: [{ classification: 'Target', comparison: { type: 'Less Than', value: -1 }, trendIntervalInMS: 1000 },],
|
|
8990
|
+
}],
|
|
8991
|
+
triggers: [{ classifications: ['Target'], configurationIndexes: [0] }],
|
|
8992
|
+
vitals: [
|
|
8993
|
+
{ measurement: { unit: 'LB', value: 1 }, timestamp: new Date() },
|
|
8994
|
+
{ measurement: { unit: 'LB', value: 2 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
8995
|
+
]
|
|
8996
|
+
})];
|
|
8997
|
+
case 41:
|
|
8647
8998
|
_a.sent();
|
|
8648
8999
|
return [4 /*yield*/, runTriggerTest({
|
|
8649
9000
|
title: "2-point trend failing for difference too small",
|
|
@@ -8658,7 +9009,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8658
9009
|
{ measurement: { unit: 'LB', value: 0 }, timestamp: new Date(new Date().getTime() - 999) },
|
|
8659
9010
|
]
|
|
8660
9011
|
})];
|
|
8661
|
-
case
|
|
9012
|
+
case 42:
|
|
8662
9013
|
_a.sent();
|
|
8663
9014
|
return [4 /*yield*/, runTriggerTest({
|
|
8664
9015
|
title: "2-point trend failing for point out of time range",
|
|
@@ -8673,7 +9024,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8673
9024
|
{ measurement: { unit: 'LB', value: 0 }, timestamp: new Date(new Date().getTime() - 1001) },
|
|
8674
9025
|
]
|
|
8675
9026
|
})];
|
|
8676
|
-
case
|
|
9027
|
+
case 43:
|
|
8677
9028
|
_a.sent();
|
|
8678
9029
|
return [4 /*yield*/, runTriggerTest({
|
|
8679
9030
|
title: "3-point trend passing (1 point of out range)",
|
|
@@ -8689,7 +9040,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8689
9040
|
{ measurement: { unit: 'LB', value: 0 }, timestamp: new Date(new Date().getTime() - 1001) },
|
|
8690
9041
|
]
|
|
8691
9042
|
})];
|
|
8692
|
-
case
|
|
9043
|
+
case 44:
|
|
8693
9044
|
_a.sent();
|
|
8694
9045
|
return [4 /*yield*/, runTriggerTest({
|
|
8695
9046
|
title: "3-point trend passing (1 point wrong unit)",
|
|
@@ -8705,7 +9056,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8705
9056
|
{ measurement: { unit: 'OTHER', value: 0 }, timestamp: new Date(new Date().getTime() - 200) },
|
|
8706
9057
|
]
|
|
8707
9058
|
})];
|
|
8708
|
-
case
|
|
9059
|
+
case 45:
|
|
8709
9060
|
_a.sent();
|
|
8710
9061
|
return [4 /*yield*/, runTriggerTest({
|
|
8711
9062
|
title: "3-point trend failing (1 point of out range)",
|
|
@@ -8721,7 +9072,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8721
9072
|
{ measurement: { unit: 'LB', value: 1 }, timestamp: new Date(new Date().getTime() - 1001) },
|
|
8722
9073
|
]
|
|
8723
9074
|
})];
|
|
8724
|
-
case
|
|
9075
|
+
case 46:
|
|
8725
9076
|
_a.sent();
|
|
8726
9077
|
return [4 /*yield*/, runTriggerTest({
|
|
8727
9078
|
title: "3-point trend failing (1 point wrong unit)",
|
|
@@ -8737,7 +9088,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8737
9088
|
{ measurement: { unit: 'OTHER', value: 1 }, timestamp: new Date(new Date().getTime() - 200) },
|
|
8738
9089
|
]
|
|
8739
9090
|
})];
|
|
8740
|
-
case
|
|
9091
|
+
case 47:
|
|
8741
9092
|
_a.sent();
|
|
8742
9093
|
return [4 /*yield*/, runTriggerTest({
|
|
8743
9094
|
title: "multiple trend passing",
|
|
@@ -8753,7 +9104,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8753
9104
|
{ measurement: { unit: 'LB', value: 1 }, timestamp: new Date(new Date().getTime() - 200) },
|
|
8754
9105
|
]
|
|
8755
9106
|
})];
|
|
8756
|
-
case
|
|
9107
|
+
case 48:
|
|
8757
9108
|
_a.sent();
|
|
8758
9109
|
return [4 /*yield*/, runTriggerTest({
|
|
8759
9110
|
title: "multiple trend failing (not enough)",
|
|
@@ -8769,7 +9120,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8769
9120
|
{ measurement: { unit: 'LB', value: 1 }, timestamp: new Date(new Date().getTime() - 200) },
|
|
8770
9121
|
]
|
|
8771
9122
|
})];
|
|
8772
|
-
case
|
|
9123
|
+
case 49:
|
|
8773
9124
|
_a.sent();
|
|
8774
9125
|
return [4 /*yield*/, runTriggerTest({
|
|
8775
9126
|
title: "multiple trend failing (wrong order)",
|
|
@@ -8785,7 +9136,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8785
9136
|
{ measurement: { unit: 'LB', value: 3 }, timestamp: new Date(new Date().getTime() - 200) },
|
|
8786
9137
|
]
|
|
8787
9138
|
})];
|
|
8788
|
-
case
|
|
9139
|
+
case 50:
|
|
8789
9140
|
_a.sent();
|
|
8790
9141
|
return [4 /*yield*/, runTriggerTest({
|
|
8791
9142
|
title: "multiple trend failing (not enough, and wrong order)",
|
|
@@ -8801,7 +9152,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8801
9152
|
{ measurement: { unit: 'LB', value: 2 }, timestamp: new Date(new Date().getTime() - 200) },
|
|
8802
9153
|
]
|
|
8803
9154
|
})];
|
|
8804
|
-
case
|
|
9155
|
+
case 51:
|
|
8805
9156
|
_a.sent();
|
|
8806
9157
|
return [4 /*yield*/, runTriggerTest({
|
|
8807
9158
|
title: "multiple trend failing (lots)",
|
|
@@ -8821,7 +9172,7 @@ var vital_trigger_tests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
8821
9172
|
{ measurement: { unit: 'LB', value: 1 }, timestamp: new Date(new Date().getTime() - 600) },
|
|
8822
9173
|
]
|
|
8823
9174
|
})];
|
|
8824
|
-
case
|
|
9175
|
+
case 52:
|
|
8825
9176
|
_a.sent();
|
|
8826
9177
|
return [2 /*return*/];
|
|
8827
9178
|
}
|