@openmrs/ngx-formentry 3.2.1-pre.236 → 3.2.1-pre.241
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/bundles/openmrs-ngx-formentry.umd.js +74 -51
- package/bundles/openmrs-ngx-formentry.umd.js.map +1 -1
- package/esm2015/components/ngx-remote-select/ngx-remote-select.component.js +2 -2
- package/esm2015/components/number-input/number-input.module.js +1 -1
- package/esm2015/components/radio-button/radio.component.js +5 -5
- package/esm2015/form-entry/directives/historical-value.directive.js +1 -1
- package/esm2015/form-entry/form-factory/form-node.js +1 -1
- package/esm2015/form-entry/form-factory/validation.factory.js +1 -1
- package/esm2015/form-entry/helpers/historical-expression-helper-service.js +1 -1
- package/esm2015/form-entry/helpers/js-expression-helper.js +18 -4
- package/esm2015/form-entry/helpers/risk-dataset-table.js +36 -36
- package/esm2015/form-entry/question-models/interfaces/diagnosis-question-options.js +1 -1
- package/esm2015/form-entry/question-models/max-length-validation.model.js +1 -1
- package/esm2015/form-entry/question-models/min-length-validation.model.js +1 -1
- package/esm2015/form-entry/validators/max-length.validator.js +2 -2
- package/esm2015/form-entry/validators/min-length.validator.js +2 -2
- package/esm2015/form-entry/value-adapters/diagnosis.adapter.js +21 -15
- package/esm2015/form-entry/value-adapters/encounter.adapter.js +3 -2
- package/esm2015/form-entry/value-adapters/obs-adapter-helper.js +4 -2
- package/esm2015/form-entry/value-adapters/patient-identifier.adapter.js +3 -3
- package/esm2015/lib/index.js +2 -2
- package/fesm2015/openmrs-ngx-formentry.js +83 -60
- package/fesm2015/openmrs-ngx-formentry.js.map +1 -1
- package/form-entry/value-adapters/patient-identifier.adapter.d.ts +2 -2
- package/lib/index.d.ts +1 -1
- package/package.json +1 -1
- package/styles/ngx-formentry.css +1 -1
|
@@ -1370,7 +1370,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1370
1370
|
[21, 23, 25, 26, 28],
|
|
1371
1371
|
[17, 19, 20, 21, 23],
|
|
1372
1372
|
[14, 15, 16, 17, 18],
|
|
1373
|
-
[11, 12, 13, 14, 15]
|
|
1373
|
+
[11, 12, 13, 14, 15] // sbp < 120
|
|
1374
1374
|
],
|
|
1375
1375
|
// Age 65 - 69
|
|
1376
1376
|
[
|
|
@@ -1378,7 +1378,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1378
1378
|
[16, 17, 19, 21, 22],
|
|
1379
1379
|
[12, 14, 15, 16, 18],
|
|
1380
1380
|
[10, 11, 12, 13, 14],
|
|
1381
|
-
[8, 8, 9, 10, 11]
|
|
1381
|
+
[8, 8, 9, 10, 11] // < 120
|
|
1382
1382
|
],
|
|
1383
1383
|
// Age 60 - 64
|
|
1384
1384
|
[
|
|
@@ -1386,7 +1386,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1386
1386
|
[12, 13, 14, 16, 18],
|
|
1387
1387
|
[9, 10, 11, 12, 14],
|
|
1388
1388
|
[7, 8, 8, 9, 10],
|
|
1389
|
-
[5, 6, 6, 7, 8]
|
|
1389
|
+
[5, 6, 6, 7, 8] // sbp < 120
|
|
1390
1390
|
],
|
|
1391
1391
|
// Age 55 - 59
|
|
1392
1392
|
[
|
|
@@ -1394,7 +1394,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1394
1394
|
[9, 10, 11, 12, 14],
|
|
1395
1395
|
[7, 7, 8, 9, 10],
|
|
1396
1396
|
[5, 5, 6, 7, 8],
|
|
1397
|
-
[4, 4, 4, 5, 6]
|
|
1397
|
+
[4, 4, 4, 5, 6] // sbp < 120
|
|
1398
1398
|
],
|
|
1399
1399
|
// Age 50 - 54
|
|
1400
1400
|
[
|
|
@@ -1402,7 +1402,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1402
1402
|
[7, 7, 8, 9, 11],
|
|
1403
1403
|
[5, 5, 6, 7, 8],
|
|
1404
1404
|
[3, 4, 4, 5, 6],
|
|
1405
|
-
[2, 3, 3, 4, 4]
|
|
1405
|
+
[2, 3, 3, 4, 4] // sbp < 120
|
|
1406
1406
|
],
|
|
1407
1407
|
// Age 45 - 49
|
|
1408
1408
|
[
|
|
@@ -1410,7 +1410,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1410
1410
|
[5, 6, 6, 7, 8],
|
|
1411
1411
|
[3, 4, 4, 5, 6],
|
|
1412
1412
|
[2, 3, 3, 4, 4],
|
|
1413
|
-
[2, 2, 2, 2, 3]
|
|
1413
|
+
[2, 2, 2, 2, 3] // < 120
|
|
1414
1414
|
],
|
|
1415
1415
|
// Age 40 - 44
|
|
1416
1416
|
[
|
|
@@ -1418,8 +1418,8 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1418
1418
|
[4, 4, 5, 6, 7],
|
|
1419
1419
|
[2, 3, 3, 4, 4],
|
|
1420
1420
|
[2, 2, 2, 3, 3],
|
|
1421
|
-
[1, 1, 2, 2, 2]
|
|
1422
|
-
]
|
|
1421
|
+
[1, 1, 2, 2, 2]
|
|
1422
|
+
]
|
|
1423
1423
|
],
|
|
1424
1424
|
// Smoker
|
|
1425
1425
|
[
|
|
@@ -1429,7 +1429,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1429
1429
|
[28, 30, 32, 34, 36],
|
|
1430
1430
|
[23, 24, 26, 28, 30],
|
|
1431
1431
|
[18, 20, 21, 23, 24],
|
|
1432
|
-
[15, 16, 17, 18, 20]
|
|
1432
|
+
[15, 16, 17, 18, 20] // < 120
|
|
1433
1433
|
],
|
|
1434
1434
|
// Age 65 - 69
|
|
1435
1435
|
[
|
|
@@ -1437,7 +1437,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1437
1437
|
[22, 24, 26, 29, 31],
|
|
1438
1438
|
[18, 19, 21, 23, 25],
|
|
1439
1439
|
[14, 15, 16, 18, 20],
|
|
1440
|
-
[11, 12, 13, 14, 16]
|
|
1440
|
+
[11, 12, 13, 14, 16] // < 120
|
|
1441
1441
|
],
|
|
1442
1442
|
// Age 60 - 64
|
|
1443
1443
|
[
|
|
@@ -1445,7 +1445,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1445
1445
|
[18, 18, 20, 22, 24],
|
|
1446
1446
|
[14, 15, 17, 19, 21],
|
|
1447
1447
|
[10, 12, 13, 14, 16],
|
|
1448
|
-
[8, 9, 10, 11, 12]
|
|
1448
|
+
[8, 9, 10, 11, 12] // < 120
|
|
1449
1449
|
],
|
|
1450
1450
|
// Age 55 - 59
|
|
1451
1451
|
[
|
|
@@ -1453,7 +1453,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1453
1453
|
[14, 16, 18, 20, 23],
|
|
1454
1454
|
[11, 12, 13, 15, 17],
|
|
1455
1455
|
[8, 9, 10, 11, 13],
|
|
1456
|
-
[6, 7, 7, 8, 10]
|
|
1456
|
+
[6, 7, 7, 8, 10]
|
|
1457
1457
|
],
|
|
1458
1458
|
// Age 50 - 54
|
|
1459
1459
|
[
|
|
@@ -1461,7 +1461,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1461
1461
|
[11, 13, 15, 17, 20],
|
|
1462
1462
|
[8, 9, 11, 12, 14],
|
|
1463
1463
|
[6, 7, 8, 9, 11],
|
|
1464
|
-
[4, 5, 6, 7, 8]
|
|
1464
|
+
[4, 5, 6, 7, 8]
|
|
1465
1465
|
],
|
|
1466
1466
|
// Age 45 - 49
|
|
1467
1467
|
[
|
|
@@ -1469,7 +1469,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1469
1469
|
[9, 10, 12, 14, 17],
|
|
1470
1470
|
[6, 7, 9, 10, 12],
|
|
1471
1471
|
[4, 5, 6, 7, 8],
|
|
1472
|
-
[3, 4, 4, 5, 6]
|
|
1472
|
+
[3, 4, 4, 5, 6]
|
|
1473
1473
|
],
|
|
1474
1474
|
// Age 40 - 44
|
|
1475
1475
|
[
|
|
@@ -1477,9 +1477,9 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1477
1477
|
[7, 8, 10, 12, 14],
|
|
1478
1478
|
[5, 6, 7, 8, 10],
|
|
1479
1479
|
[3, 4, 5, 6, 7],
|
|
1480
|
-
[2, 3, 3, 4, 5]
|
|
1481
|
-
]
|
|
1482
|
-
]
|
|
1480
|
+
[2, 3, 3, 4, 5]
|
|
1481
|
+
]
|
|
1482
|
+
]
|
|
1483
1483
|
],
|
|
1484
1484
|
// Women
|
|
1485
1485
|
[
|
|
@@ -1491,7 +1491,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1491
1491
|
[17, 18, 19, 19, 20],
|
|
1492
1492
|
[15, 15, 16, 16, 17],
|
|
1493
1493
|
[12, 12, 13, 13, 14],
|
|
1494
|
-
[10, 10, 11, 11, 11]
|
|
1494
|
+
[10, 10, 11, 11, 11] // < 120
|
|
1495
1495
|
],
|
|
1496
1496
|
// Age 65 - 69
|
|
1497
1497
|
[
|
|
@@ -1499,7 +1499,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1499
1499
|
[13, 14, 14, 15, 15],
|
|
1500
1500
|
[11, 11, 11, 12, 12],
|
|
1501
1501
|
[9, 9, 9, 10, 10],
|
|
1502
|
-
[7, 7, 7, 8, 8]
|
|
1502
|
+
[7, 7, 7, 8, 8]
|
|
1503
1503
|
],
|
|
1504
1504
|
// Age 60 - 64
|
|
1505
1505
|
[
|
|
@@ -1507,7 +1507,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1507
1507
|
[10, 10, 11, 11, 12],
|
|
1508
1508
|
[8, 8, 8, 9, 9],
|
|
1509
1509
|
[6, 6, 7, 7, 7],
|
|
1510
|
-
[5, 5, 5, 5, 6]
|
|
1510
|
+
[5, 5, 5, 5, 6]
|
|
1511
1511
|
],
|
|
1512
1512
|
// Age 55 - 59
|
|
1513
1513
|
[
|
|
@@ -1515,7 +1515,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1515
1515
|
[8, 8, 8, 9, 9],
|
|
1516
1516
|
[6, 6, 6, 7, 7],
|
|
1517
1517
|
[4, 5, 5, 5, 5],
|
|
1518
|
-
[3, 3, 4, 4, 4]
|
|
1518
|
+
[3, 3, 4, 4, 4]
|
|
1519
1519
|
],
|
|
1520
1520
|
// Age 50 - 54
|
|
1521
1521
|
[
|
|
@@ -1523,7 +1523,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1523
1523
|
[6, 6, 6, 7, 7],
|
|
1524
1524
|
[4, 4, 5, 5, 5],
|
|
1525
1525
|
[3, 3, 3, 4, 4],
|
|
1526
|
-
[2, 2, 3, 3, 3]
|
|
1526
|
+
[2, 2, 3, 3, 3]
|
|
1527
1527
|
],
|
|
1528
1528
|
// Age 45 - 49
|
|
1529
1529
|
[
|
|
@@ -1531,7 +1531,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1531
1531
|
[4, 5, 5, 5, 5],
|
|
1532
1532
|
[3, 3, 3, 4, 4],
|
|
1533
1533
|
[2, 2, 2, 3, 3],
|
|
1534
|
-
[2, 2, 2, 2, 2]
|
|
1534
|
+
[2, 2, 2, 2, 2]
|
|
1535
1535
|
],
|
|
1536
1536
|
// Age 40 - 44
|
|
1537
1537
|
[
|
|
@@ -1539,8 +1539,8 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1539
1539
|
[3, 3, 4, 4, 4],
|
|
1540
1540
|
[2, 2, 3, 3, 3],
|
|
1541
1541
|
[2, 2, 2, 2, 2],
|
|
1542
|
-
[1, 1, 1, 1, 1]
|
|
1543
|
-
]
|
|
1542
|
+
[1, 1, 1, 1, 1]
|
|
1543
|
+
]
|
|
1544
1544
|
],
|
|
1545
1545
|
// Smoker
|
|
1546
1546
|
[
|
|
@@ -1550,7 +1550,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1550
1550
|
[25, 26, 27, 28, 29],
|
|
1551
1551
|
[21, 22, 22, 23, 24],
|
|
1552
1552
|
[17, 18, 19, 19, 20],
|
|
1553
|
-
[14, 15, 15, 16, 17]
|
|
1553
|
+
[14, 15, 15, 16, 17]
|
|
1554
1554
|
],
|
|
1555
1555
|
// Age 65 - 69
|
|
1556
1556
|
[
|
|
@@ -1558,7 +1558,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1558
1558
|
[21, 22, 22, 23, 24],
|
|
1559
1559
|
[17, 18, 18, 19, 20],
|
|
1560
1560
|
[14, 14, 15, 15, 16],
|
|
1561
|
-
[11, 11, 12, 12, 13]
|
|
1561
|
+
[11, 11, 12, 12, 13]
|
|
1562
1562
|
],
|
|
1563
1563
|
// Age 60 - 64
|
|
1564
1564
|
[
|
|
@@ -1566,7 +1566,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1566
1566
|
[17, 18, 19, 20, 21],
|
|
1567
1567
|
[13, 14, 15, 16, 16],
|
|
1568
1568
|
[11, 11, 12, 12, 13],
|
|
1569
|
-
[8, 9, 9, 10, 10]
|
|
1569
|
+
[8, 9, 9, 10, 10]
|
|
1570
1570
|
],
|
|
1571
1571
|
// Age 55 - 59
|
|
1572
1572
|
[
|
|
@@ -1574,7 +1574,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1574
1574
|
[14, 15, 15, 16, 17],
|
|
1575
1575
|
[11, 11, 12, 13, 13],
|
|
1576
1576
|
[8, 9, 9, 10, 10],
|
|
1577
|
-
[6, 7, 7, 7, 8]
|
|
1577
|
+
[6, 7, 7, 7, 8]
|
|
1578
1578
|
],
|
|
1579
1579
|
// Age 50 - 54
|
|
1580
1580
|
[
|
|
@@ -1582,7 +1582,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1582
1582
|
[11, 12, 13, 14, 14],
|
|
1583
1583
|
[9, 9, 10, 10, 11],
|
|
1584
1584
|
[6, 7, 7, 8, 8],
|
|
1585
|
-
[5, 5, 5, 6, 6]
|
|
1585
|
+
[5, 5, 5, 6, 6]
|
|
1586
1586
|
],
|
|
1587
1587
|
// Age 45 - 49
|
|
1588
1588
|
[
|
|
@@ -1590,7 +1590,7 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1590
1590
|
[9, 10, 11, 11, 12],
|
|
1591
1591
|
[7, 7, 8, 8, 9],
|
|
1592
1592
|
[5, 5, 6, 6, 6],
|
|
1593
|
-
[4, 4, 4, 4, 5]
|
|
1593
|
+
[4, 4, 4, 4, 5]
|
|
1594
1594
|
],
|
|
1595
1595
|
// Age 40 - 44
|
|
1596
1596
|
[
|
|
@@ -1598,10 +1598,10 @@ const southEastAsiaCvdRiskTables = [
|
|
|
1598
1598
|
[8, 8, 9, 9, 10],
|
|
1599
1599
|
[5, 6, 6, 7, 7],
|
|
1600
1600
|
[4, 4, 4, 5, 5],
|
|
1601
|
-
[3, 3, 3, 3, 4]
|
|
1602
|
-
]
|
|
1603
|
-
]
|
|
1604
|
-
]
|
|
1601
|
+
[3, 3, 3, 3, 4]
|
|
1602
|
+
]
|
|
1603
|
+
]
|
|
1604
|
+
]
|
|
1605
1605
|
];
|
|
1606
1606
|
|
|
1607
1607
|
class JsExpressionHelper {
|
|
@@ -1756,7 +1756,11 @@ class JsExpressionHelper {
|
|
|
1756
1756
|
return height && weight && refSectionObject ? formattedSDValue : null;
|
|
1757
1757
|
}
|
|
1758
1758
|
calcSouthEastAsiaNonLabCVDRisk(sex, smoker, age, sbp, bmi) {
|
|
1759
|
-
const hasValidValues =
|
|
1759
|
+
const hasValidValues = typeof sex === 'string' &&
|
|
1760
|
+
typeof smoker === 'boolean' &&
|
|
1761
|
+
typeof age === 'number' &&
|
|
1762
|
+
typeof sbp === 'number' &&
|
|
1763
|
+
typeof bmi === 'number';
|
|
1760
1764
|
if (!hasValidValues) {
|
|
1761
1765
|
return null;
|
|
1762
1766
|
}
|
|
@@ -1851,11 +1855,21 @@ class JsExpressionHelper {
|
|
|
1851
1855
|
var _a;
|
|
1852
1856
|
const findObs = (obs, uuid) => {
|
|
1853
1857
|
let result;
|
|
1854
|
-
obs === null || obs === void 0 ? void 0 : obs.some(o => {
|
|
1858
|
+
obs === null || obs === void 0 ? void 0 : obs.some((o) => {
|
|
1859
|
+
var _a;
|
|
1860
|
+
return (result =
|
|
1861
|
+
((_a = o === null || o === void 0 ? void 0 : o.concept) === null || _a === void 0 ? void 0 : _a.uuid) === uuid ? o : findObs(o.groupMembers || [], uuid));
|
|
1862
|
+
});
|
|
1855
1863
|
return result;
|
|
1856
1864
|
};
|
|
1857
1865
|
const obsValue = (_a = findObs(rawEncounter === null || rawEncounter === void 0 ? void 0 : rawEncounter.obs, uuid)) === null || _a === void 0 ? void 0 : _a.value;
|
|
1858
|
-
return !!targetControl
|
|
1866
|
+
return !!targetControl
|
|
1867
|
+
? targetControl
|
|
1868
|
+
: typeof obsValue === 'object'
|
|
1869
|
+
? obsValue.uuid
|
|
1870
|
+
: !!obsValue
|
|
1871
|
+
? obsValue
|
|
1872
|
+
: null;
|
|
1859
1873
|
}
|
|
1860
1874
|
doesNotMatchExpression(regexString, val) {
|
|
1861
1875
|
if (!val || ['undefined', 'null', ''].includes(val.toString())) {
|
|
@@ -1951,7 +1965,7 @@ class MaxLengthValidator {
|
|
|
1951
1965
|
return null;
|
|
1952
1966
|
}
|
|
1953
1967
|
if (control.value && control.value.length !== 0) {
|
|
1954
|
-
const v =
|
|
1968
|
+
const v = control.value.toString().length;
|
|
1955
1969
|
return v <= maxLength
|
|
1956
1970
|
? null
|
|
1957
1971
|
: { maxlength: { requiredLength: maxLength, actualValue: v } };
|
|
@@ -1968,7 +1982,7 @@ class MinLengthValidator {
|
|
|
1968
1982
|
return null;
|
|
1969
1983
|
}
|
|
1970
1984
|
if (control.value && control.value.length !== 0) {
|
|
1971
|
-
const v =
|
|
1985
|
+
const v = control.value.toString().length;
|
|
1972
1986
|
return v >= minLength
|
|
1973
1987
|
? null
|
|
1974
1988
|
: { minlength: { requiredLength: minLength, actualValue: v } };
|
|
@@ -8078,7 +8092,7 @@ class RadioButtonControlComponent {
|
|
|
8078
8092
|
}
|
|
8079
8093
|
get value() {
|
|
8080
8094
|
var _a;
|
|
8081
|
-
return (_a = this._value) !== null && _a !== void 0 ? _a :
|
|
8095
|
+
return (_a = this._value) !== null && _a !== void 0 ? _a : '';
|
|
8082
8096
|
}
|
|
8083
8097
|
set value(value) {
|
|
8084
8098
|
this._value = value;
|
|
@@ -8109,9 +8123,9 @@ class RadioButtonControlComponent {
|
|
|
8109
8123
|
}
|
|
8110
8124
|
updateSelectedOption() {
|
|
8111
8125
|
if (this.selected) {
|
|
8112
|
-
const maybeOpt = this.options.find(opt => opt.value === this.selected);
|
|
8126
|
+
const maybeOpt = this.options.find((opt) => opt.value === this.selected);
|
|
8113
8127
|
if (maybeOpt) {
|
|
8114
|
-
this.options.forEach(opt => opt.checked = opt === maybeOpt);
|
|
8128
|
+
this.options.forEach((opt) => (opt.checked = opt === maybeOpt));
|
|
8115
8129
|
this.value = this.selected;
|
|
8116
8130
|
}
|
|
8117
8131
|
}
|
|
@@ -8124,7 +8138,7 @@ RadioButtonControlComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.
|
|
|
8124
8138
|
useExisting: forwardRef(() => RadioButtonControlComponent),
|
|
8125
8139
|
multi: true
|
|
8126
8140
|
}
|
|
8127
|
-
], usesOnChanges: true, ngImport: i0, template: "<fieldset class=\"cds--fieldset\">\n <div\n *ngFor=\"let option of options; let i = index\"\n class=\"cds--form-item cds--radio-wrapper\"\n [ngClass]=\"{
|
|
8141
|
+
], usesOnChanges: true, ngImport: i0, template: "<fieldset class=\"cds--fieldset\">\n <div\n *ngFor=\"let option of options; let i = index\"\n class=\"cds--form-item cds--radio-wrapper\"\n [ngClass]=\"{ inline: orientation === 'horizontal' }\"\n >\n <label class=\"form-control no-border\">\n <input\n type=\"radio\"\n [id]=\"id + '_' + i\"\n [name]=\"id\"\n [checked]=\"option.checked\"\n [value]=\"option.value\"\n (click)=\"handleClick(option)\"\n (change)=\"handleChange(option)\"\n />\n {{ option.label }}\n </label>\n </div>\n</fieldset>\n", styles: [".inline{display:inline-block;padding-right:.5rem}\n"], directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
8128
8142
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: RadioButtonControlComponent, decorators: [{
|
|
8129
8143
|
type: Component,
|
|
8130
8144
|
args: [{
|
|
@@ -12488,7 +12502,9 @@ class ObsAdapterHelper {
|
|
|
12488
12502
|
var _a, _b;
|
|
12489
12503
|
let questionId = this.getQuestionIdFromFormFieldPath(item.formFieldPath);
|
|
12490
12504
|
if ((questionId && questionId === ((_b = (_a = node === null || node === void 0 ? void 0 : node.question) === null || _a === void 0 ? void 0 : _a.extras) === null || _b === void 0 ? void 0 : _b.id)) ||
|
|
12491
|
-
(!questionId &&
|
|
12505
|
+
(!questionId &&
|
|
12506
|
+
item.concept &&
|
|
12507
|
+
item.concept.uuid === node.question.extras.questionOptions.concept)) {
|
|
12492
12508
|
found.push(item);
|
|
12493
12509
|
}
|
|
12494
12510
|
});
|
|
@@ -13728,7 +13744,7 @@ class DiagnosisValueAdapter {
|
|
|
13728
13744
|
return this._createDiagnosesPayload(this.formDiagnosisNodes, form.existingDiagnoses);
|
|
13729
13745
|
}
|
|
13730
13746
|
populateForm(form, diagnoses) {
|
|
13731
|
-
form.existingDiagnoses = diagnoses === null || diagnoses === void 0 ? void 0 : diagnoses.filter(d => {
|
|
13747
|
+
form.existingDiagnoses = diagnoses === null || diagnoses === void 0 ? void 0 : diagnoses.filter((d) => {
|
|
13732
13748
|
return !d.voided;
|
|
13733
13749
|
});
|
|
13734
13750
|
this.formDiagnosisNodes = [];
|
|
@@ -13739,8 +13755,10 @@ class DiagnosisValueAdapter {
|
|
|
13739
13755
|
_createDiagnosesPayload(diagnosisNodes, existingDiagnoses) {
|
|
13740
13756
|
const payload = [];
|
|
13741
13757
|
let deletedDiagnoses = [];
|
|
13742
|
-
diagnosisNodes === null || diagnosisNodes === void 0 ? void 0 : diagnosisNodes.forEach(node => {
|
|
13743
|
-
node.control.value
|
|
13758
|
+
diagnosisNodes === null || diagnosisNodes === void 0 ? void 0 : diagnosisNodes.forEach((node) => {
|
|
13759
|
+
node.control.value
|
|
13760
|
+
.filter((v) => v[node.question.key])
|
|
13761
|
+
.forEach((value) => {
|
|
13744
13762
|
// Create Payload
|
|
13745
13763
|
const payloadDiagnosis = this._createPayloadDiagnosis(value[node.question.key], node.question.extras);
|
|
13746
13764
|
// Validate if is new value
|
|
@@ -13754,7 +13772,7 @@ class DiagnosisValueAdapter {
|
|
|
13754
13772
|
_createPayloadDiagnosis(codedUuid, questionExtras) {
|
|
13755
13773
|
const diagnosis = {
|
|
13756
13774
|
diagnosis: {
|
|
13757
|
-
coded: codedUuid
|
|
13775
|
+
coded: codedUuid
|
|
13758
13776
|
},
|
|
13759
13777
|
certainty: 'CONFIRMED',
|
|
13760
13778
|
rank: questionExtras.questionOptions.rank,
|
|
@@ -13763,29 +13781,31 @@ class DiagnosisValueAdapter {
|
|
|
13763
13781
|
return diagnosis;
|
|
13764
13782
|
}
|
|
13765
13783
|
_getDeletedDiagnoses(payloadDiagnoses, existingDiagnoses) {
|
|
13766
|
-
return existingDiagnoses === null || existingDiagnoses === void 0 ? void 0 : existingDiagnoses.filter(e => {
|
|
13767
|
-
return !payloadDiagnoses.find(p => {
|
|
13784
|
+
return existingDiagnoses === null || existingDiagnoses === void 0 ? void 0 : existingDiagnoses.filter((e) => {
|
|
13785
|
+
return !payloadDiagnoses.find((p) => {
|
|
13768
13786
|
let isSame = !e.voided && p.diagnosis.coded === e.diagnosis.coded.uuid;
|
|
13769
13787
|
return isSame;
|
|
13770
13788
|
});
|
|
13771
|
-
}).map(d => {
|
|
13789
|
+
}).map((d) => {
|
|
13772
13790
|
let diagnosisPayload = this._convert(d);
|
|
13773
13791
|
diagnosisPayload.voided = true;
|
|
13774
13792
|
return diagnosisPayload;
|
|
13775
13793
|
});
|
|
13776
13794
|
}
|
|
13777
13795
|
_updatedOldDiagnoses(payloadDiagnoses, existingDiagnoses) {
|
|
13778
|
-
payloadDiagnoses.forEach(p => {
|
|
13779
|
-
existingDiagnoses === null || existingDiagnoses === void 0 ? void 0 : existingDiagnoses.forEach(e => {
|
|
13796
|
+
payloadDiagnoses.forEach((p) => {
|
|
13797
|
+
existingDiagnoses === null || existingDiagnoses === void 0 ? void 0 : existingDiagnoses.forEach((e) => {
|
|
13780
13798
|
let isSame = !e.voided && p.diagnosis.coded === e.diagnosis.coded.uuid;
|
|
13781
13799
|
p.uuid = isSame ? e.uuid : null;
|
|
13782
13800
|
});
|
|
13783
13801
|
});
|
|
13784
13802
|
}
|
|
13785
13803
|
_setDiagnosesValues(formDiagnosisNodes, existingDiagnoses, rank) {
|
|
13786
|
-
formDiagnosisNodes === null || formDiagnosisNodes === void 0 ? void 0 : formDiagnosisNodes.filter(node => node.question.extras.questionOptions.rank == rank).forEach(node => {
|
|
13804
|
+
formDiagnosisNodes === null || formDiagnosisNodes === void 0 ? void 0 : formDiagnosisNodes.filter((node) => node.question.extras.questionOptions.rank == rank).forEach((node) => {
|
|
13787
13805
|
node['initialValue'] = existingDiagnoses;
|
|
13788
|
-
existingDiagnoses
|
|
13806
|
+
existingDiagnoses
|
|
13807
|
+
.filter((d) => d.rank == rank)
|
|
13808
|
+
.forEach((diagnosis, index) => {
|
|
13789
13809
|
node.createChildNode();
|
|
13790
13810
|
const value = {};
|
|
13791
13811
|
value[node.question.key] = diagnosis.diagnosis.coded.uuid;
|
|
@@ -13815,7 +13835,9 @@ class DiagnosisValueAdapter {
|
|
|
13815
13835
|
for (const node in formNode.children) {
|
|
13816
13836
|
const question = formNode.children[node].question;
|
|
13817
13837
|
const index = formNode.children[node].nodeIndex;
|
|
13818
|
-
if (question.extras &&
|
|
13838
|
+
if (question.extras &&
|
|
13839
|
+
question.extras.type === 'diagnosis' &&
|
|
13840
|
+
!this.formDiagnosisNodes.some((x) => index === x.nodeIndex)) {
|
|
13819
13841
|
this.formDiagnosisNodes.push(formNode.children[node]);
|
|
13820
13842
|
}
|
|
13821
13843
|
}
|
|
@@ -13836,11 +13858,11 @@ class DiagnosisValueAdapter {
|
|
|
13836
13858
|
patient: diagnosis.patient,
|
|
13837
13859
|
diagnosis: {
|
|
13838
13860
|
coded: diagnosis.diagnosis.coded.uuid,
|
|
13839
|
-
nonCoded: diagnosis.diagnosis.nonCoded
|
|
13861
|
+
nonCoded: diagnosis.diagnosis.nonCoded
|
|
13840
13862
|
},
|
|
13841
13863
|
certainty: diagnosis.certainty,
|
|
13842
13864
|
rank: diagnosis.rank,
|
|
13843
|
-
voided: diagnosis.voided
|
|
13865
|
+
voided: diagnosis.voided
|
|
13844
13866
|
};
|
|
13845
13867
|
}
|
|
13846
13868
|
}
|
|
@@ -13911,7 +13933,8 @@ class EncounterAdapter {
|
|
|
13911
13933
|
this.setNonFilledPayloadMembers(form, payload);
|
|
13912
13934
|
payload['obs'] = this.obsAdapter.generateFormPayload(form) || [];
|
|
13913
13935
|
payload['orders'] = this.ordersAdapter.generateFormPayload(form) || [];
|
|
13914
|
-
payload['diagnoses'] =
|
|
13936
|
+
payload['diagnoses'] =
|
|
13937
|
+
this.diagnosesAdapter.generateFormPayload(form) || [];
|
|
13915
13938
|
return payload;
|
|
13916
13939
|
}
|
|
13917
13940
|
generateNodePayload(rootNode) {
|