@medplum/agent 3.2.27 → 3.2.28
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/dist/cjs/index.cjs +819 -800
- package/package.json +5 -5
package/dist/cjs/index.cjs
CHANGED
|
@@ -483,8 +483,8 @@ var require_utf32 = __commonJS({
|
|
|
483
483
|
outer_loop:
|
|
484
484
|
for (var i = 0; i < bufs.length; i++) {
|
|
485
485
|
var buf = bufs[i];
|
|
486
|
-
for (var
|
|
487
|
-
b2.push(buf[
|
|
486
|
+
for (var j2 = 0; j2 < buf.length; j2++) {
|
|
487
|
+
b2.push(buf[j2]);
|
|
488
488
|
if (b2.length === 4) {
|
|
489
489
|
if (charsProcessed === 0) {
|
|
490
490
|
if (b2[0] === 255 && b2[1] === 254 && b2[2] === 0 && b2[3] === 0) {
|
|
@@ -543,19 +543,19 @@ var require_utf16 = __commonJS({
|
|
|
543
543
|
Utf16BEDecoder.prototype.write = function(buf) {
|
|
544
544
|
if (buf.length == 0)
|
|
545
545
|
return "";
|
|
546
|
-
var buf2 = Buffer2.alloc(buf.length + 1), i = 0,
|
|
546
|
+
var buf2 = Buffer2.alloc(buf.length + 1), i = 0, j2 = 0;
|
|
547
547
|
if (this.overflowByte !== -1) {
|
|
548
548
|
buf2[0] = buf[0];
|
|
549
549
|
buf2[1] = this.overflowByte;
|
|
550
550
|
i = 1;
|
|
551
|
-
|
|
551
|
+
j2 = 2;
|
|
552
552
|
}
|
|
553
|
-
for (; i < buf.length - 1; i += 2,
|
|
554
|
-
buf2[
|
|
555
|
-
buf2[
|
|
553
|
+
for (; i < buf.length - 1; i += 2, j2 += 2) {
|
|
554
|
+
buf2[j2] = buf[i + 1];
|
|
555
|
+
buf2[j2 + 1] = buf[i];
|
|
556
556
|
}
|
|
557
557
|
this.overflowByte = i == buf.length - 1 ? buf[buf.length - 1] : -1;
|
|
558
|
-
return buf2.slice(0,
|
|
558
|
+
return buf2.slice(0, j2).toString("ucs2");
|
|
559
559
|
};
|
|
560
560
|
Utf16BEDecoder.prototype.end = function() {
|
|
561
561
|
this.overflowByte = -1;
|
|
@@ -623,8 +623,8 @@ var require_utf16 = __commonJS({
|
|
|
623
623
|
outer_loop:
|
|
624
624
|
for (var i = 0; i < bufs.length; i++) {
|
|
625
625
|
var buf = bufs[i];
|
|
626
|
-
for (var
|
|
627
|
-
b2.push(buf[
|
|
626
|
+
for (var j2 = 0; j2 < buf.length; j2++) {
|
|
627
|
+
b2.push(buf[j2]);
|
|
628
628
|
if (b2.length === 2) {
|
|
629
629
|
if (charsProcessed === 0) {
|
|
630
630
|
if (b2[0] === 255 && b2[1] === 254) return "utf-16le";
|
|
@@ -1548,13 +1548,13 @@ var require_dbcs_codec = __commonJS({
|
|
|
1548
1548
|
var firstByteNode = this.decodeTables[0];
|
|
1549
1549
|
for (var i2 = 129; i2 <= 254; i2++) {
|
|
1550
1550
|
var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i2]];
|
|
1551
|
-
for (var
|
|
1552
|
-
if (secondByteNode[
|
|
1553
|
-
secondByteNode[
|
|
1554
|
-
} else if (secondByteNode[
|
|
1551
|
+
for (var j2 = 48; j2 <= 57; j2++) {
|
|
1552
|
+
if (secondByteNode[j2] === UNASSIGNED) {
|
|
1553
|
+
secondByteNode[j2] = NODE_START - commonThirdByteNodeIdx;
|
|
1554
|
+
} else if (secondByteNode[j2] > NODE_START) {
|
|
1555
1555
|
throw new Error("gb18030 decode tables conflict at byte 2");
|
|
1556
1556
|
}
|
|
1557
|
-
var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[
|
|
1557
|
+
var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j2]];
|
|
1558
1558
|
for (var k2 = 129; k2 <= 254; k2++) {
|
|
1559
1559
|
if (thirdByteNode[k2] === UNASSIGNED) {
|
|
1560
1560
|
thirdByteNode[k2] = NODE_START - commonFourthByteNodeIdx;
|
|
@@ -1564,9 +1564,9 @@ var require_dbcs_codec = __commonJS({
|
|
|
1564
1564
|
throw new Error("gb18030 decode tables conflict at byte 3");
|
|
1565
1565
|
}
|
|
1566
1566
|
var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k2]];
|
|
1567
|
-
for (var
|
|
1568
|
-
if (fourthByteNode[
|
|
1569
|
-
fourthByteNode[
|
|
1567
|
+
for (var l2 = 48; l2 <= 57; l2++) {
|
|
1568
|
+
if (fourthByteNode[l2] === UNASSIGNED)
|
|
1569
|
+
fourthByteNode[l2] = GB18030_CODE;
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
1572
1572
|
}
|
|
@@ -1582,8 +1582,8 @@ var require_dbcs_codec = __commonJS({
|
|
|
1582
1582
|
if (typeof val === "number")
|
|
1583
1583
|
skipEncodeChars[val] = true;
|
|
1584
1584
|
else
|
|
1585
|
-
for (var
|
|
1586
|
-
skipEncodeChars[
|
|
1585
|
+
for (var j2 = val.from; j2 <= val.to; j2++)
|
|
1586
|
+
skipEncodeChars[j2] = true;
|
|
1587
1587
|
}
|
|
1588
1588
|
this._fillEncodeTable(0, 0, skipEncodeChars);
|
|
1589
1589
|
if (codecOptions.encodeAdd) {
|
|
@@ -1623,10 +1623,10 @@ var require_dbcs_codec = __commonJS({
|
|
|
1623
1623
|
for (var k2 = 1; k2 < chunk.length; k2++) {
|
|
1624
1624
|
var part = chunk[k2];
|
|
1625
1625
|
if (typeof part === "string") {
|
|
1626
|
-
for (var
|
|
1627
|
-
var code = part.charCodeAt(
|
|
1626
|
+
for (var l2 = 0; l2 < part.length; ) {
|
|
1627
|
+
var code = part.charCodeAt(l2++);
|
|
1628
1628
|
if (55296 <= code && code < 56320) {
|
|
1629
|
-
var codeTrail = part.charCodeAt(
|
|
1629
|
+
var codeTrail = part.charCodeAt(l2++);
|
|
1630
1630
|
if (56320 <= codeTrail && codeTrail < 57344)
|
|
1631
1631
|
writeTable[curAddr++] = 65536 + (code - 55296) * 1024 + (codeTrail - 56320);
|
|
1632
1632
|
else
|
|
@@ -1635,7 +1635,7 @@ var require_dbcs_codec = __commonJS({
|
|
|
1635
1635
|
var len = 4095 - code + 2;
|
|
1636
1636
|
var seq = [];
|
|
1637
1637
|
for (var m2 = 0; m2 < len; m2++)
|
|
1638
|
-
seq.push(part.charCodeAt(
|
|
1638
|
+
seq.push(part.charCodeAt(l2++));
|
|
1639
1639
|
writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length;
|
|
1640
1640
|
this.decodeTableSeq.push(seq);
|
|
1641
1641
|
} else
|
|
@@ -1643,7 +1643,7 @@ var require_dbcs_codec = __commonJS({
|
|
|
1643
1643
|
}
|
|
1644
1644
|
} else if (typeof part === "number") {
|
|
1645
1645
|
var charCode = writeTable[curAddr - 1] + 1;
|
|
1646
|
-
for (var
|
|
1646
|
+
for (var l2 = 0; l2 < part; l2++)
|
|
1647
1647
|
writeTable[curAddr++] = charCode++;
|
|
1648
1648
|
} else
|
|
1649
1649
|
throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]);
|
|
@@ -1678,7 +1678,7 @@ var require_dbcs_codec = __commonJS({
|
|
|
1678
1678
|
bucket[low] = SEQ_START - this.encodeTableSeq.length;
|
|
1679
1679
|
this.encodeTableSeq.push(node);
|
|
1680
1680
|
}
|
|
1681
|
-
for (var
|
|
1681
|
+
for (var j2 = 1; j2 < seq.length - 1; j2++) {
|
|
1682
1682
|
var oldVal = node[uCode];
|
|
1683
1683
|
if (typeof oldVal === "object")
|
|
1684
1684
|
node = oldVal;
|
|
@@ -1728,7 +1728,7 @@ var require_dbcs_codec = __commonJS({
|
|
|
1728
1728
|
this.gb18030 = codec.gb18030;
|
|
1729
1729
|
}
|
|
1730
1730
|
DBCSEncoder.prototype.write = function(str) {
|
|
1731
|
-
var newBuf = Buffer2.alloc(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i2 = 0,
|
|
1731
|
+
var newBuf = Buffer2.alloc(str.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i2 = 0, j2 = 0;
|
|
1732
1732
|
while (true) {
|
|
1733
1733
|
if (nextChar === -1) {
|
|
1734
1734
|
if (i2 == str.length) break;
|
|
@@ -1788,13 +1788,13 @@ var require_dbcs_codec = __commonJS({
|
|
|
1788
1788
|
var idx = findIdx(this.gb18030.uChars, uCode);
|
|
1789
1789
|
if (idx != -1) {
|
|
1790
1790
|
var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]);
|
|
1791
|
-
newBuf[
|
|
1791
|
+
newBuf[j2++] = 129 + Math.floor(dbcsCode / 12600);
|
|
1792
1792
|
dbcsCode = dbcsCode % 12600;
|
|
1793
|
-
newBuf[
|
|
1793
|
+
newBuf[j2++] = 48 + Math.floor(dbcsCode / 1260);
|
|
1794
1794
|
dbcsCode = dbcsCode % 1260;
|
|
1795
|
-
newBuf[
|
|
1795
|
+
newBuf[j2++] = 129 + Math.floor(dbcsCode / 10);
|
|
1796
1796
|
dbcsCode = dbcsCode % 10;
|
|
1797
|
-
newBuf[
|
|
1797
|
+
newBuf[j2++] = 48 + dbcsCode;
|
|
1798
1798
|
continue;
|
|
1799
1799
|
}
|
|
1800
1800
|
}
|
|
@@ -1802,47 +1802,47 @@ var require_dbcs_codec = __commonJS({
|
|
|
1802
1802
|
if (dbcsCode === UNASSIGNED)
|
|
1803
1803
|
dbcsCode = this.defaultCharSingleByte;
|
|
1804
1804
|
if (dbcsCode < 256) {
|
|
1805
|
-
newBuf[
|
|
1805
|
+
newBuf[j2++] = dbcsCode;
|
|
1806
1806
|
} else if (dbcsCode < 65536) {
|
|
1807
|
-
newBuf[
|
|
1808
|
-
newBuf[
|
|
1807
|
+
newBuf[j2++] = dbcsCode >> 8;
|
|
1808
|
+
newBuf[j2++] = dbcsCode & 255;
|
|
1809
1809
|
} else if (dbcsCode < 16777216) {
|
|
1810
|
-
newBuf[
|
|
1811
|
-
newBuf[
|
|
1812
|
-
newBuf[
|
|
1810
|
+
newBuf[j2++] = dbcsCode >> 16;
|
|
1811
|
+
newBuf[j2++] = dbcsCode >> 8 & 255;
|
|
1812
|
+
newBuf[j2++] = dbcsCode & 255;
|
|
1813
1813
|
} else {
|
|
1814
|
-
newBuf[
|
|
1815
|
-
newBuf[
|
|
1816
|
-
newBuf[
|
|
1817
|
-
newBuf[
|
|
1814
|
+
newBuf[j2++] = dbcsCode >>> 24;
|
|
1815
|
+
newBuf[j2++] = dbcsCode >>> 16 & 255;
|
|
1816
|
+
newBuf[j2++] = dbcsCode >>> 8 & 255;
|
|
1817
|
+
newBuf[j2++] = dbcsCode & 255;
|
|
1818
1818
|
}
|
|
1819
1819
|
}
|
|
1820
1820
|
this.seqObj = seqObj;
|
|
1821
1821
|
this.leadSurrogate = leadSurrogate;
|
|
1822
|
-
return newBuf.slice(0,
|
|
1822
|
+
return newBuf.slice(0, j2);
|
|
1823
1823
|
};
|
|
1824
1824
|
DBCSEncoder.prototype.end = function() {
|
|
1825
1825
|
if (this.leadSurrogate === -1 && this.seqObj === void 0)
|
|
1826
1826
|
return;
|
|
1827
|
-
var newBuf = Buffer2.alloc(10),
|
|
1827
|
+
var newBuf = Buffer2.alloc(10), j2 = 0;
|
|
1828
1828
|
if (this.seqObj) {
|
|
1829
1829
|
var dbcsCode = this.seqObj[DEF_CHAR];
|
|
1830
1830
|
if (dbcsCode !== void 0) {
|
|
1831
1831
|
if (dbcsCode < 256) {
|
|
1832
|
-
newBuf[
|
|
1832
|
+
newBuf[j2++] = dbcsCode;
|
|
1833
1833
|
} else {
|
|
1834
|
-
newBuf[
|
|
1835
|
-
newBuf[
|
|
1834
|
+
newBuf[j2++] = dbcsCode >> 8;
|
|
1835
|
+
newBuf[j2++] = dbcsCode & 255;
|
|
1836
1836
|
}
|
|
1837
1837
|
} else {
|
|
1838
1838
|
}
|
|
1839
1839
|
this.seqObj = void 0;
|
|
1840
1840
|
}
|
|
1841
1841
|
if (this.leadSurrogate !== -1) {
|
|
1842
|
-
newBuf[
|
|
1842
|
+
newBuf[j2++] = this.defaultCharSingleByte;
|
|
1843
1843
|
this.leadSurrogate = -1;
|
|
1844
1844
|
}
|
|
1845
|
-
return newBuf.slice(0,
|
|
1845
|
+
return newBuf.slice(0, j2);
|
|
1846
1846
|
};
|
|
1847
1847
|
DBCSEncoder.prototype.findIdx = findIdx;
|
|
1848
1848
|
function DBCSDecoder(options, codec) {
|
|
@@ -1855,7 +1855,7 @@ var require_dbcs_codec = __commonJS({
|
|
|
1855
1855
|
}
|
|
1856
1856
|
DBCSDecoder.prototype.write = function(buf) {
|
|
1857
1857
|
var newBuf = Buffer2.alloc(buf.length * 2), nodeIdx = this.nodeIdx, prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, seqStart = -this.prevBytes.length, uCode;
|
|
1858
|
-
for (var i2 = 0,
|
|
1858
|
+
for (var i2 = 0, j2 = 0; i2 < buf.length; i2++) {
|
|
1859
1859
|
var curByte = i2 >= 0 ? buf[i2] : prevBytes[i2 + prevOffset];
|
|
1860
1860
|
var uCode = this.decodeTables[nodeIdx][curByte];
|
|
1861
1861
|
if (uCode >= 0) {
|
|
@@ -1877,8 +1877,8 @@ var require_dbcs_codec = __commonJS({
|
|
|
1877
1877
|
var seq = this.decodeTableSeq[SEQ_START - uCode];
|
|
1878
1878
|
for (var k2 = 0; k2 < seq.length - 1; k2++) {
|
|
1879
1879
|
uCode = seq[k2];
|
|
1880
|
-
newBuf[
|
|
1881
|
-
newBuf[
|
|
1880
|
+
newBuf[j2++] = uCode & 255;
|
|
1881
|
+
newBuf[j2++] = uCode >> 8;
|
|
1882
1882
|
}
|
|
1883
1883
|
uCode = seq[seq.length - 1];
|
|
1884
1884
|
} else
|
|
@@ -1886,18 +1886,18 @@ var require_dbcs_codec = __commonJS({
|
|
|
1886
1886
|
if (uCode >= 65536) {
|
|
1887
1887
|
uCode -= 65536;
|
|
1888
1888
|
var uCodeLead = 55296 | uCode >> 10;
|
|
1889
|
-
newBuf[
|
|
1890
|
-
newBuf[
|
|
1889
|
+
newBuf[j2++] = uCodeLead & 255;
|
|
1890
|
+
newBuf[j2++] = uCodeLead >> 8;
|
|
1891
1891
|
uCode = 56320 | uCode & 1023;
|
|
1892
1892
|
}
|
|
1893
|
-
newBuf[
|
|
1894
|
-
newBuf[
|
|
1893
|
+
newBuf[j2++] = uCode & 255;
|
|
1894
|
+
newBuf[j2++] = uCode >> 8;
|
|
1895
1895
|
nodeIdx = 0;
|
|
1896
1896
|
seqStart = i2 + 1;
|
|
1897
1897
|
}
|
|
1898
1898
|
this.nodeIdx = nodeIdx;
|
|
1899
1899
|
this.prevBytes = seqStart >= 0 ? Array.prototype.slice.call(buf, seqStart) : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf));
|
|
1900
|
-
return newBuf.slice(0,
|
|
1900
|
+
return newBuf.slice(0, j2).toString("ucs2");
|
|
1901
1901
|
};
|
|
1902
1902
|
DBCSDecoder.prototype.end = function() {
|
|
1903
1903
|
var ret = "";
|
|
@@ -1916,15 +1916,15 @@ var require_dbcs_codec = __commonJS({
|
|
|
1916
1916
|
function findIdx(table, val) {
|
|
1917
1917
|
if (table[0] > val)
|
|
1918
1918
|
return -1;
|
|
1919
|
-
var
|
|
1920
|
-
while (
|
|
1921
|
-
var mid =
|
|
1919
|
+
var l2 = 0, r7 = table.length;
|
|
1920
|
+
while (l2 < r7 - 1) {
|
|
1921
|
+
var mid = l2 + (r7 - l2 + 1 >> 1);
|
|
1922
1922
|
if (table[mid] <= val)
|
|
1923
|
-
|
|
1923
|
+
l2 = mid;
|
|
1924
1924
|
else
|
|
1925
1925
|
r7 = mid;
|
|
1926
1926
|
}
|
|
1927
|
-
return
|
|
1927
|
+
return l2;
|
|
1928
1928
|
}
|
|
1929
1929
|
}
|
|
1930
1930
|
});
|
|
@@ -7633,12 +7633,12 @@ var require_dcmjs = __commonJS({
|
|
|
7633
7633
|
};
|
|
7634
7634
|
return _getPrototypeOf(o);
|
|
7635
7635
|
}
|
|
7636
|
-
function _setPrototypeOf(o,
|
|
7637
|
-
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2,
|
|
7638
|
-
o2.__proto__ =
|
|
7636
|
+
function _setPrototypeOf(o, p3) {
|
|
7637
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p4) {
|
|
7638
|
+
o2.__proto__ = p4;
|
|
7639
7639
|
return o2;
|
|
7640
7640
|
};
|
|
7641
|
-
return _setPrototypeOf(o,
|
|
7641
|
+
return _setPrototypeOf(o, p3);
|
|
7642
7642
|
}
|
|
7643
7643
|
function _isNativeReflectConstruct() {
|
|
7644
7644
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
@@ -7767,7 +7767,7 @@ var require_dcmjs = __commonJS({
|
|
|
7767
7767
|
var _arr = [];
|
|
7768
7768
|
var _n2 = true;
|
|
7769
7769
|
var _d = false;
|
|
7770
|
-
var _s,
|
|
7770
|
+
var _s, _e;
|
|
7771
7771
|
try {
|
|
7772
7772
|
for (_i = _i.call(arr); !(_n2 = (_s = _i.next()).done); _n2 = true) {
|
|
7773
7773
|
_arr.push(_s.value);
|
|
@@ -7775,12 +7775,12 @@ var require_dcmjs = __commonJS({
|
|
|
7775
7775
|
}
|
|
7776
7776
|
} catch (err2) {
|
|
7777
7777
|
_d = true;
|
|
7778
|
-
|
|
7778
|
+
_e = err2;
|
|
7779
7779
|
} finally {
|
|
7780
7780
|
try {
|
|
7781
7781
|
if (!_n2 && _i["return"] != null) _i["return"]();
|
|
7782
7782
|
} finally {
|
|
7783
|
-
if (_d) throw
|
|
7783
|
+
if (_d) throw _e;
|
|
7784
7784
|
}
|
|
7785
7785
|
}
|
|
7786
7786
|
return _arr;
|
|
@@ -7805,10 +7805,10 @@ var require_dcmjs = __commonJS({
|
|
|
7805
7805
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
7806
7806
|
}
|
|
7807
7807
|
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
7808
|
-
var
|
|
7809
|
-
if (!
|
|
7810
|
-
if (Array.isArray(o) || (
|
|
7811
|
-
if (
|
|
7808
|
+
var it2 = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
7809
|
+
if (!it2) {
|
|
7810
|
+
if (Array.isArray(o) || (it2 = _unsupportedIterableToArray(o)) || allowArrayLike) {
|
|
7811
|
+
if (it2) o = it2;
|
|
7812
7812
|
var i = 0;
|
|
7813
7813
|
var F2 = function() {
|
|
7814
7814
|
};
|
|
@@ -7834,10 +7834,10 @@ var require_dcmjs = __commonJS({
|
|
|
7834
7834
|
var normalCompletion = true, didErr = false, err2;
|
|
7835
7835
|
return {
|
|
7836
7836
|
s: function() {
|
|
7837
|
-
|
|
7837
|
+
it2 = it2.call(o);
|
|
7838
7838
|
},
|
|
7839
7839
|
n: function() {
|
|
7840
|
-
var step =
|
|
7840
|
+
var step = it2.next();
|
|
7841
7841
|
normalCompletion = step.done;
|
|
7842
7842
|
return step;
|
|
7843
7843
|
},
|
|
@@ -7847,7 +7847,7 @@ var require_dcmjs = __commonJS({
|
|
|
7847
7847
|
},
|
|
7848
7848
|
f: function() {
|
|
7849
7849
|
try {
|
|
7850
|
-
if (!normalCompletion &&
|
|
7850
|
+
if (!normalCompletion && it2.return != null) it2.return();
|
|
7851
7851
|
} finally {
|
|
7852
7852
|
if (didErr) throw err2;
|
|
7853
7853
|
}
|
|
@@ -8156,17 +8156,17 @@ var require_dcmjs = __commonJS({
|
|
|
8156
8156
|
};
|
|
8157
8157
|
const pqdownheap = (s, tree, k2) => {
|
|
8158
8158
|
const v2 = s.heap[k2];
|
|
8159
|
-
let
|
|
8160
|
-
while (
|
|
8161
|
-
if (
|
|
8162
|
-
|
|
8159
|
+
let j2 = k2 << 1;
|
|
8160
|
+
while (j2 <= s.heap_len) {
|
|
8161
|
+
if (j2 < s.heap_len && smaller(tree, s.heap[j2 + 1], s.heap[j2], s.depth)) {
|
|
8162
|
+
j2++;
|
|
8163
8163
|
}
|
|
8164
|
-
if (smaller(tree, v2, s.heap[
|
|
8164
|
+
if (smaller(tree, v2, s.heap[j2], s.depth)) {
|
|
8165
8165
|
break;
|
|
8166
8166
|
}
|
|
8167
|
-
s.heap[k2] = s.heap[
|
|
8168
|
-
k2 =
|
|
8169
|
-
|
|
8167
|
+
s.heap[k2] = s.heap[j2];
|
|
8168
|
+
k2 = j2;
|
|
8169
|
+
j2 <<= 1;
|
|
8170
8170
|
}
|
|
8171
8171
|
s.heap[k2] = v2;
|
|
8172
8172
|
};
|
|
@@ -8752,7 +8752,7 @@ var require_dcmjs = __commonJS({
|
|
|
8752
8752
|
};
|
|
8753
8753
|
const fill_window = (s) => {
|
|
8754
8754
|
const _w_size = s.w_size;
|
|
8755
|
-
let
|
|
8755
|
+
let p3, n, m2, more, str2;
|
|
8756
8756
|
do {
|
|
8757
8757
|
more = s.window_size - s.lookahead - s.strstart;
|
|
8758
8758
|
if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {
|
|
@@ -8761,16 +8761,16 @@ var require_dcmjs = __commonJS({
|
|
|
8761
8761
|
s.strstart -= _w_size;
|
|
8762
8762
|
s.block_start -= _w_size;
|
|
8763
8763
|
n = s.hash_size;
|
|
8764
|
-
|
|
8764
|
+
p3 = n;
|
|
8765
8765
|
do {
|
|
8766
|
-
m2 = s.head[--
|
|
8767
|
-
s.head[
|
|
8766
|
+
m2 = s.head[--p3];
|
|
8767
|
+
s.head[p3] = m2 >= _w_size ? m2 - _w_size : 0;
|
|
8768
8768
|
} while (--n);
|
|
8769
8769
|
n = _w_size;
|
|
8770
|
-
|
|
8770
|
+
p3 = n;
|
|
8771
8771
|
do {
|
|
8772
|
-
m2 = s.prev[--
|
|
8773
|
-
s.prev[
|
|
8772
|
+
m2 = s.prev[--p3];
|
|
8773
|
+
s.prev[p3] = m2 >= _w_size ? m2 - _w_size : 0;
|
|
8774
8774
|
} while (--n);
|
|
8775
8775
|
more += _w_size;
|
|
8776
8776
|
}
|
|
@@ -9647,9 +9647,9 @@ var require_dcmjs = __commonJS({
|
|
|
9647
9647
|
if (typeof source !== "object") {
|
|
9648
9648
|
throw new TypeError(source + "must be non-object");
|
|
9649
9649
|
}
|
|
9650
|
-
for (const
|
|
9651
|
-
if (_has(source,
|
|
9652
|
-
obj[
|
|
9650
|
+
for (const p3 in source) {
|
|
9651
|
+
if (_has(source, p3)) {
|
|
9652
|
+
obj[p3] = source[p3];
|
|
9653
9653
|
}
|
|
9654
9654
|
}
|
|
9655
9655
|
}
|
|
@@ -9657,11 +9657,11 @@ var require_dcmjs = __commonJS({
|
|
|
9657
9657
|
};
|
|
9658
9658
|
var flattenChunks = (chunks) => {
|
|
9659
9659
|
let len2 = 0;
|
|
9660
|
-
for (let i = 0,
|
|
9660
|
+
for (let i = 0, l2 = chunks.length; i < l2; i++) {
|
|
9661
9661
|
len2 += chunks[i].length;
|
|
9662
9662
|
}
|
|
9663
9663
|
const result = new Uint8Array(len2);
|
|
9664
|
-
for (let i = 0, pos = 0,
|
|
9664
|
+
for (let i = 0, pos = 0, l2 = chunks.length; i < l2; i++) {
|
|
9665
9665
|
let chunk = chunks[i];
|
|
9666
9666
|
result.set(chunk, pos);
|
|
9667
9667
|
pos += chunk.length;
|
|
@@ -13156,8 +13156,8 @@ var require_dcmjs = __commonJS({
|
|
|
13156
13156
|
if (fragmentMultiframe) {
|
|
13157
13157
|
fragmentsLength = Math.ceil(frameStream.size / fragmentSize);
|
|
13158
13158
|
}
|
|
13159
|
-
for (var
|
|
13160
|
-
var isFinalFragment =
|
|
13159
|
+
for (var j2 = 0, fragmentStart = 0; j2 < fragmentsLength; j2++) {
|
|
13160
|
+
var isFinalFragment = j2 === fragmentsLength - 1;
|
|
13161
13161
|
var fragmentEnd = fragmentStart + frameStream.size;
|
|
13162
13162
|
if (fragmentMultiframe) {
|
|
13163
13163
|
fragmentEnd = fragmentStart + fragmentSize;
|
|
@@ -14823,21 +14823,21 @@ var require_dcmjs = __commonJS({
|
|
|
14823
14823
|
key: "rgb2XYZ",
|
|
14824
14824
|
value: function rgb2XYZ(rgb) {
|
|
14825
14825
|
var R2 = Colors2.invGammaCorrection(rgb[0]);
|
|
14826
|
-
var
|
|
14827
|
-
var
|
|
14828
|
-
return [0.41239558896741424 * R2 + 0.3575834307637148 *
|
|
14826
|
+
var G = Colors2.invGammaCorrection(rgb[1]);
|
|
14827
|
+
var B = Colors2.invGammaCorrection(rgb[2]);
|
|
14828
|
+
return [0.41239558896741424 * R2 + 0.3575834307637148 * G + 0.18049264738170157 * B, 0.21258623078559555 * R2 + 0.7151703037034108 * G + 0.07220049864333623 * B, 0.019297215491746945 * R2 + 0.11918386458084854 * G + 0.9504971251315798 * B];
|
|
14829
14829
|
}
|
|
14830
14830
|
}, {
|
|
14831
14831
|
key: "xyz2LAB",
|
|
14832
14832
|
value: function xyz2LAB(xyz) {
|
|
14833
14833
|
var whitePoint = Colors2.d65WhitePointXYZ();
|
|
14834
|
-
var
|
|
14834
|
+
var X = xyz[0] / whitePoint[0];
|
|
14835
14835
|
var Y2 = xyz[1] / whitePoint[1];
|
|
14836
|
-
var
|
|
14837
|
-
|
|
14836
|
+
var Z2 = xyz[2] / whitePoint[2];
|
|
14837
|
+
X = Colors2.labf(X);
|
|
14838
14838
|
Y2 = Colors2.labf(Y2);
|
|
14839
|
-
|
|
14840
|
-
return [116 * Y2 - 16, 500 * (
|
|
14839
|
+
Z2 = Colors2.labf(Z2);
|
|
14840
|
+
return [116 * Y2 - 16, 500 * (X - Y2), 200 * (Y2 - Z2)];
|
|
14841
14841
|
}
|
|
14842
14842
|
}, {
|
|
14843
14843
|
key: "lab2RGB",
|
|
@@ -15689,11 +15689,11 @@ var require_dcmjs = __commonJS({
|
|
|
15689
15689
|
var byteOffset = existingFrames * sliceLength;
|
|
15690
15690
|
var pixelDataUInt8View = new Uint8Array(dataset.PixelData, byteOffset, labelmaps.length * sliceLength);
|
|
15691
15691
|
var occupiedValue = this._getOccupiedValue();
|
|
15692
|
-
for (var
|
|
15693
|
-
var labelmap = labelmaps[
|
|
15692
|
+
for (var l2 = 0; l2 < labelmaps.length; l2++) {
|
|
15693
|
+
var labelmap = labelmaps[l2];
|
|
15694
15694
|
for (var i = 0; i < labelmap.length; i++) {
|
|
15695
15695
|
if (labelmap[i] === segmentIndex) {
|
|
15696
|
-
pixelDataUInt8View[
|
|
15696
|
+
pixelDataUInt8View[l2 * sliceLength + i] = occupiedValue;
|
|
15697
15697
|
}
|
|
15698
15698
|
}
|
|
15699
15699
|
}
|
|
@@ -16311,8 +16311,8 @@ var require_dcmjs = __commonJS({
|
|
|
16311
16311
|
return contentItem.ConceptNameCodeSequence.CodeMeaning === TRACKING_IDENTIFIER;
|
|
16312
16312
|
});
|
|
16313
16313
|
var TrackingIdentifierValue = TrackingIdentifierGroup.TextValue;
|
|
16314
|
-
var toolClass = hooks.getToolClass ? hooks.getToolClass(measurementGroup, dataset, registeredToolClasses) : registeredToolClasses.find(function(
|
|
16315
|
-
return
|
|
16314
|
+
var toolClass = hooks.getToolClass ? hooks.getToolClass(measurementGroup, dataset, registeredToolClasses) : registeredToolClasses.find(function(tc2) {
|
|
16315
|
+
return tc2.isValidCornerstoneTrackingIdentifier(TrackingIdentifierValue);
|
|
16316
16316
|
});
|
|
16317
16317
|
if (toolClass) {
|
|
16318
16318
|
var measurement = toolClass.getMeasurementData(measurementGroup);
|
|
@@ -17727,8 +17727,8 @@ var require_dcmjs = __commonJS({
|
|
|
17727
17727
|
var _matrix$shape = _slicedToArray(matrix.shape, 2), rows = _matrix$shape[0], cols = _matrix$shape[1];
|
|
17728
17728
|
var result = ndarray$1(new Uint8Array(rows * cols), [rows, cols]);
|
|
17729
17729
|
for (var i = 0; i < rows; i++) {
|
|
17730
|
-
for (var
|
|
17731
|
-
result.set(i,
|
|
17730
|
+
for (var j2 = 0; j2 < cols; j2++) {
|
|
17731
|
+
result.set(i, j2, matrix.get(i, cols - 1 - j2));
|
|
17732
17732
|
}
|
|
17733
17733
|
}
|
|
17734
17734
|
return result;
|
|
@@ -17736,9 +17736,9 @@ var require_dcmjs = __commonJS({
|
|
|
17736
17736
|
function v(matrix) {
|
|
17737
17737
|
var _matrix$shape2 = _slicedToArray(matrix.shape, 2), rows = _matrix$shape2[0], cols = _matrix$shape2[1];
|
|
17738
17738
|
var result = ndarray$1(new Uint8Array(rows * cols), [rows, cols]);
|
|
17739
|
-
for (var
|
|
17739
|
+
for (var j2 = 0; j2 < cols; j2++) {
|
|
17740
17740
|
for (var i = 0; i < rows; i++) {
|
|
17741
|
-
result.set(i,
|
|
17741
|
+
result.set(i, j2, matrix.get(rows - 1 - i, j2));
|
|
17742
17742
|
}
|
|
17743
17743
|
}
|
|
17744
17744
|
return result;
|
|
@@ -17748,8 +17748,8 @@ var require_dcmjs = __commonJS({
|
|
|
17748
17748
|
var result = ndarray$1(new Uint8Array(rows * cols), [cols, rows]);
|
|
17749
17749
|
var resultColsMinus1 = result.shape[1] - 1;
|
|
17750
17750
|
for (var i = 0; i < rows; i++) {
|
|
17751
|
-
for (var
|
|
17752
|
-
result.set(
|
|
17751
|
+
for (var j2 = 0; j2 < cols; j2++) {
|
|
17752
|
+
result.set(j2, resultColsMinus1 - i, matrix.get(i, j2));
|
|
17753
17753
|
}
|
|
17754
17754
|
}
|
|
17755
17755
|
return result;
|
|
@@ -17825,8 +17825,8 @@ var require_dcmjs = __commonJS({
|
|
|
17825
17825
|
var imageId = images[frame].imageId;
|
|
17826
17826
|
var imageIdSpecificToolState = toolState[imageId];
|
|
17827
17827
|
var brushPixelData = imageIdSpecificToolState.brush.data[segmentIndex].pixelData;
|
|
17828
|
-
for (var
|
|
17829
|
-
pixelData[pixelDataIndex] = brushPixelData[
|
|
17828
|
+
for (var p3 = 0; p3 < brushPixelData.length; p3++) {
|
|
17829
|
+
pixelData[pixelDataIndex] = brushPixelData[p3];
|
|
17830
17830
|
pixelDataIndex++;
|
|
17831
17831
|
}
|
|
17832
17832
|
}
|
|
@@ -17969,11 +17969,11 @@ var require_dcmjs = __commonJS({
|
|
|
17969
17969
|
var _pixelData2D$shape = _slicedToArray(pixelData2D.shape, 2);
|
|
17970
17970
|
_pixelData2D$shape[0];
|
|
17971
17971
|
_pixelData2D$shape[1];
|
|
17972
|
-
for (var
|
|
17973
|
-
if (pixelData2D.data[
|
|
17974
|
-
cToolsPixelData[
|
|
17972
|
+
for (var p3 = 0; p3 < cToolsPixelData.length; p3++) {
|
|
17973
|
+
if (pixelData2D.data[p3]) {
|
|
17974
|
+
cToolsPixelData[p3] = 1;
|
|
17975
17975
|
} else {
|
|
17976
|
-
cToolsPixelData[
|
|
17976
|
+
cToolsPixelData[p3] = 0;
|
|
17977
17977
|
}
|
|
17978
17978
|
}
|
|
17979
17979
|
}
|
|
@@ -18303,39 +18303,39 @@ var require_dcmjs = __commonJS({
|
|
|
18303
18303
|
return out;
|
|
18304
18304
|
}
|
|
18305
18305
|
function rotateX(out, a2, b2, rad) {
|
|
18306
|
-
var
|
|
18307
|
-
|
|
18308
|
-
|
|
18309
|
-
|
|
18310
|
-
r7[0] =
|
|
18311
|
-
r7[1] =
|
|
18312
|
-
r7[2] =
|
|
18306
|
+
var p3 = [], r7 = [];
|
|
18307
|
+
p3[0] = a2[0] - b2[0];
|
|
18308
|
+
p3[1] = a2[1] - b2[1];
|
|
18309
|
+
p3[2] = a2[2] - b2[2];
|
|
18310
|
+
r7[0] = p3[0];
|
|
18311
|
+
r7[1] = p3[1] * Math.cos(rad) - p3[2] * Math.sin(rad);
|
|
18312
|
+
r7[2] = p3[1] * Math.sin(rad) + p3[2] * Math.cos(rad);
|
|
18313
18313
|
out[0] = r7[0] + b2[0];
|
|
18314
18314
|
out[1] = r7[1] + b2[1];
|
|
18315
18315
|
out[2] = r7[2] + b2[2];
|
|
18316
18316
|
return out;
|
|
18317
18317
|
}
|
|
18318
18318
|
function rotateY(out, a2, b2, rad) {
|
|
18319
|
-
var
|
|
18320
|
-
|
|
18321
|
-
|
|
18322
|
-
|
|
18323
|
-
r7[0] =
|
|
18324
|
-
r7[1] =
|
|
18325
|
-
r7[2] =
|
|
18319
|
+
var p3 = [], r7 = [];
|
|
18320
|
+
p3[0] = a2[0] - b2[0];
|
|
18321
|
+
p3[1] = a2[1] - b2[1];
|
|
18322
|
+
p3[2] = a2[2] - b2[2];
|
|
18323
|
+
r7[0] = p3[2] * Math.sin(rad) + p3[0] * Math.cos(rad);
|
|
18324
|
+
r7[1] = p3[1];
|
|
18325
|
+
r7[2] = p3[2] * Math.cos(rad) - p3[0] * Math.sin(rad);
|
|
18326
18326
|
out[0] = r7[0] + b2[0];
|
|
18327
18327
|
out[1] = r7[1] + b2[1];
|
|
18328
18328
|
out[2] = r7[2] + b2[2];
|
|
18329
18329
|
return out;
|
|
18330
18330
|
}
|
|
18331
18331
|
function rotateZ(out, a2, b2, rad) {
|
|
18332
|
-
var
|
|
18333
|
-
|
|
18334
|
-
|
|
18335
|
-
|
|
18336
|
-
r7[0] =
|
|
18337
|
-
r7[1] =
|
|
18338
|
-
r7[2] =
|
|
18332
|
+
var p3 = [], r7 = [];
|
|
18333
|
+
p3[0] = a2[0] - b2[0];
|
|
18334
|
+
p3[1] = a2[1] - b2[1];
|
|
18335
|
+
p3[2] = a2[2] - b2[2];
|
|
18336
|
+
r7[0] = p3[0] * Math.cos(rad) - p3[1] * Math.sin(rad);
|
|
18337
|
+
r7[1] = p3[0] * Math.sin(rad) + p3[1] * Math.cos(rad);
|
|
18338
|
+
r7[2] = p3[2];
|
|
18339
18339
|
out[0] = r7[0] + b2[0];
|
|
18340
18340
|
out[1] = r7[1] + b2[1];
|
|
18341
18341
|
out[2] = r7[2] + b2[2];
|
|
@@ -18372,7 +18372,7 @@ var require_dcmjs = __commonJS({
|
|
|
18372
18372
|
var forEach = function() {
|
|
18373
18373
|
var vec = create();
|
|
18374
18374
|
return function(a2, stride, offset, count, fn, arg) {
|
|
18375
|
-
var i,
|
|
18375
|
+
var i, l2;
|
|
18376
18376
|
if (!stride) {
|
|
18377
18377
|
stride = 3;
|
|
18378
18378
|
}
|
|
@@ -18380,11 +18380,11 @@ var require_dcmjs = __commonJS({
|
|
|
18380
18380
|
offset = 0;
|
|
18381
18381
|
}
|
|
18382
18382
|
if (count) {
|
|
18383
|
-
|
|
18383
|
+
l2 = Math.min(count * stride + offset, a2.length);
|
|
18384
18384
|
} else {
|
|
18385
|
-
|
|
18385
|
+
l2 = a2.length;
|
|
18386
18386
|
}
|
|
18387
|
-
for (i = offset; i <
|
|
18387
|
+
for (i = offset; i < l2; i += stride) {
|
|
18388
18388
|
vec[0] = a2[i];
|
|
18389
18389
|
vec[1] = a2[i + 1];
|
|
18390
18390
|
vec[2] = a2[i + 2];
|
|
@@ -18505,24 +18505,24 @@ var require_dcmjs = __commonJS({
|
|
|
18505
18505
|
return headerUint32;
|
|
18506
18506
|
}
|
|
18507
18507
|
function getLiteralRunLength(uint8Row, i) {
|
|
18508
|
-
for (var
|
|
18509
|
-
if (uint8Row[i +
|
|
18510
|
-
return
|
|
18508
|
+
for (var l2 = 0; l2 < uint8Row.length - i; l2++) {
|
|
18509
|
+
if (uint8Row[i + l2] === uint8Row[i + l2 + 1] && uint8Row[i + l2 + 1] === uint8Row[i + l2 + 2]) {
|
|
18510
|
+
return l2;
|
|
18511
18511
|
}
|
|
18512
|
-
if (
|
|
18513
|
-
return
|
|
18512
|
+
if (l2 === 128) {
|
|
18513
|
+
return l2;
|
|
18514
18514
|
}
|
|
18515
18515
|
}
|
|
18516
18516
|
return uint8Row.length - i;
|
|
18517
18517
|
}
|
|
18518
18518
|
function getReplicateRunLength(uint8Row, i) {
|
|
18519
18519
|
var first = uint8Row[i];
|
|
18520
|
-
for (var
|
|
18521
|
-
if (uint8Row[i +
|
|
18522
|
-
return
|
|
18520
|
+
for (var l2 = 1; l2 < uint8Row.length - i; l2++) {
|
|
18521
|
+
if (uint8Row[i + l2] !== first) {
|
|
18522
|
+
return l2;
|
|
18523
18523
|
}
|
|
18524
|
-
if (
|
|
18525
|
-
return
|
|
18524
|
+
if (l2 === 128) {
|
|
18525
|
+
return l2;
|
|
18526
18526
|
}
|
|
18527
18527
|
}
|
|
18528
18528
|
return uint8Row.length - i;
|
|
@@ -18559,8 +18559,8 @@ var require_dcmjs = __commonJS({
|
|
|
18559
18559
|
if (byteValue <= 127) {
|
|
18560
18560
|
var N2 = byteValue + 1;
|
|
18561
18561
|
var next = i + 1;
|
|
18562
|
-
for (var
|
|
18563
|
-
pixelData[pixelDataIndex] = uInt8Frame[
|
|
18562
|
+
for (var p3 = next; p3 < next + N2; p3++) {
|
|
18563
|
+
pixelData[pixelDataIndex] = uInt8Frame[p3];
|
|
18564
18564
|
pixelDataIndex++;
|
|
18565
18565
|
}
|
|
18566
18566
|
i += N2 + 1;
|
|
@@ -19459,10 +19459,10 @@ var require_dcmjs = __commonJS({
|
|
|
19459
19459
|
continue;
|
|
19460
19460
|
}
|
|
19461
19461
|
var data3 = alignedPixelDataI.data;
|
|
19462
|
-
for (var
|
|
19463
|
-
if (data3[
|
|
19464
|
-
temp2DArray[
|
|
19465
|
-
if (temp2DArray[
|
|
19462
|
+
for (var j2 = 0, len2 = data3.length; j2 < len2; ++j2) {
|
|
19463
|
+
if (data3[j2] !== 0) {
|
|
19464
|
+
temp2DArray[j2]++;
|
|
19465
|
+
if (temp2DArray[j2] > 1) {
|
|
19466
19466
|
return true;
|
|
19467
19467
|
}
|
|
19468
19468
|
}
|
|
@@ -19526,9 +19526,9 @@ var require_dcmjs = __commonJS({
|
|
|
19526
19526
|
var labelmap2DView = new Uint16Array(tempBuffer, byteOffset, sliceLength);
|
|
19527
19527
|
var data3 = alignedPixelDataI.data;
|
|
19528
19528
|
var segmentOnFrame = false;
|
|
19529
|
-
for (var
|
|
19530
|
-
if (data3[
|
|
19531
|
-
if (labelmap2DView[
|
|
19529
|
+
for (var j2 = 0, len2 = alignedPixelDataI.data.length; j2 < len2; ++j2) {
|
|
19530
|
+
if (data3[j2]) {
|
|
19531
|
+
if (labelmap2DView[j2] !== 0) {
|
|
19532
19532
|
m2++;
|
|
19533
19533
|
if (m2 >= M3) {
|
|
19534
19534
|
labelmapBufferArray[m2] = new ArrayBuffer(arrayBufferLength);
|
|
@@ -19540,7 +19540,7 @@ var require_dcmjs = __commonJS({
|
|
|
19540
19540
|
_i2 = 0;
|
|
19541
19541
|
break;
|
|
19542
19542
|
} else {
|
|
19543
|
-
labelmap2DView[
|
|
19543
|
+
labelmap2DView[j2] = segmentIndex;
|
|
19544
19544
|
segmentOnFrame = true;
|
|
19545
19545
|
}
|
|
19546
19546
|
}
|
|
@@ -19610,9 +19610,9 @@ var require_dcmjs = __commonJS({
|
|
|
19610
19610
|
var byteOffset = sliceLength * 2 * imageIdIndex;
|
|
19611
19611
|
var labelmap2DView = new Uint16Array(labelmapBufferArray[0], byteOffset, sliceLength);
|
|
19612
19612
|
var data3 = alignedPixelDataI.data;
|
|
19613
|
-
for (var
|
|
19614
|
-
if (data3[
|
|
19615
|
-
for (var x2 =
|
|
19613
|
+
for (var j2 = 0, len2 = alignedPixelDataI.data.length; j2 < len2; ++j2) {
|
|
19614
|
+
if (data3[j2]) {
|
|
19615
|
+
for (var x2 = j2; x2 < len2; ++x2) {
|
|
19616
19616
|
if (data3[x2]) {
|
|
19617
19617
|
labelmap2DView[x2] = segmentIndex;
|
|
19618
19618
|
}
|
|
@@ -20344,8 +20344,8 @@ var require_dcmjs = __commonJS({
|
|
|
20344
20344
|
return contentItem.ConceptNameCodeSequence.CodeMeaning === TRACKING_IDENTIFIER;
|
|
20345
20345
|
});
|
|
20346
20346
|
var TrackingIdentifierValue = TrackingIdentifierGroup.TextValue;
|
|
20347
|
-
var toolClass = hooks.getToolClass ? hooks.getToolClass(measurementGroup, dataset, registeredToolClasses) : registeredToolClasses.find(function(
|
|
20348
|
-
return
|
|
20347
|
+
var toolClass = hooks.getToolClass ? hooks.getToolClass(measurementGroup, dataset, registeredToolClasses) : registeredToolClasses.find(function(tc2) {
|
|
20348
|
+
return tc2.isValidCornerstoneTrackingIdentifier(TrackingIdentifierValue);
|
|
20349
20349
|
});
|
|
20350
20350
|
if (toolClass) {
|
|
20351
20351
|
var measurement = toolClass.getMeasurementData(measurementGroup, sopInstanceUIDToImageIdMap, imageToWorldCoords, metadata);
|
|
@@ -21237,8 +21237,8 @@ var require_dcmjs = __commonJS({
|
|
|
21237
21237
|
return item.GraphicData;
|
|
21238
21238
|
}).filter(/* @__PURE__ */ function(s) {
|
|
21239
21239
|
return function(a2) {
|
|
21240
|
-
return function(
|
|
21241
|
-
return !s.has(
|
|
21240
|
+
return function(j2) {
|
|
21241
|
+
return !s.has(j2) && s.add(j2);
|
|
21242
21242
|
}(JSON.stringify(a2));
|
|
21243
21243
|
};
|
|
21244
21244
|
}(/* @__PURE__ */ new Set()));
|
|
@@ -21356,8 +21356,8 @@ var require_dcmjs = __commonJS({
|
|
|
21356
21356
|
return item.GraphicData;
|
|
21357
21357
|
}).filter(/* @__PURE__ */ function(s) {
|
|
21358
21358
|
return function(a2) {
|
|
21359
|
-
return function(
|
|
21360
|
-
return !s.has(
|
|
21359
|
+
return function(j2) {
|
|
21360
|
+
return !s.has(j2) && s.add(j2);
|
|
21361
21361
|
}(JSON.stringify(a2));
|
|
21362
21362
|
};
|
|
21363
21363
|
}(/* @__PURE__ */ new Set()));
|
|
@@ -21402,8 +21402,8 @@ var require_dcmjs = __commonJS({
|
|
|
21402
21402
|
});
|
|
21403
21403
|
return measurement.filter(/* @__PURE__ */ function(s) {
|
|
21404
21404
|
return function(a2) {
|
|
21405
|
-
return function(
|
|
21406
|
-
return !s.has(
|
|
21405
|
+
return function(j2) {
|
|
21406
|
+
return !s.has(j2) && s.add(j2);
|
|
21407
21407
|
}(JSON.stringify(a2));
|
|
21408
21408
|
};
|
|
21409
21409
|
}(/* @__PURE__ */ new Set()));
|
|
@@ -21440,8 +21440,8 @@ var require_dcmjs = __commonJS({
|
|
|
21440
21440
|
return item.GraphicData;
|
|
21441
21441
|
}).filter(/* @__PURE__ */ function(s) {
|
|
21442
21442
|
return function(a2) {
|
|
21443
|
-
return function(
|
|
21444
|
-
return !s.has(
|
|
21443
|
+
return function(j2) {
|
|
21444
|
+
return !s.has(j2) && s.add(j2);
|
|
21445
21445
|
}(JSON.stringify(a2));
|
|
21446
21446
|
};
|
|
21447
21447
|
}(/* @__PURE__ */ new Set()));
|
|
@@ -21485,8 +21485,8 @@ var require_dcmjs = __commonJS({
|
|
|
21485
21485
|
return item.GraphicData;
|
|
21486
21486
|
}).filter(/* @__PURE__ */ function(s) {
|
|
21487
21487
|
return function(a2) {
|
|
21488
|
-
return function(
|
|
21489
|
-
return !s.has(
|
|
21488
|
+
return function(j2) {
|
|
21489
|
+
return !s.has(j2) && s.add(j2);
|
|
21490
21490
|
}(JSON.stringify(a2));
|
|
21491
21491
|
};
|
|
21492
21492
|
}(/* @__PURE__ */ new Set()));
|
|
@@ -21600,7 +21600,7 @@ var require_dcmjs = __commonJS({
|
|
|
21600
21600
|
}
|
|
21601
21601
|
function stringToUint8Array(str2) {
|
|
21602
21602
|
var arr = new Uint8Array(str2.length);
|
|
21603
|
-
for (var i = 0,
|
|
21603
|
+
for (var i = 0, j2 = str2.length; i < j2; i++) {
|
|
21604
21604
|
arr[i] = str2.charCodeAt(i);
|
|
21605
21605
|
}
|
|
21606
21606
|
return arr;
|
|
@@ -27117,8 +27117,8 @@ var require_util = __commonJS({
|
|
|
27117
27117
|
};
|
|
27118
27118
|
exports2.nearestCommonProto = nearestCommonProto;
|
|
27119
27119
|
var hardMixProtos = (ingredients, constructor, exclude = []) => {
|
|
27120
|
-
var
|
|
27121
|
-
const base = (
|
|
27120
|
+
var _a2;
|
|
27121
|
+
const base = (_a2 = (0, exports2.nearestCommonProto)(...ingredients)) !== null && _a2 !== void 0 ? _a2 : Object.prototype;
|
|
27122
27122
|
const mixedProto = Object.create(base);
|
|
27123
27123
|
const visitedProtos = (0, exports2.protoChain)(base);
|
|
27124
27124
|
for (let prototype of ingredients) {
|
|
@@ -27248,8 +27248,8 @@ var require_mixin_tracking = __commonJS({
|
|
|
27248
27248
|
frontier.forEach((item) => visited.add(item));
|
|
27249
27249
|
const newFrontier = /* @__PURE__ */ new Set();
|
|
27250
27250
|
frontier.forEach((item) => {
|
|
27251
|
-
var
|
|
27252
|
-
const itemConstituents = (
|
|
27251
|
+
var _a2;
|
|
27252
|
+
const itemConstituents = (_a2 = mixins.get(item)) !== null && _a2 !== void 0 ? _a2 : (0, util_1.protoChain)(item.prototype).map((proto) => proto.constructor).filter((item2) => item2 !== null);
|
|
27253
27253
|
if (itemConstituents)
|
|
27254
27254
|
itemConstituents.forEach((constituent) => {
|
|
27255
27255
|
if (!visited.has(constituent) && !frontier.has(constituent))
|
|
@@ -27273,37 +27273,37 @@ var require_decorator = __commonJS({
|
|
|
27273
27273
|
var util_1 = require_util();
|
|
27274
27274
|
var mixin_tracking_1 = require_mixin_tracking();
|
|
27275
27275
|
var mergeObjectsOfDecorators = (o1, o2) => {
|
|
27276
|
-
var
|
|
27276
|
+
var _a2, _b;
|
|
27277
27277
|
const allKeys = (0, util_1.unique)([...Object.getOwnPropertyNames(o1), ...Object.getOwnPropertyNames(o2)]);
|
|
27278
27278
|
const mergedObject = {};
|
|
27279
27279
|
for (let key of allKeys)
|
|
27280
|
-
mergedObject[key] = (0, util_1.unique)([...(
|
|
27280
|
+
mergedObject[key] = (0, util_1.unique)([...(_a2 = o1 === null || o1 === void 0 ? void 0 : o1[key]) !== null && _a2 !== void 0 ? _a2 : [], ...(_b = o2 === null || o2 === void 0 ? void 0 : o2[key]) !== null && _b !== void 0 ? _b : []]);
|
|
27281
27281
|
return mergedObject;
|
|
27282
27282
|
};
|
|
27283
27283
|
var mergePropertyAndMethodDecorators = (d1, d22) => {
|
|
27284
|
-
var
|
|
27284
|
+
var _a2, _b, _c, _d;
|
|
27285
27285
|
return {
|
|
27286
|
-
property: mergeObjectsOfDecorators((
|
|
27286
|
+
property: mergeObjectsOfDecorators((_a2 = d1 === null || d1 === void 0 ? void 0 : d1.property) !== null && _a2 !== void 0 ? _a2 : {}, (_b = d22 === null || d22 === void 0 ? void 0 : d22.property) !== null && _b !== void 0 ? _b : {}),
|
|
27287
27287
|
method: mergeObjectsOfDecorators((_c = d1 === null || d1 === void 0 ? void 0 : d1.method) !== null && _c !== void 0 ? _c : {}, (_d = d22 === null || d22 === void 0 ? void 0 : d22.method) !== null && _d !== void 0 ? _d : {})
|
|
27288
27288
|
};
|
|
27289
27289
|
};
|
|
27290
27290
|
var mergeDecorators = (d1, d22) => {
|
|
27291
|
-
var
|
|
27291
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
27292
27292
|
return {
|
|
27293
|
-
class: (0, util_1.unique)([...(
|
|
27293
|
+
class: (0, util_1.unique)([...(_a2 = d1 === null || d1 === void 0 ? void 0 : d1.class) !== null && _a2 !== void 0 ? _a2 : [], ...(_b = d22 === null || d22 === void 0 ? void 0 : d22.class) !== null && _b !== void 0 ? _b : []]),
|
|
27294
27294
|
static: mergePropertyAndMethodDecorators((_c = d1 === null || d1 === void 0 ? void 0 : d1.static) !== null && _c !== void 0 ? _c : {}, (_d = d22 === null || d22 === void 0 ? void 0 : d22.static) !== null && _d !== void 0 ? _d : {}),
|
|
27295
|
-
instance: mergePropertyAndMethodDecorators((
|
|
27295
|
+
instance: mergePropertyAndMethodDecorators((_e = d1 === null || d1 === void 0 ? void 0 : d1.instance) !== null && _e !== void 0 ? _e : {}, (_f = d22 === null || d22 === void 0 ? void 0 : d22.instance) !== null && _f !== void 0 ? _f : {})
|
|
27296
27296
|
};
|
|
27297
27297
|
};
|
|
27298
27298
|
var decorators = /* @__PURE__ */ new Map();
|
|
27299
27299
|
var findAllConstituentClasses = (...classes) => {
|
|
27300
|
-
var
|
|
27300
|
+
var _a2;
|
|
27301
27301
|
const allClasses = /* @__PURE__ */ new Set();
|
|
27302
27302
|
const frontier = /* @__PURE__ */ new Set([...classes]);
|
|
27303
27303
|
while (frontier.size > 0) {
|
|
27304
27304
|
for (let clazz of frontier) {
|
|
27305
27305
|
const protoChainClasses = (0, util_1.protoChain)(clazz.prototype).map((proto) => proto.constructor);
|
|
27306
|
-
const mixinClasses = (
|
|
27306
|
+
const mixinClasses = (_a2 = (0, mixin_tracking_1.getMixinsForClass)(clazz)) !== null && _a2 !== void 0 ? _a2 : [];
|
|
27307
27307
|
const potentiallyNewClasses = [...protoChainClasses, ...mixinClasses];
|
|
27308
27308
|
const newClasses = potentiallyNewClasses.filter((c) => !allClasses.has(c));
|
|
27309
27309
|
for (let newClass of newClasses)
|
|
@@ -27352,12 +27352,12 @@ var require_decorator = __commonJS({
|
|
|
27352
27352
|
return decorator(clazz);
|
|
27353
27353
|
};
|
|
27354
27354
|
var decorateMember = (decorator) => (object, key, ...otherArgs) => {
|
|
27355
|
-
var
|
|
27355
|
+
var _a2, _b, _c;
|
|
27356
27356
|
const decoratorTargetType = typeof object === "function" ? "static" : "instance";
|
|
27357
27357
|
const decoratorType = typeof object[key] === "function" ? "method" : "property";
|
|
27358
27358
|
const clazz = decoratorTargetType === "static" ? object : object.constructor;
|
|
27359
27359
|
const decoratorsForClass = (0, exports2.getDecoratorsForClass)(clazz);
|
|
27360
|
-
const decoratorsForTargetType = (
|
|
27360
|
+
const decoratorsForTargetType = (_a2 = decoratorsForClass === null || decoratorsForClass === void 0 ? void 0 : decoratorsForClass[decoratorTargetType]) !== null && _a2 !== void 0 ? _a2 : {};
|
|
27361
27361
|
decoratorsForClass[decoratorTargetType] = decoratorsForTargetType;
|
|
27362
27362
|
let decoratorsForType = (_b = decoratorsForTargetType === null || decoratorsForTargetType === void 0 ? void 0 : decoratorsForTargetType[decoratorType]) !== null && _b !== void 0 ? _b : {};
|
|
27363
27363
|
decoratorsForTargetType[decoratorType] = decoratorsForType;
|
|
@@ -27387,7 +27387,7 @@ var require_mixins = __commonJS({
|
|
|
27387
27387
|
var decorator_1 = require_decorator();
|
|
27388
27388
|
var mixin_tracking_1 = require_mixin_tracking();
|
|
27389
27389
|
function Mixin(...constructors) {
|
|
27390
|
-
var
|
|
27390
|
+
var _a2, _b, _c;
|
|
27391
27391
|
const prototypes = constructors.map((constructor) => constructor.prototype);
|
|
27392
27392
|
const initFunctionName = settings_1.settings.initFunction;
|
|
27393
27393
|
if (initFunctionName !== null) {
|
|
@@ -27410,7 +27410,7 @@ var require_mixins = __commonJS({
|
|
|
27410
27410
|
let DecoratedMixedClass = MixedClass;
|
|
27411
27411
|
if (settings_1.settings.decoratorInheritance !== "none") {
|
|
27412
27412
|
const classDecorators = settings_1.settings.decoratorInheritance === "deep" ? (0, decorator_1.deepDecoratorSearch)(...constructors) : (0, decorator_1.directDecoratorSearch)(...constructors);
|
|
27413
|
-
for (let decorator of (
|
|
27413
|
+
for (let decorator of (_a2 = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.class) !== null && _a2 !== void 0 ? _a2 : []) {
|
|
27414
27414
|
const result = decorator(DecoratedMixedClass);
|
|
27415
27415
|
if (result) {
|
|
27416
27416
|
DecoratedMixedClass = result;
|
|
@@ -27893,18 +27893,18 @@ var require_zalgo = __commonJS({
|
|
|
27893
27893
|
function heComes(text2, options2) {
|
|
27894
27894
|
var result = "";
|
|
27895
27895
|
var counts;
|
|
27896
|
-
var
|
|
27896
|
+
var l2;
|
|
27897
27897
|
options2 = options2 || {};
|
|
27898
27898
|
options2["up"] = typeof options2["up"] !== "undefined" ? options2["up"] : true;
|
|
27899
27899
|
options2["mid"] = typeof options2["mid"] !== "undefined" ? options2["mid"] : true;
|
|
27900
27900
|
options2["down"] = typeof options2["down"] !== "undefined" ? options2["down"] : true;
|
|
27901
27901
|
options2["size"] = typeof options2["size"] !== "undefined" ? options2["size"] : "maxi";
|
|
27902
27902
|
text2 = text2.split("");
|
|
27903
|
-
for (
|
|
27904
|
-
if (isChar(
|
|
27903
|
+
for (l2 in text2) {
|
|
27904
|
+
if (isChar(l2)) {
|
|
27905
27905
|
continue;
|
|
27906
27906
|
}
|
|
27907
|
-
result = result + text2[
|
|
27907
|
+
result = result + text2[l2];
|
|
27908
27908
|
counts = { "up": 0, "down": 0, "mid": 0 };
|
|
27909
27909
|
switch (options2.size) {
|
|
27910
27910
|
case "mini":
|
|
@@ -29587,8 +29587,8 @@ var require_fecha_umd = __commonJS({
|
|
|
29587
29587
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
29588
29588
|
args[_i - 1] = arguments[_i];
|
|
29589
29589
|
}
|
|
29590
|
-
for (var
|
|
29591
|
-
var obj = args_1[
|
|
29590
|
+
for (var _a2 = 0, args_1 = args; _a2 < args_1.length; _a2++) {
|
|
29591
|
+
var obj = args_1[_a2];
|
|
29592
29592
|
for (var key in obj) {
|
|
29593
29593
|
origObj[key] = obj[key];
|
|
29594
29594
|
}
|
|
@@ -29909,7 +29909,7 @@ var require_fecha_umd = __commonJS({
|
|
|
29909
29909
|
}
|
|
29910
29910
|
var combinedI18nSettings = assign(assign({}, globalI18n), i18n);
|
|
29911
29911
|
for (var i = 1; i < matches.length; i++) {
|
|
29912
|
-
var
|
|
29912
|
+
var _a2 = parseInfo[i - 1], field = _a2[0], parser = _a2[2];
|
|
29913
29913
|
var value = parser ? parser(matches[i], combinedI18nSettings) : +matches[i];
|
|
29914
29914
|
if (value == null) {
|
|
29915
29915
|
return null;
|
|
@@ -30595,9 +30595,9 @@ var require_buffer_list = __commonJS({
|
|
|
30595
30595
|
key: "join",
|
|
30596
30596
|
value: function join2(s) {
|
|
30597
30597
|
if (this.length === 0) return "";
|
|
30598
|
-
var
|
|
30599
|
-
var ret = "" +
|
|
30600
|
-
while (
|
|
30598
|
+
var p3 = this.head;
|
|
30599
|
+
var ret = "" + p3.data;
|
|
30600
|
+
while (p3 = p3.next) ret += s + p3.data;
|
|
30601
30601
|
return ret;
|
|
30602
30602
|
}
|
|
30603
30603
|
}, {
|
|
@@ -30605,12 +30605,12 @@ var require_buffer_list = __commonJS({
|
|
|
30605
30605
|
value: function concat(n) {
|
|
30606
30606
|
if (this.length === 0) return Buffer2.alloc(0);
|
|
30607
30607
|
var ret = Buffer2.allocUnsafe(n >>> 0);
|
|
30608
|
-
var
|
|
30608
|
+
var p3 = this.head;
|
|
30609
30609
|
var i = 0;
|
|
30610
|
-
while (
|
|
30611
|
-
copyBuffer(
|
|
30612
|
-
i +=
|
|
30613
|
-
|
|
30610
|
+
while (p3) {
|
|
30611
|
+
copyBuffer(p3.data, ret, i);
|
|
30612
|
+
i += p3.data.length;
|
|
30613
|
+
p3 = p3.next;
|
|
30614
30614
|
}
|
|
30615
30615
|
return ret;
|
|
30616
30616
|
}
|
|
@@ -30638,12 +30638,12 @@ var require_buffer_list = __commonJS({
|
|
|
30638
30638
|
}, {
|
|
30639
30639
|
key: "_getString",
|
|
30640
30640
|
value: function _getString(n) {
|
|
30641
|
-
var
|
|
30641
|
+
var p3 = this.head;
|
|
30642
30642
|
var c = 1;
|
|
30643
|
-
var ret =
|
|
30643
|
+
var ret = p3.data;
|
|
30644
30644
|
n -= ret.length;
|
|
30645
|
-
while (
|
|
30646
|
-
var str =
|
|
30645
|
+
while (p3 = p3.next) {
|
|
30646
|
+
var str = p3.data;
|
|
30647
30647
|
var nb = n > str.length ? str.length : n;
|
|
30648
30648
|
if (nb === str.length) ret += str;
|
|
30649
30649
|
else ret += str.slice(0, n);
|
|
@@ -30651,11 +30651,11 @@ var require_buffer_list = __commonJS({
|
|
|
30651
30651
|
if (n === 0) {
|
|
30652
30652
|
if (nb === str.length) {
|
|
30653
30653
|
++c;
|
|
30654
|
-
if (
|
|
30654
|
+
if (p3.next) this.head = p3.next;
|
|
30655
30655
|
else this.head = this.tail = null;
|
|
30656
30656
|
} else {
|
|
30657
|
-
this.head =
|
|
30658
|
-
|
|
30657
|
+
this.head = p3;
|
|
30658
|
+
p3.data = str.slice(nb);
|
|
30659
30659
|
}
|
|
30660
30660
|
break;
|
|
30661
30661
|
}
|
|
@@ -30669,23 +30669,23 @@ var require_buffer_list = __commonJS({
|
|
|
30669
30669
|
key: "_getBuffer",
|
|
30670
30670
|
value: function _getBuffer(n) {
|
|
30671
30671
|
var ret = Buffer2.allocUnsafe(n);
|
|
30672
|
-
var
|
|
30672
|
+
var p3 = this.head;
|
|
30673
30673
|
var c = 1;
|
|
30674
|
-
|
|
30675
|
-
n -=
|
|
30676
|
-
while (
|
|
30677
|
-
var buf =
|
|
30674
|
+
p3.data.copy(ret);
|
|
30675
|
+
n -= p3.data.length;
|
|
30676
|
+
while (p3 = p3.next) {
|
|
30677
|
+
var buf = p3.data;
|
|
30678
30678
|
var nb = n > buf.length ? buf.length : n;
|
|
30679
30679
|
buf.copy(ret, ret.length - n, 0, nb);
|
|
30680
30680
|
n -= nb;
|
|
30681
30681
|
if (n === 0) {
|
|
30682
30682
|
if (nb === buf.length) {
|
|
30683
30683
|
++c;
|
|
30684
|
-
if (
|
|
30684
|
+
if (p3.next) this.head = p3.next;
|
|
30685
30685
|
else this.head = this.tail = null;
|
|
30686
30686
|
} else {
|
|
30687
|
-
this.head =
|
|
30688
|
-
|
|
30687
|
+
this.head = p3;
|
|
30688
|
+
p3.data = buf.slice(nb);
|
|
30689
30689
|
}
|
|
30690
30690
|
break;
|
|
30691
30691
|
}
|
|
@@ -30887,21 +30887,21 @@ var require_string_decoder = __commonJS({
|
|
|
30887
30887
|
return byte >> 6 === 2 ? -1 : -2;
|
|
30888
30888
|
}
|
|
30889
30889
|
function utf8CheckIncomplete(self2, buf, i) {
|
|
30890
|
-
var
|
|
30891
|
-
if (
|
|
30892
|
-
var nb = utf8CheckByte(buf[
|
|
30890
|
+
var j2 = buf.length - 1;
|
|
30891
|
+
if (j2 < i) return 0;
|
|
30892
|
+
var nb = utf8CheckByte(buf[j2]);
|
|
30893
30893
|
if (nb >= 0) {
|
|
30894
30894
|
if (nb > 0) self2.lastNeed = nb - 1;
|
|
30895
30895
|
return nb;
|
|
30896
30896
|
}
|
|
30897
|
-
if (--
|
|
30898
|
-
nb = utf8CheckByte(buf[
|
|
30897
|
+
if (--j2 < i || nb === -2) return 0;
|
|
30898
|
+
nb = utf8CheckByte(buf[j2]);
|
|
30899
30899
|
if (nb >= 0) {
|
|
30900
30900
|
if (nb > 0) self2.lastNeed = nb - 2;
|
|
30901
30901
|
return nb;
|
|
30902
30902
|
}
|
|
30903
|
-
if (--
|
|
30904
|
-
nb = utf8CheckByte(buf[
|
|
30903
|
+
if (--j2 < i || nb === -2) return 0;
|
|
30904
|
+
nb = utf8CheckByte(buf[j2]);
|
|
30905
30905
|
if (nb >= 0) {
|
|
30906
30906
|
if (nb > 0) {
|
|
30907
30907
|
if (nb === 2) nb = 0;
|
|
@@ -30911,7 +30911,7 @@ var require_string_decoder = __commonJS({
|
|
|
30911
30911
|
}
|
|
30912
30912
|
return 0;
|
|
30913
30913
|
}
|
|
30914
|
-
function utf8CheckExtraBytes(self2, buf,
|
|
30914
|
+
function utf8CheckExtraBytes(self2, buf, p3) {
|
|
30915
30915
|
if ((buf[0] & 192) !== 128) {
|
|
30916
30916
|
self2.lastNeed = 0;
|
|
30917
30917
|
return "\uFFFD";
|
|
@@ -30930,14 +30930,14 @@ var require_string_decoder = __commonJS({
|
|
|
30930
30930
|
}
|
|
30931
30931
|
}
|
|
30932
30932
|
function utf8FillLast(buf) {
|
|
30933
|
-
var
|
|
30934
|
-
var r7 = utf8CheckExtraBytes(this, buf,
|
|
30933
|
+
var p3 = this.lastTotal - this.lastNeed;
|
|
30934
|
+
var r7 = utf8CheckExtraBytes(this, buf, p3);
|
|
30935
30935
|
if (r7 !== void 0) return r7;
|
|
30936
30936
|
if (this.lastNeed <= buf.length) {
|
|
30937
|
-
buf.copy(this.lastChar,
|
|
30937
|
+
buf.copy(this.lastChar, p3, 0, this.lastNeed);
|
|
30938
30938
|
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
30939
30939
|
}
|
|
30940
|
-
buf.copy(this.lastChar,
|
|
30940
|
+
buf.copy(this.lastChar, p3, 0, buf.length);
|
|
30941
30941
|
this.lastNeed -= buf.length;
|
|
30942
30942
|
}
|
|
30943
30943
|
function utf8Text(buf, i) {
|
|
@@ -31607,11 +31607,11 @@ var require_stream_readable = __commonJS({
|
|
|
31607
31607
|
var decoder = new StringDecoder(enc);
|
|
31608
31608
|
this._readableState.decoder = decoder;
|
|
31609
31609
|
this._readableState.encoding = this._readableState.decoder.encoding;
|
|
31610
|
-
var
|
|
31610
|
+
var p3 = this._readableState.buffer.head;
|
|
31611
31611
|
var content = "";
|
|
31612
|
-
while (
|
|
31613
|
-
content += decoder.write(
|
|
31614
|
-
|
|
31612
|
+
while (p3 !== null) {
|
|
31613
|
+
content += decoder.write(p3.data);
|
|
31614
|
+
p3 = p3.next;
|
|
31615
31615
|
}
|
|
31616
31616
|
this._readableState.buffer.clear();
|
|
31617
31617
|
if (content !== "") this._readableState.buffer.push(content);
|
|
@@ -32126,7 +32126,7 @@ var require_stream_readable = __commonJS({
|
|
|
32126
32126
|
};
|
|
32127
32127
|
}
|
|
32128
32128
|
function indexOf(xs, x2) {
|
|
32129
|
-
for (var i = 0,
|
|
32129
|
+
for (var i = 0, l2 = xs.length; i < l2; i++) {
|
|
32130
32130
|
if (xs[i] === x2) return i;
|
|
32131
32131
|
}
|
|
32132
32132
|
return -1;
|
|
@@ -32536,8 +32536,8 @@ var require_stream_writable = __commonJS({
|
|
|
32536
32536
|
state.bufferProcessing = true;
|
|
32537
32537
|
var entry = state.bufferedRequest;
|
|
32538
32538
|
if (stream._writev && entry && entry.next) {
|
|
32539
|
-
var
|
|
32540
|
-
var buffer = new Array(
|
|
32539
|
+
var l2 = state.bufferedRequestCount;
|
|
32540
|
+
var buffer = new Array(l2);
|
|
32541
32541
|
var holder = state.corkedRequestsFree;
|
|
32542
32542
|
holder.entry = entry;
|
|
32543
32543
|
var count = 0;
|
|
@@ -34185,9 +34185,9 @@ var require_color_string = __commonJS({
|
|
|
34185
34185
|
var alpha = parseFloat(match[4]);
|
|
34186
34186
|
var h2 = (parseFloat(match[1]) % 360 + 360) % 360;
|
|
34187
34187
|
var s = clamp(parseFloat(match[2]), 0, 100);
|
|
34188
|
-
var
|
|
34188
|
+
var l2 = clamp(parseFloat(match[3]), 0, 100);
|
|
34189
34189
|
var a2 = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
34190
|
-
return [h2, s,
|
|
34190
|
+
return [h2, s, l2, a2];
|
|
34191
34191
|
}
|
|
34192
34192
|
return null;
|
|
34193
34193
|
};
|
|
@@ -34464,7 +34464,7 @@ var require_conversions = __commonJS({
|
|
|
34464
34464
|
var delta = max - min;
|
|
34465
34465
|
var h2;
|
|
34466
34466
|
var s;
|
|
34467
|
-
var
|
|
34467
|
+
var l2;
|
|
34468
34468
|
if (max === min) {
|
|
34469
34469
|
h2 = 0;
|
|
34470
34470
|
} else if (r7 === max) {
|
|
@@ -34478,15 +34478,15 @@ var require_conversions = __commonJS({
|
|
|
34478
34478
|
if (h2 < 0) {
|
|
34479
34479
|
h2 += 360;
|
|
34480
34480
|
}
|
|
34481
|
-
|
|
34481
|
+
l2 = (min + max) / 2;
|
|
34482
34482
|
if (max === min) {
|
|
34483
34483
|
s = 0;
|
|
34484
|
-
} else if (
|
|
34484
|
+
} else if (l2 <= 0.5) {
|
|
34485
34485
|
s = delta / (max + min);
|
|
34486
34486
|
} else {
|
|
34487
34487
|
s = delta / (2 - max - min);
|
|
34488
34488
|
}
|
|
34489
|
-
return [h2, s * 100,
|
|
34489
|
+
return [h2, s * 100, l2 * 100];
|
|
34490
34490
|
};
|
|
34491
34491
|
convert.rgb.hsv = function(rgb) {
|
|
34492
34492
|
var rdif;
|
|
@@ -34593,7 +34593,7 @@ var require_conversions = __commonJS({
|
|
|
34593
34593
|
var x2 = xyz[0];
|
|
34594
34594
|
var y2 = xyz[1];
|
|
34595
34595
|
var z2 = xyz[2];
|
|
34596
|
-
var
|
|
34596
|
+
var l2;
|
|
34597
34597
|
var a2;
|
|
34598
34598
|
var b2;
|
|
34599
34599
|
x2 /= 95.047;
|
|
@@ -34602,30 +34602,30 @@ var require_conversions = __commonJS({
|
|
|
34602
34602
|
x2 = x2 > 8856e-6 ? Math.pow(x2, 1 / 3) : 7.787 * x2 + 16 / 116;
|
|
34603
34603
|
y2 = y2 > 8856e-6 ? Math.pow(y2, 1 / 3) : 7.787 * y2 + 16 / 116;
|
|
34604
34604
|
z2 = z2 > 8856e-6 ? Math.pow(z2, 1 / 3) : 7.787 * z2 + 16 / 116;
|
|
34605
|
-
|
|
34605
|
+
l2 = 116 * y2 - 16;
|
|
34606
34606
|
a2 = 500 * (x2 - y2);
|
|
34607
34607
|
b2 = 200 * (y2 - z2);
|
|
34608
|
-
return [
|
|
34608
|
+
return [l2, a2, b2];
|
|
34609
34609
|
};
|
|
34610
34610
|
convert.hsl.rgb = function(hsl) {
|
|
34611
34611
|
var h2 = hsl[0] / 360;
|
|
34612
34612
|
var s = hsl[1] / 100;
|
|
34613
|
-
var
|
|
34613
|
+
var l2 = hsl[2] / 100;
|
|
34614
34614
|
var t1;
|
|
34615
34615
|
var t2;
|
|
34616
34616
|
var t3;
|
|
34617
34617
|
var rgb;
|
|
34618
34618
|
var val;
|
|
34619
34619
|
if (s === 0) {
|
|
34620
|
-
val =
|
|
34620
|
+
val = l2 * 255;
|
|
34621
34621
|
return [val, val, val];
|
|
34622
34622
|
}
|
|
34623
|
-
if (
|
|
34624
|
-
t2 =
|
|
34623
|
+
if (l2 < 0.5) {
|
|
34624
|
+
t2 = l2 * (1 + s);
|
|
34625
34625
|
} else {
|
|
34626
|
-
t2 =
|
|
34626
|
+
t2 = l2 + s - l2 * s;
|
|
34627
34627
|
}
|
|
34628
|
-
t1 = 2 *
|
|
34628
|
+
t1 = 2 * l2 - t2;
|
|
34629
34629
|
rgb = [0, 0, 0];
|
|
34630
34630
|
for (var i = 0; i < 3; i++) {
|
|
34631
34631
|
t3 = h2 + 1 / 3 * -(i - 1);
|
|
@@ -34651,16 +34651,16 @@ var require_conversions = __commonJS({
|
|
|
34651
34651
|
convert.hsl.hsv = function(hsl) {
|
|
34652
34652
|
var h2 = hsl[0];
|
|
34653
34653
|
var s = hsl[1] / 100;
|
|
34654
|
-
var
|
|
34654
|
+
var l2 = hsl[2] / 100;
|
|
34655
34655
|
var smin = s;
|
|
34656
|
-
var lmin = Math.max(
|
|
34656
|
+
var lmin = Math.max(l2, 0.01);
|
|
34657
34657
|
var sv;
|
|
34658
34658
|
var v;
|
|
34659
|
-
|
|
34660
|
-
s *=
|
|
34659
|
+
l2 *= 2;
|
|
34660
|
+
s *= l2 <= 1 ? l2 : 2 - l2;
|
|
34661
34661
|
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
34662
|
-
v = (
|
|
34663
|
-
sv =
|
|
34662
|
+
v = (l2 + s) / 2;
|
|
34663
|
+
sv = l2 === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l2 + s);
|
|
34664
34664
|
return [h2, sv * 100, v * 100];
|
|
34665
34665
|
};
|
|
34666
34666
|
convert.hsv.rgb = function(hsv) {
|
|
@@ -34669,23 +34669,23 @@ var require_conversions = __commonJS({
|
|
|
34669
34669
|
var v = hsv[2] / 100;
|
|
34670
34670
|
var hi2 = Math.floor(h2) % 6;
|
|
34671
34671
|
var f2 = h2 - Math.floor(h2);
|
|
34672
|
-
var
|
|
34672
|
+
var p3 = 255 * v * (1 - s);
|
|
34673
34673
|
var q2 = 255 * v * (1 - s * f2);
|
|
34674
34674
|
var t = 255 * v * (1 - s * (1 - f2));
|
|
34675
34675
|
v *= 255;
|
|
34676
34676
|
switch (hi2) {
|
|
34677
34677
|
case 0:
|
|
34678
|
-
return [v, t,
|
|
34678
|
+
return [v, t, p3];
|
|
34679
34679
|
case 1:
|
|
34680
|
-
return [q2, v,
|
|
34680
|
+
return [q2, v, p3];
|
|
34681
34681
|
case 2:
|
|
34682
|
-
return [
|
|
34682
|
+
return [p3, v, t];
|
|
34683
34683
|
case 3:
|
|
34684
|
-
return [
|
|
34684
|
+
return [p3, q2, v];
|
|
34685
34685
|
case 4:
|
|
34686
|
-
return [t,
|
|
34686
|
+
return [t, p3, v];
|
|
34687
34687
|
case 5:
|
|
34688
|
-
return [v,
|
|
34688
|
+
return [v, p3, q2];
|
|
34689
34689
|
}
|
|
34690
34690
|
};
|
|
34691
34691
|
convert.hsv.hsl = function(hsv) {
|
|
@@ -34695,14 +34695,14 @@ var require_conversions = __commonJS({
|
|
|
34695
34695
|
var vmin = Math.max(v, 0.01);
|
|
34696
34696
|
var lmin;
|
|
34697
34697
|
var sl;
|
|
34698
|
-
var
|
|
34699
|
-
|
|
34698
|
+
var l2;
|
|
34699
|
+
l2 = (2 - s) * v;
|
|
34700
34700
|
lmin = (2 - s) * vmin;
|
|
34701
34701
|
sl = s * vmin;
|
|
34702
34702
|
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
34703
34703
|
sl = sl || 0;
|
|
34704
|
-
|
|
34705
|
-
return [h2, sl * 100,
|
|
34704
|
+
l2 /= 2;
|
|
34705
|
+
return [h2, sl * 100, l2 * 100];
|
|
34706
34706
|
};
|
|
34707
34707
|
convert.hwb.rgb = function(hwb) {
|
|
34708
34708
|
var h2 = hwb[0] / 360;
|
|
@@ -34798,7 +34798,7 @@ var require_conversions = __commonJS({
|
|
|
34798
34798
|
var x2 = xyz[0];
|
|
34799
34799
|
var y2 = xyz[1];
|
|
34800
34800
|
var z2 = xyz[2];
|
|
34801
|
-
var
|
|
34801
|
+
var l2;
|
|
34802
34802
|
var a2;
|
|
34803
34803
|
var b2;
|
|
34804
34804
|
x2 /= 95.047;
|
|
@@ -34807,19 +34807,19 @@ var require_conversions = __commonJS({
|
|
|
34807
34807
|
x2 = x2 > 8856e-6 ? Math.pow(x2, 1 / 3) : 7.787 * x2 + 16 / 116;
|
|
34808
34808
|
y2 = y2 > 8856e-6 ? Math.pow(y2, 1 / 3) : 7.787 * y2 + 16 / 116;
|
|
34809
34809
|
z2 = z2 > 8856e-6 ? Math.pow(z2, 1 / 3) : 7.787 * z2 + 16 / 116;
|
|
34810
|
-
|
|
34810
|
+
l2 = 116 * y2 - 16;
|
|
34811
34811
|
a2 = 500 * (x2 - y2);
|
|
34812
34812
|
b2 = 200 * (y2 - z2);
|
|
34813
|
-
return [
|
|
34813
|
+
return [l2, a2, b2];
|
|
34814
34814
|
};
|
|
34815
34815
|
convert.lab.xyz = function(lab) {
|
|
34816
|
-
var
|
|
34816
|
+
var l2 = lab[0];
|
|
34817
34817
|
var a2 = lab[1];
|
|
34818
34818
|
var b2 = lab[2];
|
|
34819
34819
|
var x2;
|
|
34820
34820
|
var y2;
|
|
34821
34821
|
var z2;
|
|
34822
|
-
y2 = (
|
|
34822
|
+
y2 = (l2 + 16) / 116;
|
|
34823
34823
|
x2 = a2 / 500 + y2;
|
|
34824
34824
|
z2 = y2 - b2 / 200;
|
|
34825
34825
|
var y22 = Math.pow(y2, 3);
|
|
@@ -34834,7 +34834,7 @@ var require_conversions = __commonJS({
|
|
|
34834
34834
|
return [x2, y2, z2];
|
|
34835
34835
|
};
|
|
34836
34836
|
convert.lab.lch = function(lab) {
|
|
34837
|
-
var
|
|
34837
|
+
var l2 = lab[0];
|
|
34838
34838
|
var a2 = lab[1];
|
|
34839
34839
|
var b2 = lab[2];
|
|
34840
34840
|
var hr;
|
|
@@ -34846,10 +34846,10 @@ var require_conversions = __commonJS({
|
|
|
34846
34846
|
h2 += 360;
|
|
34847
34847
|
}
|
|
34848
34848
|
c = Math.sqrt(a2 * a2 + b2 * b2);
|
|
34849
|
-
return [
|
|
34849
|
+
return [l2, c, h2];
|
|
34850
34850
|
};
|
|
34851
34851
|
convert.lch.lab = function(lch) {
|
|
34852
|
-
var
|
|
34852
|
+
var l2 = lch[0];
|
|
34853
34853
|
var c = lch[1];
|
|
34854
34854
|
var h2 = lch[2];
|
|
34855
34855
|
var a2;
|
|
@@ -34858,7 +34858,7 @@ var require_conversions = __commonJS({
|
|
|
34858
34858
|
hr = h2 / 360 * 2 * Math.PI;
|
|
34859
34859
|
a2 = c * Math.cos(hr);
|
|
34860
34860
|
b2 = c * Math.sin(hr);
|
|
34861
|
-
return [
|
|
34861
|
+
return [l2, a2, b2];
|
|
34862
34862
|
};
|
|
34863
34863
|
convert.rgb.ansi16 = function(args) {
|
|
34864
34864
|
var r7 = args[0];
|
|
@@ -34972,16 +34972,16 @@ var require_conversions = __commonJS({
|
|
|
34972
34972
|
};
|
|
34973
34973
|
convert.hsl.hcg = function(hsl) {
|
|
34974
34974
|
var s = hsl[1] / 100;
|
|
34975
|
-
var
|
|
34975
|
+
var l2 = hsl[2] / 100;
|
|
34976
34976
|
var c = 1;
|
|
34977
34977
|
var f2 = 0;
|
|
34978
|
-
if (
|
|
34979
|
-
c = 2 * s *
|
|
34978
|
+
if (l2 < 0.5) {
|
|
34979
|
+
c = 2 * s * l2;
|
|
34980
34980
|
} else {
|
|
34981
|
-
c = 2 * s * (1 -
|
|
34981
|
+
c = 2 * s * (1 - l2);
|
|
34982
34982
|
}
|
|
34983
34983
|
if (c < 1) {
|
|
34984
|
-
f2 = (
|
|
34984
|
+
f2 = (l2 - 0.5 * c) / (1 - c);
|
|
34985
34985
|
}
|
|
34986
34986
|
return [hsl[0], c * 100, f2 * 100];
|
|
34987
34987
|
};
|
|
@@ -35058,14 +35058,14 @@ var require_conversions = __commonJS({
|
|
|
35058
35058
|
convert.hcg.hsl = function(hcg) {
|
|
35059
35059
|
var c = hcg[1] / 100;
|
|
35060
35060
|
var g2 = hcg[2] / 100;
|
|
35061
|
-
var
|
|
35061
|
+
var l2 = g2 * (1 - c) + 0.5 * c;
|
|
35062
35062
|
var s = 0;
|
|
35063
|
-
if (
|
|
35064
|
-
s = c / (2 *
|
|
35065
|
-
} else if (
|
|
35066
|
-
s = c / (2 * (1 -
|
|
35063
|
+
if (l2 > 0 && l2 < 0.5) {
|
|
35064
|
+
s = c / (2 * l2);
|
|
35065
|
+
} else if (l2 >= 0.5 && l2 < 1) {
|
|
35066
|
+
s = c / (2 * (1 - l2));
|
|
35067
35067
|
}
|
|
35068
|
-
return [hcg[0], s * 100,
|
|
35068
|
+
return [hcg[0], s * 100, l2 * 100];
|
|
35069
35069
|
};
|
|
35070
35070
|
convert.hcg.hwb = function(hcg) {
|
|
35071
35071
|
var c = hcg[1] / 100;
|
|
@@ -35545,8 +35545,8 @@ var require_color = __commonJS({
|
|
|
35545
35545
|
}
|
|
35546
35546
|
var color1 = mixinColor.rgb();
|
|
35547
35547
|
var color2 = this.rgb();
|
|
35548
|
-
var
|
|
35549
|
-
var w2 = 2 *
|
|
35548
|
+
var p3 = weight === void 0 ? 0.5 : weight;
|
|
35549
|
+
var w2 = 2 * p3 - 1;
|
|
35550
35550
|
var a2 = color1.alpha() - color2.alpha();
|
|
35551
35551
|
var w1 = ((w2 * a2 === -1 ? w2 : (w2 + a2) / (1 + w2 * a2)) + 1) / 2;
|
|
35552
35552
|
var w22 = 1 - w1;
|
|
@@ -35554,7 +35554,7 @@ var require_color = __commonJS({
|
|
|
35554
35554
|
w1 * color1.red() + w22 * color2.red(),
|
|
35555
35555
|
w1 * color1.green() + w22 * color2.green(),
|
|
35556
35556
|
w1 * color1.blue() + w22 * color2.blue(),
|
|
35557
|
-
color1.alpha() *
|
|
35557
|
+
color1.alpha() * p3 + color2.alpha() * (1 - p3)
|
|
35558
35558
|
);
|
|
35559
35559
|
}
|
|
35560
35560
|
};
|
|
@@ -35657,7 +35657,7 @@ var require_colorspace = __commonJS({
|
|
|
35657
35657
|
var split = namespace.split(delimiter || ":");
|
|
35658
35658
|
var base = hex(split[0]);
|
|
35659
35659
|
if (!split.length) return base;
|
|
35660
|
-
for (var i = 0,
|
|
35660
|
+
for (var i = 0, l2 = split.length - 1; i < l2; i++) {
|
|
35661
35661
|
base = color(base).mix(color(hex(split[i + 1]))).saturate(1).hex();
|
|
35662
35662
|
}
|
|
35663
35663
|
return base;
|
|
@@ -35893,9 +35893,9 @@ var require_tail_file = __commonJS({
|
|
|
35893
35893
|
stream.emit("data", data2);
|
|
35894
35894
|
}
|
|
35895
35895
|
data2 = (buff + data2).split(/\n+/);
|
|
35896
|
-
const
|
|
35896
|
+
const l2 = data2.length - 1;
|
|
35897
35897
|
let i = 0;
|
|
35898
|
-
for (; i <
|
|
35898
|
+
for (; i < l2; i++) {
|
|
35899
35899
|
if (options.start == null || row > options.start) {
|
|
35900
35900
|
if (!iter) {
|
|
35901
35901
|
stream.emit("line", data2[i]);
|
|
@@ -35905,7 +35905,7 @@ var require_tail_file = __commonJS({
|
|
|
35905
35905
|
}
|
|
35906
35906
|
row++;
|
|
35907
35907
|
}
|
|
35908
|
-
buff = data2[
|
|
35908
|
+
buff = data2[l2];
|
|
35909
35909
|
pos += bytes;
|
|
35910
35910
|
return read();
|
|
35911
35911
|
});
|
|
@@ -36120,15 +36120,15 @@ var require_file = __commonJS({
|
|
|
36120
36120
|
});
|
|
36121
36121
|
stream.on("data", (data2) => {
|
|
36122
36122
|
data2 = (buff + data2).split(/\n+/);
|
|
36123
|
-
const
|
|
36123
|
+
const l2 = data2.length - 1;
|
|
36124
36124
|
let i = 0;
|
|
36125
|
-
for (; i <
|
|
36125
|
+
for (; i < l2; i++) {
|
|
36126
36126
|
if (!options.start || row >= options.start) {
|
|
36127
36127
|
add(data2[i]);
|
|
36128
36128
|
}
|
|
36129
36129
|
row++;
|
|
36130
36130
|
}
|
|
36131
|
-
buff = data2[
|
|
36131
|
+
buff = data2[l2];
|
|
36132
36132
|
});
|
|
36133
36133
|
stream.on("close", () => {
|
|
36134
36134
|
if (buff) {
|
|
@@ -36629,16 +36629,16 @@ var require_http = __commonJS({
|
|
|
36629
36629
|
stream.destroy = () => req.destroy();
|
|
36630
36630
|
req.on("data", (data2) => {
|
|
36631
36631
|
data2 = (buff + data2).split(/\n+/);
|
|
36632
|
-
const
|
|
36632
|
+
const l2 = data2.length - 1;
|
|
36633
36633
|
let i = 0;
|
|
36634
|
-
for (; i <
|
|
36634
|
+
for (; i < l2; i++) {
|
|
36635
36635
|
try {
|
|
36636
36636
|
stream.emit("log", JSON.parse(data2[i]));
|
|
36637
36637
|
} catch (e) {
|
|
36638
36638
|
stream.emit("error", e);
|
|
36639
36639
|
}
|
|
36640
36640
|
}
|
|
36641
|
-
buff = data2[
|
|
36641
|
+
buff = data2[l2];
|
|
36642
36642
|
});
|
|
36643
36643
|
req.on("error", (err) => stream.emit("error", err));
|
|
36644
36644
|
return stream;
|
|
@@ -36671,11 +36671,11 @@ var require_http = __commonJS({
|
|
|
36671
36671
|
_doBatch(options, callback, auth, path) {
|
|
36672
36672
|
this.batchOptions.push(options);
|
|
36673
36673
|
if (this.batchOptions.length === 1) {
|
|
36674
|
-
const
|
|
36674
|
+
const me = this;
|
|
36675
36675
|
this.batchCallback = callback;
|
|
36676
36676
|
this.batchTimeoutID = setTimeout(function() {
|
|
36677
|
-
|
|
36678
|
-
|
|
36677
|
+
me.batchTimeoutID = -1;
|
|
36678
|
+
me._doBatchRequest(me.batchCallback, auth, path);
|
|
36679
36679
|
}, this.batchInterval);
|
|
36680
36680
|
}
|
|
36681
36681
|
if (this.batchOptions.length === this.batchCount) {
|
|
@@ -38398,7 +38398,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
38398
38398
|
}(global, (e, t, s, n, i) => {
|
|
38399
38399
|
return r7 = { 570: (e2, t2, s2) => {
|
|
38400
38400
|
const { CGetRequest: n2, CStoreRequest: i2 } = s2(940), { CommandFieldType: r8, PresentationContextResult: o2, SopClass: a2, StorageClass: c, TransferSyntax: d3, Uid: u2, UserIdentityType: h2 } = s2(492), m2 = s2(139), { EOL: g2 } = s2(857);
|
|
38401
|
-
class
|
|
38401
|
+
class l2 {
|
|
38402
38402
|
constructor(e3, t3, s3, n3) {
|
|
38403
38403
|
this.pcId = e3, this.abstractSyntaxUid = t3, this.transferSyntaxes = [], s3 && this.transferSyntaxes.push(s3), this.result = n3 || o2.Proposed;
|
|
38404
38404
|
}
|
|
@@ -38560,7 +38560,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
38560
38560
|
return this.presentationContexts.forEach((e4) => {
|
|
38561
38561
|
const t4 = e4.id;
|
|
38562
38562
|
t4 >= s3 && (s3 = t4 + 2);
|
|
38563
|
-
}), this.presentationContexts.push({ id: s3, context: new
|
|
38563
|
+
}), this.presentationContexts.push({ id: s3, context: new l2(s3, e3) }), s3;
|
|
38564
38564
|
}
|
|
38565
38565
|
addOrGetPresentationContext(e3) {
|
|
38566
38566
|
const t3 = this.getPresentationContexts();
|
|
@@ -38674,7 +38674,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
38674
38674
|
return `${e3}`;
|
|
38675
38675
|
}
|
|
38676
38676
|
}
|
|
38677
|
-
}, PresentationContext:
|
|
38677
|
+
}, PresentationContext: l2 };
|
|
38678
38678
|
}, 422: (e2, t2, s2) => {
|
|
38679
38679
|
const { Association: n2, PresentationContext: i2 } = s2(570), { TransferSyntax: r8, UserIdentityType: o2 } = s2(492), { Request: a2 } = s2(940), c = s2(371), d3 = s2(906), u2 = s2(547), h2 = s2(733), m2 = s2(278), g2 = s2(756);
|
|
38680
38680
|
e2.exports = class extends h2 {
|
|
@@ -38705,26 +38705,26 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
38705
38705
|
});
|
|
38706
38706
|
let h3 = {};
|
|
38707
38707
|
a3.securityOptions && (h3 = { key: a3.securityOptions.key, cert: a3.securityOptions.cert, ca: a3.securityOptions.ca, requestCert: a3.securityOptions.requestCert, rejectUnauthorized: a3.securityOptions.rejectUnauthorized, minVersion: a3.securityOptions.minVersion, maxVersion: a3.securityOptions.maxVersion, ciphers: a3.securityOptions.ciphers }), u2.info(`Connecting to ${e3}:${t3} ${a3.securityOptions ? "(TLS)" : ""}`);
|
|
38708
|
-
const
|
|
38709
|
-
|
|
38710
|
-
this.emit("connected"),
|
|
38711
|
-
}),
|
|
38712
|
-
this.emit("associationAccepted", e4),
|
|
38713
|
-
}),
|
|
38714
|
-
this.emit("associationReleased"),
|
|
38715
|
-
}),
|
|
38716
|
-
this.emit("associationRejected", e4),
|
|
38717
|
-
}),
|
|
38718
|
-
setTimeout(() =>
|
|
38719
|
-
}),
|
|
38708
|
+
const l2 = (a3.securityOptions ? g2 : m2).connect({ host: e3, port: t3, ...h3 }), p3 = new c(l2, a3);
|
|
38709
|
+
p3.on("connect", () => {
|
|
38710
|
+
this.emit("connected"), p3.sendAssociationRequest(d4);
|
|
38711
|
+
}), p3.on("associationAccepted", (e4) => {
|
|
38712
|
+
this.emit("associationAccepted", e4), p3.sendRequests(this.requests);
|
|
38713
|
+
}), p3.on("associationReleaseResponse", () => {
|
|
38714
|
+
this.emit("associationReleased"), l2.end();
|
|
38715
|
+
}), p3.on("associationRejected", (e4) => {
|
|
38716
|
+
this.emit("associationRejected", e4), l2.end();
|
|
38717
|
+
}), p3.on("done", () => {
|
|
38718
|
+
setTimeout(() => p3.sendAssociationReleaseRequest(), this.associationLingerTimeout);
|
|
38719
|
+
}), p3.on("cStoreRequest", (e4, t4) => {
|
|
38720
38720
|
this.emit("cStoreRequest", e4, t4);
|
|
38721
|
-
}),
|
|
38721
|
+
}), p3.on("nEventReportRequest", (e4, t4) => {
|
|
38722
38722
|
this.emit("nEventReportRequest", e4, t4);
|
|
38723
|
-
}),
|
|
38724
|
-
|
|
38725
|
-
}),
|
|
38726
|
-
this.statistics.addFromOtherStatistics(
|
|
38727
|
-
}), this.network =
|
|
38723
|
+
}), p3.on("networkError", (e4) => {
|
|
38724
|
+
l2.end(), this.emit("networkError", e4);
|
|
38725
|
+
}), p3.on("close", () => {
|
|
38726
|
+
this.statistics.addFromOtherStatistics(p3.getStatistics()), this.network = void 0, this.emit("closed");
|
|
38727
|
+
}), this.network = p3;
|
|
38728
38728
|
}
|
|
38729
38729
|
getStatistics() {
|
|
38730
38730
|
return this.statistics;
|
|
@@ -38819,7 +38819,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
38819
38819
|
}
|
|
38820
38820
|
}
|
|
38821
38821
|
}
|
|
38822
|
-
class
|
|
38822
|
+
class l2 extends c(g2, u2) {
|
|
38823
38823
|
constructor(e3, t3, s3, i3) {
|
|
38824
38824
|
switch (super(new a2({ CommandField: e3, CommandDataSetType: s3 ? 514 : 257 })), e3) {
|
|
38825
38825
|
case n2.NGetRequest:
|
|
@@ -38882,7 +38882,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
38882
38882
|
return `${super.toString(e3)} [id: ${this.getMessageId() || ""}]`;
|
|
38883
38883
|
}
|
|
38884
38884
|
}
|
|
38885
|
-
class
|
|
38885
|
+
class p3 extends g2 {
|
|
38886
38886
|
constructor(e3, t3, s3, i3, r9) {
|
|
38887
38887
|
switch (super(new a2({ CommandField: e3, CommandDataSetType: s3 ? 514 : 257, Status: i3, ErrorComment: r9 })), e3) {
|
|
38888
38888
|
case n2.NGetRequest:
|
|
@@ -38989,12 +38989,12 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
38989
38989
|
}
|
|
38990
38990
|
}
|
|
38991
38991
|
}
|
|
38992
|
-
class R2 extends
|
|
38992
|
+
class R2 extends l2 {
|
|
38993
38993
|
constructor() {
|
|
38994
38994
|
super(n2.CEchoRequest, r8.Verification, false);
|
|
38995
38995
|
}
|
|
38996
38996
|
}
|
|
38997
|
-
class S2 extends
|
|
38997
|
+
class S2 extends p3 {
|
|
38998
38998
|
constructor(e3, t3) {
|
|
38999
38999
|
super(n2.CEchoResponse, r8.Verification, false, e3, t3);
|
|
39000
39000
|
}
|
|
@@ -39004,7 +39004,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39004
39004
|
return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
|
|
39005
39005
|
}
|
|
39006
39006
|
}
|
|
39007
|
-
class f2 extends
|
|
39007
|
+
class f2 extends l2 {
|
|
39008
39008
|
constructor(e3) {
|
|
39009
39009
|
super(n2.CFindRequest, r8.StudyRootQueryRetrieveInformationModelFind, false), this.setPriority(e3 || i2.Medium);
|
|
39010
39010
|
}
|
|
@@ -39039,7 +39039,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39039
39039
|
return n3.setAffectedSopClassUid(r8.ModalityWorklistInformationModelFind), n3.setDataset(new a2(s3)), n3;
|
|
39040
39040
|
}
|
|
39041
39041
|
}
|
|
39042
|
-
class y2 extends
|
|
39042
|
+
class y2 extends p3 {
|
|
39043
39043
|
constructor(e3, t3) {
|
|
39044
39044
|
super(n2.CFindResponse, r8.StudyRootQueryRetrieveInformationModelFind, false, e3, t3);
|
|
39045
39045
|
}
|
|
@@ -39049,7 +39049,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39049
39049
|
return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
|
|
39050
39050
|
}
|
|
39051
39051
|
}
|
|
39052
|
-
class I2 extends
|
|
39052
|
+
class I2 extends l2 {
|
|
39053
39053
|
constructor(e3, t3) {
|
|
39054
39054
|
if (super(n2.CStoreRequest, "", false), this.setPriority(t3 || i2.Medium), e3 instanceof a2) return this.setAffectedSopClassUid(e3.getElement("SOPClassUID")), this.setAffectedSopInstanceUid(e3.getElement("SOPInstanceUID")), void this.setDataset(e3);
|
|
39055
39055
|
if ("string" == typeof e3 || e3 instanceof String) {
|
|
@@ -39067,7 +39067,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39067
39067
|
void 0 !== this.needsFullDatasetLoading && true === this.needsFullDatasetLoading && void 0 !== this.datasetOrFile && "" !== this.datasetOrFile.trim() && this.setDataset(a2.fromFile(this.datasetOrFile));
|
|
39068
39068
|
}
|
|
39069
39069
|
}
|
|
39070
|
-
class C2 extends
|
|
39070
|
+
class C2 extends p3 {
|
|
39071
39071
|
constructor(e3, t3) {
|
|
39072
39072
|
super(n2.CStoreResponse, "", false, e3, t3);
|
|
39073
39073
|
}
|
|
@@ -39077,7 +39077,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39077
39077
|
return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3.setAffectedSopClassUid(e3.getAffectedSopClassUid()), t3.setAffectedSopInstanceUid(e3.getAffectedSopInstanceUid()), t3;
|
|
39078
39078
|
}
|
|
39079
39079
|
}
|
|
39080
|
-
class P2 extends
|
|
39080
|
+
class P2 extends l2 {
|
|
39081
39081
|
constructor(e3) {
|
|
39082
39082
|
super(n2.CMoveRequest, r8.StudyRootQueryRetrieveInformationModelMove, false), this.setPriority(e3 || i2.Medium);
|
|
39083
39083
|
}
|
|
@@ -39100,7 +39100,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39100
39100
|
return o3.setDataset(new a2(r9)), o3.getCommandDataset().setElement("MoveDestination", e3), o3;
|
|
39101
39101
|
}
|
|
39102
39102
|
}
|
|
39103
|
-
class A2 extends
|
|
39103
|
+
class A2 extends p3 {
|
|
39104
39104
|
constructor(e3, t3) {
|
|
39105
39105
|
super(n2.CMoveResponse, r8.StudyRootQueryRetrieveInformationModelMove, false, e3, t3);
|
|
39106
39106
|
}
|
|
@@ -39122,7 +39122,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39122
39122
|
return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
|
|
39123
39123
|
}
|
|
39124
39124
|
}
|
|
39125
|
-
class v extends
|
|
39125
|
+
class v extends l2 {
|
|
39126
39126
|
constructor(e3) {
|
|
39127
39127
|
super(n2.CGetRequest, r8.StudyRootQueryRetrieveInformationModelGet, false), this.setPriority(e3 || i2.Medium), this.addStorageSopClassesToAssociation = true;
|
|
39128
39128
|
}
|
|
@@ -39151,7 +39151,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39151
39151
|
return r9.setDataset(new a2(i3)), r9;
|
|
39152
39152
|
}
|
|
39153
39153
|
}
|
|
39154
|
-
class w2 extends
|
|
39154
|
+
class w2 extends p3 {
|
|
39155
39155
|
constructor(e3, t3) {
|
|
39156
39156
|
super(n2.CGetResponse, r8.StudyRootQueryRetrieveInformationModelGet, false, e3, t3);
|
|
39157
39157
|
}
|
|
@@ -39173,12 +39173,12 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39173
39173
|
return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
|
|
39174
39174
|
}
|
|
39175
39175
|
}
|
|
39176
|
-
class x2 extends
|
|
39176
|
+
class x2 extends l2 {
|
|
39177
39177
|
constructor(e3, t3, s3) {
|
|
39178
39178
|
super(n2.NCreateRequest, e3, false), this.setAffectedSopInstanceUid(t3), this.setMetaSopClassUid(s3);
|
|
39179
39179
|
}
|
|
39180
39180
|
}
|
|
39181
|
-
class U2 extends
|
|
39181
|
+
class U2 extends p3 {
|
|
39182
39182
|
constructor(e3, t3, s3, i3) {
|
|
39183
39183
|
super(n2.NCreateResponse, e3, false, s3, i3), this.setAffectedSopInstanceUid(t3);
|
|
39184
39184
|
}
|
|
@@ -39188,7 +39188,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39188
39188
|
return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
|
|
39189
39189
|
}
|
|
39190
39190
|
}
|
|
39191
|
-
class q2 extends
|
|
39191
|
+
class q2 extends l2 {
|
|
39192
39192
|
constructor(e3, t3, s3, i3) {
|
|
39193
39193
|
super(n2.NActionRequest, e3, false), this.setRequestedSopInstanceUid(t3), this.setActionTypeId(s3), this.setMetaSopClassUid(i3);
|
|
39194
39194
|
}
|
|
@@ -39199,7 +39199,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39199
39199
|
this.getCommandDataset().setElement("ActionTypeID", e3);
|
|
39200
39200
|
}
|
|
39201
39201
|
}
|
|
39202
|
-
class D2 extends
|
|
39202
|
+
class D2 extends p3 {
|
|
39203
39203
|
constructor(e3, t3, s3, i3, r9) {
|
|
39204
39204
|
super(n2.NActionResponse, e3, false, i3, r9), this.setAffectedSopInstanceUid(t3), this.setActionTypeId(s3);
|
|
39205
39205
|
}
|
|
@@ -39215,12 +39215,12 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39215
39215
|
return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
|
|
39216
39216
|
}
|
|
39217
39217
|
}
|
|
39218
|
-
class E2 extends
|
|
39218
|
+
class E2 extends l2 {
|
|
39219
39219
|
constructor(e3, t3, s3) {
|
|
39220
39220
|
super(n2.NDeleteRequest, e3, false), this.setRequestedSopInstanceUid(t3), this.setMetaSopClassUid(s3);
|
|
39221
39221
|
}
|
|
39222
39222
|
}
|
|
39223
|
-
class T extends
|
|
39223
|
+
class T extends p3 {
|
|
39224
39224
|
constructor(e3, t3, s3, i3) {
|
|
39225
39225
|
super(n2.NDeleteResponse, e3, false, s3, i3), this.setAffectedSopInstanceUid(t3);
|
|
39226
39226
|
}
|
|
@@ -39230,7 +39230,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39230
39230
|
return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
|
|
39231
39231
|
}
|
|
39232
39232
|
}
|
|
39233
|
-
class b2 extends
|
|
39233
|
+
class b2 extends l2 {
|
|
39234
39234
|
constructor(e3, t3, s3, i3) {
|
|
39235
39235
|
super(n2.NEventReportRequest, e3, false), this.setAffectedSopInstanceUid(t3), this.setEventTypeId(s3), this.setMetaSopClassUid(i3);
|
|
39236
39236
|
}
|
|
@@ -39241,7 +39241,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39241
39241
|
this.getCommandDataset().setElement("EventTypeID", e3);
|
|
39242
39242
|
}
|
|
39243
39243
|
}
|
|
39244
|
-
class O2 extends
|
|
39244
|
+
class O2 extends p3 {
|
|
39245
39245
|
constructor(e3, t3, s3, i3, r9) {
|
|
39246
39246
|
super(n2.NEventReportResponse, e3, false, i3, r9), this.setAffectedSopInstanceUid(t3), this.setEventTypeId(s3);
|
|
39247
39247
|
}
|
|
@@ -39257,7 +39257,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39257
39257
|
return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
|
|
39258
39258
|
}
|
|
39259
39259
|
}
|
|
39260
|
-
class N2 extends
|
|
39260
|
+
class N2 extends l2 {
|
|
39261
39261
|
constructor(e3, t3, s3, i3) {
|
|
39262
39262
|
super(n2.NGetRequest, e3, false), this.setRequestedSopInstanceUid(t3), this.setAttributeIdentifierList(Array.isArray(s3) ? s3 : [s3]), this.setMetaSopClassUid(i3);
|
|
39263
39263
|
}
|
|
@@ -39283,22 +39283,22 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39283
39283
|
return "0".repeat(t3 - s3.length) + s3;
|
|
39284
39284
|
}
|
|
39285
39285
|
}
|
|
39286
|
-
class
|
|
39286
|
+
class B extends p3 {
|
|
39287
39287
|
constructor(e3, t3, s3, i3) {
|
|
39288
39288
|
super(n2.NGetResponse, e3, false, s3, i3), this.setAffectedSopInstanceUid(t3);
|
|
39289
39289
|
}
|
|
39290
39290
|
static fromRequest(e3) {
|
|
39291
39291
|
if (!(e3 instanceof N2)) throw new Error("Request should be an instance of NGetRequest");
|
|
39292
|
-
const t3 = new
|
|
39292
|
+
const t3 = new B(e3.getRequestedSopClassUid(), e3.getRequestedSopInstanceUid(), o2.ProcessingFailure);
|
|
39293
39293
|
return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
|
|
39294
39294
|
}
|
|
39295
39295
|
}
|
|
39296
|
-
class M3 extends
|
|
39296
|
+
class M3 extends l2 {
|
|
39297
39297
|
constructor(e3, t3, s3) {
|
|
39298
39298
|
super(n2.NSetRequest, e3, false), this.setRequestedSopInstanceUid(t3), this.setMetaSopClassUid(s3);
|
|
39299
39299
|
}
|
|
39300
39300
|
}
|
|
39301
|
-
class L2 extends
|
|
39301
|
+
class L2 extends p3 {
|
|
39302
39302
|
constructor(e3, t3, s3, i3) {
|
|
39303
39303
|
super(n2.NSetResponse, e3, false, s3, i3), this.setAffectedSopInstanceUid(t3);
|
|
39304
39304
|
}
|
|
@@ -39308,7 +39308,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39308
39308
|
return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
|
|
39309
39309
|
}
|
|
39310
39310
|
}
|
|
39311
|
-
class F2 extends
|
|
39311
|
+
class F2 extends l2 {
|
|
39312
39312
|
constructor(e3, t3) {
|
|
39313
39313
|
super(n2.CCancelRequest, e3, false), this.setMessageIdBeingRespondedTo(t3);
|
|
39314
39314
|
}
|
|
@@ -39323,7 +39323,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39323
39323
|
return new F2(e3.getAffectedSopClassUid(), e3.getMessageId());
|
|
39324
39324
|
}
|
|
39325
39325
|
}
|
|
39326
|
-
e2.exports = { CCancelRequest: F2, CEchoRequest: R2, CEchoResponse: S2, CFindRequest: f2, CFindResponse: y2, CGetRequest: v, CGetResponse: w2, CMoveRequest: P2, CMoveResponse: A2, Command: g2, CStoreRequest: I2, CStoreResponse: C2, NActionRequest: q2, NActionResponse: D2, NCreateRequest: x2, NCreateResponse: U2, NDeleteRequest: E2, NDeleteResponse: T, NEventReportRequest: b2, NEventReportResponse: O2, NGetRequest: N2, NGetResponse:
|
|
39326
|
+
e2.exports = { CCancelRequest: F2, CEchoRequest: R2, CEchoResponse: S2, CFindRequest: f2, CFindResponse: y2, CGetRequest: v, CGetResponse: w2, CMoveRequest: P2, CMoveResponse: A2, Command: g2, CStoreRequest: I2, CStoreResponse: C2, NActionRequest: q2, NActionResponse: D2, NCreateRequest: x2, NCreateResponse: U2, NDeleteRequest: E2, NDeleteResponse: T, NEventReportRequest: b2, NEventReportResponse: O2, NGetRequest: N2, NGetResponse: B, NSetRequest: M3, NSetResponse: L2, Request: l2, Response: p3 };
|
|
39327
39327
|
}, 492: (e2) => {
|
|
39328
39328
|
const t2 = { AAbort: 7, AAssociateAC: 2, AAssociateRJ: 3, AAssociateRQ: 1, AReleaseRP: 6, AReleaseRQ: 5, PDataTF: 4 };
|
|
39329
39329
|
Object.freeze(t2);
|
|
@@ -39351,16 +39351,16 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39351
39351
|
Object.freeze(m2);
|
|
39352
39352
|
const g2 = { BasicTextSrStorage: "1.2.840.10008.5.1.4.1.1.88.11", BreastProjectionXRayImageStorageForPresentation: "1.2.840.10008.5.1.4.1.1.13.1.4", BreastProjectionXRayImageStorageForProcessing: "1.2.840.10008.5.1.4.1.1.13.1.5", BreastTomosynthesisImageStorage: "1.2.840.10008.5.1.4.1.1.13.1.3", ChestCadSrStorage: "1.2.840.10008.5.1.4.1.1.88.65", ComprehensiveSrStorage: "1.2.840.10008.5.1.4.1.1.88.33", ComputedRadiographyImageStorage: "1.2.840.10008.5.1.4.1.1.1", CtImageStorage: "1.2.840.10008.5.1.4.1.1.2", DigitalIntraOralXRayImageStorageForPresentation: "1.2.840.10008.5.1.4.1.1.1.3", DigitalIntraOralXRayImageStorageForProcessing: "1.2.840.10008.5.1.4.1.1.1.3.1", DigitalMammographyXRayImageStorageForPresentation: "1.2.840.10008.5.1.4.1.1.1.2", DigitalMammographyXRayImageStorageForProcessing: "1.2.840.10008.5.1.4.1.1.1.2.1", DigitalXRayImageStorageForPresentation: "1.2.840.10008.5.1.4.1.1.1.1", DigitalXRayImageStorageForProcessing: "1.2.840.10008.5.1.4.1.1.1.1.1", EncapsulatedCdaStorage: "1.2.840.10008.5.1.4.1.1.104.2", EncapsulatedPdfStorage: "1.2.840.10008.5.1.4.1.1.104.1", EnhancedCtImageStorage: "1.2.840.10008.5.1.4.1.1.2.1", EnhancedMrColorImageStorage: "1.2.840.10008.5.1.4.1.1.4.3", EnhancedMrImageStorage: "1.2.840.10008.5.1.4.1.1.4.1", EnhancedPetImageStorage: "1.2.840.10008.5.1.4.1.1.130", EnhancedSrStorage: "1.2.840.10008.5.1.4.1.1.88.22", EnhancedXaImageStorage: "1.2.840.10008.5.1.4.1.1.12.1.1", EnhancedXrfImageStorage: "1.2.840.10008.5.1.4.1.1.12.2.1", IntravascularOpticalCoherenceTomographyImageStorageForPresentation: "1.2.840.10008.5.1.4.1.1.14.1", IntravascularOpticalCoherenceTomographyImageStorageForProcessing: "1.2.840.10008.5.1.4.1.1.14.2", LegacyConvertedEnhancedCTImageStorage: "1.2.840.10008.5.1.4.1.1.2.2", LegacyConvertedEnhancedMRImageStorage: "1.2.840.10008.5.1.4.1.1.4.4", LegacyConvertedEnhancedPETImageStorage: "1.2.840.10008.5.1.4.1.1.128.1", MammographyCadSrStorage: "1.2.840.10008.5.1.4.1.1.88.50", MrImageStorage: "1.2.840.10008.5.1.4.1.1.4", MultiframeGrayscaleByteSecondaryCaptureImageStorage: "1.2.840.10008.5.1.4.1.1.7.2", MultiframeGrayscaleWordSecondaryCaptureImageStorage: "1.2.840.10008.5.1.4.1.1.7.3", MultiframeSingleBitSecondaryCaptureImageStorage: "1.2.840.10008.5.1.4.1.1.7.1", MultiframeTrueColorSecondaryCaptureImageStorage: "1.2.840.10008.5.1.4.1.1.7.4", NuclearMedicineImageStorage: "1.2.840.10008.5.1.4.1.1.20", OphthalmicOpticalCoherenceTomographyEnFaceImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.5.7", OphthalmicPhotography16BitImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.5.2", OphthalmicPhotography8BitImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.5.1", OphthalmicTomographyImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.5.4", PositronEmissionTomographyImageStorage: "1.2.840.10008.5.1.4.1.1.128", RtImageStorage: "1.2.840.10008.5.1.4.1.1.481.1", SecondaryCaptureImageStorage: "1.2.840.10008.5.1.4.1.1.7", UltrasoundImageStorage: "1.2.840.10008.5.1.4.1.1.6.1", UltrasoundMultiframeImageStorage: "1.2.840.10008.5.1.4.1.1.3.1", VideoEndoscopicImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.1.1", VideoMicroscopicImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.2.1", VideoPhotographicImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.4.1", VlEndoscopicImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.1", VlMicroscopicImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.2", VlPhotographicImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.4", VlSlideCoordinatesMicroscopicImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.3", VlWholeSlideMicroscopyImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.6", WideFieldOphthalmicPhotography3dCoordinatesImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.5.6", WideFieldOphthalmicPhotographyStereographicProjectionImageStorage: "1.2.840.10008.5.1.4.1.1.77.1.5.5", XRay3dAngiographicImageStorage: "1.2.840.10008.5.1.4.1.1.13.1.1", XRay3dCraniofacialImageStorage: "1.2.840.10008.5.1.4.1.1.13.1.2", XRayAngiographicImageStorage: "1.2.840.10008.5.1.4.1.1.12.1", XRayRadiationDoseSRStorage: "1.2.840.10008.5.1.4.1.1.88.67", XRayRadiofluoroscopicImageStorage: "1.2.840.10008.5.1.4.1.1.12.2" };
|
|
39353
39353
|
Object.freeze(g2);
|
|
39354
|
-
const
|
|
39355
|
-
Object.freeze(
|
|
39356
|
-
const
|
|
39357
|
-
Object.freeze(
|
|
39358
|
-
const R2 = [
|
|
39354
|
+
const l2 = { Verification: "1.2.840.10008.1.1", StudyRootQueryRetrieveInformationModelFind: "1.2.840.10008.5.1.4.1.2.2.1", ModalityWorklistInformationModelFind: "1.2.840.10008.5.1.4.31", ModalityPerformedProcedureStep: "1.2.840.10008.3.1.2.3.3", StudyRootQueryRetrieveInformationModelMove: "1.2.840.10008.5.1.4.1.2.2.2", StudyRootQueryRetrieveInformationModelGet: "1.2.840.10008.5.1.4.1.2.2.3", StorageCommitmentPushModel: "1.2.840.10008.1.20.1", BasicFilmSession: "1.2.840.10008.5.1.1.1", PrintJob: "1.2.840.10008.5.1.1.14", BasicAnnotationBox: "1.2.840.10008.5.1.1.15", Printer: "1.2.840.10008.5.1.1.16", PrinterConfigurationRetrieval: "1.2.840.10008.5.1.1.16.376", BasicGrayscalePrintManagementMeta: "1.2.840.10008.5.1.1.9", BasicColorPrintManagementMeta: "1.2.840.10008.5.1.1.18", BasicFilmBox: "1.2.840.10008.5.1.1.2", PresentationLut: "1.2.840.10008.5.1.1.23", BasicGrayscaleImageBox: "1.2.840.10008.5.1.1.4", BasicColorImageBox: "1.2.840.10008.5.1.1.4.1", InstanceAvailabilityNotification: "1.2.840.10008.5.1.4.33" };
|
|
39355
|
+
Object.freeze(l2);
|
|
39356
|
+
const p3 = { ImplicitVRLittleEndian: "1.2.840.10008.1.2", ExplicitVRLittleEndian: "1.2.840.10008.1.2.1", DeflatedExplicitVRLittleEndian: "1.2.840.10008.1.2.1.99", ExplicitVRBigEndian: "1.2.840.10008.1.2.2", RleLossless: "1.2.840.10008.1.2.5", JpegBaseline: "1.2.840.10008.1.2.4.50", JpegLossless: "1.2.840.10008.1.2.4.70", JpegLsLossless: "1.2.840.10008.1.2.4.80", JpegLsLossy: "1.2.840.10008.1.2.4.81", Jpeg2000Lossless: "1.2.840.10008.1.2.4.90", Jpeg2000Lossy: "1.2.840.10008.1.2.4.91" };
|
|
39357
|
+
Object.freeze(p3);
|
|
39358
|
+
const R2 = [p3.ImplicitVRLittleEndian, p3.ExplicitVRLittleEndian];
|
|
39359
39359
|
Object.freeze(R2);
|
|
39360
39360
|
const S2 = { ImplementationClassUid: "1.2.826.0.1.3680043.10.854", ImplementationVersion: "DCMJS-DIMSE-V0.1", MaxPduLength: 262144 };
|
|
39361
|
-
Object.freeze(S2), e2.exports = { AbortReason: o2, AbortSource: r8, CommandFieldType: s2, DefaultImplementation: S2, PresentationContextResult: n2, Priority: u2, RawPduType: t2, RejectReason: d3, RejectResult: a2, RejectSource: c, SopClass:
|
|
39361
|
+
Object.freeze(S2), e2.exports = { AbortReason: o2, AbortSource: r8, CommandFieldType: s2, DefaultImplementation: S2, PresentationContextResult: n2, Priority: u2, RawPduType: t2, RejectReason: d3, RejectResult: a2, RejectSource: c, SopClass: l2, Status: h2, StorageClass: g2, TranscodableTransferSyntaxes: R2, TransferSyntax: p3, Uid: m2, UserIdentityType: i2 };
|
|
39362
39362
|
}, 825: (e2, t2, s2) => {
|
|
39363
|
-
const { StorageClass: n2, TransferSyntax: i2 } = s2(492), r8 = s2(139), { readFile: o2, readFileSync: a2, writeFile: c, writeFileSync: d3 } = s2(896), { EOL: u2 } = s2(857), h2 = s2(111), { DicomDict: m2, DicomMessage: g2, DicomMetaDictionary:
|
|
39363
|
+
const { StorageClass: n2, TransferSyntax: i2 } = s2(492), r8 = s2(139), { readFile: o2, readFileSync: a2, writeFile: c, writeFileSync: d3 } = s2(896), { EOL: u2 } = s2(857), h2 = s2(111), { DicomDict: m2, DicomMessage: g2, DicomMetaDictionary: l2, ReadBufferStream: p3, WriteBufferStream: R2 } = h2.data, S2 = h2.log;
|
|
39364
39364
|
class f2 {
|
|
39365
39365
|
constructor(e3, t3, s3) {
|
|
39366
39366
|
s3 = s3 || {}, s3 = { ignoreErrors: true, ...s3 }, S2.level = "error", this.transferSyntaxUid = t3 || i2.ImplicitVRLittleEndian, Buffer.isBuffer(e3) ? this.elements = this._fromElementsBuffer(e3, this.transferSyntaxUid, s3) : this.elements = e3 || {};
|
|
@@ -39381,11 +39381,11 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39381
39381
|
this.transferSyntaxUid = e3;
|
|
39382
39382
|
}
|
|
39383
39383
|
getDenaturalizedDataset(e3, t3) {
|
|
39384
|
-
const s3 = t3 ?
|
|
39384
|
+
const s3 = t3 ? l2.denaturalizeDataset(this.getElements(), { ...l2.nameMap, ...t3 }) : l2.denaturalizeDataset(this.getElements()), n3 = new R2();
|
|
39385
39385
|
return g2.write(s3, n3, this.transferSyntaxUid, e3), Buffer.from(n3.getBuffer());
|
|
39386
39386
|
}
|
|
39387
39387
|
getDenaturalizedCommandDataset() {
|
|
39388
|
-
const e3 =
|
|
39388
|
+
const e3 = l2.denaturalizeDataset(this.getElements()), t3 = new R2(), s3 = new R2();
|
|
39389
39389
|
return g2.write(e3, s3, i2.ImplicitVRLittleEndian, {}), g2.writeTagObject(t3, "00000000", "UL", s3.size, i2.ImplicitVRLittleEndian, {}), t3.concat(s3), Buffer.from(t3.getBuffer());
|
|
39390
39390
|
}
|
|
39391
39391
|
static fromFile(e3, t3, s3) {
|
|
@@ -39400,13 +39400,13 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39400
39400
|
});
|
|
39401
39401
|
}
|
|
39402
39402
|
toFile(e3, t3, s3, i3) {
|
|
39403
|
-
const o3 = { _meta: { FileMetaInformationVersion: new Uint8Array([0, 1]).buffer, MediaStorageSOPClassUID: this.getElement("SOPClassUID") || n2.SecondaryCaptureImageStorage, MediaStorageSOPInstanceUID: this.getElement("SOPInstanceUID") || f2.generateDerivedUid(), TransferSyntaxUID: this.getTransferSyntaxUid(), ImplementationClassUID: r8.getImplementationClassUid(), ImplementationVersionName: r8.getImplementationVersion() }, ...this.getElements() }, a3 =
|
|
39404
|
-
u3.dict = s3 ?
|
|
39403
|
+
const o3 = { _meta: { FileMetaInformationVersion: new Uint8Array([0, 1]).buffer, MediaStorageSOPClassUID: this.getElement("SOPClassUID") || n2.SecondaryCaptureImageStorage, MediaStorageSOPInstanceUID: this.getElement("SOPInstanceUID") || f2.generateDerivedUid(), TransferSyntaxUID: this.getTransferSyntaxUid(), ImplementationClassUID: r8.getImplementationClassUid(), ImplementationVersionName: r8.getImplementationVersion() }, ...this.getElements() }, a3 = l2.denaturalizeDataset(o3._meta), u3 = new m2(a3);
|
|
39404
|
+
u3.dict = s3 ? l2.denaturalizeDataset(o3, { ...l2.nameMap, ...s3 }) : l2.denaturalizeDataset(o3), t3 instanceof Function ? c(e3, Buffer.from(u3.write(i3)), (e4) => {
|
|
39405
39405
|
t3(e4 || void 0);
|
|
39406
39406
|
}) : d3(e3, Buffer.from(u3.write(i3)));
|
|
39407
39407
|
}
|
|
39408
39408
|
static generateDerivedUid() {
|
|
39409
|
-
return
|
|
39409
|
+
return l2.uid();
|
|
39410
39410
|
}
|
|
39411
39411
|
toString() {
|
|
39412
39412
|
const e3 = [];
|
|
@@ -39414,12 +39414,12 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39414
39414
|
}
|
|
39415
39415
|
static _fromP10Buffer(e3, t3) {
|
|
39416
39416
|
t3 = t3 || {}, t3 = { ignoreErrors: true, ...t3 };
|
|
39417
|
-
const s3 = g2.readFile(e3.buffer.slice(e3.byteOffset, e3.byteOffset + e3.byteLength), t3), n3 =
|
|
39417
|
+
const s3 = g2.readFile(e3.buffer.slice(e3.byteOffset, e3.byteOffset + e3.byteLength), t3), n3 = l2.naturalizeDataset(s3.meta).TransferSyntaxUID, i3 = l2.naturalizeDataset(s3.dict);
|
|
39418
39418
|
return new f2(i3, n3);
|
|
39419
39419
|
}
|
|
39420
39420
|
_fromElementsBuffer(e3, t3, s3) {
|
|
39421
|
-
const n3 = new
|
|
39422
|
-
return
|
|
39421
|
+
const n3 = new p3(e3.buffer.slice(e3.byteOffset, e3.byteOffset + e3.byteLength)), r9 = t3 === i2.ImplicitVRLittleEndian ? i2.ImplicitVRLittleEndian : t3 === i2.ExplicitVRBigEndian ? i2.ExplicitVRBigEndian : i2.ExplicitVRLittleEndian, o3 = g2._read(n3, r9, s3);
|
|
39422
|
+
return l2.naturalizeDataset(o3);
|
|
39423
39423
|
}
|
|
39424
39424
|
}
|
|
39425
39425
|
e2.exports = f2;
|
|
@@ -39447,8 +39447,8 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39447
39447
|
}
|
|
39448
39448
|
};
|
|
39449
39449
|
}, 371: (e2, t2, s2) => {
|
|
39450
|
-
const { Association: n2 } = s2(570), { AAbort: i2, AAssociateAC: r8, AAssociateRJ: o2, AAssociateRQ: a2, AReleaseRP: c, AReleaseRQ: d3, PDataTF: u2, Pdv: h2, RawPdu: m2 } = s2(942), { CommandFieldType: g2, RawPduType:
|
|
39451
|
-
class
|
|
39450
|
+
const { Association: n2 } = s2(570), { AAbort: i2, AAssociateAC: r8, AAssociateRJ: o2, AAssociateRQ: a2, AReleaseRP: c, AReleaseRQ: d3, PDataTF: u2, Pdv: h2, RawPdu: m2 } = s2(942), { CommandFieldType: g2, RawPduType: l2, Status: p3, TranscodableTransferSyntaxes: R2 } = s2(492), { CCancelRequest: S2, CEchoRequest: f2, CEchoResponse: y2, CFindRequest: I2, CFindResponse: C2, CGetRequest: P2, CGetResponse: A2, CMoveRequest: v, CMoveResponse: w2, Command: x2, CStoreRequest: U2, CStoreResponse: q2, NActionRequest: D2, NActionResponse: E2, NCreateRequest: T, NCreateResponse: b2, NDeleteRequest: O2, NDeleteResponse: N2, NEventReportRequest: B, NEventReportResponse: M3, NGetRequest: L2, NGetResponse: F2, NSetRequest: k2, NSetResponse: $2, Response: j2 } = s2(940), V2 = s2(825), _ = s2(139), G = s2(906), z2 = s2(547), { SmartBuffer: Q2 } = s2(766), { EOL: W } = s2(857), J2 = s2(733);
|
|
39451
|
+
class X extends J2 {
|
|
39452
39452
|
constructor() {
|
|
39453
39453
|
super();
|
|
39454
39454
|
}
|
|
@@ -39460,8 +39460,8 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39460
39460
|
_process(e3) {
|
|
39461
39461
|
if (void 0 === this.receiving) {
|
|
39462
39462
|
if (this.minimumReceived && (e3 = Buffer.concat([this.minimumReceived, e3], this.minimumReceived.length + e3.length), this.minimumReceived = void 0), e3.length < 6) return void (this.minimumReceived = e3);
|
|
39463
|
-
const t3 =
|
|
39464
|
-
if (s3 !==
|
|
39463
|
+
const t3 = Q2.fromBuffer(e3, "ascii"), s3 = t3.readUInt8();
|
|
39464
|
+
if (s3 !== l2.AAssociateRQ && s3 !== l2.AAssociateAC && s3 !== l2.AAssociateRJ && s3 !== l2.PDataTF && s3 !== l2.AReleaseRQ && s3 !== l2.AReleaseRP && s3 !== l2.AAbort) return void this.emit("error", new Error(`Unknown PDU type: ${s3}`));
|
|
39465
39465
|
t3.readUInt8();
|
|
39466
39466
|
const n3 = t3.readUInt32BE();
|
|
39467
39467
|
let i3 = e3.length - 6;
|
|
@@ -39483,17 +39483,17 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39483
39483
|
}
|
|
39484
39484
|
e2.exports = class extends J2 {
|
|
39485
39485
|
constructor(e3, t3) {
|
|
39486
|
-
super(), this.messageId = 0, this.socket = e3, this.requests = [], this.pending = [], this.dimseBuffer = void 0, this.dimse = void 0, t3 = t3 || {}, this.connectTimeout = t3.connectTimeout || 18e4, this.associationTimeout = t3.associationTimeout || 6e4, this.pduTimeout = t3.pduTimeout || 6e4, this.logCommandDatasets = t3.logCommandDatasets || false, this.logDatasets = t3.logDatasets || false, this.datasetReadOptions = t3.datasetReadOptions || {}, this.datasetWriteOptions = t3.datasetWriteOptions || {}, this.datasetNameMap = t3.datasetNameMap || {}, this.logId = "", this.connected = false, this.connectedTime = void 0, this.lastPduTime = void 0, this.timeoutIntervalId = void 0, this.statistics = new
|
|
39486
|
+
super(), this.messageId = 0, this.socket = e3, this.requests = [], this.pending = [], this.dimseBuffer = void 0, this.dimse = void 0, t3 = t3 || {}, this.connectTimeout = t3.connectTimeout || 18e4, this.associationTimeout = t3.associationTimeout || 6e4, this.pduTimeout = t3.pduTimeout || 6e4, this.logCommandDatasets = t3.logCommandDatasets || false, this.logDatasets = t3.logDatasets || false, this.datasetReadOptions = t3.datasetReadOptions || {}, this.datasetWriteOptions = t3.datasetWriteOptions || {}, this.datasetNameMap = t3.datasetNameMap || {}, this.logId = "", this.connected = false, this.connectedTime = void 0, this.lastPduTime = void 0, this.timeoutIntervalId = void 0, this.statistics = new G(), this._wrapSocket();
|
|
39487
39487
|
}
|
|
39488
39488
|
sendAssociationRequest(e3) {
|
|
39489
39489
|
this.association = e3;
|
|
39490
39490
|
const t3 = new a2(this.association).write();
|
|
39491
|
-
this.logId = this.association.getCalledAeTitle(), z2.info(`${this.logId} -> Association request:${
|
|
39491
|
+
this.logId = this.association.getCalledAeTitle(), z2.info(`${this.logId} -> Association request:${W}${this.association.toString()}`), this._sendPdu(t3);
|
|
39492
39492
|
}
|
|
39493
39493
|
sendAssociationAccept() {
|
|
39494
39494
|
this.association.setImplementationClassUid(_.getImplementationClassUid()), this.association.setImplementationVersion(_.getImplementationVersion()), this.association.setMaxPduLength(Math.min(this.association.getMaxPduLength(), _.getMaxPduLength()));
|
|
39495
39495
|
const e3 = new r8(this.association).write();
|
|
39496
|
-
z2.info(`${this.logId} -> Association accept:${
|
|
39496
|
+
z2.info(`${this.logId} -> Association accept:${W}${this.association.toString()}`), this._sendPdu(e3);
|
|
39497
39497
|
}
|
|
39498
39498
|
sendAssociationReject(e3, t3, s3) {
|
|
39499
39499
|
const n3 = new o2(e3, t3, s3), i3 = n3.write();
|
|
@@ -39590,29 +39590,29 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39590
39590
|
const t3 = new m2(e3);
|
|
39591
39591
|
try {
|
|
39592
39592
|
switch (t3.readPdu(), t3.getType()) {
|
|
39593
|
-
case
|
|
39594
|
-
this.association = new n2(), new a2(this.association).read(t3), this.logId = this.association.getCallingAeTitle(), z2.info(`${this.logId} <- Association request:${
|
|
39593
|
+
case l2.AAssociateRQ:
|
|
39594
|
+
this.association = new n2(), new a2(this.association).read(t3), this.logId = this.association.getCallingAeTitle(), z2.info(`${this.logId} <- Association request:${W}${this.association.toString()}`), this.emit("associationRequested", this.association);
|
|
39595
39595
|
break;
|
|
39596
|
-
case
|
|
39597
|
-
new r8(this.association).read(t3), this.logId = this.association.getCalledAeTitle(), z2.info(`${this.logId} <- Association accept:${
|
|
39596
|
+
case l2.AAssociateAC:
|
|
39597
|
+
new r8(this.association).read(t3), this.logId = this.association.getCalledAeTitle(), z2.info(`${this.logId} <- Association accept:${W}${this.association.toString()}`), this.emit("associationAccepted", this.association);
|
|
39598
39598
|
break;
|
|
39599
|
-
case
|
|
39599
|
+
case l2.AAssociateRJ: {
|
|
39600
39600
|
const e4 = new o2();
|
|
39601
39601
|
e4.read(t3), z2.info(`${this.logId} <- Association reject ${e4.toString()}`), this.emit("associationRejected", { result: e4.getResult(), source: e4.getSource(), reason: e4.getReason() });
|
|
39602
39602
|
break;
|
|
39603
39603
|
}
|
|
39604
|
-
case
|
|
39604
|
+
case l2.PDataTF: {
|
|
39605
39605
|
const e4 = new u2();
|
|
39606
39606
|
e4.read(t3), this._processPDataTf(e4);
|
|
39607
39607
|
break;
|
|
39608
39608
|
}
|
|
39609
|
-
case
|
|
39609
|
+
case l2.AReleaseRQ:
|
|
39610
39610
|
new d3().read(t3), z2.info(`${this.logId} <- Association release request`), this.emit("associationReleaseRequested");
|
|
39611
39611
|
break;
|
|
39612
|
-
case
|
|
39612
|
+
case l2.AReleaseRP:
|
|
39613
39613
|
new c().read(t3), z2.info(`${this.logId} <- Association release response`), this.emit("associationReleaseResponse");
|
|
39614
39614
|
break;
|
|
39615
|
-
case
|
|
39615
|
+
case l2.AAbort: {
|
|
39616
39616
|
const e4 = new i2();
|
|
39617
39617
|
e4.read(t3), z2.info(`${this.logId} <- Association abort ${e4.toString()}`), this.emit("abort", { source: e4.getSource(), reason: e4.getReason() });
|
|
39618
39618
|
break;
|
|
@@ -39629,7 +39629,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39629
39629
|
_processPDataTf(e3) {
|
|
39630
39630
|
try {
|
|
39631
39631
|
e3.getPdvs().forEach((e4) => {
|
|
39632
|
-
this.dimseBuffer || (this.dimseBuffer =
|
|
39632
|
+
this.dimseBuffer || (this.dimseBuffer = Q2.fromOptions({ encoding: "ascii" })), this.dimseBuffer.writeBuffer(e4.getValue());
|
|
39633
39633
|
const t3 = this.association.getPresentationContext(e4.getPresentationContextId());
|
|
39634
39634
|
if (e4.isLastFragment()) if (e4.isCommand()) {
|
|
39635
39635
|
const s3 = new x2(new V2(this.dimseBuffer.toBuffer()));
|
|
@@ -39683,7 +39683,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39683
39683
|
this.dimse = Object.assign(new N2(), s3);
|
|
39684
39684
|
break;
|
|
39685
39685
|
case g2.NEventReportRequest:
|
|
39686
|
-
this.dimse = Object.assign(new
|
|
39686
|
+
this.dimse = Object.assign(new B(), s3);
|
|
39687
39687
|
break;
|
|
39688
39688
|
case g2.NEventReportResponse:
|
|
39689
39689
|
this.dimse = Object.assign(new M3(), s3);
|
|
@@ -39718,9 +39718,9 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39718
39718
|
}
|
|
39719
39719
|
}
|
|
39720
39720
|
_performDimse(e3, t3) {
|
|
39721
|
-
if (t3 instanceof
|
|
39721
|
+
if (t3 instanceof j2) {
|
|
39722
39722
|
const e4 = Object.assign(Object.create(Object.getPrototypeOf(t3)), t3), s3 = this.pending.find((e5) => e5.getMessageId() === t3.getMessageIdBeingRespondedTo());
|
|
39723
|
-
s3 && (s3.raiseResponseEvent(e4), e4.getStatus() !==
|
|
39723
|
+
s3 && (s3.raiseResponseEvent(e4), e4.getStatus() !== p3.Pending && s3.raiseDoneEvent());
|
|
39724
39724
|
} else t3.getCommandFieldType() === g2.CEchoRequest ? this.emit("cEchoRequest", t3, (t4) => {
|
|
39725
39725
|
this._sendDimse({ context: e3, command: t4 });
|
|
39726
39726
|
}) : t3.getCommandFieldType() === g2.CFindRequest ? this.emit("cFindRequest", t3, (t4) => {
|
|
@@ -39755,7 +39755,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39755
39755
|
this.socket.setTimeout(this.connectTimeout), this.socket.on("connect", () => {
|
|
39756
39756
|
this.connected = true, this.connectedTime = Date.now(), this.emit("connect");
|
|
39757
39757
|
});
|
|
39758
|
-
const e3 = new
|
|
39758
|
+
const e3 = new X();
|
|
39759
39759
|
e3.on("pdu", (e4) => {
|
|
39760
39760
|
this.lastPduTime = Date.now(), this._processPdu(e4);
|
|
39761
39761
|
}), e3.on("error", (e4) => {
|
|
@@ -40214,8 +40214,8 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
40214
40214
|
}
|
|
40215
40215
|
}, Pdv: g2, RawPdu: m2 };
|
|
40216
40216
|
}, 538: (e2, t2, s2) => {
|
|
40217
|
-
const { CEchoResponse: n2, CFindResponse: i2, CGetResponse: r8, CMoveResponse: o2, CStoreResponse: a2, NActionResponse: c, NCreateResponse: d3, NDeleteResponse: u2, NEventReportResponse: h2, NGetResponse: m2, NSetResponse: g2 } = s2(940),
|
|
40218
|
-
e2.exports = { Scp: class extends
|
|
40217
|
+
const { CEchoResponse: n2, CFindResponse: i2, CGetResponse: r8, CMoveResponse: o2, CStoreResponse: a2, NActionResponse: c, NCreateResponse: d3, NDeleteResponse: u2, NEventReportResponse: h2, NGetResponse: m2, NSetResponse: g2 } = s2(940), l2 = s2(371), p3 = s2(906), R2 = s2(547), S2 = s2(733), f2 = s2(278), y2 = s2(756);
|
|
40218
|
+
e2.exports = { Scp: class extends l2 {
|
|
40219
40219
|
constructor(e3, t3) {
|
|
40220
40220
|
super(e3, t3), this.on("associationRequested", (e4) => {
|
|
40221
40221
|
this.associationRequested(e4);
|
|
@@ -40296,7 +40296,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
40296
40296
|
}
|
|
40297
40297
|
}, Server: class extends S2 {
|
|
40298
40298
|
constructor(e3) {
|
|
40299
|
-
super(), this.scp = { class: e3 }, this.server = void 0, this.clients = [], this.statistics = new
|
|
40299
|
+
super(), this.scp = { class: e3 }, this.server = void 0, this.clients = [], this.statistics = new p3();
|
|
40300
40300
|
}
|
|
40301
40301
|
listen(e3, t3) {
|
|
40302
40302
|
let s3 = {};
|
|
@@ -40357,8 +40357,8 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
40357
40357
|
}
|
|
40358
40358
|
};
|
|
40359
40359
|
}, 237: (e2, t2, s2) => {
|
|
40360
|
-
const { Association: n2, PresentationContext: i2 } = s2(570), { Scp: r8, Server: o2 } = s2(538), { CCancelRequest: a2, CEchoRequest: c, CEchoResponse: d3, CFindRequest: u2, CFindResponse: h2, CGetRequest: m2, CGetResponse: g2, CMoveRequest:
|
|
40361
|
-
e2.exports =
|
|
40360
|
+
const { Association: n2, PresentationContext: i2 } = s2(570), { Scp: r8, Server: o2 } = s2(538), { CCancelRequest: a2, CEchoRequest: c, CEchoResponse: d3, CFindRequest: u2, CFindResponse: h2, CGetRequest: m2, CGetResponse: g2, CMoveRequest: l2, CMoveResponse: p3, CStoreRequest: R2, CStoreResponse: S2, NActionRequest: f2, NActionResponse: y2, NCreateRequest: I2, NCreateResponse: C2, NDeleteRequest: P2, NDeleteResponse: A2, NEventReportRequest: v, NEventReportResponse: w2, NGetRequest: x2, NGetResponse: U2, NSetRequest: q2, NSetResponse: D2 } = s2(940), { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: B, RejectReason: M3, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $2, StorageClass: j2, TransferSyntax: V2, Uid: _, UserIdentityType: G } = s2(492), z2 = s2(422), Q2 = s2(825), W = s2(139), J2 = s2(906), X = { association: { Association: n2, PresentationContext: i2 }, Client: z2, constants: { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: B, RejectReason: M3, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $2, StorageClass: j2, TransferSyntax: V2, Uid: _, UserIdentityType: G }, Dataset: Q2, Implementation: W, log: s2(547), requests: { CCancelRequest: a2, CEchoRequest: c, CFindRequest: u2, CGetRequest: m2, CMoveRequest: l2, CStoreRequest: R2, NActionRequest: f2, NCreateRequest: I2, NDeleteRequest: P2, NEventReportRequest: v, NGetRequest: x2, NSetRequest: q2 }, responses: { CEchoResponse: d3, CFindResponse: h2, CGetResponse: g2, CMoveResponse: p3, CStoreResponse: S2, NActionResponse: y2, NCreateResponse: C2, NDeleteResponse: A2, NEventReportResponse: w2, NGetResponse: U2, NSetResponse: D2 }, Scp: r8, Server: o2, Statistics: J2, version: s2(837) };
|
|
40361
|
+
e2.exports = X;
|
|
40362
40362
|
}, 547: (e2, t2, s2) => {
|
|
40363
40363
|
const { createLogger: n2, format: i2, transports: r8 } = s2(688), { combine: o2, printf: a2, timestamp: c } = i2, d3 = n2({ format: o2(c(), a2(({ level: e3, message: t3, timestamp: s3 }) => `${s3} -- ${e3.toUpperCase()} -- ${t3}`)), transports: [new r8.Console()] });
|
|
40364
40364
|
e2.exports = d3;
|
|
@@ -40410,7 +40410,7 @@ __export(main_exports, {
|
|
|
40410
40410
|
module.exports = __toCommonJS(main_exports);
|
|
40411
40411
|
|
|
40412
40412
|
// ../core/dist/esm/index.mjs
|
|
40413
|
-
var
|
|
40413
|
+
var Je = class {
|
|
40414
40414
|
constructor(e, t) {
|
|
40415
40415
|
this.operator = e;
|
|
40416
40416
|
this.child = t;
|
|
@@ -40419,7 +40419,7 @@ var Ye = class {
|
|
|
40419
40419
|
return `${this.operator}(${this.child.toString()})`;
|
|
40420
40420
|
}
|
|
40421
40421
|
};
|
|
40422
|
-
var
|
|
40422
|
+
var Z = class {
|
|
40423
40423
|
constructor(e, t, n) {
|
|
40424
40424
|
this.operator = e;
|
|
40425
40425
|
this.left = t;
|
|
@@ -40429,7 +40429,7 @@ var Y = class {
|
|
|
40429
40429
|
return `${this.left.toString()} ${this.operator} ${this.right.toString()}`;
|
|
40430
40430
|
}
|
|
40431
40431
|
};
|
|
40432
|
-
var
|
|
40432
|
+
var Ye = class {
|
|
40433
40433
|
constructor() {
|
|
40434
40434
|
this.prefixParselets = {};
|
|
40435
40435
|
this.infixParselets = {};
|
|
@@ -40505,15 +40505,15 @@ var zt = class {
|
|
|
40505
40505
|
}
|
|
40506
40506
|
};
|
|
40507
40507
|
var Jt = "ok";
|
|
40508
|
-
var
|
|
40508
|
+
var Ze = "created";
|
|
40509
40509
|
var Zt = "not-modified";
|
|
40510
40510
|
var Xt = "not-found";
|
|
40511
40511
|
var tr = "unauthorized";
|
|
40512
|
-
var
|
|
40512
|
+
var Xe = "accepted";
|
|
40513
40513
|
var cn = { resourceType: "OperationOutcome", id: Xt, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
|
|
40514
|
-
var
|
|
40515
|
-
var un = { ...
|
|
40516
|
-
var rr = { ...
|
|
40514
|
+
var be = { resourceType: "OperationOutcome", id: tr, issue: [{ severity: "error", code: "login", details: { text: "Unauthorized" } }] };
|
|
40515
|
+
var un = { ...be, issue: [...be.issue, { severity: "error", code: "expired", details: { text: "Token expired" } }] };
|
|
40516
|
+
var rr = { ...be, issue: [...be.issue, { severity: "error", code: "invalid", details: { text: "Token not issued for this audience" } }] };
|
|
40517
40517
|
function E(r7, e) {
|
|
40518
40518
|
return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "invalid", details: { text: r7 }, ...e ? { expression: [e] } : void 0 }] };
|
|
40519
40519
|
}
|
|
@@ -40523,22 +40523,22 @@ function h(r7) {
|
|
|
40523
40523
|
function ln(r7) {
|
|
40524
40524
|
return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "exception", details: { text: "Internal server error" }, diagnostics: r7.toString() }] };
|
|
40525
40525
|
}
|
|
40526
|
-
function
|
|
40526
|
+
function Re(r7) {
|
|
40527
40527
|
return typeof r7 == "object" && r7 !== null && r7.resourceType === "OperationOutcome";
|
|
40528
40528
|
}
|
|
40529
40529
|
function nr(r7) {
|
|
40530
|
-
return r7.id === Jt || r7.id ===
|
|
40530
|
+
return r7.id === Jt || r7.id === Ze || r7.id === Zt || r7.id === Xe;
|
|
40531
40531
|
}
|
|
40532
40532
|
var d = class extends Error {
|
|
40533
40533
|
constructor(e, t) {
|
|
40534
40534
|
super(pn(e)), this.outcome = e, this.cause = t;
|
|
40535
40535
|
}
|
|
40536
40536
|
};
|
|
40537
|
-
function
|
|
40538
|
-
return r7 instanceof d ? r7.outcome :
|
|
40537
|
+
function et(r7) {
|
|
40538
|
+
return r7 instanceof d ? r7.outcome : Re(r7) ? r7 : E(Ce(r7));
|
|
40539
40539
|
}
|
|
40540
|
-
function
|
|
40541
|
-
return r7 ? typeof r7 == "string" ? r7 : r7 instanceof Error ? r7.message :
|
|
40540
|
+
function Ce(r7) {
|
|
40541
|
+
return r7 ? typeof r7 == "string" ? r7 : r7 instanceof Error ? r7.message : Re(r7) ? pn(r7) : typeof r7 == "object" && "code" in r7 && typeof r7.code == "string" ? r7.code : JSON.stringify(r7) : "Unknown error";
|
|
40542
40542
|
}
|
|
40543
40543
|
function pn(r7) {
|
|
40544
40544
|
let e = r7.issue?.map(eo) ?? [];
|
|
@@ -40561,7 +40561,7 @@ var hn = { Element: { elements: { id: { type: [{ code: "string" }] }, extension:
|
|
|
40561
40561
|
function ar(r7) {
|
|
40562
40562
|
return new or(r7).parse();
|
|
40563
40563
|
}
|
|
40564
|
-
var
|
|
40564
|
+
var le = mn(hn);
|
|
40565
40565
|
var cr = /* @__PURE__ */ Object.create(null);
|
|
40566
40566
|
var yn = /* @__PURE__ */ Object.create(null);
|
|
40567
40567
|
var io = { "http://hl7.org/fhir/StructureDefinition/MoneyQuantity": "MoneyQuantity", "http://hl7.org/fhir/StructureDefinition/SimpleQuantity": "SimpleQuantity", "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition": "ViewDefinition" };
|
|
@@ -40570,26 +40570,27 @@ function Tn(r7) {
|
|
|
40570
40570
|
return e = yn[r7], e || (e = yn[r7] = /* @__PURE__ */ Object.create(null)), e;
|
|
40571
40571
|
}
|
|
40572
40572
|
function ur(r7) {
|
|
40573
|
-
let
|
|
40574
|
-
|
|
40573
|
+
let t = (Array.isArray(r7) ? r7 : r7.entry?.map((n) => n.resource) ?? []).filter((n) => n?.resourceType === "StructureDefinition");
|
|
40574
|
+
Pn(t);
|
|
40575
|
+
for (let n of t) lr(n);
|
|
40575
40576
|
}
|
|
40576
40577
|
function lr(r7) {
|
|
40577
40578
|
if (!r7?.name) throw new Error("Failed loading StructureDefinition from bundle");
|
|
40578
40579
|
if (r7.resourceType !== "StructureDefinition") return;
|
|
40579
40580
|
let e = ar(r7), t = io[r7.url], n, i;
|
|
40580
|
-
t ? (n =
|
|
40581
|
+
t ? (n = le, i = t) : r7.url === `http://hl7.org/fhir/StructureDefinition/${r7.type}` || r7.url === `https://medplum.com/fhir/StructureDefinition/${r7.type}` || r7.type?.startsWith("http://") || r7.type?.startsWith("https://") ? (n = le, i = r7.type) : (n = Tn(r7.url), i = r7.type), n[i] = e;
|
|
40581
40582
|
for (let o of e.innerTypes) o.parentType = e, n[o.name] = o;
|
|
40582
40583
|
cr[r7.url] = e;
|
|
40583
40584
|
}
|
|
40584
40585
|
function En(r7) {
|
|
40585
|
-
return !!
|
|
40586
|
+
return !!le[r7];
|
|
40586
40587
|
}
|
|
40587
40588
|
function Le(r7, e) {
|
|
40588
40589
|
if (e) {
|
|
40589
40590
|
let t = Tn(e)[r7];
|
|
40590
40591
|
if (t) return t;
|
|
40591
40592
|
}
|
|
40592
|
-
return
|
|
40593
|
+
return le[r7];
|
|
40593
40594
|
}
|
|
40594
40595
|
function Rn(r7) {
|
|
40595
40596
|
return !!cr[r7];
|
|
@@ -40597,7 +40598,7 @@ function Rn(r7) {
|
|
|
40597
40598
|
var or = class {
|
|
40598
40599
|
constructor(e) {
|
|
40599
40600
|
if (!e.snapshot?.element || e.snapshot.element.length === 0) throw new Error(`No snapshot defined for StructureDefinition '${e.name}'`);
|
|
40600
|
-
this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, path: this.root.path, title: e.title, type: e.type, url: e.url, kind: e.kind, description: co(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
|
|
40601
|
+
this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, path: this.root.path, title: e.title, type: e.type, url: e.url, version: e.version, kind: e.kind, description: co(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
|
|
40601
40602
|
}
|
|
40602
40603
|
parse() {
|
|
40603
40604
|
let e = this.next();
|
|
@@ -40630,12 +40631,12 @@ var or = class {
|
|
|
40630
40631
|
return this.checkFieldExit(), this.innerTypes.length > 0 && (this.resourceSchema.innerTypes = this.innerTypes), this.resourceSchema;
|
|
40631
40632
|
}
|
|
40632
40633
|
checkFieldEnter(e, t) {
|
|
40633
|
-
this.isInnerType(e) && this.enterInnerType(e), this.slicingContext && !
|
|
40634
|
+
this.isInnerType(e) && this.enterInnerType(e), this.slicingContext && !Pe(this.slicingContext.path, e?.path) && (this.slicingContext = void 0), e.slicing && !this.slicingContext && this.enterSlice(e, t);
|
|
40634
40635
|
}
|
|
40635
40636
|
enterInnerType(e) {
|
|
40636
|
-
for (; this.backboneContext && !
|
|
40637
|
+
for (; this.backboneContext && !Pe(this.backboneContext?.path, e.path); ) this.innerTypes.push(this.backboneContext.type), this.backboneContext = this.backboneContext.parent;
|
|
40637
40638
|
let t = sr(e);
|
|
40638
|
-
this.backboneContext = { type: { name: t, type: t, path: e.path, title: e.label, description: e.definition, elements: {}, constraints: this.parseElementDefinition(e).constraints, innerTypes: [] }, path: e.path, parent:
|
|
40639
|
+
this.backboneContext = { type: { name: t, type: t, path: e.path, title: e.label, description: e.definition, elements: {}, constraints: this.parseElementDefinition(e).constraints, innerTypes: [] }, path: e.path, parent: Pe(this.backboneContext?.path, e.path) ? this.backboneContext : this.backboneContext?.parent };
|
|
40639
40640
|
}
|
|
40640
40641
|
enterSlice(e, t) {
|
|
40641
40642
|
ao(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
|
|
@@ -40644,9 +40645,9 @@ var or = class {
|
|
|
40644
40645
|
}), slices: [], ordered: e.slicing?.ordered ?? false, rule: e.slicing?.rules }, this.slicingContext = { field: t.slicing, path: e.path ?? "" });
|
|
40645
40646
|
}
|
|
40646
40647
|
checkFieldExit(e = void 0) {
|
|
40647
|
-
if (this.backboneContext && !
|
|
40648
|
+
if (this.backboneContext && !Pe(this.backboneContext.path, e?.path)) if (this.backboneContext.parent) do
|
|
40648
40649
|
this.innerTypes.push(this.backboneContext.type), this.backboneContext = this.backboneContext.parent;
|
|
40649
|
-
while (this.backboneContext && !
|
|
40650
|
+
while (this.backboneContext && !Pe(this.backboneContext.path, e?.path));
|
|
40650
40651
|
else this.innerTypes.push(this.backboneContext.type), this.backboneContext = void 0;
|
|
40651
40652
|
}
|
|
40652
40653
|
next() {
|
|
@@ -40665,7 +40666,7 @@ var or = class {
|
|
|
40665
40666
|
}
|
|
40666
40667
|
isInnerType(e) {
|
|
40667
40668
|
let t = this.peek();
|
|
40668
|
-
return !!(
|
|
40669
|
+
return !!(Pe(e?.path, t?.path) && e.type?.some((n) => ["BackboneElement", "Element"].includes(n.code)));
|
|
40669
40670
|
}
|
|
40670
40671
|
parseSliceStart(e) {
|
|
40671
40672
|
if (!this.slicingContext) throw new Error(`Invalid slice start before discriminator: ${e.sliceName} (${e.id})`);
|
|
@@ -40674,7 +40675,7 @@ var or = class {
|
|
|
40674
40675
|
parseElementDefinitionType(e) {
|
|
40675
40676
|
return (e.type ?? []).map((t) => {
|
|
40676
40677
|
let n;
|
|
40677
|
-
return (t.code === "BackboneElement" || t.code === "Element") && (n = sr(e)), n || (n =
|
|
40678
|
+
return (t.code === "BackboneElement" || t.code === "Element") && (n = sr(e)), n || (n = ee(t, "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")?.valueUrl), n || (n = t.code ?? ""), { code: n, targetProfile: t.targetProfile, profile: t.profile };
|
|
40678
40679
|
});
|
|
40679
40680
|
}
|
|
40680
40681
|
parseElementDefinition(e) {
|
|
@@ -40691,7 +40692,7 @@ function ir(r7, e = "") {
|
|
|
40691
40692
|
function so(r7, e) {
|
|
40692
40693
|
return r7 ? e && r7.startsWith(e) ? r7.substring(e.length + 1) : r7 : "";
|
|
40693
40694
|
}
|
|
40694
|
-
function
|
|
40695
|
+
function Pe(r7, e) {
|
|
40695
40696
|
return !r7 || !e ? false : e.startsWith(r7 + ".") || e === r7;
|
|
40696
40697
|
}
|
|
40697
40698
|
function vn(r7) {
|
|
@@ -40705,17 +40706,17 @@ function co(r7) {
|
|
|
40705
40706
|
let e = r7.description;
|
|
40706
40707
|
return e?.startsWith(`Base StructureDefinition for ${r7.name} Type: `) && (e = e.substring(`Base StructureDefinition for ${r7.name} Type: `.length)), e;
|
|
40707
40708
|
}
|
|
40708
|
-
var
|
|
40709
|
+
var it = { base64Binary: /^([A-Za-z\d+/]{4})*([A-Za-z\d+/]{2}==|[A-Za-z\d+/]{3}=)?$/, canonical: /^\S*$/, code: /^[^\s]+( [^\s]+)*$/, date: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1]))?)?$/, dateTime: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1])(T([01]\d|2[0-3])(:[0-5]\d:([0-5]\d|60)(\.\d{1,9})?)?)?)?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00)?)?)?$/, id: /^[A-Za-z0-9\-.]{1,64}$/, instant: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2]\d|3[0-1])T([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00))$/, markdown: /^[\s\S]+$/, oid: /^urn:oid:[0-2](\.(0|[1-9]\d*))+$/, string: /^[\s\S]+$/, time: /^([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?$/, uri: /^\S*$/, url: /^\S*$/, uuid: /^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/, xhtml: /.*/ };
|
|
40709
40710
|
function f(r7) {
|
|
40710
|
-
return [{ type:
|
|
40711
|
+
return [{ type: p.boolean, value: r7 }];
|
|
40711
40712
|
}
|
|
40712
40713
|
function g(r7) {
|
|
40713
|
-
return r7 == null ? { type: "undefined", value: void 0 } : Number.isSafeInteger(r7) ? { type:
|
|
40714
|
+
return r7 == null ? { type: "undefined", value: void 0 } : Number.isSafeInteger(r7) ? { type: p.integer, value: r7 } : typeof r7 == "number" ? { type: p.decimal, value: r7 } : typeof r7 == "boolean" ? { type: p.boolean, value: r7 } : typeof r7 == "string" ? { type: p.string, value: r7 } : V(r7) ? { type: p.Quantity, value: r7 } : k(r7) ? { type: r7.resourceType, value: r7 } : Sr(r7) ? { type: p.CodeableConcept, value: r7 } : Tr(r7) ? { type: p.Coding, value: r7 } : { type: p.BackboneElement, value: r7 };
|
|
40714
40715
|
}
|
|
40715
40716
|
function N(r7) {
|
|
40716
40717
|
return r7.length === 0 ? false : !!r7[0].value;
|
|
40717
40718
|
}
|
|
40718
|
-
function
|
|
40719
|
+
function $(r7, e) {
|
|
40719
40720
|
if (r7.length !== 0) {
|
|
40720
40721
|
if (r7.length === 1 && (!e || r7[0].type === e)) return r7[0];
|
|
40721
40722
|
throw new Error(`Expected singleton of type ${e}, but found ${JSON.stringify(r7)}`);
|
|
@@ -40723,28 +40724,28 @@ function W(r7, e) {
|
|
|
40723
40724
|
}
|
|
40724
40725
|
function P(r7, e, t) {
|
|
40725
40726
|
if (!r7.value) return;
|
|
40726
|
-
let n =
|
|
40727
|
+
let n = at(r7.type, e, t?.profileUrl);
|
|
40727
40728
|
return n ? To(r7, e, n) : So(r7, e);
|
|
40728
40729
|
}
|
|
40729
40730
|
function To(r7, e, t) {
|
|
40730
40731
|
let n = r7.value, i = t.type;
|
|
40731
40732
|
if (!i || i.length === 0) return;
|
|
40732
40733
|
let o, s = "undefined", a2, c = t.path.lastIndexOf("."), u2 = t.path.substring(c + 1);
|
|
40733
|
-
for (let
|
|
40734
|
-
let m2 = u2.replace("[x]",
|
|
40734
|
+
for (let l2 of i) {
|
|
40735
|
+
let m2 = u2.replace("[x]", I(l2.code));
|
|
40735
40736
|
if (o = n[m2], a2 = n["_" + m2], o !== void 0 || a2 !== void 0) {
|
|
40736
|
-
s =
|
|
40737
|
+
s = l2.code;
|
|
40737
40738
|
break;
|
|
40738
40739
|
}
|
|
40739
40740
|
}
|
|
40740
40741
|
if (a2) if (Array.isArray(o)) {
|
|
40741
40742
|
o = o.slice();
|
|
40742
|
-
for (let
|
|
40743
|
-
} else o =
|
|
40744
|
-
if (!S(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((
|
|
40743
|
+
for (let l2 = 0; l2 < Math.max(o.length, a2.length); l2++) o[l2] = Vn(o[l2], a2[l2]);
|
|
40744
|
+
} else o = Vn(o, a2);
|
|
40745
|
+
if (!S(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((l2) => An(l2, s)) : An(o, s);
|
|
40745
40746
|
}
|
|
40746
|
-
function
|
|
40747
|
-
return e === "Resource" &&
|
|
40747
|
+
function An(r7, e) {
|
|
40748
|
+
return e === "Resource" && k(r7) && (e = r7.resourceType), { type: e, value: r7 };
|
|
40748
40749
|
}
|
|
40749
40750
|
function So(r7, e) {
|
|
40750
40751
|
let t = r7.value;
|
|
@@ -40755,8 +40756,8 @@ function So(r7, e) {
|
|
|
40755
40756
|
Array.isArray(i) ? n = i.map(g) : n = g(i);
|
|
40756
40757
|
} else {
|
|
40757
40758
|
let i = e.endsWith("[x]") ? e.substring(0, e.length - 3) : e;
|
|
40758
|
-
for (let o of Object.values(
|
|
40759
|
-
let s = i +
|
|
40759
|
+
for (let o of Object.values(p)) {
|
|
40760
|
+
let s = i + I(o);
|
|
40760
40761
|
if (s in t) {
|
|
40761
40762
|
let a2 = t[s];
|
|
40762
40763
|
Array.isArray(a2) ? n = a2.map((c) => ({ type: o, value: c })) : n = { type: o, value: a2 };
|
|
@@ -40769,7 +40770,7 @@ function So(r7, e) {
|
|
|
40769
40770
|
} else if (S(n)) return;
|
|
40770
40771
|
return n;
|
|
40771
40772
|
}
|
|
40772
|
-
function
|
|
40773
|
+
function ot(r7) {
|
|
40773
40774
|
let e = [];
|
|
40774
40775
|
for (let t of r7) {
|
|
40775
40776
|
let n = false;
|
|
@@ -40781,31 +40782,31 @@ function st(r7) {
|
|
|
40781
40782
|
}
|
|
40782
40783
|
return e;
|
|
40783
40784
|
}
|
|
40784
|
-
function
|
|
40785
|
+
function Dn(r7) {
|
|
40785
40786
|
return f(!N(r7));
|
|
40786
40787
|
}
|
|
40787
|
-
function
|
|
40788
|
+
function Mn(r7, e) {
|
|
40788
40789
|
return r7.length === 0 || e.length === 0 ? [] : r7.length !== e.length ? f(false) : f(r7.every((t, n) => N(gr(t, e[n]))));
|
|
40789
40790
|
}
|
|
40790
|
-
function
|
|
40791
|
+
function _n(r7, e) {
|
|
40791
40792
|
return r7.length === 0 || e.length === 0 ? [] : r7.length !== e.length ? f(true) : f(r7.some((t, n) => !N(gr(t, e[n]))));
|
|
40792
40793
|
}
|
|
40793
40794
|
function gr(r7, e) {
|
|
40794
40795
|
let t = r7.value?.valueOf(), n = e.value?.valueOf();
|
|
40795
|
-
return typeof t == "number" && typeof n == "number" ? f(Math.abs(t - n) < 1e-8) :
|
|
40796
|
+
return typeof t == "number" && typeof n == "number" ? f(Math.abs(t - n) < 1e-8) : V(t) && V(n) ? f(Fn(t, n)) : f(typeof t == "object" && typeof n == "object" ? vr(r7, e) : t === n);
|
|
40796
40797
|
}
|
|
40797
40798
|
function xr(r7, e) {
|
|
40798
|
-
return r7.length === 0 && e.length === 0 ? f(true) : r7.length !== e.length ? f(false) : (r7.sort(
|
|
40799
|
+
return r7.length === 0 && e.length === 0 ? f(true) : r7.length !== e.length ? f(false) : (r7.sort(On), e.sort(On), f(r7.every((t, n) => N(Eo(t, e[n])))));
|
|
40799
40800
|
}
|
|
40800
40801
|
function Eo(r7, e) {
|
|
40801
40802
|
let { type: t, value: n } = r7, { type: i, value: o } = e, s = n?.valueOf(), a2 = o?.valueOf();
|
|
40802
|
-
return typeof s == "number" && typeof a2 == "number" ? f(Math.abs(s - a2) < 0.01) :
|
|
40803
|
+
return typeof s == "number" && typeof a2 == "number" ? f(Math.abs(s - a2) < 0.01) : V(s) && V(a2) ? f(Fn(s, a2)) : f(t === "Coding" && i === "Coding" ? typeof s != "object" || typeof a2 != "object" ? false : s.code === a2.code && s.system === a2.system : typeof s == "object" && typeof a2 == "object" ? vr({ ...s, id: void 0 }, { ...a2, id: void 0 }) : typeof s == "string" && typeof a2 == "string" ? s.toLowerCase() === a2.toLowerCase() : s === a2);
|
|
40803
40804
|
}
|
|
40804
|
-
function
|
|
40805
|
+
function On(r7, e) {
|
|
40805
40806
|
let t = r7.value?.valueOf(), n = e.value?.valueOf();
|
|
40806
40807
|
return typeof t == "number" && typeof n == "number" ? t - n : typeof t == "string" && typeof n == "string" ? t.localeCompare(n) : 0;
|
|
40807
40808
|
}
|
|
40808
|
-
function
|
|
40809
|
+
function st(r7, e) {
|
|
40809
40810
|
let { value: t } = r7;
|
|
40810
40811
|
if (t == null) return false;
|
|
40811
40812
|
switch (e) {
|
|
@@ -40815,32 +40816,32 @@ function at(r7, e) {
|
|
|
40815
40816
|
case "Integer":
|
|
40816
40817
|
return typeof t == "number";
|
|
40817
40818
|
case "Date":
|
|
40818
|
-
return
|
|
40819
|
+
return Nn(t);
|
|
40819
40820
|
case "DateTime":
|
|
40820
|
-
return
|
|
40821
|
+
return Ae(t);
|
|
40821
40822
|
case "Time":
|
|
40822
40823
|
return typeof t == "string" && !!/^T\d/.exec(t);
|
|
40823
40824
|
case "Period":
|
|
40824
|
-
return
|
|
40825
|
+
return Ln(t);
|
|
40825
40826
|
case "Quantity":
|
|
40826
|
-
return
|
|
40827
|
+
return V(t);
|
|
40827
40828
|
default:
|
|
40828
|
-
return typeof t == "object" && t?.resourceType === e;
|
|
40829
|
+
return r7.type === e || typeof t == "object" && t?.resourceType === e;
|
|
40829
40830
|
}
|
|
40830
40831
|
}
|
|
40831
|
-
function
|
|
40832
|
-
return typeof r7 == "string" && !!
|
|
40832
|
+
function Nn(r7) {
|
|
40833
|
+
return typeof r7 == "string" && !!it.date.exec(r7);
|
|
40833
40834
|
}
|
|
40834
|
-
function
|
|
40835
|
-
return typeof r7 == "string" && !!
|
|
40835
|
+
function Ae(r7) {
|
|
40836
|
+
return typeof r7 == "string" && !!it.dateTime.exec(r7);
|
|
40836
40837
|
}
|
|
40837
|
-
function
|
|
40838
|
-
return !!(r7 && typeof r7 == "object" && ("start" in r7 &&
|
|
40838
|
+
function Ln(r7) {
|
|
40839
|
+
return !!(r7 && typeof r7 == "object" && ("start" in r7 && Ae(r7.start) || "end" in r7 && Ae(r7.end)));
|
|
40839
40840
|
}
|
|
40840
|
-
function
|
|
40841
|
+
function V(r7) {
|
|
40841
40842
|
return !!(r7 && typeof r7 == "object" && "value" in r7 && typeof r7.value == "number");
|
|
40842
40843
|
}
|
|
40843
|
-
function
|
|
40844
|
+
function Fn(r7, e) {
|
|
40844
40845
|
return Math.abs(r7.value - e.value) < 0.01 && (r7.unit === e.unit || r7.code === e.code || r7.unit === e.code || r7.code === e.unit);
|
|
40845
40846
|
}
|
|
40846
40847
|
function vr(r7, e) {
|
|
@@ -40848,16 +40849,16 @@ function vr(r7, e) {
|
|
|
40848
40849
|
if (t.length !== n.length) return false;
|
|
40849
40850
|
for (let i of t) {
|
|
40850
40851
|
let o = r7[i], s = e[i];
|
|
40851
|
-
if (
|
|
40852
|
+
if (kn(o) && kn(s)) {
|
|
40852
40853
|
if (!vr(o, s)) return false;
|
|
40853
40854
|
} else if (o !== s) return false;
|
|
40854
40855
|
}
|
|
40855
40856
|
return true;
|
|
40856
40857
|
}
|
|
40857
|
-
function
|
|
40858
|
+
function kn(r7) {
|
|
40858
40859
|
return r7 !== null && typeof r7 == "object";
|
|
40859
40860
|
}
|
|
40860
|
-
function
|
|
40861
|
+
function Vn(r7, e) {
|
|
40861
40862
|
if (e) {
|
|
40862
40863
|
if (typeof e != "object") throw new Error("Primitive extension must be an object");
|
|
40863
40864
|
return bo(r7 ?? {}, e);
|
|
@@ -40867,15 +40868,15 @@ function kn(r7, e) {
|
|
|
40867
40868
|
function bo(r7, e) {
|
|
40868
40869
|
return delete e.__proto__, delete e.constructor, Object.assign(r7, e);
|
|
40869
40870
|
}
|
|
40870
|
-
function
|
|
40871
|
-
let e =
|
|
40871
|
+
function re(r7) {
|
|
40872
|
+
let e = de(r7), t = Co(r7);
|
|
40872
40873
|
return t === e ? { reference: e } : { reference: e, display: t };
|
|
40873
40874
|
}
|
|
40874
|
-
function pe(r7) {
|
|
40875
|
-
return le(r7) ? r7.reference : `${r7.resourceType}/${r7.id}`;
|
|
40876
|
-
}
|
|
40877
40875
|
function de(r7) {
|
|
40878
|
-
|
|
40876
|
+
return pe(r7) ? r7.reference : `${r7.resourceType}/${r7.id}`;
|
|
40877
|
+
}
|
|
40878
|
+
function fe(r7) {
|
|
40879
|
+
if (r7) return pe(r7) ? r7.reference.split("/")[1] : r7.id;
|
|
40879
40880
|
}
|
|
40880
40881
|
function Ro(r7) {
|
|
40881
40882
|
return r7.resourceType === "Patient" || r7.resourceType === "Practitioner" || r7.resourceType === "RelatedPerson";
|
|
@@ -40898,7 +40899,7 @@ function Co(r7) {
|
|
|
40898
40899
|
if (Array.isArray(e) && (e = e[0]), Sr(e)) return Be(e);
|
|
40899
40900
|
if (No(e)) return e.text;
|
|
40900
40901
|
}
|
|
40901
|
-
return
|
|
40902
|
+
return de(r7);
|
|
40902
40903
|
}
|
|
40903
40904
|
function Po(r7) {
|
|
40904
40905
|
let e = r7.name;
|
|
@@ -40908,24 +40909,24 @@ function wo(r7) {
|
|
|
40908
40909
|
let e = r7.deviceName;
|
|
40909
40910
|
if (e && e.length > 0) return e[0].name;
|
|
40910
40911
|
}
|
|
40911
|
-
function
|
|
40912
|
+
function ct(r7, e) {
|
|
40912
40913
|
let t = new Date(r7);
|
|
40913
40914
|
t.setUTCHours(0, 0, 0, 0);
|
|
40914
40915
|
let n = e ? new Date(e) : /* @__PURE__ */ new Date();
|
|
40915
40916
|
n.setUTCHours(0, 0, 0, 0);
|
|
40916
|
-
let i = t.getUTCFullYear(), o = t.getUTCMonth(), s = t.getUTCDate(), a2 = n.getUTCFullYear(), c = n.getUTCMonth(), u2 = n.getUTCDate(),
|
|
40917
|
-
(c < o || c === o && u2 < s) &&
|
|
40917
|
+
let i = t.getUTCFullYear(), o = t.getUTCMonth(), s = t.getUTCDate(), a2 = n.getUTCFullYear(), c = n.getUTCMonth(), u2 = n.getUTCDate(), l2 = a2 - i;
|
|
40918
|
+
(c < o || c === o && u2 < s) && l2--;
|
|
40918
40919
|
let m2 = a2 * 12 + c - (i * 12 + o);
|
|
40919
40920
|
u2 < s && m2--;
|
|
40920
40921
|
let x2 = Math.floor((n.getTime() - t.getTime()) / (1e3 * 60 * 60 * 24));
|
|
40921
|
-
return { years:
|
|
40922
|
+
return { years: l2, months: m2, days: x2 };
|
|
40922
40923
|
}
|
|
40923
|
-
function
|
|
40924
|
+
function ee(r7, ...e) {
|
|
40924
40925
|
let t = r7;
|
|
40925
40926
|
for (let n = 0; n < e.length && t; n++) t = t?.extension?.find((i) => i.url === e[n]);
|
|
40926
40927
|
return t;
|
|
40927
40928
|
}
|
|
40928
|
-
function
|
|
40929
|
+
function ut(r7, e) {
|
|
40929
40930
|
return JSON.stringify(r7, Oo, e ? 2 : void 0) ?? "";
|
|
40930
40931
|
}
|
|
40931
40932
|
function Oo(r7, e) {
|
|
@@ -40937,19 +40938,19 @@ function Io(r7) {
|
|
|
40937
40938
|
function S(r7) {
|
|
40938
40939
|
if (r7 == null) return true;
|
|
40939
40940
|
let e = typeof r7;
|
|
40940
|
-
return e === "string" || e === "object" ? !
|
|
40941
|
+
return e === "string" || e === "object" ? !z(r7) : false;
|
|
40941
40942
|
}
|
|
40942
|
-
function
|
|
40943
|
+
function z(r7) {
|
|
40943
40944
|
if (r7 == null) return false;
|
|
40944
40945
|
let e = typeof r7;
|
|
40945
40946
|
return e === "string" && r7 !== "" || e === "object" && ("length" in r7 && r7.length > 0 || Object.keys(r7).length > 0);
|
|
40946
40947
|
}
|
|
40947
|
-
function
|
|
40948
|
+
function te(r7, e, t) {
|
|
40948
40949
|
return r7 === e || S(r7) && S(e) ? true : S(r7) || S(e) ? false : Array.isArray(r7) && Array.isArray(e) ? ko(r7, e) : Array.isArray(r7) || Array.isArray(e) ? false : R(r7) && R(e) ? Vo(r7, e, t) : (R(r7) || R(e), false);
|
|
40949
40950
|
}
|
|
40950
40951
|
function ko(r7, e) {
|
|
40951
40952
|
if (r7.length !== e.length) return false;
|
|
40952
|
-
for (let t = 0; t < r7.length; t++) if (!
|
|
40953
|
+
for (let t = 0; t < r7.length; t++) if (!te(r7[t], e[t])) return false;
|
|
40953
40954
|
return true;
|
|
40954
40955
|
}
|
|
40955
40956
|
function Vo(r7, e, t) {
|
|
@@ -40957,14 +40958,14 @@ function Vo(r7, e, t) {
|
|
|
40957
40958
|
Object.keys(r7).forEach((i) => n.add(i)), Object.keys(e).forEach((i) => n.add(i)), t === "meta" && (n.delete("versionId"), n.delete("lastUpdated"), n.delete("author"));
|
|
40958
40959
|
for (let i of n) {
|
|
40959
40960
|
let o = r7[i], s = e[i];
|
|
40960
|
-
if (!
|
|
40961
|
+
if (!te(o, s, i)) return false;
|
|
40961
40962
|
}
|
|
40962
40963
|
return true;
|
|
40963
40964
|
}
|
|
40964
40965
|
function R(r7) {
|
|
40965
40966
|
return r7 !== null && typeof r7 == "object";
|
|
40966
40967
|
}
|
|
40967
|
-
function
|
|
40968
|
+
function jn(r7) {
|
|
40968
40969
|
return r7.every(_o);
|
|
40969
40970
|
}
|
|
40970
40971
|
function _o(r7) {
|
|
@@ -40981,72 +40982,76 @@ function No(r7) {
|
|
|
40981
40982
|
}
|
|
40982
40983
|
var Wn = [];
|
|
40983
40984
|
for (let r7 = 0; r7 < 256; r7++) Wn.push(r7.toString(16).padStart(2, "0"));
|
|
40984
|
-
function
|
|
40985
|
-
let e =
|
|
40985
|
+
function $n(r7) {
|
|
40986
|
+
let e = Hn(r7), t = new Uint8Array(e), n = new Array(t.length);
|
|
40986
40987
|
for (let i = 0; i < t.length; i++) n[i] = Wn[t[i]];
|
|
40987
40988
|
return n.join("");
|
|
40988
40989
|
}
|
|
40989
|
-
function
|
|
40990
|
-
let e =
|
|
40990
|
+
function Gn(r7) {
|
|
40991
|
+
let e = Hn(r7), t = new Uint8Array(e), n = new Array(t.length);
|
|
40991
40992
|
for (let i = 0; i < t.length; i++) n[i] = String.fromCharCode(t[i]);
|
|
40992
40993
|
return window.btoa(n.join(""));
|
|
40993
40994
|
}
|
|
40994
|
-
function
|
|
40995
|
+
function Hn(r7) {
|
|
40995
40996
|
return ArrayBuffer.isView(r7) ? r7.buffer : r7;
|
|
40996
40997
|
}
|
|
40997
|
-
function
|
|
40998
|
+
function I(r7) {
|
|
40998
40999
|
return r7 ? r7.charAt(0).toUpperCase() + r7.substring(1) : "";
|
|
40999
41000
|
}
|
|
41000
41001
|
var Rr = (r7) => new Promise((e) => {
|
|
41001
41002
|
setTimeout(e, r7);
|
|
41002
41003
|
});
|
|
41003
|
-
function
|
|
41004
|
+
function lt(r7) {
|
|
41004
41005
|
return r7.sort((e, t) => e.localeCompare(t));
|
|
41005
41006
|
}
|
|
41006
41007
|
function Pr(r7) {
|
|
41007
41008
|
return r7.endsWith("/") ? r7 : r7 + "/";
|
|
41008
41009
|
}
|
|
41009
|
-
function
|
|
41010
|
+
function jo(r7) {
|
|
41010
41011
|
return r7.startsWith("/") ? r7.slice(1) : r7;
|
|
41011
41012
|
}
|
|
41012
|
-
function
|
|
41013
|
-
return new URL(
|
|
41013
|
+
function q(r7, e) {
|
|
41014
|
+
return new URL(jo(e), Pr(r7.toString())).toString();
|
|
41014
41015
|
}
|
|
41015
|
-
function
|
|
41016
|
-
return
|
|
41016
|
+
function Jn(r7, e) {
|
|
41017
|
+
return q(r7, e).toString().replace("http://", "ws://").replace("https://", "wss://");
|
|
41017
41018
|
}
|
|
41018
|
-
function
|
|
41019
|
+
function Yn(r7) {
|
|
41019
41020
|
return typeof r7 == "object" && !Array.isArray(r7) && !(r7 instanceof URLSearchParams) && (r7 = Object.fromEntries(Object.entries(r7).filter((e) => e[1] !== void 0))), new URLSearchParams(r7).toString();
|
|
41020
41021
|
}
|
|
41021
|
-
var
|
|
41022
|
-
function
|
|
41023
|
-
return
|
|
41022
|
+
var Wo = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-_]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-_]*[A-Za-z0-9])$/;
|
|
41023
|
+
function ll(r7) {
|
|
41024
|
+
return Wo.test(r7);
|
|
41024
41025
|
}
|
|
41025
41026
|
function qe(r7, e) {
|
|
41026
41027
|
let t = [];
|
|
41027
41028
|
if (r7.prefix && e?.prefix !== false && t.push(...r7.prefix), r7.given && t.push(...r7.given), r7.family && t.push(r7.family), r7.suffix && e?.suffix !== false && t.push(...r7.suffix), r7.use && (e?.all || e?.use) && t.push("[" + r7.use + "]"), t.length === 0) {
|
|
41028
|
-
let n =
|
|
41029
|
+
let n = he(r7.text);
|
|
41029
41030
|
if (n) return n;
|
|
41030
41031
|
}
|
|
41031
41032
|
return t.join(" ").trim();
|
|
41032
41033
|
}
|
|
41033
41034
|
function Be(r7) {
|
|
41034
41035
|
if (!r7) return "";
|
|
41035
|
-
let e =
|
|
41036
|
+
let e = he(r7.text);
|
|
41036
41037
|
return e || (r7.coding ? r7.coding.map((t) => Zn(t)).join(", ") : "");
|
|
41037
41038
|
}
|
|
41038
41039
|
function Zn(r7, e) {
|
|
41039
|
-
let t =
|
|
41040
|
+
let t = he(r7?.display);
|
|
41040
41041
|
if (t) {
|
|
41041
|
-
let n = e ?
|
|
41042
|
+
let n = e ? he(r7?.code) : void 0;
|
|
41042
41043
|
return `${t}${n ? " (" + n + ")" : ""}`;
|
|
41043
41044
|
}
|
|
41044
|
-
return
|
|
41045
|
+
return he(r7?.code) ?? "";
|
|
41045
41046
|
}
|
|
41046
|
-
function
|
|
41047
|
+
function he(r7) {
|
|
41047
41048
|
return typeof r7 == "string" ? r7 : void 0;
|
|
41048
41049
|
}
|
|
41049
|
-
var
|
|
41050
|
+
var p = { Address: "Address", Age: "Age", Annotation: "Annotation", Attachment: "Attachment", BackboneElement: "BackboneElement", CodeableConcept: "CodeableConcept", Coding: "Coding", ContactDetail: "ContactDetail", ContactPoint: "ContactPoint", Contributor: "Contributor", Count: "Count", DataRequirement: "DataRequirement", Distance: "Distance", Dosage: "Dosage", Duration: "Duration", Expression: "Expression", Extension: "Extension", HumanName: "HumanName", Identifier: "Identifier", MarketingStatus: "MarketingStatus", Meta: "Meta", Money: "Money", Narrative: "Narrative", ParameterDefinition: "ParameterDefinition", Period: "Period", Population: "Population", ProdCharacteristic: "ProdCharacteristic", ProductShelfLife: "ProductShelfLife", Quantity: "Quantity", Range: "Range", Ratio: "Ratio", Reference: "Reference", RelatedArtifact: "RelatedArtifact", SampledData: "SampledData", Signature: "Signature", SubstanceAmount: "SubstanceAmount", SystemString: "http://hl7.org/fhirpath/System.String", Timing: "Timing", TriggerDefinition: "TriggerDefinition", UsageContext: "UsageContext", base64Binary: "base64Binary", boolean: "boolean", canonical: "canonical", code: "code", date: "date", dateTime: "dateTime", decimal: "decimal", id: "id", instant: "instant", integer: "integer", markdown: "markdown", oid: "oid", positiveInt: "positiveInt", string: "string", time: "time", unsignedInt: "unsignedInt", uri: "uri", url: "url", uuid: "uuid" };
|
|
41051
|
+
function Pn(r7) {
|
|
41052
|
+
let e = Array.isArray(r7) ? r7 : r7.entry?.map((t) => t.resource) ?? [];
|
|
41053
|
+
for (let t of e) t?.resourceType === "StructureDefinition" && t.kind === "resource" && ti(t.type);
|
|
41054
|
+
}
|
|
41050
41055
|
function ti(r7) {
|
|
41051
41056
|
let e = L.types[r7];
|
|
41052
41057
|
return e || (e = { searchParamsDetails: {} }, L.types[r7] = e), e.searchParams || (e.searchParams = { _id: { base: [r7], code: "_id", type: "token", expression: r7 + ".id" }, _lastUpdated: { base: [r7], code: "_lastUpdated", type: "date", expression: r7 + ".meta.lastUpdated" }, _compartment: { base: [r7], code: "_compartment", type: "reference", expression: r7 + ".meta.compartment" }, _profile: { base: [r7], code: "_profile", type: "uri", expression: r7 + ".meta.profile" }, _security: { base: [r7], code: "_security", type: "token", expression: r7 + ".meta.security" }, _source: { base: [r7], code: "_source", type: "uri", expression: r7 + ".meta.source" }, _tag: { base: [r7], code: "_tag", type: "token", expression: r7 + ".meta.tag" } }), e;
|
|
@@ -41062,9 +41067,9 @@ function sr(r7) {
|
|
|
41062
41067
|
return e === "BackboneElement" || e === "Element" ? es((r7.base?.path ?? r7.path)?.split(".")) : e;
|
|
41063
41068
|
}
|
|
41064
41069
|
function es(r7) {
|
|
41065
|
-
return r7.length === 1 ? r7[0] : r7.map(
|
|
41070
|
+
return r7.length === 1 ? r7[0] : r7.map(I).join("");
|
|
41066
41071
|
}
|
|
41067
|
-
function
|
|
41072
|
+
function at(r7, e, t) {
|
|
41068
41073
|
let n = Le(r7, t);
|
|
41069
41074
|
if (n) return is(n.elements, e);
|
|
41070
41075
|
}
|
|
@@ -41079,14 +41084,14 @@ function is(r7, e) {
|
|
|
41079
41084
|
}
|
|
41080
41085
|
}
|
|
41081
41086
|
}
|
|
41082
|
-
function
|
|
41087
|
+
function k(r7) {
|
|
41083
41088
|
return !!(r7 && typeof r7 == "object" && "resourceType" in r7);
|
|
41084
41089
|
}
|
|
41085
|
-
function
|
|
41090
|
+
function pe(r7) {
|
|
41086
41091
|
return !!(r7 && typeof r7 == "object" && "reference" in r7 && typeof r7.reference == "string");
|
|
41087
41092
|
}
|
|
41088
41093
|
var L = { types: {} };
|
|
41089
|
-
function
|
|
41094
|
+
function ke(r7) {
|
|
41090
41095
|
if (r7.startsWith("T")) return r7 + "T00:00:00.000Z".substring(r7.length);
|
|
41091
41096
|
if (r7.length <= 10) return r7;
|
|
41092
41097
|
try {
|
|
@@ -41095,8 +41100,8 @@ function Ie(r7) {
|
|
|
41095
41100
|
return r7;
|
|
41096
41101
|
}
|
|
41097
41102
|
}
|
|
41098
|
-
var
|
|
41099
|
-
var
|
|
41103
|
+
var J = () => [];
|
|
41104
|
+
var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), hasValue: (r7, e) => f(e.length !== 0), exists: (r7, e, t) => t ? f(e.filter((n) => N(t.eval(r7, [n]))).length > 0) : f(e.length > 0 && e.every((n) => !S(n.value))), all: (r7, e, t) => f(e.every((n) => N(t.eval(r7, [n])))), allTrue: (r7, e) => {
|
|
41100
41105
|
for (let t of e) if (!t.value) return f(false);
|
|
41101
41106
|
return f(true);
|
|
41102
41107
|
}, anyTrue: (r7, e) => {
|
|
@@ -41110,16 +41115,16 @@ var A = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
|
|
|
41110
41115
|
return f(false);
|
|
41111
41116
|
}, subsetOf: (r7, e, t) => {
|
|
41112
41117
|
if (e.length === 0) return f(true);
|
|
41113
|
-
let n = t.eval(r7,
|
|
41118
|
+
let n = t.eval(r7, ye(r7));
|
|
41114
41119
|
return n.length === 0 ? f(false) : f(e.every((i) => n.some((o) => o.value === i.value)));
|
|
41115
41120
|
}, supersetOf: (r7, e, t) => {
|
|
41116
|
-
let n = t.eval(r7,
|
|
41121
|
+
let n = t.eval(r7, ye(r7));
|
|
41117
41122
|
return n.length === 0 ? f(true) : e.length === 0 ? f(false) : f(n.every((i) => e.some((o) => o.value === i.value)));
|
|
41118
|
-
}, count: (r7, e) => [{ type:
|
|
41123
|
+
}, count: (r7, e) => [{ type: p.integer, value: e.length }], distinct: (r7, e) => {
|
|
41119
41124
|
let t = [];
|
|
41120
41125
|
for (let n of e) t.some((i) => i.value === n.value) || t.push(n);
|
|
41121
41126
|
return t;
|
|
41122
|
-
}, isDistinct: (r7, e) => f(e.length ===
|
|
41127
|
+
}, isDistinct: (r7, e) => f(e.length === O.distinct(r7, e).length), where: (r7, e, t) => e.filter((n) => N(t.eval(r7, [n]))), select: (r7, e, t) => e.map((n) => t.eval({ parent: r7, variables: { $this: n } }, [n])).flat(), repeat: J, ofType: (r7, e, t) => e.filter((n) => n.type === t.name), single: (r7, e) => {
|
|
41123
41128
|
if (e.length > 1) throw new Error("Expected input length one for single()");
|
|
41124
41129
|
return e.length === 0 ? [] : e.slice(0, 1);
|
|
41125
41130
|
}, first: (r7, e) => e.length === 0 ? [] : e.slice(0, 1), last: (r7, e) => e.length === 0 ? [] : e.slice(e.length - 1, e.length), tail: (r7, e) => e.length === 0 ? [] : e.slice(1, e.length), skip: (r7, e, t) => {
|
|
@@ -41132,21 +41137,21 @@ var A = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
|
|
|
41132
41137
|
return n >= e.length ? e : n <= 0 ? [] : e.slice(0, n);
|
|
41133
41138
|
}, intersect: (r7, e, t) => {
|
|
41134
41139
|
if (!t) return e;
|
|
41135
|
-
let n = t.eval(r7,
|
|
41140
|
+
let n = t.eval(r7, ye(r7)), i = [];
|
|
41136
41141
|
for (let o of e) !i.some((s) => s.value === o.value) && n.some((s) => s.value === o.value) && i.push(o);
|
|
41137
41142
|
return i;
|
|
41138
41143
|
}, exclude: (r7, e, t) => {
|
|
41139
41144
|
if (!t) return e;
|
|
41140
|
-
let n = t.eval(r7,
|
|
41145
|
+
let n = t.eval(r7, ye(r7)), i = [];
|
|
41141
41146
|
for (let o of e) n.some((s) => s.value === o.value) || i.push(o);
|
|
41142
41147
|
return i;
|
|
41143
41148
|
}, union: (r7, e, t) => {
|
|
41144
41149
|
if (!t) return e;
|
|
41145
|
-
let n = t.eval(r7,
|
|
41146
|
-
return
|
|
41150
|
+
let n = t.eval(r7, ye(r7));
|
|
41151
|
+
return ot([...e, ...n]);
|
|
41147
41152
|
}, combine: (r7, e, t) => {
|
|
41148
41153
|
if (!t) return e;
|
|
41149
|
-
let n = t.eval(r7,
|
|
41154
|
+
let n = t.eval(r7, ye(r7));
|
|
41150
41155
|
return [...e, ...n];
|
|
41151
41156
|
}, htmlChecks: (r7, e, t) => [g(true)], iif: (r7, e, t, n, i) => {
|
|
41152
41157
|
let o = t.eval(r7, e);
|
|
@@ -41154,8 +41159,8 @@ var A = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
|
|
|
41154
41159
|
return N(o) ? n.eval(r7, e) : i ? i.eval(r7, e) : [];
|
|
41155
41160
|
}, toBoolean: (r7, e) => {
|
|
41156
41161
|
if (e.length === 0) return [];
|
|
41157
|
-
let [{ value: t }] =
|
|
41158
|
-
if (typeof t == "boolean") return [{ type:
|
|
41162
|
+
let [{ value: t }] = Q(e, 1);
|
|
41163
|
+
if (typeof t == "boolean") return [{ type: p.boolean, value: t }];
|
|
41159
41164
|
if (typeof t == "number" && (t === 0 || t === 1)) return f(!!t);
|
|
41160
41165
|
if (typeof t == "string") {
|
|
41161
41166
|
let n = t.toLowerCase();
|
|
@@ -41163,58 +41168,58 @@ var A = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
|
|
|
41163
41168
|
if (["false", "f", "no", "n", "0", "0.0"].includes(n)) return f(false);
|
|
41164
41169
|
}
|
|
41165
41170
|
return [];
|
|
41166
|
-
}, convertsToBoolean: (r7, e) => e.length === 0 ? [] : f(
|
|
41171
|
+
}, convertsToBoolean: (r7, e) => e.length === 0 ? [] : f(O.toBoolean(r7, e).length === 1), toInteger: (r7, e) => {
|
|
41167
41172
|
if (e.length === 0) return [];
|
|
41168
|
-
let [{ value: t }] =
|
|
41169
|
-
return typeof t == "number" ? [{ type:
|
|
41170
|
-
}, convertsToInteger: (r7, e) => e.length === 0 ? [] : f(
|
|
41173
|
+
let [{ value: t }] = Q(e, 1);
|
|
41174
|
+
return typeof t == "number" ? [{ type: p.integer, value: t }] : typeof t == "string" && /^[+-]?\d+$/.exec(t) ? [{ type: p.integer, value: parseInt(t, 10) }] : typeof t == "boolean" ? [{ type: p.integer, value: t ? 1 : 0 }] : [];
|
|
41175
|
+
}, convertsToInteger: (r7, e) => e.length === 0 ? [] : f(O.toInteger(r7, e).length === 1), toDate: (r7, e) => {
|
|
41171
41176
|
if (e.length === 0) return [];
|
|
41172
|
-
let [{ value: t }] =
|
|
41173
|
-
return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type:
|
|
41174
|
-
}, convertsToDate: (r7, e) => e.length === 0 ? [] : f(
|
|
41177
|
+
let [{ value: t }] = Q(e, 1);
|
|
41178
|
+
return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: p.date, value: ke(t) }] : [];
|
|
41179
|
+
}, convertsToDate: (r7, e) => e.length === 0 ? [] : f(O.toDate(r7, e).length === 1), toDateTime: (r7, e) => {
|
|
41175
41180
|
if (e.length === 0) return [];
|
|
41176
|
-
let [{ value: t }] =
|
|
41177
|
-
return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type:
|
|
41178
|
-
}, convertsToDateTime: (r7, e) => e.length === 0 ? [] : f(
|
|
41181
|
+
let [{ value: t }] = Q(e, 1);
|
|
41182
|
+
return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: p.dateTime, value: ke(t) }] : [];
|
|
41183
|
+
}, convertsToDateTime: (r7, e) => e.length === 0 ? [] : f(O.toDateTime(r7, e).length === 1), toDecimal: (r7, e) => {
|
|
41179
41184
|
if (e.length === 0) return [];
|
|
41180
|
-
let [{ value: t }] =
|
|
41181
|
-
return typeof t == "number" ? [{ type:
|
|
41182
|
-
}, convertsToDecimal: (r7, e) => e.length === 0 ? [] : f(
|
|
41185
|
+
let [{ value: t }] = Q(e, 1);
|
|
41186
|
+
return typeof t == "number" ? [{ type: p.decimal, value: t }] : typeof t == "string" && /^-?\d{1,9}(\.\d{1,9})?$/.exec(t) ? [{ type: p.decimal, value: parseFloat(t) }] : typeof t == "boolean" ? [{ type: p.decimal, value: t ? 1 : 0 }] : [];
|
|
41187
|
+
}, convertsToDecimal: (r7, e) => e.length === 0 ? [] : f(O.toDecimal(r7, e).length === 1), toQuantity: (r7, e) => {
|
|
41183
41188
|
if (e.length === 0) return [];
|
|
41184
|
-
let [{ value: t }] =
|
|
41185
|
-
return
|
|
41186
|
-
}, convertsToQuantity: (r7, e) => e.length === 0 ? [] : f(
|
|
41189
|
+
let [{ value: t }] = Q(e, 1);
|
|
41190
|
+
return V(t) ? [{ type: p.Quantity, value: t }] : typeof t == "number" ? [{ type: p.Quantity, value: { value: t, unit: "1" } }] : typeof t == "string" && /^-?\d{1,9}(\.\d{1,9})?/.exec(t) ? [{ type: p.Quantity, value: { value: parseFloat(t), unit: "1" } }] : typeof t == "boolean" ? [{ type: p.Quantity, value: { value: t ? 1 : 0, unit: "1" } }] : [];
|
|
41191
|
+
}, convertsToQuantity: (r7, e) => e.length === 0 ? [] : f(O.toQuantity(r7, e).length === 1), toString: (r7, e) => {
|
|
41187
41192
|
if (e.length === 0) return [];
|
|
41188
|
-
let [{ value: t }] =
|
|
41189
|
-
return t == null ? [] :
|
|
41190
|
-
}, convertsToString: (r7, e) => e.length === 0 ? [] : f(
|
|
41193
|
+
let [{ value: t }] = Q(e, 1);
|
|
41194
|
+
return t == null ? [] : V(t) ? [{ type: p.string, value: `${t.value} '${t.unit}'` }] : [{ type: p.string, value: t.toString() }];
|
|
41195
|
+
}, convertsToString: (r7, e) => e.length === 0 ? [] : f(O.toString(r7, e).length === 1), toTime: (r7, e) => {
|
|
41191
41196
|
if (e.length === 0) return [];
|
|
41192
|
-
let [{ value: t }] =
|
|
41197
|
+
let [{ value: t }] = Q(e, 1);
|
|
41193
41198
|
if (typeof t == "string") {
|
|
41194
41199
|
let n = /^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(t);
|
|
41195
|
-
if (n) return [{ type:
|
|
41200
|
+
if (n) return [{ type: p.time, value: ke("T" + n[1]) }];
|
|
41196
41201
|
}
|
|
41197
41202
|
return [];
|
|
41198
|
-
}, convertsToTime: (r7, e) => e.length === 0 ? [] : f(
|
|
41203
|
+
}, convertsToTime: (r7, e) => e.length === 0 ? [] : f(O.toTime(r7, e).length === 1), indexOf: (r7, e, t) => F((n, i) => n.indexOf(i), r7, e, t), substring: (r7, e, t, n) => F((i, o, s) => {
|
|
41199
41204
|
let a2 = o, c = s ? a2 + s : i.length;
|
|
41200
41205
|
return a2 < 0 || a2 >= i.length ? void 0 : i.substring(a2, c);
|
|
41201
|
-
}, r7, e, t, n), startsWith: (r7, e, t) => F((n, i) => n.startsWith(i), r7, e, t), endsWith: (r7, e, t) => F((n, i) => n.endsWith(i), r7, e, t), contains: (r7, e, t) => F((n, i) => n.includes(i), r7, e, t), upper: (r7, e) => F((t) => t.toUpperCase(), r7, e), lower: (r7, e) => F((t) => t.toLowerCase(), r7, e), replace: (r7, e, t, n) => F((i, o, s) => i.replaceAll(o, s), r7, e, t, n), matches: (r7, e, t) => F((n, i) => !!new RegExp(i).exec(n), r7, e, t), replaceMatches: (r7, e, t, n) => F((i, o, s) => i.replaceAll(o, s), r7, e, t, n), length: (r7, e) => F((t) => t.length, r7, e), toChars: (r7, e) => F((t) => t ? t.split("") : void 0, r7, e), encode:
|
|
41202
|
-
let n = t?.eval(r7,
|
|
41206
|
+
}, r7, e, t, n), startsWith: (r7, e, t) => F((n, i) => n.startsWith(i), r7, e, t), endsWith: (r7, e, t) => F((n, i) => n.endsWith(i), r7, e, t), contains: (r7, e, t) => F((n, i) => n.includes(i), r7, e, t), upper: (r7, e) => F((t) => t.toUpperCase(), r7, e), lower: (r7, e) => F((t) => t.toLowerCase(), r7, e), replace: (r7, e, t, n) => F((i, o, s) => i.replaceAll(o, s), r7, e, t, n), matches: (r7, e, t) => F((n, i) => !!new RegExp(i).exec(n), r7, e, t), replaceMatches: (r7, e, t, n) => F((i, o, s) => i.replaceAll(o, s), r7, e, t, n), length: (r7, e) => F((t) => t.length, r7, e), toChars: (r7, e) => F((t) => t ? t.split("") : void 0, r7, e), encode: J, decode: J, escape: J, unescape: J, trim: J, split: J, join: (r7, e, t) => {
|
|
41207
|
+
let n = t?.eval(r7, ye(r7))[0]?.value ?? "";
|
|
41203
41208
|
if (typeof n != "string") throw new Error("Separator must be a string.");
|
|
41204
|
-
return [{ type:
|
|
41205
|
-
}, abs: (r7, e) =>
|
|
41206
|
-
let o =
|
|
41209
|
+
return [{ type: p.string, value: e.map((i) => i.value?.toString() ?? "").join(n) }];
|
|
41210
|
+
}, abs: (r7, e) => H(Math.abs, r7, e), ceiling: (r7, e) => H(Math.ceil, r7, e), exp: (r7, e) => H(Math.exp, r7, e), floor: (r7, e) => H(Math.floor, r7, e), ln: (r7, e) => H(Math.log, r7, e), log: (r7, e, t) => H((n, i) => Math.log(n) / Math.log(i), r7, e, t), power: (r7, e, t) => H(Math.pow, r7, e, t), round: (r7, e) => H(Math.round, r7, e), sqrt: (r7, e) => H(Math.sqrt, r7, e), truncate: (r7, e) => H((t) => t | 0, r7, e), children: J, descendants: J, trace: (r7, e, t) => e, now: () => [{ type: p.dateTime, value: (/* @__PURE__ */ new Date()).toISOString() }], timeOfDay: () => [{ type: p.time, value: (/* @__PURE__ */ new Date()).toISOString().substring(11) }], today: () => [{ type: p.date, value: (/* @__PURE__ */ new Date()).toISOString().substring(0, 10) }], between: (r7, e, t, n, i) => {
|
|
41211
|
+
let o = O.toDateTime(r7, t.eval(r7, e));
|
|
41207
41212
|
if (o.length === 0) throw new Error("Invalid start date");
|
|
41208
|
-
let s =
|
|
41213
|
+
let s = O.toDateTime(r7, n.eval(r7, e));
|
|
41209
41214
|
if (s.length === 0) throw new Error("Invalid end date");
|
|
41210
41215
|
let a2 = i.eval(r7, e)[0]?.value;
|
|
41211
41216
|
if (a2 !== "years" && a2 !== "months" && a2 !== "days") throw new Error("Invalid units");
|
|
41212
|
-
let c =
|
|
41213
|
-
return [{ type:
|
|
41217
|
+
let c = ct(o[0].value, s[0].value);
|
|
41218
|
+
return [{ type: p.Quantity, value: { value: c[a2], unit: a2 } }];
|
|
41214
41219
|
}, is: (r7, e, t) => {
|
|
41215
41220
|
let n = "";
|
|
41216
|
-
return t instanceof
|
|
41217
|
-
}, not: (r7, e) =>
|
|
41221
|
+
return t instanceof j ? n = t.name : t instanceof ie && (n = t.left.name + "." + t.right.name), n ? e.map((i) => ({ type: p.boolean, value: st(i, n) })) : [];
|
|
41222
|
+
}, not: (r7, e) => O.toBoolean(r7, e).map((t) => ({ type: p.boolean, value: !t.value })), resolve: (r7, e) => e.map((t) => {
|
|
41218
41223
|
let n = t.value, i;
|
|
41219
41224
|
if (typeof n == "string") i = n;
|
|
41220
41225
|
else if (typeof n == "object") {
|
|
@@ -41230,48 +41235,48 @@ var A = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
|
|
|
41230
41235
|
let [o, s] = i.split("/");
|
|
41231
41236
|
return { type: o, value: { resourceType: o, id: s } };
|
|
41232
41237
|
}
|
|
41233
|
-
return { type:
|
|
41234
|
-
}).filter((t) => !!t.value), as: (r7, e) => e, type: (r7, e) => e.map(({ value: t }) => typeof t == "boolean" ? { type:
|
|
41238
|
+
return { type: p.BackboneElement, value: void 0 };
|
|
41239
|
+
}).filter((t) => !!t.value), as: (r7, e) => e, type: (r7, e) => e.map(({ value: t }) => typeof t == "boolean" ? { type: p.BackboneElement, value: { namespace: "System", name: "Boolean" } } : typeof t == "number" ? { type: p.BackboneElement, value: { namespace: "System", name: "Integer" } } : k(t) ? { type: p.BackboneElement, value: { namespace: "FHIR", name: t.resourceType } } : { type: p.BackboneElement, value: null }), conformsTo: (r7, e, t) => {
|
|
41235
41240
|
let n = t.eval(r7, e)[0].value;
|
|
41236
41241
|
if (!n.startsWith("http://hl7.org/fhir/StructureDefinition/")) throw new Error("Expected a StructureDefinition URL");
|
|
41237
41242
|
let i = n.replace("http://hl7.org/fhir/StructureDefinition/", "");
|
|
41238
|
-
return e.map((o) => ({ type:
|
|
41243
|
+
return e.map((o) => ({ type: p.boolean, value: o.value?.resourceType === i }));
|
|
41239
41244
|
}, getResourceKey: (r7, e) => {
|
|
41240
41245
|
let t = e[0].value;
|
|
41241
|
-
return t?.id ? [{ type:
|
|
41246
|
+
return t?.id ? [{ type: p.id, value: t.id }] : [];
|
|
41242
41247
|
}, getReferenceKey: (r7, e, t) => {
|
|
41243
41248
|
let n = e[0].value;
|
|
41244
41249
|
if (!n?.reference) return [];
|
|
41245
41250
|
let i = "";
|
|
41246
|
-
return t instanceof
|
|
41251
|
+
return t instanceof j && (i = t.name), i && !n.reference.startsWith(i + "/") ? [] : [{ type: p.id, value: fe(n) }];
|
|
41247
41252
|
}, extension: (r7, e, t) => {
|
|
41248
41253
|
let n = t.eval(r7, e)[0].value, i = e?.[0]?.value;
|
|
41249
41254
|
if (i) {
|
|
41250
|
-
let o =
|
|
41251
|
-
if (o) return [{ type:
|
|
41255
|
+
let o = ee(i, n);
|
|
41256
|
+
if (o) return [{ type: p.Extension, value: o }];
|
|
41252
41257
|
}
|
|
41253
41258
|
return [];
|
|
41254
41259
|
} };
|
|
41255
41260
|
function F(r7, e, t, ...n) {
|
|
41256
41261
|
if (t.length === 0) return [];
|
|
41257
|
-
let [{ value: i }] =
|
|
41262
|
+
let [{ value: i }] = Q(t, 1);
|
|
41258
41263
|
if (typeof i != "string") throw new Error("String function cannot be called with non-string");
|
|
41259
41264
|
let o = r7(i, ...n.map((s) => s?.eval(e, t)[0]?.value));
|
|
41260
41265
|
return o === void 0 ? [] : Array.isArray(o) ? o.map(g) : [g(o)];
|
|
41261
41266
|
}
|
|
41262
|
-
function
|
|
41267
|
+
function H(r7, e, t, ...n) {
|
|
41263
41268
|
if (t.length === 0) return [];
|
|
41264
|
-
let [{ value: i }] =
|
|
41269
|
+
let [{ value: i }] = Q(t, 1), o = V(i), s = o ? i.value : i;
|
|
41265
41270
|
if (typeof s != "number") throw new Error("Math function cannot be called with non-number");
|
|
41266
|
-
let a2 = r7(s, ...n.map((
|
|
41271
|
+
let a2 = r7(s, ...n.map((l2) => l2.eval(e, t)[0]?.value)), c = o ? p.Quantity : t[0].type, u2 = o ? { ...i, value: a2 } : a2;
|
|
41267
41272
|
return [{ type: c, value: u2 }];
|
|
41268
41273
|
}
|
|
41269
|
-
function
|
|
41274
|
+
function Q(r7, e) {
|
|
41270
41275
|
if (r7.length !== e) throw new Error(`Expected ${e} arguments`);
|
|
41271
41276
|
for (let t of r7) if (t == null) throw new Error("Expected non-null argument");
|
|
41272
41277
|
return r7;
|
|
41273
41278
|
}
|
|
41274
|
-
function
|
|
41279
|
+
function ye(r7) {
|
|
41275
41280
|
let e = r7;
|
|
41276
41281
|
for (; e.parent?.variables.$this; ) e = e.parent;
|
|
41277
41282
|
return [e.variables.$this];
|
|
@@ -41288,7 +41293,7 @@ var U = class {
|
|
|
41288
41293
|
return typeof e == "string" ? `'${e}'` : e.toString();
|
|
41289
41294
|
}
|
|
41290
41295
|
};
|
|
41291
|
-
var
|
|
41296
|
+
var j = class {
|
|
41292
41297
|
constructor(e) {
|
|
41293
41298
|
this.name = e;
|
|
41294
41299
|
}
|
|
@@ -41306,13 +41311,13 @@ var q = class {
|
|
|
41306
41311
|
}
|
|
41307
41312
|
evalValue(e) {
|
|
41308
41313
|
let t = e.value;
|
|
41309
|
-
if (!(!t || typeof t != "object")) return
|
|
41314
|
+
if (!(!t || typeof t != "object")) return k(t) && t.resourceType === this.name ? e : P(e, this.name);
|
|
41310
41315
|
}
|
|
41311
41316
|
toString() {
|
|
41312
41317
|
return this.name;
|
|
41313
41318
|
}
|
|
41314
41319
|
};
|
|
41315
|
-
var
|
|
41320
|
+
var dt = class {
|
|
41316
41321
|
eval() {
|
|
41317
41322
|
return [];
|
|
41318
41323
|
}
|
|
@@ -41320,7 +41325,7 @@ var ft = class {
|
|
|
41320
41325
|
return "{}";
|
|
41321
41326
|
}
|
|
41322
41327
|
};
|
|
41323
|
-
var
|
|
41328
|
+
var ft = class extends Je {
|
|
41324
41329
|
constructor(t, n, i) {
|
|
41325
41330
|
super(t, n);
|
|
41326
41331
|
this.impl = i;
|
|
@@ -41332,17 +41337,17 @@ var mt = class extends Ye {
|
|
|
41332
41337
|
return this.operator + this.child.toString();
|
|
41333
41338
|
}
|
|
41334
41339
|
};
|
|
41335
|
-
var
|
|
41340
|
+
var ge = class extends Z {
|
|
41336
41341
|
constructor(e, t) {
|
|
41337
41342
|
super("as", e, t);
|
|
41338
41343
|
}
|
|
41339
41344
|
eval(e, t) {
|
|
41340
|
-
return
|
|
41345
|
+
return O.ofType(e, this.left.eval(e, t), this.right);
|
|
41341
41346
|
}
|
|
41342
41347
|
};
|
|
41343
|
-
var C = class extends
|
|
41348
|
+
var C = class extends Z {
|
|
41344
41349
|
};
|
|
41345
|
-
var
|
|
41350
|
+
var D = class extends C {
|
|
41346
41351
|
constructor(t, n, i, o) {
|
|
41347
41352
|
super(t, n, i);
|
|
41348
41353
|
this.impl = o;
|
|
@@ -41352,20 +41357,20 @@ var V = class extends C {
|
|
|
41352
41357
|
if (i.length !== 1) return [];
|
|
41353
41358
|
let o = this.right.eval(t, n);
|
|
41354
41359
|
if (o.length !== 1) return [];
|
|
41355
|
-
let s = i[0].value, a2 = o[0].value, c =
|
|
41356
|
-
return typeof
|
|
41360
|
+
let s = i[0].value, a2 = o[0].value, c = V(s) ? s.value : s, u2 = V(a2) ? a2.value : a2, l2 = this.impl(c, u2);
|
|
41361
|
+
return typeof l2 == "boolean" ? f(l2) : V(s) ? [{ type: p.Quantity, value: { ...s, value: l2 } }] : [g(l2)];
|
|
41357
41362
|
}
|
|
41358
41363
|
};
|
|
41359
|
-
var
|
|
41364
|
+
var mt = class extends Z {
|
|
41360
41365
|
constructor(e, t) {
|
|
41361
41366
|
super("&", e, t);
|
|
41362
41367
|
}
|
|
41363
41368
|
eval(e, t) {
|
|
41364
41369
|
let n = this.left.eval(e, t), i = this.right.eval(e, t), o = [...n, ...i];
|
|
41365
|
-
return o.length > 0 && o.every((s) => typeof s.value == "string") ? [{ type:
|
|
41370
|
+
return o.length > 0 && o.every((s) => typeof s.value == "string") ? [{ type: p.string, value: o.map((s) => s.value).join("") }] : o;
|
|
41366
41371
|
}
|
|
41367
41372
|
};
|
|
41368
|
-
var
|
|
41373
|
+
var ht = class extends C {
|
|
41369
41374
|
constructor(e, t) {
|
|
41370
41375
|
super("contains", e, t);
|
|
41371
41376
|
}
|
|
@@ -41374,16 +41379,16 @@ var yt = class extends C {
|
|
|
41374
41379
|
return f(n.some((o) => o.value === i[0].value));
|
|
41375
41380
|
}
|
|
41376
41381
|
};
|
|
41377
|
-
var
|
|
41382
|
+
var yt = class extends C {
|
|
41378
41383
|
constructor(e, t) {
|
|
41379
41384
|
super("in", e, t);
|
|
41380
41385
|
}
|
|
41381
41386
|
eval(e, t) {
|
|
41382
|
-
let n =
|
|
41387
|
+
let n = $(this.left.eval(e, t)), i = this.right.eval(e, t);
|
|
41383
41388
|
return n ? f(i.some((o) => o.value === n.value)) : [];
|
|
41384
41389
|
}
|
|
41385
41390
|
};
|
|
41386
|
-
var
|
|
41391
|
+
var ie = class extends Z {
|
|
41387
41392
|
constructor(e, t) {
|
|
41388
41393
|
super(".", e, t);
|
|
41389
41394
|
}
|
|
@@ -41394,34 +41399,34 @@ var ne = class extends Y {
|
|
|
41394
41399
|
return `${this.left.toString()}.${this.right.toString()}`;
|
|
41395
41400
|
}
|
|
41396
41401
|
};
|
|
41397
|
-
var
|
|
41402
|
+
var Ve = class extends Z {
|
|
41398
41403
|
constructor(e, t) {
|
|
41399
41404
|
super("|", e, t);
|
|
41400
41405
|
}
|
|
41401
41406
|
eval(e, t) {
|
|
41402
41407
|
let n = this.left.eval(e, t), i = this.right.eval(e, t);
|
|
41403
|
-
return
|
|
41408
|
+
return ot([...n, ...i]);
|
|
41404
41409
|
}
|
|
41405
41410
|
};
|
|
41406
|
-
var
|
|
41411
|
+
var gt = class extends C {
|
|
41407
41412
|
constructor(e, t) {
|
|
41408
41413
|
super("=", e, t);
|
|
41409
41414
|
}
|
|
41410
41415
|
eval(e, t) {
|
|
41411
41416
|
let n = this.left.eval(e, t), i = this.right.eval(e, t);
|
|
41412
|
-
return
|
|
41417
|
+
return Mn(n, i);
|
|
41413
41418
|
}
|
|
41414
41419
|
};
|
|
41415
|
-
var
|
|
41420
|
+
var xt = class extends C {
|
|
41416
41421
|
constructor(e, t) {
|
|
41417
41422
|
super("!=", e, t);
|
|
41418
41423
|
}
|
|
41419
41424
|
eval(e, t) {
|
|
41420
41425
|
let n = this.left.eval(e, t), i = this.right.eval(e, t);
|
|
41421
|
-
return
|
|
41426
|
+
return _n(n, i);
|
|
41422
41427
|
}
|
|
41423
41428
|
};
|
|
41424
|
-
var
|
|
41429
|
+
var vt = class extends C {
|
|
41425
41430
|
constructor(e, t) {
|
|
41426
41431
|
super("~", e, t);
|
|
41427
41432
|
}
|
|
@@ -41430,16 +41435,16 @@ var Tt = class extends C {
|
|
|
41430
41435
|
return xr(n, i);
|
|
41431
41436
|
}
|
|
41432
41437
|
};
|
|
41433
|
-
var
|
|
41438
|
+
var Tt = class extends C {
|
|
41434
41439
|
constructor(e, t) {
|
|
41435
41440
|
super("!~", e, t);
|
|
41436
41441
|
}
|
|
41437
41442
|
eval(e, t) {
|
|
41438
41443
|
let n = this.left.eval(e, t), i = this.right.eval(e, t);
|
|
41439
|
-
return
|
|
41444
|
+
return Dn(xr(n, i));
|
|
41440
41445
|
}
|
|
41441
41446
|
};
|
|
41442
|
-
var
|
|
41447
|
+
var xe = class extends C {
|
|
41443
41448
|
constructor(e, t) {
|
|
41444
41449
|
super("is", e, t);
|
|
41445
41450
|
}
|
|
@@ -41447,52 +41452,52 @@ var ge = class extends C {
|
|
|
41447
41452
|
let n = this.left.eval(e, t);
|
|
41448
41453
|
if (n.length !== 1) return [];
|
|
41449
41454
|
let i = this.right.name;
|
|
41450
|
-
return f(
|
|
41455
|
+
return f(st(n[0], i));
|
|
41451
41456
|
}
|
|
41452
41457
|
};
|
|
41453
|
-
var
|
|
41458
|
+
var St = class extends C {
|
|
41454
41459
|
constructor(e, t) {
|
|
41455
41460
|
super("and", e, t);
|
|
41456
41461
|
}
|
|
41457
41462
|
eval(e, t) {
|
|
41458
|
-
let n =
|
|
41463
|
+
let n = $(this.left.eval(e, t), "boolean"), i = $(this.right.eval(e, t), "boolean");
|
|
41459
41464
|
return n?.value === true && i?.value === true ? f(true) : n?.value === false || i?.value === false ? f(false) : [];
|
|
41460
41465
|
}
|
|
41461
41466
|
};
|
|
41462
|
-
var
|
|
41467
|
+
var Et = class extends C {
|
|
41463
41468
|
constructor(e, t) {
|
|
41464
41469
|
super("or", e, t);
|
|
41465
41470
|
}
|
|
41466
41471
|
eval(e, t) {
|
|
41467
|
-
let n =
|
|
41472
|
+
let n = $(this.left.eval(e, t), "boolean"), i = $(this.right.eval(e, t), "boolean");
|
|
41468
41473
|
return n?.value === false && i?.value === false ? f(false) : n?.value || i?.value ? f(true) : [];
|
|
41469
41474
|
}
|
|
41470
41475
|
};
|
|
41471
|
-
var
|
|
41476
|
+
var bt = class extends C {
|
|
41472
41477
|
constructor(e, t) {
|
|
41473
41478
|
super("xor", e, t);
|
|
41474
41479
|
}
|
|
41475
41480
|
eval(e, t) {
|
|
41476
|
-
let n =
|
|
41481
|
+
let n = $(this.left.eval(e, t), "boolean"), i = $(this.right.eval(e, t), "boolean");
|
|
41477
41482
|
return !n || !i ? [] : f(n.value !== i.value);
|
|
41478
41483
|
}
|
|
41479
41484
|
};
|
|
41480
|
-
var
|
|
41485
|
+
var Rt = class extends C {
|
|
41481
41486
|
constructor(e, t) {
|
|
41482
41487
|
super("implies", e, t);
|
|
41483
41488
|
}
|
|
41484
41489
|
eval(e, t) {
|
|
41485
|
-
let n =
|
|
41490
|
+
let n = $(this.left.eval(e, t), "boolean"), i = $(this.right.eval(e, t), "boolean");
|
|
41486
41491
|
return i?.value === true || n?.value === false ? f(true) : !n || !i ? [] : f(false);
|
|
41487
41492
|
}
|
|
41488
41493
|
};
|
|
41489
|
-
var
|
|
41494
|
+
var Y = class {
|
|
41490
41495
|
constructor(e, t) {
|
|
41491
41496
|
this.name = e;
|
|
41492
41497
|
this.args = t;
|
|
41493
41498
|
}
|
|
41494
41499
|
eval(e, t) {
|
|
41495
|
-
let n =
|
|
41500
|
+
let n = O[this.name];
|
|
41496
41501
|
if (!n) throw new Error("Unrecognized function: " + this.name);
|
|
41497
41502
|
return n(e, t, ...this.args);
|
|
41498
41503
|
}
|
|
@@ -41500,7 +41505,7 @@ var J = class {
|
|
|
41500
41505
|
return `${this.name}(${this.args.map((e) => e.toString()).join(", ")})`;
|
|
41501
41506
|
}
|
|
41502
41507
|
};
|
|
41503
|
-
var
|
|
41508
|
+
var ve = class {
|
|
41504
41509
|
constructor(e, t) {
|
|
41505
41510
|
this.left = e;
|
|
41506
41511
|
this.expr = t;
|
|
@@ -41517,7 +41522,7 @@ var xe = class {
|
|
|
41517
41522
|
return `${this.left.toString()}[${this.expr.toString()}]`;
|
|
41518
41523
|
}
|
|
41519
41524
|
};
|
|
41520
|
-
var
|
|
41525
|
+
var We = ["!=", "!~", "<=", ">=", "{}", "->"];
|
|
41521
41526
|
var y = { FunctionCall: 0, Dot: 1, Indexer: 2, UnaryAdd: 3, UnarySubtract: 3, Multiply: 4, Divide: 4, IntegerDivide: 4, Modulo: 4, Add: 5, Subtract: 5, Ampersand: 5, Is: 6, As: 6, Union: 7, GreaterThan: 8, GreaterThanOrEquals: 8, LessThan: 8, LessThanOrEquals: 8, Equals: 9, Equivalent: 9, NotEquals: 9, NotEquivalent: 9, In: 10, Contains: 10, And: 11, Xor: 12, Or: 12, Implies: 13, Arrow: 100, Semicolon: 200 };
|
|
41522
41527
|
var as = { parse(r7) {
|
|
41523
41528
|
let e = r7.consumeAndParse();
|
|
@@ -41527,25 +41532,25 @@ var as = { parse(r7) {
|
|
|
41527
41532
|
var cs = { parse(r7, e) {
|
|
41528
41533
|
let t = r7.consumeAndParse();
|
|
41529
41534
|
if (!r7.match("]")) throw new Error("Parse error: expected `]`");
|
|
41530
|
-
return new
|
|
41535
|
+
return new ve(e, t);
|
|
41531
41536
|
}, precedence: y.Indexer };
|
|
41532
41537
|
var us = { parse(r7, e) {
|
|
41533
|
-
if (!(e instanceof
|
|
41538
|
+
if (!(e instanceof j)) throw new Error("Unexpected parentheses");
|
|
41534
41539
|
let t = [];
|
|
41535
41540
|
for (; !r7.match(")"); ) t.push(r7.consumeAndParse()), r7.match(",");
|
|
41536
|
-
return new
|
|
41541
|
+
return new Y(e.name, t);
|
|
41537
41542
|
}, precedence: y.FunctionCall };
|
|
41538
41543
|
function ls(r7) {
|
|
41539
41544
|
let e = r7.split(" "), t = parseFloat(e[0]), n = e[1];
|
|
41540
41545
|
return n?.startsWith("'") && n.endsWith("'") ? n = n.substring(1, n.length - 1) : n = "{" + n + "}", { value: t, unit: n };
|
|
41541
41546
|
}
|
|
41542
41547
|
function $e() {
|
|
41543
|
-
return new
|
|
41548
|
+
return new Ye().registerPrefix("String", { parse: (r7, e) => new U({ type: p.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r7, e) => new U({ type: p.dateTime, value: ke(e.value) }) }).registerPrefix("Quantity", { parse: (r7, e) => new U({ type: p.Quantity, value: ls(e.value) }) }).registerPrefix("Number", { parse: (r7, e) => new U({ type: e.value.includes(".") ? p.decimal : p.integer, value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new U({ type: p.boolean, value: true }) }).registerPrefix("false", { parse: () => new U({ type: p.boolean, value: false }) }).registerPrefix("Symbol", { parse: (r7, e) => new j(e.value) }).registerPrefix("{}", { parse: () => new dt() }).registerPrefix("(", as).registerInfix("[", cs).registerInfix("(", us).prefix("+", y.UnaryAdd, (r7, e) => new ft("+", e, (t) => t)).prefix("-", y.UnarySubtract, (r7, e) => new D("-", e, e, (t, n) => -n)).infixLeft(".", y.Dot, (r7, e, t) => new ie(r7, t)).infixLeft("/", y.Divide, (r7, e, t) => new D("/", r7, t, (n, i) => n / i)).infixLeft("*", y.Multiply, (r7, e, t) => new D("*", r7, t, (n, i) => n * i)).infixLeft("+", y.Add, (r7, e, t) => new D("+", r7, t, (n, i) => n + i)).infixLeft("-", y.Subtract, (r7, e, t) => new D("-", r7, t, (n, i) => n - i)).infixLeft("|", y.Union, (r7, e, t) => new Ve(r7, t)).infixLeft("=", y.Equals, (r7, e, t) => new gt(r7, t)).infixLeft("!=", y.NotEquals, (r7, e, t) => new xt(r7, t)).infixLeft("~", y.Equivalent, (r7, e, t) => new vt(r7, t)).infixLeft("!~", y.NotEquivalent, (r7, e, t) => new Tt(r7, t)).infixLeft("<", y.LessThan, (r7, e, t) => new D("<", r7, t, (n, i) => n < i)).infixLeft("<=", y.LessThanOrEquals, (r7, e, t) => new D("<=", r7, t, (n, i) => n <= i)).infixLeft(">", y.GreaterThan, (r7, e, t) => new D(">", r7, t, (n, i) => n > i)).infixLeft(">=", y.GreaterThanOrEquals, (r7, e, t) => new D(">=", r7, t, (n, i) => n >= i)).infixLeft("&", y.Ampersand, (r7, e, t) => new mt(r7, t)).infixLeft("and", y.And, (r7, e, t) => new St(r7, t)).infixLeft("as", y.As, (r7, e, t) => new ge(r7, t)).infixLeft("contains", y.Contains, (r7, e, t) => new ht(r7, t)).infixLeft("div", y.Divide, (r7, e, t) => new D("div", r7, t, (n, i) => n / i | 0)).infixLeft("in", y.In, (r7, e, t) => new yt(r7, t)).infixLeft("is", y.Is, (r7, e, t) => new xe(r7, t)).infixLeft("mod", y.Modulo, (r7, e, t) => new D("mod", r7, t, (n, i) => n % i)).infixLeft("or", y.Or, (r7, e, t) => new Et(r7, t)).infixLeft("xor", y.Xor, (r7, e, t) => new bt(r7, t)).infixLeft("implies", y.Implies, (r7, e, t) => new Rt(r7, t));
|
|
41544
41549
|
}
|
|
41545
41550
|
var ps = $e();
|
|
41546
|
-
var ii = ((
|
|
41551
|
+
var ii = ((l2) => (l2.BOOLEAN = "BOOLEAN", l2.NUMBER = "NUMBER", l2.QUANTITY = "QUANTITY", l2.TEXT = "TEXT", l2.REFERENCE = "REFERENCE", l2.CANONICAL = "CANONICAL", l2.DATE = "DATE", l2.DATETIME = "DATETIME", l2.PERIOD = "PERIOD", l2.UUID = "UUID", l2))(ii || {});
|
|
41547
41552
|
var li = ((v) => (v.EQUALS = "eq", v.NOT_EQUALS = "ne", v.GREATER_THAN = "gt", v.LESS_THAN = "lt", v.GREATER_THAN_OR_EQUALS = "ge", v.LESS_THAN_OR_EQUALS = "le", v.STARTS_AFTER = "sa", v.ENDS_BEFORE = "eb", v.APPROXIMATELY = "ap", v.CONTAINS = "contains", v.STARTS_WITH = "sw", v.EXACT = "exact", v.TEXT = "text", v.NOT = "not", v.ABOVE = "above", v.BELOW = "below", v.IN = "in", v.NOT_IN = "not-in", v.OF_TYPE = "of-type", v.MISSING = "missing", v.PRESENT = "present", v.IDENTIFIER = "identifier", v.ITERATE = "iterate", v))(li || {});
|
|
41548
|
-
var
|
|
41553
|
+
var Bs = ((b2) => (b2.READ = "read", b2.VREAD = "vread", b2.UPDATE = "update", b2.PATCH = "patch", b2.DELETE = "delete", b2.HISTORY = "history", b2.HISTORY_INSTANCE = "history-instance", b2.HISTORY_TYPE = "history-type", b2.HISTORY_SYSTEM = "history-system", b2.CREATE = "create", b2.SEARCH = "search", b2.SEARCH_TYPE = "search-type", b2.SEARCH_SYSTEM = "search-system", b2.SEARCH_COMPARTMENT = "search-compartment", b2.CAPABILITIES = "capabilities", b2.TRANSACTION = "transaction", b2.BATCH = "batch", b2.OPERATION = "operation", b2))(Bs || {});
|
|
41549
41554
|
function mi(r7) {
|
|
41550
41555
|
if (typeof window < "u") {
|
|
41551
41556
|
let e = window.atob(r7), t = Uint8Array.from(e, (n) => n.charCodeAt(0));
|
|
@@ -41564,12 +41569,12 @@ function hi(r7) {
|
|
|
41564
41569
|
}
|
|
41565
41570
|
function Nr() {
|
|
41566
41571
|
let r7 = new Uint32Array(28);
|
|
41567
|
-
return crypto.getRandomValues(r7),
|
|
41572
|
+
return crypto.getRandomValues(r7), $n(r7.buffer);
|
|
41568
41573
|
}
|
|
41569
41574
|
async function yi(r7) {
|
|
41570
41575
|
return crypto.subtle.digest("SHA-256", new TextEncoder().encode(r7));
|
|
41571
41576
|
}
|
|
41572
|
-
function
|
|
41577
|
+
function Te() {
|
|
41573
41578
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (r7) => {
|
|
41574
41579
|
let e = Math.random() * 16 | 0;
|
|
41575
41580
|
return (r7 === "x" ? e : e & 3 | 8).toString(16);
|
|
@@ -41599,7 +41604,7 @@ var Ot = class {
|
|
|
41599
41604
|
return this.cache.keys().next().value;
|
|
41600
41605
|
}
|
|
41601
41606
|
};
|
|
41602
|
-
var
|
|
41607
|
+
var A = { CSS: "text/css", DICOM: "application/dicom", FAVICON: "image/vnd.microsoft.icon", FHIR_JSON: "application/fhir+json", FORM_URL_ENCODED: "application/x-www-form-urlencoded", HL7_V2: "x-application/hl7-v2+er7", HTML: "text/html", JAVASCRIPT: "text/javascript", JSON: "application/json", JSON_PATCH: "application/json-patch+json", PNG: "image/png", SCIM_JSON: "application/scim+json", SVG: "image/svg+xml", TEXT: "text/plain", TYPESCRIPT: "text/typescript", PING: "x-application/ping", XML: "text/xml", CDA_XML: "application/cda+xml" };
|
|
41603
41608
|
var Lr = class {
|
|
41604
41609
|
constructor() {
|
|
41605
41610
|
this.listeners = {};
|
|
@@ -41625,7 +41630,7 @@ var Lr = class {
|
|
|
41625
41630
|
this.listeners = {};
|
|
41626
41631
|
}
|
|
41627
41632
|
};
|
|
41628
|
-
var
|
|
41633
|
+
var K = class {
|
|
41629
41634
|
constructor() {
|
|
41630
41635
|
this.emitter = new Lr();
|
|
41631
41636
|
}
|
|
@@ -41643,7 +41648,7 @@ var H = class {
|
|
|
41643
41648
|
}
|
|
41644
41649
|
};
|
|
41645
41650
|
var Fr = { "Patient-open": "Patient-open", "Patient-close": "Patient-close", "ImagingStudy-open": "ImagingStudy-open", "ImagingStudy-close": "ImagingStudy-close", "Encounter-open": "Encounter-open", "Encounter-close": "Encounter-close", "DiagnosticReport-open": "DiagnosticReport-open", "DiagnosticReport-close": "DiagnosticReport-close", "DiagnosticReport-select": "DiagnosticReport-select", "DiagnosticReport-update": "DiagnosticReport-update", syncerror: "syncerror" };
|
|
41646
|
-
var
|
|
41651
|
+
var zs = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
|
|
41647
41652
|
var Ur = ["DiagnosticReport-update"];
|
|
41648
41653
|
function vi(r7) {
|
|
41649
41654
|
return Ur.includes(r7);
|
|
@@ -41651,9 +41656,9 @@ function vi(r7) {
|
|
|
41651
41656
|
function Ti(r7) {
|
|
41652
41657
|
if (Ur.includes(r7)) throw new d(h(`'context.version' is required for '${r7}'.`));
|
|
41653
41658
|
}
|
|
41654
|
-
var
|
|
41655
|
-
function
|
|
41656
|
-
return
|
|
41659
|
+
var Js = { "Patient-open": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "Patient-close": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "ImagingStudy-open": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "ImagingStudy-close": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "Encounter-open": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "Encounter-close": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "DiagnosticReport-open": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-close": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-select": { report: { resourceType: "DiagnosticReport" }, select: { resourceType: "*", isArray: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport" }, patient: { resourceType: "Patient", optional: true }, study: { resourceType: "ImagingStudy", optional: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
|
|
41660
|
+
function Ys(r7) {
|
|
41661
|
+
return zs.includes(r7);
|
|
41657
41662
|
}
|
|
41658
41663
|
function Si(r7) {
|
|
41659
41664
|
return !!r7.endpoint;
|
|
@@ -41676,11 +41681,11 @@ function xi(r7, e, t, n) {
|
|
|
41676
41681
|
if (!e.resourceType) throw new d(h(`context[${t}] is invalid. Resource must contain a resource type. No resource type found.`));
|
|
41677
41682
|
let i = n.resourceType;
|
|
41678
41683
|
if (i !== "*") {
|
|
41679
|
-
if (!
|
|
41684
|
+
if (!Ys(e.resourceType)) throw new d(h(`context[${t}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));
|
|
41680
41685
|
if (i && e.resourceType !== i) throw new d(h(`context[${t}] is invalid. context[${t}] for the '${r7}' event should contain resource of type ${i}.`));
|
|
41681
41686
|
}
|
|
41682
41687
|
}
|
|
41683
|
-
function
|
|
41688
|
+
function Zs(r7, e, t, n, i) {
|
|
41684
41689
|
if (i.set(e.key, (i.get(e.key) ?? 0) + 1), !n.isArray) xi(r7, e.resource, t, n);
|
|
41685
41690
|
else {
|
|
41686
41691
|
let { resources: o } = e;
|
|
@@ -41688,12 +41693,12 @@ function Ys(r7, e, t, n, i) {
|
|
|
41688
41693
|
for (let s of o) xi(r7, s, t, n);
|
|
41689
41694
|
}
|
|
41690
41695
|
}
|
|
41691
|
-
function
|
|
41692
|
-
let t = /* @__PURE__ */ new Map(), n =
|
|
41696
|
+
function Xs(r7, e) {
|
|
41697
|
+
let t = /* @__PURE__ */ new Map(), n = Js[r7];
|
|
41693
41698
|
for (let i = 0; i < e.length; i++) {
|
|
41694
41699
|
let o = e[i].key;
|
|
41695
41700
|
if (!n[o]) throw new d(h(`Key '${o}' not found for event '${r7}'. Make sure to add only valid keys.`));
|
|
41696
|
-
|
|
41701
|
+
Zs(r7, e[i], i, n[o], t);
|
|
41697
41702
|
}
|
|
41698
41703
|
for (let [i, o] of Object.entries(n)) {
|
|
41699
41704
|
if (!(o.optional || t.has(i))) throw new d(h(`Missing required key '${i}' on context for '${r7}' event.`));
|
|
@@ -41706,9 +41711,9 @@ function qr(r7, e, t, n) {
|
|
|
41706
41711
|
if (typeof t != "object") throw new d(h("context must be a context object or array of context objects."));
|
|
41707
41712
|
if (Ur.includes(e) && !n) throw new d(h(`The '${e}' event must contain a 'context.versionId'.`));
|
|
41708
41713
|
let i = Array.isArray(t) ? t : [t];
|
|
41709
|
-
return
|
|
41714
|
+
return Xs(e, i), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: Te(), event: { "hub.topic": r7, "hub.event": e, context: i, ...n ? { "context.versionId": n } : {} } };
|
|
41710
41715
|
}
|
|
41711
|
-
var It = class extends
|
|
41716
|
+
var It = class extends K {
|
|
41712
41717
|
constructor(e) {
|
|
41713
41718
|
if (super(), this.subRequest = e, !e.endpoint) throw new d(h("Subscription request should contain an endpoint."));
|
|
41714
41719
|
if (!kt(e)) throw new d(h("Subscription request failed validation."));
|
|
@@ -41728,7 +41733,7 @@ var It = class extends H {
|
|
|
41728
41733
|
this.websocket.close();
|
|
41729
41734
|
}
|
|
41730
41735
|
};
|
|
41731
|
-
function
|
|
41736
|
+
function ea(r7) {
|
|
41732
41737
|
let e = r7.replace(/-/g, "+").replace(/_/g, "/"), t = mi(e), n = Array.from(t).reduce((o, s) => {
|
|
41733
41738
|
let a2 = ("00" + s.charCodeAt(0).toString(16)).slice(-2);
|
|
41734
41739
|
return `${o}%${a2}`;
|
|
@@ -41740,7 +41745,7 @@ function Ei(r7) {
|
|
|
41740
41745
|
}
|
|
41741
41746
|
function Vt(r7) {
|
|
41742
41747
|
let [e, t, n] = r7.split(".");
|
|
41743
|
-
return
|
|
41748
|
+
return ea(t);
|
|
41744
41749
|
}
|
|
41745
41750
|
function bi(r7) {
|
|
41746
41751
|
try {
|
|
@@ -41765,7 +41770,7 @@ var Dt = class {
|
|
|
41765
41770
|
return this.medplum.get(`keyvalue/v1/${e}`);
|
|
41766
41771
|
}
|
|
41767
41772
|
async set(e, t) {
|
|
41768
|
-
await this.medplum.put(`keyvalue/v1/${e}`, t,
|
|
41773
|
+
await this.medplum.put(`keyvalue/v1/${e}`, t, A.TEXT);
|
|
41769
41774
|
}
|
|
41770
41775
|
async delete(e) {
|
|
41771
41776
|
await this.medplum.delete(`keyvalue/v1/${e}`);
|
|
@@ -41807,9 +41812,9 @@ var M = class {
|
|
|
41807
41812
|
return this.suspender.finally(e);
|
|
41808
41813
|
}
|
|
41809
41814
|
};
|
|
41810
|
-
var
|
|
41815
|
+
var Ge = class {
|
|
41811
41816
|
constructor(e) {
|
|
41812
|
-
this.storage = e ?? (typeof localStorage < "u" ? localStorage : new
|
|
41817
|
+
this.storage = e ?? (typeof localStorage < "u" ? localStorage : new jr());
|
|
41813
41818
|
}
|
|
41814
41819
|
clear() {
|
|
41815
41820
|
this.storage.clear();
|
|
@@ -41825,10 +41830,10 @@ var He = class {
|
|
|
41825
41830
|
return t ? JSON.parse(t) : void 0;
|
|
41826
41831
|
}
|
|
41827
41832
|
setObject(e, t) {
|
|
41828
|
-
this.setString(e, t ?
|
|
41833
|
+
this.setString(e, t ? ut(t) : void 0);
|
|
41829
41834
|
}
|
|
41830
41835
|
};
|
|
41831
|
-
var
|
|
41836
|
+
var jr = class {
|
|
41832
41837
|
constructor() {
|
|
41833
41838
|
this.data = /* @__PURE__ */ new Map();
|
|
41834
41839
|
}
|
|
@@ -41851,15 +41856,15 @@ var Wr = class {
|
|
|
41851
41856
|
return Array.from(this.data.keys())[e];
|
|
41852
41857
|
}
|
|
41853
41858
|
};
|
|
41854
|
-
var
|
|
41859
|
+
var Me = { Event: typeof globalThis.Event < "u" ? globalThis.Event : void 0, ErrorEvent: void 0, CloseEvent: void 0 };
|
|
41855
41860
|
var wi = false;
|
|
41856
|
-
function
|
|
41861
|
+
function ta() {
|
|
41857
41862
|
if (typeof globalThis.Event > "u") throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");
|
|
41858
|
-
|
|
41863
|
+
Me.Event = globalThis.Event, Me.ErrorEvent = class extends Event {
|
|
41859
41864
|
constructor(e, t) {
|
|
41860
41865
|
super("error", t), this.message = e.message, this.error = e;
|
|
41861
41866
|
}
|
|
41862
|
-
},
|
|
41867
|
+
}, Me.CloseEvent = class extends Event {
|
|
41863
41868
|
constructor(t = 1e3, n = "", i) {
|
|
41864
41869
|
super("close", i);
|
|
41865
41870
|
this.wasClean = true;
|
|
@@ -41867,17 +41872,17 @@ function ea() {
|
|
|
41867
41872
|
}
|
|
41868
41873
|
};
|
|
41869
41874
|
}
|
|
41870
|
-
function
|
|
41875
|
+
function ra(r7, e) {
|
|
41871
41876
|
if (!r7) throw new Error(e);
|
|
41872
41877
|
}
|
|
41873
41878
|
function Mt(r7) {
|
|
41874
41879
|
return new r7.constructor(r7.type, r7);
|
|
41875
41880
|
}
|
|
41876
|
-
var
|
|
41881
|
+
var Se = { maxReconnectionDelay: 1e4, minReconnectionDelay: 1e3 + Math.random() * 4e3, minUptime: 5e3, reconnectionDelayGrowFactor: 1.3, connectionTimeout: 4e3, maxRetries: 1 / 0, maxEnqueuedMessages: 1 / 0, startClosed: false, debug: false };
|
|
41877
41882
|
var Ai = false;
|
|
41878
|
-
var _t = class r extends
|
|
41883
|
+
var _t = class r extends K {
|
|
41879
41884
|
constructor(t, n, i = {}) {
|
|
41880
|
-
wi || (
|
|
41885
|
+
wi || (ta(), wi = true);
|
|
41881
41886
|
super();
|
|
41882
41887
|
this._retryCount = -1;
|
|
41883
41888
|
this._shouldReconnect = true;
|
|
@@ -41891,8 +41896,8 @@ var _t = class r extends H {
|
|
|
41891
41896
|
this.onopen = null;
|
|
41892
41897
|
this._handleOpen = (t2) => {
|
|
41893
41898
|
this._debug("open event");
|
|
41894
|
-
let { minUptime: n2 =
|
|
41895
|
-
clearTimeout(this._connectTimeout), this._uptimeTimeout = setTimeout(() => this._acceptOpen(), n2),
|
|
41899
|
+
let { minUptime: n2 = Se.minUptime } = this._options;
|
|
41900
|
+
clearTimeout(this._connectTimeout), this._uptimeTimeout = setTimeout(() => this._acceptOpen(), n2), ra(this._ws, "WebSocket is not defined"), this._ws.binaryType = this._binaryType, this._messageQueue.forEach((i2) => this._ws?.send(i2)), this._messageQueue = [], this.onopen && this.onopen(t2), this.dispatchEvent(Mt(t2));
|
|
41896
41901
|
};
|
|
41897
41902
|
this._handleMessage = (t2) => {
|
|
41898
41903
|
this._debug("message event"), this.onmessage && this.onmessage(t2), this.dispatchEvent(Mt(t2));
|
|
@@ -41973,7 +41978,7 @@ var _t = class r extends H {
|
|
|
41973
41978
|
send(t) {
|
|
41974
41979
|
if (this._ws && this._ws.readyState === this.OPEN) this._debug("send", t), this._ws.send(t);
|
|
41975
41980
|
else {
|
|
41976
|
-
let { maxEnqueuedMessages: n =
|
|
41981
|
+
let { maxEnqueuedMessages: n = Se.maxEnqueuedMessages } = this._options;
|
|
41977
41982
|
this._messageQueue.length < n && (this._debug("enqueue", t), this._messageQueue.push(t));
|
|
41978
41983
|
}
|
|
41979
41984
|
}
|
|
@@ -41981,7 +41986,7 @@ var _t = class r extends H {
|
|
|
41981
41986
|
this._options.debug && this._debugLogger("RWS>", ...t);
|
|
41982
41987
|
}
|
|
41983
41988
|
_getNextDelay() {
|
|
41984
|
-
let { reconnectionDelayGrowFactor: t =
|
|
41989
|
+
let { reconnectionDelayGrowFactor: t = Se.reconnectionDelayGrowFactor, minReconnectionDelay: n = Se.minReconnectionDelay, maxReconnectionDelay: i = Se.maxReconnectionDelay } = this._options, o = 0;
|
|
41985
41990
|
return this._retryCount > 0 && (o = n * Math.pow(t, this._retryCount - 1), o > i && (o = i)), this._debug("next delay", o), o;
|
|
41986
41991
|
}
|
|
41987
41992
|
_wait() {
|
|
@@ -41992,7 +41997,7 @@ var _t = class r extends H {
|
|
|
41992
41997
|
_connect() {
|
|
41993
41998
|
if (this._connectLock || !this._shouldReconnect) return;
|
|
41994
41999
|
this._connectLock = true;
|
|
41995
|
-
let { maxRetries: t =
|
|
42000
|
+
let { maxRetries: t = Se.maxRetries, connectionTimeout: n = Se.connectionTimeout } = this._options;
|
|
41996
42001
|
if (this._retryCount >= t) {
|
|
41997
42002
|
this._debug("max retries reached", this._retryCount, ">=", t);
|
|
41998
42003
|
return;
|
|
@@ -42006,17 +42011,17 @@ var _t = class r extends H {
|
|
|
42006
42011
|
let i = this._options.WebSocket || WebSocket;
|
|
42007
42012
|
this._debug("connect", { url: this._url, protocols: this._protocols }), this._ws = this._protocols ? new i(this._url, this._protocols) : new i(this._url), this._ws.binaryType = this._binaryType, this._connectLock = false, this._addListeners(), this._connectTimeout = setTimeout(() => this._handleTimeout(), n);
|
|
42008
42013
|
}).catch((i) => {
|
|
42009
|
-
this._connectLock = false, this._handleError(new
|
|
42014
|
+
this._connectLock = false, this._handleError(new Me.ErrorEvent(Error(i.message), this));
|
|
42010
42015
|
});
|
|
42011
42016
|
}
|
|
42012
42017
|
_handleTimeout() {
|
|
42013
|
-
this._debug("timeout event"), this._handleError(new
|
|
42018
|
+
this._debug("timeout event"), this._handleError(new Me.ErrorEvent(Error("TIMEOUT"), this));
|
|
42014
42019
|
}
|
|
42015
42020
|
_disconnect(t = 1e3, n) {
|
|
42016
42021
|
if (this._clearTimeouts(), !!this._ws) {
|
|
42017
42022
|
this._removeListeners();
|
|
42018
42023
|
try {
|
|
42019
|
-
this._ws.close(t, n), this._handleClose(new
|
|
42024
|
+
this._ws.close(t, n), this._handleClose(new Me.CloseEvent(t, n, this));
|
|
42020
42025
|
} catch {
|
|
42021
42026
|
}
|
|
42022
42027
|
}
|
|
@@ -42034,8 +42039,8 @@ var _t = class r extends H {
|
|
|
42034
42039
|
clearTimeout(this._connectTimeout), clearTimeout(this._uptimeTimeout);
|
|
42035
42040
|
}
|
|
42036
42041
|
};
|
|
42037
|
-
var
|
|
42038
|
-
var
|
|
42042
|
+
var na = 5e3;
|
|
42043
|
+
var He = class extends K {
|
|
42039
42044
|
constructor(...e) {
|
|
42040
42045
|
super(), this.criteria = new Set(e);
|
|
42041
42046
|
}
|
|
@@ -42049,10 +42054,10 @@ var Qe = class extends H {
|
|
|
42049
42054
|
this.criteria.delete(e);
|
|
42050
42055
|
}
|
|
42051
42056
|
};
|
|
42052
|
-
var
|
|
42057
|
+
var Wr = class {
|
|
42053
42058
|
constructor(e, t) {
|
|
42054
42059
|
this.connecting = false;
|
|
42055
|
-
this.criteria = e, this.emitter = new
|
|
42060
|
+
this.criteria = e, this.emitter = new He(e), this.refCount = 1, this.subscriptionProps = t ? { ...t } : void 0;
|
|
42056
42061
|
}
|
|
42057
42062
|
clearAttachedSubscription() {
|
|
42058
42063
|
this.subscriptionId = void 0, this.token = void 0;
|
|
@@ -42070,7 +42075,7 @@ var Nt = class {
|
|
|
42070
42075
|
throw new d(h("Not a valid URL"));
|
|
42071
42076
|
}
|
|
42072
42077
|
let o = n?.ReconnectingWebSocket ? new n.ReconnectingWebSocket(i, void 0, { debug: n?.debug, debugLogger: n?.debugLogger }) : new _t(i, void 0, { debug: n?.debug, debugLogger: n?.debugLogger });
|
|
42073
|
-
this.medplum = e, this.ws = o, this.masterSubEmitter = new
|
|
42078
|
+
this.medplum = e, this.ws = o, this.masterSubEmitter = new He(), this.criteriaEntries = /* @__PURE__ */ new Map(), this.criteriaEntriesBySubscriptionId = /* @__PURE__ */ new Map(), this.wsClosed = false, this.pingIntervalMs = n?.pingIntervalMs ?? na, this.currentProfile = e.getProfile(), this.setupListeners();
|
|
42074
42079
|
}
|
|
42075
42080
|
setupListeners() {
|
|
42076
42081
|
let e = this.ws;
|
|
@@ -42087,7 +42092,7 @@ var Nt = class {
|
|
|
42087
42092
|
return;
|
|
42088
42093
|
}
|
|
42089
42094
|
if (o.type === "handshake") {
|
|
42090
|
-
let a2 =
|
|
42095
|
+
let a2 = fe(o.subscription), c = { type: "connect", payload: { subscriptionId: a2 } };
|
|
42091
42096
|
this.masterSubEmitter?.dispatchEvent(c);
|
|
42092
42097
|
let u2 = this.criteriaEntriesBySubscriptionId.get(a2);
|
|
42093
42098
|
if (!u2) {
|
|
@@ -42098,7 +42103,7 @@ var Nt = class {
|
|
|
42098
42103
|
return;
|
|
42099
42104
|
}
|
|
42100
42105
|
this.masterSubEmitter?.dispatchEvent({ type: "message", payload: i });
|
|
42101
|
-
let s = this.criteriaEntriesBySubscriptionId.get(
|
|
42106
|
+
let s = this.criteriaEntriesBySubscriptionId.get(fe(o.subscription));
|
|
42102
42107
|
if (!s) {
|
|
42103
42108
|
console.warn("Received notification for criteria the SubscriptionManager is not listening for");
|
|
42104
42109
|
return;
|
|
@@ -42148,7 +42153,7 @@ var Nt = class {
|
|
|
42148
42153
|
}
|
|
42149
42154
|
async getTokenForCriteria(e) {
|
|
42150
42155
|
let t = e?.subscriptionId;
|
|
42151
|
-
t || (t = (await this.medplum.createResource({ ...e.subscriptionProps, resourceType: "Subscription", status: "active", reason: `WebSocket subscription for ${
|
|
42156
|
+
t || (t = (await this.medplum.createResource({ ...e.subscriptionProps, resourceType: "Subscription", status: "active", reason: `WebSocket subscription for ${de(this.medplum.getProfile())}`, channel: { type: "websocket" }, criteria: e.criteria })).id);
|
|
42152
42157
|
let { parameter: n } = await this.medplum.get(`fhir/R4/Subscription/${t}/$get-ws-binding-token`), i = n?.find((s) => s.name === "token")?.valueString, o = n?.find((s) => s.name === "websocket-url")?.valueUrl;
|
|
42153
42158
|
if (!i) throw new d(h("Failed to get token"));
|
|
42154
42159
|
if (!o) throw new d(h("Failed to get URL from $get-ws-binding-token"));
|
|
@@ -42158,7 +42163,7 @@ var Nt = class {
|
|
|
42158
42163
|
let n = this.criteriaEntries.get(e);
|
|
42159
42164
|
if (n) {
|
|
42160
42165
|
if (!t) return n.bareCriteria;
|
|
42161
|
-
for (let i of n.criteriaWithProps) if (
|
|
42166
|
+
for (let i of n.criteriaWithProps) if (te(t, i.subscriptionProps)) return i;
|
|
42162
42167
|
}
|
|
42163
42168
|
}
|
|
42164
42169
|
getAllCriteriaEmitters() {
|
|
@@ -42179,7 +42184,7 @@ var Nt = class {
|
|
|
42179
42184
|
let s = this.criteriaEntries.get(t);
|
|
42180
42185
|
n ? s.criteriaWithProps = s.criteriaWithProps.filter((a2) => {
|
|
42181
42186
|
let c = a2.subscriptionProps;
|
|
42182
|
-
return !
|
|
42187
|
+
return !te(n, c);
|
|
42183
42188
|
}) : s.bareCriteria = void 0, !s.bareCriteria && s.criteriaWithProps.length === 0 && (this.criteriaEntries.delete(t), this.masterSubEmitter?._removeCriteria(t)), i && this.criteriaEntriesBySubscriptionId.delete(i), o && this.ws.readyState === WebSocket.OPEN && this.ws.send(JSON.stringify({ type: "unbind-from-token", payload: { token: o } }));
|
|
42184
42189
|
}
|
|
42185
42190
|
async subscribeToCriteria(e) {
|
|
@@ -42189,7 +42194,7 @@ var Nt = class {
|
|
|
42189
42194
|
let [t, n] = await this.getTokenForCriteria(e);
|
|
42190
42195
|
e.subscriptionId = t, e.token = n, this.criteriaEntriesBySubscriptionId.set(t, e), this.ws.send(JSON.stringify({ type: "bind-with-token", payload: { token: n } }));
|
|
42191
42196
|
} catch (t) {
|
|
42192
|
-
console.error(
|
|
42197
|
+
console.error(Ce(t)), this.emitError(e, t), this.removeCriteriaEntry(e);
|
|
42193
42198
|
}
|
|
42194
42199
|
}
|
|
42195
42200
|
}
|
|
@@ -42201,7 +42206,7 @@ var Nt = class {
|
|
|
42201
42206
|
this.masterSubEmitter && this.masterSubEmitter._addCriteria(e);
|
|
42202
42207
|
let n = this.maybeGetCriteriaEntry(e, t);
|
|
42203
42208
|
if (n) return n.refCount += 1, n.emitter;
|
|
42204
|
-
let i = new
|
|
42209
|
+
let i = new Wr(e, t);
|
|
42205
42210
|
return this.addCriteriaEntry(i), this.subscribeToCriteria(i).catch(console.error), i.emitter;
|
|
42206
42211
|
}
|
|
42207
42212
|
removeCriteria(e, t) {
|
|
@@ -42225,28 +42230,28 @@ var Nt = class {
|
|
|
42225
42230
|
return this.getAllCriteriaEmitters().length;
|
|
42226
42231
|
}
|
|
42227
42232
|
getMasterEmitter() {
|
|
42228
|
-
return this.masterSubEmitter || (this.masterSubEmitter = new
|
|
42233
|
+
return this.masterSubEmitter || (this.masterSubEmitter = new He(...Array.from(this.criteriaEntries.keys()))), this.masterSubEmitter;
|
|
42229
42234
|
}
|
|
42230
42235
|
};
|
|
42231
|
-
var $r = "3.2.
|
|
42232
|
-
var
|
|
42233
|
-
var
|
|
42234
|
-
var
|
|
42235
|
-
var
|
|
42236
|
-
var
|
|
42237
|
-
var
|
|
42238
|
-
var
|
|
42236
|
+
var $r = "3.2.28-82be55608";
|
|
42237
|
+
var sa = A.FHIR_JSON + ", */*; q=0.1";
|
|
42238
|
+
var aa = "https://api.medplum.com/";
|
|
42239
|
+
var ca = 1e3;
|
|
42240
|
+
var ua = 6e4;
|
|
42241
|
+
var la = 0;
|
|
42242
|
+
var pa = 3e5;
|
|
42243
|
+
var da = "Binary/";
|
|
42239
42244
|
var Oi = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
|
|
42240
|
-
var
|
|
42241
|
-
var
|
|
42242
|
-
var
|
|
42243
|
-
var
|
|
42244
|
-
var Lt = class extends
|
|
42245
|
+
var fa = ((o) => (o.ClientCredentials = "client_credentials", o.AuthorizationCode = "authorization_code", o.RefreshToken = "refresh_token", o.JwtBearer = "urn:ietf:params:oauth:grant-type:jwt-bearer", o.TokenExchange = "urn:ietf:params:oauth:grant-type:token-exchange", o))(fa || {});
|
|
42246
|
+
var ma = ((o) => (o.AccessToken = "urn:ietf:params:oauth:token-type:access_token", o.RefreshToken = "urn:ietf:params:oauth:token-type:refresh_token", o.IdToken = "urn:ietf:params:oauth:token-type:id_token", o.Saml1Token = "urn:ietf:params:oauth:token-type:saml1", o.Saml2Token = "urn:ietf:params:oauth:token-type:saml2", o))(ma || {});
|
|
42247
|
+
var ha = ((o) => (o.ClientSecretBasic = "client_secret_basic", o.ClientSecretPost = "client_secret_post", o.ClientSecretJwt = "client_secret_jwt", o.PrivateKeyJwt = "private_key_jwt", o.None = "none", o))(ha || {});
|
|
42248
|
+
var ya = ((e) => (e.JwtBearer = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", e))(ya || {});
|
|
42249
|
+
var Lt = class extends K {
|
|
42245
42250
|
constructor(t) {
|
|
42246
42251
|
super();
|
|
42247
42252
|
this.initComplete = true;
|
|
42248
42253
|
if (t?.baseUrl && !t.baseUrl.startsWith("http")) throw new Error("Base URL must start with http or https");
|
|
42249
|
-
this.options = t ?? {}, this.fetch = t?.fetch ??
|
|
42254
|
+
this.options = t ?? {}, this.fetch = t?.fetch ?? ga(), this.storage = t?.storage ?? new Ge(), this.createPdfImpl = t?.createPdf, this.baseUrl = Pr(t?.baseUrl ?? aa), this.fhirBaseUrl = q(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4"), this.authorizeUrl = q(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = q(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = q(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.fhircastHubUrl = q(this.baseUrl, t?.fhircastHubUrl ?? "fhircast/STU3"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.defaultHeaders = t?.defaultHeaders ?? {}, this.onUnauthenticated = t?.onUnauthenticated, this.refreshGracePeriod = t?.refreshGracePeriod ?? pa, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? la : ua), this.cacheTime > 0 ? this.requestCache = new Ot(t?.resourceCacheSize ?? ca) : this.requestCache = void 0, t?.autoBatchTime ? (this.autoBatchTime = t.autoBatchTime, this.autoBatchQueue = []) : (this.autoBatchTime = 0, this.autoBatchQueue = void 0), t?.accessToken && this.setAccessToken(t.accessToken), this.storage.getInitPromise === void 0 ? (t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initPromise = Promise.resolve(), this.dispatchEvent({ type: "storageInitialized" })) : (this.initComplete = false, this.initPromise = this.storage.getInitPromise(), this.initPromise.then(() => {
|
|
42250
42255
|
t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initComplete = true, this.dispatchEvent({ type: "storageInitialized" });
|
|
42251
42256
|
}).catch((n) => {
|
|
42252
42257
|
console.error(n), this.initComplete = true, this.dispatchEvent({ type: "storageInitFailed", payload: { error: n } });
|
|
@@ -42293,7 +42298,7 @@ var Lt = class extends H {
|
|
|
42293
42298
|
this.requestCache?.clear();
|
|
42294
42299
|
}
|
|
42295
42300
|
invalidateSearches(t) {
|
|
42296
|
-
let n =
|
|
42301
|
+
let n = q(this.fhirBaseUrl, t);
|
|
42297
42302
|
if (this.requestCache) for (let i of this.requestCache.keys()) (i.endsWith(n) || i.includes(n + "?")) && this.requestCache.delete(i);
|
|
42298
42303
|
}
|
|
42299
42304
|
get(t, n = {}) {
|
|
@@ -42301,7 +42306,7 @@ var Lt = class extends H {
|
|
|
42301
42306
|
let i = this.getCacheEntry(t, n);
|
|
42302
42307
|
if (i) return i.value;
|
|
42303
42308
|
let o;
|
|
42304
|
-
t.startsWith(this.fhirBaseUrl) && this.autoBatchQueue ? o = new Promise((a2, c) => {
|
|
42309
|
+
t.startsWith(this.fhirBaseUrl) && this.autoBatchQueue && !n.disableAutoBatch ? o = new Promise((a2, c) => {
|
|
42305
42310
|
this.autoBatchQueue.push({ method: "GET", url: t.replace(this.fhirBaseUrl, ""), options: n, resolve: a2, reject: c }), this.autoBatchTimerId || (this.autoBatchTimerId = setTimeout(() => this.executeAutoBatch(), this.autoBatchTime));
|
|
42306
42311
|
}) : o = this.request("GET", t, n);
|
|
42307
42312
|
let s = new M(o);
|
|
@@ -42314,7 +42319,7 @@ var Lt = class extends H {
|
|
|
42314
42319
|
return t = t.toString(), this.setRequestBody(o, n), i && this.setRequestContentType(o, i), this.invalidateUrl(t), this.request("PUT", t, o);
|
|
42315
42320
|
}
|
|
42316
42321
|
patch(t, n, i = {}) {
|
|
42317
|
-
return t = t.toString(), this.setRequestBody(i, n), this.setRequestContentType(i,
|
|
42322
|
+
return t = t.toString(), this.setRequestBody(i, n), this.setRequestContentType(i, A.JSON_PATCH), this.invalidateUrl(t), this.request("PATCH", t, i);
|
|
42318
42323
|
}
|
|
42319
42324
|
delete(t, n) {
|
|
42320
42325
|
return t = t.toString(), this.invalidateUrl(t), this.request("DELETE", t, n);
|
|
@@ -42372,18 +42377,18 @@ var Lt = class extends H {
|
|
|
42372
42377
|
return a2.toString();
|
|
42373
42378
|
}
|
|
42374
42379
|
fhirUrl(...t) {
|
|
42375
|
-
return new URL(
|
|
42380
|
+
return new URL(q(this.fhirBaseUrl, t.join("/")));
|
|
42376
42381
|
}
|
|
42377
42382
|
fhirSearchUrl(t, n) {
|
|
42378
42383
|
let i = this.fhirUrl(t);
|
|
42379
|
-
return n && (i.search =
|
|
42384
|
+
return n && (i.search = Yn(n)), i;
|
|
42380
42385
|
}
|
|
42381
42386
|
search(t, n, i) {
|
|
42382
42387
|
let o = this.fhirSearchUrl(t, n), s = "search-" + o.toString(), a2 = this.getCacheEntry(s, i);
|
|
42383
42388
|
if (a2) return a2.value;
|
|
42384
42389
|
let c = new M((async () => {
|
|
42385
42390
|
let u2 = await this.get(o, i);
|
|
42386
|
-
if (u2.entry) for (let
|
|
42391
|
+
if (u2.entry) for (let l2 of u2.entry) this.cacheResource(l2.resource);
|
|
42387
42392
|
return u2;
|
|
42388
42393
|
})());
|
|
42389
42394
|
return this.setCacheEntry(s, c), c;
|
|
@@ -42535,37 +42540,51 @@ var Lt = class extends H {
|
|
|
42535
42540
|
return s || (s = t), this.cacheResource(s), this.invalidateUrl(this.fhirUrl(t.resourceType, t.id, "_history")), this.invalidateSearches(t.resourceType), s;
|
|
42536
42541
|
}
|
|
42537
42542
|
async createAttachment(t, n, i, o, s) {
|
|
42538
|
-
let a2 = Di(t, n, i, o)
|
|
42543
|
+
let a2 = Di(t, n, i, o);
|
|
42544
|
+
if (a2.contentType === A.XML) {
|
|
42545
|
+
let l2 = a2.data, m2;
|
|
42546
|
+
l2 instanceof Blob ? m2 = await new Promise((x2, B) => {
|
|
42547
|
+
let W = new FileReader();
|
|
42548
|
+
W.onload = () => {
|
|
42549
|
+
if (!W.result) {
|
|
42550
|
+
B(new Error("Failed to load file"));
|
|
42551
|
+
return;
|
|
42552
|
+
}
|
|
42553
|
+
x2(W.result);
|
|
42554
|
+
}, W.readAsText(l2, "utf-8");
|
|
42555
|
+
}) : ArrayBuffer.isView(l2) ? m2 = new TextDecoder().decode(l2) : m2 = l2, m2.includes("<ClinicalDocument") && m2.includes("urn:hl7-org:v3") && (a2 = { ...a2, contentType: A.CDA_XML });
|
|
42556
|
+
}
|
|
42557
|
+
let c = s ?? (typeof n == "object" ? n : {}), u2 = await this.createBinary(a2, c);
|
|
42539
42558
|
return { contentType: a2.contentType, url: u2.url, title: a2.filename };
|
|
42540
42559
|
}
|
|
42541
42560
|
createBinary(t, n, i, o, s) {
|
|
42542
|
-
let a2 = Di(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType:
|
|
42543
|
-
return m2 &&
|
|
42561
|
+
let a2 = Di(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: l2, filename: m2, securityContext: x2, onProgress: B } = a2, W = this.fhirUrl("Binary");
|
|
42562
|
+
return m2 && W.searchParams.set("_filename", m2), x2?.reference && this.setRequestHeader(c, "X-Security-Context", x2.reference), B ? this.uploadwithProgress(W, u2, l2, B, c) : this.post(W, u2, l2, c);
|
|
42544
42563
|
}
|
|
42545
42564
|
uploadwithProgress(t, n, i, o, s) {
|
|
42546
42565
|
return new Promise((a2, c) => {
|
|
42547
|
-
let u2 = new XMLHttpRequest(),
|
|
42548
|
-
s?.signal?.addEventListener("abort",
|
|
42566
|
+
let u2 = new XMLHttpRequest(), l2 = () => u2.abort();
|
|
42567
|
+
s?.signal?.addEventListener("abort", l2);
|
|
42549
42568
|
let m2 = (x2) => {
|
|
42550
|
-
s?.signal?.removeEventListener("abort",
|
|
42569
|
+
s?.signal?.removeEventListener("abort", l2), x2 instanceof Error ? c(x2) : a2(x2);
|
|
42551
42570
|
};
|
|
42552
42571
|
if (u2.responseType = "json", u2.onabort = () => m2(new DOMException("Request aborted", "AbortError")), u2.onerror = () => m2(new Error("Request error")), o && (u2.upload.onprogress = (x2) => o(x2), u2.upload.onload = (x2) => o(x2)), u2.onload = () => {
|
|
42553
|
-
u2.status >= 200 && u2.status < 300 ? m2(u2.response) : m2(new d(
|
|
42572
|
+
u2.status >= 200 && u2.status < 300 ? m2(u2.response) : m2(new d(et(u2.response || u2.statusText)));
|
|
42554
42573
|
}, u2.open("POST", t), u2.withCredentials = true, u2.setRequestHeader("Authorization", "Bearer " + this.accessToken), u2.setRequestHeader("Cache-Control", "no-cache, no-store, max-age=0"), u2.setRequestHeader("Content-Type", i), this.options.extendedMode !== false && u2.setRequestHeader("X-Medplum", "extended"), s?.headers) {
|
|
42555
42574
|
let x2 = s.headers;
|
|
42556
|
-
for (let [
|
|
42575
|
+
for (let [B, W] of Object.entries(x2)) u2.setRequestHeader(B, W);
|
|
42557
42576
|
}
|
|
42558
42577
|
u2.send(n);
|
|
42559
42578
|
});
|
|
42560
42579
|
}
|
|
42561
42580
|
async createPdf(t, n, i, o) {
|
|
42562
42581
|
if (!this.createPdfImpl) throw new Error("PDF creation not enabled");
|
|
42563
|
-
let s =
|
|
42564
|
-
return this.createBinary(
|
|
42582
|
+
let s = Ta(t, n, i, o), a2 = typeof n == "object" ? n : {}, { docDefinition: c, tableLayouts: u2, fonts: l2, ...m2 } = s, x2 = await this.createPdfImpl(c, u2, l2), B = { ...m2, data: x2, contentType: "application/pdf" };
|
|
42583
|
+
return this.createBinary(B, a2);
|
|
42565
42584
|
}
|
|
42566
42585
|
createComment(t, n, i) {
|
|
42567
42586
|
let o = this.getProfile(), s, a2;
|
|
42568
|
-
return t.resourceType === "Encounter" && (s =
|
|
42587
|
+
return t.resourceType === "Encounter" && (s = re(t), a2 = t.subject), t.resourceType === "ServiceRequest" && (s = t.encounter, a2 = t.subject), t.resourceType === "Patient" && (a2 = re(t)), this.createResource({ resourceType: "Communication", status: "completed", basedOn: [re(t)], encounter: s, subject: a2, sender: o ? re(o) : void 0, sent: (/* @__PURE__ */ new Date()).toISOString(), payload: [{ contentString: n }] }, i);
|
|
42569
42588
|
}
|
|
42570
42589
|
async updateResource(t, n) {
|
|
42571
42590
|
if (!t.resourceType) throw new Error("Missing resourceType");
|
|
@@ -42598,22 +42617,22 @@ var Lt = class extends H {
|
|
|
42598
42617
|
return this.post(this.fhirBaseUrl, t, void 0, n);
|
|
42599
42618
|
}
|
|
42600
42619
|
sendEmail(t, n) {
|
|
42601
|
-
return this.post("email/v1/send", t,
|
|
42620
|
+
return this.post("email/v1/send", t, A.JSON, n);
|
|
42602
42621
|
}
|
|
42603
42622
|
graphql(t, n, i, o) {
|
|
42604
|
-
return this.post(this.fhirUrl("$graphql"), { query: t, operationName: n, variables: i },
|
|
42623
|
+
return this.post(this.fhirUrl("$graphql"), { query: t, operationName: n, variables: i }, A.JSON, o);
|
|
42605
42624
|
}
|
|
42606
42625
|
readResourceGraph(t, n, i, o) {
|
|
42607
42626
|
return this.get(`${this.fhirUrl(t, n)}/$graph?graph=${i}`, o);
|
|
42608
42627
|
}
|
|
42609
42628
|
pushToAgent(t, n, i, o, s, a2) {
|
|
42610
|
-
return this.post(this.fhirUrl("Agent",
|
|
42629
|
+
return this.post(this.fhirUrl("Agent", fe(t), "$push"), { destination: typeof n == "string" ? n : de(n), body: i, contentType: o, waitForResponse: s }, A.FHIR_JSON, a2);
|
|
42611
42630
|
}
|
|
42612
42631
|
getActiveLogin() {
|
|
42613
42632
|
return this.storage.getObject("activeLogin");
|
|
42614
42633
|
}
|
|
42615
42634
|
async setActiveLogin(t) {
|
|
42616
|
-
(!this.sessionDetails?.profile ||
|
|
42635
|
+
(!this.sessionDetails?.profile || de(this.sessionDetails.profile) !== t.profile?.reference) && this.clearActiveLogin(), this.setAccessToken(t.accessToken, t.refreshToken), this.storage.setObject("activeLogin", t), this.addLogin(t), this.refreshPromise = void 0, await this.refreshProfile();
|
|
42617
42636
|
}
|
|
42618
42637
|
getAccessToken() {
|
|
42619
42638
|
return this.accessToken;
|
|
@@ -42670,13 +42689,13 @@ var Lt = class extends H {
|
|
|
42670
42689
|
async download(t, n = {}) {
|
|
42671
42690
|
this.refreshPromise && await this.refreshPromise;
|
|
42672
42691
|
let i = t.toString();
|
|
42673
|
-
i.startsWith(
|
|
42692
|
+
i.startsWith(da) && (t = this.fhirUrl(i));
|
|
42674
42693
|
let o = n.headers;
|
|
42675
42694
|
return o || (o = {}, n.headers = o), o.Accept || (o.Accept = "*/*"), this.addFetchOptionsDefaults(n), (await this.fetchWithRetry(t.toString(), n)).blob();
|
|
42676
42695
|
}
|
|
42677
42696
|
async createMedia(t, n) {
|
|
42678
42697
|
let { additionalFields: i, ...o } = t, s = await this.createResource({ resourceType: "Media", status: "preparation", content: { contentType: t.contentType }, ...i });
|
|
42679
|
-
o.securityContext || (o.securityContext =
|
|
42698
|
+
o.securityContext || (o.securityContext = re(s));
|
|
42680
42699
|
let a2 = await this.createAttachment(o, n);
|
|
42681
42700
|
return this.updateResource({ ...s, status: "completed", content: a2 });
|
|
42682
42701
|
}
|
|
@@ -42718,14 +42737,14 @@ var Lt = class extends H {
|
|
|
42718
42737
|
if (s.status === 404 && !c) throw new d(cn);
|
|
42719
42738
|
let u2 = await this.parseBody(s, c);
|
|
42720
42739
|
if (s.status === 200 && i.followRedirectOnOk || s.status === 201 && i.followRedirectOnCreated) {
|
|
42721
|
-
let
|
|
42722
|
-
if (
|
|
42740
|
+
let l2 = await ki(s, u2);
|
|
42741
|
+
if (l2) return this.request("GET", l2, { ...i, body: void 0 });
|
|
42723
42742
|
}
|
|
42724
42743
|
if (s.status === 202 && i.pollStatusOnAccepted) {
|
|
42725
42744
|
let m2 = await ki(s, u2) ?? o.statusUrl;
|
|
42726
42745
|
if (m2) return this.pollStatus(m2, i, o);
|
|
42727
42746
|
}
|
|
42728
|
-
if (s.status >= 400) throw new d(
|
|
42747
|
+
if (s.status >= 400) throw new d(et(u2));
|
|
42729
42748
|
return u2;
|
|
42730
42749
|
}
|
|
42731
42750
|
async parseBody(t, n) {
|
|
@@ -42741,7 +42760,7 @@ var Lt = class extends H {
|
|
|
42741
42760
|
}
|
|
42742
42761
|
}
|
|
42743
42762
|
async fetchWithRetry(t, n) {
|
|
42744
|
-
t.startsWith("http") || (t =
|
|
42763
|
+
t.startsWith("http") || (t = q(this.baseUrl, t));
|
|
42745
42764
|
let i = n?.maxRetries ?? 2, o = 200;
|
|
42746
42765
|
for (let s = 0; s <= i; s++) {
|
|
42747
42766
|
try {
|
|
@@ -42758,7 +42777,7 @@ var Lt = class extends H {
|
|
|
42758
42777
|
logRequest(t, n) {
|
|
42759
42778
|
if (console.log(`> ${n.method} ${t}`), n.headers) {
|
|
42760
42779
|
let i = n.headers;
|
|
42761
|
-
for (let o of
|
|
42780
|
+
for (let o of lt(Object.keys(i))) console.log(`> ${o}: ${i[o]}`);
|
|
42762
42781
|
}
|
|
42763
42782
|
}
|
|
42764
42783
|
logResponse(t) {
|
|
@@ -42779,9 +42798,9 @@ var Lt = class extends H {
|
|
|
42779
42798
|
if (this.autoBatchQueue.length = 0, this.autoBatchTimerId = void 0, t.length === 1) {
|
|
42780
42799
|
let o = t[0];
|
|
42781
42800
|
try {
|
|
42782
|
-
o.resolve(await this.request(o.method,
|
|
42801
|
+
o.resolve(await this.request(o.method, q(this.fhirBaseUrl, o.url), o.options));
|
|
42783
42802
|
} catch (s) {
|
|
42784
|
-
o.reject(new d(
|
|
42803
|
+
o.reject(new d(et(s)));
|
|
42785
42804
|
}
|
|
42786
42805
|
return;
|
|
42787
42806
|
}
|
|
@@ -42794,7 +42813,7 @@ var Lt = class extends H {
|
|
|
42794
42813
|
addFetchOptionsDefaults(t) {
|
|
42795
42814
|
Object.entries(this.defaultHeaders).forEach(([n, i]) => {
|
|
42796
42815
|
this.setRequestHeader(t, n, i);
|
|
42797
|
-
}), this.setRequestHeader(t, "Accept",
|
|
42816
|
+
}), this.setRequestHeader(t, "Accept", sa, true), this.options.extendedMode !== false && this.setRequestHeader(t, "X-Medplum", "extended"), t.body && this.setRequestHeader(t, "Content-Type", A.FHIR_JSON, true), this.accessToken ? this.setRequestHeader(t, "Authorization", "Bearer " + this.accessToken) : this.basicAuth && this.setRequestHeader(t, "Authorization", "Basic " + this.basicAuth), t.cache || (t.cache = "no-cache"), t.credentials || (t.credentials = "include");
|
|
42798
42817
|
}
|
|
42799
42818
|
setRequestContentType(t, n) {
|
|
42800
42819
|
this.setRequestHeader(t, "Content-Type", n);
|
|
@@ -42808,14 +42827,14 @@ var Lt = class extends H {
|
|
|
42808
42827
|
typeof n == "string" || typeof Blob < "u" && (n instanceof Blob || n?.constructor.name === "Blob") || typeof File < "u" && (n instanceof File || n?.constructor.name === "File") || typeof Uint8Array < "u" && (n instanceof Uint8Array || n?.constructor.name === "Uint8Array") ? t.body = n : n && (t.body = JSON.stringify(n));
|
|
42809
42828
|
}
|
|
42810
42829
|
handleUnauthenticated(t, n, i) {
|
|
42811
|
-
return this.refresh() ? this.request(t, n, i) : (this.clear(), this.onUnauthenticated && this.onUnauthenticated(), Promise.reject(new d(
|
|
42830
|
+
return this.refresh() ? this.request(t, n, i) : (this.clear(), this.onUnauthenticated && this.onUnauthenticated(), Promise.reject(new d(be)));
|
|
42812
42831
|
}
|
|
42813
42832
|
async startPkce() {
|
|
42814
42833
|
let t = Nr();
|
|
42815
42834
|
sessionStorage.setItem("pkceState", t);
|
|
42816
42835
|
let n = Nr().slice(0, 128);
|
|
42817
42836
|
sessionStorage.setItem("codeVerifier", n);
|
|
42818
|
-
let i = await yi(n), o =
|
|
42837
|
+
let i = await yi(n), o = Gn(i).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
|
|
42819
42838
|
return sessionStorage.setItem("codeChallenge", o), { codeChallengeMethod: "S256", codeChallenge: o };
|
|
42820
42839
|
}
|
|
42821
42840
|
async requestAuthorization(t) {
|
|
@@ -42861,20 +42880,20 @@ var Lt = class extends H {
|
|
|
42861
42880
|
async fhircastSubscribe(t, n) {
|
|
42862
42881
|
if (!(typeof t == "string" && t !== "")) throw new d(h("Invalid topic provided. Topic must be a valid string."));
|
|
42863
42882
|
if (!(typeof n == "object" && Array.isArray(n) && n.length > 0)) throw new d(h("Invalid events provided. Events must be an array of event names containing at least one event."));
|
|
42864
|
-
let i = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post(this.fhircastHubUrl, Br(i),
|
|
42883
|
+
let i = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post(this.fhircastHubUrl, Br(i), A.FORM_URL_ENCODED))["hub.channel.endpoint"];
|
|
42865
42884
|
if (!s) throw new Error("Invalid response!");
|
|
42866
42885
|
return i.endpoint = s, i;
|
|
42867
42886
|
}
|
|
42868
42887
|
async fhircastUnsubscribe(t) {
|
|
42869
42888
|
if (!kt(t)) throw new d(h("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));
|
|
42870
42889
|
if (!(t.endpoint && typeof t.endpoint == "string" && t.endpoint.startsWith("ws"))) throw new d(h("Provided subscription request must have an endpoint in order to unsubscribe."));
|
|
42871
|
-
t.mode = "unsubscribe", await this.post(this.fhircastHubUrl, Br(t),
|
|
42890
|
+
t.mode = "unsubscribe", await this.post(this.fhircastHubUrl, Br(t), A.FORM_URL_ENCODED);
|
|
42872
42891
|
}
|
|
42873
42892
|
fhircastConnect(t) {
|
|
42874
42893
|
return new It(t);
|
|
42875
42894
|
}
|
|
42876
42895
|
async fhircastPublish(t, n, i, o) {
|
|
42877
|
-
return vi(n) ? this.post(this.fhircastHubUrl, qr(t, n, i, o),
|
|
42896
|
+
return vi(n) ? this.post(this.fhircastHubUrl, qr(t, n, i, o), A.JSON) : (Ti(n), this.post(this.fhircastHubUrl, qr(t, n, i), A.JSON));
|
|
42878
42897
|
}
|
|
42879
42898
|
async fhircastGetContext(t) {
|
|
42880
42899
|
return this.get(`${this.fhircastHubUrl}/${t}`);
|
|
@@ -42883,7 +42902,7 @@ var Lt = class extends H {
|
|
|
42883
42902
|
return this.post("admin/projects/" + t + "/invite", n);
|
|
42884
42903
|
}
|
|
42885
42904
|
async fetchTokens(t) {
|
|
42886
|
-
let n = { method: "POST", headers: { "Content-Type":
|
|
42905
|
+
let n = { method: "POST", headers: { "Content-Type": A.FORM_URL_ENCODED }, body: t.toString(), credentials: "include" }, i = n.headers;
|
|
42887
42906
|
Object.assign(i, this.defaultHeaders), this.basicAuth && (i.Authorization = `Basic ${this.basicAuth}`);
|
|
42888
42907
|
let o;
|
|
42889
42908
|
try {
|
|
@@ -42930,7 +42949,7 @@ var Lt = class extends H {
|
|
|
42930
42949
|
}
|
|
42931
42950
|
}
|
|
42932
42951
|
getSubscriptionManager() {
|
|
42933
|
-
return this.subscriptionManager || (this.subscriptionManager = new Nt(this,
|
|
42952
|
+
return this.subscriptionManager || (this.subscriptionManager = new Nt(this, Jn(this.baseUrl, "/ws/subscriptions-r4"))), this.subscriptionManager;
|
|
42934
42953
|
}
|
|
42935
42954
|
subscribeToCriteria(t, n) {
|
|
42936
42955
|
return this.getSubscriptionManager().addCriteria(t, n);
|
|
@@ -42942,7 +42961,7 @@ var Lt = class extends H {
|
|
|
42942
42961
|
return this.getSubscriptionManager().getMasterEmitter();
|
|
42943
42962
|
}
|
|
42944
42963
|
};
|
|
42945
|
-
function
|
|
42964
|
+
function ga() {
|
|
42946
42965
|
if (!globalThis.fetch) throw new Error("Fetch not available in this environment");
|
|
42947
42966
|
return globalThis.fetch.bind(globalThis);
|
|
42948
42967
|
}
|
|
@@ -42954,30 +42973,30 @@ async function ki(r7, e) {
|
|
|
42954
42973
|
if (t) return t;
|
|
42955
42974
|
let n = r7.headers.get("location");
|
|
42956
42975
|
if (n) return n;
|
|
42957
|
-
if (
|
|
42976
|
+
if (Re(e) && e.issue?.[0]?.diagnostics) return e.issue[0].diagnostics;
|
|
42958
42977
|
}
|
|
42959
42978
|
function Vi(r7) {
|
|
42960
42979
|
let e = r7.entry?.map((t) => t.resource) ?? [];
|
|
42961
42980
|
return Object.assign(e, { bundle: r7 });
|
|
42962
42981
|
}
|
|
42963
|
-
function
|
|
42982
|
+
function xa(r7) {
|
|
42964
42983
|
return R(r7) && "data" in r7 && "contentType" in r7;
|
|
42965
42984
|
}
|
|
42966
42985
|
function Di(r7, e, t, n) {
|
|
42967
|
-
return
|
|
42986
|
+
return xa(r7) ? r7 : { data: r7, filename: e, contentType: t, onProgress: n };
|
|
42968
42987
|
}
|
|
42969
|
-
function
|
|
42988
|
+
function va(r7) {
|
|
42970
42989
|
return R(r7) && "docDefinition" in r7;
|
|
42971
42990
|
}
|
|
42972
|
-
function
|
|
42973
|
-
return
|
|
42991
|
+
function Ta(r7, e, t, n) {
|
|
42992
|
+
return va(r7) ? r7 : { docDefinition: r7, filename: e, tableLayouts: t, fonts: n };
|
|
42974
42993
|
}
|
|
42975
|
-
var
|
|
42976
|
-
var
|
|
42977
|
-
var
|
|
42978
|
-
var
|
|
42979
|
-
var
|
|
42980
|
-
var
|
|
42994
|
+
var Va = [...We, "->", "<<", ">>", "=="];
|
|
42995
|
+
var _a = $e().registerInfix("->", { precedence: y.Arrow }).registerInfix(";", { precedence: y.Semicolon });
|
|
42996
|
+
var Xa = " ".repeat(2);
|
|
42997
|
+
var tc = [...We, "eq", "ne", "co"];
|
|
42998
|
+
var ic = $e();
|
|
42999
|
+
var ce = class {
|
|
42981
43000
|
constructor(e = "\r", t = "|", n = "^", i = "~", o = "\\", s = "&") {
|
|
42982
43001
|
this.segmentSeparator = e;
|
|
42983
43002
|
this.fieldSeparator = t;
|
|
@@ -42994,7 +43013,7 @@ var ae = class {
|
|
|
42994
43013
|
}
|
|
42995
43014
|
};
|
|
42996
43015
|
var Yi = class r2 {
|
|
42997
|
-
constructor(e, t = new
|
|
43016
|
+
constructor(e, t = new ce()) {
|
|
42998
43017
|
this.context = t, this.segments = e;
|
|
42999
43018
|
}
|
|
43000
43019
|
get header() {
|
|
@@ -43017,7 +43036,7 @@ var Yi = class r2 {
|
|
|
43017
43036
|
}
|
|
43018
43037
|
buildAck() {
|
|
43019
43038
|
let e = /* @__PURE__ */ new Date(), t = this.getSegment("MSH"), n = t?.getField(3)?.toString() ?? "", i = t?.getField(4)?.toString() ?? "", o = t?.getField(5)?.toString() ?? "", s = t?.getField(6)?.toString() ?? "", a2 = t?.getField(10)?.toString() ?? "", c = t?.getField(12)?.toString() ?? "2.5.1";
|
|
43020
|
-
return new r2([new
|
|
43039
|
+
return new r2([new ze(["MSH", this.context.getMsh2(), o, s, n, i, sc(e), "", this.buildAckMessageType(t), e.getTime().toString(), "P", c], this.context), new ze(["MSA", "AA", a2, "OK"], this.context)]);
|
|
43021
43040
|
}
|
|
43022
43041
|
buildAckMessageType(e) {
|
|
43023
43042
|
let t = e?.getField(9), n = t?.getComponent(2), i = t?.getComponent(3), o = "ACK";
|
|
@@ -43028,21 +43047,21 @@ var Yi = class r2 {
|
|
|
43028
43047
|
let n = new Error("Invalid HL7 message");
|
|
43029
43048
|
throw n.type = "entity.parse.failed", n;
|
|
43030
43049
|
}
|
|
43031
|
-
let t = new
|
|
43032
|
-
return new r2(e.split(/[\r\n]+/).map((n) =>
|
|
43050
|
+
let t = new ce("\r", e.charAt(3), e.charAt(4), e.charAt(5), e.charAt(6), e.charAt(7));
|
|
43051
|
+
return new r2(e.split(/[\r\n]+/).map((n) => ze.parse(n, t)), t);
|
|
43033
43052
|
}
|
|
43034
43053
|
};
|
|
43035
|
-
var
|
|
43036
|
-
constructor(e, t = new
|
|
43037
|
-
this.context = t,
|
|
43054
|
+
var ze = class r3 {
|
|
43055
|
+
constructor(e, t = new ce()) {
|
|
43056
|
+
this.context = t, jn(e) ? this.fields = e.map((n) => Ne.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
|
|
43038
43057
|
}
|
|
43039
43058
|
get(e) {
|
|
43040
43059
|
return this.fields[e];
|
|
43041
43060
|
}
|
|
43042
43061
|
getField(e) {
|
|
43043
43062
|
if (this.name === "MSH") {
|
|
43044
|
-
if (e === 1) return new
|
|
43045
|
-
if (e === 2) return new
|
|
43063
|
+
if (e === 1) return new Ne([[this.context.getMsh1()]], this.context);
|
|
43064
|
+
if (e === 2) return new Ne([[this.context.getMsh2()]], this.context);
|
|
43046
43065
|
if (e > 2) return this.fields[e - 1];
|
|
43047
43066
|
}
|
|
43048
43067
|
return this.fields[e];
|
|
@@ -43053,12 +43072,12 @@ var Je = class r3 {
|
|
|
43053
43072
|
toString() {
|
|
43054
43073
|
return this.fields.map((e) => e.toString()).join(this.context.fieldSeparator);
|
|
43055
43074
|
}
|
|
43056
|
-
static parse(e, t = new
|
|
43057
|
-
return new r3(e.split(t.fieldSeparator).map((n) =>
|
|
43075
|
+
static parse(e, t = new ce()) {
|
|
43076
|
+
return new r3(e.split(t.fieldSeparator).map((n) => Ne.parse(n, t)), t);
|
|
43058
43077
|
}
|
|
43059
43078
|
};
|
|
43060
|
-
var
|
|
43061
|
-
constructor(e, t = new
|
|
43079
|
+
var Ne = class r4 {
|
|
43080
|
+
constructor(e, t = new ce()) {
|
|
43062
43081
|
this.context = t, this.components = e;
|
|
43063
43082
|
}
|
|
43064
43083
|
get(e, t, n = 0) {
|
|
@@ -43071,11 +43090,11 @@ var _e = class r4 {
|
|
|
43071
43090
|
toString() {
|
|
43072
43091
|
return this.components.map((e) => e.join(this.context.componentSeparator)).join(this.context.repetitionSeparator);
|
|
43073
43092
|
}
|
|
43074
|
-
static parse(e, t = new
|
|
43093
|
+
static parse(e, t = new ce()) {
|
|
43075
43094
|
return new r4(e.split(t.repetitionSeparator).map((n) => n.split(t.componentSeparator)), t);
|
|
43076
43095
|
}
|
|
43077
43096
|
};
|
|
43078
|
-
function
|
|
43097
|
+
function sc(r7) {
|
|
43079
43098
|
let e = r7 instanceof Date ? r7 : new Date(r7), n = e.toISOString().replace(/[-:T]/g, "").replace(/(\.\d+)?Z$/, ""), i = e.getUTCMilliseconds();
|
|
43080
43099
|
return i > 0 && (n += "." + i.toString()), n;
|
|
43081
43100
|
}
|
|
@@ -43113,14 +43132,14 @@ var Zi = class r5 {
|
|
|
43113
43132
|
`) }), this.write(JSON.stringify({ level: Yr[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: this.prefix ? `${this.prefix}${t}` : t, ...n, ...this.metadata })));
|
|
43114
43133
|
}
|
|
43115
43134
|
};
|
|
43116
|
-
function
|
|
43135
|
+
function Tm(r7) {
|
|
43117
43136
|
let e = Yr[r7.toUpperCase()];
|
|
43118
43137
|
if (e === void 0) throw new Error(`Invalid log level: ${r7}`);
|
|
43119
43138
|
return e;
|
|
43120
43139
|
}
|
|
43121
|
-
var
|
|
43140
|
+
var fc = "https://meta.medplum.com/releases";
|
|
43122
43141
|
var Kt = /* @__PURE__ */ new Map();
|
|
43123
|
-
function
|
|
43142
|
+
function mc(r7) {
|
|
43124
43143
|
let e = r7;
|
|
43125
43144
|
if (!e.tag_name) throw new Error("Manifest missing tag_name");
|
|
43126
43145
|
let t = e.assets;
|
|
@@ -43133,7 +43152,7 @@ function fc(r7) {
|
|
|
43133
43152
|
async function Xr(r7, e, t) {
|
|
43134
43153
|
let n = Kt.get(e ?? "latest");
|
|
43135
43154
|
if (!n) {
|
|
43136
|
-
let i = e ? `v${e}` : "latest", o = new URL(`${
|
|
43155
|
+
let i = e ? `v${e}` : "latest", o = new URL(`${fc}/${i}.json`);
|
|
43137
43156
|
if (o.searchParams.set("a", r7), o.searchParams.set("c", $r), t) for (let [c, u2] of Object.entries(t)) o.searchParams.set(c, u2);
|
|
43138
43157
|
let s = await fetch(o.toString());
|
|
43139
43158
|
if (s.status !== 200) {
|
|
@@ -43141,20 +43160,20 @@ async function Xr(r7, e, t) {
|
|
|
43141
43160
|
try {
|
|
43142
43161
|
c = (await s.json()).message;
|
|
43143
43162
|
} catch (u2) {
|
|
43144
|
-
console.error(`Failed to parse message from body: ${
|
|
43163
|
+
console.error(`Failed to parse message from body: ${Ce(u2)}`);
|
|
43145
43164
|
}
|
|
43146
43165
|
throw new Error(`Received status code ${s.status} while fetching manifest for version '${e ?? "latest"}'. Message: ${c}`);
|
|
43147
43166
|
}
|
|
43148
43167
|
let a2 = await s.json();
|
|
43149
|
-
|
|
43168
|
+
mc(a2), n = a2, Kt.set(e ?? "latest", n), e || Kt.set(n.tag_name.slice(1), n);
|
|
43150
43169
|
}
|
|
43151
43170
|
return n;
|
|
43152
43171
|
}
|
|
43153
|
-
function
|
|
43172
|
+
function hc(r7) {
|
|
43154
43173
|
return /^\d+\.\d+\.\d+$/.test(r7);
|
|
43155
43174
|
}
|
|
43156
|
-
async function
|
|
43157
|
-
if (!
|
|
43175
|
+
async function _m(r7, e) {
|
|
43176
|
+
if (!hc(e)) return false;
|
|
43158
43177
|
try {
|
|
43159
43178
|
await Xr(r7, e);
|
|
43160
43179
|
} catch {
|
|
@@ -43162,7 +43181,7 @@ async function Mm(r7, e) {
|
|
|
43162
43181
|
}
|
|
43163
43182
|
return true;
|
|
43164
43183
|
}
|
|
43165
|
-
async function
|
|
43184
|
+
async function Nm(r7) {
|
|
43166
43185
|
let e = await Xr(r7);
|
|
43167
43186
|
if (!e.tag_name.startsWith("v")) throw new Error(`Invalid release name found. Release tag '${e.tag_name}' did not start with 'v'`);
|
|
43168
43187
|
return e.tag_name.slice(1);
|
|
@@ -43196,12 +43215,12 @@ var r6 = class extends Event {
|
|
|
43196
43215
|
this.error = e;
|
|
43197
43216
|
}
|
|
43198
43217
|
};
|
|
43199
|
-
var
|
|
43218
|
+
var l = class extends Event {
|
|
43200
43219
|
constructor() {
|
|
43201
43220
|
super("close");
|
|
43202
43221
|
}
|
|
43203
43222
|
};
|
|
43204
|
-
var
|
|
43223
|
+
var p2 = class extends a {
|
|
43205
43224
|
constructor(e, n = "utf-8") {
|
|
43206
43225
|
super();
|
|
43207
43226
|
this.socket = e;
|
|
@@ -43245,7 +43264,7 @@ var p = class extends a {
|
|
|
43245
43264
|
});
|
|
43246
43265
|
}
|
|
43247
43266
|
close() {
|
|
43248
|
-
this.socket.end(), this.socket.destroy(), this.dispatchEvent(new
|
|
43267
|
+
this.socket.end(), this.socket.destroy(), this.dispatchEvent(new l());
|
|
43249
43268
|
}
|
|
43250
43269
|
appendData(e) {
|
|
43251
43270
|
this.chunks.push(e);
|
|
@@ -43262,7 +43281,7 @@ var m = class extends a {
|
|
|
43262
43281
|
return this.connection ? Promise.resolve(this.connection) : new Promise((t, e) => {
|
|
43263
43282
|
let n = (0, import_node_net.connect)({ host: this.host, port: this.port, keepAlive: this.keepAlive }, () => {
|
|
43264
43283
|
let s;
|
|
43265
|
-
this.connection = s = new
|
|
43284
|
+
this.connection = s = new p2(n, this.encoding), n.off("error", e), s.addEventListener("close", () => this.dispatchEvent(new l())), s.addEventListener("error", (o) => this.dispatchEvent(new r6(o.error))), t(this.connection);
|
|
43266
43285
|
});
|
|
43267
43286
|
n.on("error", e);
|
|
43268
43287
|
});
|
|
@@ -43283,7 +43302,7 @@ var u = class {
|
|
|
43283
43302
|
}
|
|
43284
43303
|
start(t, e) {
|
|
43285
43304
|
let n = import_node_net2.default.createServer((s) => {
|
|
43286
|
-
let o = new
|
|
43305
|
+
let o = new p2(s, e);
|
|
43287
43306
|
this.handler(o);
|
|
43288
43307
|
});
|
|
43289
43308
|
n.listen(t), this.server = n;
|
|
@@ -43451,20 +43470,20 @@ var AgentDicomChannel = class extends BaseChannel {
|
|
|
43451
43470
|
calledAeTitle: this.association?.getCalledAeTitle()
|
|
43452
43471
|
},
|
|
43453
43472
|
dataset: dicomJson,
|
|
43454
|
-
binary: binary ?
|
|
43473
|
+
binary: binary ? re(binary) : void 0
|
|
43455
43474
|
};
|
|
43456
43475
|
App.instance.addToWebSocketQueue({
|
|
43457
43476
|
type: "agent:transmit:request",
|
|
43458
43477
|
accessToken: "placeholder",
|
|
43459
43478
|
channel: DcmjsDimseScp.channel.getDefinition().name,
|
|
43460
43479
|
remote: this.association?.getCallingAeTitle(),
|
|
43461
|
-
contentType:
|
|
43480
|
+
contentType: A.JSON,
|
|
43462
43481
|
body: JSON.stringify(payload),
|
|
43463
43482
|
callback: `Agent/${App.instance.agentId}-${(0, import_node_crypto.randomUUID)()}`
|
|
43464
43483
|
});
|
|
43465
43484
|
response.setStatus(dimse.constants.Status.Success);
|
|
43466
43485
|
} catch (err) {
|
|
43467
|
-
DcmjsDimseScp.channel.log.error(`DICOM error: ${
|
|
43486
|
+
DcmjsDimseScp.channel.log.error(`DICOM error: ${Ce(err)}`);
|
|
43468
43487
|
response.setStatus(dimse.constants.Status.ProcessingFailure);
|
|
43469
43488
|
}
|
|
43470
43489
|
return response;
|
|
@@ -43564,12 +43583,12 @@ var AgentHl7ChannelConnection = class {
|
|
|
43564
43583
|
accessToken: "placeholder",
|
|
43565
43584
|
channel: this.channel.getDefinition().name,
|
|
43566
43585
|
remote: this.remote,
|
|
43567
|
-
contentType:
|
|
43586
|
+
contentType: A.HL7_V2,
|
|
43568
43587
|
body: event.message.toString(),
|
|
43569
43588
|
callback: `Agent/${this.channel.app.agentId}-${(0, import_node_crypto2.randomUUID)()}`
|
|
43570
43589
|
});
|
|
43571
43590
|
} catch (err) {
|
|
43572
|
-
this.channel.log.error(`HL7 error: ${
|
|
43591
|
+
this.channel.log.error(`HL7 error: ${Ce(err)}`);
|
|
43573
43592
|
}
|
|
43574
43593
|
}
|
|
43575
43594
|
close() {
|
|
@@ -43793,7 +43812,7 @@ var App = class _App {
|
|
|
43793
43812
|
case "agent:transmit:request":
|
|
43794
43813
|
if (this.config?.status !== "active") {
|
|
43795
43814
|
this.sendAgentDisabledError(command);
|
|
43796
|
-
} else if (command.contentType ===
|
|
43815
|
+
} else if (command.contentType === A.PING) {
|
|
43797
43816
|
await this.tryPingHost(command);
|
|
43798
43817
|
} else {
|
|
43799
43818
|
this.pushMessage(command);
|
|
@@ -43811,7 +43830,7 @@ var App = class _App {
|
|
|
43811
43830
|
} catch (err) {
|
|
43812
43831
|
await this.sendToWebSocket({
|
|
43813
43832
|
type: "agent:error",
|
|
43814
|
-
body:
|
|
43833
|
+
body: Ce(err),
|
|
43815
43834
|
callback: command.callback
|
|
43816
43835
|
});
|
|
43817
43836
|
}
|
|
@@ -43826,7 +43845,7 @@ var App = class _App {
|
|
|
43826
43845
|
this.log.error(`Unknown message type: ${command.type}`);
|
|
43827
43846
|
}
|
|
43828
43847
|
} catch (err) {
|
|
43829
|
-
this.log.error(`WebSocket error on incoming message: ${
|
|
43848
|
+
this.log.error(`WebSocket error on incoming message: ${Ce(err)}`);
|
|
43830
43849
|
}
|
|
43831
43850
|
});
|
|
43832
43851
|
return new Promise((resolve2, reject) => {
|
|
@@ -43901,7 +43920,7 @@ var App = class _App {
|
|
|
43901
43920
|
try {
|
|
43902
43921
|
await this.startOrReloadChannel(definition, endpoint);
|
|
43903
43922
|
} catch (err) {
|
|
43904
|
-
this.log.error(
|
|
43923
|
+
this.log.error(Ce(err));
|
|
43905
43924
|
}
|
|
43906
43925
|
}
|
|
43907
43926
|
}
|
|
@@ -43927,7 +43946,7 @@ var App = class _App {
|
|
|
43927
43946
|
parsedEndpoint = new URL(endpoint.address);
|
|
43928
43947
|
} catch (err) {
|
|
43929
43948
|
throw new Error(
|
|
43930
|
-
`Error while validating endpoint address for channel '${channel.name}': ${
|
|
43949
|
+
`Error while validating endpoint address for channel '${channel.name}': ${Ce(err)}`
|
|
43931
43950
|
);
|
|
43932
43951
|
}
|
|
43933
43952
|
if (seenPorts.has(parsedEndpoint.port)) {
|
|
@@ -44006,7 +44025,7 @@ var App = class _App {
|
|
|
44006
44025
|
try {
|
|
44007
44026
|
await this.sendToWebSocket(msg);
|
|
44008
44027
|
} catch (err) {
|
|
44009
|
-
this.log.error(`WebSocket error while attempting to send message: ${
|
|
44028
|
+
this.log.error(`WebSocket error while attempting to send message: ${Ce(err)}`);
|
|
44010
44029
|
this.webSocketQueue.unshift(msg);
|
|
44011
44030
|
throw err;
|
|
44012
44031
|
}
|
|
@@ -44043,7 +44062,7 @@ IPv6 is currently unsupported.`;
|
|
|
44043
44062
|
this.log.error(errMsg);
|
|
44044
44063
|
throw new Error(errMsg);
|
|
44045
44064
|
}
|
|
44046
|
-
if (!((0, import_node_net3.isIPv4)(message.remote) ||
|
|
44065
|
+
if (!((0, import_node_net3.isIPv4)(message.remote) || ll(message.remote))) {
|
|
44047
44066
|
const errMsg = `Attempted to ping an invalid host.
|
|
44048
44067
|
|
|
44049
44068
|
"${message.remote}" is not a valid IPv4 address or a resolvable hostname.`;
|
|
@@ -44075,22 +44094,22 @@ ${result}`);
|
|
|
44075
44094
|
this.addToWebSocketQueue({
|
|
44076
44095
|
type: "agent:transmit:response",
|
|
44077
44096
|
channel: message.channel,
|
|
44078
|
-
contentType:
|
|
44097
|
+
contentType: A.PING,
|
|
44079
44098
|
remote: message.remote,
|
|
44080
44099
|
callback: message.callback,
|
|
44081
44100
|
statusCode: 200,
|
|
44082
44101
|
body: result
|
|
44083
44102
|
});
|
|
44084
44103
|
} catch (err) {
|
|
44085
|
-
this.log.error(`Error during ping attempt to ${message.remote ?? "NO_HOST_GIVEN"}: ${
|
|
44104
|
+
this.log.error(`Error during ping attempt to ${message.remote ?? "NO_HOST_GIVEN"}: ${Ce(err)}`);
|
|
44086
44105
|
this.addToWebSocketQueue({
|
|
44087
44106
|
type: "agent:transmit:response",
|
|
44088
44107
|
channel: message.channel,
|
|
44089
|
-
contentType:
|
|
44108
|
+
contentType: A.TEXT,
|
|
44090
44109
|
remote: message.remote,
|
|
44091
44110
|
callback: message.callback,
|
|
44092
44111
|
statusCode: 400,
|
|
44093
|
-
body:
|
|
44112
|
+
body: Ce(err)
|
|
44094
44113
|
});
|
|
44095
44114
|
}
|
|
44096
44115
|
}
|
|
@@ -44106,7 +44125,7 @@ ${result}`);
|
|
|
44106
44125
|
return;
|
|
44107
44126
|
}
|
|
44108
44127
|
let child;
|
|
44109
|
-
if (message.version && !await
|
|
44128
|
+
if (message.version && !await _m("agent-upgrader", message.version)) {
|
|
44110
44129
|
const versionTag = message.version ? `v${message.version}` : "latest";
|
|
44111
44130
|
const errMsg = `Error during upgrading to version '${versionTag}'. '${message.version}' is not a valid version`;
|
|
44112
44131
|
this.log.error(errMsg);
|
|
@@ -44137,11 +44156,11 @@ ${result}`);
|
|
|
44137
44156
|
});
|
|
44138
44157
|
});
|
|
44139
44158
|
child.on("error", (err) => {
|
|
44140
|
-
this.log.error(
|
|
44159
|
+
this.log.error(Ce(err));
|
|
44141
44160
|
});
|
|
44142
44161
|
} catch (err) {
|
|
44143
44162
|
const versionTag = message.version ? `v${message.version}` : "latest";
|
|
44144
|
-
const errMsg = `Error during upgrading to version '${versionTag}': ${
|
|
44163
|
+
const errMsg = `Error during upgrading to version '${versionTag}': ${Ce(err)}`;
|
|
44145
44164
|
this.log.error(errMsg);
|
|
44146
44165
|
await this.sendToWebSocket({
|
|
44147
44166
|
type: "agent:error",
|
|
@@ -44153,7 +44172,7 @@ ${result}`);
|
|
|
44153
44172
|
try {
|
|
44154
44173
|
await this.stop();
|
|
44155
44174
|
this.log.info("Successfully stopped agent network services");
|
|
44156
|
-
const targetVersion = message.version ?? await
|
|
44175
|
+
const targetVersion = message.version ?? await Nm("agent-upgrader");
|
|
44157
44176
|
this.log.info("Writing upgrade manifest...", { previousVersion: $r, targetVersion });
|
|
44158
44177
|
(0, import_node_fs3.writeFileSync)(
|
|
44159
44178
|
UPGRADE_MANIFEST_PATH,
|
|
@@ -44168,7 +44187,7 @@ ${result}`);
|
|
|
44168
44187
|
child.disconnect();
|
|
44169
44188
|
} catch (err) {
|
|
44170
44189
|
this.log.error(
|
|
44171
|
-
`Error while stopping agent or messaging child process as part of upgrade: ${
|
|
44190
|
+
`Error while stopping agent or messaging child process as part of upgrade: ${Ce(err)}`
|
|
44172
44191
|
);
|
|
44173
44192
|
import_node_process.default.exit(1);
|
|
44174
44193
|
}
|
|
@@ -44233,20 +44252,20 @@ ${result}`);
|
|
|
44233
44252
|
channel: message.channel,
|
|
44234
44253
|
remote: message.remote,
|
|
44235
44254
|
callback: message.callback,
|
|
44236
|
-
contentType:
|
|
44255
|
+
contentType: A.HL7_V2,
|
|
44237
44256
|
statusCode: 200,
|
|
44238
44257
|
body: response.toString()
|
|
44239
44258
|
});
|
|
44240
44259
|
}).catch((err) => {
|
|
44241
|
-
this.log.error(`HL7 error: ${
|
|
44260
|
+
this.log.error(`HL7 error: ${Ce(err)}`);
|
|
44242
44261
|
this.addToWebSocketQueue({
|
|
44243
44262
|
type: "agent:transmit:response",
|
|
44244
44263
|
channel: message.channel,
|
|
44245
44264
|
remote: message.remote,
|
|
44246
44265
|
callback: message.callback,
|
|
44247
|
-
contentType:
|
|
44266
|
+
contentType: A.TEXT,
|
|
44248
44267
|
statusCode: 400,
|
|
44249
|
-
body:
|
|
44268
|
+
body: Ce(err)
|
|
44250
44269
|
});
|
|
44251
44270
|
if (client.keepAlive) {
|
|
44252
44271
|
this.hl7Clients.delete(message.remote);
|
|
@@ -44295,7 +44314,7 @@ async function agentMain(argv) {
|
|
|
44295
44314
|
const { baseUrl, clientId, clientSecret, agentId } = args;
|
|
44296
44315
|
const medplum = new Lt({ baseUrl, clientId });
|
|
44297
44316
|
await medplum.startClientLogin(clientId, clientSecret);
|
|
44298
|
-
const app = new App(medplum, agentId,
|
|
44317
|
+
const app = new App(medplum, agentId, Tm(args.logLevel ?? "INFO"));
|
|
44299
44318
|
await app.start();
|
|
44300
44319
|
process.on("SIGINT", async () => {
|
|
44301
44320
|
console.log("Gracefully shutting down from SIGINT (Ctrl-C)");
|
|
@@ -44336,10 +44355,10 @@ async function upgraderMain(argv) {
|
|
|
44336
44355
|
});
|
|
44337
44356
|
});
|
|
44338
44357
|
import_node_process2.default.send({ type: "STARTED" });
|
|
44339
|
-
if (argv[3] && !
|
|
44358
|
+
if (argv[3] && !hc(argv[3])) {
|
|
44340
44359
|
throw new Error("Invalid version specified");
|
|
44341
44360
|
}
|
|
44342
|
-
const version = argv[3] ?? await
|
|
44361
|
+
const version = argv[3] ?? await Nm("agent-upgrader");
|
|
44343
44362
|
const binPath = getReleaseBinPath(version);
|
|
44344
44363
|
if (!(0, import_node_fs5.existsSync)(binPath)) {
|
|
44345
44364
|
globalLogger.info(`Could not find binary at "${binPath}". Downloading release from GitHub...`);
|
|
@@ -44362,7 +44381,7 @@ async function upgraderMain(argv) {
|
|
|
44362
44381
|
(0, import_node_child_process2.spawnSync)(binPath, ["/S"]);
|
|
44363
44382
|
globalLogger.info(`Agent version ${version} successfully installed`);
|
|
44364
44383
|
} catch (err) {
|
|
44365
|
-
globalLogger.error(`Error while attempting to run installer: ${
|
|
44384
|
+
globalLogger.error(`Error while attempting to run installer: ${Ce(err)}`);
|
|
44366
44385
|
globalLogger.error("Failed to run installer, attempting to restart agent service...");
|
|
44367
44386
|
try {
|
|
44368
44387
|
(0, import_node_child_process2.execSync)('net start "Medplum Agent"');
|