@medplum/agent 3.2.18 → 3.2.20

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.
Files changed (2) hide show
  1. package/dist/cjs/index.cjs +597 -582
  2. package/package.json +6 -6
@@ -12,13 +12,13 @@ var __export = (target, all) => {
12
12
  for (var name in all)
13
13
  __defProp(target, name, { get: all[name], enumerable: true });
14
14
  };
15
- var __copyProps = (to2, from, except, desc) => {
15
+ var __copyProps = (to, from, except, desc) => {
16
16
  if (from && typeof from === "object" || typeof from === "function") {
17
17
  for (let key of __getOwnPropNames(from))
18
- if (!__hasOwnProp.call(to2, key) && key !== except)
19
- __defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ if (!__hasOwnProp.call(to, key) && key !== except)
19
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
20
  }
21
- return to2;
21
+ return to;
22
22
  };
23
23
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
24
  // If the importer is in node compatibility mode or this is not an ESM
@@ -1564,9 +1564,9 @@ var require_dbcs_codec = __commonJS({
1564
1564
  throw new Error("gb18030 decode tables conflict at byte 3");
1565
1565
  }
1566
1566
  var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k2]];
1567
- for (var l2 = 48; l2 <= 57; l2++) {
1568
- if (fourthByteNode[l2] === UNASSIGNED)
1569
- fourthByteNode[l2] = GB18030_CODE;
1567
+ for (var l3 = 48; l3 <= 57; l3++) {
1568
+ if (fourthByteNode[l3] === UNASSIGNED)
1569
+ fourthByteNode[l3] = GB18030_CODE;
1570
1570
  }
1571
1571
  }
1572
1572
  }
@@ -1623,10 +1623,10 @@ var require_dbcs_codec = __commonJS({
1623
1623
  for (var k2 = 1; k2 < chunk.length; k2++) {
1624
1624
  var part = chunk[k2];
1625
1625
  if (typeof part === "string") {
1626
- for (var l2 = 0; l2 < part.length; ) {
1627
- var code = part.charCodeAt(l2++);
1626
+ for (var l3 = 0; l3 < part.length; ) {
1627
+ var code = part.charCodeAt(l3++);
1628
1628
  if (55296 <= code && code < 56320) {
1629
- var codeTrail = part.charCodeAt(l2++);
1629
+ var codeTrail = part.charCodeAt(l3++);
1630
1630
  if (56320 <= codeTrail && codeTrail < 57344)
1631
1631
  writeTable[curAddr++] = 65536 + (code - 55296) * 1024 + (codeTrail - 56320);
1632
1632
  else
@@ -1635,7 +1635,7 @@ var require_dbcs_codec = __commonJS({
1635
1635
  var len = 4095 - code + 2;
1636
1636
  var seq = [];
1637
1637
  for (var m2 = 0; m2 < len; m2++)
1638
- seq.push(part.charCodeAt(l2++));
1638
+ seq.push(part.charCodeAt(l3++));
1639
1639
  writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length;
1640
1640
  this.decodeTableSeq.push(seq);
1641
1641
  } else
@@ -1643,7 +1643,7 @@ var require_dbcs_codec = __commonJS({
1643
1643
  }
1644
1644
  } else if (typeof part === "number") {
1645
1645
  var charCode = writeTable[curAddr - 1] + 1;
1646
- for (var l2 = 0; l2 < part; l2++)
1646
+ for (var l3 = 0; l3 < part; l3++)
1647
1647
  writeTable[curAddr++] = charCode++;
1648
1648
  } else
1649
1649
  throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]);
@@ -1916,15 +1916,15 @@ var require_dbcs_codec = __commonJS({
1916
1916
  function findIdx(table, val) {
1917
1917
  if (table[0] > val)
1918
1918
  return -1;
1919
- var l2 = 0, r7 = table.length;
1920
- while (l2 < r7 - 1) {
1921
- var mid = l2 + (r7 - l2 + 1 >> 1);
1919
+ var l3 = 0, r7 = table.length;
1920
+ while (l3 < r7 - 1) {
1921
+ var mid = l3 + (r7 - l3 + 1 >> 1);
1922
1922
  if (table[mid] <= val)
1923
- l2 = mid;
1923
+ l3 = mid;
1924
1924
  else
1925
1925
  r7 = mid;
1926
1926
  }
1927
- return l2;
1927
+ return l3;
1928
1928
  }
1929
1929
  }
1930
1930
  });
@@ -7633,12 +7633,12 @@ var require_dcmjs = __commonJS({
7633
7633
  };
7634
7634
  return _getPrototypeOf(o);
7635
7635
  }
7636
- function _setPrototypeOf(o, p3) {
7637
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p4) {
7638
- o2.__proto__ = p4;
7636
+ function _setPrototypeOf(o, p2) {
7637
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p3) {
7638
+ o2.__proto__ = p3;
7639
7639
  return o2;
7640
7640
  };
7641
- return _setPrototypeOf(o, p3);
7641
+ return _setPrototypeOf(o, p2);
7642
7642
  }
7643
7643
  function _isNativeReflectConstruct() {
7644
7644
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
@@ -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, m2, more, str2;
8755
+ let p2, n, m2, more, str2;
8756
8756
  do {
8757
8757
  more = s.window_size - s.lookahead - s.strstart;
8758
8758
  if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {
@@ -8761,16 +8761,16 @@ var require_dcmjs = __commonJS({
8761
8761
  s.strstart -= _w_size;
8762
8762
  s.block_start -= _w_size;
8763
8763
  n = s.hash_size;
8764
- p3 = n;
8764
+ p2 = n;
8765
8765
  do {
8766
- m2 = s.head[--p3];
8767
- s.head[p3] = m2 >= _w_size ? m2 - _w_size : 0;
8766
+ m2 = s.head[--p2];
8767
+ s.head[p2] = m2 >= _w_size ? m2 - _w_size : 0;
8768
8768
  } while (--n);
8769
8769
  n = _w_size;
8770
- p3 = n;
8770
+ p2 = n;
8771
8771
  do {
8772
- m2 = s.prev[--p3];
8773
- s.prev[p3] = m2 >= _w_size ? m2 - _w_size : 0;
8772
+ m2 = s.prev[--p2];
8773
+ s.prev[p2] = m2 >= _w_size ? m2 - _w_size : 0;
8774
8774
  } while (--n);
8775
8775
  more += _w_size;
8776
8776
  }
@@ -9647,9 +9647,9 @@ var require_dcmjs = __commonJS({
9647
9647
  if (typeof source !== "object") {
9648
9648
  throw new TypeError(source + "must be non-object");
9649
9649
  }
9650
- for (const p3 in source) {
9651
- if (_has(source, p3)) {
9652
- obj[p3] = source[p3];
9650
+ for (const p2 in source) {
9651
+ if (_has(source, p2)) {
9652
+ obj[p2] = source[p2];
9653
9653
  }
9654
9654
  }
9655
9655
  }
@@ -9657,11 +9657,11 @@ var require_dcmjs = __commonJS({
9657
9657
  };
9658
9658
  var flattenChunks = (chunks) => {
9659
9659
  let len2 = 0;
9660
- for (let i = 0, l2 = chunks.length; i < l2; i++) {
9660
+ for (let i = 0, l3 = chunks.length; i < l3; i++) {
9661
9661
  len2 += chunks[i].length;
9662
9662
  }
9663
9663
  const result = new Uint8Array(len2);
9664
- for (let i = 0, pos = 0, l2 = chunks.length; i < l2; i++) {
9664
+ for (let i = 0, pos = 0, l3 = chunks.length; i < l3; i++) {
9665
9665
  let chunk = chunks[i];
9666
9666
  result.set(chunk, pos);
9667
9667
  pos += chunk.length;
@@ -15689,11 +15689,11 @@ var require_dcmjs = __commonJS({
15689
15689
  var byteOffset = existingFrames * sliceLength;
15690
15690
  var pixelDataUInt8View = new Uint8Array(dataset.PixelData, byteOffset, labelmaps.length * sliceLength);
15691
15691
  var occupiedValue = this._getOccupiedValue();
15692
- for (var l2 = 0; l2 < labelmaps.length; l2++) {
15693
- var labelmap = labelmaps[l2];
15692
+ for (var l3 = 0; l3 < labelmaps.length; l3++) {
15693
+ var labelmap = labelmaps[l3];
15694
15694
  for (var i = 0; i < labelmap.length; i++) {
15695
15695
  if (labelmap[i] === segmentIndex) {
15696
- pixelDataUInt8View[l2 * sliceLength + i] = occupiedValue;
15696
+ pixelDataUInt8View[l3 * sliceLength + i] = occupiedValue;
15697
15697
  }
15698
15698
  }
15699
15699
  }
@@ -17825,8 +17825,8 @@ var require_dcmjs = __commonJS({
17825
17825
  var imageId = images[frame].imageId;
17826
17826
  var imageIdSpecificToolState = toolState[imageId];
17827
17827
  var brushPixelData = imageIdSpecificToolState.brush.data[segmentIndex].pixelData;
17828
- for (var p3 = 0; p3 < brushPixelData.length; p3++) {
17829
- pixelData[pixelDataIndex] = brushPixelData[p3];
17828
+ for (var p2 = 0; p2 < brushPixelData.length; p2++) {
17829
+ pixelData[pixelDataIndex] = brushPixelData[p2];
17830
17830
  pixelDataIndex++;
17831
17831
  }
17832
17832
  }
@@ -17969,11 +17969,11 @@ var require_dcmjs = __commonJS({
17969
17969
  var _pixelData2D$shape = _slicedToArray(pixelData2D.shape, 2);
17970
17970
  _pixelData2D$shape[0];
17971
17971
  _pixelData2D$shape[1];
17972
- for (var p3 = 0; p3 < cToolsPixelData.length; p3++) {
17973
- if (pixelData2D.data[p3]) {
17974
- cToolsPixelData[p3] = 1;
17972
+ for (var p2 = 0; p2 < cToolsPixelData.length; p2++) {
17973
+ if (pixelData2D.data[p2]) {
17974
+ cToolsPixelData[p2] = 1;
17975
17975
  } else {
17976
- cToolsPixelData[p3] = 0;
17976
+ cToolsPixelData[p2] = 0;
17977
17977
  }
17978
17978
  }
17979
17979
  }
@@ -18303,39 +18303,39 @@ var require_dcmjs = __commonJS({
18303
18303
  return out;
18304
18304
  }
18305
18305
  function rotateX(out, a2, b2, rad) {
18306
- var p3 = [], r7 = [];
18307
- p3[0] = a2[0] - b2[0];
18308
- p3[1] = a2[1] - b2[1];
18309
- p3[2] = a2[2] - b2[2];
18310
- r7[0] = p3[0];
18311
- r7[1] = p3[1] * Math.cos(rad) - p3[2] * Math.sin(rad);
18312
- r7[2] = p3[1] * Math.sin(rad) + p3[2] * Math.cos(rad);
18306
+ var p2 = [], r7 = [];
18307
+ p2[0] = a2[0] - b2[0];
18308
+ p2[1] = a2[1] - b2[1];
18309
+ p2[2] = a2[2] - b2[2];
18310
+ r7[0] = p2[0];
18311
+ r7[1] = p2[1] * Math.cos(rad) - p2[2] * Math.sin(rad);
18312
+ r7[2] = p2[1] * Math.sin(rad) + p2[2] * Math.cos(rad);
18313
18313
  out[0] = r7[0] + b2[0];
18314
18314
  out[1] = r7[1] + b2[1];
18315
18315
  out[2] = r7[2] + b2[2];
18316
18316
  return out;
18317
18317
  }
18318
18318
  function rotateY(out, a2, b2, rad) {
18319
- var p3 = [], r7 = [];
18320
- p3[0] = a2[0] - b2[0];
18321
- p3[1] = a2[1] - b2[1];
18322
- p3[2] = a2[2] - b2[2];
18323
- r7[0] = p3[2] * Math.sin(rad) + p3[0] * Math.cos(rad);
18324
- r7[1] = p3[1];
18325
- r7[2] = p3[2] * Math.cos(rad) - p3[0] * Math.sin(rad);
18319
+ var p2 = [], r7 = [];
18320
+ p2[0] = a2[0] - b2[0];
18321
+ p2[1] = a2[1] - b2[1];
18322
+ p2[2] = a2[2] - b2[2];
18323
+ r7[0] = p2[2] * Math.sin(rad) + p2[0] * Math.cos(rad);
18324
+ r7[1] = p2[1];
18325
+ r7[2] = p2[2] * Math.cos(rad) - p2[0] * Math.sin(rad);
18326
18326
  out[0] = r7[0] + b2[0];
18327
18327
  out[1] = r7[1] + b2[1];
18328
18328
  out[2] = r7[2] + b2[2];
18329
18329
  return out;
18330
18330
  }
18331
18331
  function rotateZ(out, a2, b2, rad) {
18332
- var p3 = [], r7 = [];
18333
- p3[0] = a2[0] - b2[0];
18334
- p3[1] = a2[1] - b2[1];
18335
- p3[2] = a2[2] - b2[2];
18336
- r7[0] = p3[0] * Math.cos(rad) - p3[1] * Math.sin(rad);
18337
- r7[1] = p3[0] * Math.sin(rad) + p3[1] * Math.cos(rad);
18338
- r7[2] = p3[2];
18332
+ var p2 = [], r7 = [];
18333
+ p2[0] = a2[0] - b2[0];
18334
+ p2[1] = a2[1] - b2[1];
18335
+ p2[2] = a2[2] - b2[2];
18336
+ r7[0] = p2[0] * Math.cos(rad) - p2[1] * Math.sin(rad);
18337
+ r7[1] = p2[0] * Math.sin(rad) + p2[1] * Math.cos(rad);
18338
+ r7[2] = p2[2];
18339
18339
  out[0] = r7[0] + b2[0];
18340
18340
  out[1] = r7[1] + b2[1];
18341
18341
  out[2] = r7[2] + b2[2];
@@ -18372,7 +18372,7 @@ var require_dcmjs = __commonJS({
18372
18372
  var forEach = function() {
18373
18373
  var vec = create();
18374
18374
  return function(a2, stride, offset, count, fn2, arg) {
18375
- var i, l2;
18375
+ var i, l3;
18376
18376
  if (!stride) {
18377
18377
  stride = 3;
18378
18378
  }
@@ -18380,11 +18380,11 @@ var require_dcmjs = __commonJS({
18380
18380
  offset = 0;
18381
18381
  }
18382
18382
  if (count) {
18383
- l2 = Math.min(count * stride + offset, a2.length);
18383
+ l3 = Math.min(count * stride + offset, a2.length);
18384
18384
  } else {
18385
- l2 = a2.length;
18385
+ l3 = a2.length;
18386
18386
  }
18387
- for (i = offset; i < l2; i += stride) {
18387
+ for (i = offset; i < l3; i += stride) {
18388
18388
  vec[0] = a2[i];
18389
18389
  vec[1] = a2[i + 1];
18390
18390
  vec[2] = a2[i + 2];
@@ -18505,24 +18505,24 @@ var require_dcmjs = __commonJS({
18505
18505
  return headerUint32;
18506
18506
  }
18507
18507
  function getLiteralRunLength(uint8Row, i) {
18508
- for (var l2 = 0; l2 < uint8Row.length - i; l2++) {
18509
- if (uint8Row[i + l2] === uint8Row[i + l2 + 1] && uint8Row[i + l2 + 1] === uint8Row[i + l2 + 2]) {
18510
- return l2;
18508
+ for (var l3 = 0; l3 < uint8Row.length - i; l3++) {
18509
+ if (uint8Row[i + l3] === uint8Row[i + l3 + 1] && uint8Row[i + l3 + 1] === uint8Row[i + l3 + 2]) {
18510
+ return l3;
18511
18511
  }
18512
- if (l2 === 128) {
18513
- return l2;
18512
+ if (l3 === 128) {
18513
+ return l3;
18514
18514
  }
18515
18515
  }
18516
18516
  return uint8Row.length - i;
18517
18517
  }
18518
18518
  function getReplicateRunLength(uint8Row, i) {
18519
18519
  var first = uint8Row[i];
18520
- for (var l2 = 1; l2 < uint8Row.length - i; l2++) {
18521
- if (uint8Row[i + l2] !== first) {
18522
- return l2;
18520
+ for (var l3 = 1; l3 < uint8Row.length - i; l3++) {
18521
+ if (uint8Row[i + l3] !== first) {
18522
+ return l3;
18523
18523
  }
18524
- if (l2 === 128) {
18525
- return l2;
18524
+ if (l3 === 128) {
18525
+ return l3;
18526
18526
  }
18527
18527
  }
18528
18528
  return uint8Row.length - i;
@@ -18559,8 +18559,8 @@ var require_dcmjs = __commonJS({
18559
18559
  if (byteValue <= 127) {
18560
18560
  var N2 = byteValue + 1;
18561
18561
  var next = i + 1;
18562
- for (var p3 = next; p3 < next + N2; p3++) {
18563
- pixelData[pixelDataIndex] = uInt8Frame[p3];
18562
+ for (var p2 = next; p2 < next + N2; p2++) {
18563
+ pixelData[pixelDataIndex] = uInt8Frame[p2];
18564
18564
  pixelDataIndex++;
18565
18565
  }
18566
18566
  i += N2 + 1;
@@ -27893,18 +27893,18 @@ var require_zalgo = __commonJS({
27893
27893
  function heComes(text2, options2) {
27894
27894
  var result = "";
27895
27895
  var counts;
27896
- var l2;
27896
+ var l3;
27897
27897
  options2 = options2 || {};
27898
27898
  options2["up"] = typeof options2["up"] !== "undefined" ? options2["up"] : true;
27899
27899
  options2["mid"] = typeof options2["mid"] !== "undefined" ? options2["mid"] : true;
27900
27900
  options2["down"] = typeof options2["down"] !== "undefined" ? options2["down"] : true;
27901
27901
  options2["size"] = typeof options2["size"] !== "undefined" ? options2["size"] : "maxi";
27902
27902
  text2 = text2.split("");
27903
- for (l2 in text2) {
27904
- if (isChar(l2)) {
27903
+ for (l3 in text2) {
27904
+ if (isChar(l3)) {
27905
27905
  continue;
27906
27906
  }
27907
- result = result + text2[l2];
27907
+ result = result + text2[l3];
27908
27908
  counts = { "up": 0, "down": 0, "mid": 0 };
27909
27909
  switch (options2.size) {
27910
27910
  case "mini":
@@ -30117,7 +30117,7 @@ var require_package = __commonJS({
30117
30117
  module2.exports = {
30118
30118
  name: "winston",
30119
30119
  description: "A logger for just about everything.",
30120
- version: "3.15.0",
30120
+ version: "3.16.0",
30121
30121
  author: "Charlie Robbins <charlie.robbins@gmail.com>",
30122
30122
  maintainers: [
30123
30123
  "David Hyde <dabh@alumni.stanford.edu>"
@@ -32641,20 +32641,20 @@ var require_buffer_list = __commonJS({
32641
32641
  }
32642
32642
  join(s) {
32643
32643
  if (this.length === 0) return "";
32644
- let p3 = this.head;
32645
- let ret = "" + p3.data;
32646
- while ((p3 = p3.next) !== null) ret += s + p3.data;
32644
+ let p2 = this.head;
32645
+ let ret = "" + p2.data;
32646
+ while ((p2 = p2.next) !== null) ret += s + p2.data;
32647
32647
  return ret;
32648
32648
  }
32649
32649
  concat(n) {
32650
32650
  if (this.length === 0) return Buffer2.alloc(0);
32651
32651
  const ret = Buffer2.allocUnsafe(n >>> 0);
32652
- let p3 = this.head;
32652
+ let p2 = this.head;
32653
32653
  let i = 0;
32654
- while (p3) {
32655
- TypedArrayPrototypeSet(ret, p3.data, i);
32656
- i += p3.data.length;
32657
- p3 = p3.next;
32654
+ while (p2) {
32655
+ TypedArrayPrototypeSet(ret, p2.data, i);
32656
+ i += p2.data.length;
32657
+ p2 = p2.next;
32658
32658
  }
32659
32659
  return ret;
32660
32660
  }
@@ -32675,17 +32675,17 @@ var require_buffer_list = __commonJS({
32675
32675
  return this.head.data;
32676
32676
  }
32677
32677
  *[SymbolIterator]() {
32678
- for (let p3 = this.head; p3; p3 = p3.next) {
32679
- yield p3.data;
32678
+ for (let p2 = this.head; p2; p2 = p2.next) {
32679
+ yield p2.data;
32680
32680
  }
32681
32681
  }
32682
32682
  // Consumes a specified amount of characters from the buffered data.
32683
32683
  _getString(n) {
32684
32684
  let ret = "";
32685
- let p3 = this.head;
32685
+ let p2 = this.head;
32686
32686
  let c = 0;
32687
32687
  do {
32688
- const str = p3.data;
32688
+ const str = p2.data;
32689
32689
  if (n > str.length) {
32690
32690
  ret += str;
32691
32691
  n -= str.length;
@@ -32693,17 +32693,17 @@ var require_buffer_list = __commonJS({
32693
32693
  if (n === str.length) {
32694
32694
  ret += str;
32695
32695
  ++c;
32696
- if (p3.next) this.head = p3.next;
32696
+ if (p2.next) this.head = p2.next;
32697
32697
  else this.head = this.tail = null;
32698
32698
  } else {
32699
32699
  ret += StringPrototypeSlice(str, 0, n);
32700
- this.head = p3;
32701
- p3.data = StringPrototypeSlice(str, n);
32700
+ this.head = p2;
32701
+ p2.data = StringPrototypeSlice(str, n);
32702
32702
  }
32703
32703
  break;
32704
32704
  }
32705
32705
  ++c;
32706
- } while ((p3 = p3.next) !== null);
32706
+ } while ((p2 = p2.next) !== null);
32707
32707
  this.length -= c;
32708
32708
  return ret;
32709
32709
  }
@@ -32711,10 +32711,10 @@ var require_buffer_list = __commonJS({
32711
32711
  _getBuffer(n) {
32712
32712
  const ret = Buffer2.allocUnsafe(n);
32713
32713
  const retLen = n;
32714
- let p3 = this.head;
32714
+ let p2 = this.head;
32715
32715
  let c = 0;
32716
32716
  do {
32717
- const buf = p3.data;
32717
+ const buf = p2.data;
32718
32718
  if (n > buf.length) {
32719
32719
  TypedArrayPrototypeSet(ret, buf, retLen - n);
32720
32720
  n -= buf.length;
@@ -32722,17 +32722,17 @@ var require_buffer_list = __commonJS({
32722
32722
  if (n === buf.length) {
32723
32723
  TypedArrayPrototypeSet(ret, buf, retLen - n);
32724
32724
  ++c;
32725
- if (p3.next) this.head = p3.next;
32725
+ if (p2.next) this.head = p2.next;
32726
32726
  else this.head = this.tail = null;
32727
32727
  } else {
32728
32728
  TypedArrayPrototypeSet(ret, new Uint8Array2(buf.buffer, buf.byteOffset, n), retLen - n);
32729
- this.head = p3;
32730
- p3.data = buf.slice(n);
32729
+ this.head = p2;
32730
+ p2.data = buf.slice(n);
32731
32731
  }
32732
32732
  break;
32733
32733
  }
32734
32734
  ++c;
32735
- } while ((p3 = p3.next) !== null);
32735
+ } while ((p2 = p2.next) !== null);
32736
32736
  this.length -= c;
32737
32737
  return ret;
32738
32738
  }
@@ -37088,17 +37088,17 @@ var require_series = __commonJS({
37088
37088
  }
37089
37089
  });
37090
37090
 
37091
- // ../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/stream.js
37091
+ // ../../node_modules/readable-stream/lib/internal/streams/stream.js
37092
37092
  var require_stream3 = __commonJS({
37093
- "../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/stream.js"(exports2, module2) {
37093
+ "../../node_modules/readable-stream/lib/internal/streams/stream.js"(exports2, module2) {
37094
37094
  "use strict";
37095
37095
  module2.exports = require("stream");
37096
37096
  }
37097
37097
  });
37098
37098
 
37099
- // ../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/buffer_list.js
37099
+ // ../../node_modules/readable-stream/lib/internal/streams/buffer_list.js
37100
37100
  var require_buffer_list2 = __commonJS({
37101
- "../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports2, module2) {
37101
+ "../../node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports2, module2) {
37102
37102
  "use strict";
37103
37103
  function ownKeys(object, enumerableOnly) {
37104
37104
  var keys = Object.keys(object);
@@ -37222,9 +37222,9 @@ var require_buffer_list2 = __commonJS({
37222
37222
  key: "join",
37223
37223
  value: function join2(s) {
37224
37224
  if (this.length === 0) return "";
37225
- var p3 = this.head;
37226
- var ret = "" + p3.data;
37227
- while (p3 = p3.next) ret += s + p3.data;
37225
+ var p2 = this.head;
37226
+ var ret = "" + p2.data;
37227
+ while (p2 = p2.next) ret += s + p2.data;
37228
37228
  return ret;
37229
37229
  }
37230
37230
  }, {
@@ -37232,12 +37232,12 @@ var require_buffer_list2 = __commonJS({
37232
37232
  value: function concat(n) {
37233
37233
  if (this.length === 0) return Buffer2.alloc(0);
37234
37234
  var ret = Buffer2.allocUnsafe(n >>> 0);
37235
- var p3 = this.head;
37235
+ var p2 = this.head;
37236
37236
  var i = 0;
37237
- while (p3) {
37238
- copyBuffer(p3.data, ret, i);
37239
- i += p3.data.length;
37240
- p3 = p3.next;
37237
+ while (p2) {
37238
+ copyBuffer(p2.data, ret, i);
37239
+ i += p2.data.length;
37240
+ p2 = p2.next;
37241
37241
  }
37242
37242
  return ret;
37243
37243
  }
@@ -37265,12 +37265,12 @@ var require_buffer_list2 = __commonJS({
37265
37265
  }, {
37266
37266
  key: "_getString",
37267
37267
  value: function _getString(n) {
37268
- var p3 = this.head;
37268
+ var p2 = this.head;
37269
37269
  var c = 1;
37270
- var ret = p3.data;
37270
+ var ret = p2.data;
37271
37271
  n -= ret.length;
37272
- while (p3 = p3.next) {
37273
- var str = p3.data;
37272
+ while (p2 = p2.next) {
37273
+ var str = p2.data;
37274
37274
  var nb = n > str.length ? str.length : n;
37275
37275
  if (nb === str.length) ret += str;
37276
37276
  else ret += str.slice(0, n);
@@ -37278,11 +37278,11 @@ var require_buffer_list2 = __commonJS({
37278
37278
  if (n === 0) {
37279
37279
  if (nb === str.length) {
37280
37280
  ++c;
37281
- if (p3.next) this.head = p3.next;
37281
+ if (p2.next) this.head = p2.next;
37282
37282
  else this.head = this.tail = null;
37283
37283
  } else {
37284
- this.head = p3;
37285
- p3.data = str.slice(nb);
37284
+ this.head = p2;
37285
+ p2.data = str.slice(nb);
37286
37286
  }
37287
37287
  break;
37288
37288
  }
@@ -37296,23 +37296,23 @@ var require_buffer_list2 = __commonJS({
37296
37296
  key: "_getBuffer",
37297
37297
  value: function _getBuffer(n) {
37298
37298
  var ret = Buffer2.allocUnsafe(n);
37299
- var p3 = this.head;
37299
+ var p2 = this.head;
37300
37300
  var c = 1;
37301
- p3.data.copy(ret);
37302
- n -= p3.data.length;
37303
- while (p3 = p3.next) {
37304
- var buf = p3.data;
37301
+ p2.data.copy(ret);
37302
+ n -= p2.data.length;
37303
+ while (p2 = p2.next) {
37304
+ var buf = p2.data;
37305
37305
  var nb = n > buf.length ? buf.length : n;
37306
37306
  buf.copy(ret, ret.length - n, 0, nb);
37307
37307
  n -= nb;
37308
37308
  if (n === 0) {
37309
37309
  if (nb === buf.length) {
37310
37310
  ++c;
37311
- if (p3.next) this.head = p3.next;
37311
+ if (p2.next) this.head = p2.next;
37312
37312
  else this.head = this.tail = null;
37313
37313
  } else {
37314
- this.head = p3;
37315
- p3.data = buf.slice(nb);
37314
+ this.head = p2;
37315
+ p2.data = buf.slice(nb);
37316
37316
  }
37317
37317
  break;
37318
37318
  }
@@ -37338,9 +37338,9 @@ var require_buffer_list2 = __commonJS({
37338
37338
  }
37339
37339
  });
37340
37340
 
37341
- // ../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/destroy.js
37341
+ // ../../node_modules/readable-stream/lib/internal/streams/destroy.js
37342
37342
  var require_destroy2 = __commonJS({
37343
- "../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/destroy.js"(exports2, module2) {
37343
+ "../../node_modules/readable-stream/lib/internal/streams/destroy.js"(exports2, module2) {
37344
37344
  "use strict";
37345
37345
  function destroy(err, cb) {
37346
37346
  var _this = this;
@@ -37427,9 +37427,9 @@ var require_destroy2 = __commonJS({
37427
37427
  }
37428
37428
  });
37429
37429
 
37430
- // ../../node_modules/winston/node_modules/readable-stream/errors.js
37430
+ // ../../node_modules/readable-stream/errors.js
37431
37431
  var require_errors3 = __commonJS({
37432
- "../../node_modules/winston/node_modules/readable-stream/errors.js"(exports2, module2) {
37432
+ "../../node_modules/readable-stream/errors.js"(exports2, module2) {
37433
37433
  "use strict";
37434
37434
  var codes = {};
37435
37435
  function createErrorType(code, message, Base) {
@@ -37527,9 +37527,9 @@ var require_errors3 = __commonJS({
37527
37527
  }
37528
37528
  });
37529
37529
 
37530
- // ../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/state.js
37530
+ // ../../node_modules/readable-stream/lib/internal/streams/state.js
37531
37531
  var require_state2 = __commonJS({
37532
- "../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/state.js"(exports2, module2) {
37532
+ "../../node_modules/readable-stream/lib/internal/streams/state.js"(exports2, module2) {
37533
37533
  "use strict";
37534
37534
  var ERR_INVALID_OPT_VALUE = require_errors3().codes.ERR_INVALID_OPT_VALUE;
37535
37535
  function highWaterMarkFrom(options, isDuplex, duplexKey) {
@@ -37608,9 +37608,9 @@ var require_node = __commonJS({
37608
37608
  }
37609
37609
  });
37610
37610
 
37611
- // ../../node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js
37611
+ // ../../node_modules/readable-stream/lib/_stream_writable.js
37612
37612
  var require_stream_writable2 = __commonJS({
37613
- "../../node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js"(exports2, module2) {
37613
+ "../../node_modules/readable-stream/lib/_stream_writable.js"(exports2, module2) {
37614
37614
  "use strict";
37615
37615
  module2.exports = Writable;
37616
37616
  function CorkedRequest(state) {
@@ -37917,8 +37917,8 @@ var require_stream_writable2 = __commonJS({
37917
37917
  state.bufferProcessing = true;
37918
37918
  var entry = state.bufferedRequest;
37919
37919
  if (stream._writev && entry && entry.next) {
37920
- var l2 = state.bufferedRequestCount;
37921
- var buffer = new Array(l2);
37920
+ var l3 = state.bufferedRequestCount;
37921
+ var buffer = new Array(l3);
37922
37922
  var holder = state.corkedRequestsFree;
37923
37923
  holder.entry = entry;
37924
37924
  var count = 0;
@@ -38079,9 +38079,9 @@ var require_stream_writable2 = __commonJS({
38079
38079
  }
38080
38080
  });
38081
38081
 
38082
- // ../../node_modules/winston/node_modules/readable-stream/lib/_stream_duplex.js
38082
+ // ../../node_modules/readable-stream/lib/_stream_duplex.js
38083
38083
  var require_stream_duplex = __commonJS({
38084
- "../../node_modules/winston/node_modules/readable-stream/lib/_stream_duplex.js"(exports2, module2) {
38084
+ "../../node_modules/readable-stream/lib/_stream_duplex.js"(exports2, module2) {
38085
38085
  "use strict";
38086
38086
  var objectKeys = Object.keys || function(obj) {
38087
38087
  var keys2 = [];
@@ -38192,6 +38192,7 @@ var require_safe_buffer = __commonJS({
38192
38192
  function SafeBuffer(arg, encodingOrOffset, length) {
38193
38193
  return Buffer2(arg, encodingOrOffset, length);
38194
38194
  }
38195
+ SafeBuffer.prototype = Object.create(Buffer2.prototype);
38195
38196
  copyProps(Buffer2, SafeBuffer);
38196
38197
  SafeBuffer.from = function(arg, encodingOrOffset, length) {
38197
38198
  if (typeof arg === "number") {
@@ -38371,7 +38372,7 @@ var require_string_decoder = __commonJS({
38371
38372
  }
38372
38373
  return 0;
38373
38374
  }
38374
- function utf8CheckExtraBytes(self2, buf, p3) {
38375
+ function utf8CheckExtraBytes(self2, buf, p2) {
38375
38376
  if ((buf[0] & 192) !== 128) {
38376
38377
  self2.lastNeed = 0;
38377
38378
  return "\uFFFD";
@@ -38390,14 +38391,14 @@ var require_string_decoder = __commonJS({
38390
38391
  }
38391
38392
  }
38392
38393
  function utf8FillLast(buf) {
38393
- var p3 = this.lastTotal - this.lastNeed;
38394
- var r7 = utf8CheckExtraBytes(this, buf, p3);
38394
+ var p2 = this.lastTotal - this.lastNeed;
38395
+ var r7 = utf8CheckExtraBytes(this, buf, p2);
38395
38396
  if (r7 !== void 0) return r7;
38396
38397
  if (this.lastNeed <= buf.length) {
38397
- buf.copy(this.lastChar, p3, 0, this.lastNeed);
38398
+ buf.copy(this.lastChar, p2, 0, this.lastNeed);
38398
38399
  return this.lastChar.toString(this.encoding, 0, this.lastTotal);
38399
38400
  }
38400
- buf.copy(this.lastChar, p3, 0, buf.length);
38401
+ buf.copy(this.lastChar, p2, 0, buf.length);
38401
38402
  this.lastNeed -= buf.length;
38402
38403
  }
38403
38404
  function utf8Text(buf, i) {
@@ -38468,9 +38469,9 @@ var require_string_decoder = __commonJS({
38468
38469
  }
38469
38470
  });
38470
38471
 
38471
- // ../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/end-of-stream.js
38472
+ // ../../node_modules/readable-stream/lib/internal/streams/end-of-stream.js
38472
38473
  var require_end_of_stream2 = __commonJS({
38473
- "../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports2, module2) {
38474
+ "../../node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports2, module2) {
38474
38475
  "use strict";
38475
38476
  var ERR_STREAM_PREMATURE_CLOSE = require_errors3().codes.ERR_STREAM_PREMATURE_CLOSE;
38476
38477
  function once(callback) {
@@ -38557,9 +38558,9 @@ var require_end_of_stream2 = __commonJS({
38557
38558
  }
38558
38559
  });
38559
38560
 
38560
- // ../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/async_iterator.js
38561
+ // ../../node_modules/readable-stream/lib/internal/streams/async_iterator.js
38561
38562
  var require_async_iterator = __commonJS({
38562
- "../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/async_iterator.js"(exports2, module2) {
38563
+ "../../node_modules/readable-stream/lib/internal/streams/async_iterator.js"(exports2, module2) {
38563
38564
  "use strict";
38564
38565
  var _Object$setPrototypeO;
38565
38566
  function _defineProperty(obj, key, value) {
@@ -38740,9 +38741,9 @@ var require_async_iterator = __commonJS({
38740
38741
  }
38741
38742
  });
38742
38743
 
38743
- // ../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/from.js
38744
+ // ../../node_modules/readable-stream/lib/internal/streams/from.js
38744
38745
  var require_from2 = __commonJS({
38745
- "../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/from.js"(exports2, module2) {
38746
+ "../../node_modules/readable-stream/lib/internal/streams/from.js"(exports2, module2) {
38746
38747
  "use strict";
38747
38748
  function asyncGeneratorStep(gen, resolve2, reject, _next, _throw, key, arg) {
38748
38749
  try {
@@ -38861,9 +38862,9 @@ var require_from2 = __commonJS({
38861
38862
  }
38862
38863
  });
38863
38864
 
38864
- // ../../node_modules/winston/node_modules/readable-stream/lib/_stream_readable.js
38865
+ // ../../node_modules/readable-stream/lib/_stream_readable.js
38865
38866
  var require_stream_readable = __commonJS({
38866
- "../../node_modules/winston/node_modules/readable-stream/lib/_stream_readable.js"(exports2, module2) {
38867
+ "../../node_modules/readable-stream/lib/_stream_readable.js"(exports2, module2) {
38867
38868
  "use strict";
38868
38869
  module2.exports = Readable2;
38869
38870
  var Duplex;
@@ -39067,11 +39068,11 @@ var require_stream_readable = __commonJS({
39067
39068
  var decoder = new StringDecoder(enc);
39068
39069
  this._readableState.decoder = decoder;
39069
39070
  this._readableState.encoding = this._readableState.decoder.encoding;
39070
- var p3 = this._readableState.buffer.head;
39071
+ var p2 = this._readableState.buffer.head;
39071
39072
  var content = "";
39072
- while (p3 !== null) {
39073
- content += decoder.write(p3.data);
39074
- p3 = p3.next;
39073
+ while (p2 !== null) {
39074
+ content += decoder.write(p2.data);
39075
+ p2 = p2.next;
39075
39076
  }
39076
39077
  this._readableState.buffer.clear();
39077
39078
  if (content !== "") this._readableState.buffer.push(content);
@@ -39586,7 +39587,7 @@ var require_stream_readable = __commonJS({
39586
39587
  };
39587
39588
  }
39588
39589
  function indexOf(xs, x2) {
39589
- for (var i = 0, l2 = xs.length; i < l2; i++) {
39590
+ for (var i = 0, l3 = xs.length; i < l3; i++) {
39590
39591
  if (xs[i] === x2) return i;
39591
39592
  }
39592
39593
  return -1;
@@ -39594,9 +39595,9 @@ var require_stream_readable = __commonJS({
39594
39595
  }
39595
39596
  });
39596
39597
 
39597
- // ../../node_modules/winston/node_modules/readable-stream/lib/_stream_transform.js
39598
+ // ../../node_modules/readable-stream/lib/_stream_transform.js
39598
39599
  var require_stream_transform = __commonJS({
39599
- "../../node_modules/winston/node_modules/readable-stream/lib/_stream_transform.js"(exports2, module2) {
39600
+ "../../node_modules/readable-stream/lib/_stream_transform.js"(exports2, module2) {
39600
39601
  "use strict";
39601
39602
  module2.exports = Transform;
39602
39603
  var _require$codes = require_errors3().codes;
@@ -39695,9 +39696,9 @@ var require_stream_transform = __commonJS({
39695
39696
  }
39696
39697
  });
39697
39698
 
39698
- // ../../node_modules/winston/node_modules/readable-stream/lib/_stream_passthrough.js
39699
+ // ../../node_modules/readable-stream/lib/_stream_passthrough.js
39699
39700
  var require_stream_passthrough = __commonJS({
39700
- "../../node_modules/winston/node_modules/readable-stream/lib/_stream_passthrough.js"(exports2, module2) {
39701
+ "../../node_modules/readable-stream/lib/_stream_passthrough.js"(exports2, module2) {
39701
39702
  "use strict";
39702
39703
  module2.exports = PassThrough;
39703
39704
  var Transform = require_stream_transform();
@@ -39712,9 +39713,9 @@ var require_stream_passthrough = __commonJS({
39712
39713
  }
39713
39714
  });
39714
39715
 
39715
- // ../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/pipeline.js
39716
+ // ../../node_modules/readable-stream/lib/internal/streams/pipeline.js
39716
39717
  var require_pipeline2 = __commonJS({
39717
- "../../node_modules/winston/node_modules/readable-stream/lib/internal/streams/pipeline.js"(exports2, module2) {
39718
+ "../../node_modules/readable-stream/lib/internal/streams/pipeline.js"(exports2, module2) {
39718
39719
  "use strict";
39719
39720
  var eos;
39720
39721
  function once(callback) {
@@ -39762,8 +39763,8 @@ var require_pipeline2 = __commonJS({
39762
39763
  function call(fn2) {
39763
39764
  fn2();
39764
39765
  }
39765
- function pipe(from, to2) {
39766
- return from.pipe(to2);
39766
+ function pipe(from, to) {
39767
+ return from.pipe(to);
39767
39768
  }
39768
39769
  function popCallback(streams) {
39769
39770
  if (!streams.length) return noop;
@@ -39797,9 +39798,9 @@ var require_pipeline2 = __commonJS({
39797
39798
  }
39798
39799
  });
39799
39800
 
39800
- // ../../node_modules/winston/node_modules/readable-stream/readable.js
39801
+ // ../../node_modules/readable-stream/readable.js
39801
39802
  var require_readable2 = __commonJS({
39802
- "../../node_modules/winston/node_modules/readable-stream/readable.js"(exports2, module2) {
39803
+ "../../node_modules/readable-stream/readable.js"(exports2, module2) {
39803
39804
  "use strict";
39804
39805
  var Stream = require("stream");
39805
39806
  if (process.env.READABLE_STREAM === "disable" && Stream) {
@@ -40253,9 +40254,9 @@ var require_color_string = __commonJS({
40253
40254
  var alpha = parseFloat(match[4]);
40254
40255
  var h2 = (parseFloat(match[1]) % 360 + 360) % 360;
40255
40256
  var s = clamp(parseFloat(match[2]), 0, 100);
40256
- var l2 = clamp(parseFloat(match[3]), 0, 100);
40257
+ var l3 = clamp(parseFloat(match[3]), 0, 100);
40257
40258
  var a2 = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
40258
- return [h2, s, l2, a2];
40259
+ return [h2, s, l3, a2];
40259
40260
  }
40260
40261
  return null;
40261
40262
  };
@@ -40532,7 +40533,7 @@ var require_conversions = __commonJS({
40532
40533
  var delta = max - min;
40533
40534
  var h2;
40534
40535
  var s;
40535
- var l2;
40536
+ var l3;
40536
40537
  if (max === min) {
40537
40538
  h2 = 0;
40538
40539
  } else if (r7 === max) {
@@ -40546,15 +40547,15 @@ var require_conversions = __commonJS({
40546
40547
  if (h2 < 0) {
40547
40548
  h2 += 360;
40548
40549
  }
40549
- l2 = (min + max) / 2;
40550
+ l3 = (min + max) / 2;
40550
40551
  if (max === min) {
40551
40552
  s = 0;
40552
- } else if (l2 <= 0.5) {
40553
+ } else if (l3 <= 0.5) {
40553
40554
  s = delta / (max + min);
40554
40555
  } else {
40555
40556
  s = delta / (2 - max - min);
40556
40557
  }
40557
- return [h2, s * 100, l2 * 100];
40558
+ return [h2, s * 100, l3 * 100];
40558
40559
  };
40559
40560
  convert.rgb.hsv = function(rgb) {
40560
40561
  var rdif;
@@ -40661,7 +40662,7 @@ var require_conversions = __commonJS({
40661
40662
  var x2 = xyz[0];
40662
40663
  var y2 = xyz[1];
40663
40664
  var z2 = xyz[2];
40664
- var l2;
40665
+ var l3;
40665
40666
  var a2;
40666
40667
  var b2;
40667
40668
  x2 /= 95.047;
@@ -40670,30 +40671,30 @@ var require_conversions = __commonJS({
40670
40671
  x2 = x2 > 8856e-6 ? Math.pow(x2, 1 / 3) : 7.787 * x2 + 16 / 116;
40671
40672
  y2 = y2 > 8856e-6 ? Math.pow(y2, 1 / 3) : 7.787 * y2 + 16 / 116;
40672
40673
  z2 = z2 > 8856e-6 ? Math.pow(z2, 1 / 3) : 7.787 * z2 + 16 / 116;
40673
- l2 = 116 * y2 - 16;
40674
+ l3 = 116 * y2 - 16;
40674
40675
  a2 = 500 * (x2 - y2);
40675
40676
  b2 = 200 * (y2 - z2);
40676
- return [l2, a2, b2];
40677
+ return [l3, a2, b2];
40677
40678
  };
40678
40679
  convert.hsl.rgb = function(hsl) {
40679
40680
  var h2 = hsl[0] / 360;
40680
40681
  var s = hsl[1] / 100;
40681
- var l2 = hsl[2] / 100;
40682
+ var l3 = hsl[2] / 100;
40682
40683
  var t1;
40683
40684
  var t2;
40684
40685
  var t3;
40685
40686
  var rgb;
40686
40687
  var val;
40687
40688
  if (s === 0) {
40688
- val = l2 * 255;
40689
+ val = l3 * 255;
40689
40690
  return [val, val, val];
40690
40691
  }
40691
- if (l2 < 0.5) {
40692
- t2 = l2 * (1 + s);
40692
+ if (l3 < 0.5) {
40693
+ t2 = l3 * (1 + s);
40693
40694
  } else {
40694
- t2 = l2 + s - l2 * s;
40695
+ t2 = l3 + s - l3 * s;
40695
40696
  }
40696
- t1 = 2 * l2 - t2;
40697
+ t1 = 2 * l3 - t2;
40697
40698
  rgb = [0, 0, 0];
40698
40699
  for (var i = 0; i < 3; i++) {
40699
40700
  t3 = h2 + 1 / 3 * -(i - 1);
@@ -40719,16 +40720,16 @@ var require_conversions = __commonJS({
40719
40720
  convert.hsl.hsv = function(hsl) {
40720
40721
  var h2 = hsl[0];
40721
40722
  var s = hsl[1] / 100;
40722
- var l2 = hsl[2] / 100;
40723
+ var l3 = hsl[2] / 100;
40723
40724
  var smin = s;
40724
- var lmin = Math.max(l2, 0.01);
40725
+ var lmin = Math.max(l3, 0.01);
40725
40726
  var sv;
40726
40727
  var v;
40727
- l2 *= 2;
40728
- s *= l2 <= 1 ? l2 : 2 - l2;
40728
+ l3 *= 2;
40729
+ s *= l3 <= 1 ? l3 : 2 - l3;
40729
40730
  smin *= lmin <= 1 ? lmin : 2 - lmin;
40730
- v = (l2 + s) / 2;
40731
- sv = l2 === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l2 + s);
40731
+ v = (l3 + s) / 2;
40732
+ sv = l3 === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l3 + s);
40732
40733
  return [h2, sv * 100, v * 100];
40733
40734
  };
40734
40735
  convert.hsv.rgb = function(hsv) {
@@ -40737,23 +40738,23 @@ var require_conversions = __commonJS({
40737
40738
  var v = hsv[2] / 100;
40738
40739
  var hi2 = Math.floor(h2) % 6;
40739
40740
  var f2 = h2 - Math.floor(h2);
40740
- var p3 = 255 * v * (1 - s);
40741
+ var p2 = 255 * v * (1 - s);
40741
40742
  var q2 = 255 * v * (1 - s * f2);
40742
40743
  var t = 255 * v * (1 - s * (1 - f2));
40743
40744
  v *= 255;
40744
40745
  switch (hi2) {
40745
40746
  case 0:
40746
- return [v, t, p3];
40747
+ return [v, t, p2];
40747
40748
  case 1:
40748
- return [q2, v, p3];
40749
+ return [q2, v, p2];
40749
40750
  case 2:
40750
- return [p3, v, t];
40751
+ return [p2, v, t];
40751
40752
  case 3:
40752
- return [p3, q2, v];
40753
+ return [p2, q2, v];
40753
40754
  case 4:
40754
- return [t, p3, v];
40755
+ return [t, p2, v];
40755
40756
  case 5:
40756
- return [v, p3, q2];
40757
+ return [v, p2, q2];
40757
40758
  }
40758
40759
  };
40759
40760
  convert.hsv.hsl = function(hsv) {
@@ -40763,14 +40764,14 @@ var require_conversions = __commonJS({
40763
40764
  var vmin = Math.max(v, 0.01);
40764
40765
  var lmin;
40765
40766
  var sl;
40766
- var l2;
40767
- l2 = (2 - s) * v;
40767
+ var l3;
40768
+ l3 = (2 - s) * v;
40768
40769
  lmin = (2 - s) * vmin;
40769
40770
  sl = s * vmin;
40770
40771
  sl /= lmin <= 1 ? lmin : 2 - lmin;
40771
40772
  sl = sl || 0;
40772
- l2 /= 2;
40773
- return [h2, sl * 100, l2 * 100];
40773
+ l3 /= 2;
40774
+ return [h2, sl * 100, l3 * 100];
40774
40775
  };
40775
40776
  convert.hwb.rgb = function(hwb) {
40776
40777
  var h2 = hwb[0] / 360;
@@ -40866,7 +40867,7 @@ var require_conversions = __commonJS({
40866
40867
  var x2 = xyz[0];
40867
40868
  var y2 = xyz[1];
40868
40869
  var z2 = xyz[2];
40869
- var l2;
40870
+ var l3;
40870
40871
  var a2;
40871
40872
  var b2;
40872
40873
  x2 /= 95.047;
@@ -40875,19 +40876,19 @@ var require_conversions = __commonJS({
40875
40876
  x2 = x2 > 8856e-6 ? Math.pow(x2, 1 / 3) : 7.787 * x2 + 16 / 116;
40876
40877
  y2 = y2 > 8856e-6 ? Math.pow(y2, 1 / 3) : 7.787 * y2 + 16 / 116;
40877
40878
  z2 = z2 > 8856e-6 ? Math.pow(z2, 1 / 3) : 7.787 * z2 + 16 / 116;
40878
- l2 = 116 * y2 - 16;
40879
+ l3 = 116 * y2 - 16;
40879
40880
  a2 = 500 * (x2 - y2);
40880
40881
  b2 = 200 * (y2 - z2);
40881
- return [l2, a2, b2];
40882
+ return [l3, a2, b2];
40882
40883
  };
40883
40884
  convert.lab.xyz = function(lab) {
40884
- var l2 = lab[0];
40885
+ var l3 = lab[0];
40885
40886
  var a2 = lab[1];
40886
40887
  var b2 = lab[2];
40887
40888
  var x2;
40888
40889
  var y2;
40889
40890
  var z2;
40890
- y2 = (l2 + 16) / 116;
40891
+ y2 = (l3 + 16) / 116;
40891
40892
  x2 = a2 / 500 + y2;
40892
40893
  z2 = y2 - b2 / 200;
40893
40894
  var y22 = Math.pow(y2, 3);
@@ -40902,7 +40903,7 @@ var require_conversions = __commonJS({
40902
40903
  return [x2, y2, z2];
40903
40904
  };
40904
40905
  convert.lab.lch = function(lab) {
40905
- var l2 = lab[0];
40906
+ var l3 = lab[0];
40906
40907
  var a2 = lab[1];
40907
40908
  var b2 = lab[2];
40908
40909
  var hr;
@@ -40914,10 +40915,10 @@ var require_conversions = __commonJS({
40914
40915
  h2 += 360;
40915
40916
  }
40916
40917
  c = Math.sqrt(a2 * a2 + b2 * b2);
40917
- return [l2, c, h2];
40918
+ return [l3, c, h2];
40918
40919
  };
40919
40920
  convert.lch.lab = function(lch) {
40920
- var l2 = lch[0];
40921
+ var l3 = lch[0];
40921
40922
  var c = lch[1];
40922
40923
  var h2 = lch[2];
40923
40924
  var a2;
@@ -40926,7 +40927,7 @@ var require_conversions = __commonJS({
40926
40927
  hr = h2 / 360 * 2 * Math.PI;
40927
40928
  a2 = c * Math.cos(hr);
40928
40929
  b2 = c * Math.sin(hr);
40929
- return [l2, a2, b2];
40930
+ return [l3, a2, b2];
40930
40931
  };
40931
40932
  convert.rgb.ansi16 = function(args) {
40932
40933
  var r7 = args[0];
@@ -41040,16 +41041,16 @@ var require_conversions = __commonJS({
41040
41041
  };
41041
41042
  convert.hsl.hcg = function(hsl) {
41042
41043
  var s = hsl[1] / 100;
41043
- var l2 = hsl[2] / 100;
41044
+ var l3 = hsl[2] / 100;
41044
41045
  var c = 1;
41045
41046
  var f2 = 0;
41046
- if (l2 < 0.5) {
41047
- c = 2 * s * l2;
41047
+ if (l3 < 0.5) {
41048
+ c = 2 * s * l3;
41048
41049
  } else {
41049
- c = 2 * s * (1 - l2);
41050
+ c = 2 * s * (1 - l3);
41050
41051
  }
41051
41052
  if (c < 1) {
41052
- f2 = (l2 - 0.5 * c) / (1 - c);
41053
+ f2 = (l3 - 0.5 * c) / (1 - c);
41053
41054
  }
41054
41055
  return [hsl[0], c * 100, f2 * 100];
41055
41056
  };
@@ -41126,14 +41127,14 @@ var require_conversions = __commonJS({
41126
41127
  convert.hcg.hsl = function(hcg) {
41127
41128
  var c = hcg[1] / 100;
41128
41129
  var g2 = hcg[2] / 100;
41129
- var l2 = g2 * (1 - c) + 0.5 * c;
41130
+ var l3 = g2 * (1 - c) + 0.5 * c;
41130
41131
  var s = 0;
41131
- if (l2 > 0 && l2 < 0.5) {
41132
- s = c / (2 * l2);
41133
- } else if (l2 >= 0.5 && l2 < 1) {
41134
- s = c / (2 * (1 - l2));
41132
+ if (l3 > 0 && l3 < 0.5) {
41133
+ s = c / (2 * l3);
41134
+ } else if (l3 >= 0.5 && l3 < 1) {
41135
+ s = c / (2 * (1 - l3));
41135
41136
  }
41136
- return [hcg[0], s * 100, l2 * 100];
41137
+ return [hcg[0], s * 100, l3 * 100];
41137
41138
  };
41138
41139
  convert.hcg.hwb = function(hcg) {
41139
41140
  var c = hcg[1] / 100;
@@ -41223,9 +41224,9 @@ var require_route = __commonJS({
41223
41224
  }
41224
41225
  return graph;
41225
41226
  }
41226
- function link(from, to2) {
41227
+ function link(from, to) {
41227
41228
  return function(args) {
41228
- return to2(from(args));
41229
+ return to(from(args));
41229
41230
  };
41230
41231
  }
41231
41232
  function wrapConversion(toModel, graph) {
@@ -41613,8 +41614,8 @@ var require_color = __commonJS({
41613
41614
  }
41614
41615
  var color1 = mixinColor.rgb();
41615
41616
  var color2 = this.rgb();
41616
- var p3 = weight === void 0 ? 0.5 : weight;
41617
- var w3 = 2 * p3 - 1;
41617
+ var p2 = weight === void 0 ? 0.5 : weight;
41618
+ var w3 = 2 * p2 - 1;
41618
41619
  var a2 = color1.alpha() - color2.alpha();
41619
41620
  var w1 = ((w3 * a2 === -1 ? w3 : (w3 + a2) / (1 + w3 * a2)) + 1) / 2;
41620
41621
  var w22 = 1 - w1;
@@ -41622,7 +41623,7 @@ var require_color = __commonJS({
41622
41623
  w1 * color1.red() + w22 * color2.red(),
41623
41624
  w1 * color1.green() + w22 * color2.green(),
41624
41625
  w1 * color1.blue() + w22 * color2.blue(),
41625
- color1.alpha() * p3 + color2.alpha() * (1 - p3)
41626
+ color1.alpha() * p2 + color2.alpha() * (1 - p2)
41626
41627
  );
41627
41628
  }
41628
41629
  };
@@ -41725,7 +41726,7 @@ var require_colorspace = __commonJS({
41725
41726
  var split = namespace.split(delimiter || ":");
41726
41727
  var base = hex(split[0]);
41727
41728
  if (!split.length) return base;
41728
- for (var i = 0, l2 = split.length - 1; i < l2; i++) {
41729
+ for (var i = 0, l3 = split.length - 1; i < l3; i++) {
41729
41730
  base = color(base).mix(color(hex(split[i + 1]))).saturate(1).hex();
41730
41731
  }
41731
41732
  return base;
@@ -41961,9 +41962,9 @@ var require_tail_file = __commonJS({
41961
41962
  stream.emit("data", data2);
41962
41963
  }
41963
41964
  data2 = (buff + data2).split(/\n+/);
41964
- const l2 = data2.length - 1;
41965
+ const l3 = data2.length - 1;
41965
41966
  let i = 0;
41966
- for (; i < l2; i++) {
41967
+ for (; i < l3; i++) {
41967
41968
  if (options.start == null || row > options.start) {
41968
41969
  if (!iter) {
41969
41970
  stream.emit("line", data2[i]);
@@ -41973,7 +41974,7 @@ var require_tail_file = __commonJS({
41973
41974
  }
41974
41975
  row++;
41975
41976
  }
41976
- buff = data2[l2];
41977
+ buff = data2[l3];
41977
41978
  pos += bytes;
41978
41979
  return read();
41979
41980
  });
@@ -42188,15 +42189,15 @@ var require_file = __commonJS({
42188
42189
  });
42189
42190
  stream.on("data", (data2) => {
42190
42191
  data2 = (buff + data2).split(/\n+/);
42191
- const l2 = data2.length - 1;
42192
+ const l3 = data2.length - 1;
42192
42193
  let i = 0;
42193
- for (; i < l2; i++) {
42194
+ for (; i < l3; i++) {
42194
42195
  if (!options.start || row >= options.start) {
42195
42196
  add(data2[i]);
42196
42197
  }
42197
42198
  row++;
42198
42199
  }
42199
- buff = data2[l2];
42200
+ buff = data2[l3];
42200
42201
  });
42201
42202
  stream.on("close", () => {
42202
42203
  if (buff) {
@@ -42697,16 +42698,16 @@ var require_http = __commonJS({
42697
42698
  stream.destroy = () => req.destroy();
42698
42699
  req.on("data", (data2) => {
42699
42700
  data2 = (buff + data2).split(/\n+/);
42700
- const l2 = data2.length - 1;
42701
+ const l3 = data2.length - 1;
42701
42702
  let i = 0;
42702
- for (; i < l2; i++) {
42703
+ for (; i < l3; i++) {
42703
42704
  try {
42704
42705
  stream.emit("log", JSON.parse(data2[i]));
42705
42706
  } catch (e) {
42706
42707
  stream.emit("error", e);
42707
42708
  }
42708
42709
  }
42709
- buff = data2[l2];
42710
+ buff = data2[l3];
42710
42711
  });
42711
42712
  req.on("error", (err) => stream.emit("error", err));
42712
42713
  return stream;
@@ -43887,6 +43888,7 @@ var require_logger = __commonJS({
43887
43888
  });
43888
43889
  if (meta.message) info.message = `${info.message} ${meta.message}`;
43889
43890
  if (meta.stack) info.stack = meta.stack;
43891
+ if (meta.cause) info.cause = meta.cause;
43890
43892
  this.write(info);
43891
43893
  return this;
43892
43894
  }
@@ -44465,7 +44467,7 @@ var require_dcmjs_dimse_min = __commonJS({
44465
44467
  }(global, (e, t, s, n, i) => {
44466
44468
  return r7 = { 570: (e2, t2, s2) => {
44467
44469
  const { CGetRequest: n2, CStoreRequest: i2 } = s2(940), { CommandFieldType: r8, PresentationContextResult: o2, SopClass: a2, StorageClass: c, TransferSyntax: d3, Uid: u2, UserIdentityType: h2 } = s2(492), m2 = s2(139), { EOL: g2 } = s2(857);
44468
- class l2 {
44470
+ class l3 {
44469
44471
  constructor(e3, t3, s3, n3) {
44470
44472
  this.pcId = e3, this.abstractSyntaxUid = t3, this.transferSyntaxes = [], s3 && this.transferSyntaxes.push(s3), this.result = n3 || o2.Proposed;
44471
44473
  }
@@ -44627,7 +44629,7 @@ var require_dcmjs_dimse_min = __commonJS({
44627
44629
  return this.presentationContexts.forEach((e4) => {
44628
44630
  const t4 = e4.id;
44629
44631
  t4 >= s3 && (s3 = t4 + 2);
44630
- }), this.presentationContexts.push({ id: s3, context: new l2(s3, e3) }), s3;
44632
+ }), this.presentationContexts.push({ id: s3, context: new l3(s3, e3) }), s3;
44631
44633
  }
44632
44634
  addOrGetPresentationContext(e3) {
44633
44635
  const t3 = this.getPresentationContexts();
@@ -44741,7 +44743,7 @@ var require_dcmjs_dimse_min = __commonJS({
44741
44743
  return `${e3}`;
44742
44744
  }
44743
44745
  }
44744
- }, PresentationContext: l2 };
44746
+ }, PresentationContext: l3 };
44745
44747
  }, 422: (e2, t2, s2) => {
44746
44748
  const { Association: n2, PresentationContext: i2 } = s2(570), { TransferSyntax: r8, UserIdentityType: o2 } = s2(492), { Request: a2 } = s2(940), c = s2(371), d3 = s2(906), u2 = s2(547), h2 = s2(733), m2 = s2(278), g2 = s2(756);
44747
44749
  e2.exports = class extends h2 {
@@ -44772,26 +44774,26 @@ var require_dcmjs_dimse_min = __commonJS({
44772
44774
  });
44773
44775
  let h3 = {};
44774
44776
  a3.securityOptions && (h3 = { key: a3.securityOptions.key, cert: a3.securityOptions.cert, ca: a3.securityOptions.ca, requestCert: a3.securityOptions.requestCert, rejectUnauthorized: a3.securityOptions.rejectUnauthorized, minVersion: a3.securityOptions.minVersion, maxVersion: a3.securityOptions.maxVersion, ciphers: a3.securityOptions.ciphers }), u2.info(`Connecting to ${e3}:${t3} ${a3.securityOptions ? "(TLS)" : ""}`);
44775
- const l2 = (a3.securityOptions ? g2 : m2).connect({ host: e3, port: t3, ...h3 }), p3 = new c(l2, a3);
44776
- p3.on("connect", () => {
44777
- this.emit("connected"), p3.sendAssociationRequest(d4);
44778
- }), p3.on("associationAccepted", (e4) => {
44779
- this.emit("associationAccepted", e4), p3.sendRequests(this.requests);
44780
- }), p3.on("associationReleaseResponse", () => {
44781
- this.emit("associationReleased"), l2.end();
44782
- }), p3.on("associationRejected", (e4) => {
44783
- this.emit("associationRejected", e4), l2.end();
44784
- }), p3.on("done", () => {
44785
- setTimeout(() => p3.sendAssociationReleaseRequest(), this.associationLingerTimeout);
44786
- }), p3.on("cStoreRequest", (e4, t4) => {
44777
+ const l3 = (a3.securityOptions ? g2 : m2).connect({ host: e3, port: t3, ...h3 }), p2 = new c(l3, a3);
44778
+ p2.on("connect", () => {
44779
+ this.emit("connected"), p2.sendAssociationRequest(d4);
44780
+ }), p2.on("associationAccepted", (e4) => {
44781
+ this.emit("associationAccepted", e4), p2.sendRequests(this.requests);
44782
+ }), p2.on("associationReleaseResponse", () => {
44783
+ this.emit("associationReleased"), l3.end();
44784
+ }), p2.on("associationRejected", (e4) => {
44785
+ this.emit("associationRejected", e4), l3.end();
44786
+ }), p2.on("done", () => {
44787
+ setTimeout(() => p2.sendAssociationReleaseRequest(), this.associationLingerTimeout);
44788
+ }), p2.on("cStoreRequest", (e4, t4) => {
44787
44789
  this.emit("cStoreRequest", e4, t4);
44788
- }), p3.on("nEventReportRequest", (e4, t4) => {
44790
+ }), p2.on("nEventReportRequest", (e4, t4) => {
44789
44791
  this.emit("nEventReportRequest", e4, t4);
44790
- }), p3.on("networkError", (e4) => {
44791
- l2.end(), this.emit("networkError", e4);
44792
- }), p3.on("close", () => {
44793
- this.statistics.addFromOtherStatistics(p3.getStatistics()), this.network = void 0, this.emit("closed");
44794
- }), this.network = p3;
44792
+ }), p2.on("networkError", (e4) => {
44793
+ l3.end(), this.emit("networkError", e4);
44794
+ }), p2.on("close", () => {
44795
+ this.statistics.addFromOtherStatistics(p2.getStatistics()), this.network = void 0, this.emit("closed");
44796
+ }), this.network = p2;
44795
44797
  }
44796
44798
  getStatistics() {
44797
44799
  return this.statistics;
@@ -44886,7 +44888,7 @@ var require_dcmjs_dimse_min = __commonJS({
44886
44888
  }
44887
44889
  }
44888
44890
  }
44889
- class l2 extends c(g2, u2) {
44891
+ class l3 extends c(g2, u2) {
44890
44892
  constructor(e3, t3, s3, i3) {
44891
44893
  switch (super(new a2({ CommandField: e3, CommandDataSetType: s3 ? 514 : 257 })), e3) {
44892
44894
  case n2.NGetRequest:
@@ -44949,7 +44951,7 @@ var require_dcmjs_dimse_min = __commonJS({
44949
44951
  return `${super.toString(e3)} [id: ${this.getMessageId() || ""}]`;
44950
44952
  }
44951
44953
  }
44952
- class p3 extends g2 {
44954
+ class p2 extends g2 {
44953
44955
  constructor(e3, t3, s3, i3, r9) {
44954
44956
  switch (super(new a2({ CommandField: e3, CommandDataSetType: s3 ? 514 : 257, Status: i3, ErrorComment: r9 })), e3) {
44955
44957
  case n2.NGetRequest:
@@ -45056,12 +45058,12 @@ var require_dcmjs_dimse_min = __commonJS({
45056
45058
  }
45057
45059
  }
45058
45060
  }
45059
- class R2 extends l2 {
45061
+ class R2 extends l3 {
45060
45062
  constructor() {
45061
45063
  super(n2.CEchoRequest, r8.Verification, false);
45062
45064
  }
45063
45065
  }
45064
- class S2 extends p3 {
45066
+ class S2 extends p2 {
45065
45067
  constructor(e3, t3) {
45066
45068
  super(n2.CEchoResponse, r8.Verification, false, e3, t3);
45067
45069
  }
@@ -45071,7 +45073,7 @@ var require_dcmjs_dimse_min = __commonJS({
45071
45073
  return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
45072
45074
  }
45073
45075
  }
45074
- class f2 extends l2 {
45076
+ class f2 extends l3 {
45075
45077
  constructor(e3) {
45076
45078
  super(n2.CFindRequest, r8.StudyRootQueryRetrieveInformationModelFind, false), this.setPriority(e3 || i2.Medium);
45077
45079
  }
@@ -45106,7 +45108,7 @@ var require_dcmjs_dimse_min = __commonJS({
45106
45108
  return n3.setAffectedSopClassUid(r8.ModalityWorklistInformationModelFind), n3.setDataset(new a2(s3)), n3;
45107
45109
  }
45108
45110
  }
45109
- class y2 extends p3 {
45111
+ class y2 extends p2 {
45110
45112
  constructor(e3, t3) {
45111
45113
  super(n2.CFindResponse, r8.StudyRootQueryRetrieveInformationModelFind, false, e3, t3);
45112
45114
  }
@@ -45116,7 +45118,7 @@ var require_dcmjs_dimse_min = __commonJS({
45116
45118
  return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
45117
45119
  }
45118
45120
  }
45119
- class I2 extends l2 {
45121
+ class I2 extends l3 {
45120
45122
  constructor(e3, t3) {
45121
45123
  if (super(n2.CStoreRequest, "", false), this.setPriority(t3 || i2.Medium), e3 instanceof a2) return this.setAffectedSopClassUid(e3.getElement("SOPClassUID")), this.setAffectedSopInstanceUid(e3.getElement("SOPInstanceUID")), void this.setDataset(e3);
45122
45124
  if ("string" == typeof e3 || e3 instanceof String) {
@@ -45134,7 +45136,7 @@ var require_dcmjs_dimse_min = __commonJS({
45134
45136
  void 0 !== this.needsFullDatasetLoading && true === this.needsFullDatasetLoading && void 0 !== this.datasetOrFile && "" !== this.datasetOrFile.trim() && this.setDataset(a2.fromFile(this.datasetOrFile));
45135
45137
  }
45136
45138
  }
45137
- class C2 extends p3 {
45139
+ class C2 extends p2 {
45138
45140
  constructor(e3, t3) {
45139
45141
  super(n2.CStoreResponse, "", false, e3, t3);
45140
45142
  }
@@ -45144,7 +45146,7 @@ var require_dcmjs_dimse_min = __commonJS({
45144
45146
  return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3.setAffectedSopClassUid(e3.getAffectedSopClassUid()), t3.setAffectedSopInstanceUid(e3.getAffectedSopInstanceUid()), t3;
45145
45147
  }
45146
45148
  }
45147
- class P2 extends l2 {
45149
+ class P2 extends l3 {
45148
45150
  constructor(e3) {
45149
45151
  super(n2.CMoveRequest, r8.StudyRootQueryRetrieveInformationModelMove, false), this.setPriority(e3 || i2.Medium);
45150
45152
  }
@@ -45167,7 +45169,7 @@ var require_dcmjs_dimse_min = __commonJS({
45167
45169
  return o3.setDataset(new a2(r9)), o3.getCommandDataset().setElement("MoveDestination", e3), o3;
45168
45170
  }
45169
45171
  }
45170
- class A extends p3 {
45172
+ class A extends p2 {
45171
45173
  constructor(e3, t3) {
45172
45174
  super(n2.CMoveResponse, r8.StudyRootQueryRetrieveInformationModelMove, false, e3, t3);
45173
45175
  }
@@ -45189,7 +45191,7 @@ var require_dcmjs_dimse_min = __commonJS({
45189
45191
  return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
45190
45192
  }
45191
45193
  }
45192
- class v extends l2 {
45194
+ class v extends l3 {
45193
45195
  constructor(e3) {
45194
45196
  super(n2.CGetRequest, r8.StudyRootQueryRetrieveInformationModelGet, false), this.setPriority(e3 || i2.Medium), this.addStorageSopClassesToAssociation = true;
45195
45197
  }
@@ -45218,7 +45220,7 @@ var require_dcmjs_dimse_min = __commonJS({
45218
45220
  return r9.setDataset(new a2(i3)), r9;
45219
45221
  }
45220
45222
  }
45221
- class w3 extends p3 {
45223
+ class w3 extends p2 {
45222
45224
  constructor(e3, t3) {
45223
45225
  super(n2.CGetResponse, r8.StudyRootQueryRetrieveInformationModelGet, false, e3, t3);
45224
45226
  }
@@ -45240,12 +45242,12 @@ var require_dcmjs_dimse_min = __commonJS({
45240
45242
  return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
45241
45243
  }
45242
45244
  }
45243
- class x2 extends l2 {
45245
+ class x2 extends l3 {
45244
45246
  constructor(e3, t3, s3) {
45245
45247
  super(n2.NCreateRequest, e3, false), this.setAffectedSopInstanceUid(t3), this.setMetaSopClassUid(s3);
45246
45248
  }
45247
45249
  }
45248
- class U2 extends p3 {
45250
+ class U2 extends p2 {
45249
45251
  constructor(e3, t3, s3, i3) {
45250
45252
  super(n2.NCreateResponse, e3, false, s3, i3), this.setAffectedSopInstanceUid(t3);
45251
45253
  }
@@ -45255,7 +45257,7 @@ var require_dcmjs_dimse_min = __commonJS({
45255
45257
  return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
45256
45258
  }
45257
45259
  }
45258
- class q2 extends l2 {
45260
+ class q2 extends l3 {
45259
45261
  constructor(e3, t3, s3, i3) {
45260
45262
  super(n2.NActionRequest, e3, false), this.setRequestedSopInstanceUid(t3), this.setActionTypeId(s3), this.setMetaSopClassUid(i3);
45261
45263
  }
@@ -45266,7 +45268,7 @@ var require_dcmjs_dimse_min = __commonJS({
45266
45268
  this.getCommandDataset().setElement("ActionTypeID", e3);
45267
45269
  }
45268
45270
  }
45269
- class D2 extends p3 {
45271
+ class D2 extends p2 {
45270
45272
  constructor(e3, t3, s3, i3, r9) {
45271
45273
  super(n2.NActionResponse, e3, false, i3, r9), this.setAffectedSopInstanceUid(t3), this.setActionTypeId(s3);
45272
45274
  }
@@ -45282,12 +45284,12 @@ var require_dcmjs_dimse_min = __commonJS({
45282
45284
  return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
45283
45285
  }
45284
45286
  }
45285
- class E2 extends l2 {
45287
+ class E2 extends l3 {
45286
45288
  constructor(e3, t3, s3) {
45287
45289
  super(n2.NDeleteRequest, e3, false), this.setRequestedSopInstanceUid(t3), this.setMetaSopClassUid(s3);
45288
45290
  }
45289
45291
  }
45290
- class T extends p3 {
45292
+ class T extends p2 {
45291
45293
  constructor(e3, t3, s3, i3) {
45292
45294
  super(n2.NDeleteResponse, e3, false, s3, i3), this.setAffectedSopInstanceUid(t3);
45293
45295
  }
@@ -45297,7 +45299,7 @@ var require_dcmjs_dimse_min = __commonJS({
45297
45299
  return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
45298
45300
  }
45299
45301
  }
45300
- class b2 extends l2 {
45302
+ class b2 extends l3 {
45301
45303
  constructor(e3, t3, s3, i3) {
45302
45304
  super(n2.NEventReportRequest, e3, false), this.setAffectedSopInstanceUid(t3), this.setEventTypeId(s3), this.setMetaSopClassUid(i3);
45303
45305
  }
@@ -45308,7 +45310,7 @@ var require_dcmjs_dimse_min = __commonJS({
45308
45310
  this.getCommandDataset().setElement("EventTypeID", e3);
45309
45311
  }
45310
45312
  }
45311
- class O2 extends p3 {
45313
+ class O2 extends p2 {
45312
45314
  constructor(e3, t3, s3, i3, r9) {
45313
45315
  super(n2.NEventReportResponse, e3, false, i3, r9), this.setAffectedSopInstanceUid(t3), this.setEventTypeId(s3);
45314
45316
  }
@@ -45324,7 +45326,7 @@ var require_dcmjs_dimse_min = __commonJS({
45324
45326
  return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
45325
45327
  }
45326
45328
  }
45327
- class N2 extends l2 {
45329
+ class N2 extends l3 {
45328
45330
  constructor(e3, t3, s3, i3) {
45329
45331
  super(n2.NGetRequest, e3, false), this.setRequestedSopInstanceUid(t3), this.setAttributeIdentifierList(Array.isArray(s3) ? s3 : [s3]), this.setMetaSopClassUid(i3);
45330
45332
  }
@@ -45350,7 +45352,7 @@ var require_dcmjs_dimse_min = __commonJS({
45350
45352
  return "0".repeat(t3 - s3.length) + s3;
45351
45353
  }
45352
45354
  }
45353
- class B2 extends p3 {
45355
+ class B2 extends p2 {
45354
45356
  constructor(e3, t3, s3, i3) {
45355
45357
  super(n2.NGetResponse, e3, false, s3, i3), this.setAffectedSopInstanceUid(t3);
45356
45358
  }
@@ -45360,12 +45362,12 @@ var require_dcmjs_dimse_min = __commonJS({
45360
45362
  return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
45361
45363
  }
45362
45364
  }
45363
- class M3 extends l2 {
45365
+ class M3 extends l3 {
45364
45366
  constructor(e3, t3, s3) {
45365
45367
  super(n2.NSetRequest, e3, false), this.setRequestedSopInstanceUid(t3), this.setMetaSopClassUid(s3);
45366
45368
  }
45367
45369
  }
45368
- class L2 extends p3 {
45370
+ class L2 extends p2 {
45369
45371
  constructor(e3, t3, s3, i3) {
45370
45372
  super(n2.NSetResponse, e3, false, s3, i3), this.setAffectedSopInstanceUid(t3);
45371
45373
  }
@@ -45375,7 +45377,7 @@ var require_dcmjs_dimse_min = __commonJS({
45375
45377
  return t3.setMessageIdBeingRespondedTo(e3.getMessageId()), t3;
45376
45378
  }
45377
45379
  }
45378
- class F2 extends l2 {
45380
+ class F2 extends l3 {
45379
45381
  constructor(e3, t3) {
45380
45382
  super(n2.CCancelRequest, e3, false), this.setMessageIdBeingRespondedTo(t3);
45381
45383
  }
@@ -45390,7 +45392,7 @@ var require_dcmjs_dimse_min = __commonJS({
45390
45392
  return new F2(e3.getAffectedSopClassUid(), e3.getMessageId());
45391
45393
  }
45392
45394
  }
45393
- e2.exports = { CCancelRequest: F2, CEchoRequest: R2, CEchoResponse: S2, CFindRequest: f2, CFindResponse: y2, CGetRequest: v, CGetResponse: w3, CMoveRequest: P2, CMoveResponse: A, Command: g2, CStoreRequest: I2, CStoreResponse: C2, NActionRequest: q2, NActionResponse: D2, NCreateRequest: x2, NCreateResponse: U2, NDeleteRequest: E2, NDeleteResponse: T, NEventReportRequest: b2, NEventReportResponse: O2, NGetRequest: N2, NGetResponse: B2, NSetRequest: M3, NSetResponse: L2, Request: l2, Response: p3 };
45395
+ e2.exports = { CCancelRequest: F2, CEchoRequest: R2, CEchoResponse: S2, CFindRequest: f2, CFindResponse: y2, CGetRequest: v, CGetResponse: w3, CMoveRequest: P2, CMoveResponse: A, Command: g2, CStoreRequest: I2, CStoreResponse: C2, NActionRequest: q2, NActionResponse: D2, NCreateRequest: x2, NCreateResponse: U2, NDeleteRequest: E2, NDeleteResponse: T, NEventReportRequest: b2, NEventReportResponse: O2, NGetRequest: N2, NGetResponse: B2, NSetRequest: M3, NSetResponse: L2, Request: l3, Response: p2 };
45394
45396
  }, 492: (e2) => {
45395
45397
  const t2 = { AAbort: 7, AAssociateAC: 2, AAssociateRJ: 3, AAssociateRQ: 1, AReleaseRP: 6, AReleaseRQ: 5, PDataTF: 4 };
45396
45398
  Object.freeze(t2);
@@ -45418,16 +45420,16 @@ var require_dcmjs_dimse_min = __commonJS({
45418
45420
  Object.freeze(m2);
45419
45421
  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" };
45420
45422
  Object.freeze(g2);
45421
- 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" };
45422
- Object.freeze(l2);
45423
- const p3 = { ImplicitVRLittleEndian: "1.2.840.10008.1.2", ExplicitVRLittleEndian: "1.2.840.10008.1.2.1", DeflatedExplicitVRLittleEndian: "1.2.840.10008.1.2.1.99", ExplicitVRBigEndian: "1.2.840.10008.1.2.2", RleLossless: "1.2.840.10008.1.2.5", JpegBaseline: "1.2.840.10008.1.2.4.50", JpegLossless: "1.2.840.10008.1.2.4.70", JpegLsLossless: "1.2.840.10008.1.2.4.80", JpegLsLossy: "1.2.840.10008.1.2.4.81", Jpeg2000Lossless: "1.2.840.10008.1.2.4.90", Jpeg2000Lossy: "1.2.840.10008.1.2.4.91" };
45424
- Object.freeze(p3);
45425
- const R2 = [p3.ImplicitVRLittleEndian, p3.ExplicitVRLittleEndian];
45423
+ const l3 = { 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" };
45424
+ Object.freeze(l3);
45425
+ const p2 = { ImplicitVRLittleEndian: "1.2.840.10008.1.2", ExplicitVRLittleEndian: "1.2.840.10008.1.2.1", DeflatedExplicitVRLittleEndian: "1.2.840.10008.1.2.1.99", ExplicitVRBigEndian: "1.2.840.10008.1.2.2", RleLossless: "1.2.840.10008.1.2.5", JpegBaseline: "1.2.840.10008.1.2.4.50", JpegLossless: "1.2.840.10008.1.2.4.70", JpegLsLossless: "1.2.840.10008.1.2.4.80", JpegLsLossy: "1.2.840.10008.1.2.4.81", Jpeg2000Lossless: "1.2.840.10008.1.2.4.90", Jpeg2000Lossy: "1.2.840.10008.1.2.4.91" };
45426
+ Object.freeze(p2);
45427
+ const R2 = [p2.ImplicitVRLittleEndian, p2.ExplicitVRLittleEndian];
45426
45428
  Object.freeze(R2);
45427
45429
  const S2 = { ImplementationClassUid: "1.2.826.0.1.3680043.10.854", ImplementationVersion: "DCMJS-DIMSE-V0.1", MaxPduLength: 262144 };
45428
- Object.freeze(S2), e2.exports = { AbortReason: o2, AbortSource: r8, CommandFieldType: s2, DefaultImplementation: S2, PresentationContextResult: n2, Priority: u2, RawPduType: t2, RejectReason: d3, RejectResult: a2, RejectSource: c, SopClass: l2, Status: h2, StorageClass: g2, TranscodableTransferSyntaxes: R2, TransferSyntax: p3, Uid: m2, UserIdentityType: i2 };
45430
+ 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: l3, Status: h2, StorageClass: g2, TranscodableTransferSyntaxes: R2, TransferSyntax: p2, Uid: m2, UserIdentityType: i2 };
45429
45431
  }, 825: (e2, t2, s2) => {
45430
- const { StorageClass: n2, TransferSyntax: i2 } = s2(492), r8 = s2(139), { readFile: o2, readFileSync: a2, writeFile: c, writeFileSync: d3 } = s2(896), { EOL: u2 } = s2(857), h2 = s2(111), { DicomDict: m2, DicomMessage: g2, DicomMetaDictionary: l2, ReadBufferStream: p3, WriteBufferStream: R2 } = h2.data, S2 = h2.log;
45432
+ const { StorageClass: n2, TransferSyntax: i2 } = s2(492), r8 = s2(139), { readFile: o2, readFileSync: a2, writeFile: c, writeFileSync: d3 } = s2(896), { EOL: u2 } = s2(857), h2 = s2(111), { DicomDict: m2, DicomMessage: g2, DicomMetaDictionary: l3, ReadBufferStream: p2, WriteBufferStream: R2 } = h2.data, S2 = h2.log;
45431
45433
  class f2 {
45432
45434
  constructor(e3, t3, s3) {
45433
45435
  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 || {};
@@ -45448,11 +45450,11 @@ var require_dcmjs_dimse_min = __commonJS({
45448
45450
  this.transferSyntaxUid = e3;
45449
45451
  }
45450
45452
  getDenaturalizedDataset(e3, t3) {
45451
- const s3 = t3 ? l2.denaturalizeDataset(this.getElements(), { ...l2.nameMap, ...t3 }) : l2.denaturalizeDataset(this.getElements()), n3 = new R2();
45453
+ const s3 = t3 ? l3.denaturalizeDataset(this.getElements(), { ...l3.nameMap, ...t3 }) : l3.denaturalizeDataset(this.getElements()), n3 = new R2();
45452
45454
  return g2.write(s3, n3, this.transferSyntaxUid, e3), Buffer.from(n3.getBuffer());
45453
45455
  }
45454
45456
  getDenaturalizedCommandDataset() {
45455
- const e3 = l2.denaturalizeDataset(this.getElements()), t3 = new R2(), s3 = new R2();
45457
+ const e3 = l3.denaturalizeDataset(this.getElements()), t3 = new R2(), s3 = new R2();
45456
45458
  return g2.write(e3, s3, i2.ImplicitVRLittleEndian, {}), g2.writeTagObject(t3, "00000000", "UL", s3.size, i2.ImplicitVRLittleEndian, {}), t3.concat(s3), Buffer.from(t3.getBuffer());
45457
45459
  }
45458
45460
  static fromFile(e3, t3, s3) {
@@ -45467,13 +45469,13 @@ var require_dcmjs_dimse_min = __commonJS({
45467
45469
  });
45468
45470
  }
45469
45471
  toFile(e3, t3, s3, i3) {
45470
- const o3 = { _meta: { FileMetaInformationVersion: new Uint8Array([0, 1]).buffer, MediaStorageSOPClassUID: this.getElement("SOPClassUID") || n2.SecondaryCaptureImageStorage, MediaStorageSOPInstanceUID: this.getElement("SOPInstanceUID") || f2.generateDerivedUid(), TransferSyntaxUID: this.getTransferSyntaxUid(), ImplementationClassUID: r8.getImplementationClassUid(), ImplementationVersionName: r8.getImplementationVersion() }, ...this.getElements() }, a3 = l2.denaturalizeDataset(o3._meta), u3 = new m2(a3);
45471
- u3.dict = s3 ? l2.denaturalizeDataset(o3, { ...l2.nameMap, ...s3 }) : l2.denaturalizeDataset(o3), t3 instanceof Function ? c(e3, Buffer.from(u3.write(i3)), (e4) => {
45472
+ 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 = l3.denaturalizeDataset(o3._meta), u3 = new m2(a3);
45473
+ u3.dict = s3 ? l3.denaturalizeDataset(o3, { ...l3.nameMap, ...s3 }) : l3.denaturalizeDataset(o3), t3 instanceof Function ? c(e3, Buffer.from(u3.write(i3)), (e4) => {
45472
45474
  t3(e4 || void 0);
45473
45475
  }) : d3(e3, Buffer.from(u3.write(i3)));
45474
45476
  }
45475
45477
  static generateDerivedUid() {
45476
- return l2.uid();
45478
+ return l3.uid();
45477
45479
  }
45478
45480
  toString() {
45479
45481
  const e3 = [];
@@ -45481,12 +45483,12 @@ var require_dcmjs_dimse_min = __commonJS({
45481
45483
  }
45482
45484
  static _fromP10Buffer(e3, t3) {
45483
45485
  t3 = t3 || {}, t3 = { ignoreErrors: true, ...t3 };
45484
- const s3 = g2.readFile(e3.buffer.slice(e3.byteOffset, e3.byteOffset + e3.byteLength), t3), n3 = l2.naturalizeDataset(s3.meta).TransferSyntaxUID, i3 = l2.naturalizeDataset(s3.dict);
45486
+ const s3 = g2.readFile(e3.buffer.slice(e3.byteOffset, e3.byteOffset + e3.byteLength), t3), n3 = l3.naturalizeDataset(s3.meta).TransferSyntaxUID, i3 = l3.naturalizeDataset(s3.dict);
45485
45487
  return new f2(i3, n3);
45486
45488
  }
45487
45489
  _fromElementsBuffer(e3, t3, s3) {
45488
- const n3 = new p3(e3.buffer.slice(e3.byteOffset, e3.byteOffset + e3.byteLength)), r9 = t3 === i2.ImplicitVRLittleEndian ? i2.ImplicitVRLittleEndian : t3 === i2.ExplicitVRBigEndian ? i2.ExplicitVRBigEndian : i2.ExplicitVRLittleEndian, o3 = g2._read(n3, r9, s3);
45489
- return l2.naturalizeDataset(o3);
45490
+ const n3 = new p2(e3.buffer.slice(e3.byteOffset, e3.byteOffset + e3.byteLength)), r9 = t3 === i2.ImplicitVRLittleEndian ? i2.ImplicitVRLittleEndian : t3 === i2.ExplicitVRBigEndian ? i2.ExplicitVRBigEndian : i2.ExplicitVRLittleEndian, o3 = g2._read(n3, r9, s3);
45491
+ return l3.naturalizeDataset(o3);
45490
45492
  }
45491
45493
  }
45492
45494
  e2.exports = f2;
@@ -45514,7 +45516,7 @@ var require_dcmjs_dimse_min = __commonJS({
45514
45516
  }
45515
45517
  };
45516
45518
  }, 371: (e2, t2, s2) => {
45517
- const { Association: n2 } = s2(570), { AAbort: i2, AAssociateAC: r8, AAssociateRJ: o2, AAssociateRQ: a2, AReleaseRP: c, AReleaseRQ: d3, PDataTF: u2, Pdv: h2, RawPdu: m2 } = s2(942), { CommandFieldType: g2, RawPduType: l2, Status: p3, TranscodableTransferSyntaxes: R2 } = s2(492), { CCancelRequest: S2, CEchoRequest: f2, CEchoResponse: y2, CFindRequest: I2, CFindResponse: C2, CGetRequest: P2, CGetResponse: A, CMoveRequest: v, CMoveResponse: w3, Command: x2, CStoreRequest: U2, CStoreResponse: q2, NActionRequest: D2, NActionResponse: E2, NCreateRequest: T, NCreateResponse: b2, NDeleteRequest: O2, NDeleteResponse: N2, NEventReportRequest: B2, NEventReportResponse: M3, NGetRequest: L2, NGetResponse: F2, NSetRequest: k2, NSetResponse: $, Response: j2 } = s2(940), V2 = s2(825), _ = s2(139), G2 = s2(906), z2 = s2(547), { SmartBuffer: Q } = s2(766), { EOL: W2 } = s2(857), J2 = s2(733);
45519
+ const { Association: n2 } = s2(570), { AAbort: i2, AAssociateAC: r8, AAssociateRJ: o2, AAssociateRQ: a2, AReleaseRP: c, AReleaseRQ: d3, PDataTF: u2, Pdv: h2, RawPdu: m2 } = s2(942), { CommandFieldType: g2, RawPduType: l3, Status: p2, TranscodableTransferSyntaxes: R2 } = s2(492), { CCancelRequest: S2, CEchoRequest: f2, CEchoResponse: y2, CFindRequest: I2, CFindResponse: C2, CGetRequest: P2, CGetResponse: A, CMoveRequest: v, CMoveResponse: w3, Command: x2, CStoreRequest: U2, CStoreResponse: q2, NActionRequest: D2, NActionResponse: E2, NCreateRequest: T, NCreateResponse: b2, NDeleteRequest: O2, NDeleteResponse: N2, NEventReportRequest: B2, NEventReportResponse: M3, NGetRequest: L2, NGetResponse: F2, NSetRequest: k2, NSetResponse: $, Response: j2 } = s2(940), V2 = s2(825), _ = s2(139), G2 = s2(906), z2 = s2(547), { SmartBuffer: Q } = s2(766), { EOL: W2 } = s2(857), J2 = s2(733);
45518
45520
  class X2 extends J2 {
45519
45521
  constructor() {
45520
45522
  super();
@@ -45528,7 +45530,7 @@ var require_dcmjs_dimse_min = __commonJS({
45528
45530
  if (void 0 === this.receiving) {
45529
45531
  if (this.minimumReceived && (e3 = Buffer.concat([this.minimumReceived, e3], this.minimumReceived.length + e3.length), this.minimumReceived = void 0), e3.length < 6) return void (this.minimumReceived = e3);
45530
45532
  const t3 = Q.fromBuffer(e3, "ascii"), s3 = t3.readUInt8();
45531
- if (s3 !== l2.AAssociateRQ && s3 !== l2.AAssociateAC && s3 !== l2.AAssociateRJ && s3 !== l2.PDataTF && s3 !== l2.AReleaseRQ && s3 !== l2.AReleaseRP && s3 !== l2.AAbort) return void this.emit("error", new Error(`Unknown PDU type: ${s3}`));
45533
+ if (s3 !== l3.AAssociateRQ && s3 !== l3.AAssociateAC && s3 !== l3.AAssociateRJ && s3 !== l3.PDataTF && s3 !== l3.AReleaseRQ && s3 !== l3.AReleaseRP && s3 !== l3.AAbort) return void this.emit("error", new Error(`Unknown PDU type: ${s3}`));
45532
45534
  t3.readUInt8();
45533
45535
  const n3 = t3.readUInt32BE();
45534
45536
  let i3 = e3.length - 6;
@@ -45657,29 +45659,29 @@ var require_dcmjs_dimse_min = __commonJS({
45657
45659
  const t3 = new m2(e3);
45658
45660
  try {
45659
45661
  switch (t3.readPdu(), t3.getType()) {
45660
- case l2.AAssociateRQ:
45662
+ case l3.AAssociateRQ:
45661
45663
  this.association = new n2(), new a2(this.association).read(t3), this.logId = this.association.getCallingAeTitle(), z2.info(`${this.logId} <- Association request:${W2}${this.association.toString()}`), this.emit("associationRequested", this.association);
45662
45664
  break;
45663
- case l2.AAssociateAC:
45665
+ case l3.AAssociateAC:
45664
45666
  new r8(this.association).read(t3), this.logId = this.association.getCalledAeTitle(), z2.info(`${this.logId} <- Association accept:${W2}${this.association.toString()}`), this.emit("associationAccepted", this.association);
45665
45667
  break;
45666
- case l2.AAssociateRJ: {
45668
+ case l3.AAssociateRJ: {
45667
45669
  const e4 = new o2();
45668
45670
  e4.read(t3), z2.info(`${this.logId} <- Association reject ${e4.toString()}`), this.emit("associationRejected", { result: e4.getResult(), source: e4.getSource(), reason: e4.getReason() });
45669
45671
  break;
45670
45672
  }
45671
- case l2.PDataTF: {
45673
+ case l3.PDataTF: {
45672
45674
  const e4 = new u2();
45673
45675
  e4.read(t3), this._processPDataTf(e4);
45674
45676
  break;
45675
45677
  }
45676
- case l2.AReleaseRQ:
45678
+ case l3.AReleaseRQ:
45677
45679
  new d3().read(t3), z2.info(`${this.logId} <- Association release request`), this.emit("associationReleaseRequested");
45678
45680
  break;
45679
- case l2.AReleaseRP:
45681
+ case l3.AReleaseRP:
45680
45682
  new c().read(t3), z2.info(`${this.logId} <- Association release response`), this.emit("associationReleaseResponse");
45681
45683
  break;
45682
- case l2.AAbort: {
45684
+ case l3.AAbort: {
45683
45685
  const e4 = new i2();
45684
45686
  e4.read(t3), z2.info(`${this.logId} <- Association abort ${e4.toString()}`), this.emit("abort", { source: e4.getSource(), reason: e4.getReason() });
45685
45687
  break;
@@ -45787,7 +45789,7 @@ var require_dcmjs_dimse_min = __commonJS({
45787
45789
  _performDimse(e3, t3) {
45788
45790
  if (t3 instanceof j2) {
45789
45791
  const e4 = Object.assign(Object.create(Object.getPrototypeOf(t3)), t3), s3 = this.pending.find((e5) => e5.getMessageId() === t3.getMessageIdBeingRespondedTo());
45790
- s3 && (s3.raiseResponseEvent(e4), e4.getStatus() !== p3.Pending && s3.raiseDoneEvent());
45792
+ s3 && (s3.raiseResponseEvent(e4), e4.getStatus() !== p2.Pending && s3.raiseDoneEvent());
45791
45793
  } else t3.getCommandFieldType() === g2.CEchoRequest ? this.emit("cEchoRequest", t3, (t4) => {
45792
45794
  this._sendDimse({ context: e3, command: t4 });
45793
45795
  }) : t3.getCommandFieldType() === g2.CFindRequest ? this.emit("cFindRequest", t3, (t4) => {
@@ -46281,8 +46283,8 @@ var require_dcmjs_dimse_min = __commonJS({
46281
46283
  }
46282
46284
  }, Pdv: g2, RawPdu: m2 };
46283
46285
  }, 538: (e2, t2, s2) => {
46284
- const { CEchoResponse: n2, CFindResponse: i2, CGetResponse: r8, CMoveResponse: o2, CStoreResponse: a2, NActionResponse: c, NCreateResponse: d3, NDeleteResponse: u2, NEventReportResponse: h2, NGetResponse: m2, NSetResponse: g2 } = s2(940), l2 = s2(371), p3 = s2(906), R2 = s2(547), S2 = s2(733), f2 = s2(278), y2 = s2(756);
46285
- e2.exports = { Scp: class extends l2 {
46286
+ const { CEchoResponse: n2, CFindResponse: i2, CGetResponse: r8, CMoveResponse: o2, CStoreResponse: a2, NActionResponse: c, NCreateResponse: d3, NDeleteResponse: u2, NEventReportResponse: h2, NGetResponse: m2, NSetResponse: g2 } = s2(940), l3 = s2(371), p2 = s2(906), R2 = s2(547), S2 = s2(733), f2 = s2(278), y2 = s2(756);
46287
+ e2.exports = { Scp: class extends l3 {
46286
46288
  constructor(e3, t3) {
46287
46289
  super(e3, t3), this.on("associationRequested", (e4) => {
46288
46290
  this.associationRequested(e4);
@@ -46363,7 +46365,7 @@ var require_dcmjs_dimse_min = __commonJS({
46363
46365
  }
46364
46366
  }, Server: class extends S2 {
46365
46367
  constructor(e3) {
46366
- super(), this.scp = { class: e3 }, this.server = void 0, this.clients = [], this.statistics = new p3();
46368
+ super(), this.scp = { class: e3 }, this.server = void 0, this.clients = [], this.statistics = new p2();
46367
46369
  }
46368
46370
  listen(e3, t3) {
46369
46371
  let s3 = {};
@@ -46424,7 +46426,7 @@ var require_dcmjs_dimse_min = __commonJS({
46424
46426
  }
46425
46427
  };
46426
46428
  }, 237: (e2, t2, s2) => {
46427
- const { Association: n2, PresentationContext: i2 } = s2(570), { Scp: r8, Server: o2 } = s2(538), { CCancelRequest: a2, CEchoRequest: c, CEchoResponse: d3, CFindRequest: u2, CFindResponse: h2, CGetRequest: m2, CGetResponse: g2, CMoveRequest: l2, CMoveResponse: p3, CStoreRequest: R2, CStoreResponse: S2, NActionRequest: f2, NActionResponse: y2, NCreateRequest: I2, NCreateResponse: C2, NDeleteRequest: P2, NDeleteResponse: A, NEventReportRequest: v, NEventReportResponse: w3, NGetRequest: x2, NGetResponse: U2, NSetRequest: q2, NSetResponse: D2 } = s2(940), { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: B2, RejectReason: M3, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $, StorageClass: j2, TransferSyntax: V2, Uid: _, UserIdentityType: G2 } = s2(492), z2 = s2(422), Q = s2(825), W2 = s2(139), J2 = s2(906), X2 = { association: { Association: n2, PresentationContext: i2 }, Client: z2, constants: { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: B2, RejectReason: M3, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $, StorageClass: j2, TransferSyntax: V2, Uid: _, UserIdentityType: G2 }, Dataset: Q, Implementation: W2, log: s2(547), requests: { CCancelRequest: a2, CEchoRequest: c, CFindRequest: u2, CGetRequest: m2, CMoveRequest: l2, CStoreRequest: R2, NActionRequest: f2, NCreateRequest: I2, NDeleteRequest: P2, NEventReportRequest: v, NGetRequest: x2, NSetRequest: q2 }, responses: { CEchoResponse: d3, CFindResponse: h2, CGetResponse: g2, CMoveResponse: p3, CStoreResponse: S2, NActionResponse: y2, NCreateResponse: C2, NDeleteResponse: A, NEventReportResponse: w3, NGetResponse: U2, NSetResponse: D2 }, Scp: r8, Server: o2, Statistics: J2, version: s2(837) };
46429
+ const { Association: n2, PresentationContext: i2 } = s2(570), { Scp: r8, Server: o2 } = s2(538), { CCancelRequest: a2, CEchoRequest: c, CEchoResponse: d3, CFindRequest: u2, CFindResponse: h2, CGetRequest: m2, CGetResponse: g2, CMoveRequest: l3, CMoveResponse: p2, CStoreRequest: R2, CStoreResponse: S2, NActionRequest: f2, NActionResponse: y2, NCreateRequest: I2, NCreateResponse: C2, NDeleteRequest: P2, NDeleteResponse: A, NEventReportRequest: v, NEventReportResponse: w3, NGetRequest: x2, NGetResponse: U2, NSetRequest: q2, NSetResponse: D2 } = s2(940), { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: B2, RejectReason: M3, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $, StorageClass: j2, TransferSyntax: V2, Uid: _, UserIdentityType: G2 } = s2(492), z2 = s2(422), Q = s2(825), W2 = s2(139), J2 = s2(906), X2 = { association: { Association: n2, PresentationContext: i2 }, Client: z2, constants: { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: B2, RejectReason: M3, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $, StorageClass: j2, TransferSyntax: V2, Uid: _, UserIdentityType: G2 }, Dataset: Q, Implementation: W2, log: s2(547), requests: { CCancelRequest: a2, CEchoRequest: c, CFindRequest: u2, CGetRequest: m2, CMoveRequest: l3, CStoreRequest: R2, NActionRequest: f2, NCreateRequest: I2, NDeleteRequest: P2, NEventReportRequest: v, NGetRequest: x2, NSetRequest: q2 }, responses: { CEchoResponse: d3, CFindResponse: h2, CGetResponse: g2, CMoveResponse: p2, CStoreResponse: S2, NActionResponse: y2, NCreateResponse: C2, NDeleteResponse: A, NEventReportResponse: w3, NGetResponse: U2, NSetResponse: D2 }, Scp: r8, Server: o2, Statistics: J2, version: s2(837) };
46428
46430
  e2.exports = X2;
46429
46431
  }, 547: (e2, t2, s2) => {
46430
46432
  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()] });
@@ -46577,17 +46579,17 @@ var Yt = "not-modified";
46577
46579
  var Zt = "not-found";
46578
46580
  var er = "unauthorized";
46579
46581
  var Ze = "accepted";
46580
- var rn = { resourceType: "OperationOutcome", id: Zt, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
46582
+ var on = { resourceType: "OperationOutcome", id: Zt, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
46581
46583
  var Ee = { resourceType: "OperationOutcome", id: er, issue: [{ severity: "error", code: "login", details: { text: "Unauthorized" } }] };
46582
- var nn = { ...Ee, issue: [...Ee.issue, { severity: "error", code: "expired", details: { text: "Token expired" } }] };
46584
+ var sn = { ...Ee, issue: [...Ee.issue, { severity: "error", code: "expired", details: { text: "Token expired" } }] };
46583
46585
  var tr = { ...Ee, issue: [...Ee.issue, { severity: "error", code: "invalid", details: { text: "Token not issued for this audience" } }] };
46584
- function S(r7, e) {
46586
+ function E(r7, e) {
46585
46587
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "invalid", details: { text: r7 }, ...e ? { expression: [e] } : void 0 }] };
46586
46588
  }
46587
46589
  function h(r7) {
46588
46590
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "structure", details: { text: r7 } }] };
46589
46591
  }
46590
- function on(r7) {
46592
+ function an(r7) {
46591
46593
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "exception", details: { text: "Internal server error" }, diagnostics: r7.toString() }] };
46592
46594
  }
46593
46595
  function be(r7) {
@@ -46598,43 +46600,43 @@ function rr(r7) {
46598
46600
  }
46599
46601
  var d = class extends Error {
46600
46602
  constructor(e, t) {
46601
- super(sn(e)), this.outcome = e, this.cause = t;
46603
+ super(cn(e)), this.outcome = e, this.cause = t;
46602
46604
  }
46603
46605
  };
46604
46606
  function Xe(r7) {
46605
- return r7 instanceof d ? r7.outcome : be(r7) ? r7 : S(Ne(r7));
46607
+ return r7 instanceof d ? r7.outcome : be(r7) ? r7 : E(Ne(r7));
46606
46608
  }
46607
46609
  function Ne(r7) {
46608
- return r7 ? typeof r7 == "string" ? r7 : r7 instanceof Error ? r7.message : be(r7) ? sn(r7) : typeof r7 == "object" && "code" in r7 && typeof r7.code == "string" ? r7.code : JSON.stringify(r7) : "Unknown error";
46610
+ return r7 ? typeof r7 == "string" ? r7 : r7 instanceof Error ? r7.message : be(r7) ? cn(r7) : typeof r7 == "object" && "code" in r7 && typeof r7.code == "string" ? r7.code : JSON.stringify(r7) : "Unknown error";
46609
46611
  }
46610
- function sn(r7) {
46611
- let e = r7.issue?.map(Ki) ?? [];
46612
+ function cn(r7) {
46613
+ let e = r7.issue?.map(Ji) ?? [];
46612
46614
  return e.length > 0 ? e.join("; ") : "Unknown error";
46613
46615
  }
46614
- function Ki(r7) {
46616
+ function Ji(r7) {
46615
46617
  let e;
46616
46618
  return r7.details?.text ? r7.diagnostics ? e = `${r7.details.text} (${r7.diagnostics})` : e = r7.details.text : r7.diagnostics ? e = r7.diagnostics : e = "Unknown error", r7.expression?.length && (e += ` (${r7.expression.join(", ")})`), e;
46617
46619
  }
46618
- function Ji(r7, e) {
46620
+ function Zi(r7, e) {
46619
46621
  let t = e.max && e.max === Number.MAX_SAFE_INTEGER ? Number.POSITIVE_INFINITY : e.max;
46620
46622
  return { path: r7, description: "", type: e.type ?? [], min: e.min ?? 0, max: t ?? 1, isArray: !!t && t > 1, constraints: [] };
46621
46623
  }
46622
- function un(r7) {
46624
+ function pn(r7) {
46623
46625
  let e = /* @__PURE__ */ Object.create(null);
46624
- 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, Ji(i, o)])), constraints: [], innerTypes: [] };
46626
+ 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, Zi(i, o)])), constraints: [], innerTypes: [] };
46625
46627
  return e;
46626
46628
  }
46627
- var ln = { 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" }] } } }, 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"] }] } } }, 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" }] } } }, 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" }] } } }, 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" }] } } }, 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" }] } } } };
46629
+ var dn = { 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" }] } } }, 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"] }] } } }, 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" }] } } }, 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" }] } } }, 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" }] } } }, 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" }] } } } };
46628
46630
  function sr(r7) {
46629
46631
  return new ir(r7).parse();
46630
46632
  }
46631
- var ce = un(ln);
46633
+ var ce = pn(dn);
46632
46634
  var ar = /* @__PURE__ */ Object.create(null);
46633
- var pn = /* @__PURE__ */ Object.create(null);
46634
- var Zi = { "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" };
46635
- function hn(r7) {
46635
+ var fn = /* @__PURE__ */ Object.create(null);
46636
+ var eo = { "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" };
46637
+ function gn(r7) {
46636
46638
  let e;
46637
- return e = pn[r7], e || (e = pn[r7] = /* @__PURE__ */ Object.create(null)), e;
46639
+ return e = fn[r7], e || (e = fn[r7] = /* @__PURE__ */ Object.create(null)), e;
46638
46640
  }
46639
46641
  function cr(r7) {
46640
46642
  let e = Array.isArray(r7) ? r7 : r7.entry?.map((t) => t.resource) ?? [];
@@ -46643,28 +46645,28 @@ function cr(r7) {
46643
46645
  function ur(r7) {
46644
46646
  if (!r7?.name) throw new Error("Failed loading StructureDefinition from bundle");
46645
46647
  if (r7.resourceType !== "StructureDefinition") return;
46646
- let e = sr(r7), t = Zi[r7.url], n, i;
46647
- t ? (n = ce, 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 = ce, i = r7.type) : (n = hn(r7.url), i = r7.type), n[i] = e;
46648
+ let e = sr(r7), t = eo[r7.url], n, i;
46649
+ t ? (n = ce, 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 = ce, i = r7.type) : (n = gn(r7.url), i = r7.type), n[i] = e;
46648
46650
  for (let o of e.innerTypes) o.parentType = e, n[o.name] = o;
46649
46651
  ar[r7.url] = e;
46650
46652
  }
46651
- function gn(r7) {
46653
+ function xn(r7) {
46652
46654
  return !!ce[r7];
46653
46655
  }
46654
46656
  function Le(r7, e) {
46655
46657
  if (e) {
46656
- let t = hn(e)[r7];
46658
+ let t = gn(e)[r7];
46657
46659
  if (t) return t;
46658
46660
  }
46659
46661
  return ce[r7];
46660
46662
  }
46661
- function xn(r7) {
46663
+ function Sn(r7) {
46662
46664
  return !!ar[r7];
46663
46665
  }
46664
46666
  var ir = class {
46665
46667
  constructor(e) {
46666
46668
  if (!e.snapshot?.element || e.snapshot.element.length === 0) throw new Error(`No snapshot defined for StructureDefinition '${e.name}'`);
46667
- this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, path: this.root.path, title: e.title, type: e.type, url: e.url, kind: e.kind, description: ro(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
46669
+ this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, path: this.root.path, title: e.title, type: e.type, url: e.url, kind: e.kind, description: io(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
46668
46670
  }
46669
46671
  parse() {
46670
46672
  let e = this.next();
@@ -46705,7 +46707,7 @@ var ir = class {
46705
46707
  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: Re(this.backboneContext?.path, e.path) ? this.backboneContext : this.backboneContext?.parent };
46706
46708
  }
46707
46709
  enterSlice(e, t) {
46708
- to(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
46710
+ no(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
46709
46711
  if (n.type !== "value" && n.type !== "pattern" && n.type !== "type") throw new Error(`Unsupported slicing discriminator type: ${n.type}`);
46710
46712
  return { path: n.path, type: n.type };
46711
46713
  }), slices: [], ordered: e.slicing?.ordered ?? false, rule: e.slicing?.rules }, this.slicingContext = { field: t.slicing, path: e.path ?? "" });
@@ -46745,39 +46747,39 @@ var ir = class {
46745
46747
  });
46746
46748
  }
46747
46749
  parseElementDefinition(e) {
46748
- let t = fn(e.max), n = e.base?.max ? fn(e.base.max) : t, i = { type: "ElementDefinition", value: e };
46749
- 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: mn(P(i, "fixed[x]")), pattern: mn(P(i, "pattern[x]")), binding: e.binding };
46750
+ let t = hn(e.max), n = e.base?.max ? hn(e.base.max) : t, i = { type: "ElementDefinition", value: e };
46751
+ 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: yn(P(i, "fixed[x]")), pattern: yn(P(i, "pattern[x]")), binding: e.binding };
46750
46752
  }
46751
46753
  };
46752
- function fn(r7) {
46754
+ function hn(r7) {
46753
46755
  return r7 === "*" ? Number.POSITIVE_INFINITY : Number.parseInt(r7, 10);
46754
46756
  }
46755
46757
  function nr(r7, e = "") {
46756
- return eo(r7.path, e);
46758
+ return ro(r7.path, e);
46757
46759
  }
46758
- function eo(r7, e) {
46760
+ function ro(r7, e) {
46759
46761
  return r7 ? e && r7.startsWith(e) ? r7.substring(e.length + 1) : r7 : "";
46760
46762
  }
46761
46763
  function Re(r7, e) {
46762
46764
  return !r7 || !e ? false : e.startsWith(r7 + ".") || e === r7;
46763
46765
  }
46764
- function mn(r7) {
46765
- return Array.isArray(r7) && r7.length > 0 ? r7[0] : E(r7) ? void 0 : r7;
46766
+ function yn(r7) {
46767
+ return Array.isArray(r7) && r7.length > 0 ? r7[0] : S(r7) ? void 0 : r7;
46766
46768
  }
46767
- function to(r7) {
46769
+ function no(r7) {
46768
46770
  let e = r7.slicing?.discriminator;
46769
46771
  return !!(r7.type?.some((t) => t.code === "Extension") && e?.length === 1 && e[0].type === "value" && e[0].path === "url");
46770
46772
  }
46771
- function ro(r7) {
46773
+ function io(r7) {
46772
46774
  let e = r7.description;
46773
46775
  return e?.startsWith(`Base StructureDefinition for ${r7.name} Type: `) && (e = e.substring(`Base StructureDefinition for ${r7.name} Type: `.length)), e;
46774
46776
  }
46775
46777
  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: /.*/ };
46776
46778
  function f(r7) {
46777
- return [{ type: p.boolean, value: r7 }];
46779
+ return [{ type: l.boolean, value: r7 }];
46778
46780
  }
46779
46781
  function g(r7) {
46780
- 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 } : k(r7) ? { type: p.Quantity, value: r7 } : I(r7) ? { type: r7.resourceType, value: r7 } : { type: p.BackboneElement, value: r7 };
46782
+ return r7 == null ? { type: "undefined", value: void 0 } : Number.isSafeInteger(r7) ? { type: l.integer, value: r7 } : typeof r7 == "number" ? { type: l.decimal, value: r7 } : typeof r7 == "boolean" ? { type: l.boolean, value: r7 } : typeof r7 == "string" ? { type: l.string, value: r7 } : k(r7) ? { type: l.Quantity, value: r7 } : I(r7) ? { type: r7.resourceType, value: r7 } : Tr(r7) ? { type: l.CodeableConcept, value: r7 } : xr(r7) ? { type: l.Coding, value: r7 } : { type: l.BackboneElement, value: r7 };
46781
46783
  }
46782
46784
  function N(r7) {
46783
46785
  return r7.length === 0 ? false : !!r7[0].value;
@@ -46791,41 +46793,47 @@ function j(r7, e) {
46791
46793
  function P(r7, e, t) {
46792
46794
  if (!r7.value) return;
46793
46795
  let n = st(r7.type, e, t?.profileUrl);
46794
- return n ? mo(r7, e, n) : ho(r7, e);
46796
+ return n ? yo(r7, e, n) : go(r7, e);
46795
46797
  }
46796
- function mo(r7, e, t) {
46798
+ function yo(r7, e, t) {
46797
46799
  let n = r7.value, i = t.type;
46798
46800
  if (!i || i.length === 0) return;
46799
46801
  let o, s = "undefined", a2, c = t.path.lastIndexOf("."), u2 = t.path.substring(c + 1);
46800
- for (let l2 of i) {
46801
- let m2 = u2.replace("[x]", w(l2.code));
46802
+ for (let p2 of i) {
46803
+ let m2 = u2.replace("[x]", w(p2.code));
46802
46804
  if (o = n[m2], a2 = n["_" + m2], o !== void 0 || a2 !== void 0) {
46803
- s = l2.code;
46805
+ s = p2.code;
46804
46806
  break;
46805
46807
  }
46806
46808
  }
46807
46809
  if (a2) if (Array.isArray(o)) {
46808
46810
  o = o.slice();
46809
- for (let l2 = 0; l2 < Math.max(o.length, a2.length); l2++) o[l2] = Pn(o[l2], a2[l2]);
46810
- } else o = Pn(o, a2);
46811
- if (!E(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((l2) => En(l2, s)) : En(o, s);
46811
+ for (let p2 = 0; p2 < Math.max(o.length, a2.length); p2++) o[p2] = An(o[p2], a2[p2]);
46812
+ } else o = An(o, a2);
46813
+ if (!S(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((p2) => Rn(p2, s)) : Rn(o, s);
46812
46814
  }
46813
- function En(r7, e) {
46815
+ function Rn(r7, e) {
46814
46816
  return e === "Resource" && I(r7) && (e = r7.resourceType), { type: e, value: r7 };
46815
46817
  }
46816
- function ho(r7, e) {
46818
+ function go(r7, e) {
46817
46819
  let t = r7.value;
46818
46820
  if (!t || typeof t != "object") return;
46819
46821
  let n;
46820
- if (e in t) n = t[e];
46821
- else for (let i in p) {
46822
+ if (e in t) {
46823
+ let i = t[e];
46824
+ Array.isArray(i) ? n = i.map(g) : n = g(i);
46825
+ } else for (let i in l) {
46822
46826
  let o = e + w(i);
46823
46827
  if (o in t) {
46824
- n = t[o];
46828
+ let s = t[o];
46829
+ Array.isArray(s) ? n = s.map((a2) => ({ type: i, value: a2 })) : n = { type: i, value: s };
46825
46830
  break;
46826
46831
  }
46827
46832
  }
46828
- if (!E(n)) return Array.isArray(n) ? n.map(g) : g(n);
46833
+ if (Array.isArray(n)) {
46834
+ if (n.length === 0 || S(n[0])) return;
46835
+ } else if (S(n)) return;
46836
+ return n;
46829
46837
  }
46830
46838
  function it(r7) {
46831
46839
  let e = [];
@@ -46839,27 +46847,27 @@ function it(r7) {
46839
46847
  }
46840
46848
  return e;
46841
46849
  }
46842
- function wn(r7) {
46850
+ function On(r7) {
46843
46851
  return f(!N(r7));
46844
46852
  }
46845
- function An(r7, e) {
46853
+ function In(r7, e) {
46846
46854
  return r7.length === 0 || e.length === 0 ? [] : r7.length !== e.length ? f(false) : f(r7.every((t, n) => N(yr(t, e[n]))));
46847
46855
  }
46848
- function On(r7, e) {
46856
+ function kn(r7, e) {
46849
46857
  return r7.length === 0 || e.length === 0 ? [] : r7.length !== e.length ? f(true) : f(r7.some((t, n) => !N(yr(t, e[n]))));
46850
46858
  }
46851
46859
  function yr(r7, e) {
46852
46860
  let t = r7.value?.valueOf(), n = e.value?.valueOf();
46853
- return typeof t == "number" && typeof n == "number" ? f(Math.abs(t - n) < 1e-8) : k(t) && k(n) ? f(Vn(t, n)) : f(typeof t == "object" && typeof n == "object" ? vr(r7, e) : t === n);
46861
+ return typeof t == "number" && typeof n == "number" ? f(Math.abs(t - n) < 1e-8) : k(t) && k(n) ? f(Mn(t, n)) : f(typeof t == "object" && typeof n == "object" ? vr(r7, e) : t === n);
46854
46862
  }
46855
46863
  function gr(r7, e) {
46856
- return r7.length === 0 && e.length === 0 ? f(true) : r7.length !== e.length ? f(false) : (r7.sort(bn), e.sort(bn), f(r7.every((t, n) => N(yo(t, e[n])))));
46864
+ return r7.length === 0 && e.length === 0 ? f(true) : r7.length !== e.length ? f(false) : (r7.sort(Cn), e.sort(Cn), f(r7.every((t, n) => N(vo(t, e[n])))));
46857
46865
  }
46858
- function yo(r7, e) {
46866
+ function vo(r7, e) {
46859
46867
  let { type: t, value: n } = r7, { type: i, value: o } = e, s = n?.valueOf(), a2 = o?.valueOf();
46860
- return typeof s == "number" && typeof a2 == "number" ? f(Math.abs(s - a2) < 0.01) : k(s) && k(a2) ? f(Vn(s, a2)) : f(t === "Coding" && i === "Coding" ? typeof s != "object" || typeof a2 != "object" ? false : s.code === a2.code && s.system === a2.system : typeof s == "object" && typeof a2 == "object" ? vr({ ...s, id: void 0 }, { ...a2, id: void 0 }) : typeof s == "string" && typeof a2 == "string" ? s.toLowerCase() === a2.toLowerCase() : s === a2);
46868
+ return typeof s == "number" && typeof a2 == "number" ? f(Math.abs(s - a2) < 0.01) : k(s) && k(a2) ? f(Mn(s, a2)) : f(t === "Coding" && i === "Coding" ? typeof s != "object" || typeof a2 != "object" ? false : s.code === a2.code && s.system === a2.system : typeof s == "object" && typeof a2 == "object" ? vr({ ...s, id: void 0 }, { ...a2, id: void 0 }) : typeof s == "string" && typeof a2 == "string" ? s.toLowerCase() === a2.toLowerCase() : s === a2);
46861
46869
  }
46862
- function bn(r7, e) {
46870
+ function Cn(r7, e) {
46863
46871
  let t = r7.value?.valueOf(), n = e.value?.valueOf();
46864
46872
  return typeof t == "number" && typeof n == "number" ? t - n : typeof t == "string" && typeof n == "string" ? t.localeCompare(n) : 0;
46865
46873
  }
@@ -46873,32 +46881,32 @@ function ot(r7, e) {
46873
46881
  case "Integer":
46874
46882
  return typeof t == "number";
46875
46883
  case "Date":
46876
- return In(t);
46884
+ return Vn(t);
46877
46885
  case "DateTime":
46878
46886
  return Pe(t);
46879
46887
  case "Time":
46880
46888
  return typeof t == "string" && !!/^T\d/.exec(t);
46881
46889
  case "Period":
46882
- return kn(t);
46890
+ return Dn(t);
46883
46891
  case "Quantity":
46884
46892
  return k(t);
46885
46893
  default:
46886
46894
  return typeof t == "object" && t?.resourceType === e;
46887
46895
  }
46888
46896
  }
46889
- function In(r7) {
46897
+ function Vn(r7) {
46890
46898
  return typeof r7 == "string" && !!nt.date.exec(r7);
46891
46899
  }
46892
46900
  function Pe(r7) {
46893
46901
  return typeof r7 == "string" && !!nt.dateTime.exec(r7);
46894
46902
  }
46895
- function kn(r7) {
46903
+ function Dn(r7) {
46896
46904
  return !!(r7 && typeof r7 == "object" && ("start" in r7 && Pe(r7.start) || "end" in r7 && Pe(r7.end)));
46897
46905
  }
46898
46906
  function k(r7) {
46899
46907
  return !!(r7 && typeof r7 == "object" && "value" in r7 && typeof r7.value == "number");
46900
46908
  }
46901
- function Vn(r7, e) {
46909
+ function Mn(r7, e) {
46902
46910
  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);
46903
46911
  }
46904
46912
  function vr(r7, e) {
@@ -46906,27 +46914,27 @@ function vr(r7, e) {
46906
46914
  if (t.length !== n.length) return false;
46907
46915
  for (let i of t) {
46908
46916
  let o = r7[i], s = e[i];
46909
- if (Cn(o) && Cn(s)) {
46917
+ if (wn(o) && wn(s)) {
46910
46918
  if (!vr(o, s)) return false;
46911
46919
  } else if (o !== s) return false;
46912
46920
  }
46913
46921
  return true;
46914
46922
  }
46915
- function Cn(r7) {
46923
+ function wn(r7) {
46916
46924
  return r7 !== null && typeof r7 == "object";
46917
46925
  }
46918
- function Pn(r7, e) {
46926
+ function An(r7, e) {
46919
46927
  if (e) {
46920
46928
  if (typeof e != "object") throw new Error("Primitive extension must be an object");
46921
- return go(r7 ?? {}, e);
46929
+ return xo(r7 ?? {}, e);
46922
46930
  }
46923
46931
  return r7;
46924
46932
  }
46925
- function go(r7, e) {
46933
+ function xo(r7, e) {
46926
46934
  return delete e.__proto__, delete e.constructor, Object.assign(r7, e);
46927
46935
  }
46928
46936
  function te(r7) {
46929
- let e = le(r7), t = xo(r7);
46937
+ let e = le(r7), t = So(r7);
46930
46938
  return t === e ? { reference: e } : { reference: e, display: t };
46931
46939
  }
46932
46940
  function le(r7) {
@@ -46935,16 +46943,16 @@ function le(r7) {
46935
46943
  function pe(r7) {
46936
46944
  if (r7) return ue(r7) ? r7.reference.split("/")[1] : r7.id;
46937
46945
  }
46938
- function vo(r7) {
46946
+ function To(r7) {
46939
46947
  return r7.resourceType === "Patient" || r7.resourceType === "Practitioner" || r7.resourceType === "RelatedPerson";
46940
46948
  }
46941
- function xo(r7) {
46942
- if (vo(r7)) {
46943
- let e = To(r7);
46949
+ function So(r7) {
46950
+ if (To(r7)) {
46951
+ let e = Eo(r7);
46944
46952
  if (e) return e;
46945
46953
  }
46946
46954
  if (r7.resourceType === "Device") {
46947
- let e = So(r7);
46955
+ let e = bo(r7);
46948
46956
  if (e) return e;
46949
46957
  }
46950
46958
  if (r7.resourceType === "MedicationRequest" && r7.medicationCodeableConcept) return at(r7.medicationCodeableConcept);
@@ -46953,16 +46961,16 @@ function xo(r7) {
46953
46961
  if ("name" in r7 && r7.name && typeof r7.name == "string") return r7.name;
46954
46962
  if ("code" in r7 && r7.code) {
46955
46963
  let e = r7.code;
46956
- if (Array.isArray(e) && (e = e[0]), ko(e)) return at(e);
46964
+ if (Array.isArray(e) && (e = e[0]), Tr(e)) return at(e);
46957
46965
  if (Vo(e)) return e.text;
46958
46966
  }
46959
46967
  return le(r7);
46960
46968
  }
46961
- function To(r7) {
46969
+ function Eo(r7) {
46962
46970
  let e = r7.name;
46963
46971
  if (e && e.length > 0) return lt(e[0]);
46964
46972
  }
46965
- function So(r7) {
46973
+ function bo(r7) {
46966
46974
  let e = r7.deviceName;
46967
46975
  if (e && e.length > 0) return e[0].name;
46968
46976
  }
@@ -46971,28 +46979,28 @@ function ct(r7, e) {
46971
46979
  t.setUTCHours(0, 0, 0, 0);
46972
46980
  let n = e ? new Date(e) : /* @__PURE__ */ new Date();
46973
46981
  n.setUTCHours(0, 0, 0, 0);
46974
- let i = t.getUTCFullYear(), o = t.getUTCMonth(), s = t.getUTCDate(), a2 = n.getUTCFullYear(), c = n.getUTCMonth(), u2 = n.getUTCDate(), l2 = a2 - i;
46975
- (c < o || c === o && u2 < s) && l2--;
46982
+ let i = t.getUTCFullYear(), o = t.getUTCMonth(), s = t.getUTCDate(), a2 = n.getUTCFullYear(), c = n.getUTCMonth(), u2 = n.getUTCDate(), p2 = a2 - i;
46983
+ (c < o || c === o && u2 < s) && p2--;
46976
46984
  let m2 = a2 * 12 + c - (i * 12 + o);
46977
46985
  u2 < s && m2--;
46978
46986
  let v = Math.floor((n.getTime() - t.getTime()) / (1e3 * 60 * 60 * 24));
46979
- return { years: l2, months: m2, days: v };
46987
+ return { years: p2, months: m2, days: v };
46980
46988
  }
46981
46989
  function X(r7, ...e) {
46982
46990
  let t = r7;
46983
46991
  for (let n = 0; n < e.length && t; n++) t = t?.extension?.find((i) => i.url === e[n]);
46984
46992
  return t;
46985
46993
  }
46986
- function Nn(r7, e) {
46987
- return JSON.stringify(r7, bo, e ? 2 : void 0);
46994
+ function Fn(r7, e) {
46995
+ return JSON.stringify(r7, Co, e ? 2 : void 0);
46988
46996
  }
46989
- function bo(r7, e) {
46990
- return !Ro(r7) && E(e) ? void 0 : e;
46997
+ function Co(r7, e) {
46998
+ return !Po(r7) && S(e) ? void 0 : e;
46991
46999
  }
46992
- function Ro(r7) {
47000
+ function Po(r7) {
46993
47001
  return !!/\d+$/.exec(r7);
46994
47002
  }
46995
- function E(r7) {
47003
+ function S(r7) {
46996
47004
  if (r7 == null) return true;
46997
47005
  let e = typeof r7;
46998
47006
  return e === "string" || e === "object" ? !K(r7) : false;
@@ -47003,14 +47011,14 @@ function K(r7) {
47003
47011
  return e === "string" && r7 !== "" || e === "object" && ("length" in r7 && r7.length > 0 || Object.keys(r7).length > 0);
47004
47012
  }
47005
47013
  function ee(r7, e, t) {
47006
- return r7 === e || E(r7) && E(e) ? true : E(r7) || E(e) ? false : Array.isArray(r7) && Array.isArray(e) ? Co(r7, e) : Array.isArray(r7) || Array.isArray(e) ? false : R(r7) && R(e) ? Po(r7, e, t) : (R(r7) || R(e), false);
47014
+ return r7 === e || S(r7) && S(e) ? true : S(r7) || S(e) ? false : Array.isArray(r7) && Array.isArray(e) ? wo(r7, e) : Array.isArray(r7) || Array.isArray(e) ? false : R(r7) && R(e) ? Ao(r7, e, t) : (R(r7) || R(e), false);
47007
47015
  }
47008
- function Co(r7, e) {
47016
+ function wo(r7, e) {
47009
47017
  if (r7.length !== e.length) return false;
47010
47018
  for (let t = 0; t < r7.length; t++) if (!ee(r7[t], e[t])) return false;
47011
47019
  return true;
47012
47020
  }
47013
- function Po(r7, e, t) {
47021
+ function Ao(r7, e, t) {
47014
47022
  let n = /* @__PURE__ */ new Set();
47015
47023
  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"));
47016
47024
  for (let i of n) {
@@ -47022,29 +47030,29 @@ function Po(r7, e, t) {
47022
47030
  function R(r7) {
47023
47031
  return r7 !== null && typeof r7 == "object";
47024
47032
  }
47025
- function Ln(r7) {
47026
- return r7.every(Oo);
47033
+ function Un(r7) {
47034
+ return r7.every(ko);
47027
47035
  }
47028
- function Oo(r7) {
47036
+ function ko(r7) {
47029
47037
  return typeof r7 == "string";
47030
47038
  }
47031
- function Io(r7) {
47039
+ function xr(r7) {
47032
47040
  return R(r7) && "code" in r7 && typeof r7.code == "string";
47033
47041
  }
47034
- function ko(r7) {
47035
- return R(r7) && "coding" in r7 && Array.isArray(r7.coding) && r7.coding.every(Io);
47042
+ function Tr(r7) {
47043
+ return R(r7) && "coding" in r7 && Array.isArray(r7.coding) && r7.coding.every(xr);
47036
47044
  }
47037
47045
  function Vo(r7) {
47038
47046
  return R(r7) && "text" in r7 && typeof r7.text == "string";
47039
47047
  }
47040
- var Fn = [];
47041
- for (let r7 = 0; r7 < 256; r7++) Fn.push(r7.toString(16).padStart(2, "0"));
47042
- function Un(r7) {
47048
+ var Bn = [];
47049
+ for (let r7 = 0; r7 < 256; r7++) Bn.push(r7.toString(16).padStart(2, "0"));
47050
+ function qn(r7) {
47043
47051
  let e = new Uint8Array(r7), t = new Array(e.length);
47044
- for (let n = 0; n < e.length; n++) t[n] = Fn[e[n]];
47052
+ for (let n = 0; n < e.length; n++) t[n] = Bn[e[n]];
47045
47053
  return t.join("");
47046
47054
  }
47047
- function Bn(r7) {
47055
+ function jn(r7) {
47048
47056
  let e = new Uint8Array(r7), t = [];
47049
47057
  for (let n = 0; n < e.length; n++) t[n] = String.fromCharCode(e[n]);
47050
47058
  return window.btoa(t.join(""));
@@ -47052,25 +47060,25 @@ function Bn(r7) {
47052
47060
  function w(r7) {
47053
47061
  return r7 ? r7.charAt(0).toUpperCase() + r7.substring(1) : "";
47054
47062
  }
47055
- var Sr = (r7) => new Promise((e) => {
47063
+ var br = (r7) => new Promise((e) => {
47056
47064
  setTimeout(e, r7);
47057
47065
  });
47058
47066
  function ut(r7) {
47059
47067
  return r7.sort((e, t) => e.localeCompare(t));
47060
47068
  }
47061
- function br(r7) {
47069
+ function Cr(r7) {
47062
47070
  return r7.endsWith("/") ? r7 : r7 + "/";
47063
47071
  }
47064
47072
  function Fo(r7) {
47065
47073
  return r7.startsWith("/") ? r7.slice(1) : r7;
47066
47074
  }
47067
47075
  function B(r7, e) {
47068
- return new URL(Fo(e), br(r7.toString())).toString();
47076
+ return new URL(Fo(e), Cr(r7.toString())).toString();
47069
47077
  }
47070
- function Wn(r7, e) {
47078
+ function Hn(r7, e) {
47071
47079
  return B(r7, e).toString().replace("http://", "ws://").replace("https://", "wss://");
47072
47080
  }
47073
- function Gn(r7) {
47081
+ function Qn(r7) {
47074
47082
  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();
47075
47083
  }
47076
47084
  var Uo = /^(([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])$/;
@@ -47101,14 +47109,14 @@ function Go(r7, e) {
47101
47109
  function me(r7) {
47102
47110
  return typeof r7 == "string" ? r7 : void 0;
47103
47111
  }
47104
- 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" };
47105
- function zn(r7) {
47112
+ var l = { 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" };
47113
+ function Yn(r7) {
47106
47114
  let e = L.types[r7];
47107
47115
  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;
47108
47116
  }
47109
- function Pr(r7) {
47117
+ function Ar(r7) {
47110
47118
  for (let e of r7.base ?? []) {
47111
- let t = zn(e);
47119
+ let t = Yn(e);
47112
47120
  t.searchParams || (t.searchParams = {}), t.searchParams[r7.code] = r7;
47113
47121
  }
47114
47122
  }
@@ -47151,7 +47159,7 @@ function Oe(r7) {
47151
47159
  }
47152
47160
  }
47153
47161
  var z = () => [];
47154
- var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => E(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) => !E(n.value))), all: (r7, e, t) => f(e.every((n) => N(t.eval(r7, [n])))), allTrue: (r7, e) => {
47162
+ 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) => {
47155
47163
  for (let t of e) if (!t.value) return f(false);
47156
47164
  return f(true);
47157
47165
  }, anyTrue: (r7, e) => {
@@ -47170,7 +47178,7 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => E(t.value))), has
47170
47178
  }, supersetOf: (r7, e, t) => {
47171
47179
  let n = t.eval(r7, he(r7));
47172
47180
  return n.length === 0 ? f(true) : e.length === 0 ? f(false) : f(n.every((i) => e.some((o) => o.value === i.value)));
47173
- }, count: (r7, e) => [{ type: p.integer, value: e.length }], distinct: (r7, e) => {
47181
+ }, count: (r7, e) => [{ type: l.integer, value: e.length }], distinct: (r7, e) => {
47174
47182
  let t = [];
47175
47183
  for (let n of e) t.some((i) => i.value === n.value) || t.push(n);
47176
47184
  return t;
@@ -47210,7 +47218,7 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => E(t.value))), has
47210
47218
  }, toBoolean: (r7, e) => {
47211
47219
  if (e.length === 0) return [];
47212
47220
  let [{ value: t }] = G(e, 1);
47213
- if (typeof t == "boolean") return [{ type: p.boolean, value: t }];
47221
+ if (typeof t == "boolean") return [{ type: l.boolean, value: t }];
47214
47222
  if (typeof t == "number" && (t === 0 || t === 1)) return f(!!t);
47215
47223
  if (typeof t == "string") {
47216
47224
  let n = t.toLowerCase();
@@ -47221,33 +47229,33 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => E(t.value))), has
47221
47229
  }, convertsToBoolean: (r7, e) => e.length === 0 ? [] : f(O.toBoolean(r7, e).length === 1), toInteger: (r7, e) => {
47222
47230
  if (e.length === 0) return [];
47223
47231
  let [{ value: t }] = G(e, 1);
47224
- 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 }] : [];
47232
+ return typeof t == "number" ? [{ type: l.integer, value: t }] : typeof t == "string" && /^[+-]?\d+$/.exec(t) ? [{ type: l.integer, value: parseInt(t, 10) }] : typeof t == "boolean" ? [{ type: l.integer, value: t ? 1 : 0 }] : [];
47225
47233
  }, convertsToInteger: (r7, e) => e.length === 0 ? [] : f(O.toInteger(r7, e).length === 1), toDate: (r7, e) => {
47226
47234
  if (e.length === 0) return [];
47227
47235
  let [{ value: t }] = G(e, 1);
47228
- return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: p.date, value: Oe(t) }] : [];
47236
+ return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.date, value: Oe(t) }] : [];
47229
47237
  }, convertsToDate: (r7, e) => e.length === 0 ? [] : f(O.toDate(r7, e).length === 1), toDateTime: (r7, e) => {
47230
47238
  if (e.length === 0) return [];
47231
47239
  let [{ value: t }] = G(e, 1);
47232
- return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: p.dateTime, value: Oe(t) }] : [];
47240
+ return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.dateTime, value: Oe(t) }] : [];
47233
47241
  }, convertsToDateTime: (r7, e) => e.length === 0 ? [] : f(O.toDateTime(r7, e).length === 1), toDecimal: (r7, e) => {
47234
47242
  if (e.length === 0) return [];
47235
47243
  let [{ value: t }] = G(e, 1);
47236
- 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 }] : [];
47244
+ return typeof t == "number" ? [{ type: l.decimal, value: t }] : typeof t == "string" && /^-?\d{1,9}(\.\d{1,9})?$/.exec(t) ? [{ type: l.decimal, value: parseFloat(t) }] : typeof t == "boolean" ? [{ type: l.decimal, value: t ? 1 : 0 }] : [];
47237
47245
  }, convertsToDecimal: (r7, e) => e.length === 0 ? [] : f(O.toDecimal(r7, e).length === 1), toQuantity: (r7, e) => {
47238
47246
  if (e.length === 0) return [];
47239
47247
  let [{ value: t }] = G(e, 1);
47240
- return k(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" } }] : [];
47248
+ return k(t) ? [{ type: l.Quantity, value: t }] : typeof t == "number" ? [{ type: l.Quantity, value: { value: t, unit: "1" } }] : typeof t == "string" && /^-?\d{1,9}(\.\d{1,9})?/.exec(t) ? [{ type: l.Quantity, value: { value: parseFloat(t), unit: "1" } }] : typeof t == "boolean" ? [{ type: l.Quantity, value: { value: t ? 1 : 0, unit: "1" } }] : [];
47241
47249
  }, convertsToQuantity: (r7, e) => e.length === 0 ? [] : f(O.toQuantity(r7, e).length === 1), toString: (r7, e) => {
47242
47250
  if (e.length === 0) return [];
47243
47251
  let [{ value: t }] = G(e, 1);
47244
- return t == null ? [] : k(t) ? [{ type: p.string, value: `${t.value} '${t.unit}'` }] : [{ type: p.string, value: t.toString() }];
47252
+ return t == null ? [] : k(t) ? [{ type: l.string, value: `${t.value} '${t.unit}'` }] : [{ type: l.string, value: t.toString() }];
47245
47253
  }, convertsToString: (r7, e) => e.length === 0 ? [] : f(O.toString(r7, e).length === 1), toTime: (r7, e) => {
47246
47254
  if (e.length === 0) return [];
47247
47255
  let [{ value: t }] = G(e, 1);
47248
47256
  if (typeof t == "string") {
47249
47257
  let n = /^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(t);
47250
- if (n) return [{ type: p.time, value: Oe("T" + n[1]) }];
47258
+ if (n) return [{ type: l.time, value: Oe("T" + n[1]) }];
47251
47259
  }
47252
47260
  return [];
47253
47261
  }, 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) => {
@@ -47256,8 +47264,8 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => E(t.value))), has
47256
47264
  }, 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: z, decode: z, escape: z, unescape: z, trim: z, split: z, join: (r7, e, t) => {
47257
47265
  let n = t?.eval(r7, he(r7))[0]?.value ?? "";
47258
47266
  if (typeof n != "string") throw new Error("Separator must be a string.");
47259
- return [{ type: p.string, value: e.map((i) => i.value?.toString() ?? "").join(n) }];
47260
- }, abs: (r7, e) => W(Math.abs, r7, e), ceiling: (r7, e) => W(Math.ceil, r7, e), exp: (r7, e) => W(Math.exp, r7, e), floor: (r7, e) => W(Math.floor, r7, e), ln: (r7, e) => W(Math.log, r7, e), log: (r7, e, t) => W((n, i) => Math.log(n) / Math.log(i), r7, e, t), power: (r7, e, t) => W(Math.pow, r7, e, t), round: (r7, e) => W(Math.round, r7, e), sqrt: (r7, e) => W(Math.sqrt, r7, e), truncate: (r7, e) => W((t) => t | 0, r7, e), children: z, descendants: z, 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) => {
47267
+ return [{ type: l.string, value: e.map((i) => i.value?.toString() ?? "").join(n) }];
47268
+ }, abs: (r7, e) => W(Math.abs, r7, e), ceiling: (r7, e) => W(Math.ceil, r7, e), exp: (r7, e) => W(Math.exp, r7, e), floor: (r7, e) => W(Math.floor, r7, e), ln: (r7, e) => W(Math.log, r7, e), log: (r7, e, t) => W((n, i) => Math.log(n) / Math.log(i), r7, e, t), power: (r7, e, t) => W(Math.pow, r7, e, t), round: (r7, e) => W(Math.round, r7, e), sqrt: (r7, e) => W(Math.sqrt, r7, e), truncate: (r7, e) => W((t) => t | 0, r7, e), children: z, descendants: z, trace: (r7, e, t) => e, now: () => [{ type: l.dateTime, value: (/* @__PURE__ */ new Date()).toISOString() }], timeOfDay: () => [{ type: l.time, value: (/* @__PURE__ */ new Date()).toISOString().substring(11) }], today: () => [{ type: l.date, value: (/* @__PURE__ */ new Date()).toISOString().substring(0, 10) }], between: (r7, e, t, n, i) => {
47261
47269
  let o = O.toDateTime(r7, t.eval(r7, e));
47262
47270
  if (o.length === 0) throw new Error("Invalid start date");
47263
47271
  let s = O.toDateTime(r7, n.eval(r7, e));
@@ -47265,11 +47273,11 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => E(t.value))), has
47265
47273
  let a2 = i.eval(r7, e)[0]?.value;
47266
47274
  if (a2 !== "years" && a2 !== "months" && a2 !== "days") throw new Error("Invalid units");
47267
47275
  let c = ct(o[0].value, s[0].value);
47268
- return [{ type: p.Quantity, value: { value: c[a2], unit: a2 } }];
47276
+ return [{ type: l.Quantity, value: { value: c[a2], unit: a2 } }];
47269
47277
  }, is: (r7, e, t) => {
47270
47278
  let n = "";
47271
- return t instanceof q ? n = t.name : t instanceof re && (n = t.left.name + "." + t.right.name), n ? e.map((i) => ({ type: p.boolean, value: ot(i, n) })) : [];
47272
- }, not: (r7, e) => O.toBoolean(r7, e).map((t) => ({ type: p.boolean, value: !t.value })), resolve: (r7, e) => e.map((t) => {
47279
+ return t instanceof q ? n = t.name : t instanceof re && (n = t.left.name + "." + t.right.name), n ? e.map((i) => ({ type: l.boolean, value: ot(i, n) })) : [];
47280
+ }, not: (r7, e) => O.toBoolean(r7, e).map((t) => ({ type: l.boolean, value: !t.value })), resolve: (r7, e) => e.map((t) => {
47273
47281
  let n = t.value, i;
47274
47282
  if (typeof n == "string") i = n;
47275
47283
  else if (typeof n == "object") {
@@ -47285,25 +47293,25 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => E(t.value))), has
47285
47293
  let [o, s] = i.split("/");
47286
47294
  return { type: o, value: { resourceType: o, id: s } };
47287
47295
  }
47288
- return { type: p.BackboneElement, value: void 0 };
47289
- }).filter((t) => !!t.value), as: (r7, e) => e, type: (r7, e) => e.map(({ value: t }) => typeof t == "boolean" ? { type: p.BackboneElement, value: { namespace: "System", name: "Boolean" } } : typeof t == "number" ? { type: p.BackboneElement, value: { namespace: "System", name: "Integer" } } : I(t) ? { type: p.BackboneElement, value: { namespace: "FHIR", name: t.resourceType } } : { type: p.BackboneElement, value: null }), conformsTo: (r7, e, t) => {
47296
+ return { type: l.BackboneElement, value: void 0 };
47297
+ }).filter((t) => !!t.value), as: (r7, e) => e, type: (r7, e) => e.map(({ value: t }) => typeof t == "boolean" ? { type: l.BackboneElement, value: { namespace: "System", name: "Boolean" } } : typeof t == "number" ? { type: l.BackboneElement, value: { namespace: "System", name: "Integer" } } : I(t) ? { type: l.BackboneElement, value: { namespace: "FHIR", name: t.resourceType } } : { type: l.BackboneElement, value: null }), conformsTo: (r7, e, t) => {
47290
47298
  let n = t.eval(r7, e)[0].value;
47291
47299
  if (!n.startsWith("http://hl7.org/fhir/StructureDefinition/")) throw new Error("Expected a StructureDefinition URL");
47292
47300
  let i = n.replace("http://hl7.org/fhir/StructureDefinition/", "");
47293
- return e.map((o) => ({ type: p.boolean, value: o.value?.resourceType === i }));
47301
+ return e.map((o) => ({ type: l.boolean, value: o.value?.resourceType === i }));
47294
47302
  }, getResourceKey: (r7, e) => {
47295
47303
  let t = e[0].value;
47296
- return t?.id ? [{ type: p.id, value: t.id }] : [];
47304
+ return t?.id ? [{ type: l.id, value: t.id }] : [];
47297
47305
  }, getReferenceKey: (r7, e, t) => {
47298
47306
  let n = e[0].value;
47299
47307
  if (!n?.reference) return [];
47300
47308
  let i = "";
47301
- return t instanceof q && (i = t.name), i && !n.reference.startsWith(i + "/") ? [] : [{ type: p.id, value: pe(n) }];
47309
+ return t instanceof q && (i = t.name), i && !n.reference.startsWith(i + "/") ? [] : [{ type: l.id, value: pe(n) }];
47302
47310
  }, extension: (r7, e, t) => {
47303
47311
  let n = t.eval(r7, e)[0].value, i = e?.[0]?.value;
47304
47312
  if (i) {
47305
47313
  let o = X(i, n);
47306
- if (o) return [{ type: p.Extension, value: o }];
47314
+ if (o) return [{ type: l.Extension, value: o }];
47307
47315
  }
47308
47316
  return [];
47309
47317
  } };
@@ -47318,7 +47326,7 @@ function W(r7, e, t, ...n) {
47318
47326
  if (t.length === 0) return [];
47319
47327
  let [{ value: i }] = G(t, 1), o = k(i), s = o ? i.value : i;
47320
47328
  if (typeof s != "number") throw new Error("Math function cannot be called with non-number");
47321
- 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;
47329
+ let a2 = r7(s, ...n.map((p2) => p2.eval(e, t)[0]?.value)), c = o ? l.Quantity : t[0].type, u2 = o ? { ...i, value: a2 } : a2;
47322
47330
  return [{ type: c, value: u2 }];
47323
47331
  }
47324
47332
  function G(r7, e) {
@@ -47407,8 +47415,8 @@ var V = class extends C {
47407
47415
  if (i.length !== 1) return [];
47408
47416
  let o = this.right.eval(t, n);
47409
47417
  if (o.length !== 1) return [];
47410
- let s = i[0].value, a2 = o[0].value, c = k(s) ? s.value : s, u2 = k(a2) ? a2.value : a2, l2 = this.impl(c, u2);
47411
- return typeof l2 == "boolean" ? f(l2) : k(s) ? [{ type: p.Quantity, value: { ...s, value: l2 } }] : [g(l2)];
47418
+ let s = i[0].value, a2 = o[0].value, c = k(s) ? s.value : s, u2 = k(a2) ? a2.value : a2, p2 = this.impl(c, u2);
47419
+ return typeof p2 == "boolean" ? f(p2) : k(s) ? [{ type: l.Quantity, value: { ...s, value: p2 } }] : [g(p2)];
47412
47420
  }
47413
47421
  };
47414
47422
  var mt = class extends Y {
@@ -47417,7 +47425,7 @@ var mt = class extends Y {
47417
47425
  }
47418
47426
  eval(e, t) {
47419
47427
  let n = this.left.eval(e, t), i = this.right.eval(e, t), o = [...n, ...i];
47420
- return o.length > 0 && o.every((s) => typeof s.value == "string") ? [{ type: p.string, value: o.map((s) => s.value).join("") }] : o;
47428
+ return o.length > 0 && o.every((s) => typeof s.value == "string") ? [{ type: l.string, value: o.map((s) => s.value).join("") }] : o;
47421
47429
  }
47422
47430
  };
47423
47431
  var ht = class extends C {
@@ -47464,7 +47472,7 @@ var gt = class extends C {
47464
47472
  }
47465
47473
  eval(e, t) {
47466
47474
  let n = this.left.eval(e, t), i = this.right.eval(e, t);
47467
- return An(n, i);
47475
+ return In(n, i);
47468
47476
  }
47469
47477
  };
47470
47478
  var vt = class extends C {
@@ -47473,7 +47481,7 @@ var vt = class extends C {
47473
47481
  }
47474
47482
  eval(e, t) {
47475
47483
  let n = this.left.eval(e, t), i = this.right.eval(e, t);
47476
- return On(n, i);
47484
+ return kn(n, i);
47477
47485
  }
47478
47486
  };
47479
47487
  var xt = class extends C {
@@ -47491,7 +47499,7 @@ var Tt = class extends C {
47491
47499
  }
47492
47500
  eval(e, t) {
47493
47501
  let n = this.left.eval(e, t), i = this.right.eval(e, t);
47494
- return wn(gr(n, i));
47502
+ return On(gr(n, i));
47495
47503
  }
47496
47504
  };
47497
47505
  var ge = class extends C {
@@ -47595,13 +47603,13 @@ function os(r7) {
47595
47603
  return n?.startsWith("'") && n.endsWith("'") ? n = n.substring(1, n.length - 1) : n = "{" + n + "}", { value: t, unit: n };
47596
47604
  }
47597
47605
  function je() {
47598
- 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: Oe(e.value) }) }).registerPrefix("Quantity", { parse: (r7, e) => new U({ type: p.Quantity, value: os(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 q(e.value) }).registerPrefix("{}", { parse: () => new dt() }).registerPrefix("(", rs).registerInfix("[", ns).registerInfix("(", is).prefix("+", y.UnaryAdd, (r7, e) => new ft("+", e, (t) => t)).prefix("-", y.UnarySubtract, (r7, e) => new V("-", e, e, (t, n) => -n)).infixLeft(".", y.Dot, (r7, e, t) => new re(r7, t)).infixLeft("/", y.Divide, (r7, e, t) => new V("/", r7, t, (n, i) => n / i)).infixLeft("*", y.Multiply, (r7, e, t) => new V("*", r7, t, (n, i) => n * i)).infixLeft("+", y.Add, (r7, e, t) => new V("+", r7, t, (n, i) => n + i)).infixLeft("-", y.Subtract, (r7, e, t) => new V("-", r7, t, (n, i) => n - i)).infixLeft("|", y.Union, (r7, e, t) => new Ie(r7, t)).infixLeft("=", y.Equals, (r7, e, t) => new gt(r7, t)).infixLeft("!=", y.NotEquals, (r7, e, t) => new vt(r7, t)).infixLeft("~", y.Equivalent, (r7, e, t) => new xt(r7, t)).infixLeft("!~", y.NotEquivalent, (r7, e, t) => new Tt(r7, t)).infixLeft("<", y.LessThan, (r7, e, t) => new V("<", r7, t, (n, i) => n < i)).infixLeft("<=", y.LessThanOrEquals, (r7, e, t) => new V("<=", r7, t, (n, i) => n <= i)).infixLeft(">", y.GreaterThan, (r7, e, t) => new V(">", r7, t, (n, i) => n > i)).infixLeft(">=", y.GreaterThanOrEquals, (r7, e, t) => new V(">=", r7, t, (n, i) => n >= i)).infixLeft("&", y.Ampersand, (r7, e, t) => new mt(r7, t)).infixLeft("and", y.And, (r7, e, t) => new St(r7, t)).infixLeft("as", y.As, (r7, e, t) => new ye(r7, t)).infixLeft("contains", y.Contains, (r7, e, t) => new ht(r7, t)).infixLeft("div", y.Divide, (r7, e, t) => new V("div", r7, t, (n, i) => n / i | 0)).infixLeft("in", y.In, (r7, e, t) => new yt(r7, t)).infixLeft("is", y.Is, (r7, e, t) => new ge(r7, t)).infixLeft("mod", y.Modulo, (r7, e, t) => new V("mod", r7, t, (n, i) => n % i)).infixLeft("or", y.Or, (r7, e, t) => new Et(r7, t)).infixLeft("xor", y.Xor, (r7, e, t) => new bt(r7, t)).infixLeft("implies", y.Implies, (r7, e, t) => new Rt(r7, t));
47606
+ return new Je().registerPrefix("String", { parse: (r7, e) => new U({ type: l.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r7, e) => new U({ type: l.dateTime, value: Oe(e.value) }) }).registerPrefix("Quantity", { parse: (r7, e) => new U({ type: l.Quantity, value: os(e.value) }) }).registerPrefix("Number", { parse: (r7, e) => new U({ type: e.value.includes(".") ? l.decimal : l.integer, value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new U({ type: l.boolean, value: true }) }).registerPrefix("false", { parse: () => new U({ type: l.boolean, value: false }) }).registerPrefix("Symbol", { parse: (r7, e) => new q(e.value) }).registerPrefix("{}", { parse: () => new dt() }).registerPrefix("(", rs).registerInfix("[", ns).registerInfix("(", is).prefix("+", y.UnaryAdd, (r7, e) => new ft("+", e, (t) => t)).prefix("-", y.UnarySubtract, (r7, e) => new V("-", e, e, (t, n) => -n)).infixLeft(".", y.Dot, (r7, e, t) => new re(r7, t)).infixLeft("/", y.Divide, (r7, e, t) => new V("/", r7, t, (n, i) => n / i)).infixLeft("*", y.Multiply, (r7, e, t) => new V("*", r7, t, (n, i) => n * i)).infixLeft("+", y.Add, (r7, e, t) => new V("+", r7, t, (n, i) => n + i)).infixLeft("-", y.Subtract, (r7, e, t) => new V("-", r7, t, (n, i) => n - i)).infixLeft("|", y.Union, (r7, e, t) => new Ie(r7, t)).infixLeft("=", y.Equals, (r7, e, t) => new gt(r7, t)).infixLeft("!=", y.NotEquals, (r7, e, t) => new vt(r7, t)).infixLeft("~", y.Equivalent, (r7, e, t) => new xt(r7, t)).infixLeft("!~", y.NotEquivalent, (r7, e, t) => new Tt(r7, t)).infixLeft("<", y.LessThan, (r7, e, t) => new V("<", r7, t, (n, i) => n < i)).infixLeft("<=", y.LessThanOrEquals, (r7, e, t) => new V("<=", r7, t, (n, i) => n <= i)).infixLeft(">", y.GreaterThan, (r7, e, t) => new V(">", r7, t, (n, i) => n > i)).infixLeft(">=", y.GreaterThanOrEquals, (r7, e, t) => new V(">=", r7, t, (n, i) => n >= i)).infixLeft("&", y.Ampersand, (r7, e, t) => new mt(r7, t)).infixLeft("and", y.And, (r7, e, t) => new St(r7, t)).infixLeft("as", y.As, (r7, e, t) => new ye(r7, t)).infixLeft("contains", y.Contains, (r7, e, t) => new ht(r7, t)).infixLeft("div", y.Divide, (r7, e, t) => new V("div", r7, t, (n, i) => n / i | 0)).infixLeft("in", y.In, (r7, e, t) => new yt(r7, t)).infixLeft("is", y.Is, (r7, e, t) => new ge(r7, t)).infixLeft("mod", y.Modulo, (r7, e, t) => new V("mod", r7, t, (n, i) => n % i)).infixLeft("or", y.Or, (r7, e, t) => new Et(r7, t)).infixLeft("xor", y.Xor, (r7, e, t) => new bt(r7, t)).infixLeft("implies", y.Implies, (r7, e, t) => new Rt(r7, t));
47599
47607
  }
47600
47608
  var ss = je();
47601
- var Zn = ((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))(Zn || {});
47602
- var ii = ((T) => (T.EQUALS = "eq", T.NOT_EQUALS = "ne", T.GREATER_THAN = "gt", T.LESS_THAN = "lt", T.GREATER_THAN_OR_EQUALS = "ge", T.LESS_THAN_OR_EQUALS = "le", T.STARTS_AFTER = "sa", T.ENDS_BEFORE = "eb", T.APPROXIMATELY = "ap", T.CONTAINS = "contains", T.EXACT = "exact", T.TEXT = "text", T.NOT = "not", T.ABOVE = "above", T.BELOW = "below", T.IN = "in", T.NOT_IN = "not-in", T.OF_TYPE = "of-type", T.MISSING = "missing", T.PRESENT = "present", T.IDENTIFIER = "identifier", T.ITERATE = "iterate", T))(ii || {});
47609
+ var ei = ((p2) => (p2.BOOLEAN = "BOOLEAN", p2.NUMBER = "NUMBER", p2.QUANTITY = "QUANTITY", p2.TEXT = "TEXT", p2.REFERENCE = "REFERENCE", p2.CANONICAL = "CANONICAL", p2.DATE = "DATE", p2.DATETIME = "DATETIME", p2.PERIOD = "PERIOD", p2.UUID = "UUID", p2))(ei || {});
47610
+ var si = ((T) => (T.EQUALS = "eq", T.NOT_EQUALS = "ne", T.GREATER_THAN = "gt", T.LESS_THAN = "lt", T.GREATER_THAN_OR_EQUALS = "ge", T.LESS_THAN_OR_EQUALS = "le", T.STARTS_AFTER = "sa", T.ENDS_BEFORE = "eb", T.APPROXIMATELY = "ap", T.CONTAINS = "contains", T.EXACT = "exact", T.TEXT = "text", T.NOT = "not", T.ABOVE = "above", T.BELOW = "below", T.IN = "in", T.NOT_IN = "not-in", T.OF_TYPE = "of-type", T.MISSING = "missing", T.PRESENT = "present", T.IDENTIFIER = "identifier", T.ITERATE = "iterate", T))(si || {});
47603
47611
  var _s = ((b2) => (b2.READ = "read", b2.VREAD = "vread", b2.UPDATE = "update", b2.PATCH = "patch", b2.DELETE = "delete", b2.HISTORY = "history", b2.HISTORY_INSTANCE = "history-instance", b2.HISTORY_TYPE = "history-type", b2.HISTORY_SYSTEM = "history-system", b2.CREATE = "create", b2.SEARCH = "search", b2.SEARCH_TYPE = "search-type", b2.SEARCH_SYSTEM = "search-system", b2.SEARCH_COMPARTMENT = "search-compartment", b2.CAPABILITIES = "capabilities", b2.TRANSACTION = "transaction", b2.BATCH = "batch", b2.OPERATION = "operation", b2))(_s || {});
47604
- function ci(r7) {
47612
+ function li(r7) {
47605
47613
  if (typeof window < "u") {
47606
47614
  let e = window.atob(r7), t = Uint8Array.from(e, (n) => n.charCodeAt(0));
47607
47615
  return new window.TextDecoder().decode(t);
@@ -47609,7 +47617,7 @@ function ci(r7) {
47609
47617
  if (typeof Buffer < "u") return Buffer.from(r7, "base64").toString("utf-8");
47610
47618
  throw new Error("Unable to decode base64");
47611
47619
  }
47612
- function ui(r7) {
47620
+ function pi(r7) {
47613
47621
  if (typeof window < "u") {
47614
47622
  let e = new window.TextEncoder().encode(r7), t = String.fromCharCode.apply(null, e);
47615
47623
  return window.btoa(t);
@@ -47617,11 +47625,11 @@ function ui(r7) {
47617
47625
  if (typeof Buffer < "u") return Buffer.from(r7, "utf8").toString("base64");
47618
47626
  throw new Error("Unable to encode base64");
47619
47627
  }
47620
- function Dr() {
47628
+ function _r() {
47621
47629
  let r7 = new Uint32Array(28);
47622
- return crypto.getRandomValues(r7), Un(r7.buffer);
47630
+ return crypto.getRandomValues(r7), qn(r7.buffer);
47623
47631
  }
47624
- async function li(r7) {
47632
+ async function di(r7) {
47625
47633
  return crypto.subtle.digest("SHA-256", new TextEncoder().encode(r7));
47626
47634
  }
47627
47635
  function xe() {
@@ -47655,7 +47663,7 @@ var At = class {
47655
47663
  }
47656
47664
  };
47657
47665
  var D = { 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" };
47658
- var Mr = class {
47666
+ var Nr = class {
47659
47667
  constructor() {
47660
47668
  this.listeners = {};
47661
47669
  }
@@ -47682,7 +47690,7 @@ var Mr = class {
47682
47690
  };
47683
47691
  var H = class {
47684
47692
  constructor() {
47685
- this.emitter = new Mr();
47693
+ this.emitter = new Nr();
47686
47694
  }
47687
47695
  dispatchEvent(e) {
47688
47696
  this.emitter.dispatchEvent(e);
@@ -47697,35 +47705,35 @@ var H = class {
47697
47705
  this.emitter.removeAllListeners();
47698
47706
  }
47699
47707
  };
47700
- var _r = { "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" };
47708
+ 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" };
47701
47709
  var Ws = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
47702
- var Nr = ["DiagnosticReport-update"];
47703
- function fi(r7) {
47704
- return Nr.includes(r7);
47710
+ var Fr = ["DiagnosticReport-update"];
47711
+ function hi(r7) {
47712
+ return Fr.includes(r7);
47705
47713
  }
47706
- function mi(r7) {
47707
- if (Nr.includes(r7)) throw new d(h(`'context.version' is required for '${r7}'.`));
47714
+ function yi(r7) {
47715
+ if (Fr.includes(r7)) throw new d(h(`'context.version' is required for '${r7}'.`));
47708
47716
  }
47709
47717
  var Gs = { "Patient-open": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "Patient-close": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "ImagingStudy-open": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "ImagingStudy-close": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "Encounter-open": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "Encounter-close": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "DiagnosticReport-open": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-close": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-select": { report: { resourceType: "DiagnosticReport" }, select: { resourceType: "*", isArray: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport" }, patient: { resourceType: "Patient", optional: true }, study: { resourceType: "ImagingStudy", optional: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
47710
47718
  function Hs(r7) {
47711
47719
  return Ws.includes(r7);
47712
47720
  }
47713
- function hi(r7) {
47721
+ function gi(r7) {
47714
47722
  return !!r7.endpoint;
47715
47723
  }
47716
- function Lr(r7) {
47724
+ function Ur(r7) {
47717
47725
  if (!It(r7)) throw new d(h("subscriptionRequest must be an object conforming to SubscriptionRequest type."));
47718
47726
  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(",") };
47719
- return hi(r7) && (o.endpoint = r7.endpoint), new URLSearchParams(o).toString();
47727
+ return gi(r7) && (o.endpoint = r7.endpoint), new URLSearchParams(o).toString();
47720
47728
  }
47721
47729
  function It(r7) {
47722
47730
  if (typeof r7 != "object") return false;
47723
47731
  let { channelType: e, mode: t, topic: n, events: i } = r7;
47724
47732
  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;
47725
- for (let o of i) if (!_r[o]) return false;
47726
- return !(hi(r7) && !(typeof r7.endpoint == "string" && r7.endpoint.startsWith("ws")));
47733
+ for (let o of i) if (!Lr[o]) return false;
47734
+ return !(gi(r7) && !(typeof r7.endpoint == "string" && r7.endpoint.startsWith("ws")));
47727
47735
  }
47728
- function di(r7, e, t, n) {
47736
+ function mi(r7, e, t, n) {
47729
47737
  if (typeof e != "object") throw new d(h(`context[${t}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));
47730
47738
  if (!(e.id && typeof e.id == "string")) throw new d(h(`context[${t}] is invalid. Resource must contain a valid string ID.`));
47731
47739
  if (!e.resourceType) throw new d(h(`context[${t}] is invalid. Resource must contain a resource type. No resource type found.`));
@@ -47736,11 +47744,11 @@ function di(r7, e, t, n) {
47736
47744
  }
47737
47745
  }
47738
47746
  function Qs(r7, e, t, n, i) {
47739
- if (i.set(e.key, (i.get(e.key) ?? 0) + 1), !n.isArray) di(r7, e.resource, t, n);
47747
+ if (i.set(e.key, (i.get(e.key) ?? 0) + 1), !n.isArray) mi(r7, e.resource, t, n);
47740
47748
  else {
47741
47749
  let { resources: o } = e;
47742
47750
  if (!o) throw new d(h(`context[${t}] is invalid. context[${t}] for the '${r7}' with key '${String(e.key)}' should contain an array of resources on the key 'resources'.`));
47743
- for (let s of o) di(r7, s, t, n);
47751
+ for (let s of o) mi(r7, s, t, n);
47744
47752
  }
47745
47753
  }
47746
47754
  function Ks(r7, e) {
@@ -47755,11 +47763,11 @@ function Ks(r7, e) {
47755
47763
  if (!o.manyAllowed && (t.get(i) || 0) > 1) throw new d(h(`${t.get(i)} context entries with key '${i}' found for the '${r7}' event when schema only allows for 1.`));
47756
47764
  }
47757
47765
  }
47758
- function Fr(r7, e, t, n) {
47766
+ function Br(r7, e, t, n) {
47759
47767
  if (!(r7 && typeof r7 == "string")) throw new d(h("Must provide a topic."));
47760
- if (!_r[e]) throw new d(h(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(_r).join(", ")}`));
47768
+ if (!Lr[e]) throw new d(h(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Lr).join(", ")}`));
47761
47769
  if (typeof t != "object") throw new d(h("context must be a context object or array of context objects."));
47762
- if (Nr.includes(e) && !n) throw new d(h(`The '${e}' event must contain a 'context.versionId'.`));
47770
+ if (Fr.includes(e) && !n) throw new d(h(`The '${e}' event must contain a 'context.versionId'.`));
47763
47771
  let i = Array.isArray(t) ? t : [t];
47764
47772
  return Ks(e, i), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: xe(), event: { "hub.topic": r7, "hub.event": e, context: i, ...n ? { "context.versionId": n } : {} } };
47765
47773
  }
@@ -47784,27 +47792,27 @@ var Ot = class extends H {
47784
47792
  }
47785
47793
  };
47786
47794
  function zs(r7) {
47787
- let e = r7.replace(/-/g, "+").replace(/_/g, "/"), t = ci(e), n = Array.from(t).reduce((o, s) => {
47795
+ let e = r7.replace(/-/g, "+").replace(/_/g, "/"), t = li(e), n = Array.from(t).reduce((o, s) => {
47788
47796
  let a2 = ("00" + s.charCodeAt(0).toString(16)).slice(-2);
47789
47797
  return `${o}%${a2}`;
47790
47798
  }, ""), i = decodeURIComponent(n);
47791
47799
  return JSON.parse(i);
47792
47800
  }
47793
- function yi(r7) {
47801
+ function vi(r7) {
47794
47802
  return r7.split(".").length === 3;
47795
47803
  }
47796
47804
  function kt(r7) {
47797
47805
  let [e, t, n] = r7.split(".");
47798
47806
  return zs(t);
47799
47807
  }
47800
- function gi(r7) {
47808
+ function xi(r7) {
47801
47809
  try {
47802
47810
  return typeof kt(r7).login_id == "string";
47803
47811
  } catch {
47804
47812
  return false;
47805
47813
  }
47806
47814
  }
47807
- function vi(r7) {
47815
+ function Ti(r7) {
47808
47816
  try {
47809
47817
  let t = kt(r7).exp;
47810
47818
  return typeof t == "number" ? t * 1e3 : void 0;
@@ -47826,11 +47834,11 @@ var Vt = class {
47826
47834
  await this.medplum.delete(`keyvalue/v1/${e}`);
47827
47835
  }
47828
47836
  };
47829
- var xi;
47830
- xi = Symbol.toStringTag;
47837
+ var Si;
47838
+ Si = Symbol.toStringTag;
47831
47839
  var M = class {
47832
47840
  constructor(e) {
47833
- this[xi] = "ReadablePromise";
47841
+ this[Si] = "ReadablePromise";
47834
47842
  this.status = "pending";
47835
47843
  this.suspender = e.then((t) => (this.status = "success", this.response = t, t), (t) => {
47836
47844
  throw this.status = "error", this.error = t, t;
@@ -47864,7 +47872,7 @@ var M = class {
47864
47872
  };
47865
47873
  var We = class {
47866
47874
  constructor(e) {
47867
- this.storage = e ?? (typeof localStorage < "u" ? localStorage : new Ur());
47875
+ this.storage = e ?? (typeof localStorage < "u" ? localStorage : new qr());
47868
47876
  }
47869
47877
  clear() {
47870
47878
  this.storage.clear();
@@ -47880,10 +47888,10 @@ var We = class {
47880
47888
  return t ? JSON.parse(t) : void 0;
47881
47889
  }
47882
47890
  setObject(e, t) {
47883
- this.setString(e, t ? Nn(t) : void 0);
47891
+ this.setString(e, t ? Fn(t) : void 0);
47884
47892
  }
47885
47893
  };
47886
- var Ur = class {
47894
+ var qr = class {
47887
47895
  constructor() {
47888
47896
  this.data = /* @__PURE__ */ new Map();
47889
47897
  }
@@ -47907,7 +47915,7 @@ var Ur = class {
47907
47915
  }
47908
47916
  };
47909
47917
  var Ve = { Event: typeof globalThis.Event < "u" ? globalThis.Event : void 0, ErrorEvent: void 0, CloseEvent: void 0 };
47910
- var Si = false;
47918
+ var bi = false;
47911
47919
  function Js() {
47912
47920
  if (typeof globalThis.Event > "u") throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");
47913
47921
  Ve.Event = globalThis.Event, Ve.ErrorEvent = class extends Event {
@@ -47929,15 +47937,14 @@ function Dt(r7) {
47929
47937
  return new r7.constructor(r7.type, r7);
47930
47938
  }
47931
47939
  var Te = { maxReconnectionDelay: 1e4, minReconnectionDelay: 1e3 + Math.random() * 4e3, minUptime: 5e3, reconnectionDelayGrowFactor: 1.3, connectionTimeout: 4e3, maxRetries: 1 / 0, maxEnqueuedMessages: 1 / 0, startClosed: false, debug: false };
47932
- var Ei = false;
47940
+ var Ri = false;
47933
47941
  var Mt = class r extends H {
47934
47942
  constructor(t, n, i = {}) {
47935
- Si || (Js(), Si = true);
47943
+ bi || (Js(), bi = true);
47936
47944
  super();
47937
47945
  this._retryCount = -1;
47938
47946
  this._shouldReconnect = true;
47939
47947
  this._connectLock = false;
47940
- this._binaryType = "blob";
47941
47948
  this._closeCalled = false;
47942
47949
  this._messageQueue = [];
47943
47950
  this._debugLogger = console.log.bind(console);
@@ -47959,7 +47966,7 @@ var Mt = class r extends H {
47959
47966
  this._handleClose = (t2) => {
47960
47967
  this._debug("close event"), this._clearTimeouts(), this._shouldReconnect && this._connect(), this.onclose && this.onclose(t2), this.dispatchEvent(Dt(t2));
47961
47968
  };
47962
- this._url = t, this._protocols = n, this._options = i, this._options.startClosed && (this._shouldReconnect = false), this._options.debugLogger && (this._debugLogger = this._options.debugLogger), this._connect();
47969
+ 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();
47963
47970
  }
47964
47971
  static get CONNECTING() {
47965
47972
  return 0;
@@ -48058,7 +48065,7 @@ var Mt = class r extends H {
48058
48065
  this._connectLock = false;
48059
48066
  return;
48060
48067
  }
48061
- !this._options.WebSocket && typeof WebSocket > "u" && !Ei && (console.error("\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket."), Ei = true);
48068
+ !this._options.WebSocket && typeof WebSocket > "u" && !Ri && (console.error("\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket."), Ri = true);
48062
48069
  let i = this._options.WebSocket || WebSocket;
48063
48070
  this._debug("connect", { url: this._url, protocols: this._protocols }), this._ws = this._protocols ? new i(this._url, this._protocols) : new i(this._url), this._ws.binaryType = this._binaryType, this._connectLock = false, this._addListeners(), this._connectTimeout = setTimeout(() => this._handleTimeout(), n);
48064
48071
  }).catch((i) => {
@@ -48105,7 +48112,7 @@ var Ge = class extends H {
48105
48112
  this.criteria.delete(e);
48106
48113
  }
48107
48114
  };
48108
- var Br = class {
48115
+ var jr = class {
48109
48116
  constructor(e, t) {
48110
48117
  this.connecting = false;
48111
48118
  this.criteria = e, this.emitter = new Ge(e), this.refCount = 1, this.subscriptionProps = t ? { ...t } : void 0;
@@ -48167,7 +48174,7 @@ var _t = class {
48167
48174
  for (let o of this.getAllCriteriaEmitters()) o.dispatchEvent({ ...i });
48168
48175
  }
48169
48176
  }), e.addEventListener("error", () => {
48170
- let t = { type: "error", payload: new d(on(new Error("WebSocket error"))) };
48177
+ let t = { type: "error", payload: new d(an(new Error("WebSocket error"))) };
48171
48178
  this.masterSubEmitter?.dispatchEvent(t);
48172
48179
  for (let n of this.getAllCriteriaEmitters()) n.dispatchEvent({ ...t });
48173
48180
  }), e.addEventListener("close", () => {
@@ -48257,7 +48264,7 @@ var _t = class {
48257
48264
  this.masterSubEmitter && this.masterSubEmitter._addCriteria(e);
48258
48265
  let n = this.maybeGetCriteriaEntry(e, t);
48259
48266
  if (n) return n.refCount += 1, n.emitter;
48260
- let i = new Br(e, t);
48267
+ let i = new jr(e, t);
48261
48268
  return this.addCriteriaEntry(i), this.subscribeToCriteria(i).catch(console.error), i.emitter;
48262
48269
  }
48263
48270
  removeCriteria(e, t) {
@@ -48284,7 +48291,7 @@ var _t = class {
48284
48291
  return this.masterSubEmitter || (this.masterSubEmitter = new Ge(...Array.from(this.criteriaEntries.keys()))), this.masterSubEmitter;
48285
48292
  }
48286
48293
  };
48287
- var Xd = "3.2.18-8ca5b55b2";
48294
+ var Xd = "3.2.20-7bac0b659";
48288
48295
  var ta = D.FHIR_JSON + ", */*; q=0.1";
48289
48296
  var ra = "https://api.medplum.com/";
48290
48297
  var na = 1e3;
@@ -48292,7 +48299,7 @@ var ia = 6e4;
48292
48299
  var oa = 0;
48293
48300
  var sa = 3e5;
48294
48301
  var aa = "Binary/";
48295
- var bi = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
48302
+ var Ci = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
48296
48303
  var ca = ((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))(ca || {});
48297
48304
  var ua = ((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))(ua || {});
48298
48305
  var la = ((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))(la || {});
@@ -48302,7 +48309,7 @@ var Nt = class extends H {
48302
48309
  super();
48303
48310
  this.initComplete = true;
48304
48311
  if (t?.baseUrl && !t.baseUrl.startsWith("http")) throw new Error("Base URL must start with http or https");
48305
- this.options = t ?? {}, this.fetch = t?.fetch ?? da(), this.storage = t?.storage ?? new We(), this.createPdfImpl = t?.createPdf, this.baseUrl = br(t?.baseUrl ?? ra), this.fhirBaseUrl = B(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4"), this.authorizeUrl = B(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = B(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = B(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.fhircastHubUrl = B(this.baseUrl, t?.fhircastHubUrl ?? "fhircast/STU3"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.onUnauthenticated = t?.onUnauthenticated, this.refreshGracePeriod = t?.refreshGracePeriod ?? sa, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? oa : ia), this.cacheTime > 0 ? this.requestCache = new At(t?.resourceCacheSize ?? na) : 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(() => {
48312
+ this.options = t ?? {}, this.fetch = t?.fetch ?? da(), this.storage = t?.storage ?? new We(), this.createPdfImpl = t?.createPdf, this.baseUrl = Cr(t?.baseUrl ?? ra), this.fhirBaseUrl = B(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4"), this.authorizeUrl = B(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = B(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = B(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.fhircastHubUrl = B(this.baseUrl, t?.fhircastHubUrl ?? "fhircast/STU3"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.onUnauthenticated = t?.onUnauthenticated, this.refreshGracePeriod = t?.refreshGracePeriod ?? sa, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? oa : ia), this.cacheTime > 0 ? this.requestCache = new At(t?.resourceCacheSize ?? na) : 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(() => {
48306
48313
  t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initComplete = true, this.dispatchEvent({ type: "storageInitialized" });
48307
48314
  }).catch((n) => {
48308
48315
  console.error(n), this.initComplete = true, this.dispatchEvent({ type: "storageInitFailed", payload: { error: n } });
@@ -48429,14 +48436,14 @@ var Nt = class extends H {
48429
48436
  }
48430
48437
  fhirSearchUrl(t, n) {
48431
48438
  let i = this.fhirUrl(t);
48432
- return n && (i.search = Gn(n)), i;
48439
+ return n && (i.search = Qn(n)), i;
48433
48440
  }
48434
48441
  search(t, n, i) {
48435
48442
  let o = this.fhirSearchUrl(t, n), s = "search-" + o.toString(), a2 = this.getCacheEntry(s, i);
48436
48443
  if (a2) return a2.value;
48437
48444
  let c = new M((async () => {
48438
48445
  let u2 = await this.get(o, i);
48439
- if (u2.entry) for (let l2 of u2.entry) this.cacheResource(l2.resource);
48446
+ if (u2.entry) for (let p2 of u2.entry) this.cacheResource(p2.resource);
48440
48447
  return u2;
48441
48448
  })());
48442
48449
  return this.setCacheEntry(s, c), c;
@@ -48452,7 +48459,7 @@ var Nt = class extends H {
48452
48459
  searchResources(t, n, i) {
48453
48460
  let s = "searchResources-" + this.fhirSearchUrl(t, n).toString(), a2 = this.getCacheEntry(s, i);
48454
48461
  if (a2) return a2.value;
48455
- let c = new M(this.search(t, n, i).then(Pi));
48462
+ let c = new M(this.search(t, n, i).then(Ai));
48456
48463
  return this.setCacheEntry(s, c), c;
48457
48464
  }
48458
48465
  async *searchResourcePages(t, n, i) {
@@ -48460,7 +48467,7 @@ var Nt = class extends H {
48460
48467
  for (; o; ) {
48461
48468
  let s = new URL(o).searchParams, a2 = await this.search(t, s, i), c = a2.link?.find((u2) => u2.relation === "next");
48462
48469
  if (!a2.entry?.length && !c) break;
48463
- yield Pi(a2), o = c?.url ? new URL(c.url) : void 0;
48470
+ yield Ai(a2), o = c?.url ? new URL(c.url) : void 0;
48464
48471
  }
48465
48472
  }
48466
48473
  searchValueSet(t, n, i) {
@@ -48477,7 +48484,7 @@ var Nt = class extends H {
48477
48484
  getCachedReference(t) {
48478
48485
  let n = t.reference;
48479
48486
  if (!n) return;
48480
- if (n === "system") return bi;
48487
+ if (n === "system") return Ci;
48481
48488
  let [i, o] = n.split("/");
48482
48489
  if (!(!i || !o)) return this.getCached(i, o);
48483
48490
  }
@@ -48488,12 +48495,12 @@ var Nt = class extends H {
48488
48495
  readReference(t, n) {
48489
48496
  let i = t.reference;
48490
48497
  if (!i) return new M(Promise.reject(new Error("Missing reference")));
48491
- if (i === "system") return new M(Promise.resolve(bi));
48498
+ if (i === "system") return new M(Promise.resolve(Ci));
48492
48499
  let [o, s] = i.split("/");
48493
48500
  return !o || !s ? new M(Promise.reject(new Error("Invalid reference"))) : this.readResource(o, s, n);
48494
48501
  }
48495
48502
  requestSchema(t) {
48496
- if (gn(t)) return Promise.resolve();
48503
+ if (xn(t)) return Promise.resolve();
48497
48504
  let n = t + "-requestSchema", i = this.getCacheEntry(n, void 0);
48498
48505
  if (i) return i.value;
48499
48506
  let o = new M((async () => {
@@ -48539,12 +48546,12 @@ var Nt = class extends H {
48539
48546
  }
48540
48547
  }`.replace(/\s+/g, " "), a2 = await this.graphql(s);
48541
48548
  cr(a2.data.StructureDefinitionList);
48542
- for (let c of a2.data.SearchParameterList) Pr(c);
48549
+ for (let c of a2.data.SearchParameterList) Ar(c);
48543
48550
  })());
48544
48551
  return this.setCacheEntry(n, o), o;
48545
48552
  }
48546
48553
  requestProfileSchema(t, n) {
48547
- if (!n?.expandProfile && xn(t)) return Promise.resolve();
48554
+ if (!n?.expandProfile && Sn(t)) return Promise.resolve();
48548
48555
  let i = t + "-requestSchema" + (n?.expandProfile ? "-nested" : ""), o = this.getCacheEntry(i, void 0);
48549
48556
  if (o) return o.value;
48550
48557
  let s = new M((async () => {
@@ -48585,19 +48592,19 @@ var Nt = class extends H {
48585
48592
  return s || (s = t), this.cacheResource(s), this.invalidateUrl(this.fhirUrl(t.resourceType, t.id, "_history")), this.invalidateSearches(t.resourceType), s;
48586
48593
  }
48587
48594
  async createAttachment(t, n, i, o, s) {
48588
- let a2 = wi(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), u2 = await this.createBinary(a2, c);
48595
+ let a2 = Oi(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), u2 = await this.createBinary(a2, c);
48589
48596
  return { contentType: a2.contentType, url: u2.url, title: a2.filename };
48590
48597
  }
48591
48598
  createBinary(t, n, i, o, s) {
48592
- let a2 = wi(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: l2, filename: m2, securityContext: v, onProgress: Q } = a2, _e = this.fhirUrl("Binary");
48593
- return m2 && _e.searchParams.set("_filename", m2), v?.reference && this.setRequestHeader(c, "X-Security-Context", v.reference), Q ? this.uploadwithProgress(_e, u2, l2, Q, c) : this.post(_e, u2, l2, c);
48599
+ let a2 = Oi(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: p2, filename: m2, securityContext: v, onProgress: Q } = a2, _e = this.fhirUrl("Binary");
48600
+ return m2 && _e.searchParams.set("_filename", m2), v?.reference && this.setRequestHeader(c, "X-Security-Context", v.reference), Q ? this.uploadwithProgress(_e, u2, p2, Q, c) : this.post(_e, u2, p2, c);
48594
48601
  }
48595
48602
  uploadwithProgress(t, n, i, o, s) {
48596
48603
  return new Promise((a2, c) => {
48597
- let u2 = new XMLHttpRequest(), l2 = () => u2.abort();
48598
- s?.signal?.addEventListener("abort", l2);
48604
+ let u2 = new XMLHttpRequest(), p2 = () => u2.abort();
48605
+ s?.signal?.addEventListener("abort", p2);
48599
48606
  let m2 = (v) => {
48600
- s?.signal?.removeEventListener("abort", l2), v instanceof Error ? c(v) : a2(v);
48607
+ s?.signal?.removeEventListener("abort", p2), v instanceof Error ? c(v) : a2(v);
48601
48608
  };
48602
48609
  if (u2.responseType = "json", u2.onabort = () => m2(new DOMException("Request aborted", "AbortError")), u2.onerror = () => m2(new Error("Request error")), o && (u2.upload.onprogress = (v) => o(v), u2.upload.onload = (v) => o(v)), u2.onload = () => {
48603
48610
  u2.status >= 200 && u2.status < 300 ? m2(u2.response) : m2(new d(Xe(u2.response || u2.statusText)));
@@ -48610,7 +48617,7 @@ var Nt = class extends H {
48610
48617
  }
48611
48618
  async createPdf(t, n, i, o) {
48612
48619
  if (!this.createPdfImpl) throw new Error("PDF creation not enabled");
48613
- let s = ha(t, n, i, o), a2 = typeof n == "object" ? n : {}, { docDefinition: c, tableLayouts: u2, fonts: l2, ...m2 } = s, v = await this.createPdfImpl(c, u2, l2), Q = { ...m2, data: v, contentType: "application/pdf" };
48620
+ let s = ha(t, n, i, o), a2 = typeof n == "object" ? n : {}, { docDefinition: c, tableLayouts: u2, fonts: p2, ...m2 } = s, v = await this.createPdfImpl(c, u2, p2), Q = { ...m2, data: v, contentType: "application/pdf" };
48614
48621
  return this.createBinary(Q, a2);
48615
48622
  }
48616
48623
  createComment(t, n, i) {
@@ -48669,7 +48676,7 @@ var Nt = class extends H {
48669
48676
  return this.accessToken;
48670
48677
  }
48671
48678
  setAccessToken(t, n) {
48672
- this.accessToken = t, this.refreshToken = n, this.accessTokenExpires = vi(t), this.medplumServer = gi(t);
48679
+ this.accessToken = t, this.refreshToken = n, this.accessTokenExpires = Ti(t), this.medplumServer = xi(t);
48673
48680
  }
48674
48681
  getLogins() {
48675
48682
  return this.storage.getObject("logins") ?? [];
@@ -48762,14 +48769,14 @@ var Nt = class extends H {
48762
48769
  if (s.status === 401) return this.handleUnauthenticated(t, n, i);
48763
48770
  if (s.status === 204 || s.status === 304) return;
48764
48771
  let c = s.headers.get("content-type")?.includes("json");
48765
- if (s.status === 404 && !c) throw new d(rn);
48772
+ if (s.status === 404 && !c) throw new d(on);
48766
48773
  let u2 = await this.parseBody(s, c);
48767
48774
  if (s.status === 200 && i.followRedirectOnOk || s.status === 201 && i.followRedirectOnCreated) {
48768
- let l2 = await Ci(s, u2);
48769
- if (l2) return this.request("GET", l2, { ...i, body: void 0 });
48775
+ let p2 = await wi(s, u2);
48776
+ if (p2) return this.request("GET", p2, { ...i, body: void 0 });
48770
48777
  }
48771
48778
  if (s.status === 202 && i.pollStatusOnAccepted) {
48772
- let m2 = await Ci(s, u2) ?? o.statusUrl;
48779
+ let m2 = await wi(s, u2) ?? o.statusUrl;
48773
48780
  if (m2) return this.pollStatus(m2, i, o);
48774
48781
  }
48775
48782
  if (s.status >= 400) throw new d(Xe(u2));
@@ -48796,7 +48803,7 @@ var Nt = class extends H {
48796
48803
  } catch (a2) {
48797
48804
  if (a2.message === "Failed to fetch" && s === 0 && this.dispatchEvent({ type: "offline" }), a2.name === "AbortError" || s === i) throw a2;
48798
48805
  }
48799
- await Sr(o);
48806
+ await br(o);
48800
48807
  }
48801
48808
  throw new Error("Unreachable");
48802
48809
  }
@@ -48814,11 +48821,12 @@ var Nt = class extends H {
48814
48821
  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;
48815
48822
  else {
48816
48823
  let s = n.pollStatusPeriod ?? 1e3;
48817
- await Sr(s), i.pollCount++;
48824
+ await br(s), i.pollCount++;
48818
48825
  }
48819
48826
  return this.request("GET", t, o, i);
48820
48827
  }
48821
48828
  async executeAutoBatch() {
48829
+ if (this.autoBatchQueue === void 0) return;
48822
48830
  let t = [...this.autoBatchQueue];
48823
48831
  if (this.autoBatchQueue.length = 0, this.autoBatchTimerId = void 0, t.length === 1) {
48824
48832
  let o = t[0];
@@ -48853,20 +48861,20 @@ var Nt = class extends H {
48853
48861
  return this.refresh() ? this.request(t, n, i) : (this.clear(), this.onUnauthenticated && this.onUnauthenticated(), Promise.reject(new d(Ee)));
48854
48862
  }
48855
48863
  async startPkce() {
48856
- let t = Dr();
48864
+ let t = _r();
48857
48865
  sessionStorage.setItem("pkceState", t);
48858
- let n = Dr().slice(0, 128);
48866
+ let n = _r().slice(0, 128);
48859
48867
  sessionStorage.setItem("codeVerifier", n);
48860
- let i = await li(n), o = Bn(i).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
48868
+ let i = await di(n), o = jn(i).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
48861
48869
  return sessionStorage.setItem("codeChallenge", o), { codeChallengeMethod: "S256", codeChallenge: o };
48862
48870
  }
48863
48871
  async requestAuthorization(t) {
48864
48872
  let n = await this.ensureCodeChallenge(t ?? {}), i = new URL(this.authorizeUrl);
48865
- i.searchParams.set("response_type", "code"), i.searchParams.set("state", sessionStorage.getItem("pkceState")), i.searchParams.set("client_id", n.clientId ?? this.clientId), i.searchParams.set("redirect_uri", n.redirectUri ?? Ri()), i.searchParams.set("code_challenge_method", n.codeChallengeMethod), i.searchParams.set("code_challenge", n.codeChallenge), i.searchParams.set("scope", n.scope ?? "openid profile"), window.location.assign(i.toString());
48873
+ i.searchParams.set("response_type", "code"), i.searchParams.set("state", sessionStorage.getItem("pkceState")), i.searchParams.set("client_id", n.clientId ?? this.clientId), i.searchParams.set("redirect_uri", n.redirectUri ?? Pi()), i.searchParams.set("code_challenge_method", n.codeChallengeMethod), i.searchParams.set("code_challenge", n.codeChallenge), i.searchParams.set("scope", n.scope ?? "openid profile"), window.location.assign(i.toString());
48866
48874
  }
48867
48875
  processCode(t, n) {
48868
48876
  let i = new URLSearchParams();
48869
- if (i.set("grant_type", "authorization_code"), i.set("code", t), i.set("client_id", n?.clientId ?? this.clientId), i.set("redirect_uri", n?.redirectUri ?? Ri()), typeof sessionStorage < "u") {
48877
+ if (i.set("grant_type", "authorization_code"), i.set("code", t), i.set("client_id", n?.clientId ?? this.clientId), i.set("redirect_uri", n?.redirectUri ?? Pi()), typeof sessionStorage < "u") {
48870
48878
  let o = sessionStorage.getItem("codeVerifier");
48871
48879
  o && i.set("code_verifier", o);
48872
48880
  }
@@ -48898,25 +48906,25 @@ var Nt = class extends H {
48898
48906
  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);
48899
48907
  }
48900
48908
  setBasicAuth(t, n) {
48901
- this.clientId = t, this.clientSecret = n, this.basicAuth = ui(t + ":" + n);
48909
+ this.clientId = t, this.clientSecret = n, this.basicAuth = pi(t + ":" + n);
48902
48910
  }
48903
48911
  async fhircastSubscribe(t, n) {
48904
48912
  if (!(typeof t == "string" && t !== "")) throw new d(h("Invalid topic provided. Topic must be a valid string."));
48905
48913
  if (!(typeof n == "object" && Array.isArray(n) && n.length > 0)) throw new d(h("Invalid events provided. Events must be an array of event names containing at least one event."));
48906
- let i = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post(this.fhircastHubUrl, Lr(i), D.FORM_URL_ENCODED))["hub.channel.endpoint"];
48914
+ let i = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post(this.fhircastHubUrl, Ur(i), D.FORM_URL_ENCODED))["hub.channel.endpoint"];
48907
48915
  if (!s) throw new Error("Invalid response!");
48908
48916
  return i.endpoint = s, i;
48909
48917
  }
48910
48918
  async fhircastUnsubscribe(t) {
48911
48919
  if (!It(t)) throw new d(h("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));
48912
48920
  if (!(t.endpoint && typeof t.endpoint == "string" && t.endpoint.startsWith("ws"))) throw new d(h("Provided subscription request must have an endpoint in order to unsubscribe."));
48913
- t.mode = "unsubscribe", await this.post(this.fhircastHubUrl, Lr(t), D.FORM_URL_ENCODED);
48921
+ t.mode = "unsubscribe", await this.post(this.fhircastHubUrl, Ur(t), D.FORM_URL_ENCODED);
48914
48922
  }
48915
48923
  fhircastConnect(t) {
48916
48924
  return new Ot(t);
48917
48925
  }
48918
48926
  async fhircastPublish(t, n, i, o) {
48919
- return fi(n) ? this.post(this.fhircastHubUrl, Fr(t, n, i, o), D.JSON) : (mi(n), this.post(this.fhircastHubUrl, Fr(t, n, i), D.JSON));
48927
+ return hi(n) ? this.post(this.fhircastHubUrl, Br(t, n, i, o), D.JSON) : (yi(n), this.post(this.fhircastHubUrl, Br(t, n, i), D.JSON));
48920
48928
  }
48921
48929
  async fhircastGetContext(t) {
48922
48930
  return this.get(`${this.fhircastHubUrl}/${t}`);
@@ -48937,9 +48945,9 @@ var Nt = class extends H {
48937
48945
  this.clearActiveLogin();
48938
48946
  try {
48939
48947
  let a2 = await o.json();
48940
- throw new d(S(a2.error_description));
48948
+ throw new d(E(a2.error_description));
48941
48949
  } catch (a2) {
48942
- throw new d(S("Failed to fetch tokens"), a2);
48950
+ throw new d(E("Failed to fetch tokens"), a2);
48943
48951
  }
48944
48952
  }
48945
48953
  let s = await o.json();
@@ -48947,9 +48955,9 @@ var Nt = class extends H {
48947
48955
  }
48948
48956
  async verifyTokens(t) {
48949
48957
  let n = t.access_token;
48950
- if (yi(n)) {
48958
+ if (vi(n)) {
48951
48959
  let i = kt(n);
48952
- if (Date.now() >= i.exp * 1e3) throw this.clearActiveLogin(), new d(nn);
48960
+ if (Date.now() >= i.exp * 1e3) throw this.clearActiveLogin(), new d(sn);
48953
48961
  if (i.cid) {
48954
48962
  if (i.cid !== this.clientId) throw this.clearActiveLogin(), new d(tr);
48955
48963
  } else if (this.clientId && i.client_id !== this.clientId) throw this.clearActiveLogin(), new d(tr);
@@ -48972,7 +48980,7 @@ var Nt = class extends H {
48972
48980
  }
48973
48981
  }
48974
48982
  getSubscriptionManager() {
48975
- return this.subscriptionManager || (this.subscriptionManager = new _t(this, Wn(this.baseUrl, "/ws/subscriptions-r4"))), this.subscriptionManager;
48983
+ return this.subscriptionManager || (this.subscriptionManager = new _t(this, Hn(this.baseUrl, "/ws/subscriptions-r4"))), this.subscriptionManager;
48976
48984
  }
48977
48985
  subscribeToCriteria(t, n) {
48978
48986
  return this.getSubscriptionManager().addCriteria(t, n);
@@ -48988,24 +48996,24 @@ function da() {
48988
48996
  if (!globalThis.fetch) throw new Error("Fetch not available in this environment");
48989
48997
  return globalThis.fetch.bind(globalThis);
48990
48998
  }
48991
- function Ri() {
48999
+ function Pi() {
48992
49000
  return typeof window > "u" ? "" : window.location.protocol + "//" + window.location.host + "/";
48993
49001
  }
48994
- async function Ci(r7, e) {
49002
+ async function wi(r7, e) {
48995
49003
  let t = r7.headers.get("content-location");
48996
49004
  if (t) return t;
48997
49005
  let n = r7.headers.get("location");
48998
49006
  if (n) return n;
48999
49007
  if (be(e) && e.issue?.[0]?.diagnostics) return e.issue[0].diagnostics;
49000
49008
  }
49001
- function Pi(r7) {
49009
+ function Ai(r7) {
49002
49010
  let e = r7.entry?.map((t) => t.resource) ?? [];
49003
49011
  return Object.assign(e, { bundle: r7 });
49004
49012
  }
49005
49013
  function fa(r7) {
49006
49014
  return R(r7) && "data" in r7 && "contentType" in r7;
49007
49015
  }
49008
- function wi(r7, e, t, n) {
49016
+ function Oi(r7, e, t, n) {
49009
49017
  return fa(r7) ? r7 : { data: r7, filename: e, contentType: t, onProgress: n };
49010
49018
  }
49011
49019
  function ma(r7) {
@@ -49034,7 +49042,7 @@ var se = class {
49034
49042
  return this.componentSeparator + this.repetitionSeparator + this.escapeCharacter + this.subcomponentSeparator;
49035
49043
  }
49036
49044
  };
49037
- var Wi = class r2 {
49045
+ var Hi = class r2 {
49038
49046
  constructor(e, t = new se()) {
49039
49047
  this.context = t, this.segments = e;
49040
49048
  }
@@ -49075,7 +49083,7 @@ var Wi = class r2 {
49075
49083
  };
49076
49084
  var Ke = class r3 {
49077
49085
  constructor(e, t = new se()) {
49078
- this.context = t, Ln(e) ? this.fields = e.map((n) => Me.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
49086
+ this.context = t, Un(e) ? this.fields = e.map((n) => Me.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
49079
49087
  }
49080
49088
  get(e) {
49081
49089
  return this.fields[e];
@@ -49120,8 +49128,8 @@ function Xa(r7) {
49120
49128
  let e = r7 instanceof Date ? r7 : new Date(r7), n = e.toISOString().replace(/[-:T]/g, "").replace(/(\.\d+)?Z$/, ""), i = e.getUTCMilliseconds();
49121
49129
  return i > 0 && (n += "." + i.toString()), n;
49122
49130
  }
49123
- var Qr = ((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))(Qr || {});
49124
- var Gi = class r5 {
49131
+ 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 || {});
49132
+ var Qi = class r5 {
49125
49133
  constructor(e, t = {}, n = 3, i) {
49126
49134
  this.write = e;
49127
49135
  this.metadata = t;
@@ -49151,11 +49159,11 @@ var Gi = class r5 {
49151
49159
  }
49152
49160
  log(e, t, n) {
49153
49161
  e > this.level || (n instanceof Error && (n = { error: n.toString(), stack: n.stack?.split(`
49154
- `) }), this.write(JSON.stringify({ level: Qr[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: this.prefix ? `${this.prefix}${t}` : t, ...n, ...this.metadata })));
49162
+ `) }), this.write(JSON.stringify({ level: zr[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: this.prefix ? `${this.prefix}${t}` : t, ...n, ...this.metadata })));
49155
49163
  }
49156
49164
  };
49157
49165
  function dm(r7) {
49158
- let e = Qr[r7.toUpperCase()];
49166
+ let e = zr[r7.toUpperCase()];
49159
49167
  if (e === void 0) throw new Error(`Invalid log level: ${r7}`);
49160
49168
  return e;
49161
49169
  }
@@ -49171,7 +49179,7 @@ function ac(r7) {
49171
49179
  if (!n.name) throw new Error("Asset missing name");
49172
49180
  }
49173
49181
  }
49174
- async function Qi(r7) {
49182
+ async function zi(r7) {
49175
49183
  let e = Qt.get(r7 ?? "latest");
49176
49184
  if (!e) {
49177
49185
  let t = r7 ? `tags/v${r7}` : "latest", n = await fetch(`${sc}/${t}`);
@@ -49195,14 +49203,14 @@ function cc(r7) {
49195
49203
  async function Pm(r7) {
49196
49204
  if (!cc(r7)) return false;
49197
49205
  try {
49198
- await Qi(r7);
49206
+ await zi(r7);
49199
49207
  } catch {
49200
49208
  return false;
49201
49209
  }
49202
49210
  return true;
49203
49211
  }
49204
49212
  async function wm() {
49205
- let r7 = await Qi();
49213
+ let r7 = await zi();
49206
49214
  if (!r7.tag_name.startsWith("v")) throw new Error(`Invalid release name found. Release tag '${r7.tag_name}' did not start with 'v'`);
49207
49215
  return r7.tag_name.slice(1);
49208
49216
  }
@@ -49235,12 +49243,12 @@ var r6 = class extends Event {
49235
49243
  this.error = e;
49236
49244
  }
49237
49245
  };
49238
- var l = class extends Event {
49246
+ var l2 = class extends Event {
49239
49247
  constructor() {
49240
49248
  super("close");
49241
49249
  }
49242
49250
  };
49243
- var p2 = class extends a {
49251
+ var p = class extends a {
49244
49252
  constructor(e, n = "utf-8") {
49245
49253
  super();
49246
49254
  this.socket = e;
@@ -49250,7 +49258,7 @@ var p2 = class extends a {
49250
49258
  e.on("data", (s) => {
49251
49259
  try {
49252
49260
  if (this.appendData(s), s.at(-2) === 28 && s.at(-1) === 13) {
49253
- let o = Buffer.concat(this.chunks), i = o.subarray(1, o.length - 2), f2 = (0, import_iconv_lite.decode)(i, this.encoding), g2 = Wi.parse(f2);
49261
+ let o = Buffer.concat(this.chunks), i = o.subarray(1, o.length - 2), f2 = (0, import_iconv_lite.decode)(i, this.encoding), g2 = Hi.parse(f2);
49254
49262
  this.dispatchEvent(new d2(this, g2)), this.resetBuffer();
49255
49263
  }
49256
49264
  } catch (o) {
@@ -49284,7 +49292,7 @@ var p2 = class extends a {
49284
49292
  });
49285
49293
  }
49286
49294
  close() {
49287
- this.socket.end(), this.socket.destroy(), this.dispatchEvent(new l());
49295
+ this.socket.end(), this.socket.destroy(), this.dispatchEvent(new l2());
49288
49296
  }
49289
49297
  appendData(e) {
49290
49298
  this.chunks.push(e);
@@ -49301,7 +49309,7 @@ var m = class extends a {
49301
49309
  return this.connection ? Promise.resolve(this.connection) : new Promise((t, e) => {
49302
49310
  let n = (0, import_node_net.connect)({ host: this.host, port: this.port, keepAlive: this.keepAlive }, () => {
49303
49311
  let s;
49304
- this.connection = s = new p2(n, this.encoding), n.off("error", e), s.addEventListener("close", () => this.dispatchEvent(new l())), s.addEventListener("error", (o) => this.dispatchEvent(new r6(o.error))), t(this.connection);
49312
+ this.connection = s = new p(n, this.encoding), n.off("error", e), s.addEventListener("close", () => this.dispatchEvent(new l2())), s.addEventListener("error", (o) => this.dispatchEvent(new r6(o.error))), t(this.connection);
49305
49313
  });
49306
49314
  n.on("error", e);
49307
49315
  });
@@ -49322,7 +49330,7 @@ var u = class {
49322
49330
  }
49323
49331
  start(t, e) {
49324
49332
  let n = import_node_net2.default.createServer((s) => {
49325
- let o = new p2(s, e);
49333
+ let o = new p(s, e);
49326
49334
  this.handler(o);
49327
49335
  });
49328
49336
  n.listen(t), this.server = n;
@@ -49579,7 +49587,7 @@ var AgentHl7Channel = class extends BaseChannel {
49579
49587
  sendToRemote(msg) {
49580
49588
  const connection = this.connections.get(msg.remote);
49581
49589
  if (connection) {
49582
- connection.hl7Connection.send(Wi.parse(msg.body));
49590
+ connection.hl7Connection.send(Hi.parse(msg.body));
49583
49591
  }
49584
49592
  }
49585
49593
  handleNewConnection(connection) {
@@ -49628,7 +49636,7 @@ var UPGRADER_LOG_PATH = (0, import_node_path2.resolve)(
49628
49636
  );
49629
49637
  var RELEASES_PATH = (0, import_node_path2.resolve)(__dirname);
49630
49638
  async function downloadRelease(version, path) {
49631
- const release = await Qi(version);
49639
+ const release = await zi(version);
49632
49640
  const downloadUrl = parseDownloadUrl(release, (0, import_node_os2.platform)());
49633
49641
  const { body } = await fetch(downloadUrl);
49634
49642
  if (!body) {
@@ -49688,6 +49696,7 @@ async function execAsync(command, options) {
49688
49696
  });
49689
49697
  }
49690
49698
  var DEFAULT_PING_TIMEOUT = 3600;
49699
+ var MAX_MISSED_HEARTBEATS = 1;
49691
49700
  var App = class _App {
49692
49701
  constructor(medplum, agentId, logLevel) {
49693
49702
  this.medplum = medplum;
@@ -49698,11 +49707,12 @@ var App = class _App {
49698
49707
  this.hl7Queue = [];
49699
49708
  this.hl7Clients = /* @__PURE__ */ new Map();
49700
49709
  this.heartbeatPeriod = 10 * 1e3;
49710
+ this.outstandingHeartbeats = 0;
49701
49711
  this.live = false;
49702
49712
  this.shutdown = false;
49703
49713
  this.keepAlive = false;
49704
49714
  _App.instance = this;
49705
- this.log = new Gi((msg) => console.log(msg), void 0, logLevel);
49715
+ this.log = new Qi((msg) => console.log(msg), void 0, logLevel);
49706
49716
  }
49707
49717
  async start() {
49708
49718
  this.log.info("Medplum service starting...");
@@ -49746,29 +49756,34 @@ var App = class _App {
49746
49756
  this.heartbeatTimer = setInterval(() => this.heartbeat(), this.heartbeatPeriod);
49747
49757
  }
49748
49758
  async heartbeat() {
49749
- if (!(this.webSocket || this.reconnectTimer)) {
49759
+ if (!this.webSocket) {
49750
49760
  this.log.warn("WebSocket not connected");
49751
49761
  this.connectWebSocket().catch(this.log.error);
49752
49762
  return;
49753
49763
  }
49754
- if (this.webSocket && this.live) {
49764
+ if (this.live) {
49765
+ if (this.outstandingHeartbeats > MAX_MISSED_HEARTBEATS) {
49766
+ this.outstandingHeartbeats = 0;
49767
+ this.webSocket.reconnect();
49768
+ this.log.info("Disconnected from Medplum server. Attempting to reconnect...");
49769
+ return;
49770
+ }
49771
+ this.outstandingHeartbeats += 1;
49755
49772
  await this.sendToWebSocket({ type: "agent:heartbeat:request" });
49756
49773
  }
49757
49774
  }
49758
49775
  async connectWebSocket() {
49759
- if (this.reconnectTimer) {
49760
- clearTimeout(this.reconnectTimer);
49761
- this.reconnectTimer = void 0;
49762
- }
49763
49776
  const webSocketUrl = new URL(this.medplum.getBaseUrl());
49764
49777
  webSocketUrl.protocol = webSocketUrl.protocol === "https:" ? "wss:" : "ws:";
49765
49778
  webSocketUrl.pathname = "/ws/agent";
49766
49779
  this.log.info(`Connecting to WebSocket: ${webSocketUrl.href}`);
49767
- this.webSocket = new wrapper_default(webSocketUrl);
49768
- this.webSocket.binaryType = "nodebuffer";
49769
- this.webSocket.addEventListener("error", (err) => {
49780
+ this.webSocket = new Mt(webSocketUrl.toString(), void 0, {
49781
+ WebSocket: wrapper_default,
49782
+ binaryType: "nodebuffer"
49783
+ });
49784
+ this.webSocket.addEventListener("error", () => {
49770
49785
  if (!this.shutdown) {
49771
- this.log.error(`WebSocket closed due to an error: ${Ne(err)}`);
49786
+ this.log.error("WebSocket closed due to an error");
49772
49787
  }
49773
49788
  });
49774
49789
  this.webSocket.addEventListener("open", async () => {
@@ -49779,11 +49794,9 @@ var App = class _App {
49779
49794
  });
49780
49795
  });
49781
49796
  this.webSocket.addEventListener("close", () => {
49782
- if (!this.shutdown) {
49783
- this.webSocket = void 0;
49797
+ if (!this.shutdown && this.live) {
49784
49798
  this.live = false;
49785
49799
  this.log.info("WebSocket closed");
49786
- this.reconnectTimer = setTimeout(() => this.connectWebSocket(), 1e3);
49787
49800
  }
49788
49801
  });
49789
49802
  this.webSocket.addEventListener("message", async (e) => {
@@ -49798,11 +49811,14 @@ var App = class _App {
49798
49811
  case "agent:connect:response":
49799
49812
  this.live = true;
49800
49813
  this.startWebSocketWorker();
49814
+ this.log.info("Successfully connected to Medplum server");
49801
49815
  break;
49802
49816
  case "agent:heartbeat:request":
49817
+ this.outstandingHeartbeats = 0;
49803
49818
  await this.sendToWebSocket({ type: "agent:heartbeat:response", version: Xd });
49804
49819
  break;
49805
49820
  case "agent:heartbeat:response":
49821
+ this.outstandingHeartbeats = 0;
49806
49822
  break;
49807
49823
  // @ts-expect-error - Deprecated message type
49808
49824
  case "transmit":
@@ -49950,7 +49966,7 @@ var App = class _App {
49950
49966
  for (let i = 0; i < channels.length; i++) {
49951
49967
  const channel = channels[i];
49952
49968
  const endpoint = endpoints[i];
49953
- if (endpoint.address === "") {
49969
+ if (!endpoint.address) {
49954
49970
  throw new Error(`Invalid empty endpoint address for channel '${channel.name}'`);
49955
49971
  }
49956
49972
  let parsedEndpoint;
@@ -49997,10 +50013,6 @@ var App = class _App {
49997
50013
  clearInterval(this.heartbeatTimer);
49998
50014
  this.heartbeatTimer = void 0;
49999
50015
  }
50000
- if (this.reconnectTimer) {
50001
- clearTimeout(this.reconnectTimer);
50002
- this.reconnectTimer = void 0;
50003
- }
50004
50016
  if (this.webSocket) {
50005
50017
  this.webSocket.close();
50006
50018
  this.webSocket = void 0;
@@ -50261,7 +50273,7 @@ ${result}`);
50261
50273
  });
50262
50274
  }
50263
50275
  }
50264
- client.sendAndWait(Wi.parse(message.body)).then((response) => {
50276
+ client.sendAndWait(Hi.parse(message.body)).then((response) => {
50265
50277
  this.log.info(`Response: ${response.toString().replaceAll("\r", "\n")}`);
50266
50278
  this.addToWebSocketQueue({
50267
50279
  type: "agent:transmit:response",
@@ -50358,7 +50370,7 @@ async function upgraderMain(argv) {
50358
50370
  if ((0, import_node_os4.platform)() !== "win32") {
50359
50371
  throw new Error(`Unsupported platform: ${(0, import_node_os4.platform)()}. Agent upgrader currently only supports Windows`);
50360
50372
  }
50361
- const globalLogger = new Gi((msg) => console.log(msg));
50373
+ const globalLogger = new Qi((msg) => console.log(msg));
50362
50374
  if (!import_node_process2.default.send) {
50363
50375
  globalLogger.error("Upgrader not started as a child process with Node IPC enabled. Aborting...");
50364
50376
  import_node_process2.default.exit(1);
@@ -50445,6 +50457,9 @@ dcmjs/build/dcmjs.js:
50445
50457
  * @license MIT
50446
50458
  *)
50447
50459
 
50460
+ safe-buffer/index.js:
50461
+ (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
50462
+
50448
50463
  dcmjs-dimse/build/dcmjs-dimse.min.js:
50449
50464
  (*! dcmjs-dimse - 0.1.30 - 2024-10-26 | (c) 2021-2024 Pantelis Georgiadis | https://github.com/PantelisGeorgiadis/dcmjs-dimse *)
50450
50465
  */