@medplum/agent 3.2.31 → 3.2.33
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 +908 -902
- package/package.json +5 -5
package/dist/cjs/index.cjs
CHANGED
|
@@ -476,7 +476,7 @@ var require_utf32 = __commonJS({
|
|
|
476
476
|
return this.decoder.end();
|
|
477
477
|
};
|
|
478
478
|
function detectEncoding(bufs, defaultEncoding) {
|
|
479
|
-
var
|
|
479
|
+
var b3 = [];
|
|
480
480
|
var charsProcessed = 0;
|
|
481
481
|
var invalidLE = 0, invalidBE = 0;
|
|
482
482
|
var bmpCharsLE = 0, bmpCharsBE = 0;
|
|
@@ -484,21 +484,21 @@ var require_utf32 = __commonJS({
|
|
|
484
484
|
for (var i = 0; i < bufs.length; i++) {
|
|
485
485
|
var buf = bufs[i];
|
|
486
486
|
for (var j2 = 0; j2 < buf.length; j2++) {
|
|
487
|
-
|
|
488
|
-
if (
|
|
487
|
+
b3.push(buf[j2]);
|
|
488
|
+
if (b3.length === 4) {
|
|
489
489
|
if (charsProcessed === 0) {
|
|
490
|
-
if (
|
|
490
|
+
if (b3[0] === 255 && b3[1] === 254 && b3[2] === 0 && b3[3] === 0) {
|
|
491
491
|
return "utf-32le";
|
|
492
492
|
}
|
|
493
|
-
if (
|
|
493
|
+
if (b3[0] === 0 && b3[1] === 0 && b3[2] === 254 && b3[3] === 255) {
|
|
494
494
|
return "utf-32be";
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
if (
|
|
498
|
-
if (
|
|
499
|
-
if (
|
|
500
|
-
if ((
|
|
501
|
-
|
|
497
|
+
if (b3[0] !== 0 || b3[1] > 16) invalidBE++;
|
|
498
|
+
if (b3[3] !== 0 || b3[2] > 16) invalidLE++;
|
|
499
|
+
if (b3[0] === 0 && b3[1] === 0 && (b3[2] !== 0 || b3[3] !== 0)) bmpCharsBE++;
|
|
500
|
+
if ((b3[0] !== 0 || b3[1] !== 0) && b3[2] === 0 && b3[3] === 0) bmpCharsLE++;
|
|
501
|
+
b3.length = 0;
|
|
502
502
|
charsProcessed++;
|
|
503
503
|
if (charsProcessed >= 100) {
|
|
504
504
|
break outer_loop;
|
|
@@ -617,22 +617,22 @@ var require_utf16 = __commonJS({
|
|
|
617
617
|
return this.decoder.end();
|
|
618
618
|
};
|
|
619
619
|
function detectEncoding(bufs, defaultEncoding) {
|
|
620
|
-
var
|
|
620
|
+
var b3 = [];
|
|
621
621
|
var charsProcessed = 0;
|
|
622
622
|
var asciiCharsLE = 0, asciiCharsBE = 0;
|
|
623
623
|
outer_loop:
|
|
624
624
|
for (var i = 0; i < bufs.length; i++) {
|
|
625
625
|
var buf = bufs[i];
|
|
626
626
|
for (var j2 = 0; j2 < buf.length; j2++) {
|
|
627
|
-
|
|
628
|
-
if (
|
|
627
|
+
b3.push(buf[j2]);
|
|
628
|
+
if (b3.length === 2) {
|
|
629
629
|
if (charsProcessed === 0) {
|
|
630
|
-
if (
|
|
631
|
-
if (
|
|
630
|
+
if (b3[0] === 255 && b3[1] === 254) return "utf-16le";
|
|
631
|
+
if (b3[0] === 254 && b3[1] === 255) return "utf-16be";
|
|
632
632
|
}
|
|
633
|
-
if (
|
|
634
|
-
if (
|
|
635
|
-
|
|
633
|
+
if (b3[0] === 0 && b3[1] !== 0) asciiCharsBE++;
|
|
634
|
+
if (b3[0] !== 0 && b3[1] === 0) asciiCharsLE++;
|
|
635
|
+
b3.length = 0;
|
|
636
636
|
charsProcessed++;
|
|
637
637
|
if (charsProcessed >= 100) {
|
|
638
638
|
break outer_loop;
|
|
@@ -1634,7 +1634,7 @@ var require_dbcs_codec = __commonJS({
|
|
|
1634
1634
|
} else if (4080 < code && code <= 4095) {
|
|
1635
1635
|
var len = 4095 - code + 2;
|
|
1636
1636
|
var seq = [];
|
|
1637
|
-
for (var
|
|
1637
|
+
for (var m3 = 0; m3 < len; m3++)
|
|
1638
1638
|
seq.push(part.charCodeAt(l2++));
|
|
1639
1639
|
writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length;
|
|
1640
1640
|
this.decodeTableSeq.push(seq);
|
|
@@ -7252,7 +7252,7 @@ var require_websocket_server = __commonJS({
|
|
|
7252
7252
|
socket.once("finish", socket.destroy);
|
|
7253
7253
|
socket.end(
|
|
7254
7254
|
`HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r
|
|
7255
|
-
` + Object.keys(headers).map((
|
|
7255
|
+
` + Object.keys(headers).map((h) => `${h}: ${headers[h]}`).join("\r\n") + "\r\n\r\n" + message
|
|
7256
7256
|
);
|
|
7257
7257
|
}
|
|
7258
7258
|
function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) {
|
|
@@ -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, _e2;
|
|
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
|
+
_e2 = 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 _e2;
|
|
7784
7784
|
}
|
|
7785
7785
|
}
|
|
7786
7786
|
return _arr;
|
|
@@ -7978,8 +7978,8 @@ var require_dcmjs = __commonJS({
|
|
|
7978
7978
|
const extra = desc.stat_desc.extra_bits;
|
|
7979
7979
|
const base = desc.stat_desc.extra_base;
|
|
7980
7980
|
const max_length = desc.stat_desc.max_length;
|
|
7981
|
-
let
|
|
7982
|
-
let n,
|
|
7981
|
+
let h2;
|
|
7982
|
+
let n, m3;
|
|
7983
7983
|
let bits;
|
|
7984
7984
|
let xbits;
|
|
7985
7985
|
let f2;
|
|
@@ -7988,8 +7988,8 @@ var require_dcmjs = __commonJS({
|
|
|
7988
7988
|
s.bl_count[bits] = 0;
|
|
7989
7989
|
}
|
|
7990
7990
|
tree[s.heap[s.heap_max] * 2 + 1] = 0;
|
|
7991
|
-
for (
|
|
7992
|
-
n = s.heap[
|
|
7991
|
+
for (h2 = s.heap_max + 1; h2 < HEAP_SIZE$1; h2++) {
|
|
7992
|
+
n = s.heap[h2];
|
|
7993
7993
|
bits = tree[tree[n * 2 + 1] * 2 + 1] + 1;
|
|
7994
7994
|
if (bits > max_length) {
|
|
7995
7995
|
bits = max_length;
|
|
@@ -8026,13 +8026,13 @@ var require_dcmjs = __commonJS({
|
|
|
8026
8026
|
for (bits = max_length; bits !== 0; bits--) {
|
|
8027
8027
|
n = s.bl_count[bits];
|
|
8028
8028
|
while (n !== 0) {
|
|
8029
|
-
|
|
8030
|
-
if (
|
|
8029
|
+
m3 = s.heap[--h2];
|
|
8030
|
+
if (m3 > max_code) {
|
|
8031
8031
|
continue;
|
|
8032
8032
|
}
|
|
8033
|
-
if (tree[
|
|
8034
|
-
s.opt_len += (bits - tree[
|
|
8035
|
-
tree[
|
|
8033
|
+
if (tree[m3 * 2 + 1] !== bits) {
|
|
8034
|
+
s.opt_len += (bits - tree[m3 * 2 + 1]) * tree[m3 * 2];
|
|
8035
|
+
tree[m3 * 2 + 1] = bits;
|
|
8036
8036
|
}
|
|
8037
8037
|
n--;
|
|
8038
8038
|
}
|
|
@@ -8149,10 +8149,10 @@ var require_dcmjs = __commonJS({
|
|
|
8149
8149
|
s.pending_buf.set(s.window.subarray(buf, buf + len2), s.pending);
|
|
8150
8150
|
s.pending += len2;
|
|
8151
8151
|
};
|
|
8152
|
-
const smaller = (tree, n,
|
|
8152
|
+
const smaller = (tree, n, m3, depth) => {
|
|
8153
8153
|
const _n2 = n * 2;
|
|
8154
|
-
const _m2 =
|
|
8155
|
-
return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[
|
|
8154
|
+
const _m2 = m3 * 2;
|
|
8155
|
+
return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m3];
|
|
8156
8156
|
};
|
|
8157
8157
|
const pqdownheap = (s, tree, k2) => {
|
|
8158
8158
|
const v2 = s.heap[k2];
|
|
@@ -8209,7 +8209,7 @@ var require_dcmjs = __commonJS({
|
|
|
8209
8209
|
const stree = desc.stat_desc.static_tree;
|
|
8210
8210
|
const has_stree = desc.stat_desc.has_stree;
|
|
8211
8211
|
const elems = desc.stat_desc.elems;
|
|
8212
|
-
let n,
|
|
8212
|
+
let n, m3;
|
|
8213
8213
|
let max_code = -1;
|
|
8214
8214
|
let node;
|
|
8215
8215
|
s.heap_len = 0;
|
|
@@ -8251,15 +8251,15 @@ var require_dcmjs = __commonJS({
|
|
|
8251
8251
|
1
|
|
8252
8252
|
/*SMALLEST*/
|
|
8253
8253
|
);
|
|
8254
|
-
|
|
8254
|
+
m3 = s.heap[
|
|
8255
8255
|
1
|
|
8256
8256
|
/*SMALLEST*/
|
|
8257
8257
|
];
|
|
8258
8258
|
s.heap[--s.heap_max] = n;
|
|
8259
|
-
s.heap[--s.heap_max] =
|
|
8260
|
-
tree[node * 2] = tree[n * 2] + tree[
|
|
8261
|
-
s.depth[node] = (s.depth[n] >= s.depth[
|
|
8262
|
-
tree[n * 2 + 1] = tree[
|
|
8259
|
+
s.heap[--s.heap_max] = m3;
|
|
8260
|
+
tree[node * 2] = tree[n * 2] + tree[m3 * 2];
|
|
8261
|
+
s.depth[node] = (s.depth[n] >= s.depth[m3] ? s.depth[n] : s.depth[m3]) + 1;
|
|
8262
|
+
tree[n * 2 + 1] = tree[m3 * 2 + 1] = node;
|
|
8263
8263
|
s.heap[
|
|
8264
8264
|
1
|
|
8265
8265
|
/*SMALLEST*/
|
|
@@ -8678,12 +8678,12 @@ var require_dcmjs = __commonJS({
|
|
|
8678
8678
|
s.block_start = s.strstart;
|
|
8679
8679
|
flush_pending(s.strm);
|
|
8680
8680
|
};
|
|
8681
|
-
const put_byte = (s,
|
|
8682
|
-
s.pending_buf[s.pending++] =
|
|
8681
|
+
const put_byte = (s, b3) => {
|
|
8682
|
+
s.pending_buf[s.pending++] = b3;
|
|
8683
8683
|
};
|
|
8684
|
-
const putShortMSB = (s,
|
|
8685
|
-
s.pending_buf[s.pending++] =
|
|
8686
|
-
s.pending_buf[s.pending++] =
|
|
8684
|
+
const putShortMSB = (s, b3) => {
|
|
8685
|
+
s.pending_buf[s.pending++] = b3 >>> 8 & 255;
|
|
8686
|
+
s.pending_buf[s.pending++] = b3 & 255;
|
|
8687
8687
|
};
|
|
8688
8688
|
const read_buf = (strm, buf, start, size) => {
|
|
8689
8689
|
let len2 = strm.avail_in;
|
|
@@ -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 p3, n,
|
|
8755
|
+
let p3, n, m3, 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)) {
|
|
@@ -8763,14 +8763,14 @@ var require_dcmjs = __commonJS({
|
|
|
8763
8763
|
n = s.hash_size;
|
|
8764
8764
|
p3 = n;
|
|
8765
8765
|
do {
|
|
8766
|
-
|
|
8767
|
-
s.head[p3] =
|
|
8766
|
+
m3 = s.head[--p3];
|
|
8767
|
+
s.head[p3] = m3 >= _w_size ? m3 - _w_size : 0;
|
|
8768
8768
|
} while (--n);
|
|
8769
8769
|
n = _w_size;
|
|
8770
8770
|
p3 = n;
|
|
8771
8771
|
do {
|
|
8772
|
-
|
|
8773
|
-
s.prev[p3] =
|
|
8772
|
+
m3 = s.prev[--p3];
|
|
8773
|
+
s.prev[p3] = m3 >= _w_size ? m3 - _w_size : 0;
|
|
8774
8774
|
} while (--n);
|
|
8775
8775
|
more += _w_size;
|
|
8776
8776
|
}
|
|
@@ -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
|
|
14826
|
+
var G2 = Colors2.invGammaCorrection(rgb[1]);
|
|
14827
14827
|
var B = Colors2.invGammaCorrection(rgb[2]);
|
|
14828
|
-
return [0.41239558896741424 * R2 + 0.3575834307637148 *
|
|
14828
|
+
return [0.41239558896741424 * R2 + 0.3575834307637148 * G2 + 0.18049264738170157 * B, 0.21258623078559555 * R2 + 0.7151703037034108 * G2 + 0.07220049864333623 * B, 0.019297215491746945 * R2 + 0.11918386458084854 * G2 + 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 X2 = xyz[0] / whitePoint[0];
|
|
14835
14835
|
var Y2 = xyz[1] / whitePoint[1];
|
|
14836
14836
|
var Z2 = xyz[2] / whitePoint[2];
|
|
14837
|
-
|
|
14837
|
+
X2 = Colors2.labf(X2);
|
|
14838
14838
|
Y2 = Colors2.labf(Y2);
|
|
14839
14839
|
Z2 = Colors2.labf(Z2);
|
|
14840
|
-
return [116 * Y2 - 16, 500 * (
|
|
14840
|
+
return [116 * Y2 - 16, 500 * (X2 - Y2), 200 * (Y2 - Z2)];
|
|
14841
14841
|
}
|
|
14842
14842
|
}, {
|
|
14843
14843
|
key: "lab2RGB",
|
|
@@ -14849,9 +14849,9 @@ var require_dcmjs = __commonJS({
|
|
|
14849
14849
|
value: function lab2XYZ(lab) {
|
|
14850
14850
|
var L2 = (lab[0] + 16) / 116;
|
|
14851
14851
|
var a2 = L2 + lab[1] / 500;
|
|
14852
|
-
var
|
|
14852
|
+
var b3 = L2 - lab[2] / 200;
|
|
14853
14853
|
var whitePoint = Colors2.d65WhitePointXYZ();
|
|
14854
|
-
return [whitePoint[0] * Colors2.labfInv(a2), whitePoint[1] * Colors2.labfInv(L2), whitePoint[2] * Colors2.labfInv(
|
|
14854
|
+
return [whitePoint[0] * Colors2.labfInv(a2), whitePoint[1] * Colors2.labfInv(L2), whitePoint[2] * Colors2.labfInv(b3)];
|
|
14855
14855
|
}
|
|
14856
14856
|
}, {
|
|
14857
14857
|
key: "xyz2RGB",
|
|
@@ -15163,8 +15163,8 @@ var require_dcmjs = __commonJS({
|
|
|
15163
15163
|
var distance2 = ImageNormalizer2.vec3Dot(positionVector, scanAxis);
|
|
15164
15164
|
distanceDatasetPairs.push([distance2, dataset]);
|
|
15165
15165
|
});
|
|
15166
|
-
distanceDatasetPairs.sort(function(a2,
|
|
15167
|
-
return
|
|
15166
|
+
distanceDatasetPairs.sort(function(a2, b3) {
|
|
15167
|
+
return b3[0] - a2[0];
|
|
15168
15168
|
});
|
|
15169
15169
|
if (ds.BitsAllocated !== 16) {
|
|
15170
15170
|
log.error("Only works with 16 bit data, not " + String(this.dataset.BitsAllocated));
|
|
@@ -15352,8 +15352,8 @@ var require_dcmjs = __commonJS({
|
|
|
15352
15352
|
}
|
|
15353
15353
|
}], [{
|
|
15354
15354
|
key: "vec3CrossProduct",
|
|
15355
|
-
value: function vec3CrossProduct(a2,
|
|
15356
|
-
var ax = a2[0], ay = a2[1], az = a2[2], bx =
|
|
15355
|
+
value: function vec3CrossProduct(a2, b3) {
|
|
15356
|
+
var ax = a2[0], ay = a2[1], az = a2[2], bx = b3[0], by = b3[1], bz = b3[2];
|
|
15357
15357
|
var out = [];
|
|
15358
15358
|
out[0] = ay * bz - az * by;
|
|
15359
15359
|
out[1] = az * bx - ax * bz;
|
|
@@ -15362,17 +15362,17 @@ var require_dcmjs = __commonJS({
|
|
|
15362
15362
|
}
|
|
15363
15363
|
}, {
|
|
15364
15364
|
key: "vec3Subtract",
|
|
15365
|
-
value: function vec3Subtract(a2,
|
|
15365
|
+
value: function vec3Subtract(a2, b3) {
|
|
15366
15366
|
var out = [];
|
|
15367
|
-
out[0] = a2[0] -
|
|
15368
|
-
out[1] = a2[1] -
|
|
15369
|
-
out[2] = a2[2] -
|
|
15367
|
+
out[0] = a2[0] - b3[0];
|
|
15368
|
+
out[1] = a2[1] - b3[1];
|
|
15369
|
+
out[2] = a2[2] - b3[2];
|
|
15370
15370
|
return out;
|
|
15371
15371
|
}
|
|
15372
15372
|
}, {
|
|
15373
15373
|
key: "vec3Dot",
|
|
15374
|
-
value: function vec3Dot(a2,
|
|
15375
|
-
return a2[0] *
|
|
15374
|
+
value: function vec3Dot(a2, b3) {
|
|
15375
|
+
return a2[0] * b3[0] + a2[1] * b3[1] + a2[2] * b3[2];
|
|
15376
15376
|
}
|
|
15377
15377
|
}]);
|
|
15378
15378
|
return ImageNormalizer2;
|
|
@@ -17423,8 +17423,8 @@ var require_dcmjs = __commonJS({
|
|
|
17423
17423
|
var iota = iota_1;
|
|
17424
17424
|
var isBuffer = isBuffer_1;
|
|
17425
17425
|
var hasTypedArrays = typeof Float64Array !== "undefined";
|
|
17426
|
-
function compare1st(a2,
|
|
17427
|
-
return a2[0] -
|
|
17426
|
+
function compare1st(a2, b3) {
|
|
17427
|
+
return a2[0] - b3[0];
|
|
17428
17428
|
}
|
|
17429
17429
|
function order() {
|
|
17430
17430
|
var stride = this.stride;
|
|
@@ -17669,8 +17669,8 @@ var require_dcmjs = __commonJS({
|
|
|
17669
17669
|
}
|
|
17670
17670
|
var ndarray = wrappedNDArrayCtor;
|
|
17671
17671
|
var ndarray$1 = /* @__PURE__ */ getDefaultExportFromCjs(ndarray);
|
|
17672
|
-
function crossProduct3D(a2,
|
|
17673
|
-
return [a2[1] *
|
|
17672
|
+
function crossProduct3D(a2, b3) {
|
|
17673
|
+
return [a2[1] * b3[2] - a2[2] * b3[1], a2[2] * b3[0] - a2[0] * b3[2], a2[0] * b3[1] - a2[1] * b3[0]];
|
|
17674
17674
|
}
|
|
17675
17675
|
var flipImageOrientationPatient = {
|
|
17676
17676
|
/**
|
|
@@ -17678,7 +17678,7 @@ var require_dcmjs = __commonJS({
|
|
|
17678
17678
|
* @param {Number[6]} iop - ImageOrientationPatient
|
|
17679
17679
|
* @returns {Number[6]} The transformed ImageOrientationPatient
|
|
17680
17680
|
*/
|
|
17681
|
-
h: function
|
|
17681
|
+
h: function h2(iop) {
|
|
17682
17682
|
return [iop[0], iop[1], iop[2], -iop[3], -iop[4], -iop[5]];
|
|
17683
17683
|
},
|
|
17684
17684
|
/**
|
|
@@ -17720,10 +17720,10 @@ var require_dcmjs = __commonJS({
|
|
|
17720
17720
|
return [].concat(_toConsumableArray(rRot), _toConsumableArray(cRot));
|
|
17721
17721
|
}
|
|
17722
17722
|
var flipMatrix2D = {
|
|
17723
|
-
h
|
|
17723
|
+
h,
|
|
17724
17724
|
v
|
|
17725
17725
|
};
|
|
17726
|
-
function
|
|
17726
|
+
function h(matrix) {
|
|
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++) {
|
|
@@ -17754,13 +17754,13 @@ var require_dcmjs = __commonJS({
|
|
|
17754
17754
|
}
|
|
17755
17755
|
return result;
|
|
17756
17756
|
}
|
|
17757
|
-
function nearlyEqual(a2,
|
|
17757
|
+
function nearlyEqual(a2, b3, epsilon) {
|
|
17758
17758
|
var absA = Math.abs(a2);
|
|
17759
|
-
var absB = Math.abs(
|
|
17760
|
-
var diff = Math.abs(a2 -
|
|
17761
|
-
if (a2 ===
|
|
17759
|
+
var absB = Math.abs(b3);
|
|
17760
|
+
var diff = Math.abs(a2 - b3);
|
|
17761
|
+
if (a2 === b3) {
|
|
17762
17762
|
return true;
|
|
17763
|
-
} else if (a2 === 0 ||
|
|
17763
|
+
} else if (a2 === 0 || b3 === 0 || absA + absB < epsilon * epsilon) {
|
|
17764
17764
|
return diff < epsilon;
|
|
17765
17765
|
} else {
|
|
17766
17766
|
return diff / Math.min(absA + absB, Number.MAX_VALUE) < epsilon;
|
|
@@ -18106,28 +18106,28 @@ var require_dcmjs = __commonJS({
|
|
|
18106
18106
|
out[2] = z2;
|
|
18107
18107
|
return out;
|
|
18108
18108
|
}
|
|
18109
|
-
function add(out, a2,
|
|
18110
|
-
out[0] = a2[0] +
|
|
18111
|
-
out[1] = a2[1] +
|
|
18112
|
-
out[2] = a2[2] +
|
|
18109
|
+
function add(out, a2, b3) {
|
|
18110
|
+
out[0] = a2[0] + b3[0];
|
|
18111
|
+
out[1] = a2[1] + b3[1];
|
|
18112
|
+
out[2] = a2[2] + b3[2];
|
|
18113
18113
|
return out;
|
|
18114
18114
|
}
|
|
18115
|
-
function subtract$1(out, a2,
|
|
18116
|
-
out[0] = a2[0] -
|
|
18117
|
-
out[1] = a2[1] -
|
|
18118
|
-
out[2] = a2[2] -
|
|
18115
|
+
function subtract$1(out, a2, b3) {
|
|
18116
|
+
out[0] = a2[0] - b3[0];
|
|
18117
|
+
out[1] = a2[1] - b3[1];
|
|
18118
|
+
out[2] = a2[2] - b3[2];
|
|
18119
18119
|
return out;
|
|
18120
18120
|
}
|
|
18121
|
-
function multiply(out, a2,
|
|
18122
|
-
out[0] = a2[0] *
|
|
18123
|
-
out[1] = a2[1] *
|
|
18124
|
-
out[2] = a2[2] *
|
|
18121
|
+
function multiply(out, a2, b3) {
|
|
18122
|
+
out[0] = a2[0] * b3[0];
|
|
18123
|
+
out[1] = a2[1] * b3[1];
|
|
18124
|
+
out[2] = a2[2] * b3[2];
|
|
18125
18125
|
return out;
|
|
18126
18126
|
}
|
|
18127
|
-
function divide(out, a2,
|
|
18128
|
-
out[0] = a2[0] /
|
|
18129
|
-
out[1] = a2[1] /
|
|
18130
|
-
out[2] = a2[2] /
|
|
18127
|
+
function divide(out, a2, b3) {
|
|
18128
|
+
out[0] = a2[0] / b3[0];
|
|
18129
|
+
out[1] = a2[1] / b3[1];
|
|
18130
|
+
out[2] = a2[2] / b3[2];
|
|
18131
18131
|
return out;
|
|
18132
18132
|
}
|
|
18133
18133
|
function ceil(out, a2) {
|
|
@@ -18142,16 +18142,16 @@ var require_dcmjs = __commonJS({
|
|
|
18142
18142
|
out[2] = Math.floor(a2[2]);
|
|
18143
18143
|
return out;
|
|
18144
18144
|
}
|
|
18145
|
-
function min(out, a2,
|
|
18146
|
-
out[0] = Math.min(a2[0],
|
|
18147
|
-
out[1] = Math.min(a2[1],
|
|
18148
|
-
out[2] = Math.min(a2[2],
|
|
18145
|
+
function min(out, a2, b3) {
|
|
18146
|
+
out[0] = Math.min(a2[0], b3[0]);
|
|
18147
|
+
out[1] = Math.min(a2[1], b3[1]);
|
|
18148
|
+
out[2] = Math.min(a2[2], b3[2]);
|
|
18149
18149
|
return out;
|
|
18150
18150
|
}
|
|
18151
|
-
function max(out, a2,
|
|
18152
|
-
out[0] = Math.max(a2[0],
|
|
18153
|
-
out[1] = Math.max(a2[1],
|
|
18154
|
-
out[2] = Math.max(a2[2],
|
|
18151
|
+
function max(out, a2, b3) {
|
|
18152
|
+
out[0] = Math.max(a2[0], b3[0]);
|
|
18153
|
+
out[1] = Math.max(a2[1], b3[1]);
|
|
18154
|
+
out[2] = Math.max(a2[2], b3[2]);
|
|
18155
18155
|
return out;
|
|
18156
18156
|
}
|
|
18157
18157
|
function round(out, a2) {
|
|
@@ -18160,28 +18160,28 @@ var require_dcmjs = __commonJS({
|
|
|
18160
18160
|
out[2] = Math.round(a2[2]);
|
|
18161
18161
|
return out;
|
|
18162
18162
|
}
|
|
18163
|
-
function scale(out, a2,
|
|
18164
|
-
out[0] = a2[0] *
|
|
18165
|
-
out[1] = a2[1] *
|
|
18166
|
-
out[2] = a2[2] *
|
|
18163
|
+
function scale(out, a2, b3) {
|
|
18164
|
+
out[0] = a2[0] * b3;
|
|
18165
|
+
out[1] = a2[1] * b3;
|
|
18166
|
+
out[2] = a2[2] * b3;
|
|
18167
18167
|
return out;
|
|
18168
18168
|
}
|
|
18169
|
-
function scaleAndAdd(out, a2,
|
|
18170
|
-
out[0] = a2[0] +
|
|
18171
|
-
out[1] = a2[1] +
|
|
18172
|
-
out[2] = a2[2] +
|
|
18169
|
+
function scaleAndAdd(out, a2, b3, scale2) {
|
|
18170
|
+
out[0] = a2[0] + b3[0] * scale2;
|
|
18171
|
+
out[1] = a2[1] + b3[1] * scale2;
|
|
18172
|
+
out[2] = a2[2] + b3[2] * scale2;
|
|
18173
18173
|
return out;
|
|
18174
18174
|
}
|
|
18175
|
-
function distance(a2,
|
|
18176
|
-
var x2 =
|
|
18177
|
-
var y2 =
|
|
18178
|
-
var z2 =
|
|
18175
|
+
function distance(a2, b3) {
|
|
18176
|
+
var x2 = b3[0] - a2[0];
|
|
18177
|
+
var y2 = b3[1] - a2[1];
|
|
18178
|
+
var z2 = b3[2] - a2[2];
|
|
18179
18179
|
return Math.hypot(x2, y2, z2);
|
|
18180
18180
|
}
|
|
18181
|
-
function squaredDistance(a2,
|
|
18182
|
-
var x2 =
|
|
18183
|
-
var y2 =
|
|
18184
|
-
var z2 =
|
|
18181
|
+
function squaredDistance(a2, b3) {
|
|
18182
|
+
var x2 = b3[0] - a2[0];
|
|
18183
|
+
var y2 = b3[1] - a2[1];
|
|
18184
|
+
var z2 = b3[2] - a2[2];
|
|
18185
18185
|
return x2 * x2 + y2 * y2 + z2 * z2;
|
|
18186
18186
|
}
|
|
18187
18187
|
function squaredLength(a2) {
|
|
@@ -18215,38 +18215,38 @@ var require_dcmjs = __commonJS({
|
|
|
18215
18215
|
out[2] = a2[2] * len2;
|
|
18216
18216
|
return out;
|
|
18217
18217
|
}
|
|
18218
|
-
function dot(a2,
|
|
18219
|
-
return a2[0] *
|
|
18218
|
+
function dot(a2, b3) {
|
|
18219
|
+
return a2[0] * b3[0] + a2[1] * b3[1] + a2[2] * b3[2];
|
|
18220
18220
|
}
|
|
18221
|
-
function cross$1(out, a2,
|
|
18221
|
+
function cross$1(out, a2, b3) {
|
|
18222
18222
|
var ax = a2[0], ay = a2[1], az = a2[2];
|
|
18223
|
-
var bx =
|
|
18223
|
+
var bx = b3[0], by = b3[1], bz = b3[2];
|
|
18224
18224
|
out[0] = ay * bz - az * by;
|
|
18225
18225
|
out[1] = az * bx - ax * bz;
|
|
18226
18226
|
out[2] = ax * by - ay * bx;
|
|
18227
18227
|
return out;
|
|
18228
18228
|
}
|
|
18229
|
-
function lerp(out, a2,
|
|
18229
|
+
function lerp(out, a2, b3, t) {
|
|
18230
18230
|
var ax = a2[0];
|
|
18231
18231
|
var ay = a2[1];
|
|
18232
18232
|
var az = a2[2];
|
|
18233
|
-
out[0] = ax + t * (
|
|
18234
|
-
out[1] = ay + t * (
|
|
18235
|
-
out[2] = az + t * (
|
|
18233
|
+
out[0] = ax + t * (b3[0] - ax);
|
|
18234
|
+
out[1] = ay + t * (b3[1] - ay);
|
|
18235
|
+
out[2] = az + t * (b3[2] - az);
|
|
18236
18236
|
return out;
|
|
18237
18237
|
}
|
|
18238
|
-
function hermite(out, a2,
|
|
18238
|
+
function hermite(out, a2, b3, c, d3, t) {
|
|
18239
18239
|
var factorTimes2 = t * t;
|
|
18240
18240
|
var factor1 = factorTimes2 * (2 * t - 3) + 1;
|
|
18241
18241
|
var factor2 = factorTimes2 * (t - 2) + t;
|
|
18242
18242
|
var factor3 = factorTimes2 * (t - 1);
|
|
18243
18243
|
var factor4 = factorTimes2 * (3 - 2 * t);
|
|
18244
|
-
out[0] = a2[0] * factor1 +
|
|
18245
|
-
out[1] = a2[1] * factor1 +
|
|
18246
|
-
out[2] = a2[2] * factor1 +
|
|
18244
|
+
out[0] = a2[0] * factor1 + b3[0] * factor2 + c[0] * factor3 + d3[0] * factor4;
|
|
18245
|
+
out[1] = a2[1] * factor1 + b3[1] * factor2 + c[1] * factor3 + d3[1] * factor4;
|
|
18246
|
+
out[2] = a2[2] * factor1 + b3[2] * factor2 + c[2] * factor3 + d3[2] * factor4;
|
|
18247
18247
|
return out;
|
|
18248
18248
|
}
|
|
18249
|
-
function bezier(out, a2,
|
|
18249
|
+
function bezier(out, a2, b3, c, d3, t) {
|
|
18250
18250
|
var inverseFactor = 1 - t;
|
|
18251
18251
|
var inverseFactorTimesTwo = inverseFactor * inverseFactor;
|
|
18252
18252
|
var factorTimes2 = t * t;
|
|
@@ -18254,9 +18254,9 @@ var require_dcmjs = __commonJS({
|
|
|
18254
18254
|
var factor2 = 3 * t * inverseFactorTimesTwo;
|
|
18255
18255
|
var factor3 = 3 * factorTimes2 * inverseFactor;
|
|
18256
18256
|
var factor4 = factorTimes2 * t;
|
|
18257
|
-
out[0] = a2[0] * factor1 +
|
|
18258
|
-
out[1] = a2[1] * factor1 +
|
|
18259
|
-
out[2] = a2[2] * factor1 +
|
|
18257
|
+
out[0] = a2[0] * factor1 + b3[0] * factor2 + c[0] * factor3 + d3[0] * factor4;
|
|
18258
|
+
out[1] = a2[1] * factor1 + b3[1] * factor2 + c[1] * factor3 + d3[1] * factor4;
|
|
18259
|
+
out[2] = a2[2] * factor1 + b3[2] * factor2 + c[2] * factor3 + d3[2] * factor4;
|
|
18260
18260
|
return out;
|
|
18261
18261
|
}
|
|
18262
18262
|
function random(out, scale2) {
|
|
@@ -18269,20 +18269,20 @@ var require_dcmjs = __commonJS({
|
|
|
18269
18269
|
out[2] = z2 * scale2;
|
|
18270
18270
|
return out;
|
|
18271
18271
|
}
|
|
18272
|
-
function transformMat4(out, a2,
|
|
18272
|
+
function transformMat4(out, a2, m3) {
|
|
18273
18273
|
var x2 = a2[0], y2 = a2[1], z2 = a2[2];
|
|
18274
|
-
var w2 =
|
|
18274
|
+
var w2 = m3[3] * x2 + m3[7] * y2 + m3[11] * z2 + m3[15];
|
|
18275
18275
|
w2 = w2 || 1;
|
|
18276
|
-
out[0] = (
|
|
18277
|
-
out[1] = (
|
|
18278
|
-
out[2] = (
|
|
18276
|
+
out[0] = (m3[0] * x2 + m3[4] * y2 + m3[8] * z2 + m3[12]) / w2;
|
|
18277
|
+
out[1] = (m3[1] * x2 + m3[5] * y2 + m3[9] * z2 + m3[13]) / w2;
|
|
18278
|
+
out[2] = (m3[2] * x2 + m3[6] * y2 + m3[10] * z2 + m3[14]) / w2;
|
|
18279
18279
|
return out;
|
|
18280
18280
|
}
|
|
18281
|
-
function transformMat3(out, a2,
|
|
18281
|
+
function transformMat3(out, a2, m3) {
|
|
18282
18282
|
var x2 = a2[0], y2 = a2[1], z2 = a2[2];
|
|
18283
|
-
out[0] = x2 *
|
|
18284
|
-
out[1] = x2 *
|
|
18285
|
-
out[2] = x2 *
|
|
18283
|
+
out[0] = x2 * m3[0] + y2 * m3[3] + z2 * m3[6];
|
|
18284
|
+
out[1] = x2 * m3[1] + y2 * m3[4] + z2 * m3[7];
|
|
18285
|
+
out[2] = x2 * m3[2] + y2 * m3[5] + z2 * m3[8];
|
|
18286
18286
|
return out;
|
|
18287
18287
|
}
|
|
18288
18288
|
function transformQuat(out, a2, q2) {
|
|
@@ -18302,47 +18302,47 @@ var require_dcmjs = __commonJS({
|
|
|
18302
18302
|
out[2] = z2 + uvz + uuvz;
|
|
18303
18303
|
return out;
|
|
18304
18304
|
}
|
|
18305
|
-
function rotateX(out, a2,
|
|
18305
|
+
function rotateX(out, a2, b3, rad) {
|
|
18306
18306
|
var p3 = [], r7 = [];
|
|
18307
|
-
p3[0] = a2[0] -
|
|
18308
|
-
p3[1] = a2[1] -
|
|
18309
|
-
p3[2] = a2[2] -
|
|
18307
|
+
p3[0] = a2[0] - b3[0];
|
|
18308
|
+
p3[1] = a2[1] - b3[1];
|
|
18309
|
+
p3[2] = a2[2] - b3[2];
|
|
18310
18310
|
r7[0] = p3[0];
|
|
18311
18311
|
r7[1] = p3[1] * Math.cos(rad) - p3[2] * Math.sin(rad);
|
|
18312
18312
|
r7[2] = p3[1] * Math.sin(rad) + p3[2] * Math.cos(rad);
|
|
18313
|
-
out[0] = r7[0] +
|
|
18314
|
-
out[1] = r7[1] +
|
|
18315
|
-
out[2] = r7[2] +
|
|
18313
|
+
out[0] = r7[0] + b3[0];
|
|
18314
|
+
out[1] = r7[1] + b3[1];
|
|
18315
|
+
out[2] = r7[2] + b3[2];
|
|
18316
18316
|
return out;
|
|
18317
18317
|
}
|
|
18318
|
-
function rotateY(out, a2,
|
|
18318
|
+
function rotateY(out, a2, b3, rad) {
|
|
18319
18319
|
var p3 = [], r7 = [];
|
|
18320
|
-
p3[0] = a2[0] -
|
|
18321
|
-
p3[1] = a2[1] -
|
|
18322
|
-
p3[2] = a2[2] -
|
|
18320
|
+
p3[0] = a2[0] - b3[0];
|
|
18321
|
+
p3[1] = a2[1] - b3[1];
|
|
18322
|
+
p3[2] = a2[2] - b3[2];
|
|
18323
18323
|
r7[0] = p3[2] * Math.sin(rad) + p3[0] * Math.cos(rad);
|
|
18324
18324
|
r7[1] = p3[1];
|
|
18325
18325
|
r7[2] = p3[2] * Math.cos(rad) - p3[0] * Math.sin(rad);
|
|
18326
|
-
out[0] = r7[0] +
|
|
18327
|
-
out[1] = r7[1] +
|
|
18328
|
-
out[2] = r7[2] +
|
|
18326
|
+
out[0] = r7[0] + b3[0];
|
|
18327
|
+
out[1] = r7[1] + b3[1];
|
|
18328
|
+
out[2] = r7[2] + b3[2];
|
|
18329
18329
|
return out;
|
|
18330
18330
|
}
|
|
18331
|
-
function rotateZ(out, a2,
|
|
18331
|
+
function rotateZ(out, a2, b3, rad) {
|
|
18332
18332
|
var p3 = [], r7 = [];
|
|
18333
|
-
p3[0] = a2[0] -
|
|
18334
|
-
p3[1] = a2[1] -
|
|
18335
|
-
p3[2] = a2[2] -
|
|
18333
|
+
p3[0] = a2[0] - b3[0];
|
|
18334
|
+
p3[1] = a2[1] - b3[1];
|
|
18335
|
+
p3[2] = a2[2] - b3[2];
|
|
18336
18336
|
r7[0] = p3[0] * Math.cos(rad) - p3[1] * Math.sin(rad);
|
|
18337
18337
|
r7[1] = p3[0] * Math.sin(rad) + p3[1] * Math.cos(rad);
|
|
18338
18338
|
r7[2] = p3[2];
|
|
18339
|
-
out[0] = r7[0] +
|
|
18340
|
-
out[1] = r7[1] +
|
|
18341
|
-
out[2] = r7[2] +
|
|
18339
|
+
out[0] = r7[0] + b3[0];
|
|
18340
|
+
out[1] = r7[1] + b3[1];
|
|
18341
|
+
out[2] = r7[2] + b3[2];
|
|
18342
18342
|
return out;
|
|
18343
18343
|
}
|
|
18344
|
-
function angle(a2,
|
|
18345
|
-
var ax = a2[0], ay = a2[1], az = a2[2], bx =
|
|
18344
|
+
function angle(a2, b3) {
|
|
18345
|
+
var ax = a2[0], ay = a2[1], az = a2[2], bx = b3[0], by = b3[1], bz = b3[2], mag1 = Math.sqrt(ax * ax + ay * ay + az * az), mag2 = Math.sqrt(bx * bx + by * by + bz * bz), mag = mag1 * mag2, cosine = mag && dot(a2, b3) / mag;
|
|
18346
18346
|
return Math.acos(Math.min(Math.max(cosine, -1), 1));
|
|
18347
18347
|
}
|
|
18348
18348
|
function zero(out) {
|
|
@@ -18354,12 +18354,12 @@ var require_dcmjs = __commonJS({
|
|
|
18354
18354
|
function str(a2) {
|
|
18355
18355
|
return "vec3(" + a2[0] + ", " + a2[1] + ", " + a2[2] + ")";
|
|
18356
18356
|
}
|
|
18357
|
-
function exactEquals(a2,
|
|
18358
|
-
return a2[0] ===
|
|
18357
|
+
function exactEquals(a2, b3) {
|
|
18358
|
+
return a2[0] === b3[0] && a2[1] === b3[1] && a2[2] === b3[2];
|
|
18359
18359
|
}
|
|
18360
|
-
function equals(a2,
|
|
18360
|
+
function equals(a2, b3) {
|
|
18361
18361
|
var a0 = a2[0], a1 = a2[1], a22 = a2[2];
|
|
18362
|
-
var b0 =
|
|
18362
|
+
var b0 = b3[0], b1 = b3[1], b22 = b3[2];
|
|
18363
18363
|
return Math.abs(a0 - b0) <= EPSILON$1 * Math.max(1, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= EPSILON$1 * Math.max(1, Math.abs(a1), Math.abs(b1)) && Math.abs(a22 - b22) <= EPSILON$1 * Math.max(1, Math.abs(a22), Math.abs(b22));
|
|
18364
18364
|
}
|
|
18365
18365
|
var sub = subtract$1;
|
|
@@ -19482,9 +19482,9 @@ var require_dcmjs = __commonJS({
|
|
|
19482
19482
|
var sliceLength = Columns * Rows;
|
|
19483
19483
|
var arrayBufferLength = sliceLength * imageIds.length * 2;
|
|
19484
19484
|
var M3 = 1;
|
|
19485
|
-
var
|
|
19486
|
-
var tempBuffer = labelmapBufferArray[
|
|
19487
|
-
var tempSegmentsOnFrame = cloneDeep(segmentsOnFrameArray[
|
|
19485
|
+
var m3 = 0;
|
|
19486
|
+
var tempBuffer = labelmapBufferArray[m3].slice(0);
|
|
19487
|
+
var tempSegmentsOnFrame = cloneDeep(segmentsOnFrameArray[m3]);
|
|
19488
19488
|
var numberOfSegs = multiframe.SegmentSequence.length;
|
|
19489
19489
|
for (var segmentIndexToProcess = 1; segmentIndexToProcess <= numberOfSegs; ++segmentIndexToProcess) {
|
|
19490
19490
|
var _loop4 = function _loop42(_i2, groupsLen2) {
|
|
@@ -19529,14 +19529,14 @@ var require_dcmjs = __commonJS({
|
|
|
19529
19529
|
for (var j2 = 0, len2 = alignedPixelDataI.data.length; j2 < len2; ++j2) {
|
|
19530
19530
|
if (data3[j2]) {
|
|
19531
19531
|
if (labelmap2DView[j2] !== 0) {
|
|
19532
|
-
|
|
19533
|
-
if (
|
|
19534
|
-
labelmapBufferArray[
|
|
19535
|
-
segmentsOnFrameArray[
|
|
19532
|
+
m3++;
|
|
19533
|
+
if (m3 >= M3) {
|
|
19534
|
+
labelmapBufferArray[m3] = new ArrayBuffer(arrayBufferLength);
|
|
19535
|
+
segmentsOnFrameArray[m3] = [];
|
|
19536
19536
|
M3++;
|
|
19537
19537
|
}
|
|
19538
|
-
tempBuffer = labelmapBufferArray[
|
|
19539
|
-
tempSegmentsOnFrame = cloneDeep(segmentsOnFrameArray[
|
|
19538
|
+
tempBuffer = labelmapBufferArray[m3].slice(0);
|
|
19539
|
+
tempSegmentsOnFrame = cloneDeep(segmentsOnFrameArray[m3]);
|
|
19540
19540
|
_i2 = 0;
|
|
19541
19541
|
break;
|
|
19542
19542
|
} else {
|
|
@@ -19561,11 +19561,11 @@ var require_dcmjs = __commonJS({
|
|
|
19561
19561
|
var _ret2 = _loop4(i, groupsLen);
|
|
19562
19562
|
if (_ret2 === "continue") continue;
|
|
19563
19563
|
}
|
|
19564
|
-
labelmapBufferArray[
|
|
19565
|
-
segmentsOnFrameArray[
|
|
19566
|
-
|
|
19567
|
-
tempBuffer = labelmapBufferArray[
|
|
19568
|
-
tempSegmentsOnFrame = cloneDeep(segmentsOnFrameArray[
|
|
19564
|
+
labelmapBufferArray[m3] = tempBuffer.slice(0);
|
|
19565
|
+
segmentsOnFrameArray[m3] = cloneDeep(tempSegmentsOnFrame);
|
|
19566
|
+
m3 = 0;
|
|
19567
|
+
tempBuffer = labelmapBufferArray[m3].slice(0);
|
|
19568
|
+
tempSegmentsOnFrame = cloneDeep(segmentsOnFrameArray[m3]);
|
|
19569
19569
|
}
|
|
19570
19570
|
}
|
|
19571
19571
|
var getSegmentIndex = function getSegmentIndex2(multiframe, frame) {
|
|
@@ -21022,10 +21022,10 @@ var require_dcmjs = __commonJS({
|
|
|
21022
21022
|
}
|
|
21023
21023
|
return den;
|
|
21024
21024
|
}
|
|
21025
|
-
function subtract(a2,
|
|
21026
|
-
out[0] = a2[0] -
|
|
21027
|
-
out[1] = a2[1] -
|
|
21028
|
-
out[2] = a2[2] -
|
|
21025
|
+
function subtract(a2, b3, out) {
|
|
21026
|
+
out[0] = a2[0] - b3[0];
|
|
21027
|
+
out[1] = a2[1] - b3[1];
|
|
21028
|
+
out[2] = a2[2] - b3[2];
|
|
21029
21029
|
}
|
|
21030
21030
|
function geometryFromFunctionalGroups(dataset, PerFrameFunctionalGroups) {
|
|
21031
21031
|
var geometry = {};
|
|
@@ -23652,8 +23652,8 @@ var require_dcmjs = __commonJS({
|
|
|
23652
23652
|
});
|
|
23653
23653
|
var groupItem = _this22[0];
|
|
23654
23654
|
var wereReferencesProvided = [options.referencedRegions !== void 0, options.referencedVolume !== void 0, options.referencedSegmentation !== void 0];
|
|
23655
|
-
var numReferences = wereReferencesProvided.reduce(function(a2,
|
|
23656
|
-
return a2 +
|
|
23655
|
+
var numReferences = wereReferencesProvided.reduce(function(a2, b3) {
|
|
23656
|
+
return a2 + b3;
|
|
23657
23657
|
});
|
|
23658
23658
|
if (numReferences === 0) {
|
|
23659
23659
|
throw new Error("One of the following options must be provided: 'referencedRegions', 'referencedVolume', or 'referencedSegmentation'.");
|
|
@@ -23695,8 +23695,8 @@ var require_dcmjs = __commonJS({
|
|
|
23695
23695
|
function PlanarROIMeasurementsAndQualitativeEvaluations2(options) {
|
|
23696
23696
|
_classCallCheck(this, PlanarROIMeasurementsAndQualitativeEvaluations2);
|
|
23697
23697
|
var wereReferencesProvided = [options.referencedRegion !== void 0, options.referencedSegmentation !== void 0];
|
|
23698
|
-
var numReferences = wereReferencesProvided.reduce(function(a2,
|
|
23699
|
-
return a2 +
|
|
23698
|
+
var numReferences = wereReferencesProvided.reduce(function(a2, b3) {
|
|
23699
|
+
return a2 + b3;
|
|
23700
23700
|
});
|
|
23701
23701
|
if (numReferences === 0) {
|
|
23702
23702
|
throw new Error("One of the following options must be provided: 'referencedRegion', 'referencedSegmentation'.");
|
|
@@ -23893,8 +23893,8 @@ var require_dcmjs = __commonJS({
|
|
|
23893
23893
|
var imageLibraryItem = new ImageLibrary();
|
|
23894
23894
|
(_item$ContentSequence3 = item.ContentSequence).push.apply(_item$ContentSequence3, _toConsumableArray(imageLibraryItem));
|
|
23895
23895
|
var wereOptionsProvided = [options.imagingMeasurements !== void 0, options.derivedImagingMeasurements !== void 0, options.qualitativeEvaluations !== void 0];
|
|
23896
|
-
var numOptionsProvided = wereOptionsProvided.reduce(function(a2,
|
|
23897
|
-
return a2 +
|
|
23896
|
+
var numOptionsProvided = wereOptionsProvided.reduce(function(a2, b3) {
|
|
23897
|
+
return a2 + b3;
|
|
23898
23898
|
});
|
|
23899
23899
|
if (numOptionsProvided > 1) {
|
|
23900
23900
|
throw new Error("Only one of the following options should be provided: 'imagingMeasurements', 'derivedImagingMeasurement', 'qualitativeEvaluations'.");
|
|
@@ -27288,11 +27288,11 @@ var require_decorator = __commonJS({
|
|
|
27288
27288
|
};
|
|
27289
27289
|
};
|
|
27290
27290
|
var mergeDecorators = (d1, d22) => {
|
|
27291
|
-
var _a2, _b, _c, _d,
|
|
27291
|
+
var _a2, _b, _c, _d, _e2, _f;
|
|
27292
27292
|
return {
|
|
27293
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((_e2 = d1 === null || d1 === void 0 ? void 0 : d1.instance) !== null && _e2 !== void 0 ? _e2 : {}, (_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();
|
|
@@ -29285,9 +29285,9 @@ var require_ms = __commonJS({
|
|
|
29285
29285
|
"../../node_modules/ms/index.js"(exports2, module2) {
|
|
29286
29286
|
"use strict";
|
|
29287
29287
|
var s = 1e3;
|
|
29288
|
-
var
|
|
29289
|
-
var
|
|
29290
|
-
var d3 =
|
|
29288
|
+
var m3 = s * 60;
|
|
29289
|
+
var h = m3 * 60;
|
|
29290
|
+
var d3 = h * 24;
|
|
29291
29291
|
var w2 = d3 * 7;
|
|
29292
29292
|
var y2 = d3 * 365.25;
|
|
29293
29293
|
module2.exports = function(val, options) {
|
|
@@ -29335,13 +29335,13 @@ var require_ms = __commonJS({
|
|
|
29335
29335
|
case "hrs":
|
|
29336
29336
|
case "hr":
|
|
29337
29337
|
case "h":
|
|
29338
|
-
return n *
|
|
29338
|
+
return n * h;
|
|
29339
29339
|
case "minutes":
|
|
29340
29340
|
case "minute":
|
|
29341
29341
|
case "mins":
|
|
29342
29342
|
case "min":
|
|
29343
29343
|
case "m":
|
|
29344
|
-
return n *
|
|
29344
|
+
return n * m3;
|
|
29345
29345
|
case "seconds":
|
|
29346
29346
|
case "second":
|
|
29347
29347
|
case "secs":
|
|
@@ -29363,11 +29363,11 @@ var require_ms = __commonJS({
|
|
|
29363
29363
|
if (msAbs >= d3) {
|
|
29364
29364
|
return Math.round(ms / d3) + "d";
|
|
29365
29365
|
}
|
|
29366
|
-
if (msAbs >=
|
|
29367
|
-
return Math.round(ms /
|
|
29366
|
+
if (msAbs >= h) {
|
|
29367
|
+
return Math.round(ms / h) + "h";
|
|
29368
29368
|
}
|
|
29369
|
-
if (msAbs >=
|
|
29370
|
-
return Math.round(ms /
|
|
29369
|
+
if (msAbs >= m3) {
|
|
29370
|
+
return Math.round(ms / m3) + "m";
|
|
29371
29371
|
}
|
|
29372
29372
|
if (msAbs >= s) {
|
|
29373
29373
|
return Math.round(ms / s) + "s";
|
|
@@ -29379,11 +29379,11 @@ var require_ms = __commonJS({
|
|
|
29379
29379
|
if (msAbs >= d3) {
|
|
29380
29380
|
return plural(ms, msAbs, d3, "day");
|
|
29381
29381
|
}
|
|
29382
|
-
if (msAbs >=
|
|
29383
|
-
return plural(ms, msAbs,
|
|
29382
|
+
if (msAbs >= h) {
|
|
29383
|
+
return plural(ms, msAbs, h, "hour");
|
|
29384
29384
|
}
|
|
29385
|
-
if (msAbs >=
|
|
29386
|
-
return plural(ms, msAbs,
|
|
29385
|
+
if (msAbs >= m3) {
|
|
29386
|
+
return plural(ms, msAbs, m3, "minute");
|
|
29387
29387
|
}
|
|
29388
29388
|
if (msAbs >= s) {
|
|
29389
29389
|
return plural(ms, msAbs, s, "second");
|
|
@@ -31548,10 +31548,10 @@ var require_stream_readable = __commonJS({
|
|
|
31548
31548
|
state.reading = false;
|
|
31549
31549
|
onEofChunk(stream, state);
|
|
31550
31550
|
} else {
|
|
31551
|
-
var
|
|
31552
|
-
if (!skipChunkCheck)
|
|
31553
|
-
if (
|
|
31554
|
-
errorOrDestroy(stream,
|
|
31551
|
+
var er2;
|
|
31552
|
+
if (!skipChunkCheck) er2 = chunkInvalid(state, chunk);
|
|
31553
|
+
if (er2) {
|
|
31554
|
+
errorOrDestroy(stream, er2);
|
|
31555
31555
|
} else if (state.objectMode || chunk && chunk.length > 0) {
|
|
31556
31556
|
if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) {
|
|
31557
31557
|
chunk = _uint8ArrayToBuffer(chunk);
|
|
@@ -31593,11 +31593,11 @@ var require_stream_readable = __commonJS({
|
|
|
31593
31593
|
maybeReadMore(stream, state);
|
|
31594
31594
|
}
|
|
31595
31595
|
function chunkInvalid(state, chunk) {
|
|
31596
|
-
var
|
|
31596
|
+
var er2;
|
|
31597
31597
|
if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) {
|
|
31598
|
-
|
|
31598
|
+
er2 = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk);
|
|
31599
31599
|
}
|
|
31600
|
-
return
|
|
31600
|
+
return er2;
|
|
31601
31601
|
}
|
|
31602
31602
|
Readable2.prototype.isPaused = function() {
|
|
31603
31603
|
return this._readableState.flowing === false;
|
|
@@ -31823,11 +31823,11 @@ var require_stream_readable = __commonJS({
|
|
|
31823
31823
|
src.pause();
|
|
31824
31824
|
}
|
|
31825
31825
|
}
|
|
31826
|
-
function onerror(
|
|
31827
|
-
debug("onerror",
|
|
31826
|
+
function onerror(er2) {
|
|
31827
|
+
debug("onerror", er2);
|
|
31828
31828
|
unpipe();
|
|
31829
31829
|
dest.removeListener("error", onerror);
|
|
31830
|
-
if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest,
|
|
31830
|
+
if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest, er2);
|
|
31831
31831
|
}
|
|
31832
31832
|
prependListener(dest, "error", onerror);
|
|
31833
31833
|
function onclose() {
|
|
@@ -32292,8 +32292,8 @@ var require_stream_writable = __commonJS({
|
|
|
32292
32292
|
this.corked = 0;
|
|
32293
32293
|
this.sync = true;
|
|
32294
32294
|
this.bufferProcessing = false;
|
|
32295
|
-
this.onwrite = function(
|
|
32296
|
-
onwrite(stream,
|
|
32295
|
+
this.onwrite = function(er2) {
|
|
32296
|
+
onwrite(stream, er2);
|
|
32297
32297
|
};
|
|
32298
32298
|
this.writecb = null;
|
|
32299
32299
|
this.writelen = 0;
|
|
@@ -32359,20 +32359,20 @@ var require_stream_writable = __commonJS({
|
|
|
32359
32359
|
errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE());
|
|
32360
32360
|
};
|
|
32361
32361
|
function writeAfterEnd(stream, cb) {
|
|
32362
|
-
var
|
|
32363
|
-
errorOrDestroy(stream,
|
|
32364
|
-
process.nextTick(cb,
|
|
32362
|
+
var er2 = new ERR_STREAM_WRITE_AFTER_END();
|
|
32363
|
+
errorOrDestroy(stream, er2);
|
|
32364
|
+
process.nextTick(cb, er2);
|
|
32365
32365
|
}
|
|
32366
32366
|
function validChunk(stream, state, chunk, cb) {
|
|
32367
|
-
var
|
|
32367
|
+
var er2;
|
|
32368
32368
|
if (chunk === null) {
|
|
32369
|
-
|
|
32369
|
+
er2 = new ERR_STREAM_NULL_VALUES();
|
|
32370
32370
|
} else if (typeof chunk !== "string" && !state.objectMode) {
|
|
32371
|
-
|
|
32371
|
+
er2 = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk);
|
|
32372
32372
|
}
|
|
32373
|
-
if (
|
|
32374
|
-
errorOrDestroy(stream,
|
|
32375
|
-
process.nextTick(cb,
|
|
32373
|
+
if (er2) {
|
|
32374
|
+
errorOrDestroy(stream, er2);
|
|
32375
|
+
process.nextTick(cb, er2);
|
|
32376
32376
|
return false;
|
|
32377
32377
|
}
|
|
32378
32378
|
return true;
|
|
@@ -32481,17 +32481,17 @@ var require_stream_writable = __commonJS({
|
|
|
32481
32481
|
else stream._write(chunk, encoding, state.onwrite);
|
|
32482
32482
|
state.sync = false;
|
|
32483
32483
|
}
|
|
32484
|
-
function onwriteError(stream, state, sync,
|
|
32484
|
+
function onwriteError(stream, state, sync, er2, cb) {
|
|
32485
32485
|
--state.pendingcb;
|
|
32486
32486
|
if (sync) {
|
|
32487
|
-
process.nextTick(cb,
|
|
32487
|
+
process.nextTick(cb, er2);
|
|
32488
32488
|
process.nextTick(finishMaybe, stream, state);
|
|
32489
32489
|
stream._writableState.errorEmitted = true;
|
|
32490
|
-
errorOrDestroy(stream,
|
|
32490
|
+
errorOrDestroy(stream, er2);
|
|
32491
32491
|
} else {
|
|
32492
|
-
cb(
|
|
32492
|
+
cb(er2);
|
|
32493
32493
|
stream._writableState.errorEmitted = true;
|
|
32494
|
-
errorOrDestroy(stream,
|
|
32494
|
+
errorOrDestroy(stream, er2);
|
|
32495
32495
|
finishMaybe(stream, state);
|
|
32496
32496
|
}
|
|
32497
32497
|
}
|
|
@@ -32501,13 +32501,13 @@ var require_stream_writable = __commonJS({
|
|
|
32501
32501
|
state.length -= state.writelen;
|
|
32502
32502
|
state.writelen = 0;
|
|
32503
32503
|
}
|
|
32504
|
-
function onwrite(stream,
|
|
32504
|
+
function onwrite(stream, er2) {
|
|
32505
32505
|
var state = stream._writableState;
|
|
32506
32506
|
var sync = state.sync;
|
|
32507
32507
|
var cb = state.writecb;
|
|
32508
32508
|
if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK();
|
|
32509
32509
|
onwriteStateUpdate(state);
|
|
32510
|
-
if (
|
|
32510
|
+
if (er2) onwriteError(stream, state, sync, er2, cb);
|
|
32511
32511
|
else {
|
|
32512
32512
|
var finished = needFinish(state) || stream.destroyed;
|
|
32513
32513
|
if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
|
|
@@ -33538,7 +33538,7 @@ var require_stream_transform = __commonJS({
|
|
|
33538
33538
|
var ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
|
|
33539
33539
|
var Duplex = require_stream_duplex();
|
|
33540
33540
|
require_inherits()(Transform, Duplex);
|
|
33541
|
-
function afterTransform(
|
|
33541
|
+
function afterTransform(er2, data2) {
|
|
33542
33542
|
var ts = this._transformState;
|
|
33543
33543
|
ts.transforming = false;
|
|
33544
33544
|
var cb = ts.writecb;
|
|
@@ -33549,7 +33549,7 @@ var require_stream_transform = __commonJS({
|
|
|
33549
33549
|
ts.writecb = null;
|
|
33550
33550
|
if (data2 != null)
|
|
33551
33551
|
this.push(data2);
|
|
33552
|
-
cb(
|
|
33552
|
+
cb(er2);
|
|
33553
33553
|
var rs = this._readableState;
|
|
33554
33554
|
rs.reading = false;
|
|
33555
33555
|
if (rs.needReadable || rs.length < rs.highWaterMark) {
|
|
@@ -33578,8 +33578,8 @@ var require_stream_transform = __commonJS({
|
|
|
33578
33578
|
function prefinish() {
|
|
33579
33579
|
var _this = this;
|
|
33580
33580
|
if (typeof this._flush === "function" && !this._readableState.destroyed) {
|
|
33581
|
-
this._flush(function(
|
|
33582
|
-
done(_this,
|
|
33581
|
+
this._flush(function(er2, data2) {
|
|
33582
|
+
done(_this, er2, data2);
|
|
33583
33583
|
});
|
|
33584
33584
|
} else {
|
|
33585
33585
|
done(this, null, null);
|
|
@@ -33616,8 +33616,8 @@ var require_stream_transform = __commonJS({
|
|
|
33616
33616
|
cb(err2);
|
|
33617
33617
|
});
|
|
33618
33618
|
};
|
|
33619
|
-
function done(stream,
|
|
33620
|
-
if (
|
|
33619
|
+
function done(stream, er2, data2) {
|
|
33620
|
+
if (er2) return stream.emit("error", er2);
|
|
33621
33621
|
if (data2 != null)
|
|
33622
33622
|
stream.push(data2);
|
|
33623
33623
|
if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();
|
|
@@ -34183,11 +34183,11 @@ var require_color_string = __commonJS({
|
|
|
34183
34183
|
var match = string.match(hsl);
|
|
34184
34184
|
if (match) {
|
|
34185
34185
|
var alpha = parseFloat(match[4]);
|
|
34186
|
-
var
|
|
34186
|
+
var h = (parseFloat(match[1]) % 360 + 360) % 360;
|
|
34187
34187
|
var s = clamp(parseFloat(match[2]), 0, 100);
|
|
34188
34188
|
var l2 = clamp(parseFloat(match[3]), 0, 100);
|
|
34189
34189
|
var a2 = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
34190
|
-
return [
|
|
34190
|
+
return [h, s, l2, a2];
|
|
34191
34191
|
}
|
|
34192
34192
|
return null;
|
|
34193
34193
|
};
|
|
@@ -34199,11 +34199,11 @@ var require_color_string = __commonJS({
|
|
|
34199
34199
|
var match = string.match(hwb);
|
|
34200
34200
|
if (match) {
|
|
34201
34201
|
var alpha = parseFloat(match[4]);
|
|
34202
|
-
var
|
|
34202
|
+
var h = (parseFloat(match[1]) % 360 + 360) % 360;
|
|
34203
34203
|
var w2 = clamp(parseFloat(match[2]), 0, 100);
|
|
34204
|
-
var
|
|
34204
|
+
var b3 = clamp(parseFloat(match[3]), 0, 100);
|
|
34205
34205
|
var a2 = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
34206
|
-
return [
|
|
34206
|
+
return [h, w2, b3, a2];
|
|
34207
34207
|
}
|
|
34208
34208
|
return null;
|
|
34209
34209
|
};
|
|
@@ -34219,8 +34219,8 @@ var require_color_string = __commonJS({
|
|
|
34219
34219
|
var rgba = swizzle(arguments);
|
|
34220
34220
|
var r7 = Math.round(rgba[0] / 255 * 100);
|
|
34221
34221
|
var g2 = Math.round(rgba[1] / 255 * 100);
|
|
34222
|
-
var
|
|
34223
|
-
return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + r7 + "%, " + g2 + "%, " +
|
|
34222
|
+
var b3 = Math.round(rgba[2] / 255 * 100);
|
|
34223
|
+
return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + r7 + "%, " + g2 + "%, " + b3 + "%)" : "rgba(" + r7 + "%, " + g2 + "%, " + b3 + "%, " + rgba[3] + ")";
|
|
34224
34224
|
};
|
|
34225
34225
|
cs2.to.hsl = function() {
|
|
34226
34226
|
var hsla = swizzle(arguments);
|
|
@@ -34458,25 +34458,25 @@ var require_conversions = __commonJS({
|
|
|
34458
34458
|
convert.rgb.hsl = function(rgb) {
|
|
34459
34459
|
var r7 = rgb[0] / 255;
|
|
34460
34460
|
var g2 = rgb[1] / 255;
|
|
34461
|
-
var
|
|
34462
|
-
var min = Math.min(r7, g2,
|
|
34463
|
-
var max = Math.max(r7, g2,
|
|
34461
|
+
var b3 = rgb[2] / 255;
|
|
34462
|
+
var min = Math.min(r7, g2, b3);
|
|
34463
|
+
var max = Math.max(r7, g2, b3);
|
|
34464
34464
|
var delta = max - min;
|
|
34465
|
-
var
|
|
34465
|
+
var h;
|
|
34466
34466
|
var s;
|
|
34467
34467
|
var l2;
|
|
34468
34468
|
if (max === min) {
|
|
34469
|
-
|
|
34469
|
+
h = 0;
|
|
34470
34470
|
} else if (r7 === max) {
|
|
34471
|
-
|
|
34471
|
+
h = (g2 - b3) / delta;
|
|
34472
34472
|
} else if (g2 === max) {
|
|
34473
|
-
|
|
34474
|
-
} else if (
|
|
34475
|
-
|
|
34473
|
+
h = 2 + (b3 - r7) / delta;
|
|
34474
|
+
} else if (b3 === max) {
|
|
34475
|
+
h = 4 + (r7 - g2) / delta;
|
|
34476
34476
|
}
|
|
34477
|
-
|
|
34478
|
-
if (
|
|
34479
|
-
|
|
34477
|
+
h = Math.min(h * 60, 360);
|
|
34478
|
+
if (h < 0) {
|
|
34479
|
+
h += 360;
|
|
34480
34480
|
}
|
|
34481
34481
|
l2 = (min + max) / 2;
|
|
34482
34482
|
if (max === min) {
|
|
@@ -34486,44 +34486,44 @@ var require_conversions = __commonJS({
|
|
|
34486
34486
|
} else {
|
|
34487
34487
|
s = delta / (2 - max - min);
|
|
34488
34488
|
}
|
|
34489
|
-
return [
|
|
34489
|
+
return [h, s * 100, l2 * 100];
|
|
34490
34490
|
};
|
|
34491
34491
|
convert.rgb.hsv = function(rgb) {
|
|
34492
34492
|
var rdif;
|
|
34493
34493
|
var gdif;
|
|
34494
34494
|
var bdif;
|
|
34495
|
-
var
|
|
34495
|
+
var h;
|
|
34496
34496
|
var s;
|
|
34497
34497
|
var r7 = rgb[0] / 255;
|
|
34498
34498
|
var g2 = rgb[1] / 255;
|
|
34499
|
-
var
|
|
34500
|
-
var v = Math.max(r7, g2,
|
|
34501
|
-
var diff = v - Math.min(r7, g2,
|
|
34499
|
+
var b3 = rgb[2] / 255;
|
|
34500
|
+
var v = Math.max(r7, g2, b3);
|
|
34501
|
+
var diff = v - Math.min(r7, g2, b3);
|
|
34502
34502
|
var diffc = function(c) {
|
|
34503
34503
|
return (v - c) / 6 / diff + 1 / 2;
|
|
34504
34504
|
};
|
|
34505
34505
|
if (diff === 0) {
|
|
34506
|
-
|
|
34506
|
+
h = s = 0;
|
|
34507
34507
|
} else {
|
|
34508
34508
|
s = diff / v;
|
|
34509
34509
|
rdif = diffc(r7);
|
|
34510
34510
|
gdif = diffc(g2);
|
|
34511
|
-
bdif = diffc(
|
|
34511
|
+
bdif = diffc(b3);
|
|
34512
34512
|
if (r7 === v) {
|
|
34513
|
-
|
|
34513
|
+
h = bdif - gdif;
|
|
34514
34514
|
} else if (g2 === v) {
|
|
34515
|
-
|
|
34516
|
-
} else if (
|
|
34517
|
-
|
|
34515
|
+
h = 1 / 3 + rdif - bdif;
|
|
34516
|
+
} else if (b3 === v) {
|
|
34517
|
+
h = 2 / 3 + gdif - rdif;
|
|
34518
34518
|
}
|
|
34519
|
-
if (
|
|
34520
|
-
|
|
34521
|
-
} else if (
|
|
34522
|
-
|
|
34519
|
+
if (h < 0) {
|
|
34520
|
+
h += 1;
|
|
34521
|
+
} else if (h > 1) {
|
|
34522
|
+
h -= 1;
|
|
34523
34523
|
}
|
|
34524
34524
|
}
|
|
34525
34525
|
return [
|
|
34526
|
-
|
|
34526
|
+
h * 360,
|
|
34527
34527
|
s * 100,
|
|
34528
34528
|
v * 100
|
|
34529
34529
|
];
|
|
@@ -34531,25 +34531,25 @@ var require_conversions = __commonJS({
|
|
|
34531
34531
|
convert.rgb.hwb = function(rgb) {
|
|
34532
34532
|
var r7 = rgb[0];
|
|
34533
34533
|
var g2 = rgb[1];
|
|
34534
|
-
var
|
|
34535
|
-
var
|
|
34536
|
-
var w2 = 1 / 255 * Math.min(r7, Math.min(g2,
|
|
34537
|
-
|
|
34538
|
-
return [
|
|
34534
|
+
var b3 = rgb[2];
|
|
34535
|
+
var h = convert.rgb.hsl(rgb)[0];
|
|
34536
|
+
var w2 = 1 / 255 * Math.min(r7, Math.min(g2, b3));
|
|
34537
|
+
b3 = 1 - 1 / 255 * Math.max(r7, Math.max(g2, b3));
|
|
34538
|
+
return [h, w2 * 100, b3 * 100];
|
|
34539
34539
|
};
|
|
34540
34540
|
convert.rgb.cmyk = function(rgb) {
|
|
34541
34541
|
var r7 = rgb[0] / 255;
|
|
34542
34542
|
var g2 = rgb[1] / 255;
|
|
34543
|
-
var
|
|
34543
|
+
var b3 = rgb[2] / 255;
|
|
34544
34544
|
var c;
|
|
34545
|
-
var
|
|
34545
|
+
var m3;
|
|
34546
34546
|
var y2;
|
|
34547
34547
|
var k2;
|
|
34548
|
-
k2 = Math.min(1 - r7, 1 - g2, 1 -
|
|
34548
|
+
k2 = Math.min(1 - r7, 1 - g2, 1 - b3);
|
|
34549
34549
|
c = (1 - r7 - k2) / (1 - k2) || 0;
|
|
34550
|
-
|
|
34551
|
-
y2 = (1 -
|
|
34552
|
-
return [c * 100,
|
|
34550
|
+
m3 = (1 - g2 - k2) / (1 - k2) || 0;
|
|
34551
|
+
y2 = (1 - b3 - k2) / (1 - k2) || 0;
|
|
34552
|
+
return [c * 100, m3 * 100, y2 * 100, k2 * 100];
|
|
34553
34553
|
};
|
|
34554
34554
|
function comparativeDistance(x2, y2) {
|
|
34555
34555
|
return Math.pow(x2[0] - y2[0], 2) + Math.pow(x2[1] - y2[1], 2) + Math.pow(x2[2] - y2[2], 2);
|
|
@@ -34579,13 +34579,13 @@ var require_conversions = __commonJS({
|
|
|
34579
34579
|
convert.rgb.xyz = function(rgb) {
|
|
34580
34580
|
var r7 = rgb[0] / 255;
|
|
34581
34581
|
var g2 = rgb[1] / 255;
|
|
34582
|
-
var
|
|
34582
|
+
var b3 = rgb[2] / 255;
|
|
34583
34583
|
r7 = r7 > 0.04045 ? Math.pow((r7 + 0.055) / 1.055, 2.4) : r7 / 12.92;
|
|
34584
34584
|
g2 = g2 > 0.04045 ? Math.pow((g2 + 0.055) / 1.055, 2.4) : g2 / 12.92;
|
|
34585
|
-
|
|
34586
|
-
var x2 = r7 * 0.4124 + g2 * 0.3576 +
|
|
34587
|
-
var y2 = r7 * 0.2126 + g2 * 0.7152 +
|
|
34588
|
-
var z2 = r7 * 0.0193 + g2 * 0.1192 +
|
|
34585
|
+
b3 = b3 > 0.04045 ? Math.pow((b3 + 0.055) / 1.055, 2.4) : b3 / 12.92;
|
|
34586
|
+
var x2 = r7 * 0.4124 + g2 * 0.3576 + b3 * 0.1805;
|
|
34587
|
+
var y2 = r7 * 0.2126 + g2 * 0.7152 + b3 * 0.0722;
|
|
34588
|
+
var z2 = r7 * 0.0193 + g2 * 0.1192 + b3 * 0.9505;
|
|
34589
34589
|
return [x2 * 100, y2 * 100, z2 * 100];
|
|
34590
34590
|
};
|
|
34591
34591
|
convert.rgb.lab = function(rgb) {
|
|
@@ -34595,7 +34595,7 @@ var require_conversions = __commonJS({
|
|
|
34595
34595
|
var z2 = xyz[2];
|
|
34596
34596
|
var l2;
|
|
34597
34597
|
var a2;
|
|
34598
|
-
var
|
|
34598
|
+
var b3;
|
|
34599
34599
|
x2 /= 95.047;
|
|
34600
34600
|
y2 /= 100;
|
|
34601
34601
|
z2 /= 108.883;
|
|
@@ -34604,11 +34604,11 @@ var require_conversions = __commonJS({
|
|
|
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
|
-
|
|
34608
|
-
return [l2, a2,
|
|
34607
|
+
b3 = 200 * (y2 - z2);
|
|
34608
|
+
return [l2, a2, b3];
|
|
34609
34609
|
};
|
|
34610
34610
|
convert.hsl.rgb = function(hsl) {
|
|
34611
|
-
var
|
|
34611
|
+
var h = hsl[0] / 360;
|
|
34612
34612
|
var s = hsl[1] / 100;
|
|
34613
34613
|
var l2 = hsl[2] / 100;
|
|
34614
34614
|
var t1;
|
|
@@ -34628,7 +34628,7 @@ var require_conversions = __commonJS({
|
|
|
34628
34628
|
t1 = 2 * l2 - t2;
|
|
34629
34629
|
rgb = [0, 0, 0];
|
|
34630
34630
|
for (var i = 0; i < 3; i++) {
|
|
34631
|
-
t3 =
|
|
34631
|
+
t3 = h + 1 / 3 * -(i - 1);
|
|
34632
34632
|
if (t3 < 0) {
|
|
34633
34633
|
t3++;
|
|
34634
34634
|
}
|
|
@@ -34649,7 +34649,7 @@ var require_conversions = __commonJS({
|
|
|
34649
34649
|
return rgb;
|
|
34650
34650
|
};
|
|
34651
34651
|
convert.hsl.hsv = function(hsl) {
|
|
34652
|
-
var
|
|
34652
|
+
var h = hsl[0];
|
|
34653
34653
|
var s = hsl[1] / 100;
|
|
34654
34654
|
var l2 = hsl[2] / 100;
|
|
34655
34655
|
var smin = s;
|
|
@@ -34661,19 +34661,19 @@ var require_conversions = __commonJS({
|
|
|
34661
34661
|
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
34662
34662
|
v = (l2 + s) / 2;
|
|
34663
34663
|
sv = l2 === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l2 + s);
|
|
34664
|
-
return [
|
|
34664
|
+
return [h, sv * 100, v * 100];
|
|
34665
34665
|
};
|
|
34666
34666
|
convert.hsv.rgb = function(hsv) {
|
|
34667
|
-
var
|
|
34667
|
+
var h = hsv[0] / 60;
|
|
34668
34668
|
var s = hsv[1] / 100;
|
|
34669
34669
|
var v = hsv[2] / 100;
|
|
34670
|
-
var
|
|
34671
|
-
var f2 =
|
|
34670
|
+
var hi = Math.floor(h) % 6;
|
|
34671
|
+
var f2 = h - Math.floor(h);
|
|
34672
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
|
-
switch (
|
|
34676
|
+
switch (hi) {
|
|
34677
34677
|
case 0:
|
|
34678
34678
|
return [v, t, p3];
|
|
34679
34679
|
case 1:
|
|
@@ -34689,7 +34689,7 @@ var require_conversions = __commonJS({
|
|
|
34689
34689
|
}
|
|
34690
34690
|
};
|
|
34691
34691
|
convert.hsv.hsl = function(hsv) {
|
|
34692
|
-
var
|
|
34692
|
+
var h = hsv[0];
|
|
34693
34693
|
var s = hsv[1] / 100;
|
|
34694
34694
|
var v = hsv[2] / 100;
|
|
34695
34695
|
var vmin = Math.max(v, 0.01);
|
|
@@ -34702,10 +34702,10 @@ var require_conversions = __commonJS({
|
|
|
34702
34702
|
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
34703
34703
|
sl = sl || 0;
|
|
34704
34704
|
l2 /= 2;
|
|
34705
|
-
return [
|
|
34705
|
+
return [h, sl * 100, l2 * 100];
|
|
34706
34706
|
};
|
|
34707
34707
|
convert.hwb.rgb = function(hwb) {
|
|
34708
|
-
var
|
|
34708
|
+
var h = hwb[0] / 360;
|
|
34709
34709
|
var wh = hwb[1] / 100;
|
|
34710
34710
|
var bl = hwb[2] / 100;
|
|
34711
34711
|
var ratio = wh + bl;
|
|
@@ -34717,64 +34717,64 @@ var require_conversions = __commonJS({
|
|
|
34717
34717
|
wh /= ratio;
|
|
34718
34718
|
bl /= ratio;
|
|
34719
34719
|
}
|
|
34720
|
-
i = Math.floor(6 *
|
|
34720
|
+
i = Math.floor(6 * h);
|
|
34721
34721
|
v = 1 - bl;
|
|
34722
|
-
f2 = 6 *
|
|
34722
|
+
f2 = 6 * h - i;
|
|
34723
34723
|
if ((i & 1) !== 0) {
|
|
34724
34724
|
f2 = 1 - f2;
|
|
34725
34725
|
}
|
|
34726
34726
|
n = wh + f2 * (v - wh);
|
|
34727
34727
|
var r7;
|
|
34728
34728
|
var g2;
|
|
34729
|
-
var
|
|
34729
|
+
var b3;
|
|
34730
34730
|
switch (i) {
|
|
34731
34731
|
default:
|
|
34732
34732
|
case 6:
|
|
34733
34733
|
case 0:
|
|
34734
34734
|
r7 = v;
|
|
34735
34735
|
g2 = n;
|
|
34736
|
-
|
|
34736
|
+
b3 = wh;
|
|
34737
34737
|
break;
|
|
34738
34738
|
case 1:
|
|
34739
34739
|
r7 = n;
|
|
34740
34740
|
g2 = v;
|
|
34741
|
-
|
|
34741
|
+
b3 = wh;
|
|
34742
34742
|
break;
|
|
34743
34743
|
case 2:
|
|
34744
34744
|
r7 = wh;
|
|
34745
34745
|
g2 = v;
|
|
34746
|
-
|
|
34746
|
+
b3 = n;
|
|
34747
34747
|
break;
|
|
34748
34748
|
case 3:
|
|
34749
34749
|
r7 = wh;
|
|
34750
34750
|
g2 = n;
|
|
34751
|
-
|
|
34751
|
+
b3 = v;
|
|
34752
34752
|
break;
|
|
34753
34753
|
case 4:
|
|
34754
34754
|
r7 = n;
|
|
34755
34755
|
g2 = wh;
|
|
34756
|
-
|
|
34756
|
+
b3 = v;
|
|
34757
34757
|
break;
|
|
34758
34758
|
case 5:
|
|
34759
34759
|
r7 = v;
|
|
34760
34760
|
g2 = wh;
|
|
34761
|
-
|
|
34761
|
+
b3 = n;
|
|
34762
34762
|
break;
|
|
34763
34763
|
}
|
|
34764
|
-
return [r7 * 255, g2 * 255,
|
|
34764
|
+
return [r7 * 255, g2 * 255, b3 * 255];
|
|
34765
34765
|
};
|
|
34766
34766
|
convert.cmyk.rgb = function(cmyk) {
|
|
34767
34767
|
var c = cmyk[0] / 100;
|
|
34768
|
-
var
|
|
34768
|
+
var m3 = cmyk[1] / 100;
|
|
34769
34769
|
var y2 = cmyk[2] / 100;
|
|
34770
34770
|
var k2 = cmyk[3] / 100;
|
|
34771
34771
|
var r7;
|
|
34772
34772
|
var g2;
|
|
34773
|
-
var
|
|
34773
|
+
var b3;
|
|
34774
34774
|
r7 = 1 - Math.min(1, c * (1 - k2) + k2);
|
|
34775
|
-
g2 = 1 - Math.min(1,
|
|
34776
|
-
|
|
34777
|
-
return [r7 * 255, g2 * 255,
|
|
34775
|
+
g2 = 1 - Math.min(1, m3 * (1 - k2) + k2);
|
|
34776
|
+
b3 = 1 - Math.min(1, y2 * (1 - k2) + k2);
|
|
34777
|
+
return [r7 * 255, g2 * 255, b3 * 255];
|
|
34778
34778
|
};
|
|
34779
34779
|
convert.xyz.rgb = function(xyz) {
|
|
34780
34780
|
var x2 = xyz[0] / 100;
|
|
@@ -34782,17 +34782,17 @@ var require_conversions = __commonJS({
|
|
|
34782
34782
|
var z2 = xyz[2] / 100;
|
|
34783
34783
|
var r7;
|
|
34784
34784
|
var g2;
|
|
34785
|
-
var
|
|
34785
|
+
var b3;
|
|
34786
34786
|
r7 = x2 * 3.2406 + y2 * -1.5372 + z2 * -0.4986;
|
|
34787
34787
|
g2 = x2 * -0.9689 + y2 * 1.8758 + z2 * 0.0415;
|
|
34788
|
-
|
|
34788
|
+
b3 = x2 * 0.0557 + y2 * -0.204 + z2 * 1.057;
|
|
34789
34789
|
r7 = r7 > 31308e-7 ? 1.055 * Math.pow(r7, 1 / 2.4) - 0.055 : r7 * 12.92;
|
|
34790
34790
|
g2 = g2 > 31308e-7 ? 1.055 * Math.pow(g2, 1 / 2.4) - 0.055 : g2 * 12.92;
|
|
34791
|
-
|
|
34791
|
+
b3 = b3 > 31308e-7 ? 1.055 * Math.pow(b3, 1 / 2.4) - 0.055 : b3 * 12.92;
|
|
34792
34792
|
r7 = Math.min(Math.max(0, r7), 1);
|
|
34793
34793
|
g2 = Math.min(Math.max(0, g2), 1);
|
|
34794
|
-
|
|
34795
|
-
return [r7 * 255, g2 * 255,
|
|
34794
|
+
b3 = Math.min(Math.max(0, b3), 1);
|
|
34795
|
+
return [r7 * 255, g2 * 255, b3 * 255];
|
|
34796
34796
|
};
|
|
34797
34797
|
convert.xyz.lab = function(xyz) {
|
|
34798
34798
|
var x2 = xyz[0];
|
|
@@ -34800,7 +34800,7 @@ var require_conversions = __commonJS({
|
|
|
34800
34800
|
var z2 = xyz[2];
|
|
34801
34801
|
var l2;
|
|
34802
34802
|
var a2;
|
|
34803
|
-
var
|
|
34803
|
+
var b3;
|
|
34804
34804
|
x2 /= 95.047;
|
|
34805
34805
|
y2 /= 100;
|
|
34806
34806
|
z2 /= 108.883;
|
|
@@ -34809,19 +34809,19 @@ var require_conversions = __commonJS({
|
|
|
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
|
-
|
|
34813
|
-
return [l2, a2,
|
|
34812
|
+
b3 = 200 * (y2 - z2);
|
|
34813
|
+
return [l2, a2, b3];
|
|
34814
34814
|
};
|
|
34815
34815
|
convert.lab.xyz = function(lab) {
|
|
34816
34816
|
var l2 = lab[0];
|
|
34817
34817
|
var a2 = lab[1];
|
|
34818
|
-
var
|
|
34818
|
+
var b3 = lab[2];
|
|
34819
34819
|
var x2;
|
|
34820
34820
|
var y2;
|
|
34821
34821
|
var z2;
|
|
34822
34822
|
y2 = (l2 + 16) / 116;
|
|
34823
34823
|
x2 = a2 / 500 + y2;
|
|
34824
|
-
z2 = y2 -
|
|
34824
|
+
z2 = y2 - b3 / 200;
|
|
34825
34825
|
var y22 = Math.pow(y2, 3);
|
|
34826
34826
|
var x22 = Math.pow(x2, 3);
|
|
34827
34827
|
var z22 = Math.pow(z2, 3);
|
|
@@ -34836,40 +34836,40 @@ var require_conversions = __commonJS({
|
|
|
34836
34836
|
convert.lab.lch = function(lab) {
|
|
34837
34837
|
var l2 = lab[0];
|
|
34838
34838
|
var a2 = lab[1];
|
|
34839
|
-
var
|
|
34839
|
+
var b3 = lab[2];
|
|
34840
34840
|
var hr;
|
|
34841
|
-
var
|
|
34841
|
+
var h;
|
|
34842
34842
|
var c;
|
|
34843
|
-
hr = Math.atan2(
|
|
34844
|
-
|
|
34845
|
-
if (
|
|
34846
|
-
|
|
34843
|
+
hr = Math.atan2(b3, a2);
|
|
34844
|
+
h = hr * 360 / 2 / Math.PI;
|
|
34845
|
+
if (h < 0) {
|
|
34846
|
+
h += 360;
|
|
34847
34847
|
}
|
|
34848
|
-
c = Math.sqrt(a2 * a2 +
|
|
34849
|
-
return [l2, c,
|
|
34848
|
+
c = Math.sqrt(a2 * a2 + b3 * b3);
|
|
34849
|
+
return [l2, c, h];
|
|
34850
34850
|
};
|
|
34851
34851
|
convert.lch.lab = function(lch) {
|
|
34852
34852
|
var l2 = lch[0];
|
|
34853
34853
|
var c = lch[1];
|
|
34854
|
-
var
|
|
34854
|
+
var h = lch[2];
|
|
34855
34855
|
var a2;
|
|
34856
|
-
var
|
|
34856
|
+
var b3;
|
|
34857
34857
|
var hr;
|
|
34858
|
-
hr =
|
|
34858
|
+
hr = h / 360 * 2 * Math.PI;
|
|
34859
34859
|
a2 = c * Math.cos(hr);
|
|
34860
|
-
|
|
34861
|
-
return [l2, a2,
|
|
34860
|
+
b3 = c * Math.sin(hr);
|
|
34861
|
+
return [l2, a2, b3];
|
|
34862
34862
|
};
|
|
34863
34863
|
convert.rgb.ansi16 = function(args) {
|
|
34864
34864
|
var r7 = args[0];
|
|
34865
34865
|
var g2 = args[1];
|
|
34866
|
-
var
|
|
34866
|
+
var b3 = args[2];
|
|
34867
34867
|
var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2];
|
|
34868
34868
|
value = Math.round(value / 50);
|
|
34869
34869
|
if (value === 0) {
|
|
34870
34870
|
return 30;
|
|
34871
34871
|
}
|
|
34872
|
-
var ansi = 30 + (Math.round(
|
|
34872
|
+
var ansi = 30 + (Math.round(b3 / 255) << 2 | Math.round(g2 / 255) << 1 | Math.round(r7 / 255));
|
|
34873
34873
|
if (value === 2) {
|
|
34874
34874
|
ansi += 60;
|
|
34875
34875
|
}
|
|
@@ -34881,8 +34881,8 @@ var require_conversions = __commonJS({
|
|
|
34881
34881
|
convert.rgb.ansi256 = function(args) {
|
|
34882
34882
|
var r7 = args[0];
|
|
34883
34883
|
var g2 = args[1];
|
|
34884
|
-
var
|
|
34885
|
-
if (r7 === g2 && g2 ===
|
|
34884
|
+
var b3 = args[2];
|
|
34885
|
+
if (r7 === g2 && g2 === b3) {
|
|
34886
34886
|
if (r7 < 8) {
|
|
34887
34887
|
return 16;
|
|
34888
34888
|
}
|
|
@@ -34891,7 +34891,7 @@ var require_conversions = __commonJS({
|
|
|
34891
34891
|
}
|
|
34892
34892
|
return Math.round((r7 - 8) / 247 * 24) + 232;
|
|
34893
34893
|
}
|
|
34894
|
-
var ansi = 16 + 36 * Math.round(r7 / 255 * 5) + 6 * Math.round(g2 / 255 * 5) + Math.round(
|
|
34894
|
+
var ansi = 16 + 36 * Math.round(r7 / 255 * 5) + 6 * Math.round(g2 / 255 * 5) + Math.round(b3 / 255 * 5);
|
|
34895
34895
|
return ansi;
|
|
34896
34896
|
};
|
|
34897
34897
|
convert.ansi16.rgb = function(args) {
|
|
@@ -34906,8 +34906,8 @@ var require_conversions = __commonJS({
|
|
|
34906
34906
|
var mult = (~~(args > 50) + 1) * 0.5;
|
|
34907
34907
|
var r7 = (color & 1) * mult * 255;
|
|
34908
34908
|
var g2 = (color >> 1 & 1) * mult * 255;
|
|
34909
|
-
var
|
|
34910
|
-
return [r7, g2,
|
|
34909
|
+
var b3 = (color >> 2 & 1) * mult * 255;
|
|
34910
|
+
return [r7, g2, b3];
|
|
34911
34911
|
};
|
|
34912
34912
|
convert.ansi256.rgb = function(args) {
|
|
34913
34913
|
if (args >= 232) {
|
|
@@ -34918,8 +34918,8 @@ var require_conversions = __commonJS({
|
|
|
34918
34918
|
var rem;
|
|
34919
34919
|
var r7 = Math.floor(args / 36) / 5 * 255;
|
|
34920
34920
|
var g2 = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
34921
|
-
var
|
|
34922
|
-
return [r7, g2,
|
|
34921
|
+
var b3 = rem % 6 / 5 * 255;
|
|
34922
|
+
return [r7, g2, b3];
|
|
34923
34923
|
};
|
|
34924
34924
|
convert.rgb.hex = function(args) {
|
|
34925
34925
|
var integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
@@ -34940,15 +34940,15 @@ var require_conversions = __commonJS({
|
|
|
34940
34940
|
var integer = parseInt(colorString, 16);
|
|
34941
34941
|
var r7 = integer >> 16 & 255;
|
|
34942
34942
|
var g2 = integer >> 8 & 255;
|
|
34943
|
-
var
|
|
34944
|
-
return [r7, g2,
|
|
34943
|
+
var b3 = integer & 255;
|
|
34944
|
+
return [r7, g2, b3];
|
|
34945
34945
|
};
|
|
34946
34946
|
convert.rgb.hcg = function(rgb) {
|
|
34947
34947
|
var r7 = rgb[0] / 255;
|
|
34948
34948
|
var g2 = rgb[1] / 255;
|
|
34949
|
-
var
|
|
34950
|
-
var max = Math.max(Math.max(r7, g2),
|
|
34951
|
-
var min = Math.min(Math.min(r7, g2),
|
|
34949
|
+
var b3 = rgb[2] / 255;
|
|
34950
|
+
var max = Math.max(Math.max(r7, g2), b3);
|
|
34951
|
+
var min = Math.min(Math.min(r7, g2), b3);
|
|
34952
34952
|
var chroma = max - min;
|
|
34953
34953
|
var grayscale;
|
|
34954
34954
|
var hue;
|
|
@@ -34960,9 +34960,9 @@ var require_conversions = __commonJS({
|
|
|
34960
34960
|
if (chroma <= 0) {
|
|
34961
34961
|
hue = 0;
|
|
34962
34962
|
} else if (max === r7) {
|
|
34963
|
-
hue = (g2 -
|
|
34963
|
+
hue = (g2 - b3) / chroma % 6;
|
|
34964
34964
|
} else if (max === g2) {
|
|
34965
|
-
hue = 2 + (
|
|
34965
|
+
hue = 2 + (b3 - r7) / chroma;
|
|
34966
34966
|
} else {
|
|
34967
34967
|
hue = 4 + (r7 - g2) / chroma + 4;
|
|
34968
34968
|
}
|
|
@@ -34996,18 +34996,18 @@ var require_conversions = __commonJS({
|
|
|
34996
34996
|
return [hsv[0], c * 100, f2 * 100];
|
|
34997
34997
|
};
|
|
34998
34998
|
convert.hcg.rgb = function(hcg) {
|
|
34999
|
-
var
|
|
34999
|
+
var h = hcg[0] / 360;
|
|
35000
35000
|
var c = hcg[1] / 100;
|
|
35001
35001
|
var g2 = hcg[2] / 100;
|
|
35002
35002
|
if (c === 0) {
|
|
35003
35003
|
return [g2 * 255, g2 * 255, g2 * 255];
|
|
35004
35004
|
}
|
|
35005
35005
|
var pure = [0, 0, 0];
|
|
35006
|
-
var
|
|
35007
|
-
var v =
|
|
35006
|
+
var hi = h % 1 * 6;
|
|
35007
|
+
var v = hi % 1;
|
|
35008
35008
|
var w2 = 1 - v;
|
|
35009
35009
|
var mg = 0;
|
|
35010
|
-
switch (Math.floor(
|
|
35010
|
+
switch (Math.floor(hi)) {
|
|
35011
35011
|
case 0:
|
|
35012
35012
|
pure[0] = 1;
|
|
35013
35013
|
pure[1] = v;
|
|
@@ -35075,8 +35075,8 @@ var require_conversions = __commonJS({
|
|
|
35075
35075
|
};
|
|
35076
35076
|
convert.hwb.hcg = function(hwb) {
|
|
35077
35077
|
var w2 = hwb[1] / 100;
|
|
35078
|
-
var
|
|
35079
|
-
var v = 1 -
|
|
35078
|
+
var b3 = hwb[2] / 100;
|
|
35079
|
+
var v = 1 - b3;
|
|
35080
35080
|
var c = v - w2;
|
|
35081
35081
|
var g2 = 0;
|
|
35082
35082
|
if (c < 1) {
|
|
@@ -35590,8 +35590,8 @@ var require_color = __commonJS({
|
|
|
35590
35590
|
}
|
|
35591
35591
|
function getset(model, channel, modifier) {
|
|
35592
35592
|
model = Array.isArray(model) ? model : [model];
|
|
35593
|
-
model.forEach(function(
|
|
35594
|
-
(limiters[
|
|
35593
|
+
model.forEach(function(m3) {
|
|
35594
|
+
(limiters[m3] || (limiters[m3] = []))[channel] = modifier;
|
|
35595
35595
|
});
|
|
35596
35596
|
model = model[0];
|
|
35597
35597
|
return function(val) {
|
|
@@ -35687,15 +35687,15 @@ var require_kuler = __commonJS({
|
|
|
35687
35687
|
color[1] = color[0];
|
|
35688
35688
|
color = color.join("");
|
|
35689
35689
|
}
|
|
35690
|
-
var r7 = color.substring(0, 2), g2 = color.substring(2, 4),
|
|
35691
|
-
return [parseInt(r7, 16), parseInt(g2, 16), parseInt(
|
|
35690
|
+
var r7 = color.substring(0, 2), g2 = color.substring(2, 4), b3 = color.substring(4, 6);
|
|
35691
|
+
return [parseInt(r7, 16), parseInt(g2, 16), parseInt(b3, 16)];
|
|
35692
35692
|
};
|
|
35693
|
-
Kuler.prototype.rgb = function rgb(r7, g2,
|
|
35694
|
-
var red = r7 / 255 * 5, green = g2 / 255 * 5, blue =
|
|
35693
|
+
Kuler.prototype.rgb = function rgb(r7, g2, b3) {
|
|
35694
|
+
var red = r7 / 255 * 5, green = g2 / 255 * 5, blue = b3 / 255 * 5;
|
|
35695
35695
|
return this.ansi(red, green, blue);
|
|
35696
35696
|
};
|
|
35697
|
-
Kuler.prototype.ansi = function ansi(r7, g2,
|
|
35698
|
-
var red = Math.round(r7), green = Math.round(g2), blue = Math.round(
|
|
35697
|
+
Kuler.prototype.ansi = function ansi(r7, g2, b3) {
|
|
35698
|
+
var red = Math.round(r7), green = Math.round(g2), blue = Math.round(b3);
|
|
35699
35699
|
return 16 + red * 36 + green * 6 + blue;
|
|
35700
35700
|
};
|
|
35701
35701
|
Kuler.prototype.reset = function reset() {
|
|
@@ -38397,7 +38397,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
38397
38397
|
"object" == typeof exports2 && "object" == typeof module2 ? module2.exports = t(require_async_eventemitter(), require_dcmjs(), require_smartbuffer(), require_cjs(), require_winston()) : "function" == typeof define && define.amd ? define("dcmjs-dimse", ["async-eventemitter", "dcmjs", "smart-buffer", "ts-mixer", "winston"], t) : "object" == typeof exports2 ? exports2["dcmjs-dimse"] = t(require_async_eventemitter(), require_dcmjs(), require_smartbuffer(), require_cjs(), require_winston()) : e["dcmjs-dimse"] = t(e["async-eventemitter"], e.dcmjs, e["smart-buffer"], e["ts-mixer"], e.winston);
|
|
38398
38398
|
}(global, (e, t, s, n, i) => {
|
|
38399
38399
|
return r7 = { 570: (e2, t2, s2) => {
|
|
38400
|
-
const { CGetRequest: n2, CStoreRequest: i2 } = s2(940), { CommandFieldType: r8, PresentationContextResult: o2, SopClass: a2, StorageClass: c, TransferSyntax: d3, Uid: u2, UserIdentityType:
|
|
38400
|
+
const { CGetRequest: n2, CStoreRequest: i2 } = s2(940), { CommandFieldType: r8, PresentationContextResult: o2, SopClass: a2, StorageClass: c, TransferSyntax: d3, Uid: u2, UserIdentityType: h } = s2(492), m3 = s2(139), { EOL: g2 } = s2(857);
|
|
38401
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;
|
|
@@ -38460,7 +38460,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
38460
38460
|
}
|
|
38461
38461
|
e2.exports = { Association: class {
|
|
38462
38462
|
constructor(e3, t3) {
|
|
38463
|
-
this.callingAeTitle = e3, this.calledAeTitle = t3, this.maxPduLength =
|
|
38463
|
+
this.callingAeTitle = e3, this.calledAeTitle = t3, this.maxPduLength = m3.getMaxPduLength(), this.applicationContextName = u2.ApplicationContextName, this.implementationClassUid = m3.getImplementationClassUid(), this.implementationVersion = m3.getImplementationVersion(), this.presentationContexts = [], this.negotiateAsyncOps = false, this.maxAsyncOpsInvoked = 1, this.maxAsyncOpsPerformed = 1, this.negotiateUserIdentity = false, this.userIdentityType = h.Username, this.userIdentityPositiveResponseRequested = false, this.userIdentityPrimaryField = "", this.userIdentitySecondaryField = "", this.negotiateUserIdentityServerResponse = false, this.userIdentityServerResponse = "";
|
|
38464
38464
|
}
|
|
38465
38465
|
getCallingAeTitle() {
|
|
38466
38466
|
return this.callingAeTitle;
|
|
@@ -38660,15 +38660,15 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
38660
38660
|
}
|
|
38661
38661
|
_userIdentityTypeToString(e3) {
|
|
38662
38662
|
switch (e3) {
|
|
38663
|
-
case
|
|
38663
|
+
case h.Username:
|
|
38664
38664
|
return "Username";
|
|
38665
|
-
case
|
|
38665
|
+
case h.UsernameAndPasscode:
|
|
38666
38666
|
return "Username and Passcode";
|
|
38667
|
-
case
|
|
38667
|
+
case h.Kerberos:
|
|
38668
38668
|
return "Kerberos Service Ticket";
|
|
38669
|
-
case
|
|
38669
|
+
case h.Saml:
|
|
38670
38670
|
return "SAML Assertion";
|
|
38671
|
-
case
|
|
38671
|
+
case h.Jwt:
|
|
38672
38672
|
return "JSON Web Token";
|
|
38673
38673
|
default:
|
|
38674
38674
|
return `${e3}`;
|
|
@@ -38676,8 +38676,8 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
38676
38676
|
}
|
|
38677
38677
|
}, PresentationContext: l2 };
|
|
38678
38678
|
}, 422: (e2, t2, s2) => {
|
|
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),
|
|
38680
|
-
e2.exports = class extends
|
|
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), h = s2(733), m3 = s2(278), g2 = s2(756);
|
|
38680
|
+
e2.exports = class extends h {
|
|
38681
38681
|
constructor() {
|
|
38682
38682
|
super(), this.requests = [], this.additionalPresentationContexts = [], this.network = void 0, this.statistics = new d3();
|
|
38683
38683
|
}
|
|
@@ -38703,9 +38703,9 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
38703
38703
|
d4.addTransferSyntaxToPresentationContext(t4, e5);
|
|
38704
38704
|
});
|
|
38705
38705
|
});
|
|
38706
|
-
let
|
|
38707
|
-
a3.securityOptions && (
|
|
38708
|
-
const l2 = (a3.securityOptions ? g2 :
|
|
38706
|
+
let h2 = {};
|
|
38707
|
+
a3.securityOptions && (h2 = { 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 l2 = (a3.securityOptions ? g2 : m3).connect({ host: e3, port: t3, ...h2 }), p3 = new c(l2, a3);
|
|
38709
38709
|
p3.on("connect", () => {
|
|
38710
38710
|
this.emit("connected"), p3.sendAssociationRequest(d4);
|
|
38711
38711
|
}), p3.on("associationAccepted", (e4) => {
|
|
@@ -38739,7 +38739,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
38739
38739
|
}
|
|
38740
38740
|
};
|
|
38741
38741
|
}, 940: (e2, t2, s2) => {
|
|
38742
|
-
const { CommandFieldType: n2, Priority: i2, SopClass: r8, Status: o2 } = s2(492), a2 = s2(825), { Mixin: c } = s2(429), { EOL: d3 } = s2(857), u2 = s2(733),
|
|
38742
|
+
const { CommandFieldType: n2, Priority: i2, SopClass: r8, Status: o2 } = s2(492), a2 = s2(825), { Mixin: c } = s2(429), { EOL: d3 } = s2(857), u2 = s2(733), h = s2(111), { DicomMetaDictionary: m3 } = h.data;
|
|
38743
38743
|
class g2 {
|
|
38744
38744
|
constructor(e3, t3) {
|
|
38745
38745
|
this.commandDataset = e3 || new a2(), this.dataset = t3;
|
|
@@ -39215,7 +39215,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39215
39215
|
return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
|
|
39216
39216
|
}
|
|
39217
39217
|
}
|
|
39218
|
-
class
|
|
39218
|
+
class E extends l2 {
|
|
39219
39219
|
constructor(e3, t3, s3) {
|
|
39220
39220
|
super(n2.NDeleteRequest, e3, false), this.setRequestedSopInstanceUid(t3), this.setMetaSopClassUid(s3);
|
|
39221
39221
|
}
|
|
@@ -39225,12 +39225,12 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39225
39225
|
super(n2.NDeleteResponse, e3, false, s3, i3), this.setAffectedSopInstanceUid(t3);
|
|
39226
39226
|
}
|
|
39227
39227
|
static fromRequest(e3) {
|
|
39228
|
-
if (!(e3 instanceof
|
|
39228
|
+
if (!(e3 instanceof E)) throw new Error("Request should be an instance of NDeleteRequest");
|
|
39229
39229
|
const t3 = new T(e3.getRequestedSopClassUid(), e3.getRequestedSopInstanceUid(), o2.ProcessingFailure);
|
|
39230
39230
|
return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
|
|
39231
39231
|
}
|
|
39232
39232
|
}
|
|
39233
|
-
class
|
|
39233
|
+
class b3 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
|
}
|
|
@@ -39252,7 +39252,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39252
39252
|
this.getCommandDataset().setElement("EventTypeID", e3);
|
|
39253
39253
|
}
|
|
39254
39254
|
static fromRequest(e3) {
|
|
39255
|
-
if (!(e3 instanceof
|
|
39255
|
+
if (!(e3 instanceof b3)) throw new Error("Request should be an instance of NEventReportRequest");
|
|
39256
39256
|
const t3 = new O2(e3.getAffectedSopClassUid(), e3.getAffectedSopInstanceUid(), e3.getEventTypeId(), o2.ProcessingFailure);
|
|
39257
39257
|
return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
|
|
39258
39258
|
}
|
|
@@ -39264,14 +39264,14 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39264
39264
|
getAttributeIdentifierList() {
|
|
39265
39265
|
const e3 = this.getCommandDataset().getElement("AttributeIdentifierList"), t3 = [];
|
|
39266
39266
|
return void 0 !== e3 && Array.isArray(e3) && e3.length > 0 && e3.forEach((e4) => {
|
|
39267
|
-
const s3 = e4 >> 16, n3 = 65535 & e4, i3 = `(${this._getPaddedHexString(s3, 4)},${this._getPaddedHexString(n3, 4)})`, r9 =
|
|
39267
|
+
const s3 = e4 >> 16, n3 = 65535 & e4, i3 = `(${this._getPaddedHexString(s3, 4)},${this._getPaddedHexString(n3, 4)})`, r9 = m3.dictionary[i3.toUpperCase()];
|
|
39268
39268
|
r9 && t3.push(r9.name);
|
|
39269
39269
|
}), t3;
|
|
39270
39270
|
}
|
|
39271
39271
|
setAttributeIdentifierList(e3) {
|
|
39272
39272
|
const t3 = [];
|
|
39273
|
-
Object.keys(
|
|
39274
|
-
const n3 =
|
|
39273
|
+
Object.keys(m3.dictionary).forEach((s3) => {
|
|
39274
|
+
const n3 = m3.dictionary[s3];
|
|
39275
39275
|
if ("DICOM" === n3.version && e3.includes(n3.name)) {
|
|
39276
39276
|
const e4 = parseInt(n3.tag.substring(1, 5), 16), s4 = parseInt(n3.tag.substring(6, 10), 16);
|
|
39277
39277
|
t3.push(e4 << 16 | 65535 & s4);
|
|
@@ -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:
|
|
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: E, NDeleteResponse: T, NEventReportRequest: b3, 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);
|
|
@@ -39345,10 +39345,10 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39345
39345
|
Object.freeze(d3);
|
|
39346
39346
|
const u2 = { Low: 2, Medium: 0, High: 1 };
|
|
39347
39347
|
Object.freeze(u2);
|
|
39348
|
-
const
|
|
39349
|
-
Object.freeze(
|
|
39350
|
-
const
|
|
39351
|
-
Object.freeze(
|
|
39348
|
+
const h = { Success: 0, Cancel: 65024, Pending: 65280, ClassInstanceConflict: 281, DataSetSopClassMismatch: 43264, DuplicateSOPInstance: 273, DuplicateInvocation: 528, InvalidArgumentValue: 277, InvalidAttributeValue: 262, InvalidObjectInstance: 279, MissingAttribute: 288, MissingAttributeValue: 289, MistypedArgument: 530, MoveDestinationUnknown: 43009, NoSuchActionType: 291, NoSuchArgument: 276, NoSuchEventType: 275, NoSuchObjectInstance: 274, NoSuchSopClass: 280, NotAuthorized: 292, OutOfResourcesNumberOfMatches: 42753, OutOfResourcesSubOperations: 42754, ProcessingFailure: 272, ResourceLimitation: 531, SopClassNotSupported: 290, UnrecognizedOperation: 529 };
|
|
39349
|
+
Object.freeze(h);
|
|
39350
|
+
const m3 = { ApplicationContextName: "1.2.840.10008.3.1.1.1" };
|
|
39351
|
+
Object.freeze(m3);
|
|
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
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" };
|
|
@@ -39358,9 +39358,9 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39358
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: l2, Status:
|
|
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: h, StorageClass: g2, TranscodableTransferSyntaxes: R2, TransferSyntax: p3, Uid: m3, 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),
|
|
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), h = s2(111), { DicomDict: m3, DicomMessage: g2, DicomMetaDictionary: l2, ReadBufferStream: p3, WriteBufferStream: R2 } = h.data, S2 = h.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 || {};
|
|
@@ -39400,7 +39400,7 @@ 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 = l2.denaturalizeDataset(o3._meta), u3 = new
|
|
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 m3(a3);
|
|
39404
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)));
|
|
@@ -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:
|
|
39451
|
-
class
|
|
39450
|
+
const { Association: n2 } = s2(570), { AAbort: i2, AAssociateAC: r8, AAssociateRJ: o2, AAssociateRQ: a2, AReleaseRP: c, AReleaseRQ: d3, PDataTF: u2, Pdv: h, RawPdu: m3 } = 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: E, NCreateRequest: T, NCreateResponse: b3, 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), G2 = s2(906), z2 = s2(547), { SmartBuffer: Q2 } = s2(766), { EOL: W } = s2(857), J2 = s2(733);
|
|
39451
|
+
class X2 extends J2 {
|
|
39452
39452
|
constructor() {
|
|
39453
39453
|
super();
|
|
39454
39454
|
}
|
|
@@ -39483,7 +39483,7 @@ 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 G2(), this._wrapSocket();
|
|
39487
39487
|
}
|
|
39488
39488
|
sendAssociationRequest(e3) {
|
|
39489
39489
|
this.association = e3;
|
|
@@ -39569,7 +39569,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39569
39569
|
s3 = 0 === s3 ? n3 : Math.min(s3, n3);
|
|
39570
39570
|
const i3 = e3.getCommandDataset().getDenaturalizedCommandDataset();
|
|
39571
39571
|
z2.info(`${this.logId} -> ${e3.toString({ includeCommandDataset: this.logCommandDatasets, includeDataset: this.logDatasets })} [pc: ${t3}]`);
|
|
39572
|
-
const r9 = new u2(), o3 = new
|
|
39572
|
+
const r9 = new u2(), o3 = new h(t3, i3, true, true);
|
|
39573
39573
|
r9.addPdv(o3);
|
|
39574
39574
|
const a3 = r9.write().writePdu();
|
|
39575
39575
|
this.socket.write(a3), this.statistics.addBytesSent(a3.length);
|
|
@@ -39579,7 +39579,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39579
39579
|
let o4 = 0;
|
|
39580
39580
|
for (; o4 < i4; ) n4.push(e4.slice(o4, o4 += r10));
|
|
39581
39581
|
for (let e5 = 0; e5 < n4.length; e5++) {
|
|
39582
|
-
const s4 = n4.length === e5 + 1, i5 = new
|
|
39582
|
+
const s4 = n4.length === e5 + 1, i5 = new h(t3, n4[e5], false, s4), r11 = new u2();
|
|
39583
39583
|
r11.addPdv(i5);
|
|
39584
39584
|
const o5 = r11.write().writePdu();
|
|
39585
39585
|
this.socket.write(o5), this.statistics.addBytesSent(o5.length);
|
|
@@ -39587,7 +39587,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39587
39587
|
}
|
|
39588
39588
|
}
|
|
39589
39589
|
_processPdu(e3) {
|
|
39590
|
-
const t3 = new
|
|
39590
|
+
const t3 = new m3(e3);
|
|
39591
39591
|
try {
|
|
39592
39592
|
switch (t3.readPdu(), t3.getType()) {
|
|
39593
39593
|
case l2.AAssociateRQ:
|
|
@@ -39668,13 +39668,13 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39668
39668
|
this.dimse = Object.assign(new T(), s3);
|
|
39669
39669
|
break;
|
|
39670
39670
|
case g2.NCreateResponse:
|
|
39671
|
-
this.dimse = Object.assign(new
|
|
39671
|
+
this.dimse = Object.assign(new b3(), s3);
|
|
39672
39672
|
break;
|
|
39673
39673
|
case g2.NActionRequest:
|
|
39674
39674
|
this.dimse = Object.assign(new D2(), s3);
|
|
39675
39675
|
break;
|
|
39676
39676
|
case g2.NActionResponse:
|
|
39677
|
-
this.dimse = Object.assign(new
|
|
39677
|
+
this.dimse = Object.assign(new E(), s3);
|
|
39678
39678
|
break;
|
|
39679
39679
|
case g2.NDeleteRequest:
|
|
39680
39680
|
this.dimse = Object.assign(new O2(), s3);
|
|
@@ -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 X2();
|
|
39759
39759
|
e3.on("pdu", (e4) => {
|
|
39760
39760
|
this.lastPduTime = Date.now(), this._processPdu(e4);
|
|
39761
39761
|
}), e3.on("error", (e4) => {
|
|
@@ -39785,8 +39785,8 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39785
39785
|
}
|
|
39786
39786
|
};
|
|
39787
39787
|
}, 942: (e2, t2, s2) => {
|
|
39788
|
-
const { AbortReason: n2, AbortSource: i2, RawPduType: r8, RejectReason: o2, RejectResult: a2, RejectSource: c, TransferSyntax: d3 } = s2(492), { SmartBuffer: u2 } = s2(766), { EOL:
|
|
39789
|
-
class
|
|
39788
|
+
const { AbortReason: n2, AbortSource: i2, RawPduType: r8, RejectReason: o2, RejectResult: a2, RejectSource: c, TransferSyntax: d3 } = s2(492), { SmartBuffer: u2 } = s2(766), { EOL: h } = s2(857);
|
|
39789
|
+
class m3 {
|
|
39790
39790
|
constructor(e3) {
|
|
39791
39791
|
if (this.m16 = [], this.m32 = [], Buffer.isBuffer(e3)) return this.buffer = u2.fromBuffer(e3, "ascii"), void (this.type = this.buffer.readUInt8());
|
|
39792
39792
|
this.buffer = u2.fromOptions({ encoding: "ascii" }), this.type = e3;
|
|
@@ -39921,7 +39921,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39921
39921
|
return this.reason;
|
|
39922
39922
|
}
|
|
39923
39923
|
write() {
|
|
39924
|
-
const e3 = new
|
|
39924
|
+
const e3 = new m3(r8.AAbort);
|
|
39925
39925
|
return e3.writeByte("Reserved", 0), e3.writeByte("Reserved", 0), e3.writeByte("Source", this.source), e3.writeByte("Reason", this.reason), e3;
|
|
39926
39926
|
}
|
|
39927
39927
|
read(e3) {
|
|
@@ -39968,7 +39968,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
39968
39968
|
return this.association;
|
|
39969
39969
|
}
|
|
39970
39970
|
write() {
|
|
39971
|
-
const e3 = new
|
|
39971
|
+
const e3 = new m3(r8.AAssociateAC);
|
|
39972
39972
|
return e3.writeUInt16("Version", 1), e3.writeByteMultiple("Reserved", 0, 2), e3.writeStringWithPadding("Called AE", this.association.getCalledAeTitle(), 16, " "), e3.writeStringWithPadding("Calling AE", this.association.getCallingAeTitle(), 16, " "), e3.writeByteMultiple("Reserved", 0, 32), e3.writeByte("Item-Type", 16), e3.writeByte("Reserved", 0), e3.markLength16("Item-Length"), e3.writeString("Application Context Name", this.association.getApplicationContextName()), e3.writeLength16(), this.association.getPresentationContexts().forEach((t3) => {
|
|
39973
39973
|
const s3 = this.association.getPresentationContext(t3.id);
|
|
39974
39974
|
e3.writeByte("Item-Type", 33), e3.writeByte("Reserved", 0), e3.markLength16("Item-Length"), e3.writeByte("Presentation Context ID", s3.getPresentationContextId()), e3.writeByte("Reserved", 0), e3.writeByte("Result", s3.getResult()), e3.writeByte("Reserved", 0), e3.writeByte("Item-Type", 64), e3.writeByte("Reserved", 0), e3.markLength16("Item-Length"), e3.writeString("Transfer Syntax UID", s3.getAcceptedTransferSyntaxUid() || d3.ImplicitVRLittleEndian), e3.writeLength16(), e3.writeLength16();
|
|
@@ -40017,7 +40017,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
40017
40017
|
}
|
|
40018
40018
|
}
|
|
40019
40019
|
toString() {
|
|
40020
|
-
return `(A-ASSOCIATE-AC)${
|
|
40020
|
+
return `(A-ASSOCIATE-AC)${h}${this.association.toString()}`;
|
|
40021
40021
|
}
|
|
40022
40022
|
}, AAssociateRJ: class {
|
|
40023
40023
|
constructor(e3, t3, s3) {
|
|
@@ -40033,7 +40033,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
40033
40033
|
return this.reason;
|
|
40034
40034
|
}
|
|
40035
40035
|
write() {
|
|
40036
|
-
const e3 = new
|
|
40036
|
+
const e3 = new m3(r8.AAssociateRJ);
|
|
40037
40037
|
return e3.writeByte("Reserved", 0), e3.writeByte("Result", this.result), e3.writeByte("Source", this.source), e3.writeByte("Reason", this.reason), e3;
|
|
40038
40038
|
}
|
|
40039
40039
|
read(e3) {
|
|
@@ -40103,7 +40103,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
40103
40103
|
return this.association;
|
|
40104
40104
|
}
|
|
40105
40105
|
write() {
|
|
40106
|
-
const e3 = new
|
|
40106
|
+
const e3 = new m3(r8.AAssociateRQ);
|
|
40107
40107
|
return e3.writeUInt16("Version", 1), e3.writeByteMultiple("Reserved", 0, 2), e3.writeStringWithPadding("Called AE", this.association.getCalledAeTitle(), 16, " "), e3.writeStringWithPadding("Calling AE", this.association.getCallingAeTitle(), 16, " "), e3.writeByteMultiple("Reserved", 0, 32), e3.writeByte("Item-Type", 16), e3.writeByte("Reserved", 0), e3.markLength16("Item-Length"), e3.writeString("Application Context Name", this.association.getApplicationContextName()), e3.writeLength16(), this.association.getPresentationContexts().forEach((t3) => {
|
|
40108
40108
|
const s3 = this.association.getPresentationContext(t3.id);
|
|
40109
40109
|
e3.writeByte("Item-Type", 32), e3.writeByte("Reserved", 0), e3.markLength16("Item-Length"), e3.writeByte("Presentation Context ID", s3.getPresentationContextId()), e3.writeByteMultiple("Reserved", 0, 3), e3.writeByte("Item-Type", 48), e3.writeByte("Reserved", 0), e3.markLength16("Item-Length"), e3.writeString("Abstract Syntax UID", s3.getAbstractSyntaxUid()), e3.writeLength16(), s3.getTransferSyntaxUids().forEach((t4) => {
|
|
@@ -40145,13 +40145,13 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
40145
40145
|
}
|
|
40146
40146
|
}
|
|
40147
40147
|
toString() {
|
|
40148
|
-
return `(A-ASSOCIATE-RQ)${
|
|
40148
|
+
return `(A-ASSOCIATE-RQ)${h}${this.association.toString()}`;
|
|
40149
40149
|
}
|
|
40150
40150
|
}, AReleaseRP: class {
|
|
40151
40151
|
constructor() {
|
|
40152
40152
|
}
|
|
40153
40153
|
write() {
|
|
40154
|
-
const e3 = new
|
|
40154
|
+
const e3 = new m3(r8.AReleaseRP);
|
|
40155
40155
|
return e3.writeUInt32("Reserved", 0), e3;
|
|
40156
40156
|
}
|
|
40157
40157
|
read(e3) {
|
|
@@ -40164,7 +40164,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
40164
40164
|
constructor() {
|
|
40165
40165
|
}
|
|
40166
40166
|
write() {
|
|
40167
|
-
const e3 = new
|
|
40167
|
+
const e3 = new m3(r8.AReleaseRQ);
|
|
40168
40168
|
return e3.writeUInt32("Reserved", 0), e3;
|
|
40169
40169
|
}
|
|
40170
40170
|
read(e3) {
|
|
@@ -40196,7 +40196,7 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
40196
40196
|
}), e3;
|
|
40197
40197
|
}
|
|
40198
40198
|
write() {
|
|
40199
|
-
const e3 = new
|
|
40199
|
+
const e3 = new m3(r8.PDataTF);
|
|
40200
40200
|
return this.pdvs.forEach((t3) => {
|
|
40201
40201
|
t3.write(e3);
|
|
40202
40202
|
}), e3;
|
|
@@ -40212,9 +40212,9 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
40212
40212
|
toString() {
|
|
40213
40213
|
return `(P-DATA-TF) [PDV count: ${this.getPdvCount()}, PDV length: ${this.getLengthOfPdvs()}]`;
|
|
40214
40214
|
}
|
|
40215
|
-
}, Pdv: g2, RawPdu:
|
|
40215
|
+
}, Pdv: g2, RawPdu: m3 };
|
|
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:
|
|
40217
|
+
const { CEchoResponse: n2, CFindResponse: i2, CGetResponse: r8, CMoveResponse: o2, CStoreResponse: a2, NActionResponse: c, NCreateResponse: d3, NDeleteResponse: u2, NEventReportResponse: h, NGetResponse: m3, NSetResponse: g2 } = s2(940), l2 = s2(371), p3 = s2(906), R2 = s2(547), S2 = s2(733), f2 = s2(278), y2 = s2(756);
|
|
40218
40218
|
e2.exports = { Scp: class extends l2 {
|
|
40219
40219
|
constructor(e3, t3) {
|
|
40220
40220
|
super(e3, t3), this.on("associationRequested", (e4) => {
|
|
@@ -40280,10 +40280,10 @@ var require_dcmjs_dimse_min = __commonJS({
|
|
|
40280
40280
|
R2.error("nDeleteRequest method must be implemented"), t3(u2.fromRequest(e3));
|
|
40281
40281
|
}
|
|
40282
40282
|
nEventReportRequest(e3, t3) {
|
|
40283
|
-
R2.error("nEventReportRequest method must be implemented"), t3(
|
|
40283
|
+
R2.error("nEventReportRequest method must be implemented"), t3(h.fromRequest(e3));
|
|
40284
40284
|
}
|
|
40285
40285
|
nGetRequest(e3, t3) {
|
|
40286
|
-
R2.error("nGetRequest method must be implemented"), t3(
|
|
40286
|
+
R2.error("nGetRequest method must be implemented"), t3(m3.fromRequest(e3));
|
|
40287
40287
|
}
|
|
40288
40288
|
nSetRequest(e3, t3) {
|
|
40289
40289
|
R2.error("nSetRequest method must be implemented"), t3(g2.fromRequest(e3));
|
|
@@ -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:
|
|
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: h, CGetRequest: m3, 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: E, AbortSource: T, CommandFieldType: b3, PresentationContextResult: O2, Priority: N2, RawPduType: B, RejectReason: M3, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $2, StorageClass: j2, TransferSyntax: V2, Uid: _, UserIdentityType: G2 } = s2(492), z2 = s2(422), Q2 = s2(825), W = s2(139), J2 = s2(906), X2 = { association: { Association: n2, PresentationContext: i2 }, Client: z2, constants: { AbortReason: E, AbortSource: T, CommandFieldType: b3, PresentationContextResult: O2, Priority: N2, RawPduType: B, RejectReason: M3, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $2, StorageClass: j2, TransferSyntax: V2, Uid: _, UserIdentityType: G2 }, Dataset: Q2, Implementation: W, log: s2(547), requests: { CCancelRequest: a2, CEchoRequest: c, CFindRequest: u2, CGetRequest: m3, CMoveRequest: l2, CStoreRequest: R2, NActionRequest: f2, NCreateRequest: I2, NDeleteRequest: P2, NEventReportRequest: v, NGetRequest: x2, NSetRequest: q2 }, responses: { CEchoResponse: d3, CFindResponse: h, 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 = X2;
|
|
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 Ke = class {
|
|
40414
40414
|
constructor(e, t) {
|
|
40415
40415
|
this.operator = e;
|
|
40416
40416
|
this.child = t;
|
|
@@ -40419,7 +40419,7 @@ var Je = class {
|
|
|
40419
40419
|
return `${this.operator}(${this.child.toString()})`;
|
|
40420
40420
|
}
|
|
40421
40421
|
};
|
|
40422
|
-
var
|
|
40422
|
+
var X = class {
|
|
40423
40423
|
constructor(e, t, n) {
|
|
40424
40424
|
this.operator = e;
|
|
40425
40425
|
this.left = t;
|
|
@@ -40429,7 +40429,7 @@ var Z = class {
|
|
|
40429
40429
|
return `${this.left.toString()} ${this.operator} ${this.right.toString()}`;
|
|
40430
40430
|
}
|
|
40431
40431
|
};
|
|
40432
|
-
var
|
|
40432
|
+
var Je = class {
|
|
40433
40433
|
constructor() {
|
|
40434
40434
|
this.prefixParselets = {};
|
|
40435
40435
|
this.infixParselets = {};
|
|
@@ -40453,10 +40453,10 @@ var Ye = class {
|
|
|
40453
40453
|
}, precedence: t });
|
|
40454
40454
|
}
|
|
40455
40455
|
construct(e) {
|
|
40456
|
-
return new
|
|
40456
|
+
return new Qt(e, this.prefixParselets, this.infixParselets);
|
|
40457
40457
|
}
|
|
40458
40458
|
};
|
|
40459
|
-
var
|
|
40459
|
+
var Qt = class {
|
|
40460
40460
|
constructor(e, t, n) {
|
|
40461
40461
|
this.tokens = e, this.prefixParselets = t, this.infixParselets = n;
|
|
40462
40462
|
}
|
|
@@ -40504,43 +40504,43 @@ var zt = class {
|
|
|
40504
40504
|
return this.infixParselets[e.id === "Symbol" ? e.value : e.id];
|
|
40505
40505
|
}
|
|
40506
40506
|
};
|
|
40507
|
-
var
|
|
40508
|
-
var
|
|
40509
|
-
var
|
|
40510
|
-
var
|
|
40511
|
-
var
|
|
40512
|
-
var
|
|
40513
|
-
var
|
|
40514
|
-
var
|
|
40515
|
-
var
|
|
40516
|
-
var
|
|
40517
|
-
function
|
|
40507
|
+
var zt = "ok";
|
|
40508
|
+
var Ye = "created";
|
|
40509
|
+
var Jt = "not-modified";
|
|
40510
|
+
var Zt = "not-found";
|
|
40511
|
+
var er = "unauthorized";
|
|
40512
|
+
var Ze = "accepted";
|
|
40513
|
+
var un = { resourceType: "OperationOutcome", id: Zt, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
|
|
40514
|
+
var Re = { resourceType: "OperationOutcome", id: er, issue: [{ severity: "error", code: "login", details: { text: "Unauthorized" } }] };
|
|
40515
|
+
var ln = { ...Re, issue: [...Re.issue, { severity: "error", code: "expired", details: { text: "Token expired" } }] };
|
|
40516
|
+
var tr = { ...Re, issue: [...Re.issue, { severity: "error", code: "invalid", details: { text: "Token not issued for this audience" } }] };
|
|
40517
|
+
function b(r7, e) {
|
|
40518
40518
|
return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "invalid", details: { text: r7 }, ...e ? { expression: [e] } : void 0 }] };
|
|
40519
40519
|
}
|
|
40520
|
-
function
|
|
40520
|
+
function m(r7) {
|
|
40521
40521
|
return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "structure", details: { text: r7 } }] };
|
|
40522
40522
|
}
|
|
40523
|
-
function
|
|
40523
|
+
function pn(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 Ce(r7) {
|
|
40527
40527
|
return typeof r7 == "object" && r7 !== null && r7.resourceType === "OperationOutcome";
|
|
40528
40528
|
}
|
|
40529
|
-
function
|
|
40530
|
-
return r7.id ===
|
|
40529
|
+
function rr(r7) {
|
|
40530
|
+
return r7.id === zt || r7.id === Ye || r7.id === Jt || r7.id === Ze;
|
|
40531
40531
|
}
|
|
40532
40532
|
var d = class extends Error {
|
|
40533
40533
|
constructor(e, t) {
|
|
40534
|
-
super(
|
|
40534
|
+
super(dn(e)), this.outcome = e, this.cause = t;
|
|
40535
40535
|
}
|
|
40536
40536
|
};
|
|
40537
|
-
function
|
|
40538
|
-
return r7 instanceof d ? r7.outcome :
|
|
40537
|
+
function Xe(r7) {
|
|
40538
|
+
return r7 instanceof d ? r7.outcome : Ce(r7) ? r7 : b(Pe(r7));
|
|
40539
40539
|
}
|
|
40540
|
-
function
|
|
40541
|
-
return r7 ? typeof r7 == "string" ? r7 : r7 instanceof Error ? r7.message :
|
|
40540
|
+
function Pe(r7) {
|
|
40541
|
+
return r7 ? typeof r7 == "string" ? r7 : r7 instanceof Error ? r7.message : Ce(r7) ? dn(r7) : typeof r7 == "object" && "code" in r7 && typeof r7.code == "string" ? r7.code : JSON.stringify(r7) : "Unknown error";
|
|
40542
40542
|
}
|
|
40543
|
-
function
|
|
40543
|
+
function dn(r7) {
|
|
40544
40544
|
let e = r7.issue?.map(eo) ?? [];
|
|
40545
40545
|
return e.length > 0 ? e.join("; ") : "Unknown error";
|
|
40546
40546
|
}
|
|
@@ -40557,45 +40557,45 @@ function mn(r7) {
|
|
|
40557
40557
|
for (let [t, n] of Object.entries(r7)) e[t] = { name: t, type: t, path: t, elements: Object.fromEntries(Object.entries(n.elements).map(([i, o]) => [i, ro(i, o)])), constraints: [], innerTypes: [] };
|
|
40558
40558
|
return e;
|
|
40559
40559
|
}
|
|
40560
|
-
var hn = { Element: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, BackboneElement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, Address: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: 9007199254740991, type: [{ code: "string" }] }, city: { type: [{ code: "string" }] }, district: { type: [{ code: "string" }] }, state: { type: [{ code: "string" }] }, postalCode: { type: [{ code: "string" }] }, country: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Age: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "author[x]": { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Organization"] }, { code: "string" }] }, time: { type: [{ code: "dateTime" }] }, text: { min: 1, type: [{ code: "markdown" }] } } }, Attachment: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, contentType: { type: [{ code: "code" }] }, language: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] }, url: { type: [{ code: "url" }] }, size: { type: [{ code: "unsignedInt" }] }, hash: { type: [{ code: "base64Binary" }] }, title: { type: [{ code: "string" }] }, creation: { type: [{ code: "dateTime" }] } } }, CodeableConcept: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, coding: { max: 9007199254740991, type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: 9007199254740991, type: [{ code: "ContactPoint" }] } } }, ContactPoint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] } } }, Count: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, "subject[x]": { type: [{ code: "CodeableConcept" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Group"] }] }, mustSupport: { max: 9007199254740991, type: [{ code: "string" }] }, codeFilter: { max: 9007199254740991, type: [{ code: "DataRequirementCodeFilter" }] }, dateFilter: { max: 9007199254740991, type: [{ code: "DataRequirementDateFilter" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: 9007199254740991, type: [{ code: "DataRequirementSort" }] } } }, DataRequirementCodeFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] } } }, DataRequirementDateFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, "value[x]": { type: [{ code: "dateTime" }, { code: "Period" }, { code: "Duration" }] } } }, DataRequirementSort: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, direction: { min: 1, type: [{ code: "code" }] } } }, Distance: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] }, patientInstruction: { type: [{ code: "string" }] }, timing: { type: [{ code: "Timing" }] }, "asNeeded[x]": { type: [{ code: "boolean" }, { code: "CodeableConcept" }] }, site: { type: [{ code: "CodeableConcept" }] }, route: { type: [{ code: "CodeableConcept" }] }, method: { type: [{ code: "CodeableConcept" }] }, doseAndRate: { max: 9007199254740991, type: [{ code: "DosageDoseAndRate" }] }, maxDosePerPeriod: { type: [{ code: "Ratio" }] }, maxDosePerAdministration: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, maxDosePerLifetime: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, DosageDoseAndRate: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { type: [{ code: "CodeableConcept" }] }, "dose[x]": { type: [{ code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, "rate[x]": { type: [{ code: "Ratio" }, { code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Duration: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: 9007199254740991, type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] }, slicing: { type: [{ code: "ElementDefinitionSlicing" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: 9007199254740991, type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "ElementDefinitionBase" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: 9007199254740991, type: [{ code: "ElementDefinitionType" }] }, "defaultValue[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, meaningWhenMissing: { type: [{ code: "markdown" }] }, orderMeaning: { type: [{ code: "string" }] }, "fixed[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, "pattern[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, example: { max: 9007199254740991, type: [{ code: "ElementDefinitionExample" }] }, "minValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, "maxValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, maxLength: { type: [{ code: "integer" }] }, condition: { max: 9007199254740991, type: [{ code: "id" }] }, constraint: { max: 9007199254740991, type: [{ code: "ElementDefinitionConstraint" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "ElementDefinitionBinding" }] }, mapping: { max: 9007199254740991, type: [{ code: "ElementDefinitionMapping" }] } } }, ElementDefinitionSlicingDiscriminator: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, path: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionSlicing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, discriminator: { max: 9007199254740991, type: [{ code: "ElementDefinitionSlicingDiscriminator" }] }, description: { type: [{ code: "string" }] }, ordered: { type: [{ code: "boolean" }] }, rules: { min: 1, type: [{ code: "code" }] } } }, ElementDefinitionBase: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, min: { min: 1, type: [{ code: "unsignedInt" }] }, max: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionType: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, targetProfile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, aggregation: { max: 9007199254740991, type: [{ code: "code" }] }, versioning: { type: [{ code: "code" }] } } }, ElementDefinitionExample: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, label: { min: 1, type: [{ code: "string" }] }, "value[x]": { min: 1, type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, ElementDefinitionConstraint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, key: { min: 1, type: [{ code: "id" }] }, requirements: { type: [{ code: "string" }] }, severity: { min: 1, type: [{ code: "code" }] }, human: { min: 1, type: [{ code: "string" }] }, expression: { type: [{ code: "string" }] }, xpath: { type: [{ code: "string" }] }, source: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, ElementDefinitionBinding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, strength: { min: 1, type: [{ code: "code" }] }, description: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] } } }, ElementDefinitionMapping: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identity: { min: 1, type: [{ code: "id" }] }, language: { type: [{ code: "code" }] }, map: { min: 1, type: [{ code: "string" }] }, comment: { type: [{ code: "string" }] } } }, Expression: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, description: { type: [{ code: "string" }] }, name: { type: [{ code: "id" }] }, language: { min: 1, type: [{ code: "code" }] }, expression: { type: [{ code: "string" }] }, reference: { type: [{ code: "uri" }] } } }, Extension: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "uri" }] }, "value[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, HumanName: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: 9007199254740991, type: [{ code: "string" }] }, prefix: { max: 9007199254740991, type: [{ code: "string" }] }, suffix: { max: 9007199254740991, type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "CodeableConcept" }] }, system: { type: [{ code: "uri" }] }, value: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] }, assigner: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MarketingStatus: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, country: { min: 1, type: [{ code: "CodeableConcept" }] }, jurisdiction: { type: [{ code: "CodeableConcept" }] }, status: { min: 1, type: [{ code: "CodeableConcept" }] }, dateRange: { min: 1, type: [{ code: "Period" }] }, restoreDate: { type: [{ code: "dateTime" }] } } }, Meta: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: 9007199254740991, type: [{ code: "Coding" }] }, tag: { max: 9007199254740991, type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, onBehalfOf: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, accounts: { max: 9007199254740991, type: [{ code: "Reference" }] }, compartment: { max: 9007199254740991, type: [{ code: "Reference" }] } } }, Money: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "code" }] }, use: { min: 1, type: [{ code: "code" }] }, min: { type: [{ code: "integer" }] }, max: { type: [{ code: "string" }] }, documentation: { type: [{ code: "string" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, Period: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, height: { type: [{ code: "Quantity" }] }, width: { type: [{ code: "Quantity" }] }, depth: { type: [{ code: "Quantity" }] }, weight: { type: [{ code: "Quantity" }] }, nominalVolume: { type: [{ code: "Quantity" }] }, externalDiameter: { type: [{ code: "Quantity" }] }, shape: { type: [{ code: "string" }] }, color: { max: 9007199254740991, type: [{ code: "string" }] }, imprint: { max: 9007199254740991, type: [{ code: "string" }] }, image: { max: 9007199254740991, type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, Quantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Range: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, low: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, high: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Ratio: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, label: { type: [{ code: "string" }] }, display: { type: [{ code: "string" }] }, citation: { type: [{ code: "markdown" }] }, url: { type: [{ code: "url" }] }, document: { type: [{ code: "Attachment" }] }, resource: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Resource"] }] } } }, SampledData: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, origin: { min: 1, type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, period: { min: 1, type: [{ code: "decimal" }] }, factor: { type: [{ code: "decimal" }] }, lowerLimit: { type: [{ code: "decimal" }] }, upperLimit: { type: [{ code: "decimal" }] }, dimensions: { min: 1, type: [{ code: "positiveInt" }] }, data: { type: [{ code: "string" }] } } }, Signature: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, max: 9007199254740991, type: [{ code: "Coding" }] }, when: { min: 1, type: [{ code: "instant" }] }, who: { min: 1, type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, onBehalfOf: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, targetFormat: { type: [{ code: "code" }] }, sigFormat: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] } } }, SubstanceAmount: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "SubstanceAmountReferenceRange" }] } } }, SubstanceAmountReferenceRange: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, lowLimit: { type: [{ code: "Quantity" }] }, highLimit: { type: [{ code: "Quantity" }] } } }, Timing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, event: { max: 9007199254740991, type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "TimingRepeat" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TimingRepeat: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "bounds[x]": { type: [{ code: "Duration" }, { code: "Range" }, { code: "Period" }] }, count: { type: [{ code: "positiveInt" }] }, countMax: { type: [{ code: "positiveInt" }] }, duration: { type: [{ code: "decimal" }] }, durationMax: { type: [{ code: "decimal" }] }, durationUnit: { type: [{ code: "code" }] }, frequency: { type: [{ code: "positiveInt" }] }, frequencyMax: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "decimal" }] }, periodMax: { type: [{ code: "decimal" }] }, periodUnit: { type: [{ code: "code" }] }, dayOfWeek: { max: 9007199254740991, type: [{ code: "code" }] }, timeOfDay: { max: 9007199254740991, type: [{ code: "time" }] }, when: { max: 9007199254740991, type: [{ code: "code" }] }, offset: { type: [{ code: "unsignedInt" }] } } }, TriggerDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { type: [{ code: "string" }] }, "timing[x]": { type: [{ code: "Timing" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Schedule"] }, { code: "date" }, { code: "dateTime" }] }, data: { max: 9007199254740991, type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "Coding" }] }, "value[x]": { min: 1, type: [{ code: "CodeableConcept" }, { code: "Quantity" }, { code: "Range" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/PlanDefinition", "http://hl7.org/fhir/StructureDefinition/ResearchStudy", "http://hl7.org/fhir/StructureDefinition/InsurancePlan", "http://hl7.org/fhir/StructureDefinition/HealthcareService", "http://hl7.org/fhir/StructureDefinition/Group", "http://hl7.org/fhir/StructureDefinition/Location", "http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MoneyQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, SimpleQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { max: 0, type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, IdentityProvider: { elements: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, tokenAuthMethod: { type: [{ code: "code" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, usePkce: { type: [{ code: "boolean" }] }, useSubject: { type: [{ code: "boolean" }] } } } };
|
|
40561
|
-
function
|
|
40562
|
-
return new
|
|
40560
|
+
var yn = { Element: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, BackboneElement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, Address: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: 9007199254740991, type: [{ code: "string" }] }, city: { type: [{ code: "string" }] }, district: { type: [{ code: "string" }] }, state: { type: [{ code: "string" }] }, postalCode: { type: [{ code: "string" }] }, country: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Age: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "author[x]": { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Organization"] }, { code: "string" }] }, time: { type: [{ code: "dateTime" }] }, text: { min: 1, type: [{ code: "markdown" }] } } }, Attachment: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, contentType: { type: [{ code: "code" }] }, language: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] }, url: { type: [{ code: "url" }] }, size: { type: [{ code: "unsignedInt" }] }, hash: { type: [{ code: "base64Binary" }] }, title: { type: [{ code: "string" }] }, creation: { type: [{ code: "dateTime" }] } } }, CodeableConcept: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, coding: { max: 9007199254740991, type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: 9007199254740991, type: [{ code: "ContactPoint" }] } } }, ContactPoint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] } } }, Count: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, "subject[x]": { type: [{ code: "CodeableConcept" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Group"] }] }, mustSupport: { max: 9007199254740991, type: [{ code: "string" }] }, codeFilter: { max: 9007199254740991, type: [{ code: "DataRequirementCodeFilter" }] }, dateFilter: { max: 9007199254740991, type: [{ code: "DataRequirementDateFilter" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: 9007199254740991, type: [{ code: "DataRequirementSort" }] } } }, DataRequirementCodeFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] } } }, DataRequirementDateFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, "value[x]": { type: [{ code: "dateTime" }, { code: "Period" }, { code: "Duration" }] } } }, DataRequirementSort: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, direction: { min: 1, type: [{ code: "code" }] } } }, Distance: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] }, patientInstruction: { type: [{ code: "string" }] }, timing: { type: [{ code: "Timing" }] }, "asNeeded[x]": { type: [{ code: "boolean" }, { code: "CodeableConcept" }] }, site: { type: [{ code: "CodeableConcept" }] }, route: { type: [{ code: "CodeableConcept" }] }, method: { type: [{ code: "CodeableConcept" }] }, doseAndRate: { max: 9007199254740991, type: [{ code: "DosageDoseAndRate" }] }, maxDosePerPeriod: { type: [{ code: "Ratio" }] }, maxDosePerAdministration: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, maxDosePerLifetime: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, DosageDoseAndRate: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { type: [{ code: "CodeableConcept" }] }, "dose[x]": { type: [{ code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, "rate[x]": { type: [{ code: "Ratio" }, { code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Duration: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: 9007199254740991, type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] }, slicing: { type: [{ code: "ElementDefinitionSlicing" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: 9007199254740991, type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "ElementDefinitionBase" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: 9007199254740991, type: [{ code: "ElementDefinitionType" }] }, "defaultValue[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, meaningWhenMissing: { type: [{ code: "markdown" }] }, orderMeaning: { type: [{ code: "string" }] }, "fixed[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, "pattern[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, example: { max: 9007199254740991, type: [{ code: "ElementDefinitionExample" }] }, "minValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, "maxValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, maxLength: { type: [{ code: "integer" }] }, condition: { max: 9007199254740991, type: [{ code: "id" }] }, constraint: { max: 9007199254740991, type: [{ code: "ElementDefinitionConstraint" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "ElementDefinitionBinding" }] }, mapping: { max: 9007199254740991, type: [{ code: "ElementDefinitionMapping" }] } } }, ElementDefinitionSlicingDiscriminator: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, path: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionSlicing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, discriminator: { max: 9007199254740991, type: [{ code: "ElementDefinitionSlicingDiscriminator" }] }, description: { type: [{ code: "string" }] }, ordered: { type: [{ code: "boolean" }] }, rules: { min: 1, type: [{ code: "code" }] } } }, ElementDefinitionBase: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, min: { min: 1, type: [{ code: "unsignedInt" }] }, max: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionType: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, targetProfile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, aggregation: { max: 9007199254740991, type: [{ code: "code" }] }, versioning: { type: [{ code: "code" }] } } }, ElementDefinitionExample: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, label: { min: 1, type: [{ code: "string" }] }, "value[x]": { min: 1, type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, ElementDefinitionConstraint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, key: { min: 1, type: [{ code: "id" }] }, requirements: { type: [{ code: "string" }] }, severity: { min: 1, type: [{ code: "code" }] }, human: { min: 1, type: [{ code: "string" }] }, expression: { type: [{ code: "string" }] }, xpath: { type: [{ code: "string" }] }, source: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, ElementDefinitionBinding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, strength: { min: 1, type: [{ code: "code" }] }, description: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] } } }, ElementDefinitionMapping: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identity: { min: 1, type: [{ code: "id" }] }, language: { type: [{ code: "code" }] }, map: { min: 1, type: [{ code: "string" }] }, comment: { type: [{ code: "string" }] } } }, Expression: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, description: { type: [{ code: "string" }] }, name: { type: [{ code: "id" }] }, language: { min: 1, type: [{ code: "code" }] }, expression: { type: [{ code: "string" }] }, reference: { type: [{ code: "uri" }] } } }, Extension: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "uri" }] }, "value[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, HumanName: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: 9007199254740991, type: [{ code: "string" }] }, prefix: { max: 9007199254740991, type: [{ code: "string" }] }, suffix: { max: 9007199254740991, type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "CodeableConcept" }] }, system: { type: [{ code: "uri" }] }, value: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] }, assigner: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MarketingStatus: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, country: { min: 1, type: [{ code: "CodeableConcept" }] }, jurisdiction: { type: [{ code: "CodeableConcept" }] }, status: { min: 1, type: [{ code: "CodeableConcept" }] }, dateRange: { min: 1, type: [{ code: "Period" }] }, restoreDate: { type: [{ code: "dateTime" }] } } }, Meta: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: 9007199254740991, type: [{ code: "Coding" }] }, tag: { max: 9007199254740991, type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, onBehalfOf: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, accounts: { max: 9007199254740991, type: [{ code: "Reference" }] }, compartment: { max: 9007199254740991, type: [{ code: "Reference" }] } } }, Money: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "code" }] }, use: { min: 1, type: [{ code: "code" }] }, min: { type: [{ code: "integer" }] }, max: { type: [{ code: "string" }] }, documentation: { type: [{ code: "string" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, Period: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, height: { type: [{ code: "Quantity" }] }, width: { type: [{ code: "Quantity" }] }, depth: { type: [{ code: "Quantity" }] }, weight: { type: [{ code: "Quantity" }] }, nominalVolume: { type: [{ code: "Quantity" }] }, externalDiameter: { type: [{ code: "Quantity" }] }, shape: { type: [{ code: "string" }] }, color: { max: 9007199254740991, type: [{ code: "string" }] }, imprint: { max: 9007199254740991, type: [{ code: "string" }] }, image: { max: 9007199254740991, type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, Quantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Range: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, low: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, high: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Ratio: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, label: { type: [{ code: "string" }] }, display: { type: [{ code: "string" }] }, citation: { type: [{ code: "markdown" }] }, url: { type: [{ code: "url" }] }, document: { type: [{ code: "Attachment" }] }, resource: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Resource"] }] } } }, SampledData: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, origin: { min: 1, type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, period: { min: 1, type: [{ code: "decimal" }] }, factor: { type: [{ code: "decimal" }] }, lowerLimit: { type: [{ code: "decimal" }] }, upperLimit: { type: [{ code: "decimal" }] }, dimensions: { min: 1, type: [{ code: "positiveInt" }] }, data: { type: [{ code: "string" }] } } }, Signature: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, max: 9007199254740991, type: [{ code: "Coding" }] }, when: { min: 1, type: [{ code: "instant" }] }, who: { min: 1, type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, onBehalfOf: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, targetFormat: { type: [{ code: "code" }] }, sigFormat: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] } } }, SubstanceAmount: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "SubstanceAmountReferenceRange" }] } } }, SubstanceAmountReferenceRange: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, lowLimit: { type: [{ code: "Quantity" }] }, highLimit: { type: [{ code: "Quantity" }] } } }, Timing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, event: { max: 9007199254740991, type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "TimingRepeat" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TimingRepeat: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "bounds[x]": { type: [{ code: "Duration" }, { code: "Range" }, { code: "Period" }] }, count: { type: [{ code: "positiveInt" }] }, countMax: { type: [{ code: "positiveInt" }] }, duration: { type: [{ code: "decimal" }] }, durationMax: { type: [{ code: "decimal" }] }, durationUnit: { type: [{ code: "code" }] }, frequency: { type: [{ code: "positiveInt" }] }, frequencyMax: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "decimal" }] }, periodMax: { type: [{ code: "decimal" }] }, periodUnit: { type: [{ code: "code" }] }, dayOfWeek: { max: 9007199254740991, type: [{ code: "code" }] }, timeOfDay: { max: 9007199254740991, type: [{ code: "time" }] }, when: { max: 9007199254740991, type: [{ code: "code" }] }, offset: { type: [{ code: "unsignedInt" }] } } }, TriggerDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { type: [{ code: "string" }] }, "timing[x]": { type: [{ code: "Timing" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Schedule"] }, { code: "date" }, { code: "dateTime" }] }, data: { max: 9007199254740991, type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "Coding" }] }, "value[x]": { min: 1, type: [{ code: "CodeableConcept" }, { code: "Quantity" }, { code: "Range" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/PlanDefinition", "http://hl7.org/fhir/StructureDefinition/ResearchStudy", "http://hl7.org/fhir/StructureDefinition/InsurancePlan", "http://hl7.org/fhir/StructureDefinition/HealthcareService", "http://hl7.org/fhir/StructureDefinition/Group", "http://hl7.org/fhir/StructureDefinition/Location", "http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MoneyQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, SimpleQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { max: 0, type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, IdentityProvider: { elements: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, tokenAuthMethod: { type: [{ code: "code" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, usePkce: { type: [{ code: "boolean" }] }, useSubject: { type: [{ code: "boolean" }] } } } };
|
|
40561
|
+
function sr(r7) {
|
|
40562
|
+
return new ir(r7).parse();
|
|
40563
40563
|
}
|
|
40564
|
-
var
|
|
40565
|
-
var
|
|
40566
|
-
var
|
|
40564
|
+
var de = mn(yn);
|
|
40565
|
+
var ar = /* @__PURE__ */ Object.create(null);
|
|
40566
|
+
var gn = /* @__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" };
|
|
40568
|
-
function
|
|
40568
|
+
function Sn(r7) {
|
|
40569
40569
|
let e;
|
|
40570
|
-
return e =
|
|
40570
|
+
return e = gn[r7], e || (e = gn[r7] = /* @__PURE__ */ Object.create(null)), e;
|
|
40571
40571
|
}
|
|
40572
|
-
function
|
|
40572
|
+
function cr(r7) {
|
|
40573
40573
|
let t = (Array.isArray(r7) ? r7 : r7.entry?.map((n) => n.resource) ?? []).filter((n) => n?.resourceType === "StructureDefinition");
|
|
40574
|
-
|
|
40575
|
-
for (let n of t)
|
|
40574
|
+
wn(t);
|
|
40575
|
+
for (let n of t) ur(n);
|
|
40576
40576
|
}
|
|
40577
|
-
function
|
|
40577
|
+
function ur(r7) {
|
|
40578
40578
|
if (!r7?.name) throw new Error("Failed loading StructureDefinition from bundle");
|
|
40579
40579
|
if (r7.resourceType !== "StructureDefinition") return;
|
|
40580
|
-
let e =
|
|
40581
|
-
t ? (n =
|
|
40580
|
+
let e = sr(r7), t = io[r7.url], n, i;
|
|
40581
|
+
t ? (n = de, 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 = de, i = r7.type) : (n = Sn(r7.url), i = r7.type), n[i] = e;
|
|
40582
40582
|
for (let o of e.innerTypes) o.parentType = e, n[o.name] = o;
|
|
40583
|
-
|
|
40583
|
+
ar[r7.url] = e;
|
|
40584
40584
|
}
|
|
40585
40585
|
function En(r7) {
|
|
40586
|
-
return !!
|
|
40586
|
+
return !!de[r7];
|
|
40587
40587
|
}
|
|
40588
|
-
function
|
|
40588
|
+
function Ne(r7, e) {
|
|
40589
40589
|
if (e) {
|
|
40590
|
-
let t =
|
|
40590
|
+
let t = Sn(e)[r7];
|
|
40591
40591
|
if (t) return t;
|
|
40592
40592
|
}
|
|
40593
|
-
return
|
|
40593
|
+
return de[r7];
|
|
40594
40594
|
}
|
|
40595
|
-
function
|
|
40596
|
-
return !!
|
|
40595
|
+
function Cn(r7) {
|
|
40596
|
+
return !!ar[r7];
|
|
40597
40597
|
}
|
|
40598
|
-
var
|
|
40598
|
+
var ir = class {
|
|
40599
40599
|
constructor(e) {
|
|
40600
40600
|
if (!e.snapshot?.element || e.snapshot.element.length === 0) throw new Error(`No snapshot defined for StructureDefinition '${e.name}'`);
|
|
40601
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 = [];
|
|
@@ -40606,7 +40606,7 @@ var or = class {
|
|
|
40606
40606
|
if (e.sliceName) this.parseSliceStart(e);
|
|
40607
40607
|
else if (e.id?.includes(":")) {
|
|
40608
40608
|
if (this.slicingContext?.current) {
|
|
40609
|
-
let t =
|
|
40609
|
+
let t = nr(e, this.slicingContext.path);
|
|
40610
40610
|
this.slicingContext.current.elements[t] = this.parseElementDefinition(e);
|
|
40611
40611
|
}
|
|
40612
40612
|
} else {
|
|
@@ -40615,13 +40615,13 @@ var or = class {
|
|
|
40615
40615
|
let n = this.backboneContext;
|
|
40616
40616
|
for (; n; ) {
|
|
40617
40617
|
if (e.path?.startsWith(n.path + ".")) {
|
|
40618
|
-
n.type.elements[
|
|
40618
|
+
n.type.elements[nr(e, n.path)] = t;
|
|
40619
40619
|
break;
|
|
40620
40620
|
}
|
|
40621
40621
|
n = n.parent;
|
|
40622
40622
|
}
|
|
40623
40623
|
if (!n) {
|
|
40624
|
-
let i =
|
|
40624
|
+
let i = nr(e, this.root.path);
|
|
40625
40625
|
e.isSummary && this.resourceSchema.summaryProperties?.add(i.replace("[x]", "")), t.min > 0 && this.resourceSchema.mandatoryProperties?.add(i.replace("[x]", "")), this.resourceSchema.elements[i] = t;
|
|
40626
40626
|
}
|
|
40627
40627
|
this.checkFieldExit(e);
|
|
@@ -40631,12 +40631,12 @@ var or = class {
|
|
|
40631
40631
|
return this.checkFieldExit(), this.innerTypes.length > 0 && (this.resourceSchema.innerTypes = this.innerTypes), this.resourceSchema;
|
|
40632
40632
|
}
|
|
40633
40633
|
checkFieldEnter(e, t) {
|
|
40634
|
-
this.isInnerType(e) && this.enterInnerType(e), this.slicingContext && !
|
|
40634
|
+
this.isInnerType(e) && this.enterInnerType(e), this.slicingContext && !we(this.slicingContext.path, e?.path) && (this.slicingContext = void 0), e.slicing && !this.slicingContext && this.enterSlice(e, t);
|
|
40635
40635
|
}
|
|
40636
40636
|
enterInnerType(e) {
|
|
40637
|
-
for (; this.backboneContext && !
|
|
40638
|
-
let t =
|
|
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:
|
|
40637
|
+
for (; this.backboneContext && !we(this.backboneContext?.path, e.path); ) this.innerTypes.push(this.backboneContext.type), this.backboneContext = this.backboneContext.parent;
|
|
40638
|
+
let t = or(e);
|
|
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: we(this.backboneContext?.path, e.path) ? this.backboneContext : this.backboneContext?.parent };
|
|
40640
40640
|
}
|
|
40641
40641
|
enterSlice(e, t) {
|
|
40642
40642
|
ao(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
|
|
@@ -40645,9 +40645,9 @@ var or = class {
|
|
|
40645
40645
|
}), slices: [], ordered: e.slicing?.ordered ?? false, rule: e.slicing?.rules }, this.slicingContext = { field: t.slicing, path: e.path ?? "" });
|
|
40646
40646
|
}
|
|
40647
40647
|
checkFieldExit(e = void 0) {
|
|
40648
|
-
if (this.backboneContext && !
|
|
40648
|
+
if (this.backboneContext && !we(this.backboneContext.path, e?.path)) if (this.backboneContext.parent) do
|
|
40649
40649
|
this.innerTypes.push(this.backboneContext.type), this.backboneContext = this.backboneContext.parent;
|
|
40650
|
-
while (this.backboneContext && !
|
|
40650
|
+
while (this.backboneContext && !we(this.backboneContext.path, e?.path));
|
|
40651
40651
|
else this.innerTypes.push(this.backboneContext.type), this.backboneContext = void 0;
|
|
40652
40652
|
}
|
|
40653
40653
|
next() {
|
|
@@ -40666,7 +40666,7 @@ var or = class {
|
|
|
40666
40666
|
}
|
|
40667
40667
|
isInnerType(e) {
|
|
40668
40668
|
let t = this.peek();
|
|
40669
|
-
return !!(
|
|
40669
|
+
return !!(we(e?.path, t?.path) && e.type?.some((n) => ["BackboneElement", "Element"].includes(n.code)));
|
|
40670
40670
|
}
|
|
40671
40671
|
parseSliceStart(e) {
|
|
40672
40672
|
if (!this.slicingContext) throw new Error(`Invalid slice start before discriminator: ${e.sliceName} (${e.id})`);
|
|
@@ -40675,27 +40675,27 @@ var or = class {
|
|
|
40675
40675
|
parseElementDefinitionType(e) {
|
|
40676
40676
|
return (e.type ?? []).map((t) => {
|
|
40677
40677
|
let n;
|
|
40678
|
-
return (t.code === "BackboneElement" || t.code === "Element") && (n =
|
|
40678
|
+
return (t.code === "BackboneElement" || t.code === "Element") && (n = or(e)), n || (n = te(t, "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")?.valueUrl), n || (n = t.code ?? ""), { code: n, targetProfile: t.targetProfile, profile: t.profile };
|
|
40679
40679
|
});
|
|
40680
40680
|
}
|
|
40681
40681
|
parseElementDefinition(e) {
|
|
40682
|
-
let t =
|
|
40683
|
-
return { description: e.definition || "", path: e.path || e.base?.path || "", min: e.min ?? 0, max: t, isArray: n > 1, constraints: (e.constraint ?? []).map((o) => ({ key: o.key ?? "", severity: o.severity ?? "error", expression: o.expression ?? "", description: o.human ?? "" })), type: this.parseElementDefinitionType(e), fixed:
|
|
40682
|
+
let t = vn(e.max), n = e.base?.max ? vn(e.base.max) : t, i = { type: "ElementDefinition", value: e };
|
|
40683
|
+
return { description: e.definition || "", path: e.path || e.base?.path || "", min: e.min ?? 0, max: t, isArray: n > 1, constraints: (e.constraint ?? []).map((o) => ({ key: o.key ?? "", severity: o.severity ?? "error", expression: o.expression ?? "", description: o.human ?? "" })), type: this.parseElementDefinitionType(e), fixed: Tn(P(i, "fixed[x]")), pattern: Tn(P(i, "pattern[x]")), binding: e.binding };
|
|
40684
40684
|
}
|
|
40685
40685
|
};
|
|
40686
|
-
function
|
|
40686
|
+
function vn(r7) {
|
|
40687
40687
|
return r7 === "*" ? Number.POSITIVE_INFINITY : Number.parseInt(r7, 10);
|
|
40688
40688
|
}
|
|
40689
|
-
function
|
|
40689
|
+
function nr(r7, e = "") {
|
|
40690
40690
|
return so(r7.path, e);
|
|
40691
40691
|
}
|
|
40692
40692
|
function so(r7, e) {
|
|
40693
40693
|
return r7 ? e && r7.startsWith(e) ? r7.substring(e.length + 1) : r7 : "";
|
|
40694
40694
|
}
|
|
40695
|
-
function
|
|
40695
|
+
function we(r7, e) {
|
|
40696
40696
|
return !r7 || !e ? false : e.startsWith(r7 + ".") || e === r7;
|
|
40697
40697
|
}
|
|
40698
|
-
function
|
|
40698
|
+
function Tn(r7) {
|
|
40699
40699
|
return Array.isArray(r7) && r7.length > 0 ? r7[0] : S(r7) ? void 0 : r7;
|
|
40700
40700
|
}
|
|
40701
40701
|
function ao(r7) {
|
|
@@ -40706,17 +40706,17 @@ function co(r7) {
|
|
|
40706
40706
|
let e = r7.description;
|
|
40707
40707
|
return e?.startsWith(`Base StructureDefinition for ${r7.name} Type: `) && (e = e.substring(`Base StructureDefinition for ${r7.name} Type: `.length)), e;
|
|
40708
40708
|
}
|
|
40709
|
-
var
|
|
40709
|
+
var nt = { 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: /.*/ };
|
|
40710
40710
|
function f(r7) {
|
|
40711
40711
|
return [{ type: p.boolean, value: r7 }];
|
|
40712
40712
|
}
|
|
40713
40713
|
function g(r7) {
|
|
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 } :
|
|
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 } : Tr(r7) ? { type: p.CodeableConcept, value: r7 } : vr(r7) ? { type: p.Coding, value: r7 } : { type: p.BackboneElement, value: r7 };
|
|
40715
40715
|
}
|
|
40716
40716
|
function N(r7) {
|
|
40717
40717
|
return r7.length === 0 ? false : !!r7[0].value;
|
|
40718
40718
|
}
|
|
40719
|
-
function
|
|
40719
|
+
function G(r7, e) {
|
|
40720
40720
|
if (r7.length !== 0) {
|
|
40721
40721
|
if (r7.length === 1 && (!e || r7[0].type === e)) return r7[0];
|
|
40722
40722
|
throw new Error(`Expected singleton of type ${e}, but found ${JSON.stringify(r7)}`);
|
|
@@ -40724,7 +40724,7 @@ function $(r7, e) {
|
|
|
40724
40724
|
}
|
|
40725
40725
|
function P(r7, e, t) {
|
|
40726
40726
|
if (!r7.value) return;
|
|
40727
|
-
let n =
|
|
40727
|
+
let n = st(r7.type, e, t?.profileUrl);
|
|
40728
40728
|
return n ? To(r7, e, n) : So(r7, e);
|
|
40729
40729
|
}
|
|
40730
40730
|
function To(r7, e, t) {
|
|
@@ -40732,19 +40732,19 @@ function To(r7, e, t) {
|
|
|
40732
40732
|
if (!i || i.length === 0) return;
|
|
40733
40733
|
let o, s = "undefined", a2, c = t.path.lastIndexOf("."), u2 = t.path.substring(c + 1);
|
|
40734
40734
|
for (let l2 of i) {
|
|
40735
|
-
let
|
|
40736
|
-
if (o = n[
|
|
40735
|
+
let h = u2.replace("[x]", I(l2.code));
|
|
40736
|
+
if (o = n[h], a2 = n["_" + h], o !== void 0 || a2 !== void 0) {
|
|
40737
40737
|
s = l2.code;
|
|
40738
40738
|
break;
|
|
40739
40739
|
}
|
|
40740
40740
|
}
|
|
40741
40741
|
if (a2) if (Array.isArray(o)) {
|
|
40742
40742
|
o = o.slice();
|
|
40743
|
-
for (let l2 = 0; l2 < Math.max(o.length, a2.length); l2++) o[l2] =
|
|
40744
|
-
} else o =
|
|
40745
|
-
if (!S(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((l2) =>
|
|
40743
|
+
for (let l2 = 0; l2 < Math.max(o.length, a2.length); l2++) o[l2] = Dn(o[l2], a2[l2]);
|
|
40744
|
+
} else o = Dn(o, a2);
|
|
40745
|
+
if (!S(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((l2) => On(l2, s)) : On(o, s);
|
|
40746
40746
|
}
|
|
40747
|
-
function
|
|
40747
|
+
function On(r7, e) {
|
|
40748
40748
|
return e === "Resource" && k(r7) && (e = r7.resourceType), { type: e, value: r7 };
|
|
40749
40749
|
}
|
|
40750
40750
|
function So(r7, e) {
|
|
@@ -40770,11 +40770,11 @@ function So(r7, e) {
|
|
|
40770
40770
|
} else if (S(n)) return;
|
|
40771
40771
|
return n;
|
|
40772
40772
|
}
|
|
40773
|
-
function
|
|
40773
|
+
function it(r7) {
|
|
40774
40774
|
let e = [];
|
|
40775
40775
|
for (let t of r7) {
|
|
40776
40776
|
let n = false;
|
|
40777
|
-
for (let i of e) if (N(
|
|
40777
|
+
for (let i of e) if (N(yr(t, i))) {
|
|
40778
40778
|
n = true;
|
|
40779
40779
|
break;
|
|
40780
40780
|
}
|
|
@@ -40782,31 +40782,31 @@ function ot(r7) {
|
|
|
40782
40782
|
}
|
|
40783
40783
|
return e;
|
|
40784
40784
|
}
|
|
40785
|
-
function
|
|
40785
|
+
function Mn(r7) {
|
|
40786
40786
|
return f(!N(r7));
|
|
40787
40787
|
}
|
|
40788
|
-
function Mn(r7, e) {
|
|
40789
|
-
return r7.length === 0 || e.length === 0 ? [] : r7.length !== e.length ? f(false) : f(r7.every((t, n) => N(gr(t, e[n]))));
|
|
40790
|
-
}
|
|
40791
40788
|
function _n(r7, e) {
|
|
40792
|
-
return r7.length === 0 || e.length === 0 ? [] : r7.length !== e.length ? f(
|
|
40789
|
+
return r7.length === 0 || e.length === 0 ? [] : r7.length !== e.length ? f(false) : f(r7.every((t, n) => N(yr(t, e[n]))));
|
|
40793
40790
|
}
|
|
40794
|
-
function
|
|
40791
|
+
function Nn(r7, e) {
|
|
40792
|
+
return r7.length === 0 || e.length === 0 ? [] : r7.length !== e.length ? f(true) : f(r7.some((t, n) => !N(yr(t, e[n]))));
|
|
40793
|
+
}
|
|
40794
|
+
function yr(r7, e) {
|
|
40795
40795
|
let t = r7.value?.valueOf(), n = e.value?.valueOf();
|
|
40796
|
-
return typeof t == "number" && typeof n == "number" ? f(Math.abs(t - n) < 1e-8) : V(t) && V(n) ? f(
|
|
40796
|
+
return typeof t == "number" && typeof n == "number" ? f(Math.abs(t - n) < 1e-8) : V(t) && V(n) ? f(Un(t, n)) : f(typeof t == "object" && typeof n == "object" ? xr(r7, e) : t === n);
|
|
40797
40797
|
}
|
|
40798
|
-
function
|
|
40799
|
-
return r7.length === 0 && e.length === 0 ? f(true) : r7.length !== e.length ? f(false) : (r7.sort(
|
|
40798
|
+
function gr(r7, e) {
|
|
40799
|
+
return r7.length === 0 && e.length === 0 ? f(true) : r7.length !== e.length ? f(false) : (r7.sort(In), e.sort(In), f(r7.every((t, n) => N(bo(t, e[n])))));
|
|
40800
40800
|
}
|
|
40801
|
-
function
|
|
40801
|
+
function bo(r7, e) {
|
|
40802
40802
|
let { type: t, value: n } = r7, { type: i, value: o } = e, s = n?.valueOf(), a2 = o?.valueOf();
|
|
40803
|
-
return typeof s == "number" && typeof a2 == "number" ? f(Math.abs(s - a2) < 0.01) : V(s) && V(a2) ? f(
|
|
40803
|
+
return typeof s == "number" && typeof a2 == "number" ? f(Math.abs(s - a2) < 0.01) : V(s) && V(a2) ? f(Un(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" ? xr({ ...s, id: void 0 }, { ...a2, id: void 0 }) : typeof s == "string" && typeof a2 == "string" ? s.toLowerCase() === a2.toLowerCase() : s === a2);
|
|
40804
40804
|
}
|
|
40805
|
-
function
|
|
40805
|
+
function In(r7, e) {
|
|
40806
40806
|
let t = r7.value?.valueOf(), n = e.value?.valueOf();
|
|
40807
40807
|
return typeof t == "number" && typeof n == "number" ? t - n : typeof t == "string" && typeof n == "string" ? t.localeCompare(n) : 0;
|
|
40808
40808
|
}
|
|
40809
|
-
function
|
|
40809
|
+
function ot(r7, e) {
|
|
40810
40810
|
let { value: t } = r7;
|
|
40811
40811
|
if (t == null) return false;
|
|
40812
40812
|
switch (e) {
|
|
@@ -40816,67 +40816,67 @@ function st(r7, e) {
|
|
|
40816
40816
|
case "Integer":
|
|
40817
40817
|
return typeof t == "number";
|
|
40818
40818
|
case "Date":
|
|
40819
|
-
return
|
|
40819
|
+
return Ln(t);
|
|
40820
40820
|
case "DateTime":
|
|
40821
|
-
return
|
|
40821
|
+
return Oe(t);
|
|
40822
40822
|
case "Time":
|
|
40823
40823
|
return typeof t == "string" && !!/^T\d/.exec(t);
|
|
40824
40824
|
case "Period":
|
|
40825
|
-
return
|
|
40825
|
+
return Fn(t);
|
|
40826
40826
|
case "Quantity":
|
|
40827
40827
|
return V(t);
|
|
40828
40828
|
default:
|
|
40829
40829
|
return r7.type === e || typeof t == "object" && t?.resourceType === e;
|
|
40830
40830
|
}
|
|
40831
40831
|
}
|
|
40832
|
-
function
|
|
40833
|
-
return typeof r7 == "string" && !!
|
|
40832
|
+
function Ln(r7) {
|
|
40833
|
+
return typeof r7 == "string" && !!nt.date.exec(r7);
|
|
40834
40834
|
}
|
|
40835
|
-
function
|
|
40836
|
-
return typeof r7 == "string" && !!
|
|
40835
|
+
function Oe(r7) {
|
|
40836
|
+
return typeof r7 == "string" && !!nt.dateTime.exec(r7);
|
|
40837
40837
|
}
|
|
40838
|
-
function
|
|
40839
|
-
return !!(r7 && typeof r7 == "object" && ("start" in r7 &&
|
|
40838
|
+
function Fn(r7) {
|
|
40839
|
+
return !!(r7 && typeof r7 == "object" && ("start" in r7 && Oe(r7.start) || "end" in r7 && Oe(r7.end)));
|
|
40840
40840
|
}
|
|
40841
40841
|
function V(r7) {
|
|
40842
40842
|
return !!(r7 && typeof r7 == "object" && "value" in r7 && typeof r7.value == "number");
|
|
40843
40843
|
}
|
|
40844
|
-
function
|
|
40844
|
+
function Un(r7, e) {
|
|
40845
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);
|
|
40846
40846
|
}
|
|
40847
|
-
function
|
|
40847
|
+
function xr(r7, e) {
|
|
40848
40848
|
let t = Object.keys(r7), n = Object.keys(e);
|
|
40849
40849
|
if (t.length !== n.length) return false;
|
|
40850
40850
|
for (let i of t) {
|
|
40851
40851
|
let o = r7[i], s = e[i];
|
|
40852
|
-
if (
|
|
40853
|
-
if (!
|
|
40852
|
+
if (Vn(o) && Vn(s)) {
|
|
40853
|
+
if (!xr(o, s)) return false;
|
|
40854
40854
|
} else if (o !== s) return false;
|
|
40855
40855
|
}
|
|
40856
40856
|
return true;
|
|
40857
40857
|
}
|
|
40858
|
-
function
|
|
40858
|
+
function Vn(r7) {
|
|
40859
40859
|
return r7 !== null && typeof r7 == "object";
|
|
40860
40860
|
}
|
|
40861
|
-
function
|
|
40861
|
+
function Dn(r7, e) {
|
|
40862
40862
|
if (e) {
|
|
40863
40863
|
if (typeof e != "object") throw new Error("Primitive extension must be an object");
|
|
40864
|
-
return
|
|
40864
|
+
return Eo(r7 ?? {}, e);
|
|
40865
40865
|
}
|
|
40866
40866
|
return r7;
|
|
40867
40867
|
}
|
|
40868
|
-
function
|
|
40868
|
+
function Eo(r7, e) {
|
|
40869
40869
|
return delete e.__proto__, delete e.constructor, Object.assign(r7, e);
|
|
40870
40870
|
}
|
|
40871
|
-
function
|
|
40872
|
-
let e =
|
|
40871
|
+
function ne(r7) {
|
|
40872
|
+
let e = fe(r7), t = Co(r7);
|
|
40873
40873
|
return t === e ? { reference: e } : { reference: e, display: t };
|
|
40874
40874
|
}
|
|
40875
|
-
function de(r7) {
|
|
40876
|
-
return pe(r7) ? r7.reference : `${r7.resourceType}/${r7.id}`;
|
|
40877
|
-
}
|
|
40878
40875
|
function fe(r7) {
|
|
40879
|
-
|
|
40876
|
+
return $(r7) ? r7.reference : `${r7.resourceType}/${r7.id}`;
|
|
40877
|
+
}
|
|
40878
|
+
function he(r7) {
|
|
40879
|
+
if (r7) return $(r7) ? r7.reference.split("/")[1] : r7.id;
|
|
40880
40880
|
}
|
|
40881
40881
|
function Ro(r7) {
|
|
40882
40882
|
return r7.resourceType === "Patient" || r7.resourceType === "Practitioner" || r7.resourceType === "RelatedPerson";
|
|
@@ -40890,43 +40890,43 @@ function Co(r7) {
|
|
|
40890
40890
|
let e = wo(r7);
|
|
40891
40891
|
if (e) return e;
|
|
40892
40892
|
}
|
|
40893
|
-
if (r7.resourceType === "MedicationRequest" && r7.medicationCodeableConcept) return
|
|
40893
|
+
if (r7.resourceType === "MedicationRequest" && r7.medicationCodeableConcept) return Ue(r7.medicationCodeableConcept);
|
|
40894
40894
|
if (r7.resourceType === "Subscription" && r7.criteria) return r7.criteria;
|
|
40895
40895
|
if (r7.resourceType === "User" && r7.email) return r7.email;
|
|
40896
40896
|
if ("name" in r7 && r7.name && typeof r7.name == "string") return r7.name;
|
|
40897
40897
|
if ("code" in r7 && r7.code) {
|
|
40898
40898
|
let e = r7.code;
|
|
40899
|
-
if (Array.isArray(e) && (e = e[0]),
|
|
40899
|
+
if (Array.isArray(e) && (e = e[0]), Tr(e)) return Ue(e);
|
|
40900
40900
|
if (No(e)) return e.text;
|
|
40901
40901
|
}
|
|
40902
|
-
return
|
|
40902
|
+
return fe(r7);
|
|
40903
40903
|
}
|
|
40904
40904
|
function Po(r7) {
|
|
40905
40905
|
let e = r7.name;
|
|
40906
|
-
if (e && e.length > 0) return
|
|
40906
|
+
if (e && e.length > 0) return Be(e[0]);
|
|
40907
40907
|
}
|
|
40908
40908
|
function wo(r7) {
|
|
40909
40909
|
let e = r7.deviceName;
|
|
40910
40910
|
if (e && e.length > 0) return e[0].name;
|
|
40911
40911
|
}
|
|
40912
|
-
function
|
|
40912
|
+
function at(r7, e) {
|
|
40913
40913
|
let t = new Date(r7);
|
|
40914
40914
|
t.setUTCHours(0, 0, 0, 0);
|
|
40915
40915
|
let n = e ? new Date(e) : /* @__PURE__ */ new Date();
|
|
40916
40916
|
n.setUTCHours(0, 0, 0, 0);
|
|
40917
40917
|
let i = t.getUTCFullYear(), o = t.getUTCMonth(), s = t.getUTCDate(), a2 = n.getUTCFullYear(), c = n.getUTCMonth(), u2 = n.getUTCDate(), l2 = a2 - i;
|
|
40918
40918
|
(c < o || c === o && u2 < s) && l2--;
|
|
40919
|
-
let
|
|
40920
|
-
u2 < s &&
|
|
40919
|
+
let h = a2 * 12 + c - (i * 12 + o);
|
|
40920
|
+
u2 < s && h--;
|
|
40921
40921
|
let x2 = Math.floor((n.getTime() - t.getTime()) / (1e3 * 60 * 60 * 24));
|
|
40922
|
-
return { years: l2, months:
|
|
40922
|
+
return { years: l2, months: h, days: x2 };
|
|
40923
40923
|
}
|
|
40924
|
-
function
|
|
40924
|
+
function te(r7, ...e) {
|
|
40925
40925
|
let t = r7;
|
|
40926
40926
|
for (let n = 0; n < e.length && t; n++) t = t?.extension?.find((i) => i.url === e[n]);
|
|
40927
40927
|
return t;
|
|
40928
40928
|
}
|
|
40929
|
-
function
|
|
40929
|
+
function ct(r7, e) {
|
|
40930
40930
|
return JSON.stringify(r7, Oo, e ? 2 : void 0) ?? "";
|
|
40931
40931
|
}
|
|
40932
40932
|
function Oo(r7, e) {
|
|
@@ -40938,19 +40938,19 @@ function Io(r7) {
|
|
|
40938
40938
|
function S(r7) {
|
|
40939
40939
|
if (r7 == null) return true;
|
|
40940
40940
|
let e = typeof r7;
|
|
40941
|
-
return e === "string" || e === "object" ? !
|
|
40941
|
+
return e === "string" || e === "object" ? !J(r7) : false;
|
|
40942
40942
|
}
|
|
40943
|
-
function
|
|
40943
|
+
function J(r7) {
|
|
40944
40944
|
if (r7 == null) return false;
|
|
40945
40945
|
let e = typeof r7;
|
|
40946
40946
|
return e === "string" && r7 !== "" || e === "object" && ("length" in r7 && r7.length > 0 || Object.keys(r7).length > 0);
|
|
40947
40947
|
}
|
|
40948
|
-
function
|
|
40948
|
+
function re(r7, e, t) {
|
|
40949
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);
|
|
40950
40950
|
}
|
|
40951
40951
|
function ko(r7, e) {
|
|
40952
40952
|
if (r7.length !== e.length) return false;
|
|
40953
|
-
for (let t = 0; t < r7.length; t++) if (!
|
|
40953
|
+
for (let t = 0; t < r7.length; t++) if (!re(r7[t], e[t])) return false;
|
|
40954
40954
|
return true;
|
|
40955
40955
|
}
|
|
40956
40956
|
function Vo(r7, e, t) {
|
|
@@ -40958,119 +40958,119 @@ function Vo(r7, e, t) {
|
|
|
40958
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"));
|
|
40959
40959
|
for (let i of n) {
|
|
40960
40960
|
let o = r7[i], s = e[i];
|
|
40961
|
-
if (!
|
|
40961
|
+
if (!re(o, s, i)) return false;
|
|
40962
40962
|
}
|
|
40963
40963
|
return true;
|
|
40964
40964
|
}
|
|
40965
40965
|
function R(r7) {
|
|
40966
40966
|
return r7 !== null && typeof r7 == "object";
|
|
40967
40967
|
}
|
|
40968
|
-
function
|
|
40968
|
+
function Wn(r7) {
|
|
40969
40969
|
return r7.every(_o);
|
|
40970
40970
|
}
|
|
40971
40971
|
function _o(r7) {
|
|
40972
40972
|
return typeof r7 == "string";
|
|
40973
40973
|
}
|
|
40974
|
-
function
|
|
40974
|
+
function vr(r7) {
|
|
40975
40975
|
return R(r7) && "code" in r7 && typeof r7.code == "string";
|
|
40976
40976
|
}
|
|
40977
|
-
function
|
|
40978
|
-
return R(r7) && "coding" in r7 && Array.isArray(r7.coding) && r7.coding.every(
|
|
40977
|
+
function Tr(r7) {
|
|
40978
|
+
return R(r7) && "coding" in r7 && Array.isArray(r7.coding) && r7.coding.every(vr);
|
|
40979
40979
|
}
|
|
40980
40980
|
function No(r7) {
|
|
40981
40981
|
return R(r7) && "text" in r7 && typeof r7.text == "string";
|
|
40982
40982
|
}
|
|
40983
|
-
var
|
|
40984
|
-
for (let r7 = 0; r7 < 256; r7++)
|
|
40985
|
-
function
|
|
40986
|
-
let e =
|
|
40987
|
-
for (let i = 0; i < t.length; i++) n[i] =
|
|
40983
|
+
var $n = [];
|
|
40984
|
+
for (let r7 = 0; r7 < 256; r7++) $n.push(r7.toString(16).padStart(2, "0"));
|
|
40985
|
+
function Gn(r7) {
|
|
40986
|
+
let e = Qn(r7), t = new Uint8Array(e), n = new Array(t.length);
|
|
40987
|
+
for (let i = 0; i < t.length; i++) n[i] = $n[t[i]];
|
|
40988
40988
|
return n.join("");
|
|
40989
40989
|
}
|
|
40990
|
-
function
|
|
40991
|
-
let e =
|
|
40990
|
+
function Hn(r7) {
|
|
40991
|
+
let e = Qn(r7), t = new Uint8Array(e), n = new Array(t.length);
|
|
40992
40992
|
for (let i = 0; i < t.length; i++) n[i] = String.fromCharCode(t[i]);
|
|
40993
40993
|
return window.btoa(n.join(""));
|
|
40994
40994
|
}
|
|
40995
|
-
function
|
|
40995
|
+
function Qn(r7) {
|
|
40996
40996
|
return ArrayBuffer.isView(r7) ? r7.buffer : r7;
|
|
40997
40997
|
}
|
|
40998
40998
|
function I(r7) {
|
|
40999
40999
|
return r7 ? r7.charAt(0).toUpperCase() + r7.substring(1) : "";
|
|
41000
41000
|
}
|
|
41001
|
-
var
|
|
41001
|
+
var Er = (r7) => new Promise((e) => {
|
|
41002
41002
|
setTimeout(e, r7);
|
|
41003
41003
|
});
|
|
41004
|
-
function
|
|
41004
|
+
function ut(r7) {
|
|
41005
41005
|
return r7.sort((e, t) => e.localeCompare(t));
|
|
41006
41006
|
}
|
|
41007
|
-
function
|
|
41007
|
+
function Cr(r7) {
|
|
41008
41008
|
return r7.endsWith("/") ? r7 : r7 + "/";
|
|
41009
41009
|
}
|
|
41010
41010
|
function jo(r7) {
|
|
41011
41011
|
return r7.startsWith("/") ? r7.slice(1) : r7;
|
|
41012
41012
|
}
|
|
41013
41013
|
function q(r7, e) {
|
|
41014
|
-
return new URL(jo(e),
|
|
41014
|
+
return new URL(jo(e), Cr(r7.toString())).toString();
|
|
41015
41015
|
}
|
|
41016
|
-
function
|
|
41016
|
+
function Yn(r7, e) {
|
|
41017
41017
|
return q(r7, e).toString().replace("http://", "ws://").replace("https://", "wss://");
|
|
41018
41018
|
}
|
|
41019
|
-
function
|
|
41019
|
+
function Zn(r7) {
|
|
41020
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();
|
|
41021
41021
|
}
|
|
41022
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
|
|
41023
|
+
function dl(r7) {
|
|
41024
41024
|
return Wo.test(r7);
|
|
41025
41025
|
}
|
|
41026
|
-
function
|
|
41026
|
+
function Be(r7, e) {
|
|
41027
41027
|
let t = [];
|
|
41028
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) {
|
|
41029
|
-
let n =
|
|
41029
|
+
let n = ye(r7.text);
|
|
41030
41030
|
if (n) return n;
|
|
41031
41031
|
}
|
|
41032
41032
|
return t.join(" ").trim();
|
|
41033
41033
|
}
|
|
41034
|
-
function
|
|
41034
|
+
function Ue(r7) {
|
|
41035
41035
|
if (!r7) return "";
|
|
41036
|
-
let e =
|
|
41037
|
-
return e || (r7.coding ? r7.coding.map((t) =>
|
|
41036
|
+
let e = ye(r7.text);
|
|
41037
|
+
return e || (r7.coding ? r7.coding.map((t) => Xn(t)).join(", ") : "");
|
|
41038
41038
|
}
|
|
41039
|
-
function
|
|
41040
|
-
let t =
|
|
41039
|
+
function Xn(r7, e) {
|
|
41040
|
+
let t = ye(r7?.display);
|
|
41041
41041
|
if (t) {
|
|
41042
|
-
let n = e ?
|
|
41042
|
+
let n = e ? ye(r7?.code) : void 0;
|
|
41043
41043
|
return `${t}${n ? " (" + n + ")" : ""}`;
|
|
41044
41044
|
}
|
|
41045
|
-
return
|
|
41045
|
+
return ye(r7?.code) ?? "";
|
|
41046
41046
|
}
|
|
41047
|
-
function
|
|
41047
|
+
function ye(r7) {
|
|
41048
41048
|
return typeof r7 == "string" ? r7 : void 0;
|
|
41049
41049
|
}
|
|
41050
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
|
|
41051
|
+
function wn(r7) {
|
|
41052
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" &&
|
|
41053
|
+
for (let t of e) t?.resourceType === "StructureDefinition" && t.kind === "resource" && ri(t.type);
|
|
41054
41054
|
}
|
|
41055
|
-
function
|
|
41055
|
+
function ri(r7) {
|
|
41056
41056
|
let e = L.types[r7];
|
|
41057
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;
|
|
41058
41058
|
}
|
|
41059
|
-
function
|
|
41059
|
+
function Ar(r7) {
|
|
41060
41060
|
for (let e of r7.base ?? []) {
|
|
41061
|
-
let t =
|
|
41061
|
+
let t = ri(e);
|
|
41062
41062
|
t.searchParams || (t.searchParams = {}), t.searchParams[r7.code] = r7;
|
|
41063
41063
|
}
|
|
41064
41064
|
}
|
|
41065
|
-
function
|
|
41065
|
+
function or(r7) {
|
|
41066
41066
|
let e = r7.type?.[0]?.code;
|
|
41067
41067
|
return e === "BackboneElement" || e === "Element" ? es((r7.base?.path ?? r7.path)?.split(".")) : e;
|
|
41068
41068
|
}
|
|
41069
41069
|
function es(r7) {
|
|
41070
41070
|
return r7.length === 1 ? r7[0] : r7.map(I).join("");
|
|
41071
41071
|
}
|
|
41072
|
-
function
|
|
41073
|
-
let n =
|
|
41072
|
+
function st(r7, e, t) {
|
|
41073
|
+
let n = Ne(r7, t);
|
|
41074
41074
|
if (n) return is(n.elements, e);
|
|
41075
41075
|
}
|
|
41076
41076
|
function is(r7, e) {
|
|
@@ -41087,7 +41087,7 @@ function is(r7, e) {
|
|
|
41087
41087
|
function k(r7) {
|
|
41088
41088
|
return !!(r7 && typeof r7 == "object" && "resourceType" in r7);
|
|
41089
41089
|
}
|
|
41090
|
-
function
|
|
41090
|
+
function $(r7) {
|
|
41091
41091
|
return !!(r7 && typeof r7 == "object" && "reference" in r7 && typeof r7.reference == "string");
|
|
41092
41092
|
}
|
|
41093
41093
|
var L = { types: {} };
|
|
@@ -41100,7 +41100,7 @@ function ke(r7) {
|
|
|
41100
41100
|
return r7;
|
|
41101
41101
|
}
|
|
41102
41102
|
}
|
|
41103
|
-
var
|
|
41103
|
+
var Y = () => [];
|
|
41104
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) => {
|
|
41105
41105
|
for (let t of e) if (!t.value) return f(false);
|
|
41106
41106
|
return f(true);
|
|
@@ -41115,16 +41115,16 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
|
|
|
41115
41115
|
return f(false);
|
|
41116
41116
|
}, subsetOf: (r7, e, t) => {
|
|
41117
41117
|
if (e.length === 0) return f(true);
|
|
41118
|
-
let n = t.eval(r7,
|
|
41118
|
+
let n = t.eval(r7, ge(r7));
|
|
41119
41119
|
return n.length === 0 ? f(false) : f(e.every((i) => n.some((o) => o.value === i.value)));
|
|
41120
41120
|
}, supersetOf: (r7, e, t) => {
|
|
41121
|
-
let n = t.eval(r7,
|
|
41121
|
+
let n = t.eval(r7, ge(r7));
|
|
41122
41122
|
return n.length === 0 ? f(true) : e.length === 0 ? f(false) : f(n.every((i) => e.some((o) => o.value === i.value)));
|
|
41123
41123
|
}, count: (r7, e) => [{ type: p.integer, value: e.length }], distinct: (r7, e) => {
|
|
41124
41124
|
let t = [];
|
|
41125
41125
|
for (let n of e) t.some((i) => i.value === n.value) || t.push(n);
|
|
41126
41126
|
return t;
|
|
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:
|
|
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: Y, ofType: (r7, e, t) => e.filter((n) => n.type === t.name), single: (r7, e) => {
|
|
41128
41128
|
if (e.length > 1) throw new Error("Expected input length one for single()");
|
|
41129
41129
|
return e.length === 0 ? [] : e.slice(0, 1);
|
|
41130
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) => {
|
|
@@ -41137,21 +41137,21 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
|
|
|
41137
41137
|
return n >= e.length ? e : n <= 0 ? [] : e.slice(0, n);
|
|
41138
41138
|
}, intersect: (r7, e, t) => {
|
|
41139
41139
|
if (!t) return e;
|
|
41140
|
-
let n = t.eval(r7,
|
|
41140
|
+
let n = t.eval(r7, ge(r7)), i = [];
|
|
41141
41141
|
for (let o of e) !i.some((s) => s.value === o.value) && n.some((s) => s.value === o.value) && i.push(o);
|
|
41142
41142
|
return i;
|
|
41143
41143
|
}, exclude: (r7, e, t) => {
|
|
41144
41144
|
if (!t) return e;
|
|
41145
|
-
let n = t.eval(r7,
|
|
41145
|
+
let n = t.eval(r7, ge(r7)), i = [];
|
|
41146
41146
|
for (let o of e) n.some((s) => s.value === o.value) || i.push(o);
|
|
41147
41147
|
return i;
|
|
41148
41148
|
}, union: (r7, e, t) => {
|
|
41149
41149
|
if (!t) return e;
|
|
41150
|
-
let n = t.eval(r7,
|
|
41151
|
-
return
|
|
41150
|
+
let n = t.eval(r7, ge(r7));
|
|
41151
|
+
return it([...e, ...n]);
|
|
41152
41152
|
}, combine: (r7, e, t) => {
|
|
41153
41153
|
if (!t) return e;
|
|
41154
|
-
let n = t.eval(r7,
|
|
41154
|
+
let n = t.eval(r7, ge(r7));
|
|
41155
41155
|
return [...e, ...n];
|
|
41156
41156
|
}, htmlChecks: (r7, e, t) => [g(true)], iif: (r7, e, t, n, i) => {
|
|
41157
41157
|
let o = t.eval(r7, e);
|
|
@@ -41159,7 +41159,7 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
|
|
|
41159
41159
|
return N(o) ? n.eval(r7, e) : i ? i.eval(r7, e) : [];
|
|
41160
41160
|
}, toBoolean: (r7, e) => {
|
|
41161
41161
|
if (e.length === 0) return [];
|
|
41162
|
-
let [{ value: t }] =
|
|
41162
|
+
let [{ value: t }] = z(e, 1);
|
|
41163
41163
|
if (typeof t == "boolean") return [{ type: p.boolean, value: t }];
|
|
41164
41164
|
if (typeof t == "number" && (t === 0 || t === 1)) return f(!!t);
|
|
41165
41165
|
if (typeof t == "string") {
|
|
@@ -41170,31 +41170,31 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
|
|
|
41170
41170
|
return [];
|
|
41171
41171
|
}, convertsToBoolean: (r7, e) => e.length === 0 ? [] : f(O.toBoolean(r7, e).length === 1), toInteger: (r7, e) => {
|
|
41172
41172
|
if (e.length === 0) return [];
|
|
41173
|
-
let [{ value: t }] =
|
|
41173
|
+
let [{ value: t }] = z(e, 1);
|
|
41174
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
41175
|
}, convertsToInteger: (r7, e) => e.length === 0 ? [] : f(O.toInteger(r7, e).length === 1), toDate: (r7, e) => {
|
|
41176
41176
|
if (e.length === 0) return [];
|
|
41177
|
-
let [{ value: t }] =
|
|
41177
|
+
let [{ value: t }] = z(e, 1);
|
|
41178
41178
|
return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: p.date, value: ke(t) }] : [];
|
|
41179
41179
|
}, convertsToDate: (r7, e) => e.length === 0 ? [] : f(O.toDate(r7, e).length === 1), toDateTime: (r7, e) => {
|
|
41180
41180
|
if (e.length === 0) return [];
|
|
41181
|
-
let [{ value: t }] =
|
|
41181
|
+
let [{ value: t }] = z(e, 1);
|
|
41182
41182
|
return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: p.dateTime, value: ke(t) }] : [];
|
|
41183
41183
|
}, convertsToDateTime: (r7, e) => e.length === 0 ? [] : f(O.toDateTime(r7, e).length === 1), toDecimal: (r7, e) => {
|
|
41184
41184
|
if (e.length === 0) return [];
|
|
41185
|
-
let [{ value: t }] =
|
|
41185
|
+
let [{ value: t }] = z(e, 1);
|
|
41186
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
41187
|
}, convertsToDecimal: (r7, e) => e.length === 0 ? [] : f(O.toDecimal(r7, e).length === 1), toQuantity: (r7, e) => {
|
|
41188
41188
|
if (e.length === 0) return [];
|
|
41189
|
-
let [{ value: t }] =
|
|
41189
|
+
let [{ value: t }] = z(e, 1);
|
|
41190
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
41191
|
}, convertsToQuantity: (r7, e) => e.length === 0 ? [] : f(O.toQuantity(r7, e).length === 1), toString: (r7, e) => {
|
|
41192
41192
|
if (e.length === 0) return [];
|
|
41193
|
-
let [{ value: t }] =
|
|
41193
|
+
let [{ value: t }] = z(e, 1);
|
|
41194
41194
|
return t == null ? [] : V(t) ? [{ type: p.string, value: `${t.value} '${t.unit}'` }] : [{ type: p.string, value: t.toString() }];
|
|
41195
41195
|
}, convertsToString: (r7, e) => e.length === 0 ? [] : f(O.toString(r7, e).length === 1), toTime: (r7, e) => {
|
|
41196
41196
|
if (e.length === 0) return [];
|
|
41197
|
-
let [{ value: t }] =
|
|
41197
|
+
let [{ value: t }] = z(e, 1);
|
|
41198
41198
|
if (typeof t == "string") {
|
|
41199
41199
|
let n = /^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(t);
|
|
41200
41200
|
if (n) return [{ type: p.time, value: ke("T" + n[1]) }];
|
|
@@ -41203,22 +41203,22 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
|
|
|
41203
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) => {
|
|
41204
41204
|
let a2 = o, c = s ? a2 + s : i.length;
|
|
41205
41205
|
return a2 < 0 || a2 >= i.length ? void 0 : i.substring(a2, c);
|
|
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:
|
|
41207
|
-
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: Y, decode: Y, escape: Y, unescape: Y, trim: Y, split: Y, join: (r7, e, t) => {
|
|
41207
|
+
let n = t?.eval(r7, ge(r7))[0]?.value ?? "";
|
|
41208
41208
|
if (typeof n != "string") throw new Error("Separator must be a string.");
|
|
41209
41209
|
return [{ type: p.string, value: e.map((i) => i.value?.toString() ?? "").join(n) }];
|
|
41210
|
-
}, abs: (r7, e) =>
|
|
41210
|
+
}, abs: (r7, e) => Q(Math.abs, r7, e), ceiling: (r7, e) => Q(Math.ceil, r7, e), exp: (r7, e) => Q(Math.exp, r7, e), floor: (r7, e) => Q(Math.floor, r7, e), ln: (r7, e) => Q(Math.log, r7, e), log: (r7, e, t) => Q((n, i) => Math.log(n) / Math.log(i), r7, e, t), power: (r7, e, t) => Q(Math.pow, r7, e, t), round: (r7, e) => Q(Math.round, r7, e), sqrt: (r7, e) => Q(Math.sqrt, r7, e), truncate: (r7, e) => Q((t) => t | 0, r7, e), children: Y, descendants: Y, 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
41211
|
let o = O.toDateTime(r7, t.eval(r7, e));
|
|
41212
41212
|
if (o.length === 0) throw new Error("Invalid start date");
|
|
41213
41213
|
let s = O.toDateTime(r7, n.eval(r7, e));
|
|
41214
41214
|
if (s.length === 0) throw new Error("Invalid end date");
|
|
41215
41215
|
let a2 = i.eval(r7, e)[0]?.value;
|
|
41216
41216
|
if (a2 !== "years" && a2 !== "months" && a2 !== "days") throw new Error("Invalid units");
|
|
41217
|
-
let c =
|
|
41217
|
+
let c = at(o[0].value, s[0].value);
|
|
41218
41218
|
return [{ type: p.Quantity, value: { value: c[a2], unit: a2 } }];
|
|
41219
41219
|
}, is: (r7, e, t) => {
|
|
41220
41220
|
let n = "";
|
|
41221
|
-
return t instanceof j ? n = t.name : t instanceof
|
|
41221
|
+
return t instanceof j ? n = t.name : t instanceof se && (n = t.left.name + "." + t.right.name), n ? e.map((i) => ({ type: p.boolean, value: ot(i, n) })) : [];
|
|
41222
41222
|
}, not: (r7, e) => O.toBoolean(r7, e).map((t) => ({ type: p.boolean, value: !t.value })), resolve: (r7, e) => e.map((t) => {
|
|
41223
41223
|
let n = t.value, i;
|
|
41224
41224
|
if (typeof n == "string") i = n;
|
|
@@ -41248,35 +41248,35 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
|
|
|
41248
41248
|
let n = e[0].value;
|
|
41249
41249
|
if (!n?.reference) return [];
|
|
41250
41250
|
let i = "";
|
|
41251
|
-
return t instanceof j && (i = t.name), i && !n.reference.startsWith(i + "/") ? [] : [{ type: p.id, value:
|
|
41251
|
+
return t instanceof j && (i = t.name), i && !n.reference.startsWith(i + "/") ? [] : [{ type: p.id, value: he(n) }];
|
|
41252
41252
|
}, extension: (r7, e, t) => {
|
|
41253
41253
|
let n = t.eval(r7, e)[0].value, i = e?.[0]?.value;
|
|
41254
41254
|
if (i) {
|
|
41255
|
-
let o =
|
|
41255
|
+
let o = te(i, n);
|
|
41256
41256
|
if (o) return [{ type: p.Extension, value: o }];
|
|
41257
41257
|
}
|
|
41258
41258
|
return [];
|
|
41259
41259
|
} };
|
|
41260
41260
|
function F(r7, e, t, ...n) {
|
|
41261
41261
|
if (t.length === 0) return [];
|
|
41262
|
-
let [{ value: i }] =
|
|
41262
|
+
let [{ value: i }] = z(t, 1);
|
|
41263
41263
|
if (typeof i != "string") throw new Error("String function cannot be called with non-string");
|
|
41264
41264
|
let o = r7(i, ...n.map((s) => s?.eval(e, t)[0]?.value));
|
|
41265
41265
|
return o === void 0 ? [] : Array.isArray(o) ? o.map(g) : [g(o)];
|
|
41266
41266
|
}
|
|
41267
|
-
function
|
|
41267
|
+
function Q(r7, e, t, ...n) {
|
|
41268
41268
|
if (t.length === 0) return [];
|
|
41269
|
-
let [{ value: i }] =
|
|
41269
|
+
let [{ value: i }] = z(t, 1), o = V(i), s = o ? i.value : i;
|
|
41270
41270
|
if (typeof s != "number") throw new Error("Math function cannot be called with non-number");
|
|
41271
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;
|
|
41272
41272
|
return [{ type: c, value: u2 }];
|
|
41273
41273
|
}
|
|
41274
|
-
function
|
|
41274
|
+
function z(r7, e) {
|
|
41275
41275
|
if (r7.length !== e) throw new Error(`Expected ${e} arguments`);
|
|
41276
41276
|
for (let t of r7) if (t == null) throw new Error("Expected non-null argument");
|
|
41277
41277
|
return r7;
|
|
41278
41278
|
}
|
|
41279
|
-
function
|
|
41279
|
+
function ge(r7) {
|
|
41280
41280
|
let e = r7;
|
|
41281
41281
|
for (; e.parent?.variables.$this; ) e = e.parent;
|
|
41282
41282
|
return [e.variables.$this];
|
|
@@ -41317,7 +41317,7 @@ var j = class {
|
|
|
41317
41317
|
return this.name;
|
|
41318
41318
|
}
|
|
41319
41319
|
};
|
|
41320
|
-
var
|
|
41320
|
+
var pt = class {
|
|
41321
41321
|
eval() {
|
|
41322
41322
|
return [];
|
|
41323
41323
|
}
|
|
@@ -41325,7 +41325,7 @@ var dt = class {
|
|
|
41325
41325
|
return "{}";
|
|
41326
41326
|
}
|
|
41327
41327
|
};
|
|
41328
|
-
var
|
|
41328
|
+
var dt = class extends Ke {
|
|
41329
41329
|
constructor(t, n, i) {
|
|
41330
41330
|
super(t, n);
|
|
41331
41331
|
this.impl = i;
|
|
@@ -41337,7 +41337,7 @@ var ft = class extends Je {
|
|
|
41337
41337
|
return this.operator + this.child.toString();
|
|
41338
41338
|
}
|
|
41339
41339
|
};
|
|
41340
|
-
var
|
|
41340
|
+
var xe = class extends X {
|
|
41341
41341
|
constructor(e, t) {
|
|
41342
41342
|
super("as", e, t);
|
|
41343
41343
|
}
|
|
@@ -41345,7 +41345,7 @@ var ge = class extends Z {
|
|
|
41345
41345
|
return O.ofType(e, this.left.eval(e, t), this.right);
|
|
41346
41346
|
}
|
|
41347
41347
|
};
|
|
41348
|
-
var C = class extends
|
|
41348
|
+
var C = class extends X {
|
|
41349
41349
|
};
|
|
41350
41350
|
var D = class extends C {
|
|
41351
41351
|
constructor(t, n, i, o) {
|
|
@@ -41361,7 +41361,7 @@ var D = class extends C {
|
|
|
41361
41361
|
return typeof l2 == "boolean" ? f(l2) : V(s) ? [{ type: p.Quantity, value: { ...s, value: l2 } }] : [g(l2)];
|
|
41362
41362
|
}
|
|
41363
41363
|
};
|
|
41364
|
-
var
|
|
41364
|
+
var ft = class extends X {
|
|
41365
41365
|
constructor(e, t) {
|
|
41366
41366
|
super("&", e, t);
|
|
41367
41367
|
}
|
|
@@ -41379,16 +41379,16 @@ var ht = class extends C {
|
|
|
41379
41379
|
return f(n.some((o) => o.value === i[0].value));
|
|
41380
41380
|
}
|
|
41381
41381
|
};
|
|
41382
|
-
var
|
|
41382
|
+
var mt = class extends C {
|
|
41383
41383
|
constructor(e, t) {
|
|
41384
41384
|
super("in", e, t);
|
|
41385
41385
|
}
|
|
41386
41386
|
eval(e, t) {
|
|
41387
|
-
let n =
|
|
41387
|
+
let n = G(this.left.eval(e, t)), i = this.right.eval(e, t);
|
|
41388
41388
|
return n ? f(i.some((o) => o.value === n.value)) : [];
|
|
41389
41389
|
}
|
|
41390
41390
|
};
|
|
41391
|
-
var
|
|
41391
|
+
var se = class extends X {
|
|
41392
41392
|
constructor(e, t) {
|
|
41393
41393
|
super(".", e, t);
|
|
41394
41394
|
}
|
|
@@ -41399,52 +41399,52 @@ var ie = class extends Z {
|
|
|
41399
41399
|
return `${this.left.toString()}.${this.right.toString()}`;
|
|
41400
41400
|
}
|
|
41401
41401
|
};
|
|
41402
|
-
var Ve = class extends
|
|
41402
|
+
var Ve = class extends X {
|
|
41403
41403
|
constructor(e, t) {
|
|
41404
41404
|
super("|", e, t);
|
|
41405
41405
|
}
|
|
41406
41406
|
eval(e, t) {
|
|
41407
41407
|
let n = this.left.eval(e, t), i = this.right.eval(e, t);
|
|
41408
|
-
return
|
|
41408
|
+
return it([...n, ...i]);
|
|
41409
41409
|
}
|
|
41410
41410
|
};
|
|
41411
|
-
var
|
|
41411
|
+
var yt = class extends C {
|
|
41412
41412
|
constructor(e, t) {
|
|
41413
41413
|
super("=", e, t);
|
|
41414
41414
|
}
|
|
41415
41415
|
eval(e, t) {
|
|
41416
41416
|
let n = this.left.eval(e, t), i = this.right.eval(e, t);
|
|
41417
|
-
return
|
|
41417
|
+
return _n(n, i);
|
|
41418
41418
|
}
|
|
41419
41419
|
};
|
|
41420
|
-
var
|
|
41420
|
+
var gt = class extends C {
|
|
41421
41421
|
constructor(e, t) {
|
|
41422
41422
|
super("!=", e, t);
|
|
41423
41423
|
}
|
|
41424
41424
|
eval(e, t) {
|
|
41425
41425
|
let n = this.left.eval(e, t), i = this.right.eval(e, t);
|
|
41426
|
-
return
|
|
41426
|
+
return Nn(n, i);
|
|
41427
41427
|
}
|
|
41428
41428
|
};
|
|
41429
|
-
var
|
|
41429
|
+
var xt = class extends C {
|
|
41430
41430
|
constructor(e, t) {
|
|
41431
41431
|
super("~", e, t);
|
|
41432
41432
|
}
|
|
41433
41433
|
eval(e, t) {
|
|
41434
41434
|
let n = this.left.eval(e, t), i = this.right.eval(e, t);
|
|
41435
|
-
return
|
|
41435
|
+
return gr(n, i);
|
|
41436
41436
|
}
|
|
41437
41437
|
};
|
|
41438
|
-
var
|
|
41438
|
+
var vt = class extends C {
|
|
41439
41439
|
constructor(e, t) {
|
|
41440
41440
|
super("!~", e, t);
|
|
41441
41441
|
}
|
|
41442
41442
|
eval(e, t) {
|
|
41443
41443
|
let n = this.left.eval(e, t), i = this.right.eval(e, t);
|
|
41444
|
-
return
|
|
41444
|
+
return Mn(gr(n, i));
|
|
41445
41445
|
}
|
|
41446
41446
|
};
|
|
41447
|
-
var
|
|
41447
|
+
var ve = class extends C {
|
|
41448
41448
|
constructor(e, t) {
|
|
41449
41449
|
super("is", e, t);
|
|
41450
41450
|
}
|
|
@@ -41452,24 +41452,24 @@ var xe = class extends C {
|
|
|
41452
41452
|
let n = this.left.eval(e, t);
|
|
41453
41453
|
if (n.length !== 1) return [];
|
|
41454
41454
|
let i = this.right.name;
|
|
41455
|
-
return f(
|
|
41455
|
+
return f(ot(n[0], i));
|
|
41456
41456
|
}
|
|
41457
41457
|
};
|
|
41458
|
-
var
|
|
41458
|
+
var Tt = class extends C {
|
|
41459
41459
|
constructor(e, t) {
|
|
41460
41460
|
super("and", e, t);
|
|
41461
41461
|
}
|
|
41462
41462
|
eval(e, t) {
|
|
41463
|
-
let n =
|
|
41463
|
+
let n = G(this.left.eval(e, t), "boolean"), i = G(this.right.eval(e, t), "boolean");
|
|
41464
41464
|
return n?.value === true && i?.value === true ? f(true) : n?.value === false || i?.value === false ? f(false) : [];
|
|
41465
41465
|
}
|
|
41466
41466
|
};
|
|
41467
|
-
var
|
|
41467
|
+
var St = class extends C {
|
|
41468
41468
|
constructor(e, t) {
|
|
41469
41469
|
super("or", e, t);
|
|
41470
41470
|
}
|
|
41471
41471
|
eval(e, t) {
|
|
41472
|
-
let n =
|
|
41472
|
+
let n = G(this.left.eval(e, t), "boolean"), i = G(this.right.eval(e, t), "boolean");
|
|
41473
41473
|
return n?.value === false && i?.value === false ? f(false) : n?.value || i?.value ? f(true) : [];
|
|
41474
41474
|
}
|
|
41475
41475
|
};
|
|
@@ -41478,20 +41478,20 @@ var bt = class extends C {
|
|
|
41478
41478
|
super("xor", e, t);
|
|
41479
41479
|
}
|
|
41480
41480
|
eval(e, t) {
|
|
41481
|
-
let n =
|
|
41481
|
+
let n = G(this.left.eval(e, t), "boolean"), i = G(this.right.eval(e, t), "boolean");
|
|
41482
41482
|
return !n || !i ? [] : f(n.value !== i.value);
|
|
41483
41483
|
}
|
|
41484
41484
|
};
|
|
41485
|
-
var
|
|
41485
|
+
var Et = class extends C {
|
|
41486
41486
|
constructor(e, t) {
|
|
41487
41487
|
super("implies", e, t);
|
|
41488
41488
|
}
|
|
41489
41489
|
eval(e, t) {
|
|
41490
|
-
let n =
|
|
41490
|
+
let n = G(this.left.eval(e, t), "boolean"), i = G(this.right.eval(e, t), "boolean");
|
|
41491
41491
|
return i?.value === true || n?.value === false ? f(true) : !n || !i ? [] : f(false);
|
|
41492
41492
|
}
|
|
41493
41493
|
};
|
|
41494
|
-
var
|
|
41494
|
+
var Z = class {
|
|
41495
41495
|
constructor(e, t) {
|
|
41496
41496
|
this.name = e;
|
|
41497
41497
|
this.args = t;
|
|
@@ -41505,7 +41505,7 @@ var Y = class {
|
|
|
41505
41505
|
return `${this.name}(${this.args.map((e) => e.toString()).join(", ")})`;
|
|
41506
41506
|
}
|
|
41507
41507
|
};
|
|
41508
|
-
var
|
|
41508
|
+
var Te = class {
|
|
41509
41509
|
constructor(e, t) {
|
|
41510
41510
|
this.left = e;
|
|
41511
41511
|
this.expr = t;
|
|
@@ -41522,7 +41522,7 @@ var ve = class {
|
|
|
41522
41522
|
return `${this.left.toString()}[${this.expr.toString()}]`;
|
|
41523
41523
|
}
|
|
41524
41524
|
};
|
|
41525
|
-
var
|
|
41525
|
+
var je = ["!=", "!~", "<=", ">=", "{}", "->"];
|
|
41526
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 };
|
|
41527
41527
|
var as = { parse(r7) {
|
|
41528
41528
|
let e = r7.consumeAndParse();
|
|
@@ -41532,25 +41532,25 @@ var as = { parse(r7) {
|
|
|
41532
41532
|
var cs = { parse(r7, e) {
|
|
41533
41533
|
let t = r7.consumeAndParse();
|
|
41534
41534
|
if (!r7.match("]")) throw new Error("Parse error: expected `]`");
|
|
41535
|
-
return new
|
|
41535
|
+
return new Te(e, t);
|
|
41536
41536
|
}, precedence: y.Indexer };
|
|
41537
41537
|
var us = { parse(r7, e) {
|
|
41538
41538
|
if (!(e instanceof j)) throw new Error("Unexpected parentheses");
|
|
41539
41539
|
let t = [];
|
|
41540
41540
|
for (; !r7.match(")"); ) t.push(r7.consumeAndParse()), r7.match(",");
|
|
41541
|
-
return new
|
|
41541
|
+
return new Z(e.name, t);
|
|
41542
41542
|
}, precedence: y.FunctionCall };
|
|
41543
41543
|
function ls(r7) {
|
|
41544
41544
|
let e = r7.split(" "), t = parseFloat(e[0]), n = e[1];
|
|
41545
41545
|
return n?.startsWith("'") && n.endsWith("'") ? n = n.substring(1, n.length - 1) : n = "{" + n + "}", { value: t, unit: n };
|
|
41546
41546
|
}
|
|
41547
|
-
function
|
|
41548
|
-
return new
|
|
41547
|
+
function We() {
|
|
41548
|
+
return new Je().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 pt() }).registerPrefix("(", as).registerInfix("[", cs).registerInfix("(", us).prefix("+", y.UnaryAdd, (r7, e) => new dt("+", e, (t) => t)).prefix("-", y.UnarySubtract, (r7, e) => new D("-", e, e, (t, n) => -n)).infixLeft(".", y.Dot, (r7, e, t) => new se(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 yt(r7, t)).infixLeft("!=", y.NotEquals, (r7, e, t) => new gt(r7, t)).infixLeft("~", y.Equivalent, (r7, e, t) => new xt(r7, t)).infixLeft("!~", y.NotEquivalent, (r7, e, t) => new vt(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 ft(r7, t)).infixLeft("and", y.And, (r7, e, t) => new Tt(r7, t)).infixLeft("as", y.As, (r7, e, t) => new xe(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 mt(r7, t)).infixLeft("is", y.Is, (r7, e, t) => new ve(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 St(r7, t)).infixLeft("xor", y.Xor, (r7, e, t) => new bt(r7, t)).infixLeft("implies", y.Implies, (r7, e, t) => new Et(r7, t));
|
|
41549
41549
|
}
|
|
41550
|
-
var ps =
|
|
41551
|
-
var
|
|
41552
|
-
var
|
|
41553
|
-
var Bs = ((
|
|
41550
|
+
var ps = We();
|
|
41551
|
+
var oi = ((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))(oi || {});
|
|
41552
|
+
var pi = ((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))(pi || {});
|
|
41553
|
+
var Bs = ((E) => (E.READ = "read", E.VREAD = "vread", E.UPDATE = "update", E.PATCH = "patch", E.DELETE = "delete", E.HISTORY = "history", E.HISTORY_INSTANCE = "history-instance", E.HISTORY_TYPE = "history-type", E.HISTORY_SYSTEM = "history-system", E.CREATE = "create", E.SEARCH = "search", E.SEARCH_TYPE = "search-type", E.SEARCH_SYSTEM = "search-system", E.SEARCH_COMPARTMENT = "search-compartment", E.CAPABILITIES = "capabilities", E.TRANSACTION = "transaction", E.BATCH = "batch", E.OPERATION = "operation", E))(Bs || {});
|
|
41554
41554
|
function mi(r7) {
|
|
41555
41555
|
if (typeof window < "u") {
|
|
41556
41556
|
let e = window.atob(r7), t = Uint8Array.from(e, (n) => n.charCodeAt(0));
|
|
@@ -41559,7 +41559,7 @@ function mi(r7) {
|
|
|
41559
41559
|
if (typeof Buffer < "u") return Buffer.from(r7, "base64").toString("utf-8");
|
|
41560
41560
|
throw new Error("Unable to decode base64");
|
|
41561
41561
|
}
|
|
41562
|
-
function
|
|
41562
|
+
function yi(r7) {
|
|
41563
41563
|
if (typeof window < "u") {
|
|
41564
41564
|
let e = new window.TextEncoder().encode(r7), t = String.fromCharCode.apply(null, e);
|
|
41565
41565
|
return window.btoa(t);
|
|
@@ -41567,20 +41567,20 @@ function hi(r7) {
|
|
|
41567
41567
|
if (typeof Buffer < "u") return Buffer.from(r7, "utf8").toString("base64");
|
|
41568
41568
|
throw new Error("Unable to encode base64");
|
|
41569
41569
|
}
|
|
41570
|
-
function
|
|
41570
|
+
function _r() {
|
|
41571
41571
|
let r7 = new Uint32Array(28);
|
|
41572
|
-
return crypto.getRandomValues(r7),
|
|
41572
|
+
return crypto.getRandomValues(r7), Gn(r7.buffer);
|
|
41573
41573
|
}
|
|
41574
|
-
async function
|
|
41574
|
+
async function gi(r7) {
|
|
41575
41575
|
return crypto.subtle.digest("SHA-256", new TextEncoder().encode(r7));
|
|
41576
41576
|
}
|
|
41577
|
-
function
|
|
41577
|
+
function Se() {
|
|
41578
41578
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (r7) => {
|
|
41579
41579
|
let e = Math.random() * 16 | 0;
|
|
41580
41580
|
return (r7 === "x" ? e : e & 3 | 8).toString(16);
|
|
41581
41581
|
});
|
|
41582
41582
|
}
|
|
41583
|
-
var
|
|
41583
|
+
var At = class {
|
|
41584
41584
|
constructor(e = 10) {
|
|
41585
41585
|
this.max = e, this.cache = /* @__PURE__ */ new Map();
|
|
41586
41586
|
}
|
|
@@ -41605,7 +41605,7 @@ var Ot = class {
|
|
|
41605
41605
|
}
|
|
41606
41606
|
};
|
|
41607
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" };
|
|
41608
|
-
var
|
|
41608
|
+
var Nr = class {
|
|
41609
41609
|
constructor() {
|
|
41610
41610
|
this.listeners = {};
|
|
41611
41611
|
}
|
|
@@ -41632,7 +41632,7 @@ var Lr = class {
|
|
|
41632
41632
|
};
|
|
41633
41633
|
var K = class {
|
|
41634
41634
|
constructor() {
|
|
41635
|
-
this.emitter = new
|
|
41635
|
+
this.emitter = new Nr();
|
|
41636
41636
|
}
|
|
41637
41637
|
dispatchEvent(e) {
|
|
41638
41638
|
this.emitter.dispatchEvent(e);
|
|
@@ -41647,76 +41647,76 @@ var K = class {
|
|
|
41647
41647
|
this.emitter.removeAllListeners();
|
|
41648
41648
|
}
|
|
41649
41649
|
};
|
|
41650
|
-
var
|
|
41651
|
-
var
|
|
41652
|
-
var
|
|
41650
|
+
var Lr = { "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" };
|
|
41651
|
+
var Ks = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
|
|
41652
|
+
var Fr = ["DiagnosticReport-update"];
|
|
41653
41653
|
function vi(r7) {
|
|
41654
|
-
return
|
|
41654
|
+
return Fr.includes(r7);
|
|
41655
41655
|
}
|
|
41656
41656
|
function Ti(r7) {
|
|
41657
|
-
if (
|
|
41657
|
+
if (Fr.includes(r7)) throw new d(m(`'context.version' is required for '${r7}'.`));
|
|
41658
41658
|
}
|
|
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: "*",
|
|
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", reference: true }, patient: { resourceType: "Patient", optional: true, reference: true }, select: { resourceType: "*", array: true, reference: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport", reference: true }, patient: { resourceType: "Patient", optional: true, reference: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
|
|
41660
41660
|
function Ys(r7) {
|
|
41661
|
-
return
|
|
41661
|
+
return Ks.includes(r7);
|
|
41662
41662
|
}
|
|
41663
41663
|
function Si(r7) {
|
|
41664
41664
|
return !!r7.endpoint;
|
|
41665
41665
|
}
|
|
41666
|
-
function
|
|
41667
|
-
if (!
|
|
41666
|
+
function Ur(r7) {
|
|
41667
|
+
if (!It(r7)) throw new d(m("subscriptionRequest must be an object conforming to SubscriptionRequest type."));
|
|
41668
41668
|
let { channelType: e, mode: t, topic: n, events: i } = r7, o = { "hub.channel.type": e, "hub.mode": t, "hub.topic": n, "hub.events": i.join(",") };
|
|
41669
41669
|
return Si(r7) && (o.endpoint = r7.endpoint), new URLSearchParams(o).toString();
|
|
41670
41670
|
}
|
|
41671
|
-
function
|
|
41671
|
+
function It(r7) {
|
|
41672
41672
|
if (typeof r7 != "object") return false;
|
|
41673
41673
|
let { channelType: e, mode: t, topic: n, events: i } = r7;
|
|
41674
41674
|
if (!(e && t && n && i) || typeof n != "string" || typeof i != "object" || !Array.isArray(i) || i.length < 1 || e !== "websocket" || t !== "subscribe" && t !== "unsubscribe") return false;
|
|
41675
|
-
for (let o of i) if (!
|
|
41675
|
+
for (let o of i) if (!Lr[o]) return false;
|
|
41676
41676
|
return !(Si(r7) && !(typeof r7.endpoint == "string" && r7.endpoint.startsWith("ws")));
|
|
41677
41677
|
}
|
|
41678
|
-
function
|
|
41679
|
-
if (typeof e != "object") throw new d(
|
|
41680
|
-
if (!(e.id && typeof e.id == "string")) throw new d(
|
|
41681
|
-
if (!e.resourceType) throw new d(
|
|
41678
|
+
function Zs(r7, e, t, n) {
|
|
41679
|
+
if (typeof e != "object") throw new d(m(`context[${t}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));
|
|
41680
|
+
if (!(e.id && typeof e.id == "string")) throw new d(m(`context[${t}] is invalid. Resource must contain a valid string ID.`));
|
|
41681
|
+
if (!e.resourceType) throw new d(m(`context[${t}] is invalid. Resource must contain a resource type. No resource type found.`));
|
|
41682
41682
|
let i = n.resourceType;
|
|
41683
41683
|
if (i !== "*") {
|
|
41684
|
-
if (!Ys(e.resourceType)) throw new d(
|
|
41685
|
-
if (i && e.resourceType !== i) throw new d(
|
|
41684
|
+
if (!Ys(e.resourceType)) throw new d(m(`context[${t}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));
|
|
41685
|
+
if (i && e.resourceType !== i) throw new d(m(`context[${t}] is invalid. context[${t}] for the '${r7}' event should contain resource of type ${i}.`));
|
|
41686
41686
|
}
|
|
41687
41687
|
}
|
|
41688
|
-
function
|
|
41689
|
-
if (i.set(e.key, (i.get(e.key) ?? 0) + 1),
|
|
41690
|
-
|
|
41691
|
-
|
|
41692
|
-
|
|
41693
|
-
|
|
41694
|
-
}
|
|
41688
|
+
function Xs(r7, e, t, n, i) {
|
|
41689
|
+
if (i.set(e.key, (i.get(e.key) ?? 0) + 1), n.reference) {
|
|
41690
|
+
if (n.array) {
|
|
41691
|
+
if (!(typeof e.reference == "object" && Array.isArray(e.reference))) throw new d(m(`context[${t}] is invalid. Expected key '${e.key}' to be an array of references.`));
|
|
41692
|
+
for (let o of e.reference) if (!$(o)) throw new d(m(`context[${t}] is invalid. Expected key '${e.key}' to be an array of valid references.`));
|
|
41693
|
+
} else if (!$(e.reference)) throw new d(m(`context[${t}] is invalid. Expected key '${e.key}' to be a reference.`));
|
|
41694
|
+
} else Zs(r7, e.resource, t, n);
|
|
41695
41695
|
}
|
|
41696
|
-
function
|
|
41696
|
+
function ea(r7, e) {
|
|
41697
41697
|
let t = /* @__PURE__ */ new Map(), n = Js[r7];
|
|
41698
41698
|
for (let i = 0; i < e.length; i++) {
|
|
41699
41699
|
let o = e[i].key;
|
|
41700
|
-
if (!n[o]) throw new d(
|
|
41701
|
-
|
|
41700
|
+
if (!n[o]) throw new d(m(`Key '${o}' not found for event '${r7}'. Make sure to add only valid keys.`));
|
|
41701
|
+
Xs(r7, e[i], i, n[o], t);
|
|
41702
41702
|
}
|
|
41703
41703
|
for (let [i, o] of Object.entries(n)) {
|
|
41704
|
-
if (!(o.optional || t.has(i))) throw new d(
|
|
41705
|
-
if (!o.manyAllowed && (t.get(i) || 0) > 1) throw new d(
|
|
41704
|
+
if (!(o.optional || t.has(i))) throw new d(m(`Missing required key '${i}' on context for '${r7}' event.`));
|
|
41705
|
+
if (!o.manyAllowed && (t.get(i) || 0) > 1) throw new d(m(`${t.get(i)} context entries with key '${i}' found for the '${r7}' event when schema only allows for 1.`));
|
|
41706
41706
|
}
|
|
41707
41707
|
}
|
|
41708
|
-
function
|
|
41709
|
-
if (!(r7 && typeof r7 == "string")) throw new d(
|
|
41710
|
-
if (!
|
|
41711
|
-
if (typeof t != "object") throw new d(
|
|
41712
|
-
if (
|
|
41708
|
+
function Br(r7, e, t, n) {
|
|
41709
|
+
if (!(r7 && typeof r7 == "string")) throw new d(m("Must provide a topic."));
|
|
41710
|
+
if (!Lr[e]) throw new d(m(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Lr).join(", ")}`));
|
|
41711
|
+
if (typeof t != "object") throw new d(m("context must be a context object or array of context objects."));
|
|
41712
|
+
if (Fr.includes(e) && !n) throw new d(m(`The '${e}' event must contain a 'context.versionId'.`));
|
|
41713
41713
|
let i = Array.isArray(t) ? t : [t];
|
|
41714
|
-
return
|
|
41714
|
+
return ea(e, i), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: Se(), event: { "hub.topic": r7, "hub.event": e, context: i, ...n ? { "context.versionId": n } : {} } };
|
|
41715
41715
|
}
|
|
41716
|
-
var
|
|
41716
|
+
var Ot = class extends K {
|
|
41717
41717
|
constructor(e) {
|
|
41718
|
-
if (super(), this.subRequest = e, !e.endpoint) throw new d(
|
|
41719
|
-
if (!
|
|
41718
|
+
if (super(), this.subRequest = e, !e.endpoint) throw new d(m("Subscription request should contain an endpoint."));
|
|
41719
|
+
if (!It(e)) throw new d(m("Subscription request failed validation."));
|
|
41720
41720
|
let t = new WebSocket(e.endpoint);
|
|
41721
41721
|
t.addEventListener("open", () => {
|
|
41722
41722
|
this.dispatchEvent({ type: "connect" }), t.addEventListener("message", (n) => {
|
|
@@ -41733,36 +41733,36 @@ var It = class extends K {
|
|
|
41733
41733
|
this.websocket.close();
|
|
41734
41734
|
}
|
|
41735
41735
|
};
|
|
41736
|
-
function
|
|
41736
|
+
function ta(r7) {
|
|
41737
41737
|
let e = r7.replace(/-/g, "+").replace(/_/g, "/"), t = mi(e), n = Array.from(t).reduce((o, s) => {
|
|
41738
41738
|
let a2 = ("00" + s.charCodeAt(0).toString(16)).slice(-2);
|
|
41739
41739
|
return `${o}%${a2}`;
|
|
41740
41740
|
}, ""), i = decodeURIComponent(n);
|
|
41741
41741
|
return JSON.parse(i);
|
|
41742
41742
|
}
|
|
41743
|
-
function
|
|
41743
|
+
function bi(r7) {
|
|
41744
41744
|
return r7.split(".").length === 3;
|
|
41745
41745
|
}
|
|
41746
|
-
function
|
|
41746
|
+
function kt(r7) {
|
|
41747
41747
|
let [e, t, n] = r7.split(".");
|
|
41748
|
-
return
|
|
41748
|
+
return ta(t);
|
|
41749
41749
|
}
|
|
41750
|
-
function
|
|
41750
|
+
function Ei(r7) {
|
|
41751
41751
|
try {
|
|
41752
|
-
return typeof
|
|
41752
|
+
return typeof kt(r7).login_id == "string";
|
|
41753
41753
|
} catch {
|
|
41754
41754
|
return false;
|
|
41755
41755
|
}
|
|
41756
41756
|
}
|
|
41757
41757
|
function Ri(r7) {
|
|
41758
41758
|
try {
|
|
41759
|
-
let t =
|
|
41759
|
+
let t = kt(r7).exp;
|
|
41760
41760
|
return typeof t == "number" ? t * 1e3 : void 0;
|
|
41761
41761
|
} catch {
|
|
41762
41762
|
return;
|
|
41763
41763
|
}
|
|
41764
41764
|
}
|
|
41765
|
-
var
|
|
41765
|
+
var Vt = class {
|
|
41766
41766
|
constructor(e) {
|
|
41767
41767
|
this.medplum = e;
|
|
41768
41768
|
}
|
|
@@ -41812,9 +41812,9 @@ var M = class {
|
|
|
41812
41812
|
return this.suspender.finally(e);
|
|
41813
41813
|
}
|
|
41814
41814
|
};
|
|
41815
|
-
var
|
|
41815
|
+
var $e = class {
|
|
41816
41816
|
constructor(e) {
|
|
41817
|
-
this.storage = e ?? (typeof localStorage < "u" ? localStorage : new
|
|
41817
|
+
this.storage = e ?? (typeof localStorage < "u" ? localStorage : new qr());
|
|
41818
41818
|
}
|
|
41819
41819
|
clear() {
|
|
41820
41820
|
this.storage.clear();
|
|
@@ -41830,10 +41830,10 @@ var Ge = class {
|
|
|
41830
41830
|
return t ? JSON.parse(t) : void 0;
|
|
41831
41831
|
}
|
|
41832
41832
|
setObject(e, t) {
|
|
41833
|
-
this.setString(e, t ?
|
|
41833
|
+
this.setString(e, t ? ct(t) : void 0);
|
|
41834
41834
|
}
|
|
41835
41835
|
};
|
|
41836
|
-
var
|
|
41836
|
+
var qr = class {
|
|
41837
41837
|
constructor() {
|
|
41838
41838
|
this.data = /* @__PURE__ */ new Map();
|
|
41839
41839
|
}
|
|
@@ -41858,7 +41858,7 @@ var jr = class {
|
|
|
41858
41858
|
};
|
|
41859
41859
|
var Me = { Event: typeof globalThis.Event < "u" ? globalThis.Event : void 0, ErrorEvent: void 0, CloseEvent: void 0 };
|
|
41860
41860
|
var wi = false;
|
|
41861
|
-
function
|
|
41861
|
+
function ra() {
|
|
41862
41862
|
if (typeof globalThis.Event > "u") throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");
|
|
41863
41863
|
Me.Event = globalThis.Event, Me.ErrorEvent = class extends Event {
|
|
41864
41864
|
constructor(e, t) {
|
|
@@ -41872,17 +41872,17 @@ function ta() {
|
|
|
41872
41872
|
}
|
|
41873
41873
|
};
|
|
41874
41874
|
}
|
|
41875
|
-
function
|
|
41875
|
+
function na(r7, e) {
|
|
41876
41876
|
if (!r7) throw new Error(e);
|
|
41877
41877
|
}
|
|
41878
|
-
function
|
|
41878
|
+
function Dt(r7) {
|
|
41879
41879
|
return new r7.constructor(r7.type, r7);
|
|
41880
41880
|
}
|
|
41881
|
-
var
|
|
41881
|
+
var be = { maxReconnectionDelay: 1e4, minReconnectionDelay: 1e3 + Math.random() * 4e3, minUptime: 5e3, reconnectionDelayGrowFactor: 1.3, connectionTimeout: 4e3, maxRetries: 1 / 0, maxEnqueuedMessages: 1 / 0, startClosed: false, debug: false };
|
|
41882
41882
|
var Ai = false;
|
|
41883
|
-
var
|
|
41883
|
+
var Mt = class r extends K {
|
|
41884
41884
|
constructor(t, n, i = {}) {
|
|
41885
|
-
wi || (
|
|
41885
|
+
wi || (ra(), wi = true);
|
|
41886
41886
|
super();
|
|
41887
41887
|
this._retryCount = -1;
|
|
41888
41888
|
this._shouldReconnect = true;
|
|
@@ -41896,17 +41896,17 @@ var _t = class r extends K {
|
|
|
41896
41896
|
this.onopen = null;
|
|
41897
41897
|
this._handleOpen = (t2) => {
|
|
41898
41898
|
this._debug("open event");
|
|
41899
|
-
let { minUptime: n2 =
|
|
41900
|
-
clearTimeout(this._connectTimeout), this._uptimeTimeout = setTimeout(() => this._acceptOpen(), n2),
|
|
41899
|
+
let { minUptime: n2 = be.minUptime } = this._options;
|
|
41900
|
+
clearTimeout(this._connectTimeout), this._uptimeTimeout = setTimeout(() => this._acceptOpen(), n2), na(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(Dt(t2));
|
|
41901
41901
|
};
|
|
41902
41902
|
this._handleMessage = (t2) => {
|
|
41903
|
-
this._debug("message event"), this.onmessage && this.onmessage(t2), this.dispatchEvent(
|
|
41903
|
+
this._debug("message event"), this.onmessage && this.onmessage(t2), this.dispatchEvent(Dt(t2));
|
|
41904
41904
|
};
|
|
41905
41905
|
this._handleError = (t2) => {
|
|
41906
|
-
this._debug("error event", t2.message), this._disconnect(void 0, t2.message === "TIMEOUT" ? "timeout" : void 0), this.onerror && this.onerror(t2), this._debug("exec error listeners"), this.dispatchEvent(
|
|
41906
|
+
this._debug("error event", t2.message), this._disconnect(void 0, t2.message === "TIMEOUT" ? "timeout" : void 0), this.onerror && this.onerror(t2), this._debug("exec error listeners"), this.dispatchEvent(Dt(t2)), this._connect();
|
|
41907
41907
|
};
|
|
41908
41908
|
this._handleClose = (t2) => {
|
|
41909
|
-
this._debug("close event"), this._clearTimeouts(), this._shouldReconnect && this._connect(), this.onclose && this.onclose(t2), this.dispatchEvent(
|
|
41909
|
+
this._debug("close event"), this._clearTimeouts(), this._shouldReconnect && this._connect(), this.onclose && this.onclose(t2), this.dispatchEvent(Dt(t2));
|
|
41910
41910
|
};
|
|
41911
41911
|
this._url = t, this._protocols = n, this._options = i, this._options.startClosed && (this._shouldReconnect = false), this._options.binaryType ? this._binaryType = this._options.binaryType : this._binaryType = "blob", this._options.debugLogger && (this._debugLogger = this._options.debugLogger), this._connect();
|
|
41912
41912
|
}
|
|
@@ -41978,7 +41978,7 @@ var _t = class r extends K {
|
|
|
41978
41978
|
send(t) {
|
|
41979
41979
|
if (this._ws && this._ws.readyState === this.OPEN) this._debug("send", t), this._ws.send(t);
|
|
41980
41980
|
else {
|
|
41981
|
-
let { maxEnqueuedMessages: n =
|
|
41981
|
+
let { maxEnqueuedMessages: n = be.maxEnqueuedMessages } = this._options;
|
|
41982
41982
|
this._messageQueue.length < n && (this._debug("enqueue", t), this._messageQueue.push(t));
|
|
41983
41983
|
}
|
|
41984
41984
|
}
|
|
@@ -41986,7 +41986,7 @@ var _t = class r extends K {
|
|
|
41986
41986
|
this._options.debug && this._debugLogger("RWS>", ...t);
|
|
41987
41987
|
}
|
|
41988
41988
|
_getNextDelay() {
|
|
41989
|
-
let { reconnectionDelayGrowFactor: t =
|
|
41989
|
+
let { reconnectionDelayGrowFactor: t = be.reconnectionDelayGrowFactor, minReconnectionDelay: n = be.minReconnectionDelay, maxReconnectionDelay: i = be.maxReconnectionDelay } = this._options, o = 0;
|
|
41990
41990
|
return this._retryCount > 0 && (o = n * Math.pow(t, this._retryCount - 1), o > i && (o = i)), this._debug("next delay", o), o;
|
|
41991
41991
|
}
|
|
41992
41992
|
_wait() {
|
|
@@ -41997,7 +41997,7 @@ var _t = class r extends K {
|
|
|
41997
41997
|
_connect() {
|
|
41998
41998
|
if (this._connectLock || !this._shouldReconnect) return;
|
|
41999
41999
|
this._connectLock = true;
|
|
42000
|
-
let { maxRetries: t =
|
|
42000
|
+
let { maxRetries: t = be.maxRetries, connectionTimeout: n = be.connectionTimeout } = this._options;
|
|
42001
42001
|
if (this._retryCount >= t) {
|
|
42002
42002
|
this._debug("max retries reached", this._retryCount, ">=", t);
|
|
42003
42003
|
return;
|
|
@@ -42039,8 +42039,8 @@ var _t = class r extends K {
|
|
|
42039
42039
|
clearTimeout(this._connectTimeout), clearTimeout(this._uptimeTimeout);
|
|
42040
42040
|
}
|
|
42041
42041
|
};
|
|
42042
|
-
var
|
|
42043
|
-
var
|
|
42042
|
+
var ia = 5e3;
|
|
42043
|
+
var Ge = class extends K {
|
|
42044
42044
|
constructor(...e) {
|
|
42045
42045
|
super(), this.criteria = new Set(e);
|
|
42046
42046
|
}
|
|
@@ -42054,28 +42054,28 @@ var He = class extends K {
|
|
|
42054
42054
|
this.criteria.delete(e);
|
|
42055
42055
|
}
|
|
42056
42056
|
};
|
|
42057
|
-
var
|
|
42057
|
+
var jr = class {
|
|
42058
42058
|
constructor(e, t) {
|
|
42059
42059
|
this.connecting = false;
|
|
42060
|
-
this.criteria = e, this.emitter = new
|
|
42060
|
+
this.criteria = e, this.emitter = new Ge(e), this.refCount = 1, this.subscriptionProps = t ? { ...t } : void 0;
|
|
42061
42061
|
}
|
|
42062
42062
|
clearAttachedSubscription() {
|
|
42063
42063
|
this.subscriptionId = void 0, this.token = void 0;
|
|
42064
42064
|
}
|
|
42065
42065
|
};
|
|
42066
|
-
var
|
|
42066
|
+
var _t = class {
|
|
42067
42067
|
constructor(e, t, n) {
|
|
42068
42068
|
this.pingTimer = void 0;
|
|
42069
42069
|
this.waitingForPong = false;
|
|
42070
|
-
if (!(e instanceof
|
|
42070
|
+
if (!(e instanceof Nt)) throw new d(m("First arg of constructor should be a `MedplumClient`"));
|
|
42071
42071
|
let i;
|
|
42072
42072
|
try {
|
|
42073
42073
|
i = new URL(t).toString();
|
|
42074
42074
|
} catch {
|
|
42075
|
-
throw new d(
|
|
42075
|
+
throw new d(m("Not a valid URL"));
|
|
42076
42076
|
}
|
|
42077
|
-
let o = n?.ReconnectingWebSocket ? new n.ReconnectingWebSocket(i, void 0, { debug: n?.debug, debugLogger: n?.debugLogger }) : new
|
|
42078
|
-
this.medplum = e, this.ws = o, this.masterSubEmitter = new
|
|
42077
|
+
let o = n?.ReconnectingWebSocket ? new n.ReconnectingWebSocket(i, void 0, { debug: n?.debug, debugLogger: n?.debugLogger }) : new Mt(i, void 0, { debug: n?.debug, debugLogger: n?.debugLogger });
|
|
42078
|
+
this.medplum = e, this.ws = o, this.masterSubEmitter = new Ge(), this.criteriaEntries = /* @__PURE__ */ new Map(), this.criteriaEntriesBySubscriptionId = /* @__PURE__ */ new Map(), this.wsClosed = false, this.pingIntervalMs = n?.pingIntervalMs ?? ia, this.currentProfile = e.getProfile(), this.setupListeners();
|
|
42079
42079
|
}
|
|
42080
42080
|
setupListeners() {
|
|
42081
42081
|
let e = this.ws;
|
|
@@ -42092,7 +42092,7 @@ var Nt = class {
|
|
|
42092
42092
|
return;
|
|
42093
42093
|
}
|
|
42094
42094
|
if (o.type === "handshake") {
|
|
42095
|
-
let a2 =
|
|
42095
|
+
let a2 = he(o.subscription), c = { type: "connect", payload: { subscriptionId: a2 } };
|
|
42096
42096
|
this.masterSubEmitter?.dispatchEvent(c);
|
|
42097
42097
|
let u2 = this.criteriaEntriesBySubscriptionId.get(a2);
|
|
42098
42098
|
if (!u2) {
|
|
@@ -42103,7 +42103,7 @@ var Nt = class {
|
|
|
42103
42103
|
return;
|
|
42104
42104
|
}
|
|
42105
42105
|
this.masterSubEmitter?.dispatchEvent({ type: "message", payload: i });
|
|
42106
|
-
let s = this.criteriaEntriesBySubscriptionId.get(
|
|
42106
|
+
let s = this.criteriaEntriesBySubscriptionId.get(he(o.subscription));
|
|
42107
42107
|
if (!s) {
|
|
42108
42108
|
console.warn("Received notification for criteria the SubscriptionManager is not listening for");
|
|
42109
42109
|
return;
|
|
@@ -42116,7 +42116,7 @@ var Nt = class {
|
|
|
42116
42116
|
for (let o of this.getAllCriteriaEmitters()) o.dispatchEvent({ ...i });
|
|
42117
42117
|
}
|
|
42118
42118
|
}), e.addEventListener("error", () => {
|
|
42119
|
-
let t = { type: "error", payload: new d(
|
|
42119
|
+
let t = { type: "error", payload: new d(pn(new Error("WebSocket error"))) };
|
|
42120
42120
|
this.masterSubEmitter?.dispatchEvent(t);
|
|
42121
42121
|
for (let n of this.getAllCriteriaEmitters()) n.dispatchEvent({ ...t });
|
|
42122
42122
|
}), e.addEventListener("close", () => {
|
|
@@ -42153,17 +42153,17 @@ var Nt = class {
|
|
|
42153
42153
|
}
|
|
42154
42154
|
async getTokenForCriteria(e) {
|
|
42155
42155
|
let t = e?.subscriptionId;
|
|
42156
|
-
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 ${fe(this.medplum.getProfile())}`, channel: { type: "websocket" }, criteria: e.criteria })).id);
|
|
42157
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;
|
|
42158
|
-
if (!i) throw new d(
|
|
42159
|
-
if (!o) throw new d(
|
|
42158
|
+
if (!i) throw new d(m("Failed to get token"));
|
|
42159
|
+
if (!o) throw new d(m("Failed to get URL from $get-ws-binding-token"));
|
|
42160
42160
|
return [t, i];
|
|
42161
42161
|
}
|
|
42162
42162
|
maybeGetCriteriaEntry(e, t) {
|
|
42163
42163
|
let n = this.criteriaEntries.get(e);
|
|
42164
42164
|
if (n) {
|
|
42165
42165
|
if (!t) return n.bareCriteria;
|
|
42166
|
-
for (let i of n.criteriaWithProps) if (
|
|
42166
|
+
for (let i of n.criteriaWithProps) if (re(t, i.subscriptionProps)) return i;
|
|
42167
42167
|
}
|
|
42168
42168
|
}
|
|
42169
42169
|
getAllCriteriaEmitters() {
|
|
@@ -42184,7 +42184,7 @@ var Nt = class {
|
|
|
42184
42184
|
let s = this.criteriaEntries.get(t);
|
|
42185
42185
|
n ? s.criteriaWithProps = s.criteriaWithProps.filter((a2) => {
|
|
42186
42186
|
let c = a2.subscriptionProps;
|
|
42187
|
-
return !
|
|
42187
|
+
return !re(n, c);
|
|
42188
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 } }));
|
|
42189
42189
|
}
|
|
42190
42190
|
async subscribeToCriteria(e) {
|
|
@@ -42194,7 +42194,7 @@ var Nt = class {
|
|
|
42194
42194
|
let [t, n] = await this.getTokenForCriteria(e);
|
|
42195
42195
|
e.subscriptionId = t, e.token = n, this.criteriaEntriesBySubscriptionId.set(t, e), this.ws.send(JSON.stringify({ type: "bind-with-token", payload: { token: n } }));
|
|
42196
42196
|
} catch (t) {
|
|
42197
|
-
console.error(
|
|
42197
|
+
console.error(Pe(t)), this.emitError(e, t), this.removeCriteriaEntry(e);
|
|
42198
42198
|
}
|
|
42199
42199
|
}
|
|
42200
42200
|
}
|
|
@@ -42206,7 +42206,7 @@ var Nt = class {
|
|
|
42206
42206
|
this.masterSubEmitter && this.masterSubEmitter._addCriteria(e);
|
|
42207
42207
|
let n = this.maybeGetCriteriaEntry(e, t);
|
|
42208
42208
|
if (n) return n.refCount += 1, n.emitter;
|
|
42209
|
-
let i = new
|
|
42209
|
+
let i = new jr(e, t);
|
|
42210
42210
|
return this.addCriteriaEntry(i), this.subscribeToCriteria(i).catch(console.error), i.emitter;
|
|
42211
42211
|
}
|
|
42212
42212
|
removeCriteria(e, t) {
|
|
@@ -42230,28 +42230,28 @@ var Nt = class {
|
|
|
42230
42230
|
return this.getAllCriteriaEmitters().length;
|
|
42231
42231
|
}
|
|
42232
42232
|
getMasterEmitter() {
|
|
42233
|
-
return this.masterSubEmitter || (this.masterSubEmitter = new
|
|
42233
|
+
return this.masterSubEmitter || (this.masterSubEmitter = new Ge(...Array.from(this.criteriaEntries.keys()))), this.masterSubEmitter;
|
|
42234
42234
|
}
|
|
42235
42235
|
};
|
|
42236
|
-
var
|
|
42237
|
-
var
|
|
42238
|
-
var
|
|
42239
|
-
var
|
|
42240
|
-
var
|
|
42241
|
-
var
|
|
42242
|
-
var
|
|
42243
|
-
var
|
|
42236
|
+
var Wr = "3.2.33-6f2add927";
|
|
42237
|
+
var aa = A.FHIR_JSON + ", */*; q=0.1";
|
|
42238
|
+
var ca = "https://api.medplum.com/";
|
|
42239
|
+
var ua = 1e3;
|
|
42240
|
+
var la = 6e4;
|
|
42241
|
+
var pa = 0;
|
|
42242
|
+
var da = 3e5;
|
|
42243
|
+
var fa = "Binary/";
|
|
42244
42244
|
var Oi = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
|
|
42245
|
-
var
|
|
42245
|
+
var ha = ((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))(ha || {});
|
|
42246
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
|
|
42248
|
-
var
|
|
42249
|
-
var
|
|
42247
|
+
var ya = ((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))(ya || {});
|
|
42248
|
+
var ga = ((e) => (e.JwtBearer = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", e))(ga || {});
|
|
42249
|
+
var Nt = class extends K {
|
|
42250
42250
|
constructor(t) {
|
|
42251
42251
|
super();
|
|
42252
42252
|
this.initComplete = true;
|
|
42253
42253
|
if (t?.baseUrl && !t.baseUrl.startsWith("http")) throw new Error("Base URL must start with http or https");
|
|
42254
|
-
this.options = t ?? {}, this.fetch = t?.fetch ??
|
|
42254
|
+
this.options = t ?? {}, this.fetch = t?.fetch ?? xa(), this.storage = t?.storage ?? new $e(), this.createPdfImpl = t?.createPdf, this.baseUrl = Cr(t?.baseUrl ?? ca), 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 ?? da, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? pa : la), this.cacheTime > 0 ? this.requestCache = new At(t?.resourceCacheSize ?? ua) : 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(() => {
|
|
42255
42255
|
t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initComplete = true, this.dispatchEvent({ type: "storageInitialized" });
|
|
42256
42256
|
}).catch((n) => {
|
|
42257
42257
|
console.error(n), this.initComplete = true, this.dispatchEvent({ type: "storageInitFailed", payload: { error: n } });
|
|
@@ -42381,16 +42381,12 @@ var Lt = class extends K {
|
|
|
42381
42381
|
}
|
|
42382
42382
|
fhirSearchUrl(t, n) {
|
|
42383
42383
|
let i = this.fhirUrl(t);
|
|
42384
|
-
return n && (i.search =
|
|
42384
|
+
return n && (i.search = Zn(n)), i;
|
|
42385
42385
|
}
|
|
42386
42386
|
search(t, n, i) {
|
|
42387
42387
|
let o = this.fhirSearchUrl(t, n), s = "search-" + o.toString(), a2 = this.getCacheEntry(s, i);
|
|
42388
42388
|
if (a2) return a2.value;
|
|
42389
|
-
let c =
|
|
42390
|
-
let u2 = await this.get(o, i);
|
|
42391
|
-
if (u2.entry) for (let l2 of u2.entry) this.cacheResource(l2.resource);
|
|
42392
|
-
return u2;
|
|
42393
|
-
})());
|
|
42389
|
+
let c = this.getBundle(o, i);
|
|
42394
42390
|
return this.setCacheEntry(s, c), c;
|
|
42395
42391
|
}
|
|
42396
42392
|
searchOne(t, n, i) {
|
|
@@ -42490,13 +42486,13 @@ var Lt = class extends K {
|
|
|
42490
42486
|
target
|
|
42491
42487
|
}
|
|
42492
42488
|
}`.replace(/\s+/g, " "), a2 = await this.graphql(s);
|
|
42493
|
-
|
|
42494
|
-
for (let c of a2.data.SearchParameterList)
|
|
42489
|
+
cr(a2.data.StructureDefinitionList.filter((c) => c.name === t));
|
|
42490
|
+
for (let c of a2.data.SearchParameterList) Ar(c);
|
|
42495
42491
|
})());
|
|
42496
42492
|
return this.setCacheEntry(n, o), o;
|
|
42497
42493
|
}
|
|
42498
42494
|
requestProfileSchema(t, n) {
|
|
42499
|
-
if (!n?.expandProfile &&
|
|
42495
|
+
if (!n?.expandProfile && Cn(t)) return Promise.resolve();
|
|
42500
42496
|
let i = t + "-requestSchema" + (n?.expandProfile ? "-nested" : ""), o = this.getCacheEntry(i, void 0);
|
|
42501
42497
|
if (o) return o.value;
|
|
42502
42498
|
let s = new M((async () => {
|
|
@@ -42504,14 +42500,14 @@ var Lt = class extends K {
|
|
|
42504
42500
|
let a2 = this.fhirUrl("StructureDefinition", "$expand-profile");
|
|
42505
42501
|
a2.search = new URLSearchParams({ url: t }).toString();
|
|
42506
42502
|
let c = await this.post(a2.toString(), {});
|
|
42507
|
-
|
|
42503
|
+
cr(c);
|
|
42508
42504
|
} else {
|
|
42509
42505
|
let a2 = await this.searchOne("StructureDefinition", { url: t, _sort: "-_lastUpdated" });
|
|
42510
42506
|
if (!a2) {
|
|
42511
42507
|
console.warn(`No StructureDefinition found for ${t}!`);
|
|
42512
42508
|
return;
|
|
42513
42509
|
}
|
|
42514
|
-
|
|
42510
|
+
ur(a2);
|
|
42515
42511
|
}
|
|
42516
42512
|
})());
|
|
42517
42513
|
return this.setCacheEntry(i, s), s;
|
|
@@ -42523,7 +42519,10 @@ var Lt = class extends K {
|
|
|
42523
42519
|
return this.get(this.fhirUrl(t, n, "_history", i), o);
|
|
42524
42520
|
}
|
|
42525
42521
|
readPatientEverything(t, n) {
|
|
42526
|
-
return this.
|
|
42522
|
+
return this.getBundle(this.fhirUrl("Patient", t, "$everything"), n);
|
|
42523
|
+
}
|
|
42524
|
+
readPatientSummary(t, n) {
|
|
42525
|
+
return this.getBundle(this.fhirUrl("Patient", t, "$summary"), n);
|
|
42527
42526
|
}
|
|
42528
42527
|
createResource(t, n) {
|
|
42529
42528
|
if (!t.resourceType) throw new Error("Missing resourceType");
|
|
@@ -42542,8 +42541,8 @@ var Lt = class extends K {
|
|
|
42542
42541
|
async createAttachment(t, n, i, o, s) {
|
|
42543
42542
|
let a2 = Di(t, n, i, o);
|
|
42544
42543
|
if (a2.contentType === A.XML) {
|
|
42545
|
-
let l2 = a2.data,
|
|
42546
|
-
l2 instanceof Blob ?
|
|
42544
|
+
let l2 = a2.data, h;
|
|
42545
|
+
l2 instanceof Blob ? h = await new Promise((x2, B) => {
|
|
42547
42546
|
let W = new FileReader();
|
|
42548
42547
|
W.onload = () => {
|
|
42549
42548
|
if (!W.result) {
|
|
@@ -42552,24 +42551,24 @@ var Lt = class extends K {
|
|
|
42552
42551
|
}
|
|
42553
42552
|
x2(W.result);
|
|
42554
42553
|
}, W.readAsText(l2, "utf-8");
|
|
42555
|
-
}) : ArrayBuffer.isView(l2) ?
|
|
42554
|
+
}) : ArrayBuffer.isView(l2) ? h = new TextDecoder().decode(l2) : h = l2, h.includes("<ClinicalDocument") && h.includes("urn:hl7-org:v3") && (a2 = { ...a2, contentType: A.CDA_XML });
|
|
42556
42555
|
}
|
|
42557
42556
|
let c = s ?? (typeof n == "object" ? n : {}), u2 = await this.createBinary(a2, c);
|
|
42558
42557
|
return { contentType: a2.contentType, url: u2.url, title: a2.filename };
|
|
42559
42558
|
}
|
|
42560
42559
|
createBinary(t, n, i, o, s) {
|
|
42561
|
-
let a2 = Di(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: l2, filename:
|
|
42562
|
-
return
|
|
42560
|
+
let a2 = Di(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: l2, filename: h, securityContext: x2, onProgress: B } = a2, W = this.fhirUrl("Binary");
|
|
42561
|
+
return h && W.searchParams.set("_filename", h), x2?.reference && this.setRequestHeader(c, "X-Security-Context", x2.reference), B ? this.uploadwithProgress(W, u2, l2, B, c) : this.post(W, u2, l2, c);
|
|
42563
42562
|
}
|
|
42564
42563
|
uploadwithProgress(t, n, i, o, s) {
|
|
42565
42564
|
return new Promise((a2, c) => {
|
|
42566
42565
|
let u2 = new XMLHttpRequest(), l2 = () => u2.abort();
|
|
42567
42566
|
s?.signal?.addEventListener("abort", l2);
|
|
42568
|
-
let
|
|
42567
|
+
let h = (x2) => {
|
|
42569
42568
|
s?.signal?.removeEventListener("abort", l2), x2 instanceof Error ? c(x2) : a2(x2);
|
|
42570
42569
|
};
|
|
42571
|
-
if (u2.responseType = "json", u2.onabort = () =>
|
|
42572
|
-
u2.status >= 200 && u2.status < 300 ?
|
|
42570
|
+
if (u2.responseType = "json", u2.onabort = () => h(new DOMException("Request aborted", "AbortError")), u2.onerror = () => h(new Error("Request error")), o && (u2.upload.onprogress = (x2) => o(x2), u2.upload.onload = (x2) => o(x2)), u2.onload = () => {
|
|
42571
|
+
u2.status >= 200 && u2.status < 300 ? h(u2.response) : h(new d(Xe(u2.response || u2.statusText)));
|
|
42573
42572
|
}, 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) {
|
|
42574
42573
|
let x2 = s.headers;
|
|
42575
42574
|
for (let [B, W] of Object.entries(x2)) u2.setRequestHeader(B, W);
|
|
@@ -42579,12 +42578,12 @@ var Lt = class extends K {
|
|
|
42579
42578
|
}
|
|
42580
42579
|
async createPdf(t, n, i, o) {
|
|
42581
42580
|
if (!this.createPdfImpl) throw new Error("PDF creation not enabled");
|
|
42582
|
-
let s =
|
|
42581
|
+
let s = Sa(t, n, i, o), a2 = typeof n == "object" ? n : {}, { docDefinition: c, tableLayouts: u2, fonts: l2, ...h } = s, x2 = await this.createPdfImpl(c, u2, l2), B = { ...h, data: x2, contentType: "application/pdf" };
|
|
42583
42582
|
return this.createBinary(B, a2);
|
|
42584
42583
|
}
|
|
42585
42584
|
createComment(t, n, i) {
|
|
42586
42585
|
let o = this.getProfile(), s, a2;
|
|
42587
|
-
return t.resourceType === "Encounter" && (s =
|
|
42586
|
+
return t.resourceType === "Encounter" && (s = ne(t), a2 = t.subject), t.resourceType === "ServiceRequest" && (s = t.encounter, a2 = t.subject), t.resourceType === "Patient" && (a2 = ne(t)), this.createResource({ resourceType: "Communication", status: "completed", basedOn: [ne(t)], encounter: s, subject: a2, sender: o ? ne(o) : void 0, sent: (/* @__PURE__ */ new Date()).toISOString(), payload: [{ contentString: n }] }, i);
|
|
42588
42587
|
}
|
|
42589
42588
|
async updateResource(t, n) {
|
|
42590
42589
|
if (!t.resourceType) throw new Error("Missing resourceType");
|
|
@@ -42626,13 +42625,13 @@ var Lt = class extends K {
|
|
|
42626
42625
|
return this.get(`${this.fhirUrl(t, n)}/$graph?graph=${i}`, o);
|
|
42627
42626
|
}
|
|
42628
42627
|
pushToAgent(t, n, i, o, s, a2) {
|
|
42629
|
-
return this.post(this.fhirUrl("Agent",
|
|
42628
|
+
return this.post(this.fhirUrl("Agent", he(t), "$push"), { destination: typeof n == "string" ? n : fe(n), body: i, contentType: o, waitForResponse: s }, A.FHIR_JSON, a2);
|
|
42630
42629
|
}
|
|
42631
42630
|
getActiveLogin() {
|
|
42632
42631
|
return this.storage.getObject("activeLogin");
|
|
42633
42632
|
}
|
|
42634
42633
|
async setActiveLogin(t) {
|
|
42635
|
-
(!this.sessionDetails?.profile ||
|
|
42634
|
+
(!this.sessionDetails?.profile || fe(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();
|
|
42636
42635
|
}
|
|
42637
42636
|
getAccessToken() {
|
|
42638
42637
|
return this.accessToken;
|
|
@@ -42641,7 +42640,7 @@ var Lt = class extends K {
|
|
|
42641
42640
|
return this.accessTokenExpires !== void 0 && Date.now() < this.accessTokenExpires - (t ?? this.refreshGracePeriod);
|
|
42642
42641
|
}
|
|
42643
42642
|
setAccessToken(t, n) {
|
|
42644
|
-
this.accessToken = t, this.refreshToken = n, this.accessTokenExpires = Ri(t), this.medplumServer =
|
|
42643
|
+
this.accessToken = t, this.refreshToken = n, this.accessTokenExpires = Ri(t), this.medplumServer = Ei(t);
|
|
42645
42644
|
}
|
|
42646
42645
|
getLogins() {
|
|
42647
42646
|
return this.storage.getObject("logins") ?? [];
|
|
@@ -42689,13 +42688,13 @@ var Lt = class extends K {
|
|
|
42689
42688
|
async download(t, n = {}) {
|
|
42690
42689
|
this.refreshPromise && await this.refreshPromise;
|
|
42691
42690
|
let i = t.toString();
|
|
42692
|
-
i.startsWith(
|
|
42691
|
+
i.startsWith(fa) && (t = this.fhirUrl(i));
|
|
42693
42692
|
let o = n.headers;
|
|
42694
42693
|
return o || (o = {}, n.headers = o), o.Accept || (o.Accept = "*/*"), this.addFetchOptionsDefaults(n), (await this.fetchWithRetry(t.toString(), n)).blob();
|
|
42695
42694
|
}
|
|
42696
42695
|
async createMedia(t, n) {
|
|
42697
42696
|
let { additionalFields: i, ...o } = t, s = await this.createResource({ resourceType: "Media", status: "preparation", content: { contentType: t.contentType }, ...i });
|
|
42698
|
-
o.securityContext || (o.securityContext =
|
|
42697
|
+
o.securityContext || (o.securityContext = ne(s));
|
|
42699
42698
|
let a2 = await this.createAttachment(o, n);
|
|
42700
42699
|
return this.updateResource({ ...s, status: "completed", content: a2 });
|
|
42701
42700
|
}
|
|
@@ -42712,7 +42711,14 @@ var Lt = class extends K {
|
|
|
42712
42711
|
return i.Prefer = "respond-async", this.request("POST", t, n);
|
|
42713
42712
|
}
|
|
42714
42713
|
get keyValue() {
|
|
42715
|
-
return this.keyValueClient || (this.keyValueClient = new
|
|
42714
|
+
return this.keyValueClient || (this.keyValueClient = new Vt(this)), this.keyValueClient;
|
|
42715
|
+
}
|
|
42716
|
+
getBundle(t, n) {
|
|
42717
|
+
return new M((async () => {
|
|
42718
|
+
let i = await this.get(t, n);
|
|
42719
|
+
if (i.entry) for (let o of i.entry) this.cacheResource(o.resource);
|
|
42720
|
+
return i;
|
|
42721
|
+
})());
|
|
42716
42722
|
}
|
|
42717
42723
|
getCacheEntry(t, n) {
|
|
42718
42724
|
if (!this.requestCache || n?.cache === "no-cache" || n?.cache === "reload") return;
|
|
@@ -42734,17 +42740,17 @@ var Lt = class extends K {
|
|
|
42734
42740
|
if (s.status === 401) return this.handleUnauthenticated(t, n, i);
|
|
42735
42741
|
if (s.status === 204 || s.status === 304) return;
|
|
42736
42742
|
let c = s.headers.get("content-type")?.includes("json");
|
|
42737
|
-
if (s.status === 404 && !c) throw new d(
|
|
42743
|
+
if (s.status === 404 && !c) throw new d(un);
|
|
42738
42744
|
let u2 = await this.parseBody(s, c);
|
|
42739
42745
|
if (s.status === 200 && i.followRedirectOnOk || s.status === 201 && i.followRedirectOnCreated) {
|
|
42740
42746
|
let l2 = await ki(s, u2);
|
|
42741
42747
|
if (l2) return this.request("GET", l2, { ...i, body: void 0 });
|
|
42742
42748
|
}
|
|
42743
42749
|
if (s.status === 202 && i.pollStatusOnAccepted) {
|
|
42744
|
-
let
|
|
42745
|
-
if (
|
|
42750
|
+
let h = await ki(s, u2) ?? o.statusUrl;
|
|
42751
|
+
if (h) return this.pollStatus(h, i, o);
|
|
42746
42752
|
}
|
|
42747
|
-
if (s.status >= 400) throw new d(
|
|
42753
|
+
if (s.status >= 400) throw new d(Xe(u2));
|
|
42748
42754
|
return u2;
|
|
42749
42755
|
}
|
|
42750
42756
|
async parseBody(t, n) {
|
|
@@ -42770,14 +42776,14 @@ var Lt = class extends K {
|
|
|
42770
42776
|
} catch (a2) {
|
|
42771
42777
|
if (a2.message === "Failed to fetch" && s === 0 && this.dispatchEvent({ type: "offline" }), a2.name === "AbortError" || s === i) throw a2;
|
|
42772
42778
|
}
|
|
42773
|
-
await
|
|
42779
|
+
await Er(o);
|
|
42774
42780
|
}
|
|
42775
42781
|
throw new Error("Unreachable");
|
|
42776
42782
|
}
|
|
42777
42783
|
logRequest(t, n) {
|
|
42778
42784
|
if (console.log(`> ${n.method} ${t}`), n.headers) {
|
|
42779
42785
|
let i = n.headers;
|
|
42780
|
-
for (let o of
|
|
42786
|
+
for (let o of ut(Object.keys(i))) console.log(`> ${o}: ${i[o]}`);
|
|
42781
42787
|
}
|
|
42782
42788
|
}
|
|
42783
42789
|
logResponse(t) {
|
|
@@ -42788,7 +42794,7 @@ var Lt = class extends K {
|
|
|
42788
42794
|
if (i.pollCount === void 0) n.headers && typeof n.headers == "object" && "Prefer" in n.headers && (o.headers = { ...n.headers }, delete o.headers.Prefer), i.statusUrl = t, i.pollCount = 1;
|
|
42789
42795
|
else {
|
|
42790
42796
|
let s = n.pollStatusPeriod ?? 1e3;
|
|
42791
|
-
await
|
|
42797
|
+
await Er(s), i.pollCount++;
|
|
42792
42798
|
}
|
|
42793
42799
|
return this.request("GET", t, o, i);
|
|
42794
42800
|
}
|
|
@@ -42800,20 +42806,20 @@ var Lt = class extends K {
|
|
|
42800
42806
|
try {
|
|
42801
42807
|
o.resolve(await this.request(o.method, q(this.fhirBaseUrl, o.url), o.options));
|
|
42802
42808
|
} catch (s) {
|
|
42803
|
-
o.reject(new d(
|
|
42809
|
+
o.reject(new d(Xe(s)));
|
|
42804
42810
|
}
|
|
42805
42811
|
return;
|
|
42806
42812
|
}
|
|
42807
42813
|
let n = { resourceType: "Bundle", type: "batch", entry: t.map((o) => ({ request: { method: o.method, url: o.url }, resource: o.options.body ? JSON.parse(o.options.body) : void 0 })) }, i = await this.post(this.fhirBaseUrl, n);
|
|
42808
42814
|
for (let o = 0; o < t.length; o++) {
|
|
42809
42815
|
let s = t[o], a2 = i.entry?.[o];
|
|
42810
|
-
a2?.response?.outcome && !
|
|
42816
|
+
a2?.response?.outcome && !rr(a2.response.outcome) ? s.reject(new d(a2.response.outcome)) : s.resolve(a2?.resource);
|
|
42811
42817
|
}
|
|
42812
42818
|
}
|
|
42813
42819
|
addFetchOptionsDefaults(t) {
|
|
42814
42820
|
Object.entries(this.defaultHeaders).forEach(([n, i]) => {
|
|
42815
42821
|
this.setRequestHeader(t, n, i);
|
|
42816
|
-
}), this.setRequestHeader(t, "Accept",
|
|
42822
|
+
}), this.setRequestHeader(t, "Accept", aa, 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");
|
|
42817
42823
|
}
|
|
42818
42824
|
setRequestContentType(t, n) {
|
|
42819
42825
|
this.setRequestHeader(t, "Content-Type", n);
|
|
@@ -42827,14 +42833,14 @@ var Lt = class extends K {
|
|
|
42827
42833
|
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));
|
|
42828
42834
|
}
|
|
42829
42835
|
handleUnauthenticated(t, n, i) {
|
|
42830
|
-
return this.refresh() ? this.request(t, n, i) : (this.clear(), this.onUnauthenticated && this.onUnauthenticated(), Promise.reject(new d(
|
|
42836
|
+
return this.refresh() ? this.request(t, n, i) : (this.clear(), this.onUnauthenticated && this.onUnauthenticated(), Promise.reject(new d(Re)));
|
|
42831
42837
|
}
|
|
42832
42838
|
async startPkce() {
|
|
42833
|
-
let t =
|
|
42839
|
+
let t = _r();
|
|
42834
42840
|
sessionStorage.setItem("pkceState", t);
|
|
42835
|
-
let n =
|
|
42841
|
+
let n = _r().slice(0, 128);
|
|
42836
42842
|
sessionStorage.setItem("codeVerifier", n);
|
|
42837
|
-
let i = await
|
|
42843
|
+
let i = await gi(n), o = Hn(i).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
|
|
42838
42844
|
return sessionStorage.setItem("codeChallenge", o), { codeChallengeMethod: "S256", codeChallenge: o };
|
|
42839
42845
|
}
|
|
42840
42846
|
async requestAuthorization(t) {
|
|
@@ -42875,25 +42881,25 @@ var Lt = class extends K {
|
|
|
42875
42881
|
return n.append("grant_type", "client_credentials"), n.append("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.append("client_assertion", t), this.fetchTokens(n);
|
|
42876
42882
|
}
|
|
42877
42883
|
setBasicAuth(t, n) {
|
|
42878
|
-
this.clientId = t, this.clientSecret = n, this.basicAuth =
|
|
42884
|
+
this.clientId = t, this.clientSecret = n, this.basicAuth = yi(t + ":" + n);
|
|
42879
42885
|
}
|
|
42880
42886
|
async fhircastSubscribe(t, n) {
|
|
42881
|
-
if (!(typeof t == "string" && t !== "")) throw new d(
|
|
42882
|
-
if (!(typeof n == "object" && Array.isArray(n) && n.length > 0)) throw new d(
|
|
42883
|
-
let i = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post(this.fhircastHubUrl,
|
|
42887
|
+
if (!(typeof t == "string" && t !== "")) throw new d(m("Invalid topic provided. Topic must be a valid string."));
|
|
42888
|
+
if (!(typeof n == "object" && Array.isArray(n) && n.length > 0)) throw new d(m("Invalid events provided. Events must be an array of event names containing at least one event."));
|
|
42889
|
+
let i = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post(this.fhircastHubUrl, Ur(i), A.FORM_URL_ENCODED))["hub.channel.endpoint"];
|
|
42884
42890
|
if (!s) throw new Error("Invalid response!");
|
|
42885
42891
|
return i.endpoint = s, i;
|
|
42886
42892
|
}
|
|
42887
42893
|
async fhircastUnsubscribe(t) {
|
|
42888
|
-
if (!
|
|
42889
|
-
if (!(t.endpoint && typeof t.endpoint == "string" && t.endpoint.startsWith("ws"))) throw new d(
|
|
42890
|
-
t.mode = "unsubscribe", await this.post(this.fhircastHubUrl,
|
|
42894
|
+
if (!It(t)) throw new d(m("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));
|
|
42895
|
+
if (!(t.endpoint && typeof t.endpoint == "string" && t.endpoint.startsWith("ws"))) throw new d(m("Provided subscription request must have an endpoint in order to unsubscribe."));
|
|
42896
|
+
t.mode = "unsubscribe", await this.post(this.fhircastHubUrl, Ur(t), A.FORM_URL_ENCODED);
|
|
42891
42897
|
}
|
|
42892
42898
|
fhircastConnect(t) {
|
|
42893
|
-
return new
|
|
42899
|
+
return new Ot(t);
|
|
42894
42900
|
}
|
|
42895
42901
|
async fhircastPublish(t, n, i, o) {
|
|
42896
|
-
return vi(n) ? this.post(this.fhircastHubUrl,
|
|
42902
|
+
return vi(n) ? this.post(this.fhircastHubUrl, Br(t, n, i, o), A.JSON) : (Ti(n), this.post(this.fhircastHubUrl, Br(t, n, i), A.JSON));
|
|
42897
42903
|
}
|
|
42898
42904
|
async fhircastGetContext(t) {
|
|
42899
42905
|
return this.get(`${this.fhircastHubUrl}/${t}`);
|
|
@@ -42914,9 +42920,9 @@ var Lt = class extends K {
|
|
|
42914
42920
|
this.clearActiveLogin();
|
|
42915
42921
|
try {
|
|
42916
42922
|
let a2 = await o.json();
|
|
42917
|
-
throw new d(
|
|
42923
|
+
throw new d(b(a2.error_description));
|
|
42918
42924
|
} catch (a2) {
|
|
42919
|
-
throw new d(
|
|
42925
|
+
throw new d(b("Failed to fetch tokens"), a2);
|
|
42920
42926
|
}
|
|
42921
42927
|
}
|
|
42922
42928
|
let s = await o.json();
|
|
@@ -42924,12 +42930,12 @@ var Lt = class extends K {
|
|
|
42924
42930
|
}
|
|
42925
42931
|
async verifyTokens(t) {
|
|
42926
42932
|
let n = t.access_token;
|
|
42927
|
-
if (
|
|
42928
|
-
let i =
|
|
42929
|
-
if (Date.now() >= i.exp * 1e3) throw this.clearActiveLogin(), new d(
|
|
42933
|
+
if (bi(n)) {
|
|
42934
|
+
let i = kt(n);
|
|
42935
|
+
if (Date.now() >= i.exp * 1e3) throw this.clearActiveLogin(), new d(ln);
|
|
42930
42936
|
if (i.cid) {
|
|
42931
|
-
if (i.cid !== this.clientId) throw this.clearActiveLogin(), new d(
|
|
42932
|
-
} else if (this.clientId && i.client_id !== this.clientId) throw this.clearActiveLogin(), new d(
|
|
42937
|
+
if (i.cid !== this.clientId) throw this.clearActiveLogin(), new d(tr);
|
|
42938
|
+
} else if (this.clientId && i.client_id !== this.clientId) throw this.clearActiveLogin(), new d(tr);
|
|
42933
42939
|
}
|
|
42934
42940
|
return this.setActiveLogin({ accessToken: n, refreshToken: t.refresh_token, project: t.project, profile: t.profile });
|
|
42935
42941
|
}
|
|
@@ -42949,7 +42955,7 @@ var Lt = class extends K {
|
|
|
42949
42955
|
}
|
|
42950
42956
|
}
|
|
42951
42957
|
getSubscriptionManager() {
|
|
42952
|
-
return this.subscriptionManager || (this.subscriptionManager = new
|
|
42958
|
+
return this.subscriptionManager || (this.subscriptionManager = new _t(this, Yn(this.baseUrl, "/ws/subscriptions-r4"))), this.subscriptionManager;
|
|
42953
42959
|
}
|
|
42954
42960
|
subscribeToCriteria(t, n) {
|
|
42955
42961
|
return this.getSubscriptionManager().addCriteria(t, n);
|
|
@@ -42961,7 +42967,7 @@ var Lt = class extends K {
|
|
|
42961
42967
|
return this.getSubscriptionManager().getMasterEmitter();
|
|
42962
42968
|
}
|
|
42963
42969
|
};
|
|
42964
|
-
function
|
|
42970
|
+
function xa() {
|
|
42965
42971
|
if (!globalThis.fetch) throw new Error("Fetch not available in this environment");
|
|
42966
42972
|
return globalThis.fetch.bind(globalThis);
|
|
42967
42973
|
}
|
|
@@ -42973,30 +42979,30 @@ async function ki(r7, e) {
|
|
|
42973
42979
|
if (t) return t;
|
|
42974
42980
|
let n = r7.headers.get("location");
|
|
42975
42981
|
if (n) return n;
|
|
42976
|
-
if (
|
|
42982
|
+
if (Ce(e) && e.issue?.[0]?.diagnostics) return e.issue[0].diagnostics;
|
|
42977
42983
|
}
|
|
42978
42984
|
function Vi(r7) {
|
|
42979
42985
|
let e = r7.entry?.map((t) => t.resource) ?? [];
|
|
42980
42986
|
return Object.assign(e, { bundle: r7 });
|
|
42981
42987
|
}
|
|
42982
|
-
function
|
|
42988
|
+
function va(r7) {
|
|
42983
42989
|
return R(r7) && "data" in r7 && "contentType" in r7;
|
|
42984
42990
|
}
|
|
42985
42991
|
function Di(r7, e, t, n) {
|
|
42986
|
-
return
|
|
42992
|
+
return va(r7) ? r7 : { data: r7, filename: e, contentType: t, onProgress: n };
|
|
42987
42993
|
}
|
|
42988
|
-
function
|
|
42994
|
+
function Ta(r7) {
|
|
42989
42995
|
return R(r7) && "docDefinition" in r7;
|
|
42990
42996
|
}
|
|
42991
|
-
function
|
|
42992
|
-
return
|
|
42997
|
+
function Sa(r7, e, t, n) {
|
|
42998
|
+
return Ta(r7) ? r7 : { docDefinition: r7, filename: e, tableLayouts: t, fonts: n };
|
|
42993
42999
|
}
|
|
42994
|
-
var Va = [...
|
|
42995
|
-
var _a =
|
|
43000
|
+
var Va = [...je, "->", "<<", ">>", "=="];
|
|
43001
|
+
var _a = We().registerInfix("->", { precedence: y.Arrow }).registerInfix(";", { precedence: y.Semicolon });
|
|
42996
43002
|
var Xa = " ".repeat(2);
|
|
42997
|
-
var tc = [...
|
|
42998
|
-
var ic =
|
|
42999
|
-
var
|
|
43003
|
+
var tc = [...je, "eq", "ne", "co"];
|
|
43004
|
+
var ic = We();
|
|
43005
|
+
var le = class {
|
|
43000
43006
|
constructor(e = "\r", t = "|", n = "^", i = "~", o = "\\", s = "&") {
|
|
43001
43007
|
this.segmentSeparator = e;
|
|
43002
43008
|
this.fieldSeparator = t;
|
|
@@ -43013,7 +43019,7 @@ var ce = class {
|
|
|
43013
43019
|
}
|
|
43014
43020
|
};
|
|
43015
43021
|
var Yi = class r2 {
|
|
43016
|
-
constructor(e, t = new
|
|
43022
|
+
constructor(e, t = new le()) {
|
|
43017
43023
|
this.context = t, this.segments = e;
|
|
43018
43024
|
}
|
|
43019
43025
|
get header() {
|
|
@@ -43047,21 +43053,21 @@ var Yi = class r2 {
|
|
|
43047
43053
|
let n = new Error("Invalid HL7 message");
|
|
43048
43054
|
throw n.type = "entity.parse.failed", n;
|
|
43049
43055
|
}
|
|
43050
|
-
let t = new
|
|
43056
|
+
let t = new le("\r", e.charAt(3), e.charAt(4), e.charAt(5), e.charAt(6), e.charAt(7));
|
|
43051
43057
|
return new r2(e.split(/[\r\n]+/).map((n) => ze.parse(n, t)), t);
|
|
43052
43058
|
}
|
|
43053
43059
|
};
|
|
43054
43060
|
var ze = class r3 {
|
|
43055
|
-
constructor(e, t = new
|
|
43056
|
-
this.context = t,
|
|
43061
|
+
constructor(e, t = new le()) {
|
|
43062
|
+
this.context = t, Wn(e) ? this.fields = e.map((n) => _e.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
|
|
43057
43063
|
}
|
|
43058
43064
|
get(e) {
|
|
43059
43065
|
return this.fields[e];
|
|
43060
43066
|
}
|
|
43061
43067
|
getField(e) {
|
|
43062
43068
|
if (this.name === "MSH") {
|
|
43063
|
-
if (e === 1) return new
|
|
43064
|
-
if (e === 2) return new
|
|
43069
|
+
if (e === 1) return new _e([[this.context.getMsh1()]], this.context);
|
|
43070
|
+
if (e === 2) return new _e([[this.context.getMsh2()]], this.context);
|
|
43065
43071
|
if (e > 2) return this.fields[e - 1];
|
|
43066
43072
|
}
|
|
43067
43073
|
return this.fields[e];
|
|
@@ -43072,12 +43078,12 @@ var ze = class r3 {
|
|
|
43072
43078
|
toString() {
|
|
43073
43079
|
return this.fields.map((e) => e.toString()).join(this.context.fieldSeparator);
|
|
43074
43080
|
}
|
|
43075
|
-
static parse(e, t = new
|
|
43076
|
-
return new r3(e.split(t.fieldSeparator).map((n) =>
|
|
43081
|
+
static parse(e, t = new le()) {
|
|
43082
|
+
return new r3(e.split(t.fieldSeparator).map((n) => _e.parse(n, t)), t);
|
|
43077
43083
|
}
|
|
43078
43084
|
};
|
|
43079
|
-
var
|
|
43080
|
-
constructor(e, t = new
|
|
43085
|
+
var _e = class r4 {
|
|
43086
|
+
constructor(e, t = new le()) {
|
|
43081
43087
|
this.context = t, this.components = e;
|
|
43082
43088
|
}
|
|
43083
43089
|
get(e, t, n = 0) {
|
|
@@ -43090,7 +43096,7 @@ var Ne = class r4 {
|
|
|
43090
43096
|
toString() {
|
|
43091
43097
|
return this.components.map((e) => e.join(this.context.componentSeparator)).join(this.context.repetitionSeparator);
|
|
43092
43098
|
}
|
|
43093
|
-
static parse(e, t = new
|
|
43099
|
+
static parse(e, t = new le()) {
|
|
43094
43100
|
return new r4(e.split(t.repetitionSeparator).map((n) => n.split(t.componentSeparator)), t);
|
|
43095
43101
|
}
|
|
43096
43102
|
};
|
|
@@ -43098,7 +43104,7 @@ function sc(r7) {
|
|
|
43098
43104
|
let e = r7 instanceof Date ? r7 : new Date(r7), n = e.toISOString().replace(/[-:T]/g, "").replace(/(\.\d+)?Z$/, ""), i = e.getUTCMilliseconds();
|
|
43099
43105
|
return i > 0 && (n += "." + i.toString()), n;
|
|
43100
43106
|
}
|
|
43101
|
-
var
|
|
43107
|
+
var Zr = ((o) => (o[o.NONE = 0] = "NONE", o[o.ERROR = 1] = "ERROR", o[o.WARN = 2] = "WARN", o[o.INFO = 3] = "INFO", o[o.DEBUG = 4] = "DEBUG", o))(Zr || {});
|
|
43102
43108
|
var Zi = class r5 {
|
|
43103
43109
|
constructor(e, t = {}, n = 3, i) {
|
|
43104
43110
|
this.write = e;
|
|
@@ -43129,17 +43135,17 @@ var Zi = class r5 {
|
|
|
43129
43135
|
}
|
|
43130
43136
|
log(e, t, n) {
|
|
43131
43137
|
e > this.level || (n instanceof Error && (n = { error: n.toString(), stack: n.stack?.split(`
|
|
43132
|
-
`) }), this.write(JSON.stringify({ level:
|
|
43138
|
+
`) }), this.write(JSON.stringify({ level: Zr[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: this.prefix ? `${this.prefix}${t}` : t, ...n, ...this.metadata })));
|
|
43133
43139
|
}
|
|
43134
43140
|
};
|
|
43135
|
-
function
|
|
43136
|
-
let e =
|
|
43141
|
+
function bh(r7) {
|
|
43142
|
+
let e = Zr[r7.toUpperCase()];
|
|
43137
43143
|
if (e === void 0) throw new Error(`Invalid log level: ${r7}`);
|
|
43138
43144
|
return e;
|
|
43139
43145
|
}
|
|
43140
43146
|
var fc = "https://meta.medplum.com/releases";
|
|
43141
|
-
var
|
|
43142
|
-
function
|
|
43147
|
+
var Ht = /* @__PURE__ */ new Map();
|
|
43148
|
+
function hc(r7) {
|
|
43143
43149
|
let e = r7;
|
|
43144
43150
|
if (!e.tag_name) throw new Error("Manifest missing tag_name");
|
|
43145
43151
|
let t = e.assets;
|
|
@@ -43149,40 +43155,40 @@ function mc(r7) {
|
|
|
43149
43155
|
if (!n.name) throw new Error("Asset missing name");
|
|
43150
43156
|
}
|
|
43151
43157
|
}
|
|
43152
|
-
async function
|
|
43153
|
-
let n =
|
|
43158
|
+
async function en(r7, e, t) {
|
|
43159
|
+
let n = Ht.get(e ?? "latest");
|
|
43154
43160
|
if (!n) {
|
|
43155
43161
|
let i = e ? `v${e}` : "latest", o = new URL(`${fc}/${i}.json`);
|
|
43156
|
-
if (o.searchParams.set("a", r7), o.searchParams.set("c",
|
|
43162
|
+
if (o.searchParams.set("a", r7), o.searchParams.set("c", Wr), t) for (let [c, u2] of Object.entries(t)) o.searchParams.set(c, u2);
|
|
43157
43163
|
let s = await fetch(o.toString());
|
|
43158
43164
|
if (s.status !== 200) {
|
|
43159
43165
|
let c;
|
|
43160
43166
|
try {
|
|
43161
43167
|
c = (await s.json()).message;
|
|
43162
43168
|
} catch (u2) {
|
|
43163
|
-
console.error(`Failed to parse message from body: ${
|
|
43169
|
+
console.error(`Failed to parse message from body: ${Pe(u2)}`);
|
|
43164
43170
|
}
|
|
43165
43171
|
throw new Error(`Received status code ${s.status} while fetching manifest for version '${e ?? "latest"}'. Message: ${c}`);
|
|
43166
43172
|
}
|
|
43167
43173
|
let a2 = await s.json();
|
|
43168
|
-
|
|
43174
|
+
hc(a2), n = a2, Ht.set(e ?? "latest", n), e || Ht.set(n.tag_name.slice(1), n);
|
|
43169
43175
|
}
|
|
43170
43176
|
return n;
|
|
43171
43177
|
}
|
|
43172
|
-
function
|
|
43178
|
+
function mc(r7) {
|
|
43173
43179
|
return /^\d+\.\d+\.\d+$/.test(r7);
|
|
43174
43180
|
}
|
|
43175
|
-
async function
|
|
43176
|
-
if (!
|
|
43181
|
+
async function Lh(r7, e) {
|
|
43182
|
+
if (!mc(e)) return false;
|
|
43177
43183
|
try {
|
|
43178
|
-
await
|
|
43184
|
+
await en(r7, e);
|
|
43179
43185
|
} catch {
|
|
43180
43186
|
return false;
|
|
43181
43187
|
}
|
|
43182
43188
|
return true;
|
|
43183
43189
|
}
|
|
43184
|
-
async function
|
|
43185
|
-
let e = await
|
|
43190
|
+
async function Fh(r7) {
|
|
43191
|
+
let e = await en(r7);
|
|
43186
43192
|
if (!e.tag_name.startsWith("v")) throw new Error(`Invalid release name found. Release tag '${e.tag_name}' did not start with 'v'`);
|
|
43187
43193
|
return e.tag_name.slice(1);
|
|
43188
43194
|
}
|
|
@@ -43273,7 +43279,7 @@ var p2 = class extends a {
|
|
|
43273
43279
|
this.chunks = [];
|
|
43274
43280
|
}
|
|
43275
43281
|
};
|
|
43276
|
-
var
|
|
43282
|
+
var m2 = class extends a {
|
|
43277
43283
|
constructor(t) {
|
|
43278
43284
|
super(), this.options = t, this.host = this.options.host, this.port = this.options.port, this.encoding = this.options.encoding, this.keepAlive = this.options.keepAlive ?? false;
|
|
43279
43285
|
}
|
|
@@ -43470,7 +43476,7 @@ var AgentDicomChannel = class extends BaseChannel {
|
|
|
43470
43476
|
calledAeTitle: this.association?.getCalledAeTitle()
|
|
43471
43477
|
},
|
|
43472
43478
|
dataset: dicomJson,
|
|
43473
|
-
binary: binary ?
|
|
43479
|
+
binary: binary ? ne(binary) : void 0
|
|
43474
43480
|
};
|
|
43475
43481
|
App.instance.addToWebSocketQueue({
|
|
43476
43482
|
type: "agent:transmit:request",
|
|
@@ -43483,7 +43489,7 @@ var AgentDicomChannel = class extends BaseChannel {
|
|
|
43483
43489
|
});
|
|
43484
43490
|
response.setStatus(dimse.constants.Status.Success);
|
|
43485
43491
|
} catch (err) {
|
|
43486
|
-
DcmjsDimseScp.channel.log.error(`DICOM error: ${
|
|
43492
|
+
DcmjsDimseScp.channel.log.error(`DICOM error: ${Pe(err)}`);
|
|
43487
43493
|
response.setStatus(dimse.constants.Status.ProcessingFailure);
|
|
43488
43494
|
}
|
|
43489
43495
|
return response;
|
|
@@ -43588,7 +43594,7 @@ var AgentHl7ChannelConnection = class {
|
|
|
43588
43594
|
callback: `Agent/${this.channel.app.agentId}-${(0, import_node_crypto2.randomUUID)()}`
|
|
43589
43595
|
});
|
|
43590
43596
|
} catch (err) {
|
|
43591
|
-
this.channel.log.error(`HL7 error: ${
|
|
43597
|
+
this.channel.log.error(`HL7 error: ${Pe(err)}`);
|
|
43592
43598
|
}
|
|
43593
43599
|
}
|
|
43594
43600
|
close() {
|
|
@@ -43608,7 +43614,7 @@ var UPGRADER_LOG_PATH = (0, import_node_path2.resolve)(
|
|
|
43608
43614
|
);
|
|
43609
43615
|
var RELEASES_PATH = (0, import_node_path2.resolve)(__dirname);
|
|
43610
43616
|
async function downloadRelease(version, path) {
|
|
43611
|
-
const release = await
|
|
43617
|
+
const release = await en("agent-upgrader", version);
|
|
43612
43618
|
const downloadUrl = parseDownloadUrl(release, (0, import_node_os2.platform)());
|
|
43613
43619
|
const { body } = await fetch(downloadUrl);
|
|
43614
43620
|
if (!body) {
|
|
@@ -43704,7 +43710,7 @@ var App = class _App {
|
|
|
43704
43710
|
if ((0, import_node_fs3.existsSync)(UPGRADE_MANIFEST_PATH)) {
|
|
43705
43711
|
const upgradeFile = (0, import_node_fs3.readFileSync)(UPGRADE_MANIFEST_PATH, { encoding: "utf-8" });
|
|
43706
43712
|
const upgradeDetails = JSON.parse(upgradeFile);
|
|
43707
|
-
if (upgradeDetails.targetVersion ===
|
|
43713
|
+
if (upgradeDetails.targetVersion === Wr.split("-")[0]) {
|
|
43708
43714
|
await this.sendToWebSocket({
|
|
43709
43715
|
type: "agent:upgrade:response",
|
|
43710
43716
|
statusCode: 200,
|
|
@@ -43712,7 +43718,7 @@ var App = class _App {
|
|
|
43712
43718
|
});
|
|
43713
43719
|
this.log.info(`Successfully upgraded to version ${upgradeDetails.targetVersion}`);
|
|
43714
43720
|
} else {
|
|
43715
|
-
const errMsg = `Failed to upgrade to version ${upgradeDetails.targetVersion}. Agent still running with version ${
|
|
43721
|
+
const errMsg = `Failed to upgrade to version ${upgradeDetails.targetVersion}. Agent still running with version ${Wr}`;
|
|
43716
43722
|
await this.sendToWebSocket({
|
|
43717
43723
|
type: "agent:error",
|
|
43718
43724
|
body: errMsg,
|
|
@@ -43749,7 +43755,7 @@ var App = class _App {
|
|
|
43749
43755
|
webSocketUrl.protocol = webSocketUrl.protocol === "https:" ? "wss:" : "ws:";
|
|
43750
43756
|
webSocketUrl.pathname = "/ws/agent";
|
|
43751
43757
|
this.log.info(`Connecting to WebSocket: ${webSocketUrl.href}`);
|
|
43752
|
-
this.webSocket = new
|
|
43758
|
+
this.webSocket = new Mt(webSocketUrl.toString(), void 0, {
|
|
43753
43759
|
WebSocket: wrapper_default,
|
|
43754
43760
|
binaryType: "nodebuffer"
|
|
43755
43761
|
});
|
|
@@ -43787,7 +43793,7 @@ var App = class _App {
|
|
|
43787
43793
|
break;
|
|
43788
43794
|
case "agent:heartbeat:request":
|
|
43789
43795
|
this.outstandingHeartbeats = 0;
|
|
43790
|
-
await this.sendToWebSocket({ type: "agent:heartbeat:response", version:
|
|
43796
|
+
await this.sendToWebSocket({ type: "agent:heartbeat:response", version: Wr });
|
|
43791
43797
|
break;
|
|
43792
43798
|
case "agent:heartbeat:response":
|
|
43793
43799
|
this.outstandingHeartbeats = 0;
|
|
@@ -43830,7 +43836,7 @@ var App = class _App {
|
|
|
43830
43836
|
} catch (err) {
|
|
43831
43837
|
await this.sendToWebSocket({
|
|
43832
43838
|
type: "agent:error",
|
|
43833
|
-
body:
|
|
43839
|
+
body: Pe(err),
|
|
43834
43840
|
callback: command.callback
|
|
43835
43841
|
});
|
|
43836
43842
|
}
|
|
@@ -43845,7 +43851,7 @@ var App = class _App {
|
|
|
43845
43851
|
this.log.error(`Unknown message type: ${command.type}`);
|
|
43846
43852
|
}
|
|
43847
43853
|
} catch (err) {
|
|
43848
|
-
this.log.error(`WebSocket error on incoming message: ${
|
|
43854
|
+
this.log.error(`WebSocket error on incoming message: ${Pe(err)}`);
|
|
43849
43855
|
}
|
|
43850
43856
|
});
|
|
43851
43857
|
return new Promise((resolve2, reject) => {
|
|
@@ -43920,7 +43926,7 @@ var App = class _App {
|
|
|
43920
43926
|
try {
|
|
43921
43927
|
await this.startOrReloadChannel(definition, endpoint);
|
|
43922
43928
|
} catch (err) {
|
|
43923
|
-
this.log.error(
|
|
43929
|
+
this.log.error(Pe(err));
|
|
43924
43930
|
}
|
|
43925
43931
|
}
|
|
43926
43932
|
}
|
|
@@ -43946,7 +43952,7 @@ var App = class _App {
|
|
|
43946
43952
|
parsedEndpoint = new URL(endpoint.address);
|
|
43947
43953
|
} catch (err) {
|
|
43948
43954
|
throw new Error(
|
|
43949
|
-
`Error while validating endpoint address for channel '${channel.name}': ${
|
|
43955
|
+
`Error while validating endpoint address for channel '${channel.name}': ${Pe(err)}`
|
|
43950
43956
|
);
|
|
43951
43957
|
}
|
|
43952
43958
|
if (seenPorts.has(parsedEndpoint.port)) {
|
|
@@ -44025,7 +44031,7 @@ var App = class _App {
|
|
|
44025
44031
|
try {
|
|
44026
44032
|
await this.sendToWebSocket(msg);
|
|
44027
44033
|
} catch (err) {
|
|
44028
|
-
this.log.error(`WebSocket error while attempting to send message: ${
|
|
44034
|
+
this.log.error(`WebSocket error while attempting to send message: ${Pe(err)}`);
|
|
44029
44035
|
this.webSocketQueue.unshift(msg);
|
|
44030
44036
|
throw err;
|
|
44031
44037
|
}
|
|
@@ -44062,7 +44068,7 @@ IPv6 is currently unsupported.`;
|
|
|
44062
44068
|
this.log.error(errMsg);
|
|
44063
44069
|
throw new Error(errMsg);
|
|
44064
44070
|
}
|
|
44065
|
-
if (!((0, import_node_net3.isIPv4)(message.remote) ||
|
|
44071
|
+
if (!((0, import_node_net3.isIPv4)(message.remote) || dl(message.remote))) {
|
|
44066
44072
|
const errMsg = `Attempted to ping an invalid host.
|
|
44067
44073
|
|
|
44068
44074
|
"${message.remote}" is not a valid IPv4 address or a resolvable hostname.`;
|
|
@@ -44101,7 +44107,7 @@ ${result}`);
|
|
|
44101
44107
|
body: result
|
|
44102
44108
|
});
|
|
44103
44109
|
} catch (err) {
|
|
44104
|
-
this.log.error(`Error during ping attempt to ${message.remote ?? "NO_HOST_GIVEN"}: ${
|
|
44110
|
+
this.log.error(`Error during ping attempt to ${message.remote ?? "NO_HOST_GIVEN"}: ${Pe(err)}`);
|
|
44105
44111
|
this.addToWebSocketQueue({
|
|
44106
44112
|
type: "agent:transmit:response",
|
|
44107
44113
|
channel: message.channel,
|
|
@@ -44109,7 +44115,7 @@ ${result}`);
|
|
|
44109
44115
|
remote: message.remote,
|
|
44110
44116
|
callback: message.callback,
|
|
44111
44117
|
statusCode: 400,
|
|
44112
|
-
body:
|
|
44118
|
+
body: Pe(err)
|
|
44113
44119
|
});
|
|
44114
44120
|
}
|
|
44115
44121
|
}
|
|
@@ -44125,7 +44131,7 @@ ${result}`);
|
|
|
44125
44131
|
return;
|
|
44126
44132
|
}
|
|
44127
44133
|
let child;
|
|
44128
|
-
if (message.version && !await
|
|
44134
|
+
if (message.version && !await Lh("agent-upgrader", message.version)) {
|
|
44129
44135
|
const versionTag = message.version ? `v${message.version}` : "latest";
|
|
44130
44136
|
const errMsg = `Error during upgrading to version '${versionTag}'. '${message.version}' is not a valid version`;
|
|
44131
44137
|
this.log.error(errMsg);
|
|
@@ -44156,11 +44162,11 @@ ${result}`);
|
|
|
44156
44162
|
});
|
|
44157
44163
|
});
|
|
44158
44164
|
child.on("error", (err) => {
|
|
44159
|
-
this.log.error(
|
|
44165
|
+
this.log.error(Pe(err));
|
|
44160
44166
|
});
|
|
44161
44167
|
} catch (err) {
|
|
44162
44168
|
const versionTag = message.version ? `v${message.version}` : "latest";
|
|
44163
|
-
const errMsg = `Error during upgrading to version '${versionTag}': ${
|
|
44169
|
+
const errMsg = `Error during upgrading to version '${versionTag}': ${Pe(err)}`;
|
|
44164
44170
|
this.log.error(errMsg);
|
|
44165
44171
|
await this.sendToWebSocket({
|
|
44166
44172
|
type: "agent:error",
|
|
@@ -44172,12 +44178,12 @@ ${result}`);
|
|
|
44172
44178
|
try {
|
|
44173
44179
|
await this.stop();
|
|
44174
44180
|
this.log.info("Successfully stopped agent network services");
|
|
44175
|
-
const targetVersion = message.version ?? await
|
|
44176
|
-
this.log.info("Writing upgrade manifest...", { previousVersion:
|
|
44181
|
+
const targetVersion = message.version ?? await Fh("agent-upgrader");
|
|
44182
|
+
this.log.info("Writing upgrade manifest...", { previousVersion: Wr, targetVersion });
|
|
44177
44183
|
(0, import_node_fs3.writeFileSync)(
|
|
44178
44184
|
UPGRADE_MANIFEST_PATH,
|
|
44179
44185
|
JSON.stringify({
|
|
44180
|
-
previousVersion:
|
|
44186
|
+
previousVersion: Wr,
|
|
44181
44187
|
targetVersion,
|
|
44182
44188
|
callback: message.callback ?? null
|
|
44183
44189
|
}),
|
|
@@ -44187,7 +44193,7 @@ ${result}`);
|
|
|
44187
44193
|
child.disconnect();
|
|
44188
44194
|
} catch (err) {
|
|
44189
44195
|
this.log.error(
|
|
44190
|
-
`Error while stopping agent or messaging child process as part of upgrade: ${
|
|
44196
|
+
`Error while stopping agent or messaging child process as part of upgrade: ${Pe(err)}`
|
|
44191
44197
|
);
|
|
44192
44198
|
import_node_process.default.exit(1);
|
|
44193
44199
|
}
|
|
@@ -44223,7 +44229,7 @@ ${result}`);
|
|
|
44223
44229
|
} else {
|
|
44224
44230
|
const encoding = address.searchParams.get("encoding") ?? void 0;
|
|
44225
44231
|
const keepAlive = this.keepAlive;
|
|
44226
|
-
client = new
|
|
44232
|
+
client = new m2({
|
|
44227
44233
|
host: address.hostname,
|
|
44228
44234
|
port: Number.parseInt(address.port, 10),
|
|
44229
44235
|
encoding,
|
|
@@ -44257,7 +44263,7 @@ ${result}`);
|
|
|
44257
44263
|
body: response.toString()
|
|
44258
44264
|
});
|
|
44259
44265
|
}).catch((err) => {
|
|
44260
|
-
this.log.error(`HL7 error: ${
|
|
44266
|
+
this.log.error(`HL7 error: ${Pe(err)}`);
|
|
44261
44267
|
this.addToWebSocketQueue({
|
|
44262
44268
|
type: "agent:transmit:response",
|
|
44263
44269
|
channel: message.channel,
|
|
@@ -44265,7 +44271,7 @@ ${result}`);
|
|
|
44265
44271
|
callback: message.callback,
|
|
44266
44272
|
contentType: A.TEXT,
|
|
44267
44273
|
statusCode: 400,
|
|
44268
|
-
body:
|
|
44274
|
+
body: Pe(err)
|
|
44269
44275
|
});
|
|
44270
44276
|
if (client.keepAlive) {
|
|
44271
44277
|
this.hl7Clients.delete(message.remote);
|
|
@@ -44312,9 +44318,9 @@ async function agentMain(argv) {
|
|
|
44312
44318
|
process.exit(1);
|
|
44313
44319
|
}
|
|
44314
44320
|
const { baseUrl, clientId, clientSecret, agentId } = args;
|
|
44315
|
-
const medplum = new
|
|
44321
|
+
const medplum = new Nt({ baseUrl, clientId });
|
|
44316
44322
|
await medplum.startClientLogin(clientId, clientSecret);
|
|
44317
|
-
const app = new App(medplum, agentId,
|
|
44323
|
+
const app = new App(medplum, agentId, bh(args.logLevel ?? "INFO"));
|
|
44318
44324
|
await app.start();
|
|
44319
44325
|
process.on("SIGINT", async () => {
|
|
44320
44326
|
console.log("Gracefully shutting down from SIGINT (Ctrl-C)");
|
|
@@ -44355,10 +44361,10 @@ async function upgraderMain(argv) {
|
|
|
44355
44361
|
});
|
|
44356
44362
|
});
|
|
44357
44363
|
import_node_process2.default.send({ type: "STARTED" });
|
|
44358
|
-
if (argv[3] && !
|
|
44364
|
+
if (argv[3] && !mc(argv[3])) {
|
|
44359
44365
|
throw new Error("Invalid version specified");
|
|
44360
44366
|
}
|
|
44361
|
-
const version = argv[3] ?? await
|
|
44367
|
+
const version = argv[3] ?? await Fh("agent-upgrader");
|
|
44362
44368
|
const binPath = getReleaseBinPath(version);
|
|
44363
44369
|
if (!(0, import_node_fs5.existsSync)(binPath)) {
|
|
44364
44370
|
globalLogger.info(`Could not find binary at "${binPath}". Downloading release from GitHub...`);
|
|
@@ -44381,7 +44387,7 @@ async function upgraderMain(argv) {
|
|
|
44381
44387
|
(0, import_node_child_process2.spawnSync)(binPath, ["/S"]);
|
|
44382
44388
|
globalLogger.info(`Agent version ${version} successfully installed`);
|
|
44383
44389
|
} catch (err) {
|
|
44384
|
-
globalLogger.error(`Error while attempting to run installer: ${
|
|
44390
|
+
globalLogger.error(`Error while attempting to run installer: ${Pe(err)}`);
|
|
44385
44391
|
globalLogger.error("Failed to run installer, attempting to restart agent service...");
|
|
44386
44392
|
try {
|
|
44387
44393
|
(0, import_node_child_process2.execSync)('net start "Medplum Agent"');
|