@medplum/agent 4.5.0 → 4.5.2

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 +575 -575
  2. package/package.json +5 -5
@@ -9799,11 +9799,11 @@ var require_dcmjs = __commonJS({
9799
9799
  };
9800
9800
  return _setPrototypeOf(o, p2);
9801
9801
  }
9802
- function _isNativeFunction(fn2) {
9802
+ function _isNativeFunction(fn) {
9803
9803
  try {
9804
- return Function.toString.call(fn2).indexOf("[native code]") !== -1;
9804
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
9805
9805
  } catch (e) {
9806
- return typeof fn2 === "function";
9806
+ return typeof fn === "function";
9807
9807
  }
9808
9808
  }
9809
9809
  function _wrapNativeSuper(Class) {
@@ -23101,8 +23101,8 @@ var require_dcmjs = __commonJS({
23101
23101
  value: function getCornerstoneLabelFromDefaultState(defaultState) {
23102
23102
  var _defaultState$finding = defaultState.findingSites, findingSites = _defaultState$finding === void 0 ? [] : _defaultState$finding, finding = defaultState.finding;
23103
23103
  var cornersoneFreeTextCodingValue = CodingScheme.codeValues.CORNERSTONEFREETEXT;
23104
- var freeTextLabel = findingSites.find(function(fs4) {
23105
- return fs4.CodeValue === cornersoneFreeTextCodingValue;
23104
+ var freeTextLabel = findingSites.find(function(fs3) {
23105
+ return fs3.CodeValue === cornersoneFreeTextCodingValue;
23106
23106
  });
23107
23107
  if (freeTextLabel) {
23108
23108
  return freeTextLabel.CodeMeaning;
@@ -23833,7 +23833,7 @@ var require_dcmjs = __commonJS({
23833
23833
  var sqrLen = squaredLength;
23834
23834
  var forEach = (function() {
23835
23835
  var vec = create();
23836
- return function(a, stride, offset, count, fn2, arg) {
23836
+ return function(a, stride, offset, count, fn, arg) {
23837
23837
  var i, l3;
23838
23838
  if (!stride) {
23839
23839
  stride = 3;
@@ -23850,7 +23850,7 @@ var require_dcmjs = __commonJS({
23850
23850
  vec[0] = a[i];
23851
23851
  vec[1] = a[i + 1];
23852
23852
  vec[2] = a[i + 2];
23853
- fn2(vec, vec, arg);
23853
+ fn(vec, vec, arg);
23854
23854
  a[i] = vec[0];
23855
23855
  a[i + 1] = vec[1];
23856
23856
  a[i + 2] = vec[2];
@@ -29202,11 +29202,11 @@ var require_decorator = __commonJS({
29202
29202
  };
29203
29203
  };
29204
29204
  var mergeDecorators = (d1, d22) => {
29205
- var _a, _b, _c2, _d, _e2, _f;
29205
+ var _a, _b, _c2, _d, _e, _f;
29206
29206
  return {
29207
29207
  class: (0, util_1.unique)([...(_a = d1 === null || d1 === void 0 ? void 0 : d1.class) !== null && _a !== void 0 ? _a : [], ...(_b = d22 === null || d22 === void 0 ? void 0 : d22.class) !== null && _b !== void 0 ? _b : []]),
29208
29208
  static: mergePropertyAndMethodDecorators((_c2 = d1 === null || d1 === void 0 ? void 0 : d1.static) !== null && _c2 !== void 0 ? _c2 : {}, (_d = d22 === null || d22 === void 0 ? void 0 : d22.static) !== null && _d !== void 0 ? _d : {}),
29209
- instance: mergePropertyAndMethodDecorators((_e2 = d1 === null || d1 === void 0 ? void 0 : d1.instance) !== null && _e2 !== void 0 ? _e2 : {}, (_f = d22 === null || d22 === void 0 ? void 0 : d22.instance) !== null && _f !== void 0 ? _f : {})
29209
+ instance: mergePropertyAndMethodDecorators((_e = d1 === null || d1 === void 0 ? void 0 : d1.instance) !== null && _e !== void 0 ? _e : {}, (_f = d22 === null || d22 === void 0 ? void 0 : d22.instance) !== null && _f !== void 0 ? _f : {})
29210
29210
  };
29211
29211
  };
29212
29212
  var decorators = /* @__PURE__ */ new Map();
@@ -29837,11 +29837,11 @@ var require_dcmjs2 = __commonJS({
29837
29837
  };
29838
29838
  return _setPrototypeOf(o, p2);
29839
29839
  }
29840
- function _isNativeFunction(fn2) {
29840
+ function _isNativeFunction(fn) {
29841
29841
  try {
29842
- return Function.toString.call(fn2).indexOf("[native code]") !== -1;
29842
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
29843
29843
  } catch (e) {
29844
- return typeof fn2 === "function";
29844
+ return typeof fn === "function";
29845
29845
  }
29846
29846
  }
29847
29847
  function _wrapNativeSuper(Class) {
@@ -42265,8 +42265,8 @@ var require_dcmjs2 = __commonJS({
42265
42265
  value: function getCornerstoneLabelFromDefaultState(defaultState) {
42266
42266
  var _defaultState$finding = defaultState.findingSites, findingSites = _defaultState$finding === void 0 ? [] : _defaultState$finding, finding = defaultState.finding;
42267
42267
  var cornersoneFreeTextCodingValue = CodingScheme.codeValues.CORNERSTONEFREETEXT;
42268
- var freeTextLabel = findingSites.find(function(fs4) {
42269
- return fs4.CodeValue === cornersoneFreeTextCodingValue;
42268
+ var freeTextLabel = findingSites.find(function(fs3) {
42269
+ return fs3.CodeValue === cornersoneFreeTextCodingValue;
42270
42270
  });
42271
42271
  if (freeTextLabel) {
42272
42272
  return freeTextLabel.CodeMeaning;
@@ -42997,7 +42997,7 @@ var require_dcmjs2 = __commonJS({
42997
42997
  var sqrLen = squaredLength;
42998
42998
  var forEach = (function() {
42999
42999
  var vec = create();
43000
- return function(a, stride, offset, count, fn2, arg) {
43000
+ return function(a, stride, offset, count, fn, arg) {
43001
43001
  var i, l3;
43002
43002
  if (!stride) {
43003
43003
  stride = 3;
@@ -43014,7 +43014,7 @@ var require_dcmjs2 = __commonJS({
43014
43014
  vec[0] = a[i];
43015
43015
  vec[1] = a[i + 1];
43016
43016
  vec[2] = a[i + 2];
43017
- fn2(vec, vec, arg);
43017
+ fn(vec, vec, arg);
43018
43018
  a[i] = vec[0];
43019
43019
  a[i + 1] = vec[1];
43020
43020
  a[i + 2] = vec[2];
@@ -55515,11 +55515,11 @@ var require_from = __commonJS({
55515
55515
  Promise.resolve(value).then(_next, _throw);
55516
55516
  }
55517
55517
  }
55518
- function _asyncToGenerator(fn2) {
55518
+ function _asyncToGenerator(fn) {
55519
55519
  return function() {
55520
55520
  var self2 = this, args = arguments;
55521
55521
  return new Promise(function(resolve2, reject) {
55522
- var gen = fn2.apply(self2, args);
55522
+ var gen = fn.apply(self2, args);
55523
55523
  function _next(value) {
55524
55524
  asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "next", value);
55525
55525
  }
@@ -55662,11 +55662,11 @@ var require_stream_readable = __commonJS({
55662
55662
  require_inherits()(Readable2, Stream);
55663
55663
  var errorOrDestroy = destroyImpl.errorOrDestroy;
55664
55664
  var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
55665
- function prependListener(emitter, event, fn2) {
55666
- if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn2);
55667
- if (!emitter._events || !emitter._events[event]) emitter.on(event, fn2);
55668
- else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn2);
55669
- else emitter._events[event] = [fn2, emitter._events[event]];
55665
+ function prependListener(emitter, event, fn) {
55666
+ if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn);
55667
+ if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);
55668
+ else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);
55669
+ else emitter._events[event] = [fn, emitter._events[event]];
55670
55670
  }
55671
55671
  function ReadableState(options, stream, isDuplex) {
55672
55672
  Duplex = Duplex || require_stream_duplex();
@@ -56114,8 +56114,8 @@ var require_stream_readable = __commonJS({
56114
56114
  dest.emit("unpipe", this, unpipeInfo);
56115
56115
  return this;
56116
56116
  };
56117
- Readable2.prototype.on = function(ev, fn2) {
56118
- var res = Stream.prototype.on.call(this, ev, fn2);
56117
+ Readable2.prototype.on = function(ev, fn) {
56118
+ var res = Stream.prototype.on.call(this, ev, fn);
56119
56119
  var state = this._readableState;
56120
56120
  if (ev === "data") {
56121
56121
  state.readableListening = this.listenerCount("readable") > 0;
@@ -56136,8 +56136,8 @@ var require_stream_readable = __commonJS({
56136
56136
  return res;
56137
56137
  };
56138
56138
  Readable2.prototype.addListener = Readable2.prototype.on;
56139
- Readable2.prototype.removeListener = function(ev, fn2) {
56140
- var res = Stream.prototype.removeListener.call(this, ev, fn2);
56139
+ Readable2.prototype.removeListener = function(ev, fn) {
56140
+ var res = Stream.prototype.removeListener.call(this, ev, fn);
56141
56141
  if (ev === "readable") {
56142
56142
  process.nextTick(updateReadableListening, this);
56143
56143
  }
@@ -56342,9 +56342,9 @@ var require_stream_readable = __commonJS({
56342
56342
  return from(Readable2, iterable, opts);
56343
56343
  };
56344
56344
  }
56345
- function indexOf(xs, x) {
56346
- for (var i = 0, l3 = xs.length; i < l3; i++) {
56347
- if (xs[i] === x) return i;
56345
+ function indexOf(xs2, x) {
56346
+ for (var i = 0, l3 = xs2.length; i < l3; i++) {
56347
+ if (xs2[i] === x) return i;
56348
56348
  }
56349
56349
  return -1;
56350
56350
  }
@@ -57213,10 +57213,10 @@ var require_initialParams = __commonJS({
57213
57213
  Object.defineProperty(exports2, "__esModule", {
57214
57214
  value: true
57215
57215
  });
57216
- exports2.default = function(fn2) {
57216
+ exports2.default = function(fn) {
57217
57217
  return function(...args) {
57218
57218
  var callback = args.pop();
57219
- return fn2.call(this, args, callback);
57219
+ return fn.call(this, args, callback);
57220
57220
  };
57221
57221
  };
57222
57222
  module2.exports = exports2.default;
@@ -57235,11 +57235,11 @@ var require_setImmediate = __commonJS({
57235
57235
  var hasQueueMicrotask = exports2.hasQueueMicrotask = typeof queueMicrotask === "function" && queueMicrotask;
57236
57236
  var hasSetImmediate = exports2.hasSetImmediate = typeof setImmediate === "function" && setImmediate;
57237
57237
  var hasNextTick = exports2.hasNextTick = typeof process === "object" && typeof process.nextTick === "function";
57238
- function fallback(fn2) {
57239
- setTimeout(fn2, 0);
57238
+ function fallback(fn) {
57239
+ setTimeout(fn, 0);
57240
57240
  }
57241
57241
  function wrap(defer) {
57242
- return (fn2, ...args) => defer(() => fn2(...args));
57242
+ return (fn, ...args) => defer(() => fn(...args));
57243
57243
  }
57244
57244
  var _defer;
57245
57245
  if (hasQueueMicrotask) {
@@ -57326,11 +57326,11 @@ var require_wrapAsync = __commonJS({
57326
57326
  function _interopRequireDefault(obj) {
57327
57327
  return obj && obj.__esModule ? obj : { default: obj };
57328
57328
  }
57329
- function isAsync(fn2) {
57330
- return fn2[Symbol.toStringTag] === "AsyncFunction";
57329
+ function isAsync(fn) {
57330
+ return fn[Symbol.toStringTag] === "AsyncFunction";
57331
57331
  }
57332
- function isAsyncGenerator(fn2) {
57333
- return fn2[Symbol.toStringTag] === "AsyncGenerator";
57332
+ function isAsyncGenerator(fn) {
57333
+ return fn[Symbol.toStringTag] === "AsyncGenerator";
57334
57334
  }
57335
57335
  function isAsyncIterable(obj) {
57336
57336
  return typeof obj[Symbol.asyncIterator] === "function";
@@ -57415,14 +57415,14 @@ var require_once = __commonJS({
57415
57415
  value: true
57416
57416
  });
57417
57417
  exports2.default = once;
57418
- function once(fn2) {
57418
+ function once(fn) {
57419
57419
  function wrapper(...args) {
57420
- if (fn2 === null) return;
57421
- var callFn = fn2;
57422
- fn2 = null;
57420
+ if (fn === null) return;
57421
+ var callFn = fn;
57422
+ fn = null;
57423
57423
  callFn.apply(this, args);
57424
57424
  }
57425
- Object.assign(wrapper, fn2);
57425
+ Object.assign(wrapper, fn);
57426
57426
  return wrapper;
57427
57427
  }
57428
57428
  module2.exports = exports2.default;
@@ -57505,11 +57505,11 @@ var require_onlyOnce = __commonJS({
57505
57505
  value: true
57506
57506
  });
57507
57507
  exports2.default = onlyOnce;
57508
- function onlyOnce(fn2) {
57508
+ function onlyOnce(fn) {
57509
57509
  return function(...args) {
57510
- if (fn2 === null) throw new Error("Callback was already called.");
57511
- var callFn = fn2;
57512
- fn2 = null;
57510
+ if (fn === null) throw new Error("Callback was already called.");
57511
+ var callFn = fn;
57512
+ fn = null;
57513
57513
  callFn.apply(this, args);
57514
57514
  };
57515
57515
  }
@@ -57756,14 +57756,14 @@ var require_stream_transform = __commonJS({
57756
57756
  var Duplex = require_stream_duplex();
57757
57757
  require_inherits()(Transform, Duplex);
57758
57758
  function afterTransform(er, data2) {
57759
- var ts2 = this._transformState;
57760
- ts2.transforming = false;
57761
- var cb = ts2.writecb;
57759
+ var ts = this._transformState;
57760
+ ts.transforming = false;
57761
+ var cb = ts.writecb;
57762
57762
  if (cb === null) {
57763
57763
  return this.emit("error", new ERR_MULTIPLE_CALLBACK());
57764
57764
  }
57765
- ts2.writechunk = null;
57766
- ts2.writecb = null;
57765
+ ts.writechunk = null;
57766
+ ts.writecb = null;
57767
57767
  if (data2 != null)
57768
57768
  this.push(data2);
57769
57769
  cb(er);
@@ -57810,22 +57810,22 @@ var require_stream_transform = __commonJS({
57810
57810
  cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"));
57811
57811
  };
57812
57812
  Transform.prototype._write = function(chunk, encoding, cb) {
57813
- var ts2 = this._transformState;
57814
- ts2.writecb = cb;
57815
- ts2.writechunk = chunk;
57816
- ts2.writeencoding = encoding;
57817
- if (!ts2.transforming) {
57813
+ var ts = this._transformState;
57814
+ ts.writecb = cb;
57815
+ ts.writechunk = chunk;
57816
+ ts.writeencoding = encoding;
57817
+ if (!ts.transforming) {
57818
57818
  var rs2 = this._readableState;
57819
- if (ts2.needTransform || rs2.needReadable || rs2.length < rs2.highWaterMark) this._read(rs2.highWaterMark);
57819
+ if (ts.needTransform || rs2.needReadable || rs2.length < rs2.highWaterMark) this._read(rs2.highWaterMark);
57820
57820
  }
57821
57821
  };
57822
57822
  Transform.prototype._read = function(n) {
57823
- var ts2 = this._transformState;
57824
- if (ts2.writechunk !== null && !ts2.transforming) {
57825
- ts2.transforming = true;
57826
- this._transform(ts2.writechunk, ts2.writeencoding, ts2.afterTransform);
57823
+ var ts = this._transformState;
57824
+ if (ts.writechunk !== null && !ts.transforming) {
57825
+ ts.transforming = true;
57826
+ this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
57827
57827
  } else {
57828
- ts2.needTransform = true;
57828
+ ts.needTransform = true;
57829
57829
  }
57830
57830
  };
57831
57831
  Transform.prototype._destroy = function(err, cb) {
@@ -57908,8 +57908,8 @@ var require_pipeline = __commonJS({
57908
57908
  callback(err || new ERR_STREAM_DESTROYED("pipe"));
57909
57909
  };
57910
57910
  }
57911
- function call(fn2) {
57912
- fn2();
57911
+ function call(fn) {
57912
+ fn();
57913
57913
  }
57914
57914
  function pipe(from, to) {
57915
57915
  return from.pipe(to);
@@ -57997,17 +57997,17 @@ var require_diagnostics = __commonJS({
57997
57997
  if (!async.length) return false;
57998
57998
  return new Promise(function pinky(resolve2) {
57999
57999
  Promise.all(
58000
- async.map(function prebind(fn2) {
58001
- return fn2(namespace);
58000
+ async.map(function prebind(fn) {
58001
+ return fn(namespace);
58002
58002
  })
58003
58003
  ).then(function resolved(values) {
58004
58004
  resolve2(values.some(Boolean));
58005
58005
  });
58006
58006
  });
58007
58007
  }
58008
- function modify(fn2) {
58009
- if (~modifiers.indexOf(fn2)) return false;
58010
- modifiers.push(fn2);
58008
+ function modify(fn) {
58009
+ if (~modifiers.indexOf(fn)) return false;
58010
+ modifiers.push(fn);
58011
58011
  return true;
58012
58012
  }
58013
58013
  function write() {
@@ -58019,14 +58019,14 @@ var require_diagnostics = __commonJS({
58019
58019
  }
58020
58020
  return message;
58021
58021
  }
58022
- function introduce(fn2, options) {
58022
+ function introduce(fn, options) {
58023
58023
  var has = Object.prototype.hasOwnProperty;
58024
58024
  for (var key in options) {
58025
58025
  if (has.call(options, key)) {
58026
- fn2[key] = options[key];
58026
+ fn[key] = options[key];
58027
58027
  }
58028
58028
  }
58029
- return fn2;
58029
+ return fn;
58030
58030
  }
58031
58031
  function nope(options) {
58032
58032
  options.enabled = false;
@@ -58666,13 +58666,13 @@ var require_index_cjs = __commonJS({
58666
58666
  const h3 = hsv[0] / 60;
58667
58667
  const s = hsv[1] / 100;
58668
58668
  let v2 = hsv[2] / 100;
58669
- const hi = Math.floor(h3) % 6;
58669
+ const hi2 = Math.floor(h3) % 6;
58670
58670
  const f3 = h3 - Math.floor(h3);
58671
58671
  const p2 = 255 * v2 * (1 - s);
58672
58672
  const q2 = 255 * v2 * (1 - s * f3);
58673
58673
  const t = 255 * v2 * (1 - s * (1 - f3));
58674
58674
  v2 *= 255;
58675
- switch (hi) {
58675
+ switch (hi2) {
58676
58676
  case 0: {
58677
58677
  return [v2, t, p2];
58678
58678
  }
@@ -58710,21 +58710,21 @@ var require_index_cjs = __commonJS({
58710
58710
  };
58711
58711
  convert$1.hwb.rgb = function(hwb) {
58712
58712
  const h3 = hwb[0] / 360;
58713
- let wh2 = hwb[1] / 100;
58714
- let bl = hwb[2] / 100;
58715
- const ratio = wh2 + bl;
58713
+ let wh = hwb[1] / 100;
58714
+ let bl2 = hwb[2] / 100;
58715
+ const ratio = wh + bl2;
58716
58716
  let f3;
58717
58717
  if (ratio > 1) {
58718
- wh2 /= ratio;
58719
- bl /= ratio;
58718
+ wh /= ratio;
58719
+ bl2 /= ratio;
58720
58720
  }
58721
58721
  const i = Math.floor(6 * h3);
58722
- const v2 = 1 - bl;
58722
+ const v2 = 1 - bl2;
58723
58723
  f3 = 6 * h3 - i;
58724
58724
  if ((i & 1) !== 0) {
58725
58725
  f3 = 1 - f3;
58726
58726
  }
58727
- const n = wh2 + f3 * (v2 - wh2);
58727
+ const n = wh + f3 * (v2 - wh);
58728
58728
  let r6;
58729
58729
  let g3;
58730
58730
  let b3;
@@ -58734,36 +58734,36 @@ var require_index_cjs = __commonJS({
58734
58734
  case 0: {
58735
58735
  r6 = v2;
58736
58736
  g3 = n;
58737
- b3 = wh2;
58737
+ b3 = wh;
58738
58738
  break;
58739
58739
  }
58740
58740
  case 1: {
58741
58741
  r6 = n;
58742
58742
  g3 = v2;
58743
- b3 = wh2;
58743
+ b3 = wh;
58744
58744
  break;
58745
58745
  }
58746
58746
  case 2: {
58747
- r6 = wh2;
58747
+ r6 = wh;
58748
58748
  g3 = v2;
58749
58749
  b3 = n;
58750
58750
  break;
58751
58751
  }
58752
58752
  case 3: {
58753
- r6 = wh2;
58753
+ r6 = wh;
58754
58754
  g3 = n;
58755
58755
  b3 = v2;
58756
58756
  break;
58757
58757
  }
58758
58758
  case 4: {
58759
58759
  r6 = n;
58760
- g3 = wh2;
58760
+ g3 = wh;
58761
58761
  b3 = v2;
58762
58762
  break;
58763
58763
  }
58764
58764
  case 5: {
58765
58765
  r6 = v2;
58766
- g3 = wh2;
58766
+ g3 = wh;
58767
58767
  b3 = n;
58768
58768
  break;
58769
58769
  }
@@ -59026,11 +59026,11 @@ var require_index_cjs = __commonJS({
59026
59026
  return [g3 * 255, g3 * 255, g3 * 255];
59027
59027
  }
59028
59028
  const pure = [0, 0, 0];
59029
- const hi = h3 % 1 * 6;
59030
- const v2 = hi % 1;
59029
+ const hi2 = h3 % 1 * 6;
59030
+ const v2 = hi2 % 1;
59031
59031
  const w2 = 1 - v2;
59032
59032
  let mg = 0;
59033
- switch (Math.floor(hi)) {
59033
+ switch (Math.floor(hi2)) {
59034
59034
  case 0: {
59035
59035
  pure[0] = 1;
59036
59036
  pure[1] = v2;
@@ -59184,15 +59184,15 @@ var require_index_cjs = __commonJS({
59184
59184
  }
59185
59185
  function wrapConversion(toModel, graph) {
59186
59186
  const path4 = [graph[toModel].parent, toModel];
59187
- let fn2 = convert$1[graph[toModel].parent][toModel];
59187
+ let fn = convert$1[graph[toModel].parent][toModel];
59188
59188
  let cur = graph[toModel].parent;
59189
59189
  while (graph[cur].parent) {
59190
59190
  path4.unshift(graph[cur].parent);
59191
- fn2 = link(convert$1[graph[cur].parent][cur], fn2);
59191
+ fn = link(convert$1[graph[cur].parent][cur], fn);
59192
59192
  cur = graph[cur].parent;
59193
59193
  }
59194
- fn2.conversion = path4;
59195
- return fn2;
59194
+ fn.conversion = path4;
59195
+ return fn;
59196
59196
  }
59197
59197
  function route(fromModel) {
59198
59198
  const graph = deriveBFS(fromModel);
@@ -59210,7 +59210,7 @@ var require_index_cjs = __commonJS({
59210
59210
  }
59211
59211
  var convert = {};
59212
59212
  var models = Object.keys(convert$1);
59213
- function wrapRaw(fn2) {
59213
+ function wrapRaw(fn) {
59214
59214
  const wrappedFn = function(...args) {
59215
59215
  const arg0 = args[0];
59216
59216
  if (arg0 === void 0 || arg0 === null) {
@@ -59219,14 +59219,14 @@ var require_index_cjs = __commonJS({
59219
59219
  if (arg0.length > 1) {
59220
59220
  args = arg0;
59221
59221
  }
59222
- return fn2(args);
59222
+ return fn(args);
59223
59223
  };
59224
- if ("conversion" in fn2) {
59225
- wrappedFn.conversion = fn2.conversion;
59224
+ if ("conversion" in fn) {
59225
+ wrappedFn.conversion = fn.conversion;
59226
59226
  }
59227
59227
  return wrappedFn;
59228
59228
  }
59229
- function wrapRounded(fn2) {
59229
+ function wrapRounded(fn) {
59230
59230
  const wrappedFn = function(...args) {
59231
59231
  const arg0 = args[0];
59232
59232
  if (arg0 === void 0 || arg0 === null) {
@@ -59235,7 +59235,7 @@ var require_index_cjs = __commonJS({
59235
59235
  if (arg0.length > 1) {
59236
59236
  args = arg0;
59237
59237
  }
59238
- const result = fn2(args);
59238
+ const result = fn(args);
59239
59239
  if (typeof result === "object") {
59240
59240
  for (let { length } = result, i = 0; i < length; i++) {
59241
59241
  result[i] = Math.round(result[i]);
@@ -59243,8 +59243,8 @@ var require_index_cjs = __commonJS({
59243
59243
  }
59244
59244
  return result;
59245
59245
  };
59246
- if ("conversion" in fn2) {
59247
- wrappedFn.conversion = fn2.conversion;
59246
+ if ("conversion" in fn) {
59247
+ wrappedFn.conversion = fn.conversion;
59248
59248
  }
59249
59249
  return wrappedFn;
59250
59250
  }
@@ -59255,9 +59255,9 @@ var require_index_cjs = __commonJS({
59255
59255
  const routes = route(fromModel);
59256
59256
  const routeModels = Object.keys(routes);
59257
59257
  for (const toModel of routeModels) {
59258
- const fn2 = routes[toModel];
59259
- convert[fromModel][toModel] = wrapRounded(fn2);
59260
- convert[fromModel][toModel].raw = wrapRaw(fn2);
59258
+ const fn = routes[toModel];
59259
+ convert[fromModel][toModel] = wrapRounded(fn);
59260
+ convert[fromModel][toModel].raw = wrapRaw(fn);
59261
59261
  }
59262
59262
  }
59263
59263
  var skippedModels = [
@@ -59751,10 +59751,10 @@ var require_adapters = __commonJS({
59751
59751
  "../../node_modules/@dabh/diagnostics/adapters/index.js"(exports2, module2) {
59752
59752
  "use strict";
59753
59753
  var enabled = require_enabled();
59754
- module2.exports = function create(fn2) {
59754
+ module2.exports = function create(fn) {
59755
59755
  return function adapter(namespace) {
59756
59756
  try {
59757
- return enabled(namespace, fn2());
59757
+ return enabled(namespace, fn());
59758
59758
  } catch (e) {
59759
59759
  }
59760
59760
  return false;
@@ -59827,7 +59827,7 @@ var require_node2 = __commonJS({
59827
59827
  var require_tail_file = __commonJS({
59828
59828
  "../../node_modules/winston/lib/winston/tail-file.js"(exports2, module2) {
59829
59829
  "use strict";
59830
- var fs4 = require("fs");
59830
+ var fs3 = require("fs");
59831
59831
  var { StringDecoder } = require("string_decoder");
59832
59832
  var { Stream } = require_readable();
59833
59833
  function noop() {
@@ -59848,7 +59848,7 @@ var require_tail_file = __commonJS({
59848
59848
  stream.emit("end");
59849
59849
  stream.emit("close");
59850
59850
  };
59851
- fs4.open(options.file, "a+", "0644", (err, fd) => {
59851
+ fs3.open(options.file, "a+", "0644", (err, fd) => {
59852
59852
  if (err) {
59853
59853
  if (!iter) {
59854
59854
  stream.emit("error", err);
@@ -59860,10 +59860,10 @@ var require_tail_file = __commonJS({
59860
59860
  }
59861
59861
  (function read() {
59862
59862
  if (stream.destroyed) {
59863
- fs4.close(fd, noop);
59863
+ fs3.close(fd, noop);
59864
59864
  return;
59865
59865
  }
59866
- return fs4.read(fd, buffer2, 0, buffer2.length, pos, (error, bytes) => {
59866
+ return fs3.read(fd, buffer2, 0, buffer2.length, pos, (error, bytes) => {
59867
59867
  if (error) {
59868
59868
  if (!iter) {
59869
59869
  stream.emit("error", error);
@@ -59922,7 +59922,7 @@ var require_tail_file = __commonJS({
59922
59922
  var require_file = __commonJS({
59923
59923
  "../../node_modules/winston/lib/winston/transports/file.js"(exports2, module2) {
59924
59924
  "use strict";
59925
- var fs4 = require("fs");
59925
+ var fs3 = require("fs");
59926
59926
  var path4 = require("path");
59927
59927
  var asyncSeries = require_series();
59928
59928
  var zlib = require("zlib");
@@ -60105,7 +60105,7 @@ var require_file = __commonJS({
60105
60105
  let buff = "";
60106
60106
  let results = [];
60107
60107
  let row = 0;
60108
- const stream = fs4.createReadStream(file, {
60108
+ const stream = fs3.createReadStream(file, {
60109
60109
  encoding: "utf8"
60110
60110
  });
60111
60111
  stream.on("error", (err) => {
@@ -60257,7 +60257,7 @@ var require_file = __commonJS({
60257
60257
  stat(callback) {
60258
60258
  const target = this._getFile();
60259
60259
  const fullpath = path4.join(this.dirname, target);
60260
- fs4.stat(fullpath, (err, stat) => {
60260
+ fs3.stat(fullpath, (err, stat) => {
60261
60261
  if (err && err.code === "ENOENT") {
60262
60262
  debug("ENOENT\xA0ok", fullpath);
60263
60263
  this.filename = target;
@@ -60362,7 +60362,7 @@ var require_file = __commonJS({
60362
60362
  _createStream(source) {
60363
60363
  const fullpath = path4.join(this.dirname, this.filename);
60364
60364
  debug("create stream start", fullpath, this.options);
60365
- const dest = fs4.createWriteStream(fullpath, this.options).on("error", (err) => debug(err)).on("close", () => debug("close", dest.path, dest.bytesWritten)).on("open", () => {
60365
+ const dest = fs3.createWriteStream(fullpath, this.options).on("error", (err) => debug(err)).on("close", () => debug("close", dest.path, dest.bytesWritten)).on("open", () => {
60366
60366
  debug("file open ok", fullpath);
60367
60367
  this.emit("open", fullpath);
60368
60368
  source.pipe(dest);
@@ -60441,7 +60441,7 @@ var require_file = __commonJS({
60441
60441
  const isZipped = this.zippedArchive ? ".gz" : "";
60442
60442
  const filePath = `${basename}${isOldest}${ext}${isZipped}`;
60443
60443
  const target = path4.join(this.dirname, filePath);
60444
- fs4.unlink(target, callback);
60444
+ fs3.unlink(target, callback);
60445
60445
  }
60446
60446
  /**
60447
60447
  * Roll files forward based on integer, up to maxFiles. e.g. if base if
@@ -60464,17 +60464,17 @@ var require_file = __commonJS({
60464
60464
  tasks.push(function(i, cb) {
60465
60465
  let fileName = `${basename}${i - 1}${ext}${isZipped}`;
60466
60466
  const tmppath = path4.join(this.dirname, fileName);
60467
- fs4.exists(tmppath, (exists) => {
60467
+ fs3.exists(tmppath, (exists) => {
60468
60468
  if (!exists) {
60469
60469
  return cb(null);
60470
60470
  }
60471
60471
  fileName = `${basename}${i}${ext}${isZipped}`;
60472
- fs4.rename(tmppath, path4.join(this.dirname, fileName), cb);
60472
+ fs3.rename(tmppath, path4.join(this.dirname, fileName), cb);
60473
60473
  });
60474
60474
  }.bind(this, x));
60475
60475
  }
60476
60476
  asyncSeries(tasks, () => {
60477
- fs4.rename(
60477
+ fs3.rename(
60478
60478
  path4.join(this.dirname, `${basename}${ext}${isZipped}`),
60479
60479
  path4.join(this.dirname, `${basename}1${ext}${isZipped}`),
60480
60480
  callback
@@ -60490,22 +60490,22 @@ var require_file = __commonJS({
60490
60490
  * @private
60491
60491
  */
60492
60492
  _compressFile(src, dest, callback) {
60493
- fs4.access(src, fs4.F_OK, (err) => {
60493
+ fs3.access(src, fs3.F_OK, (err) => {
60494
60494
  if (err) {
60495
60495
  return callback();
60496
60496
  }
60497
60497
  var gzip = zlib.createGzip();
60498
- var inp = fs4.createReadStream(src);
60499
- var out = fs4.createWriteStream(dest);
60498
+ var inp = fs3.createReadStream(src);
60499
+ var out = fs3.createWriteStream(dest);
60500
60500
  out.on("finish", () => {
60501
- fs4.unlink(src, callback);
60501
+ fs3.unlink(src, callback);
60502
60502
  });
60503
60503
  inp.pipe(gzip).pipe(out);
60504
60504
  });
60505
60505
  }
60506
60506
  _createLogDirIfNotExist(dirPath) {
60507
- if (!fs4.existsSync(dirPath)) {
60508
- fs4.mkdirSync(dirPath, { recursive: true });
60507
+ if (!fs3.existsSync(dirPath)) {
60508
+ fs3.mkdirSync(dirPath, { recursive: true });
60509
60509
  }
60510
60510
  }
60511
60511
  };
@@ -60943,14 +60943,14 @@ var require_fn = __commonJS({
60943
60943
  "../../node_modules/fn.name/index.js"(exports2, module2) {
60944
60944
  "use strict";
60945
60945
  var toString = Object.prototype.toString;
60946
- module2.exports = function name(fn2) {
60947
- if ("string" === typeof fn2.displayName && fn2.constructor.name) {
60948
- return fn2.displayName;
60949
- } else if ("string" === typeof fn2.name && fn2.name) {
60950
- return fn2.name;
60951
- }
60952
- if ("object" === typeof fn2 && fn2.constructor && "string" === typeof fn2.constructor.name) return fn2.constructor.name;
60953
- var named = fn2.toString(), type = toString.call(fn2).slice(8, -1);
60946
+ module2.exports = function name(fn) {
60947
+ if ("string" === typeof fn.displayName && fn.constructor.name) {
60948
+ return fn.displayName;
60949
+ } else if ("string" === typeof fn.name && fn.name) {
60950
+ return fn.name;
60951
+ }
60952
+ if ("object" === typeof fn && fn.constructor && "string" === typeof fn.constructor.name) return fn.constructor.name;
60953
+ var named = fn.toString(), type = toString.call(fn).slice(8, -1);
60954
60954
  if ("Function" === type) {
60955
60955
  named = named.substring(named.indexOf("(") + 1, named.indexOf(")"));
60956
60956
  } else {
@@ -60966,16 +60966,16 @@ var require_one_time = __commonJS({
60966
60966
  "../../node_modules/one-time/index.js"(exports2, module2) {
60967
60967
  "use strict";
60968
60968
  var name = require_fn();
60969
- module2.exports = function one(fn2) {
60969
+ module2.exports = function one(fn) {
60970
60970
  var called = 0, value;
60971
60971
  function onetime() {
60972
60972
  if (called) return value;
60973
60973
  called = 1;
60974
- value = fn2.apply(this, arguments);
60975
- fn2 = null;
60974
+ value = fn.apply(this, arguments);
60975
+ fn = null;
60976
60976
  return value;
60977
60977
  }
60978
- onetime.displayName = name(fn2);
60978
+ onetime.displayName = name(fn);
60979
60979
  return onetime;
60980
60980
  };
60981
60981
  }
@@ -62614,18 +62614,18 @@ var require_object_hash = __commonJS({
62614
62614
  write("string:" + string.length + ":");
62615
62615
  write(string.toString());
62616
62616
  },
62617
- _function: function(fn2) {
62617
+ _function: function(fn) {
62618
62618
  write("fn:");
62619
- if (isNativeFunction(fn2)) {
62619
+ if (isNativeFunction(fn)) {
62620
62620
  this.dispatch("[native]");
62621
62621
  } else {
62622
- this.dispatch(fn2.toString());
62622
+ this.dispatch(fn.toString());
62623
62623
  }
62624
62624
  if (options.respectFunctionNames !== false) {
62625
- this.dispatch("function-name:" + String(fn2.name));
62625
+ this.dispatch("function-name:" + String(fn.name));
62626
62626
  }
62627
62627
  if (options.respectFunctionProperties) {
62628
- this._object(fn2);
62628
+ this._object(fn);
62629
62629
  }
62630
62630
  },
62631
62631
  _number: function(number) {
@@ -62829,10 +62829,10 @@ var require_moment = __commonJS({
62829
62829
  function isDate(input) {
62830
62830
  return input instanceof Date || Object.prototype.toString.call(input) === "[object Date]";
62831
62831
  }
62832
- function map(arr, fn2) {
62832
+ function map(arr, fn) {
62833
62833
  var res = [], i, arrLen = arr.length;
62834
62834
  for (i = 0; i < arrLen; ++i) {
62835
- res.push(fn2(arr[i], i));
62835
+ res.push(fn(arr[i], i));
62836
62836
  }
62837
62837
  return res;
62838
62838
  }
@@ -62985,7 +62985,7 @@ var require_moment = __commonJS({
62985
62985
  console.warn("Deprecation warning: " + msg);
62986
62986
  }
62987
62987
  }
62988
- function deprecate(msg, fn2) {
62988
+ function deprecate(msg, fn) {
62989
62989
  var firstTime = true;
62990
62990
  return extend(function() {
62991
62991
  if (hooks.deprecationHandler != null) {
@@ -63013,8 +63013,8 @@ var require_moment = __commonJS({
63013
63013
  );
63014
63014
  firstTime = false;
63015
63015
  }
63016
- return fn2.apply(this, arguments);
63017
- }, fn2);
63016
+ return fn.apply(this, arguments);
63017
+ }, fn);
63018
63018
  }
63019
63019
  var deprecations = {};
63020
63020
  function deprecateSimple(name, msg) {
@@ -63595,7 +63595,7 @@ var require_moment = __commonJS({
63595
63595
  return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format2) ? "format" : "standalone"][m.month()];
63596
63596
  }
63597
63597
  function handleStrictParse(monthName, format2, strict) {
63598
- var i, ii, mom, llc = monthName.toLocaleLowerCase();
63598
+ var i, ii2, mom, llc = monthName.toLocaleLowerCase();
63599
63599
  if (!this._monthsParse) {
63600
63600
  this._monthsParse = [];
63601
63601
  this._longMonthsParse = [];
@@ -63611,27 +63611,27 @@ var require_moment = __commonJS({
63611
63611
  }
63612
63612
  if (strict) {
63613
63613
  if (format2 === "MMM") {
63614
- ii = indexOf.call(this._shortMonthsParse, llc);
63615
- return ii !== -1 ? ii : null;
63614
+ ii2 = indexOf.call(this._shortMonthsParse, llc);
63615
+ return ii2 !== -1 ? ii2 : null;
63616
63616
  } else {
63617
- ii = indexOf.call(this._longMonthsParse, llc);
63618
- return ii !== -1 ? ii : null;
63617
+ ii2 = indexOf.call(this._longMonthsParse, llc);
63618
+ return ii2 !== -1 ? ii2 : null;
63619
63619
  }
63620
63620
  } else {
63621
63621
  if (format2 === "MMM") {
63622
- ii = indexOf.call(this._shortMonthsParse, llc);
63623
- if (ii !== -1) {
63624
- return ii;
63622
+ ii2 = indexOf.call(this._shortMonthsParse, llc);
63623
+ if (ii2 !== -1) {
63624
+ return ii2;
63625
63625
  }
63626
- ii = indexOf.call(this._longMonthsParse, llc);
63627
- return ii !== -1 ? ii : null;
63626
+ ii2 = indexOf.call(this._longMonthsParse, llc);
63627
+ return ii2 !== -1 ? ii2 : null;
63628
63628
  } else {
63629
- ii = indexOf.call(this._longMonthsParse, llc);
63630
- if (ii !== -1) {
63631
- return ii;
63629
+ ii2 = indexOf.call(this._longMonthsParse, llc);
63630
+ if (ii2 !== -1) {
63631
+ return ii2;
63632
63632
  }
63633
- ii = indexOf.call(this._shortMonthsParse, llc);
63634
- return ii !== -1 ? ii : null;
63633
+ ii2 = indexOf.call(this._shortMonthsParse, llc);
63634
+ return ii2 !== -1 ? ii2 : null;
63635
63635
  }
63636
63636
  }
63637
63637
  }
@@ -63935,7 +63935,7 @@ var require_moment = __commonJS({
63935
63935
  return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin;
63936
63936
  }
63937
63937
  function handleStrictParse$1(weekdayName, format2, strict) {
63938
- var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
63938
+ var i, ii2, mom, llc = weekdayName.toLocaleLowerCase();
63939
63939
  if (!this._weekdaysParse) {
63940
63940
  this._weekdaysParse = [];
63941
63941
  this._shortWeekdaysParse = [];
@@ -63955,49 +63955,49 @@ var require_moment = __commonJS({
63955
63955
  }
63956
63956
  if (strict) {
63957
63957
  if (format2 === "dddd") {
63958
- ii = indexOf.call(this._weekdaysParse, llc);
63959
- return ii !== -1 ? ii : null;
63958
+ ii2 = indexOf.call(this._weekdaysParse, llc);
63959
+ return ii2 !== -1 ? ii2 : null;
63960
63960
  } else if (format2 === "ddd") {
63961
- ii = indexOf.call(this._shortWeekdaysParse, llc);
63962
- return ii !== -1 ? ii : null;
63961
+ ii2 = indexOf.call(this._shortWeekdaysParse, llc);
63962
+ return ii2 !== -1 ? ii2 : null;
63963
63963
  } else {
63964
- ii = indexOf.call(this._minWeekdaysParse, llc);
63965
- return ii !== -1 ? ii : null;
63964
+ ii2 = indexOf.call(this._minWeekdaysParse, llc);
63965
+ return ii2 !== -1 ? ii2 : null;
63966
63966
  }
63967
63967
  } else {
63968
63968
  if (format2 === "dddd") {
63969
- ii = indexOf.call(this._weekdaysParse, llc);
63970
- if (ii !== -1) {
63971
- return ii;
63969
+ ii2 = indexOf.call(this._weekdaysParse, llc);
63970
+ if (ii2 !== -1) {
63971
+ return ii2;
63972
63972
  }
63973
- ii = indexOf.call(this._shortWeekdaysParse, llc);
63974
- if (ii !== -1) {
63975
- return ii;
63973
+ ii2 = indexOf.call(this._shortWeekdaysParse, llc);
63974
+ if (ii2 !== -1) {
63975
+ return ii2;
63976
63976
  }
63977
- ii = indexOf.call(this._minWeekdaysParse, llc);
63978
- return ii !== -1 ? ii : null;
63977
+ ii2 = indexOf.call(this._minWeekdaysParse, llc);
63978
+ return ii2 !== -1 ? ii2 : null;
63979
63979
  } else if (format2 === "ddd") {
63980
- ii = indexOf.call(this._shortWeekdaysParse, llc);
63981
- if (ii !== -1) {
63982
- return ii;
63980
+ ii2 = indexOf.call(this._shortWeekdaysParse, llc);
63981
+ if (ii2 !== -1) {
63982
+ return ii2;
63983
63983
  }
63984
- ii = indexOf.call(this._weekdaysParse, llc);
63985
- if (ii !== -1) {
63986
- return ii;
63984
+ ii2 = indexOf.call(this._weekdaysParse, llc);
63985
+ if (ii2 !== -1) {
63986
+ return ii2;
63987
63987
  }
63988
- ii = indexOf.call(this._minWeekdaysParse, llc);
63989
- return ii !== -1 ? ii : null;
63988
+ ii2 = indexOf.call(this._minWeekdaysParse, llc);
63989
+ return ii2 !== -1 ? ii2 : null;
63990
63990
  } else {
63991
- ii = indexOf.call(this._minWeekdaysParse, llc);
63992
- if (ii !== -1) {
63993
- return ii;
63991
+ ii2 = indexOf.call(this._minWeekdaysParse, llc);
63992
+ if (ii2 !== -1) {
63993
+ return ii2;
63994
63994
  }
63995
- ii = indexOf.call(this._weekdaysParse, llc);
63996
- if (ii !== -1) {
63997
- return ii;
63995
+ ii2 = indexOf.call(this._weekdaysParse, llc);
63996
+ if (ii2 !== -1) {
63997
+ return ii2;
63998
63998
  }
63999
- ii = indexOf.call(this._shortWeekdaysParse, llc);
64000
- return ii !== -1 ? ii : null;
63999
+ ii2 = indexOf.call(this._shortWeekdaysParse, llc);
64000
+ return ii2 !== -1 ? ii2 : null;
64001
64001
  }
64002
64002
  }
64003
64003
  }
@@ -64981,7 +64981,7 @@ var require_moment = __commonJS({
64981
64981
  }
64982
64982
  }
64983
64983
  );
64984
- function pickBy(fn2, moments) {
64984
+ function pickBy(fn, moments) {
64985
64985
  var res, i;
64986
64986
  if (moments.length === 1 && isArray(moments[0])) {
64987
64987
  moments = moments[0];
@@ -64991,7 +64991,7 @@ var require_moment = __commonJS({
64991
64991
  }
64992
64992
  res = moments[0];
64993
64993
  for (i = 1; i < moments.length; ++i) {
64994
- if (!moments[i].isValid() || moments[i][fn2](res)) {
64994
+ if (!moments[i].isValid() || moments[i][fn](res)) {
64995
64995
  res = moments[i];
64996
64996
  }
64997
64997
  }
@@ -66788,7 +66788,7 @@ var require_moment = __commonJS({
66788
66788
  var require_FileStreamRotator = __commonJS({
66789
66789
  "../../node_modules/file-stream-rotator/FileStreamRotator.js"(exports2, module2) {
66790
66790
  "use strict";
66791
- var fs4 = require("fs");
66791
+ var fs3 = require("fs");
66792
66792
  var path4 = require("path");
66793
66793
  var moment = require_moment();
66794
66794
  var crypto2 = require("crypto");
@@ -66883,10 +66883,10 @@ var require_FileStreamRotator = __commonJS({
66883
66883
  try {
66884
66884
  if (audit_file) {
66885
66885
  var full_path = path4.resolve(audit_file);
66886
- _rtn = JSON.parse(fs4.readFileSync(full_path, { encoding: "utf-8" }));
66886
+ _rtn = JSON.parse(fs3.readFileSync(full_path, { encoding: "utf-8" }));
66887
66887
  } else {
66888
66888
  var full_path = path4.resolve(baseLog + "/.audit.json");
66889
- _rtn = JSON.parse(fs4.readFileSync(full_path, { encoding: "utf-8" }));
66889
+ _rtn = JSON.parse(fs3.readFileSync(full_path, { encoding: "utf-8" }));
66890
66890
  }
66891
66891
  } catch (e) {
66892
66892
  if (e.code !== "ENOENT") {
@@ -66912,7 +66912,7 @@ var require_FileStreamRotator = __commonJS({
66912
66912
  FileStreamRotator.writeAuditLog = function(audit, verbose) {
66913
66913
  try {
66914
66914
  mkDirForFile(audit.auditLog);
66915
- fs4.writeFileSync(audit.auditLog, JSON.stringify(audit, null, 4));
66915
+ fs3.writeFileSync(audit.auditLog, JSON.stringify(audit, null, 4));
66916
66916
  } catch (e) {
66917
66917
  if (verbose) {
66918
66918
  console.error(/* @__PURE__ */ new Date(), "[FileStreamRotator] Failed to store log audit at:", audit.auditLog, "Error:", e);
@@ -66922,8 +66922,8 @@ var require_FileStreamRotator = __commonJS({
66922
66922
  function removeFile(file, verbose) {
66923
66923
  if (file.hash === crypto2.createHash(file.hashType).update(file.name + "LOG_FILE" + file.date).digest("hex")) {
66924
66924
  try {
66925
- if (fs4.existsSync(file.name)) {
66926
- fs4.unlinkSync(file.name);
66925
+ if (fs3.existsSync(file.name)) {
66926
+ fs3.unlinkSync(file.name);
66927
66927
  }
66928
66928
  } catch (e) {
66929
66929
  if (verbose) {
@@ -66938,15 +66938,15 @@ var require_FileStreamRotator = __commonJS({
66938
66938
  let logfileName = path4.basename(logfile);
66939
66939
  let current = logPath + "/" + symLinkName;
66940
66940
  try {
66941
- let stats = fs4.lstatSync(current);
66941
+ let stats = fs3.lstatSync(current);
66942
66942
  if (stats.isSymbolicLink()) {
66943
- fs4.unlinkSync(current);
66944
- fs4.symlinkSync(logfileName, current);
66943
+ fs3.unlinkSync(current);
66944
+ fs3.symlinkSync(logfileName, current);
66945
66945
  }
66946
66946
  } catch (err) {
66947
66947
  if (err && err.code == "ENOENT") {
66948
66948
  try {
66949
- fs4.symlinkSync(logfileName, current);
66949
+ fs3.symlinkSync(logfileName, current);
66950
66950
  } catch (e) {
66951
66951
  if (verbose) {
66952
66952
  console.error(/* @__PURE__ */ new Date(), "[FileStreamRotator] Could not create symlink file: ", current, " -> ", logfileName);
@@ -66958,11 +66958,11 @@ var require_FileStreamRotator = __commonJS({
66958
66958
  function createLogWatcher(logfile, verbose, cb) {
66959
66959
  if (!logfile) return null;
66960
66960
  try {
66961
- let stats = fs4.lstatSync(logfile);
66962
- return fs4.watch(logfile, function(event, filename) {
66961
+ let stats = fs3.lstatSync(logfile);
66962
+ return fs3.watch(logfile, function(event, filename) {
66963
66963
  if (event == "rename") {
66964
66964
  try {
66965
- let stats2 = fs4.lstatSync(logfile);
66965
+ let stats2 = fs3.lstatSync(logfile);
66966
66966
  } catch (err) {
66967
66967
  cb(err, logfile);
66968
66968
  }
@@ -67078,13 +67078,13 @@ var require_FileStreamRotator = __commonJS({
67078
67078
  if (fileCount == 0 && t_log == logfile) {
67079
67079
  t_log += options.extension;
67080
67080
  }
67081
- while (f3 = fs4.existsSync(t_log)) {
67081
+ while (f3 = fs3.existsSync(t_log)) {
67082
67082
  lastLogFile = t_log;
67083
67083
  fileCount++;
67084
67084
  t_log = logfile + "." + fileCount + options.extension;
67085
67085
  }
67086
67086
  if (lastLogFile) {
67087
- var lastLogFileStats = fs4.statSync(lastLogFile);
67087
+ var lastLogFileStats = fs3.statSync(lastLogFile);
67088
67088
  if (lastLogFileStats.size < fileSize) {
67089
67089
  t_log = lastLogFile;
67090
67090
  fileCount--;
@@ -67100,7 +67100,7 @@ var require_FileStreamRotator = __commonJS({
67100
67100
  }
67101
67101
  mkDirForFile(logfile);
67102
67102
  var file_options = options.file_options || { flags: "a" };
67103
- var rotateStream = fs4.createWriteStream(logfile, file_options);
67103
+ var rotateStream = fs3.createWriteStream(logfile, file_options);
67104
67104
  if (curDate && frequencyMetaData && staticFrequency.indexOf(frequencyMetaData.type) > -1 || fileSize > 0) {
67105
67105
  if (self2.verbose) {
67106
67106
  console.log(/* @__PURE__ */ new Date(), "[FileStreamRotator] Rotating file: ", frequencyMetaData ? frequencyMetaData.type : "", fileSize ? "size: " + fileSize : "");
@@ -67139,12 +67139,12 @@ var require_FileStreamRotator = __commonJS({
67139
67139
  });
67140
67140
  stream.on("createLog", function(file) {
67141
67141
  try {
67142
- let stats = fs4.lstatSync(file);
67142
+ let stats = fs3.lstatSync(file);
67143
67143
  } catch (err) {
67144
67144
  if (rotateStream && rotateStream.end == "function") {
67145
67145
  rotateStream.end();
67146
67146
  }
67147
- rotateStream = fs4.createWriteStream(file, file_options);
67147
+ rotateStream = fs3.createWriteStream(file, file_options);
67148
67148
  stream.emit("new", file);
67149
67149
  BubbleEvents(rotateStream, stream);
67150
67150
  }
@@ -67176,7 +67176,7 @@ var require_FileStreamRotator = __commonJS({
67176
67176
  rotateStream.destroy();
67177
67177
  }
67178
67178
  mkDirForFile(logfile);
67179
- rotateStream = fs4.createWriteStream(newLogfile, file_options);
67179
+ rotateStream = fs3.createWriteStream(newLogfile, file_options);
67180
67180
  stream.emit("new", newLogfile);
67181
67181
  stream.emit("rotate", oldFile, newLogfile);
67182
67182
  BubbleEvents(rotateStream, stream);
@@ -67204,9 +67204,9 @@ var require_FileStreamRotator = __commonJS({
67204
67204
  _path.split(path4.sep).reduce(
67205
67205
  function(fullPath, folder) {
67206
67206
  fullPath += folder + path4.sep;
67207
- if (!fs4.existsSync(fullPath)) {
67207
+ if (!fs3.existsSync(fullPath)) {
67208
67208
  try {
67209
- fs4.mkdirSync(fullPath);
67209
+ fs3.mkdirSync(fullPath);
67210
67210
  } catch (e) {
67211
67211
  if (e.code !== "EEXIST") {
67212
67212
  throw e;
@@ -67239,7 +67239,7 @@ var require_FileStreamRotator = __commonJS({
67239
67239
  var require_daily_rotate_file = __commonJS({
67240
67240
  "../../node_modules/winston-daily-rotate-file/daily-rotate-file.js"(exports2, module2) {
67241
67241
  "use strict";
67242
- var fs4 = require("fs");
67242
+ var fs3 = require("fs");
67243
67243
  var os = require("os");
67244
67244
  var path4 = require("path");
67245
67245
  var util = require("util");
@@ -67331,7 +67331,7 @@ var require_daily_rotate_file = __commonJS({
67331
67331
  if (options.zippedArchive) {
67332
67332
  const gzName = params.name + ".gz";
67333
67333
  try {
67334
- fs4.unlinkSync(gzName);
67334
+ fs3.unlinkSync(gzName);
67335
67335
  } catch (err) {
67336
67336
  if (err.code !== "ENOENT") {
67337
67337
  err.message = `Error occurred while removing ${gzName}: ${err.message}`;
@@ -67347,7 +67347,7 @@ var require_daily_rotate_file = __commonJS({
67347
67347
  if (options.zippedArchive) {
67348
67348
  this.logStream.on("rotate", (oldFile) => {
67349
67349
  try {
67350
- if (!fs4.existsSync(oldFile)) {
67350
+ if (!fs3.existsSync(oldFile)) {
67351
67351
  return;
67352
67352
  }
67353
67353
  } catch (err) {
@@ -67356,7 +67356,7 @@ var require_daily_rotate_file = __commonJS({
67356
67356
  return;
67357
67357
  }
67358
67358
  try {
67359
- if (fs4.existsSync(`${oldFile}.gz`)) {
67359
+ if (fs3.existsSync(`${oldFile}.gz`)) {
67360
67360
  return;
67361
67361
  }
67362
67362
  } catch (err) {
@@ -67365,19 +67365,19 @@ var require_daily_rotate_file = __commonJS({
67365
67365
  return;
67366
67366
  }
67367
67367
  const gzip = zlib.createGzip();
67368
- const inp = fs4.createReadStream(oldFile);
67368
+ const inp = fs3.createReadStream(oldFile);
67369
67369
  inp.on("error", (err) => {
67370
67370
  err.message = `Error occurred while reading ${oldFile}: ${err.message}`;
67371
67371
  this.emit("error", err);
67372
67372
  });
67373
- const out = fs4.createWriteStream(oldFile + ".gz");
67373
+ const out = fs3.createWriteStream(oldFile + ".gz");
67374
67374
  out.on("error", (err) => {
67375
67375
  err.message = `Error occurred while writing ${oldFile}.gz: ${err.message}`;
67376
67376
  this.emit("error", err);
67377
67377
  });
67378
67378
  inp.pipe(gzip).pipe(out).on("finish", () => {
67379
67379
  try {
67380
- fs4.unlinkSync(oldFile);
67380
+ fs3.unlinkSync(oldFile);
67381
67381
  } catch (err) {
67382
67382
  if (err.code !== "ENOENT") {
67383
67383
  err.message = `Error occurred while removing ${oldFile}: ${err.message}`;
@@ -67442,7 +67442,7 @@ var require_daily_rotate_file = __commonJS({
67442
67442
  options.order = options.order || "desc";
67443
67443
  const logFiles = (() => {
67444
67444
  const fileRegex = new RegExp(this.filename.replace("%DATE%", ".*"), "i");
67445
- return fs4.readdirSync(this.dirname).filter((file) => path4.basename(file).match(fileRegex));
67445
+ return fs3.readdirSync(this.dirname).filter((file) => path4.basename(file).match(fileRegex));
67446
67446
  })();
67447
67447
  if (logFiles.length === 0 && callback) {
67448
67448
  callback(null, results);
@@ -67456,14 +67456,14 @@ var require_daily_rotate_file = __commonJS({
67456
67456
  let stream;
67457
67457
  if (file.endsWith(".gz")) {
67458
67458
  stream = new PassThrough();
67459
- const inp = fs4.createReadStream(logFile);
67459
+ const inp = fs3.createReadStream(logFile);
67460
67460
  inp.on("error", (err) => {
67461
67461
  err.message = `Error occurred while reading ${logFile}: ${err.message}`;
67462
67462
  stream.emit("error", err);
67463
67463
  });
67464
67464
  inp.pipe(zlib.createGunzip()).pipe(stream);
67465
67465
  } else {
67466
- stream = fs4.createReadStream(logFile, {
67466
+ stream = fs3.createReadStream(logFile, {
67467
67467
  encoding: "utf8"
67468
67468
  });
67469
67469
  }
@@ -67676,9 +67676,9 @@ var ur = "not-modified";
67676
67676
  var pr = "not-found";
67677
67677
  var fr = "unauthorized";
67678
67678
  var ct = "accepted";
67679
- var bn = { resourceType: "OperationOutcome", id: pr, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
67679
+ var En = { resourceType: "OperationOutcome", id: pr, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
67680
67680
  var ke = { resourceType: "OperationOutcome", id: fr, issue: [{ severity: "error", code: "login", details: { text: "Unauthorized" } }] };
67681
- var En = { ...ke, issue: [...ke.issue, { severity: "error", code: "expired", details: { text: "Token expired" } }] };
67681
+ var Rn = { ...ke, issue: [...ke.issue, { severity: "error", code: "expired", details: { text: "Token expired" } }] };
67682
67682
  var hr = { ...ke, issue: [...ke.issue, { severity: "error", code: "invalid", details: { text: "Token not issued for this audience" } }] };
67683
67683
  function b(r6, e) {
67684
67684
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "invalid", details: { text: r6 }, ...e ? { expression: [e] } : void 0 }] };
@@ -67686,7 +67686,7 @@ function b(r6, e) {
67686
67686
  function y(r6) {
67687
67687
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "structure", details: { text: r6 } }] };
67688
67688
  }
67689
- function Rn(r6) {
67689
+ function Cn(r6) {
67690
67690
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "exception", details: { text: "Internal server error" }, diagnostics: r6.toString() }] };
67691
67691
  }
67692
67692
  function mr(r6) {
@@ -67700,74 +67700,74 @@ function yr(r6) {
67700
67700
  }
67701
67701
  var d = class extends Error {
67702
67702
  constructor(e, t) {
67703
- super(Cn(e)), this.outcome = e, this.cause = t;
67703
+ super(Pn(e)), this.outcome = e, this.cause = t;
67704
67704
  }
67705
67705
  };
67706
67706
  function lt(r6) {
67707
67707
  return r6 instanceof d ? r6.outcome : ut(r6) ? r6 : b(Ve(r6));
67708
67708
  }
67709
67709
  function Ve(r6) {
67710
- return r6 ? typeof r6 == "string" ? r6 : mr(r6) ? r6.message : ut(r6) ? Cn(r6) : typeof r6 == "object" && "code" in r6 && typeof r6.code == "string" ? r6.code : JSON.stringify(r6) : "Unknown error";
67710
+ return r6 ? typeof r6 == "string" ? r6 : mr(r6) ? r6.message : ut(r6) ? Pn(r6) : typeof r6 == "object" && "code" in r6 && typeof r6.code == "string" ? r6.code : JSON.stringify(r6) : "Unknown error";
67711
67711
  }
67712
- function Cn(r6) {
67713
- let e = r6.issue?.map(mo) ?? [];
67712
+ function Pn(r6) {
67713
+ let e = r6.issue?.map(yo) ?? [];
67714
67714
  return e.length > 0 ? e.join("; ") : "Unknown error";
67715
67715
  }
67716
- function mo(r6) {
67716
+ function yo(r6) {
67717
67717
  let e;
67718
67718
  return r6.details?.text ? r6.diagnostics ? e = `${r6.details.text} (${r6.diagnostics})` : e = r6.details.text : r6.diagnostics ? e = r6.diagnostics : e = "Unknown error", r6.expression?.length && (e += ` (${r6.expression.join(", ")})`), e;
67719
67719
  }
67720
- function go(r6, e) {
67720
+ function xo(r6, e) {
67721
67721
  let t = e.max && e.max === Number.MAX_SAFE_INTEGER ? Number.POSITIVE_INFINITY : e.max;
67722
67722
  return { path: r6, description: "", type: e.type ?? [], min: e.min ?? 0, max: t ?? 1, isArray: !!t && t > 1, constraints: [] };
67723
67723
  }
67724
- function An(r6) {
67724
+ function On(r6) {
67725
67725
  let e = /* @__PURE__ */ Object.create(null);
67726
- for (let [t, n] of Object.entries(r6)) e[t] = { name: t, type: t, path: t, elements: Object.fromEntries(Object.entries(n.elements).map(([i, o]) => [i, go(i, o)])), constraints: [], innerTypes: [] };
67726
+ for (let [t, n] of Object.entries(r6)) e[t] = { name: t, type: t, path: t, elements: Object.fromEntries(Object.entries(n.elements).map(([i, o]) => [i, xo(i, o)])), constraints: [], innerTypes: [] };
67727
67727
  return e;
67728
67728
  }
67729
- var On = { Element: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, BackboneElement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, Address: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: 9007199254740991, type: [{ code: "string" }] }, city: { type: [{ code: "string" }] }, district: { type: [{ code: "string" }] }, state: { type: [{ code: "string" }] }, postalCode: { type: [{ code: "string" }] }, country: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Age: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "author[x]": { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Organization"] }, { code: "string" }] }, time: { type: [{ code: "dateTime" }] }, text: { min: 1, type: [{ code: "markdown" }] } } }, Attachment: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, contentType: { type: [{ code: "code" }] }, language: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] }, url: { type: [{ code: "url" }] }, size: { type: [{ code: "unsignedInt" }] }, hash: { type: [{ code: "base64Binary" }] }, title: { type: [{ code: "string" }] }, creation: { type: [{ code: "dateTime" }] } } }, CodeableConcept: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, coding: { max: 9007199254740991, type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: 9007199254740991, type: [{ code: "ContactPoint" }] } } }, ContactPoint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] } } }, Count: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, "subject[x]": { type: [{ code: "CodeableConcept" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Group"] }] }, mustSupport: { max: 9007199254740991, type: [{ code: "string" }] }, codeFilter: { max: 9007199254740991, type: [{ code: "DataRequirementCodeFilter" }] }, dateFilter: { max: 9007199254740991, type: [{ code: "DataRequirementDateFilter" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: 9007199254740991, type: [{ code: "DataRequirementSort" }] } } }, DataRequirementCodeFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] } } }, DataRequirementDateFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, "value[x]": { type: [{ code: "dateTime" }, { code: "Period" }, { code: "Duration" }] } } }, DataRequirementSort: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, direction: { min: 1, type: [{ code: "code" }] } } }, Distance: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] }, patientInstruction: { type: [{ code: "string" }] }, timing: { type: [{ code: "Timing" }] }, "asNeeded[x]": { type: [{ code: "boolean" }, { code: "CodeableConcept" }] }, site: { type: [{ code: "CodeableConcept" }] }, route: { type: [{ code: "CodeableConcept" }] }, method: { type: [{ code: "CodeableConcept" }] }, doseAndRate: { max: 9007199254740991, type: [{ code: "DosageDoseAndRate" }] }, maxDosePerPeriod: { type: [{ code: "Ratio" }] }, maxDosePerAdministration: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, maxDosePerLifetime: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, DosageDoseAndRate: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { type: [{ code: "CodeableConcept" }] }, "dose[x]": { type: [{ code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, "rate[x]": { type: [{ code: "Ratio" }, { code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Duration: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: 9007199254740991, type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] }, slicing: { type: [{ code: "ElementDefinitionSlicing" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: 9007199254740991, type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "ElementDefinitionBase" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: 9007199254740991, type: [{ code: "ElementDefinitionType" }] }, "defaultValue[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, meaningWhenMissing: { type: [{ code: "markdown" }] }, orderMeaning: { type: [{ code: "string" }] }, "fixed[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, "pattern[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, example: { max: 9007199254740991, type: [{ code: "ElementDefinitionExample" }] }, "minValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, "maxValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, maxLength: { type: [{ code: "integer" }] }, condition: { max: 9007199254740991, type: [{ code: "id" }] }, constraint: { max: 9007199254740991, type: [{ code: "ElementDefinitionConstraint" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "ElementDefinitionBinding" }] }, mapping: { max: 9007199254740991, type: [{ code: "ElementDefinitionMapping" }] } } }, ElementDefinitionSlicingDiscriminator: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, path: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionSlicing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, discriminator: { max: 9007199254740991, type: [{ code: "ElementDefinitionSlicingDiscriminator" }] }, description: { type: [{ code: "string" }] }, ordered: { type: [{ code: "boolean" }] }, rules: { min: 1, type: [{ code: "code" }] } } }, ElementDefinitionBase: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, min: { min: 1, type: [{ code: "unsignedInt" }] }, max: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionType: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, targetProfile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, aggregation: { max: 9007199254740991, type: [{ code: "code" }] }, versioning: { type: [{ code: "code" }] } } }, ElementDefinitionExample: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, label: { min: 1, type: [{ code: "string" }] }, "value[x]": { min: 1, type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, ElementDefinitionConstraint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, key: { min: 1, type: [{ code: "id" }] }, requirements: { type: [{ code: "string" }] }, severity: { min: 1, type: [{ code: "code" }] }, human: { min: 1, type: [{ code: "string" }] }, expression: { type: [{ code: "string" }] }, xpath: { type: [{ code: "string" }] }, source: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, ElementDefinitionBinding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, strength: { min: 1, type: [{ code: "code" }] }, description: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] } } }, ElementDefinitionMapping: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identity: { min: 1, type: [{ code: "id" }] }, language: { type: [{ code: "code" }] }, map: { min: 1, type: [{ code: "string" }] }, comment: { type: [{ code: "string" }] } } }, Expression: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, description: { type: [{ code: "string" }] }, name: { type: [{ code: "id" }] }, language: { min: 1, type: [{ code: "code" }] }, expression: { type: [{ code: "string" }] }, reference: { type: [{ code: "uri" }] } } }, Extension: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "uri" }] }, "value[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, HumanName: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: 9007199254740991, type: [{ code: "string" }] }, prefix: { max: 9007199254740991, type: [{ code: "string" }] }, suffix: { max: 9007199254740991, type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "CodeableConcept" }] }, system: { type: [{ code: "uri" }] }, value: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] }, assigner: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MarketingStatus: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, country: { min: 1, type: [{ code: "CodeableConcept" }] }, jurisdiction: { type: [{ code: "CodeableConcept" }] }, status: { min: 1, type: [{ code: "CodeableConcept" }] }, dateRange: { min: 1, type: [{ code: "Period" }] }, restoreDate: { type: [{ code: "dateTime" }] } } }, Meta: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: 9007199254740991, type: [{ code: "Coding" }] }, tag: { max: 9007199254740991, type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, onBehalfOf: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, accounts: { max: 9007199254740991, type: [{ code: "Reference" }] }, compartment: { max: 9007199254740991, type: [{ code: "Reference" }] } } }, Money: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "code" }] }, use: { min: 1, type: [{ code: "code" }] }, min: { type: [{ code: "integer" }] }, max: { type: [{ code: "string" }] }, documentation: { type: [{ code: "string" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, Period: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, height: { type: [{ code: "Quantity" }] }, width: { type: [{ code: "Quantity" }] }, depth: { type: [{ code: "Quantity" }] }, weight: { type: [{ code: "Quantity" }] }, nominalVolume: { type: [{ code: "Quantity" }] }, externalDiameter: { type: [{ code: "Quantity" }] }, shape: { type: [{ code: "string" }] }, color: { max: 9007199254740991, type: [{ code: "string" }] }, imprint: { max: 9007199254740991, type: [{ code: "string" }] }, image: { max: 9007199254740991, type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, Quantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Range: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, low: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, high: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Ratio: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, label: { type: [{ code: "string" }] }, display: { type: [{ code: "string" }] }, citation: { type: [{ code: "markdown" }] }, url: { type: [{ code: "url" }] }, document: { type: [{ code: "Attachment" }] }, resource: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Resource"] }] } } }, SampledData: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, origin: { min: 1, type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, period: { min: 1, type: [{ code: "decimal" }] }, factor: { type: [{ code: "decimal" }] }, lowerLimit: { type: [{ code: "decimal" }] }, upperLimit: { type: [{ code: "decimal" }] }, dimensions: { min: 1, type: [{ code: "positiveInt" }] }, data: { type: [{ code: "string" }] } } }, Signature: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, max: 9007199254740991, type: [{ code: "Coding" }] }, when: { min: 1, type: [{ code: "instant" }] }, who: { min: 1, type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, onBehalfOf: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, targetFormat: { type: [{ code: "code" }] }, sigFormat: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] } } }, SubstanceAmount: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "SubstanceAmountReferenceRange" }] } } }, SubstanceAmountReferenceRange: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, lowLimit: { type: [{ code: "Quantity" }] }, highLimit: { type: [{ code: "Quantity" }] } } }, Timing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, event: { max: 9007199254740991, type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "TimingRepeat" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TimingRepeat: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "bounds[x]": { type: [{ code: "Duration" }, { code: "Range" }, { code: "Period" }] }, count: { type: [{ code: "positiveInt" }] }, countMax: { type: [{ code: "positiveInt" }] }, duration: { type: [{ code: "decimal" }] }, durationMax: { type: [{ code: "decimal" }] }, durationUnit: { type: [{ code: "code" }] }, frequency: { type: [{ code: "positiveInt" }] }, frequencyMax: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "decimal" }] }, periodMax: { type: [{ code: "decimal" }] }, periodUnit: { type: [{ code: "code" }] }, dayOfWeek: { max: 9007199254740991, type: [{ code: "code" }] }, timeOfDay: { max: 9007199254740991, type: [{ code: "time" }] }, when: { max: 9007199254740991, type: [{ code: "code" }] }, offset: { type: [{ code: "unsignedInt" }] } } }, TriggerDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { type: [{ code: "string" }] }, "timing[x]": { type: [{ code: "Timing" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Schedule"] }, { code: "date" }, { code: "dateTime" }] }, data: { max: 9007199254740991, type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "Coding" }] }, "value[x]": { min: 1, type: [{ code: "CodeableConcept" }, { code: "Quantity" }, { code: "Range" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/PlanDefinition", "http://hl7.org/fhir/StructureDefinition/ResearchStudy", "http://hl7.org/fhir/StructureDefinition/InsurancePlan", "http://hl7.org/fhir/StructureDefinition/HealthcareService", "http://hl7.org/fhir/StructureDefinition/Group", "http://hl7.org/fhir/StructureDefinition/Location", "http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MoneyQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, SimpleQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { max: 0, type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, IdentityProvider: { elements: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, tokenAuthMethod: { type: [{ code: "code" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, usePkce: { type: [{ code: "boolean" }] }, useSubject: { type: [{ code: "boolean" }] } } } };
67729
+ var In = { Element: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, BackboneElement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, Address: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: 9007199254740991, type: [{ code: "string" }] }, city: { type: [{ code: "string" }] }, district: { type: [{ code: "string" }] }, state: { type: [{ code: "string" }] }, postalCode: { type: [{ code: "string" }] }, country: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Age: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "author[x]": { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Organization"] }, { code: "string" }] }, time: { type: [{ code: "dateTime" }] }, text: { min: 1, type: [{ code: "markdown" }] } } }, Attachment: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, contentType: { type: [{ code: "code" }] }, language: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] }, url: { type: [{ code: "url" }] }, size: { type: [{ code: "unsignedInt" }] }, hash: { type: [{ code: "base64Binary" }] }, title: { type: [{ code: "string" }] }, creation: { type: [{ code: "dateTime" }] } } }, CodeableConcept: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, coding: { max: 9007199254740991, type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: 9007199254740991, type: [{ code: "ContactPoint" }] } } }, ContactPoint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] } } }, Count: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, "subject[x]": { type: [{ code: "CodeableConcept" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Group"] }] }, mustSupport: { max: 9007199254740991, type: [{ code: "string" }] }, codeFilter: { max: 9007199254740991, type: [{ code: "DataRequirementCodeFilter" }] }, dateFilter: { max: 9007199254740991, type: [{ code: "DataRequirementDateFilter" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: 9007199254740991, type: [{ code: "DataRequirementSort" }] } } }, DataRequirementCodeFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] } } }, DataRequirementDateFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, "value[x]": { type: [{ code: "dateTime" }, { code: "Period" }, { code: "Duration" }] } } }, DataRequirementSort: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, direction: { min: 1, type: [{ code: "code" }] } } }, Distance: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] }, patientInstruction: { type: [{ code: "string" }] }, timing: { type: [{ code: "Timing" }] }, "asNeeded[x]": { type: [{ code: "boolean" }, { code: "CodeableConcept" }] }, site: { type: [{ code: "CodeableConcept" }] }, route: { type: [{ code: "CodeableConcept" }] }, method: { type: [{ code: "CodeableConcept" }] }, doseAndRate: { max: 9007199254740991, type: [{ code: "DosageDoseAndRate" }] }, maxDosePerPeriod: { type: [{ code: "Ratio" }] }, maxDosePerAdministration: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, maxDosePerLifetime: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, DosageDoseAndRate: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { type: [{ code: "CodeableConcept" }] }, "dose[x]": { type: [{ code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, "rate[x]": { type: [{ code: "Ratio" }, { code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Duration: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: 9007199254740991, type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] }, slicing: { type: [{ code: "ElementDefinitionSlicing" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: 9007199254740991, type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "ElementDefinitionBase" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: 9007199254740991, type: [{ code: "ElementDefinitionType" }] }, "defaultValue[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, meaningWhenMissing: { type: [{ code: "markdown" }] }, orderMeaning: { type: [{ code: "string" }] }, "fixed[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, "pattern[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, example: { max: 9007199254740991, type: [{ code: "ElementDefinitionExample" }] }, "minValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, "maxValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, maxLength: { type: [{ code: "integer" }] }, condition: { max: 9007199254740991, type: [{ code: "id" }] }, constraint: { max: 9007199254740991, type: [{ code: "ElementDefinitionConstraint" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "ElementDefinitionBinding" }] }, mapping: { max: 9007199254740991, type: [{ code: "ElementDefinitionMapping" }] } } }, ElementDefinitionSlicingDiscriminator: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, path: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionSlicing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, discriminator: { max: 9007199254740991, type: [{ code: "ElementDefinitionSlicingDiscriminator" }] }, description: { type: [{ code: "string" }] }, ordered: { type: [{ code: "boolean" }] }, rules: { min: 1, type: [{ code: "code" }] } } }, ElementDefinitionBase: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, min: { min: 1, type: [{ code: "unsignedInt" }] }, max: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionType: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, targetProfile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, aggregation: { max: 9007199254740991, type: [{ code: "code" }] }, versioning: { type: [{ code: "code" }] } } }, ElementDefinitionExample: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, label: { min: 1, type: [{ code: "string" }] }, "value[x]": { min: 1, type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, ElementDefinitionConstraint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, key: { min: 1, type: [{ code: "id" }] }, requirements: { type: [{ code: "string" }] }, severity: { min: 1, type: [{ code: "code" }] }, human: { min: 1, type: [{ code: "string" }] }, expression: { type: [{ code: "string" }] }, xpath: { type: [{ code: "string" }] }, source: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, ElementDefinitionBinding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, strength: { min: 1, type: [{ code: "code" }] }, description: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] } } }, ElementDefinitionMapping: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identity: { min: 1, type: [{ code: "id" }] }, language: { type: [{ code: "code" }] }, map: { min: 1, type: [{ code: "string" }] }, comment: { type: [{ code: "string" }] } } }, Expression: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, description: { type: [{ code: "string" }] }, name: { type: [{ code: "id" }] }, language: { min: 1, type: [{ code: "code" }] }, expression: { type: [{ code: "string" }] }, reference: { type: [{ code: "uri" }] } } }, Extension: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "uri" }] }, "value[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, HumanName: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: 9007199254740991, type: [{ code: "string" }] }, prefix: { max: 9007199254740991, type: [{ code: "string" }] }, suffix: { max: 9007199254740991, type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "CodeableConcept" }] }, system: { type: [{ code: "uri" }] }, value: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] }, assigner: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MarketingStatus: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, country: { min: 1, type: [{ code: "CodeableConcept" }] }, jurisdiction: { type: [{ code: "CodeableConcept" }] }, status: { min: 1, type: [{ code: "CodeableConcept" }] }, dateRange: { min: 1, type: [{ code: "Period" }] }, restoreDate: { type: [{ code: "dateTime" }] } } }, Meta: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: 9007199254740991, type: [{ code: "Coding" }] }, tag: { max: 9007199254740991, type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, onBehalfOf: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, accounts: { max: 9007199254740991, type: [{ code: "Reference" }] }, compartment: { max: 9007199254740991, type: [{ code: "Reference" }] } } }, Money: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "code" }] }, use: { min: 1, type: [{ code: "code" }] }, min: { type: [{ code: "integer" }] }, max: { type: [{ code: "string" }] }, documentation: { type: [{ code: "string" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, Period: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, height: { type: [{ code: "Quantity" }] }, width: { type: [{ code: "Quantity" }] }, depth: { type: [{ code: "Quantity" }] }, weight: { type: [{ code: "Quantity" }] }, nominalVolume: { type: [{ code: "Quantity" }] }, externalDiameter: { type: [{ code: "Quantity" }] }, shape: { type: [{ code: "string" }] }, color: { max: 9007199254740991, type: [{ code: "string" }] }, imprint: { max: 9007199254740991, type: [{ code: "string" }] }, image: { max: 9007199254740991, type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, Quantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Range: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, low: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, high: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Ratio: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, label: { type: [{ code: "string" }] }, display: { type: [{ code: "string" }] }, citation: { type: [{ code: "markdown" }] }, url: { type: [{ code: "url" }] }, document: { type: [{ code: "Attachment" }] }, resource: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Resource"] }] } } }, SampledData: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, origin: { min: 1, type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, period: { min: 1, type: [{ code: "decimal" }] }, factor: { type: [{ code: "decimal" }] }, lowerLimit: { type: [{ code: "decimal" }] }, upperLimit: { type: [{ code: "decimal" }] }, dimensions: { min: 1, type: [{ code: "positiveInt" }] }, data: { type: [{ code: "string" }] } } }, Signature: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, max: 9007199254740991, type: [{ code: "Coding" }] }, when: { min: 1, type: [{ code: "instant" }] }, who: { min: 1, type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, onBehalfOf: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, targetFormat: { type: [{ code: "code" }] }, sigFormat: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] } } }, SubstanceAmount: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "SubstanceAmountReferenceRange" }] } } }, SubstanceAmountReferenceRange: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, lowLimit: { type: [{ code: "Quantity" }] }, highLimit: { type: [{ code: "Quantity" }] } } }, Timing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, event: { max: 9007199254740991, type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "TimingRepeat" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TimingRepeat: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "bounds[x]": { type: [{ code: "Duration" }, { code: "Range" }, { code: "Period" }] }, count: { type: [{ code: "positiveInt" }] }, countMax: { type: [{ code: "positiveInt" }] }, duration: { type: [{ code: "decimal" }] }, durationMax: { type: [{ code: "decimal" }] }, durationUnit: { type: [{ code: "code" }] }, frequency: { type: [{ code: "positiveInt" }] }, frequencyMax: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "decimal" }] }, periodMax: { type: [{ code: "decimal" }] }, periodUnit: { type: [{ code: "code" }] }, dayOfWeek: { max: 9007199254740991, type: [{ code: "code" }] }, timeOfDay: { max: 9007199254740991, type: [{ code: "time" }] }, when: { max: 9007199254740991, type: [{ code: "code" }] }, offset: { type: [{ code: "unsignedInt" }] } } }, TriggerDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { type: [{ code: "string" }] }, "timing[x]": { type: [{ code: "Timing" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Schedule"] }, { code: "date" }, { code: "dateTime" }] }, data: { max: 9007199254740991, type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "Coding" }] }, "value[x]": { min: 1, type: [{ code: "CodeableConcept" }, { code: "Quantity" }, { code: "Range" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/PlanDefinition", "http://hl7.org/fhir/StructureDefinition/ResearchStudy", "http://hl7.org/fhir/StructureDefinition/InsurancePlan", "http://hl7.org/fhir/StructureDefinition/HealthcareService", "http://hl7.org/fhir/StructureDefinition/Group", "http://hl7.org/fhir/StructureDefinition/Location", "http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MoneyQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, SimpleQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { max: 0, type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, IdentityProvider: { elements: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, tokenAuthMethod: { type: [{ code: "code" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, usePkce: { type: [{ code: "boolean" }] }, useSubject: { type: [{ code: "boolean" }] } } } };
67730
67730
  function Tr(r6) {
67731
67731
  return new xr(r6).parse();
67732
67732
  }
67733
- var ye = An(On);
67733
+ var ye = On(In);
67734
67734
  var Sr = /* @__PURE__ */ Object.create(null);
67735
- var In = /* @__PURE__ */ Object.create(null);
67736
- var vo = { "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" };
67737
- function Mn(r6) {
67735
+ var kn = /* @__PURE__ */ Object.create(null);
67736
+ var To = { "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" };
67737
+ function _n(r6) {
67738
67738
  let e;
67739
- return e = In[r6], e || (e = In[r6] = /* @__PURE__ */ Object.create(null)), e;
67739
+ return e = kn[r6], e || (e = kn[r6] = /* @__PURE__ */ Object.create(null)), e;
67740
67740
  }
67741
67741
  function br(r6) {
67742
67742
  let t = (Array.isArray(r6) ? r6 : r6.entry?.map((n) => n.resource) ?? []).filter((n) => n?.resourceType === "StructureDefinition");
67743
- Bn(t);
67743
+ Wn(t);
67744
67744
  for (let n of t) Er(n);
67745
67745
  }
67746
67746
  function Er(r6) {
67747
67747
  if (!r6?.name) throw new Error("Failed loading StructureDefinition from bundle");
67748
67748
  if (r6.resourceType !== "StructureDefinition") return;
67749
- let e = Tr(r6), t = vo[r6.url], n, i;
67750
- t ? (n = ye, i = t) : r6.url === `http://hl7.org/fhir/StructureDefinition/${r6.type}` || r6.url === `https://medplum.com/fhir/StructureDefinition/${r6.type}` || r6.type?.startsWith("http://") || r6.type?.startsWith("https://") ? (n = ye, i = r6.type) : (n = Mn(r6.url), i = r6.type), n[i] = e;
67749
+ let e = Tr(r6), t = To[r6.url], n, i;
67750
+ t ? (n = ye, i = t) : r6.url === `http://hl7.org/fhir/StructureDefinition/${r6.type}` || r6.url === `https://medplum.com/fhir/StructureDefinition/${r6.type}` || r6.type?.startsWith("http://") || r6.type?.startsWith("https://") ? (n = ye, i = r6.type) : (n = _n(r6.url), i = r6.type), n[i] = e;
67751
67751
  for (let o of e.innerTypes) o.parentType = e, n[o.name] = o;
67752
67752
  Sr[r6.url] = e;
67753
67753
  }
67754
- function Ln(r6) {
67754
+ function Fn(r6) {
67755
67755
  return !!ye[r6];
67756
67756
  }
67757
- function qe(r6, e) {
67757
+ function je(r6, e) {
67758
67758
  if (e) {
67759
- let t = Mn(e)[r6];
67759
+ let t = _n(e)[r6];
67760
67760
  if (t) return t;
67761
67761
  }
67762
67762
  return ye[r6];
67763
67763
  }
67764
- function Nn(r6) {
67764
+ function Un(r6) {
67765
67765
  return !!Sr[r6];
67766
67766
  }
67767
67767
  var xr = class {
67768
67768
  constructor(e) {
67769
67769
  if (!e.snapshot?.element || e.snapshot.element.length === 0) throw new Error(`No snapshot defined for StructureDefinition '${e.name}'`);
67770
- this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, path: this.root.path, title: e.title, type: e.type, url: e.url, version: e.version, kind: e.kind, description: Eo(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
67770
+ this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, path: this.root.path, title: e.title, type: e.type, url: e.url, version: e.version, kind: e.kind, description: Ro(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
67771
67771
  }
67772
67772
  parse() {
67773
67773
  let e = this.next();
@@ -67808,7 +67808,7 @@ var xr = class {
67808
67808
  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: De(this.backboneContext?.path, e.path) ? this.backboneContext : this.backboneContext?.parent };
67809
67809
  }
67810
67810
  enterSlice(e, t) {
67811
- bo(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
67811
+ Eo(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
67812
67812
  if (n.type !== "value" && n.type !== "pattern" && n.type !== "type") throw new Error(`Unsupported slicing discriminator type: ${n.type}`);
67813
67813
  return { path: n.path, type: n.type };
67814
67814
  }), slices: [], ordered: e.slicing?.ordered ?? false, rule: e.slicing?.rules }, this.slicingContext = { field: t.slicing, path: e.path ?? "" });
@@ -67848,34 +67848,34 @@ var xr = class {
67848
67848
  });
67849
67849
  }
67850
67850
  parseElementDefinition(e) {
67851
- let t = Vn(e.max), n = e.base?.max ? Vn(e.base.max) : t, i = { type: "ElementDefinition", value: e };
67852
- 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: Dn(P(i, "fixed[x]")), pattern: Dn(P(i, "pattern[x]")), binding: e.binding };
67851
+ let t = Dn(e.max), n = e.base?.max ? Dn(e.base.max) : t, i = { type: "ElementDefinition", value: e };
67852
+ 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 };
67853
67853
  }
67854
67854
  };
67855
- function Vn(r6) {
67855
+ function Dn(r6) {
67856
67856
  return r6 === "*" ? Number.POSITIVE_INFINITY : Number.parseInt(r6, 10);
67857
67857
  }
67858
67858
  function gr(r6, e = "") {
67859
- return So(r6.path, e);
67859
+ return bo(r6.path, e);
67860
67860
  }
67861
- function So(r6, e) {
67861
+ function bo(r6, e) {
67862
67862
  return r6 ? e && r6.startsWith(e) ? r6.substring(e.length + 1) : r6 : "";
67863
67863
  }
67864
67864
  function De(r6, e) {
67865
67865
  return !r6 || !e ? false : e.startsWith(r6 + ".") || e === r6;
67866
67866
  }
67867
- function Dn(r6) {
67867
+ function Mn(r6) {
67868
67868
  return Array.isArray(r6) && r6.length > 0 ? r6[0] : S(r6) ? void 0 : r6;
67869
67869
  }
67870
- function bo(r6) {
67870
+ function Eo(r6) {
67871
67871
  let e = r6.slicing?.discriminator;
67872
67872
  return !!(r6.type?.some((t) => t.code === "Extension") && e?.length === 1 && e[0].type === "value" && e[0].path === "url");
67873
67873
  }
67874
- function Eo(r6) {
67874
+ function Ro(r6) {
67875
67875
  let e = r6.description;
67876
67876
  return e?.startsWith(`Base StructureDefinition for ${r6.name} Type: `) && (e = e.substring(`Base StructureDefinition for ${r6.name} Type: `.length)), e;
67877
67877
  }
67878
- var Po = new Ie(1e3);
67878
+ var wo = new Ie(1e3);
67879
67879
  var ft = { 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: /^[\r\n\t\u0020-\uFFFF]+$/, oid: /^urn:oid:[0-2](\.(0|[1-9]\d*))+$/, string: /^[\r\n\t\u0020-\uFFFF]+$/, 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: /.*/ };
67880
67880
  function h(r6) {
67881
67881
  return [{ type: l.boolean, value: r6 }];
@@ -67895,9 +67895,9 @@ function H(r6, e) {
67895
67895
  function P(r6, e, t) {
67896
67896
  if (!r6.value) return;
67897
67897
  let n = xt(r6.type, e, t?.profileUrl);
67898
- return n ? Do(r6, e, n) : Mo(r6, e);
67898
+ return n ? Mo(r6, e, n) : _o(r6, e);
67899
67899
  }
67900
- function Do(r6, e, t) {
67900
+ function Mo(r6, e, t) {
67901
67901
  let n = r6.value, i = t.type;
67902
67902
  if (!i || i.length === 0) return;
67903
67903
  let o, s = "undefined", a, c = t.path.lastIndexOf("."), u = t.path.substring(c + 1);
@@ -67915,12 +67915,12 @@ function Do(r6, e, t) {
67915
67915
  o = a.slice();
67916
67916
  for (let p2 = 0; p2 < a.length; p2++) o[p2] = kr(void 0, a[p2]);
67917
67917
  } else o = kr(o, a);
67918
- if (!S(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((p2) => Wn(p2, s)) : Wn(o, s);
67918
+ if (!S(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((p2) => qn(p2, s)) : qn(o, s);
67919
67919
  }
67920
- function Wn(r6, e) {
67920
+ function qn(r6, e) {
67921
67921
  return e === "Resource" && O(r6) && (e = r6.resourceType), { type: e, value: r6 };
67922
67922
  }
67923
- function Mo(r6, e) {
67923
+ function _o(r6, e) {
67924
67924
  let t = r6.value;
67925
67925
  if (!t || typeof t != "object") return;
67926
67926
  let n;
@@ -67955,27 +67955,27 @@ function mt(r6) {
67955
67955
  }
67956
67956
  return e;
67957
67957
  }
67958
- function $n(r6) {
67958
+ function Gn(r6) {
67959
67959
  return h(!L(r6));
67960
67960
  }
67961
- function Gn(r6, e) {
67961
+ function Hn(r6, e) {
67962
67962
  return r6.length === 0 || e.length === 0 ? [] : r6.length !== e.length ? h(false) : h(r6.every((t, n) => L(Ge(t, e[n]))));
67963
67963
  }
67964
- function Hn(r6, e) {
67964
+ function Qn(r6, e) {
67965
67965
  return r6.length === 0 || e.length === 0 ? [] : r6.length !== e.length ? h(true) : h(r6.some((t, n) => !L(Ge(t, e[n]))));
67966
67966
  }
67967
67967
  function Ge(r6, e) {
67968
67968
  let t = r6.value?.valueOf(), n = e.value?.valueOf();
67969
- return typeof t == "number" && typeof n == "number" ? h(Math.abs(t - n) < 1e-8) : w(t) && w(n) ? h(Jn(t, n)) : h(typeof t == "object" && typeof n == "object" ? Dr(r6, e) : t === n);
67969
+ return typeof t == "number" && typeof n == "number" ? h(Math.abs(t - n) < 1e-8) : w(t) && w(n) ? h(Kn(t, n)) : h(typeof t == "object" && typeof n == "object" ? Dr(r6, e) : t === n);
67970
67970
  }
67971
67971
  function Vr(r6, e) {
67972
- return r6.length === 0 && e.length === 0 ? h(true) : r6.length !== e.length ? h(false) : (r6.sort(qn), e.sort(qn), h(r6.every((t, n) => L(_o(t, e[n])))));
67972
+ return r6.length === 0 && e.length === 0 ? h(true) : r6.length !== e.length ? h(false) : (r6.sort(jn), e.sort(jn), h(r6.every((t, n) => L(Lo(t, e[n])))));
67973
67973
  }
67974
- function _o(r6, e) {
67974
+ function Lo(r6, e) {
67975
67975
  let { type: t, value: n } = r6, { type: i, value: o } = e, s = n?.valueOf(), a = o?.valueOf();
67976
- return typeof s == "number" && typeof a == "number" ? h(Math.abs(s - a) < 0.01) : w(s) && w(a) ? h(Jn(s, a)) : h(t === "Coding" && i === "Coding" ? typeof s != "object" || typeof a != "object" ? false : s.code === a.code && s.system === a.system : typeof s == "object" && typeof a == "object" ? Dr({ ...s, id: void 0 }, { ...a, id: void 0 }) : typeof s == "string" && typeof a == "string" ? s.toLowerCase() === a.toLowerCase() : s === a);
67976
+ return typeof s == "number" && typeof a == "number" ? h(Math.abs(s - a) < 0.01) : w(s) && w(a) ? h(Kn(s, a)) : h(t === "Coding" && i === "Coding" ? typeof s != "object" || typeof a != "object" ? false : s.code === a.code && s.system === a.system : typeof s == "object" && typeof a == "object" ? Dr({ ...s, id: void 0 }, { ...a, id: void 0 }) : typeof s == "string" && typeof a == "string" ? s.toLowerCase() === a.toLowerCase() : s === a);
67977
67977
  }
67978
- function qn(r6, e) {
67978
+ function jn(r6, e) {
67979
67979
  let t = r6.value?.valueOf(), n = e.value?.valueOf();
67980
67980
  return typeof t == "number" && typeof n == "number" ? t - n : typeof t == "string" && typeof n == "string" ? t.localeCompare(n) : 0;
67981
67981
  }
@@ -67990,32 +67990,32 @@ function yt(r6, e) {
67990
67990
  case "Integer":
67991
67991
  return typeof t == "number";
67992
67992
  case "Date":
67993
- return Qn(t);
67993
+ return zn(t);
67994
67994
  case "DateTime":
67995
- return _e(t);
67995
+ return Le(t);
67996
67996
  case "Time":
67997
67997
  return typeof t == "string" && !!/^T\d/.exec(t);
67998
67998
  case "Period":
67999
- return zn(t);
67999
+ return Jn(t);
68000
68000
  case "Quantity":
68001
68001
  return w(t);
68002
68002
  default:
68003
68003
  return r6.type === n || typeof t == "object" && t?.resourceType === n;
68004
68004
  }
68005
68005
  }
68006
- function Qn(r6) {
68006
+ function zn(r6) {
68007
68007
  return typeof r6 == "string" && !!ft.date.exec(r6);
68008
68008
  }
68009
- function _e(r6) {
68009
+ function Le(r6) {
68010
68010
  return typeof r6 == "string" && !!ft.dateTime.exec(r6);
68011
68011
  }
68012
- function zn(r6) {
68013
- return !!(r6 && typeof r6 == "object" && ("start" in r6 && _e(r6.start) || "end" in r6 && _e(r6.end)));
68012
+ function Jn(r6) {
68013
+ return !!(r6 && typeof r6 == "object" && ("start" in r6 && Le(r6.start) || "end" in r6 && Le(r6.end)));
68014
68014
  }
68015
68015
  function w(r6) {
68016
68016
  return !!(r6 && typeof r6 == "object" && "value" in r6 && typeof r6.value == "number");
68017
68017
  }
68018
- function Jn(r6, e) {
68018
+ function Kn(r6, e) {
68019
68019
  return Math.abs(r6.value - e.value) < 0.01 && (r6.unit === e.unit || r6.code === e.code || r6.unit === e.code || r6.code === e.unit);
68020
68020
  }
68021
68021
  function Dr(r6, e) {
@@ -68023,49 +68023,49 @@ function Dr(r6, e) {
68023
68023
  if (t.length !== n.length) return false;
68024
68024
  for (let i of t) {
68025
68025
  let o = r6[i], s = e[i];
68026
- if (jn(o) && jn(s)) {
68026
+ if ($n(o) && $n(s)) {
68027
68027
  if (!Dr(o, s)) return false;
68028
68028
  } else if (o !== s) return false;
68029
68029
  }
68030
68030
  return true;
68031
68031
  }
68032
- function jn(r6) {
68032
+ function $n(r6) {
68033
68033
  return r6 !== null && typeof r6 == "object";
68034
68034
  }
68035
68035
  function kr(r6, e) {
68036
68036
  if (e) {
68037
68037
  if (typeof e != "object") throw new Error("Primitive extension must be an object");
68038
- return Lo(r6 ?? {}, e);
68038
+ return Fo(r6 ?? {}, e);
68039
68039
  }
68040
68040
  return r6;
68041
68041
  }
68042
- function Lo(r6, e) {
68042
+ function Fo(r6, e) {
68043
68043
  return delete e.__proto__, delete e.constructor, Object.assign(r6, e);
68044
68044
  }
68045
68045
  function Qe(r6, e) {
68046
68046
  return O(r6, e) && "id" in r6 && typeof r6.id == "string";
68047
68047
  }
68048
68048
  function ge(r6) {
68049
- let e = D(r6) ?? "undefined/undefined", t = No(r6);
68049
+ let e = V(r6) ?? "undefined/undefined", t = Uo(r6);
68050
68050
  return t === e ? { reference: e } : { reference: e, display: t };
68051
68051
  }
68052
- function D(r6) {
68052
+ function V(r6) {
68053
68053
  if (q(r6)) return r6.reference;
68054
68054
  if (Qe(r6)) return `${r6.resourceType}/${r6.id}`;
68055
68055
  }
68056
68056
  function xe(r6) {
68057
68057
  if (r6) return q(r6) ? r6.reference.split("/")[1] : r6.id;
68058
68058
  }
68059
- function Fo(r6) {
68059
+ function No(r6) {
68060
68060
  return r6.resourceType === "Patient" || r6.resourceType === "Practitioner" || r6.resourceType === "RelatedPerson";
68061
68061
  }
68062
- function No(r6) {
68063
- if (Fo(r6)) {
68064
- let e = Uo(r6);
68062
+ function Uo(r6) {
68063
+ if (No(r6)) {
68064
+ let e = Bo(r6);
68065
68065
  if (e) return e;
68066
68066
  }
68067
68067
  if (r6.resourceType === "Device") {
68068
- let e = Bo(r6);
68068
+ let e = Wo(r6);
68069
68069
  if (e) return e;
68070
68070
  }
68071
68071
  if (r6.resourceType === "MedicationRequest" && r6.medicationCodeableConcept) return He(r6.medicationCodeableConcept);
@@ -68075,15 +68075,15 @@ function No(r6) {
68075
68075
  if ("code" in r6 && r6.code) {
68076
68076
  let e = r6.code;
68077
68077
  if (Array.isArray(e) && (e = e[0]), _r(e)) return He(e);
68078
- if (zo(e)) return e.text;
68078
+ if (Jo(e)) return e.text;
68079
68079
  }
68080
- return D(r6) ?? "";
68080
+ return V(r6) ?? "";
68081
68081
  }
68082
- function Uo(r6) {
68082
+ function Bo(r6) {
68083
68083
  let e = r6.name;
68084
68084
  if (e && e.length > 0) return ze(e[0]);
68085
68085
  }
68086
- function Bo(r6) {
68086
+ function Wo(r6) {
68087
68087
  let e = r6.deviceName;
68088
68088
  if (e && e.length > 0) return e[0].name;
68089
68089
  }
@@ -68105,26 +68105,26 @@ function oe(r6, ...e) {
68105
68105
  return t;
68106
68106
  }
68107
68107
  function Tt(r6, e) {
68108
- let t = Fr(r6);
68108
+ let t = Nr(r6);
68109
68109
  return JSON.stringify(t, null, e ? 2 : void 0) ?? "";
68110
68110
  }
68111
- function Fr(r6) {
68112
- if (!(r6 == null || r6 === "")) return typeof r6 == "object" ? Array.isArray(r6) ? qo(r6) : jo(r6) : r6;
68111
+ function Nr(r6) {
68112
+ if (!(r6 == null || r6 === "")) return typeof r6 == "object" ? Array.isArray(r6) ? jo(r6) : $o(r6) : r6;
68113
68113
  }
68114
- function qo(r6) {
68114
+ function jo(r6) {
68115
68115
  let e = r6.length;
68116
68116
  if (e === 0) return;
68117
68117
  let t, n = 0;
68118
68118
  for (let i = 0; i < e; i++) {
68119
- let o = r6[i], s = Fr(o);
68119
+ let o = r6[i], s = Nr(o);
68120
68120
  s !== o && !t && (t = Array.from(r6)), s === void 0 ? t && (t[i] = null) : (t && (t[i] = s), n++);
68121
68121
  }
68122
68122
  if (n !== 0) return t ?? r6;
68123
68123
  }
68124
- function jo(r6) {
68124
+ function $o(r6) {
68125
68125
  let e, t = 0;
68126
68126
  for (let n in r6) {
68127
- let i = r6[n], o = Fr(i);
68127
+ let i = r6[n], o = Nr(i);
68128
68128
  o !== i && !e && (e = { ...r6 }), o === void 0 ? e && delete e[n] : (e && (e[n] = o), t++);
68129
68129
  }
68130
68130
  if (t !== 0) return e ?? r6;
@@ -68140,14 +68140,14 @@ function Y(r6) {
68140
68140
  return e === "string" && r6 !== "" || e === "object" && ("length" in r6 && r6.length > 0 || Object.keys(r6).length > 0);
68141
68141
  }
68142
68142
  function se(r6, e, t) {
68143
- return r6 === e || S(r6) && S(e) ? true : S(r6) || S(e) ? false : Array.isArray(r6) && Array.isArray(e) ? $o(r6, e) : Array.isArray(r6) || Array.isArray(e) ? false : R(r6) && R(e) ? Go(r6, e, t) : (R(r6) || R(e), false);
68143
+ return r6 === e || S(r6) && S(e) ? true : S(r6) || S(e) ? false : Array.isArray(r6) && Array.isArray(e) ? Go(r6, e) : Array.isArray(r6) || Array.isArray(e) ? false : R(r6) && R(e) ? Ho(r6, e, t) : (R(r6) || R(e), false);
68144
68144
  }
68145
- function $o(r6, e) {
68145
+ function Go(r6, e) {
68146
68146
  if (r6.length !== e.length) return false;
68147
68147
  for (let t = 0; t < r6.length; t++) if (!se(r6[t], e[t])) return false;
68148
68148
  return true;
68149
68149
  }
68150
- function Go(r6, e, t) {
68150
+ function Ho(r6, e, t) {
68151
68151
  let n = /* @__PURE__ */ new Set();
68152
68152
  Object.keys(r6).forEach((i) => n.add(i)), Object.keys(e).forEach((i) => n.add(i)), t === "meta" && (n.delete("versionId"), n.delete("lastUpdated"), n.delete("author"));
68153
68153
  for (let i of n) {
@@ -68159,7 +68159,7 @@ function Go(r6, e, t) {
68159
68159
  function R(r6) {
68160
68160
  return r6 !== null && typeof r6 == "object";
68161
68161
  }
68162
- function Zn(r6) {
68162
+ function ei(r6) {
68163
68163
  return r6.every(St);
68164
68164
  }
68165
68165
  function St(r6) {
@@ -68171,31 +68171,31 @@ function Mr(r6) {
68171
68171
  function _r(r6) {
68172
68172
  return R(r6) && "coding" in r6 && Array.isArray(r6.coding) && r6.coding.every(Mr);
68173
68173
  }
68174
- function zo(r6) {
68174
+ function Jo(r6) {
68175
68175
  return R(r6) && "text" in r6 && typeof r6.text == "string";
68176
68176
  }
68177
- var ei = [];
68178
- for (let r6 = 0; r6 < 256; r6++) ei.push(r6.toString(16).padStart(2, "0"));
68179
- function ti(r6) {
68180
- let e = ni(r6), t = new Uint8Array(e), n = new Array(t.length);
68181
- for (let i = 0; i < t.length; i++) n[i] = ei[t[i]];
68177
+ var ti = [];
68178
+ for (let r6 = 0; r6 < 256; r6++) ti.push(r6.toString(16).padStart(2, "0"));
68179
+ function ri(r6) {
68180
+ let e = ii(r6), t = new Uint8Array(e), n = new Array(t.length);
68181
+ for (let i = 0; i < t.length; i++) n[i] = ti[t[i]];
68182
68182
  return n.join("");
68183
68183
  }
68184
- function ri(r6) {
68185
- let e = ni(r6), t = new Uint8Array(e), n = new Array(t.length);
68184
+ function ni(r6) {
68185
+ let e = ii(r6), t = new Uint8Array(e), n = new Array(t.length);
68186
68186
  for (let i = 0; i < t.length; i++) n[i] = String.fromCharCode(t[i]);
68187
68187
  return window.btoa(n.join(""));
68188
68188
  }
68189
- function ni(r6) {
68189
+ function ii(r6) {
68190
68190
  return ArrayBuffer.isView(r6) ? r6.buffer : r6;
68191
68191
  }
68192
68192
  function k(r6) {
68193
68193
  return r6 ? r6.charAt(0).toUpperCase() + r6.substring(1) : "";
68194
68194
  }
68195
- var Ur = (r6) => new Promise((e) => {
68195
+ var Br = (r6) => new Promise((e) => {
68196
68196
  setTimeout(e, r6);
68197
68197
  });
68198
- function Br(r6, e, t) {
68198
+ function Wr(r6, e, t) {
68199
68199
  let n = [];
68200
68200
  for (let i = 0; i < t - 1; i++) {
68201
68201
  let o = r6.indexOf(e);
@@ -68207,24 +68207,24 @@ function Br(r6, e, t) {
68207
68207
  function bt(r6) {
68208
68208
  return r6.sort((e, t) => e.localeCompare(t));
68209
68209
  }
68210
- function Wr(r6) {
68210
+ function qr(r6) {
68211
68211
  return r6.endsWith("/") ? r6 : r6 + "/";
68212
68212
  }
68213
- function ts(r6) {
68213
+ function rs(r6) {
68214
68214
  return r6.startsWith("/") ? r6.slice(1) : r6;
68215
68215
  }
68216
68216
  function j(r6, e) {
68217
- return new URL(ts(e), Wr(r6.toString())).toString();
68217
+ return new URL(rs(e), qr(r6.toString())).toString();
68218
68218
  }
68219
- function ai(r6, e) {
68219
+ function ci(r6, e) {
68220
68220
  return j(r6, e).toString().replace("http://", "ws://").replace("https://", "wss://");
68221
68221
  }
68222
- function ci(r6) {
68222
+ function ui(r6) {
68223
68223
  return typeof r6 == "object" && !Array.isArray(r6) && !(r6 instanceof URLSearchParams) && (r6 = Object.fromEntries(Object.entries(r6).filter((e) => e[1] !== void 0))), new URLSearchParams(r6).toString();
68224
68224
  }
68225
- var rs = /^(([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])$/;
68226
- function Sl(r6) {
68227
- return rs.test(r6);
68225
+ var ns = /^(([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])$/;
68226
+ function bl(r6) {
68227
+ return ns.test(r6);
68228
68228
  }
68229
68229
  function ze(r6, e) {
68230
68230
  if (!r6) return "";
@@ -68238,9 +68238,9 @@ function ze(r6, e) {
68238
68238
  function He(r6) {
68239
68239
  if (!r6) return "";
68240
68240
  let e = Te(r6.text);
68241
- return e || (r6.coding ? r6.coding.map((t) => li(t)).join(", ") : "");
68241
+ return e || (r6.coding ? r6.coding.map((t) => pi(t)).join(", ") : "");
68242
68242
  }
68243
- function li(r6, e) {
68243
+ function pi(r6, e) {
68244
68244
  let t = Te(r6?.display);
68245
68245
  if (t) {
68246
68246
  let n = e ? Te(r6?.code) : void 0;
@@ -68252,32 +68252,32 @@ function Te(r6) {
68252
68252
  return typeof r6 == "string" ? r6 : void 0;
68253
68253
  }
68254
68254
  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" };
68255
- function Bn(r6) {
68255
+ function Wn(r6) {
68256
68256
  let e = Array.isArray(r6) ? r6 : r6.entry?.map((t) => t.resource) ?? [];
68257
- for (let t of e) t?.resourceType === "StructureDefinition" && t.kind === "resource" && fi(t.type);
68257
+ for (let t of e) t?.resourceType === "StructureDefinition" && t.kind === "resource" && hi(t.type);
68258
68258
  }
68259
- function fi(r6) {
68259
+ function hi(r6) {
68260
68260
  let e = F.types[r6];
68261
68261
  return e || (e = { searchParamsDetails: {} }, F.types[r6] = e), !e.searchParams && r6 !== "Binary" && (e.searchParams = { _id: { base: [r6], code: "_id", type: "token", expression: r6 + ".id" }, _lastUpdated: { base: [r6], code: "_lastUpdated", type: "date", expression: r6 + ".meta.lastUpdated" }, _compartment: { base: [r6], code: "_compartment", type: "reference", expression: r6 + ".meta.compartment" }, _profile: { base: [r6], code: "_profile", type: "uri", expression: r6 + ".meta.profile" }, _security: { base: [r6], code: "_security", type: "token", expression: r6 + ".meta.security" }, _source: { base: [r6], code: "_source", type: "uri", expression: r6 + ".meta.source" }, _tag: { base: [r6], code: "_tag", type: "token", expression: r6 + ".meta.tag" } }), e;
68262
68262
  }
68263
- function $r(r6) {
68263
+ function Gr(r6) {
68264
68264
  for (let e of r6.base ?? []) {
68265
- let t = fi(e);
68265
+ let t = hi(e);
68266
68266
  t.searchParams || (t.searchParams = {}), t.searchParams[r6.code] = r6;
68267
68267
  }
68268
68268
  }
68269
68269
  function vr(r6) {
68270
68270
  let e = r6.type?.[0]?.code;
68271
- return e === "BackboneElement" || e === "Element" ? fs2((r6.base?.path ?? r6.path)?.split(".")) : e;
68271
+ return e === "BackboneElement" || e === "Element" ? hs((r6.base?.path ?? r6.path)?.split(".")) : e;
68272
68272
  }
68273
- function fs2(r6) {
68273
+ function hs(r6) {
68274
68274
  return r6.length === 1 ? r6[0] : r6.map(k).join("");
68275
68275
  }
68276
68276
  function xt(r6, e, t) {
68277
- let n = qe(r6, t);
68278
- if (n) return gs(n.elements, e);
68277
+ let n = je(r6, t);
68278
+ if (n) return xs(n.elements, e);
68279
68279
  }
68280
- function gs(r6, e) {
68280
+ function xs(r6, e) {
68281
68281
  let t = r6[e] ?? r6[e + "[x]"];
68282
68282
  if (t) return t;
68283
68283
  for (let n = 0; n < e.length; n++) {
@@ -68295,7 +68295,7 @@ function q(r6, e) {
68295
68295
  return r6 && typeof r6 == "object" && "reference" in r6 && typeof r6.reference == "string" ? e ? r6.reference.match(new RegExp(`^${e}(/|\\?)`)) !== null : true : false;
68296
68296
  }
68297
68297
  var F = { types: {} };
68298
- function Le(r6) {
68298
+ function Fe(r6) {
68299
68299
  if (r6.startsWith("T")) return r6 + "T00:00:00.000Z".substring(r6.length);
68300
68300
  if (r6.length <= 10) return r6;
68301
68301
  try {
@@ -68379,11 +68379,11 @@ var I = { empty: (r6, e) => h(e.length === 0 || e.every((t) => S(t.value))), has
68379
68379
  }, convertsToInteger: (r6, e) => e.length === 0 ? [] : h(I.toInteger(r6, e).length === 1), toDate: (r6, e) => {
68380
68380
  if (e.length === 0) return [];
68381
68381
  let [{ value: t }] = J(e, 1);
68382
- return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.date, value: Le(t) }] : [];
68382
+ return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.date, value: Fe(t) }] : [];
68383
68383
  }, convertsToDate: (r6, e) => e.length === 0 ? [] : h(I.toDate(r6, e).length === 1), toDateTime: (r6, e) => {
68384
68384
  if (e.length === 0) return [];
68385
68385
  let [{ value: t }] = J(e, 1);
68386
- return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.dateTime, value: Le(t) }] : [];
68386
+ return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.dateTime, value: Fe(t) }] : [];
68387
68387
  }, convertsToDateTime: (r6, e) => e.length === 0 ? [] : h(I.toDateTime(r6, e).length === 1), toDecimal: (r6, e) => {
68388
68388
  if (e.length === 0) return [];
68389
68389
  let [{ value: t }] = J(e, 1);
@@ -68401,7 +68401,7 @@ var I = { empty: (r6, e) => h(e.length === 0 || e.every((t) => S(t.value))), has
68401
68401
  let [{ value: t }] = J(e, 1);
68402
68402
  if (typeof t == "string") {
68403
68403
  let n = /^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(t);
68404
- if (n) return [{ type: l.time, value: Le("T" + n[1]) }];
68404
+ if (n) return [{ type: l.time, value: Fe("T" + n[1]) }];
68405
68405
  }
68406
68406
  return [];
68407
68407
  }, convertsToTime: (r6, e) => e.length === 0 ? [] : h(I.toTime(r6, e).length === 1), indexOf: (r6, e, t) => N((n, i) => n.indexOf(i), r6, e, t), substring: (r6, e, t, n) => N((i, o, s) => {
@@ -68554,7 +68554,7 @@ var pe = class extends ne {
68554
68554
  };
68555
68555
  var C = class extends ne {
68556
68556
  };
68557
- var V = class extends C {
68557
+ var D = class extends C {
68558
68558
  constructor(e, t, n, i) {
68559
68559
  super(e, t, n), this.impl = i;
68560
68560
  }
@@ -68620,7 +68620,7 @@ var At = class extends C {
68620
68620
  }
68621
68621
  eval(e, t) {
68622
68622
  let n = this.left.eval(e, t), i = this.right.eval(e, t);
68623
- return Gn(n, i);
68623
+ return Hn(n, i);
68624
68624
  }
68625
68625
  };
68626
68626
  var Ot = class extends C {
@@ -68629,7 +68629,7 @@ var Ot = class extends C {
68629
68629
  }
68630
68630
  eval(e, t) {
68631
68631
  let n = this.left.eval(e, t), i = this.right.eval(e, t);
68632
- return Hn(n, i);
68632
+ return Qn(n, i);
68633
68633
  }
68634
68634
  };
68635
68635
  var It = class extends C {
@@ -68647,7 +68647,7 @@ var kt = class extends C {
68647
68647
  }
68648
68648
  eval(e, t) {
68649
68649
  let n = this.left.eval(e, t), i = this.right.eval(e, t);
68650
- return $n(Vr(n, i));
68650
+ return Gn(Vr(n, i));
68651
68651
  }
68652
68652
  };
68653
68653
  var Ee = class extends C {
@@ -68728,40 +68728,40 @@ var Re = class {
68728
68728
  };
68729
68729
  var Ke = ["!=", "!~", "<=", ">=", "{}", "->"];
68730
68730
  var g = { FunctionCall: 0, Dot: 1, Indexer: 2, UnaryAdd: 3, UnarySubtract: 3, Multiply: 4, Divide: 4, IntegerDivide: 4, Modulo: 4, Add: 5, Subtract: 5, Ampersand: 5, Is: 6, As: 6, Union: 7, GreaterThan: 8, GreaterThanOrEquals: 8, LessThan: 8, LessThanOrEquals: 8, Equals: 9, Equivalent: 9, NotEquals: 9, NotEquivalent: 9, In: 10, Contains: 10, And: 11, Xor: 12, Or: 12, Implies: 13, Arrow: 100, Semicolon: 200 };
68731
- var Ss = { parse(r6) {
68731
+ var bs = { parse(r6) {
68732
68732
  let e = r6.consumeAndParse();
68733
68733
  if (!r6.match(")")) throw new Error("Parse error: expected `)` got `" + r6.peek()?.value + "`");
68734
68734
  return e;
68735
68735
  } };
68736
- var bs = { parse(r6, e) {
68736
+ var Es = { parse(r6, e) {
68737
68737
  let t = r6.consumeAndParse();
68738
68738
  if (!r6.match("]")) throw new Error("Parse error: expected `]`");
68739
68739
  return new Re(e, t);
68740
68740
  }, precedence: g.Indexer };
68741
- var Es = { parse(r6, e) {
68741
+ var Rs = { parse(r6, e) {
68742
68742
  if (!(e instanceof $)) throw new Error("Unexpected parentheses");
68743
68743
  let t = [];
68744
68744
  for (; !r6.match(")"); ) t.push(r6.consumeAndParse()), r6.match(",");
68745
68745
  return new ee(e.name, t);
68746
68746
  }, precedence: g.FunctionCall };
68747
- function Rs(r6) {
68747
+ function Cs(r6) {
68748
68748
  let e = r6.split(" "), t = parseFloat(e[0]), n = e[1];
68749
68749
  return n?.startsWith("'") && n.endsWith("'") ? n = n.substring(1, n.length - 1) : n = "{" + n + "}", { value: t, unit: n };
68750
68750
  }
68751
68751
  function Xe() {
68752
- return new st().registerPrefix("String", { parse: (r6, e) => new U({ type: l.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r6, e) => new U({ type: l.dateTime, value: Le(e.value) }) }).registerPrefix("Quantity", { parse: (r6, e) => new U({ type: l.Quantity, value: Rs(e.value) }) }).registerPrefix("Number", { parse: (r6, 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: (r6, e) => new $(e.value) }).registerPrefix("{}", { parse: () => new Et() }).registerPrefix("(", Ss).registerInfix("[", bs).registerInfix("(", Es).prefix("+", g.UnaryAdd, (r6, e) => new Rt("+", e, (t) => t)).prefix("-", g.UnarySubtract, (r6, e) => new V("-", e, e, (t, n) => -n)).infixLeft(".", g.Dot, (r6, e, t) => new le(r6, t)).infixLeft("/", g.Divide, (r6, e, t) => new V("/", r6, t, (n, i) => n / i)).infixLeft("*", g.Multiply, (r6, e, t) => new V("*", r6, t, (n, i) => n * i)).infixLeft("+", g.Add, (r6, e, t) => new V("+", r6, t, (n, i) => n + i)).infixLeft("-", g.Subtract, (r6, e, t) => new V("-", r6, t, (n, i) => n - i)).infixLeft("|", g.Union, (r6, e, t) => new be(r6, t)).infixLeft("=", g.Equals, (r6, e, t) => new At(r6, t)).infixLeft("!=", g.NotEquals, (r6, e, t) => new Ot(r6, t)).infixLeft("~", g.Equivalent, (r6, e, t) => new It(r6, t)).infixLeft("!~", g.NotEquivalent, (r6, e, t) => new kt(r6, t)).infixLeft("<", g.LessThan, (r6, e, t) => new V("<", r6, t, (n, i) => n < i)).infixLeft("<=", g.LessThanOrEquals, (r6, e, t) => new V("<=", r6, t, (n, i) => n <= i)).infixLeft(">", g.GreaterThan, (r6, e, t) => new V(">", r6, t, (n, i) => n > i)).infixLeft(">=", g.GreaterThanOrEquals, (r6, e, t) => new V(">=", r6, t, (n, i) => n >= i)).infixLeft("&", g.Ampersand, (r6, e, t) => new Ct(r6, t)).infixLeft("and", g.And, (r6, e, t) => new Vt(r6, t)).infixLeft("as", g.As, (r6, e, t) => new pe(r6, t)).infixLeft("contains", g.Contains, (r6, e, t) => new Pt(r6, t)).infixLeft("div", g.Divide, (r6, e, t) => new V("div", r6, t, (n, i) => n / i | 0)).infixLeft("in", g.In, (r6, e, t) => new wt(r6, t)).infixLeft("is", g.Is, (r6, e, t) => new Ee(r6, t)).infixLeft("mod", g.Modulo, (r6, e, t) => new V("mod", r6, t, (n, i) => n % i)).infixLeft("or", g.Or, (r6, e, t) => new Dt(r6, t)).infixLeft("xor", g.Xor, (r6, e, t) => new Mt(r6, t)).infixLeft("implies", g.Implies, (r6, e, t) => new _t(r6, t));
68752
+ return new st().registerPrefix("String", { parse: (r6, e) => new U({ type: l.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r6, e) => new U({ type: l.dateTime, value: Fe(e.value) }) }).registerPrefix("Quantity", { parse: (r6, e) => new U({ type: l.Quantity, value: Cs(e.value) }) }).registerPrefix("Number", { parse: (r6, 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: (r6, e) => new $(e.value) }).registerPrefix("{}", { parse: () => new Et() }).registerPrefix("(", bs).registerInfix("[", Es).registerInfix("(", Rs).prefix("+", g.UnaryAdd, (r6, e) => new Rt("+", e, (t) => t)).prefix("-", g.UnarySubtract, (r6, e) => new D("-", e, e, (t, n) => -n)).infixLeft(".", g.Dot, (r6, e, t) => new le(r6, t)).infixLeft("/", g.Divide, (r6, e, t) => new D("/", r6, t, (n, i) => n / i)).infixLeft("*", g.Multiply, (r6, e, t) => new D("*", r6, t, (n, i) => n * i)).infixLeft("+", g.Add, (r6, e, t) => new D("+", r6, t, (n, i) => n + i)).infixLeft("-", g.Subtract, (r6, e, t) => new D("-", r6, t, (n, i) => n - i)).infixLeft("|", g.Union, (r6, e, t) => new be(r6, t)).infixLeft("=", g.Equals, (r6, e, t) => new At(r6, t)).infixLeft("!=", g.NotEquals, (r6, e, t) => new Ot(r6, t)).infixLeft("~", g.Equivalent, (r6, e, t) => new It(r6, t)).infixLeft("!~", g.NotEquivalent, (r6, e, t) => new kt(r6, t)).infixLeft("<", g.LessThan, (r6, e, t) => new D("<", r6, t, (n, i) => n < i)).infixLeft("<=", g.LessThanOrEquals, (r6, e, t) => new D("<=", r6, t, (n, i) => n <= i)).infixLeft(">", g.GreaterThan, (r6, e, t) => new D(">", r6, t, (n, i) => n > i)).infixLeft(">=", g.GreaterThanOrEquals, (r6, e, t) => new D(">=", r6, t, (n, i) => n >= i)).infixLeft("&", g.Ampersand, (r6, e, t) => new Ct(r6, t)).infixLeft("and", g.And, (r6, e, t) => new Vt(r6, t)).infixLeft("as", g.As, (r6, e, t) => new pe(r6, t)).infixLeft("contains", g.Contains, (r6, e, t) => new Pt(r6, t)).infixLeft("div", g.Divide, (r6, e, t) => new D("div", r6, t, (n, i) => n / i | 0)).infixLeft("in", g.In, (r6, e, t) => new wt(r6, t)).infixLeft("is", g.Is, (r6, e, t) => new Ee(r6, t)).infixLeft("mod", g.Modulo, (r6, e, t) => new D("mod", r6, t, (n, i) => n % i)).infixLeft("or", g.Or, (r6, e, t) => new Dt(r6, t)).infixLeft("xor", g.Xor, (r6, e, t) => new Mt(r6, t)).infixLeft("implies", g.Implies, (r6, e, t) => new _t(r6, t));
68753
68753
  }
68754
- var Cs = Xe();
68754
+ var Ps = Xe();
68755
68755
  var f = { EQUALS: "eq", NOT_EQUALS: "ne", GREATER_THAN: "gt", LESS_THAN: "lt", GREATER_THAN_OR_EQUALS: "ge", LESS_THAN_OR_EQUALS: "le", STARTS_AFTER: "sa", ENDS_BEFORE: "eb", APPROXIMATELY: "ap", CONTAINS: "contains", STARTS_WITH: "sw", EXACT: "exact", TEXT: "text", NOT: "not", ABOVE: "above", BELOW: "below", IN: "in", NOT_IN: "not-in", OF_TYPE: "of-type", MISSING: "missing", PRESENT: "present", IDENTIFIER: "identifier", ITERATE: "iterate" };
68756
- var Ri = { contains: f.CONTAINS, exact: f.EXACT, above: f.ABOVE, below: f.BELOW, text: f.TEXT, not: f.NOT, in: f.IN, "not-in": f.NOT_IN, "of-type": f.OF_TYPE, missing: f.MISSING, identifier: f.IDENTIFIER, iterate: f.ITERATE };
68757
- var Gr = { eq: f.EQUALS, ne: f.NOT_EQUALS, lt: f.LESS_THAN, le: f.LESS_THAN_OR_EQUALS, gt: f.GREATER_THAN, ge: f.GREATER_THAN_OR_EQUALS, sa: f.STARTS_AFTER, eb: f.ENDS_BEFORE, ap: f.APPROXIMATELY, sw: f.STARTS_WITH };
68758
- var Ds = [f.MISSING, f.PRESENT];
68756
+ var Ci = { contains: f.CONTAINS, exact: f.EXACT, above: f.ABOVE, below: f.BELOW, text: f.TEXT, not: f.NOT, in: f.IN, "not-in": f.NOT_IN, "of-type": f.OF_TYPE, missing: f.MISSING, identifier: f.IDENTIFIER, iterate: f.ITERATE };
68757
+ var Hr = { eq: f.EQUALS, ne: f.NOT_EQUALS, lt: f.LESS_THAN, le: f.LESS_THAN_OR_EQUALS, gt: f.GREATER_THAN, ge: f.GREATER_THAN_OR_EQUALS, sa: f.STARTS_AFTER, eb: f.ENDS_BEFORE, ap: f.APPROXIMATELY, sw: f.STARTS_WITH };
68758
+ var Ms = [f.MISSING, f.PRESENT];
68759
68759
  var Pe = { READ: "read", VREAD: "vread", UPDATE: "update", DELETE: "delete", HISTORY: "history", CREATE: "create", SEARCH: "search" };
68760
- var Zs = [Pe.READ, Pe.VREAD, Pe.HISTORY, Pe.SEARCH];
68760
+ var ea = [Pe.READ, Pe.VREAD, Pe.HISTORY, Pe.SEARCH];
68761
68761
  function B() {
68762
68762
  return typeof window < "u";
68763
68763
  }
68764
- function Hr() {
68764
+ function Qr() {
68765
68765
  return typeof Buffer < "u" ? Buffer : void 0;
68766
68766
  }
68767
68767
  var te = { assign(r6) {
@@ -68777,12 +68777,12 @@ var te = { assign(r6) {
68777
68777
  }, getOrigin() {
68778
68778
  return B() ? globalThis.location.protocol + "//" + globalThis.location.host + "/" : "";
68779
68779
  } };
68780
- function ra(r6) {
68780
+ function na(r6) {
68781
68781
  if (B()) {
68782
68782
  let t = window.atob(r6), n = Uint8Array.from(t, (i) => i.charCodeAt(0));
68783
68783
  return new window.TextDecoder().decode(n);
68784
68784
  }
68785
- let e = Hr();
68785
+ let e = Qr();
68786
68786
  if (e) return e.from(r6, "base64").toString("utf-8");
68787
68787
  throw new Error("Unable to decode base64");
68788
68788
  }
@@ -68791,20 +68791,20 @@ function Ut(r6) {
68791
68791
  let t = new window.TextEncoder().encode(r6), n = String.fromCharCode.apply(null, t);
68792
68792
  return window.btoa(n);
68793
68793
  }
68794
- let e = Hr();
68794
+ let e = Qr();
68795
68795
  if (e) return e.from(r6, "utf8").toString("base64");
68796
68796
  throw new Error("Unable to encode base64");
68797
68797
  }
68798
- function wi(r6) {
68798
+ function Ai(r6) {
68799
68799
  r6 = r6.padEnd(r6.length + (4 - r6.length % 4) % 4, "=");
68800
68800
  let e = r6.replace(/-/g, "+").replace(/_/g, "/");
68801
- return ra(e);
68801
+ return na(e);
68802
68802
  }
68803
- function Qr() {
68803
+ function zr() {
68804
68804
  let r6 = new Uint32Array(28);
68805
- return crypto.getRandomValues(r6), ti(r6.buffer);
68805
+ return crypto.getRandomValues(r6), ri(r6.buffer);
68806
68806
  }
68807
- async function Ai(r6) {
68807
+ async function Oi(r6) {
68808
68808
  return crypto.subtle.digest("SHA-256", new TextEncoder().encode(r6));
68809
68809
  }
68810
68810
  function we() {
@@ -68814,7 +68814,7 @@ function we() {
68814
68814
  });
68815
68815
  }
68816
68816
  var A = { CSS: "text/css", DICOM: "application/dicom", FAVICON: "image/vnd.microsoft.icon", FHIR_JSON: "application/fhir+json", FORM_URL_ENCODED: "application/x-www-form-urlencoded", HL7_V2: "x-application/hl7-v2+er7", HTML: "text/html", JAVASCRIPT: "text/javascript", JSON: "application/json", JSON_PATCH: "application/json-patch+json", JWT: "application/jwt", MULTIPART_FORM_DATA: "multipart/form-data", PNG: "image/png", SCIM_JSON: "application/scim+json", SVG: "image/svg+xml", TEXT: "text/plain", TYPESCRIPT: "text/typescript", PING: "x-application/ping", XML: "text/xml", CDA_XML: "application/cda+xml", OCTET_STREAM: "application/octet-stream" };
68817
- var zr = class {
68817
+ var Jr = class {
68818
68818
  constructor() {
68819
68819
  this.listeners = {};
68820
68820
  }
@@ -68841,7 +68841,7 @@ var zr = class {
68841
68841
  };
68842
68842
  var K = class {
68843
68843
  constructor() {
68844
- this.emitter = new zr();
68844
+ this.emitter = new Jr();
68845
68845
  }
68846
68846
  dispatchEvent(e) {
68847
68847
  this.emitter.dispatchEvent(e);
@@ -68856,68 +68856,68 @@ var K = class {
68856
68856
  this.emitter.removeAllListeners();
68857
68857
  }
68858
68858
  };
68859
- var Jr = { "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" };
68860
- var ca = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
68861
- var Kr = ["DiagnosticReport-update"];
68862
- function Ii(r6) {
68863
- return Kr.includes(r6);
68864
- }
68859
+ var Kr = { "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" };
68860
+ var ua = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
68861
+ var Xr = ["DiagnosticReport-update"];
68865
68862
  function ki(r6) {
68866
- if (Kr.includes(r6)) throw new d(y(`'context.version' is required for '${r6}'.`));
68867
- }
68868
- var ua = { "Patient-open": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "Patient-close": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "ImagingStudy-open": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "ImagingStudy-close": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "Encounter-open": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "Encounter-close": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "DiagnosticReport-open": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-close": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-select": { report: { resourceType: "DiagnosticReport", reference: true }, patient: { resourceType: "Patient", optional: true, reference: true }, select: { resourceType: "*", reference: true, manyAllowed: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport", reference: true }, patient: { resourceType: "Patient", optional: true, reference: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
68869
- function la(r6) {
68870
- return ca.includes(r6);
68863
+ return Xr.includes(r6);
68871
68864
  }
68872
68865
  function Vi(r6) {
68866
+ if (Xr.includes(r6)) throw new d(y(`'context.version' is required for '${r6}'.`));
68867
+ }
68868
+ var la = { "Patient-open": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "Patient-close": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "ImagingStudy-open": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "ImagingStudy-close": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "Encounter-open": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "Encounter-close": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "DiagnosticReport-open": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-close": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-select": { report: { resourceType: "DiagnosticReport", reference: true }, patient: { resourceType: "Patient", optional: true, reference: true }, select: { resourceType: "*", reference: true, manyAllowed: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport", reference: true }, patient: { resourceType: "Patient", optional: true, reference: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
68869
+ function pa(r6) {
68870
+ return ua.includes(r6);
68871
+ }
68872
+ function Di(r6) {
68873
68873
  return !!r6.endpoint;
68874
68874
  }
68875
- function Xr(r6) {
68875
+ function Yr(r6) {
68876
68876
  if (!Wt(r6)) throw new d(y("subscriptionRequest must be an object conforming to SubscriptionRequest type."));
68877
68877
  let { channelType: e, mode: t, topic: n, events: i } = r6, o = { "hub.channel.type": e, "hub.mode": t, "hub.topic": n, "hub.events": i.join(",") };
68878
- return Vi(r6) && (o.endpoint = r6.endpoint), new URLSearchParams(o).toString();
68878
+ return Di(r6) && (o.endpoint = r6.endpoint), new URLSearchParams(o).toString();
68879
68879
  }
68880
68880
  function Wt(r6) {
68881
68881
  if (typeof r6 != "object") return false;
68882
68882
  let { channelType: e, mode: t, topic: n, events: i } = r6;
68883
68883
  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;
68884
- for (let o of i) if (!Jr[o]) return false;
68885
- return !(Vi(r6) && !(typeof r6.endpoint == "string" && r6.endpoint.startsWith("ws")));
68884
+ for (let o of i) if (!Kr[o]) return false;
68885
+ return !(Di(r6) && !(typeof r6.endpoint == "string" && r6.endpoint.startsWith("ws")));
68886
68886
  }
68887
- function pa(r6, e, t, n) {
68887
+ function da(r6, e, t, n) {
68888
68888
  if (typeof e != "object") throw new d(y(`context[${t}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));
68889
68889
  if (!(e.id && typeof e.id == "string")) throw new d(y(`context[${t}] is invalid. Resource must contain a valid string ID.`));
68890
68890
  if (!e.resourceType) throw new d(y(`context[${t}] is invalid. Resource must contain a resource type. No resource type found.`));
68891
68891
  let i = n.resourceType;
68892
68892
  if (i !== "*") {
68893
- if (!la(e.resourceType)) throw new d(y(`context[${t}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));
68893
+ if (!pa(e.resourceType)) throw new d(y(`context[${t}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));
68894
68894
  if (i && e.resourceType !== i) throw new d(y(`context[${t}] is invalid. context[${t}] for the '${r6}' event should contain resource of type ${i}.`));
68895
68895
  }
68896
68896
  }
68897
- function da(r6, e, t, n, i) {
68897
+ function fa(r6, e, t, n, i) {
68898
68898
  if (i.set(e.key, (i.get(e.key) ?? 0) + 1), n.reference) {
68899
68899
  if (!q(e.reference)) throw new d(y(`context[${t}] is invalid. Expected key '${e.key}' to be a reference.`));
68900
- } else pa(r6, e.resource, t, n);
68900
+ } else da(r6, e.resource, t, n);
68901
68901
  }
68902
- function fa(r6, e) {
68903
- let t = /* @__PURE__ */ new Map(), n = ua[r6];
68902
+ function ha(r6, e) {
68903
+ let t = /* @__PURE__ */ new Map(), n = la[r6];
68904
68904
  for (let i = 0; i < e.length; i++) {
68905
68905
  let o = e[i].key;
68906
68906
  if (!n[o]) throw new d(y(`Key '${o}' not found for event '${r6}'. Make sure to add only valid keys.`));
68907
- da(r6, e[i], i, n[o], t);
68907
+ fa(r6, e[i], i, n[o], t);
68908
68908
  }
68909
68909
  for (let [i, o] of Object.entries(n)) {
68910
68910
  if (!(o.optional || t.has(i))) throw new d(y(`Missing required key '${i}' on context for '${r6}' event.`));
68911
68911
  if (!o.manyAllowed && (t.get(i) ?? 0) > 1) throw new d(y(`${t.get(i)} context entries with key '${i}' found for the '${r6}' event when schema only allows for 1.`));
68912
68912
  }
68913
68913
  }
68914
- function Yr(r6, e, t, n) {
68914
+ function Zr(r6, e, t, n) {
68915
68915
  if (!(r6 && typeof r6 == "string")) throw new d(y("Must provide a topic."));
68916
- if (!Jr[e]) throw new d(y(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Jr).join(", ")}`));
68916
+ if (!Kr[e]) throw new d(y(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Kr).join(", ")}`));
68917
68917
  if (typeof t != "object") throw new d(y("context must be a context object or array of context objects."));
68918
- if (Kr.includes(e) && !n) throw new d(y(`The '${e}' event must contain a 'context.versionId'.`));
68918
+ if (Xr.includes(e) && !n) throw new d(y(`The '${e}' event must contain a 'context.versionId'.`));
68919
68919
  let i = Array.isArray(t) ? t : [t];
68920
- return fa(e, i), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: we(), event: { "hub.topic": r6, "hub.event": e, context: i, ...n ? { "context.versionId": n } : {} } };
68920
+ return ha(e, i), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: we(), event: { "hub.topic": r6, "hub.event": e, context: i, ...n ? { "context.versionId": n } : {} } };
68921
68921
  }
68922
68922
  var Bt = class extends K {
68923
68923
  constructor(e) {
@@ -68939,24 +68939,24 @@ var Bt = class extends K {
68939
68939
  this.websocket.close();
68940
68940
  }
68941
68941
  };
68942
- function ha(r6) {
68943
- return JSON.parse(wi(r6));
68942
+ function ma(r6) {
68943
+ return JSON.parse(Ai(r6));
68944
68944
  }
68945
- function Di(r6) {
68945
+ function Mi(r6) {
68946
68946
  return r6.split(".").length === 3;
68947
68947
  }
68948
68948
  function qt(r6) {
68949
68949
  let [e, t, n] = r6.split(".");
68950
- return ha(t);
68950
+ return ma(t);
68951
68951
  }
68952
- function Mi(r6) {
68952
+ function _i(r6) {
68953
68953
  try {
68954
68954
  return typeof qt(r6).login_id == "string";
68955
68955
  } catch {
68956
68956
  return false;
68957
68957
  }
68958
68958
  }
68959
- function _i(r6) {
68959
+ function Li(r6) {
68960
68960
  try {
68961
68961
  let t = qt(r6).exp;
68962
68962
  return typeof t == "number" ? t * 1e3 : void 0;
@@ -68978,11 +68978,11 @@ var jt = class {
68978
68978
  await this.medplum.delete(`keyvalue/v1/${e}`);
68979
68979
  }
68980
68980
  };
68981
- var Li;
68982
- Li = Symbol.toStringTag;
68981
+ var Fi;
68982
+ Fi = Symbol.toStringTag;
68983
68983
  var M = class {
68984
68984
  constructor(e) {
68985
- this[Li] = "ReadablePromise";
68985
+ this[Fi] = "ReadablePromise";
68986
68986
  this.status = "pending";
68987
68987
  this.suspender = e.then((t) => (this.status = "success", this.response = t, t), (t) => {
68988
68988
  throw this.status = "error", this.error = t, t;
@@ -69016,7 +69016,7 @@ var M = class {
69016
69016
  };
69017
69017
  var et = class {
69018
69018
  constructor(e) {
69019
- this.storage = e ?? (typeof localStorage < "u" ? localStorage : new Zr());
69019
+ this.storage = e ?? (typeof localStorage < "u" ? localStorage : new en());
69020
69020
  }
69021
69021
  clear() {
69022
69022
  this.storage.clear();
@@ -69035,7 +69035,7 @@ var et = class {
69035
69035
  this.setString(e, t ? Tt(t) : void 0);
69036
69036
  }
69037
69037
  };
69038
- var Zr = class {
69038
+ var en = class {
69039
69039
  constructor() {
69040
69040
  this.data = /* @__PURE__ */ new Map();
69041
69041
  }
@@ -69058,15 +69058,15 @@ var Zr = class {
69058
69058
  return Array.from(this.data.keys())[e];
69059
69059
  }
69060
69060
  };
69061
- var Ue = { Event: typeof globalThis.Event < "u" ? globalThis.Event : void 0, ErrorEvent: void 0, CloseEvent: void 0 };
69062
- var Ni = false;
69063
- function ma() {
69061
+ var Be = { Event: typeof globalThis.Event < "u" ? globalThis.Event : void 0, ErrorEvent: void 0, CloseEvent: void 0 };
69062
+ var Ui = false;
69063
+ function ya() {
69064
69064
  if (typeof globalThis.Event > "u") throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");
69065
- Ue.Event = globalThis.Event, Ue.ErrorEvent = class extends Event {
69065
+ Be.Event = globalThis.Event, Be.ErrorEvent = class extends Event {
69066
69066
  constructor(e, t) {
69067
69067
  super("error", t), this.message = e.message, this.error = e;
69068
69068
  }
69069
- }, Ue.CloseEvent = class extends Event {
69069
+ }, Be.CloseEvent = class extends Event {
69070
69070
  constructor(t = 1e3, n = "", i) {
69071
69071
  super("close", i);
69072
69072
  this.wasClean = true;
@@ -69074,17 +69074,17 @@ function ma() {
69074
69074
  }
69075
69075
  };
69076
69076
  }
69077
- function ya(r6, e) {
69077
+ function ga(r6, e) {
69078
69078
  if (!r6) throw new Error(e);
69079
69079
  }
69080
69080
  function $t(r6) {
69081
69081
  return new r6.constructor(r6.type, r6);
69082
69082
  }
69083
69083
  var Ae = { maxReconnectionDelay: 1e4, minReconnectionDelay: 1e3 + Math.random() * 4e3, minUptime: 5e3, reconnectionDelayGrowFactor: 1.3, connectionTimeout: 4e3, maxRetries: 1 / 0, maxEnqueuedMessages: 1 / 0, startClosed: false, debug: false };
69084
- var Ui = false;
69084
+ var Bi = false;
69085
69085
  var Gt = class r extends K {
69086
69086
  constructor(t, n, i = {}) {
69087
- Ni || (ma(), Ni = true);
69087
+ Ui || (ya(), Ui = true);
69088
69088
  super();
69089
69089
  this._retryCount = -1;
69090
69090
  this._shouldReconnect = true;
@@ -69099,7 +69099,7 @@ var Gt = class r extends K {
69099
69099
  this._handleOpen = (t2) => {
69100
69100
  this._debug("open event");
69101
69101
  let { minUptime: n2 = Ae.minUptime } = this._options;
69102
- clearTimeout(this._connectTimeout), this._uptimeTimeout = setTimeout(() => this._acceptOpen(), n2), ya(this._ws, "WebSocket is not defined"), this._ws.binaryType = this._binaryType, this._messageQueue.forEach((i2) => this._ws?.send(i2)), this._messageQueue = [], this.onopen && this.onopen(t2), this.dispatchEvent($t(t2));
69102
+ clearTimeout(this._connectTimeout), this._uptimeTimeout = setTimeout(() => this._acceptOpen(), n2), ga(this._ws, "WebSocket is not defined"), this._ws.binaryType = this._binaryType, this._messageQueue.forEach((i2) => this._ws?.send(i2)), this._messageQueue = [], this.onopen && this.onopen(t2), this.dispatchEvent($t(t2));
69103
69103
  };
69104
69104
  this._handleMessage = (t2) => {
69105
69105
  this._debug("message event"), this.onmessage && this.onmessage(t2), this.dispatchEvent($t(t2));
@@ -69209,21 +69209,21 @@ var Gt = class r extends K {
69209
69209
  this._connectLock = false;
69210
69210
  return;
69211
69211
  }
69212
- !this._options.WebSocket && typeof WebSocket > "u" && !Ui && (console.error("\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket."), Ui = true);
69212
+ !this._options.WebSocket && typeof WebSocket > "u" && !Bi && (console.error("\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket."), Bi = true);
69213
69213
  let i = this._options.WebSocket || WebSocket;
69214
69214
  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);
69215
69215
  }).catch((i) => {
69216
- this._connectLock = false, this._handleError(new Ue.ErrorEvent(Error(i.message), this));
69216
+ this._connectLock = false, this._handleError(new Be.ErrorEvent(Error(i.message), this));
69217
69217
  });
69218
69218
  }
69219
69219
  _handleTimeout() {
69220
- this._debug("timeout event"), this._handleError(new Ue.ErrorEvent(Error("TIMEOUT"), this));
69220
+ this._debug("timeout event"), this._handleError(new Be.ErrorEvent(Error("TIMEOUT"), this));
69221
69221
  }
69222
69222
  _disconnect(t = 1e3, n) {
69223
69223
  if (this._clearTimeouts(), !!this._ws) {
69224
69224
  this._removeListeners();
69225
69225
  try {
69226
- this._ws.close(t, n), this._handleClose(new Ue.CloseEvent(t, n, this));
69226
+ this._ws.close(t, n), this._handleClose(new Be.CloseEvent(t, n, this));
69227
69227
  } catch {
69228
69228
  }
69229
69229
  }
@@ -69241,7 +69241,7 @@ var Gt = class r extends K {
69241
69241
  clearTimeout(this._connectTimeout), clearTimeout(this._uptimeTimeout);
69242
69242
  }
69243
69243
  };
69244
- var ga = 5e3;
69244
+ var xa = 5e3;
69245
69245
  var tt = class extends K {
69246
69246
  constructor(...e) {
69247
69247
  super(), this.criteria = new Set(e);
@@ -69256,7 +69256,7 @@ var tt = class extends K {
69256
69256
  this.criteria.delete(e);
69257
69257
  }
69258
69258
  };
69259
- var en = class {
69259
+ var tn = class {
69260
69260
  constructor(e, t) {
69261
69261
  this.connecting = false;
69262
69262
  this.criteria = e, this.emitter = new tt(e), this.refCount = 1, this.subscriptionProps = t ? { ...t } : void 0;
@@ -69277,7 +69277,7 @@ var Ht = class {
69277
69277
  throw new d(y("Not a valid URL"));
69278
69278
  }
69279
69279
  let o = n?.ReconnectingWebSocket ? new n.ReconnectingWebSocket(i, void 0, { debug: n?.debug, debugLogger: n?.debugLogger }) : new Gt(i, void 0, { debug: n?.debug, debugLogger: n?.debugLogger });
69280
- this.medplum = e, this.ws = o, this.masterSubEmitter = new tt(), this.criteriaEntries = /* @__PURE__ */ new Map(), this.criteriaEntriesBySubscriptionId = /* @__PURE__ */ new Map(), this.wsClosed = false, this.pingIntervalMs = n?.pingIntervalMs ?? ga, this.currentProfile = e.getProfile(), this.setupListeners();
69280
+ this.medplum = e, this.ws = o, this.masterSubEmitter = new tt(), this.criteriaEntries = /* @__PURE__ */ new Map(), this.criteriaEntriesBySubscriptionId = /* @__PURE__ */ new Map(), this.wsClosed = false, this.pingIntervalMs = n?.pingIntervalMs ?? xa, this.currentProfile = e.getProfile(), this.setupListeners();
69281
69281
  }
69282
69282
  setupListeners() {
69283
69283
  let e = this.ws;
@@ -69318,7 +69318,7 @@ var Ht = class {
69318
69318
  for (let o of this.getAllCriteriaEmitters()) o.dispatchEvent({ ...i });
69319
69319
  }
69320
69320
  }), e.addEventListener("error", () => {
69321
- let t = { type: "error", payload: new d(Rn(new Error("WebSocket error"))) };
69321
+ let t = { type: "error", payload: new d(Cn(new Error("WebSocket error"))) };
69322
69322
  this.masterSubEmitter?.dispatchEvent(t);
69323
69323
  for (let n of this.getAllCriteriaEmitters()) n.dispatchEvent({ ...t });
69324
69324
  }), e.addEventListener("close", () => {
@@ -69355,7 +69355,7 @@ var Ht = class {
69355
69355
  }
69356
69356
  async getTokenForCriteria(e) {
69357
69357
  let t = e?.subscriptionId;
69358
- t || (t = (await this.medplum.createResource({ ...e.subscriptionProps, resourceType: "Subscription", status: "active", reason: `WebSocket subscription for ${D(this.medplum.getProfile())}`, channel: { type: "websocket" }, criteria: e.criteria })).id);
69358
+ t || (t = (await this.medplum.createResource({ ...e.subscriptionProps, resourceType: "Subscription", status: "active", reason: `WebSocket subscription for ${V(this.medplum.getProfile())}`, channel: { type: "websocket" }, criteria: e.criteria })).id);
69359
69359
  let { parameter: n } = await this.medplum.get(`fhir/R4/Subscription/${t}/$get-ws-binding-token`), i = n?.find((s) => s.name === "token")?.valueString, o = n?.find((s) => s.name === "websocket-url")?.valueUrl;
69360
69360
  if (!i) throw new d(y("Failed to get token"));
69361
69361
  if (!o) throw new d(y("Failed to get URL from $get-ws-binding-token"));
@@ -69408,7 +69408,7 @@ var Ht = class {
69408
69408
  this.masterSubEmitter && this.masterSubEmitter._addCriteria(e);
69409
69409
  let n = this.maybeGetCriteriaEntry(e, t);
69410
69410
  if (n) return n.refCount += 1, n.emitter;
69411
- let i = new en(e, t);
69411
+ let i = new tn(e, t);
69412
69412
  return this.addCriteriaEntry(i), this.subscribeToCriteria(i).catch(console.error), i.emitter;
69413
69413
  }
69414
69414
  removeCriteria(e, t) {
@@ -69435,24 +69435,24 @@ var Ht = class {
69435
69435
  return this.masterSubEmitter || (this.masterSubEmitter = new tt(...Array.from(this.criteriaEntries.keys()))), this.masterSubEmitter;
69436
69436
  }
69437
69437
  };
69438
- var tn = "4.5.0-686bc335c";
69439
- var Ta = A.FHIR_JSON + ", */*; q=0.1";
69440
- var Sa = "https://api.medplum.com/";
69441
- var ba = 1e3;
69442
- var Ea = 6e4;
69443
- var Ra = 0;
69444
- var Ca = 3e5;
69445
- var Pa = "Binary/";
69446
- var Bi = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
69447
- var Be = { ClientCredentials: "client_credentials", AuthorizationCode: "authorization_code", RefreshToken: "refresh_token", JwtBearer: "urn:ietf:params:oauth:grant-type:jwt-bearer", TokenExchange: "urn:ietf:params:oauth:grant-type:token-exchange" };
69448
- var wa = { AccessToken: "urn:ietf:params:oauth:token-type:access_token", RefreshToken: "urn:ietf:params:oauth:token-type:refresh_token", IdToken: "urn:ietf:params:oauth:token-type:id_token", Saml1Token: "urn:ietf:params:oauth:token-type:saml1", Saml2Token: "urn:ietf:params:oauth:token-type:saml2" };
69449
- var Aa = { JwtBearer: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer" };
69438
+ var rn = "4.5.2-9c04ca03c";
69439
+ var Sa = A.FHIR_JSON + ", */*; q=0.1";
69440
+ var ba = "https://api.medplum.com/";
69441
+ var Ea = 1e3;
69442
+ var Ra = 6e4;
69443
+ var Ca = 0;
69444
+ var Pa = 3e5;
69445
+ var wa = "Binary/";
69446
+ var Wi = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
69447
+ var We = { ClientCredentials: "client_credentials", AuthorizationCode: "authorization_code", RefreshToken: "refresh_token", JwtBearer: "urn:ietf:params:oauth:grant-type:jwt-bearer", TokenExchange: "urn:ietf:params:oauth:grant-type:token-exchange" };
69448
+ var Aa = { AccessToken: "urn:ietf:params:oauth:token-type:access_token", RefreshToken: "urn:ietf:params:oauth:token-type:refresh_token", IdToken: "urn:ietf:params:oauth:token-type:id_token", Saml1Token: "urn:ietf:params:oauth:token-type:saml1", Saml2Token: "urn:ietf:params:oauth:token-type:saml2" };
69449
+ var Oa = { JwtBearer: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer" };
69450
69450
  var Qt = class extends K {
69451
69451
  constructor(t) {
69452
69452
  super();
69453
69453
  this.initComplete = true;
69454
69454
  if (t?.baseUrl && !t.baseUrl.startsWith("http")) throw new Error("Base URL must start with http or https");
69455
- this.options = t ?? {}, this.fetch = t?.fetch ?? Oa(), this.storage = t?.storage ?? new et(), this.createPdfImpl = t?.createPdf, this.baseUrl = Wr(t?.baseUrl ?? Sa), this.fhirBaseUrl = j(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4"), this.authorizeUrl = j(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = j(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = j(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.fhircastHubUrl = j(this.baseUrl, t?.fhircastHubUrl ?? "fhircast/STU3"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.credentialsInHeader = t?.authCredentialsMethod === "header", this.defaultHeaders = t?.defaultHeaders ?? {}, this.onUnauthenticated = t?.onUnauthenticated, this.refreshGracePeriod = t?.refreshGracePeriod ?? Ca, this.cacheTime = t?.cacheTime ?? (B() ? Ea : Ra), this.cacheTime > 0 ? this.requestCache = new Ie(t?.resourceCacheSize ?? ba) : 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(() => {
69455
+ this.options = t ?? {}, this.fetch = t?.fetch ?? Ia(), this.storage = t?.storage ?? new et(), this.createPdfImpl = t?.createPdf, this.baseUrl = qr(t?.baseUrl ?? ba), this.fhirBaseUrl = j(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4"), this.authorizeUrl = j(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = j(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = j(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.fhircastHubUrl = j(this.baseUrl, t?.fhircastHubUrl ?? "fhircast/STU3"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.credentialsInHeader = t?.authCredentialsMethod === "header", this.defaultHeaders = t?.defaultHeaders ?? {}, this.onUnauthenticated = t?.onUnauthenticated, this.refreshGracePeriod = t?.refreshGracePeriod ?? Pa, this.cacheTime = t?.cacheTime ?? (B() ? Ra : Ca), this.cacheTime > 0 ? this.requestCache = new Ie(t?.resourceCacheSize ?? Ea) : 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(() => {
69456
69456
  t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initComplete = true, this.dispatchEvent({ type: "storageInitialized" });
69457
69457
  }).catch((n) => {
69458
69458
  console.error(n), this.initComplete = true, this.dispatchEvent({ type: "storageInitFailed", payload: { error: n } });
@@ -69564,7 +69564,7 @@ var Qt = class extends K {
69564
69564
  }
69565
69565
  async exchangeExternalAccessToken(t, n) {
69566
69566
  if (n = n ?? this.clientId, !n) throw new Error("MedplumClient is missing clientId");
69567
- return this.fetchTokens({ grant_type: Be.TokenExchange, subject_token_type: wa.AccessToken, client_id: n, subject_token: t });
69567
+ return this.fetchTokens({ grant_type: We.TokenExchange, subject_token_type: Aa.AccessToken, client_id: n, subject_token: t });
69568
69568
  }
69569
69569
  getExternalAuthRedirectUri(t, n, i, o, s = true) {
69570
69570
  let a = new URL(t);
@@ -69581,7 +69581,7 @@ var Qt = class extends K {
69581
69581
  }
69582
69582
  fhirSearchUrl(t, n) {
69583
69583
  let i = this.fhirUrl(t);
69584
- return n && (i.search = ci(n)), i;
69584
+ return n && (i.search = ui(n)), i;
69585
69585
  }
69586
69586
  search(t, n, i) {
69587
69587
  let o = this.fhirSearchUrl(t, n), s = "search-" + o.toString(), a = this.getCacheEntry(s, i);
@@ -69600,7 +69600,7 @@ var Qt = class extends K {
69600
69600
  searchResources(t, n, i) {
69601
69601
  let s = "searchResources-" + this.fhirSearchUrl(t, n).toString(), a = this.getCacheEntry(s, i);
69602
69602
  if (a) return a.value;
69603
- let c = new M(this.search(t, n, i).then(qi));
69603
+ let c = new M(this.search(t, n, i).then(ji));
69604
69604
  return this.setCacheEntry(s, c), c;
69605
69605
  }
69606
69606
  async *searchResourcePages(t, n, i) {
@@ -69610,7 +69610,7 @@ var Qt = class extends K {
69610
69610
  s.has("_count") || s.set("_count", "1000");
69611
69611
  let a = await this.search(t, s, i), c = a.link?.find((u) => u.relation === "next");
69612
69612
  if (!a.entry?.length && !c) break;
69613
- yield qi(a), o = c?.url ? new URL(c.url) : void 0;
69613
+ yield ji(a), o = c?.url ? new URL(c.url) : void 0;
69614
69614
  }
69615
69615
  }
69616
69616
  valueSetExpand(t, n) {
@@ -69624,7 +69624,7 @@ var Qt = class extends K {
69624
69624
  getCachedReference(t) {
69625
69625
  let n = t.reference;
69626
69626
  if (!n) return;
69627
- if (n === "system") return Bi;
69627
+ if (n === "system") return Wi;
69628
69628
  let [i, o] = n.split("/");
69629
69629
  if (!(!i || !o)) return this.getCached(i, o);
69630
69630
  }
@@ -69635,12 +69635,12 @@ var Qt = class extends K {
69635
69635
  readReference(t, n) {
69636
69636
  let i = t.reference;
69637
69637
  if (!i) return new M(Promise.reject(new Error("Missing reference")));
69638
- if (i === "system") return new M(Promise.resolve(Bi));
69638
+ if (i === "system") return new M(Promise.resolve(Wi));
69639
69639
  let [o, s] = i.split("/");
69640
69640
  return !o || !s ? new M(Promise.reject(new Error("Invalid reference"))) : this.readResource(o, s, n);
69641
69641
  }
69642
69642
  requestSchema(t) {
69643
- if (Ln(t)) return Promise.resolve();
69643
+ if (Fn(t)) return Promise.resolve();
69644
69644
  let n = t + "-requestSchema", i = this.getCacheEntry(n, void 0);
69645
69645
  if (i) return i.value;
69646
69646
  let o = new M((async () => {
@@ -69686,12 +69686,12 @@ var Qt = class extends K {
69686
69686
  }
69687
69687
  }`.replace(/\s+/g, " "), a = await this.graphql(s);
69688
69688
  br(a.data.StructureDefinitionList);
69689
- for (let c of a.data.SearchParameterList) $r(c);
69689
+ for (let c of a.data.SearchParameterList) Gr(c);
69690
69690
  })());
69691
69691
  return this.setCacheEntry(n, o), o;
69692
69692
  }
69693
69693
  requestProfileSchema(t, n) {
69694
- if (!n?.expandProfile && Nn(t)) return Promise.resolve();
69694
+ if (!n?.expandProfile && Un(t)) return Promise.resolve();
69695
69695
  let i = t + "-requestSchema" + (n?.expandProfile ? "-nested" : ""), o = this.getCacheEntry(i, void 0);
69696
69696
  if (o) return o.value;
69697
69697
  let s = new M((async () => {
@@ -69739,7 +69739,7 @@ var Qt = class extends K {
69739
69739
  return s || (s = t), this.cacheResource(s), this.invalidateUrl(this.fhirUrl(t.resourceType, t.id, "_history")), this.invalidateSearches(t.resourceType), s;
69740
69740
  }
69741
69741
  async createAttachment(t, n, i, o, s) {
69742
- let a = ji(t, n, i, o);
69742
+ let a = $i(t, n, i, o);
69743
69743
  if (a.contentType === A.XML) {
69744
69744
  let p2 = a.data, m;
69745
69745
  p2 instanceof Blob ? m = await new Promise((x, W) => {
@@ -69757,7 +69757,7 @@ var Qt = class extends K {
69757
69757
  return { contentType: a.contentType, url: u.url, title: a.filename };
69758
69758
  }
69759
69759
  createBinary(t, n, i, o, s) {
69760
- let a = ji(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), { data: u, contentType: p2, filename: m, securityContext: x, onProgress: W } = a, G = this.fhirUrl("Binary");
69760
+ let a = $i(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), { data: u, contentType: p2, filename: m, securityContext: x, onProgress: W } = a, G = this.fhirUrl("Binary");
69761
69761
  return m && G.searchParams.set("_filename", m), x?.reference && this.setRequestHeader(c, "X-Security-Context", x.reference), W ? this.uploadwithProgress(G, u, p2, W, c) : this.post(G, u, p2, c);
69762
69762
  }
69763
69763
  uploadwithProgress(t, n, i, o, s) {
@@ -69778,7 +69778,7 @@ var Qt = class extends K {
69778
69778
  }
69779
69779
  async createPdf(t, n, i, o) {
69780
69780
  if (!this.createPdfImpl) throw new Error("PDF creation not enabled");
69781
- let s = Va(t, n, i, o), a = typeof n == "object" ? n : {}, { docDefinition: c, tableLayouts: u, fonts: p2, ...m } = s, x = await this.createPdfImpl(c, u, p2), W = { ...m, data: x, contentType: "application/pdf" };
69781
+ let s = Da(t, n, i, o), a = typeof n == "object" ? n : {}, { docDefinition: c, tableLayouts: u, fonts: p2, ...m } = s, x = await this.createPdfImpl(c, u, p2), W = { ...m, data: x, contentType: "application/pdf" };
69782
69782
  return this.createBinary(W, a);
69783
69783
  }
69784
69784
  createComment(t, n, i) {
@@ -69826,13 +69826,13 @@ var Qt = class extends K {
69826
69826
  }
69827
69827
  pushToAgent(t, n, i, o, s, a) {
69828
69828
  let { waitTimeout: c, ...u } = a ?? {};
69829
- return this.post(this.fhirUrl("Agent", xe(t), "$push"), { destination: typeof n == "string" ? n : D(n), body: i, contentType: o, waitForResponse: s, ...c !== void 0 ? { waitTimeout: c } : void 0 }, A.FHIR_JSON, u);
69829
+ return this.post(this.fhirUrl("Agent", xe(t), "$push"), { destination: typeof n == "string" ? n : V(n), body: i, contentType: o, waitForResponse: s, ...c !== void 0 ? { waitTimeout: c } : void 0 }, A.FHIR_JSON, u);
69830
69830
  }
69831
69831
  getActiveLogin() {
69832
69832
  return this.storage.getObject("activeLogin");
69833
69833
  }
69834
69834
  async setActiveLogin(t) {
69835
- (!this.sessionDetails?.profile || D(this.sessionDetails.profile) !== t.profile?.reference) && this.clearActiveLogin(), this.setAccessToken(t.accessToken, t.refreshToken), this.storage.setObject("activeLogin", t), this.addLogin(t), this.refreshPromise = void 0, await this.refreshProfile();
69835
+ (!this.sessionDetails?.profile || V(this.sessionDetails.profile) !== t.profile?.reference) && this.clearActiveLogin(), this.setAccessToken(t.accessToken, t.refreshToken), this.storage.setObject("activeLogin", t), this.addLogin(t), this.refreshPromise = void 0, await this.refreshProfile();
69836
69836
  }
69837
69837
  getAccessToken() {
69838
69838
  return this.accessToken;
@@ -69841,7 +69841,7 @@ var Qt = class extends K {
69841
69841
  return this.accessTokenExpires !== void 0 && Date.now() < this.accessTokenExpires - (t ?? this.refreshGracePeriod);
69842
69842
  }
69843
69843
  setAccessToken(t, n) {
69844
- this.accessToken = t, this.refreshToken = n, this.accessTokenExpires = _i(t), this.medplumServer = Mi(t);
69844
+ this.accessToken = t, this.refreshToken = n, this.accessTokenExpires = Li(t), this.medplumServer = _i(t);
69845
69845
  }
69846
69846
  getLogins() {
69847
69847
  return this.storage.getObject("logins") ?? [];
@@ -69889,7 +69889,7 @@ var Qt = class extends K {
69889
69889
  async download(t, n = {}) {
69890
69890
  this.refreshPromise && await this.refreshPromise;
69891
69891
  let i = t.toString();
69892
- i.startsWith(Pa) && (t = this.fhirUrl(i));
69892
+ i.startsWith(wa) && (t = this.fhirUrl(i));
69893
69893
  let o = n.headers;
69894
69894
  return o || (o = {}, n.headers = o), o.Accept || (o.Accept = "*/*"), this.addFetchOptionsDefaults(n), (await this.fetchWithRetry(t.toString(), n)).blob();
69895
69895
  }
@@ -69947,14 +69947,14 @@ var Qt = class extends K {
69947
69947
  if (s.status === 401) return this.handleUnauthenticated(t, n, i);
69948
69948
  if (s.status === 204 || s.status === 304) return;
69949
69949
  let c = s.headers.get("content-type")?.includes("json");
69950
- if (s.status === 404 && !c) throw new d(bn);
69950
+ if (s.status === 404 && !c) throw new d(En);
69951
69951
  let u = await this.parseBody(s, c);
69952
69952
  if (s.status === 200 && i.followRedirectOnOk || s.status === 201 && i.followRedirectOnCreated) {
69953
- let p2 = await Wi(s, u);
69953
+ let p2 = await qi(s, u);
69954
69954
  if (p2) return this.request("GET", p2, { ...i, body: void 0 });
69955
69955
  }
69956
69956
  if (s.status === 202 && i.pollStatusOnAccepted) {
69957
- let m = await Wi(s, u) ?? o.statusUrl;
69957
+ let m = await qi(s, u) ?? o.statusUrl;
69958
69958
  if (m) return this.pollStatus(m, i, o);
69959
69959
  }
69960
69960
  if (s.status >= 400) throw new d(lt(u));
@@ -69978,10 +69978,10 @@ var Qt = class extends K {
69978
69978
  for (let o = 0; o <= i; o++) try {
69979
69979
  this.options.verbose && this.logRequest(t, n);
69980
69980
  let s = await this.fetch(t, n);
69981
- if (this.options.verbose && this.logResponse(s), this.setCurrentRateLimit(s), o >= i || !Da(s)) return s;
69981
+ if (this.options.verbose && this.logResponse(s), this.setCurrentRateLimit(s), o >= i || !Ma(s)) return s;
69982
69982
  let a = this.getRetryDelay(o), c = n.maxRetryTime ?? 2e3;
69983
69983
  if (a > c) return s;
69984
- await Ur(a);
69984
+ await Br(a);
69985
69985
  } catch (s) {
69986
69986
  if (s.message === "Failed to fetch" && o === 0 && this.dispatchEvent({ type: "offline" }), s.name === "AbortError" || o === i) throw s;
69987
69987
  }
@@ -70022,7 +70022,7 @@ var Qt = class extends K {
70022
70022
  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;
70023
70023
  else {
70024
70024
  let s = n.pollStatusPeriod ?? 1e3;
70025
- await Ur(s), i.pollCount++;
70025
+ await Br(s), i.pollCount++;
70026
70026
  }
70027
70027
  return this.request("GET", t, o, i);
70028
70028
  }
@@ -70047,7 +70047,7 @@ var Qt = class extends K {
70047
70047
  addFetchOptionsDefaults(t) {
70048
70048
  Object.entries(this.defaultHeaders).forEach(([n, i]) => {
70049
70049
  this.setRequestHeader(t, n, i);
70050
- }), this.setRequestHeader(t, "Accept", Ta, true), this.options.extendedMode !== false && this.setRequestHeader(t, "X-Medplum", "extended"), t.body && this.setRequestHeader(t, "Content-Type", A.FHIR_JSON, true), this.accessToken ? this.setRequestHeader(t, "Authorization", "Bearer " + this.accessToken) : this.basicAuth && this.setRequestHeader(t, "Authorization", "Basic " + this.basicAuth), t.cache || (t.cache = "no-cache"), t.credentials || (t.credentials = "include");
70050
+ }), this.setRequestHeader(t, "Accept", Sa, true), this.options.extendedMode !== false && this.setRequestHeader(t, "X-Medplum", "extended"), t.body && this.setRequestHeader(t, "Content-Type", A.FHIR_JSON, true), this.accessToken ? this.setRequestHeader(t, "Authorization", "Bearer " + this.accessToken) : this.basicAuth && this.setRequestHeader(t, "Authorization", "Basic " + this.basicAuth), t.cache || (t.cache = "no-cache"), t.credentials || (t.credentials = "include");
70051
70051
  }
70052
70052
  setRequestContentType(t, n) {
70053
70053
  this.setRequestHeader(t, "Content-Type", n);
@@ -70064,13 +70064,13 @@ var Qt = class extends K {
70064
70064
  return this.refresh() ? this.request(t, n, i) : (this.clear(), this.onUnauthenticated && this.onUnauthenticated(), Promise.reject(new d(ke)));
70065
70065
  }
70066
70066
  async startPkce() {
70067
- let t = Qr();
70067
+ let t = zr();
70068
70068
  sessionStorage.setItem("pkceState", t);
70069
- let n = Qr().slice(0, 128);
70069
+ let n = zr().slice(0, 128);
70070
70070
  sessionStorage.setItem("codeVerifier", n);
70071
70071
  try {
70072
- let i = await Ai(n);
70073
- return { codeChallengeMethod: "S256", codeChallenge: ri(i).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "") };
70072
+ let i = await Oi(n);
70073
+ return { codeChallengeMethod: "S256", codeChallenge: ni(i).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "") };
70074
70074
  } catch (i) {
70075
70075
  return console.warn("Failed to hash code verifier. Falling back to 'plain' code challenge method", i), { codeChallengeMethod: "plain", codeChallenge: n };
70076
70076
  }
@@ -70080,7 +70080,7 @@ var Qt = class extends K {
70080
70080
  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 ?? te.getOrigin()), i.searchParams.set("code_challenge_method", n.codeChallengeMethod), i.searchParams.set("code_challenge", n.codeChallenge), i.searchParams.set("scope", n.scope ?? "openid profile"), te.assign(i.toString());
70081
70081
  }
70082
70082
  processCode(t, n) {
70083
- let i = { grant_type: Be.AuthorizationCode, code: t, client_id: n?.clientId ?? this.clientId ?? "", redirect_uri: n?.redirectUri ?? te.getOrigin() };
70083
+ let i = { grant_type: We.AuthorizationCode, code: t, client_id: n?.clientId ?? this.clientId ?? "", redirect_uri: n?.redirectUri ?? te.getOrigin() };
70084
70084
  if (typeof sessionStorage < "u") {
70085
70085
  let o = sessionStorage.getItem("codeVerifier");
70086
70086
  o && (i.code_verifier = o);
@@ -70092,17 +70092,17 @@ var Qt = class extends K {
70092
70092
  }
70093
70093
  refresh() {
70094
70094
  if (this.refreshPromise) return this.refreshPromise;
70095
- if (this.refreshToken) return this.refreshPromise = this.fetchTokens({ grant_type: Be.RefreshToken, client_id: this.clientId ?? "", refresh_token: this.refreshToken }), this.refreshPromise;
70095
+ if (this.refreshToken) return this.refreshPromise = this.fetchTokens({ grant_type: We.RefreshToken, client_id: this.clientId ?? "", refresh_token: this.refreshToken }), this.refreshPromise;
70096
70096
  if (this.clientId && this.clientSecret) return this.refreshPromise = this.startClientLogin(this.clientId, this.clientSecret), this.refreshPromise;
70097
70097
  }
70098
70098
  async startClientLogin(t, n) {
70099
- return this.clientId = t, this.clientSecret = n, this.fetchTokens({ grant_type: Be.ClientCredentials, client_id: t, client_secret: n });
70099
+ return this.clientId = t, this.clientSecret = n, this.fetchTokens({ grant_type: We.ClientCredentials, client_id: t, client_secret: n });
70100
70100
  }
70101
70101
  async startJwtBearerLogin(t, n, i) {
70102
- return this.clientId = t, this.fetchTokens({ grant_type: Be.JwtBearer, client_id: t, assertion: n, scope: i });
70102
+ return this.clientId = t, this.fetchTokens({ grant_type: We.JwtBearer, client_id: t, assertion: n, scope: i });
70103
70103
  }
70104
70104
  async startJwtAssertionLogin(t) {
70105
- return this.fetchTokens({ grant_type: Be.ClientCredentials, client_assertion_type: Aa.JwtBearer, client_assertion: t });
70105
+ return this.fetchTokens({ grant_type: We.ClientCredentials, client_assertion_type: Oa.JwtBearer, client_assertion: t });
70106
70106
  }
70107
70107
  setBasicAuth(t, n) {
70108
70108
  this.clientId = t, this.clientSecret = n, this.basicAuth = Ut(t + ":" + n);
@@ -70110,20 +70110,20 @@ var Qt = class extends K {
70110
70110
  async fhircastSubscribe(t, n) {
70111
70111
  if (!(typeof t == "string" && t !== "")) throw new d(y("Invalid topic provided. Topic must be a valid string."));
70112
70112
  if (!(typeof n == "object" && Array.isArray(n) && n.length > 0)) throw new d(y("Invalid events provided. Events must be an array of event names containing at least one event."));
70113
- let i = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post(this.fhircastHubUrl, Xr(i), A.FORM_URL_ENCODED))["hub.channel.endpoint"];
70113
+ let i = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post(this.fhircastHubUrl, Yr(i), A.FORM_URL_ENCODED))["hub.channel.endpoint"];
70114
70114
  if (!s) throw new Error("Invalid response!");
70115
70115
  return i.endpoint = s, i;
70116
70116
  }
70117
70117
  async fhircastUnsubscribe(t) {
70118
70118
  if (!Wt(t)) throw new d(y("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));
70119
70119
  if (!(t.endpoint && typeof t.endpoint == "string" && t.endpoint.startsWith("ws"))) throw new d(y("Provided subscription request must have an endpoint in order to unsubscribe."));
70120
- t.mode = "unsubscribe", await this.post(this.fhircastHubUrl, Xr(t), A.FORM_URL_ENCODED);
70120
+ t.mode = "unsubscribe", await this.post(this.fhircastHubUrl, Yr(t), A.FORM_URL_ENCODED);
70121
70121
  }
70122
70122
  fhircastConnect(t) {
70123
70123
  return new Bt(t);
70124
70124
  }
70125
70125
  async fhircastPublish(t, n, i, o) {
70126
- return Ii(n) ? this.post(this.fhircastHubUrl, Yr(t, n, i, o), A.JSON) : (ki(n), this.post(this.fhircastHubUrl, Yr(t, n, i), A.JSON));
70126
+ return ki(n) ? this.post(this.fhircastHubUrl, Zr(t, n, i, o), A.JSON) : (Vi(n), this.post(this.fhircastHubUrl, Zr(t, n, i), A.JSON));
70127
70127
  }
70128
70128
  async fhircastGetContext(t) {
70129
70129
  return this.get(`${this.fhircastHubUrl}/${t}`, { cache: "no-cache" });
@@ -70154,9 +70154,9 @@ var Qt = class extends K {
70154
70154
  }
70155
70155
  async verifyTokens(t) {
70156
70156
  let n = t.access_token;
70157
- if (Di(n)) {
70157
+ if (Mi(n)) {
70158
70158
  let i = qt(n);
70159
- if (Date.now() >= i.exp * 1e3) throw this.clearActiveLogin(), new d(En);
70159
+ if (Date.now() >= i.exp * 1e3) throw this.clearActiveLogin(), new d(Rn);
70160
70160
  if (i.cid) {
70161
70161
  if (i.cid !== this.clientId) throw this.clearActiveLogin(), new d(hr);
70162
70162
  } else if (this.clientId && i.client_id !== this.clientId) throw this.clearActiveLogin(), new d(hr);
@@ -70179,7 +70179,7 @@ var Qt = class extends K {
70179
70179
  }
70180
70180
  }
70181
70181
  getSubscriptionManager() {
70182
- return this.subscriptionManager || (this.subscriptionManager = new Ht(this, ai(this.baseUrl, "/ws/subscriptions-r4"))), this.subscriptionManager;
70182
+ return this.subscriptionManager || (this.subscriptionManager = new Ht(this, ci(this.baseUrl, "/ws/subscriptions-r4"))), this.subscriptionManager;
70183
70183
  }
70184
70184
  subscribeToCriteria(t, n) {
70185
70185
  return this.getSubscriptionManager().addCriteria(t, n);
@@ -70191,43 +70191,43 @@ var Qt = class extends K {
70191
70191
  return this.getSubscriptionManager().getMasterEmitter();
70192
70192
  }
70193
70193
  };
70194
- function Oa() {
70194
+ function Ia() {
70195
70195
  if (!globalThis.fetch) throw new Error("Fetch not available in this environment");
70196
70196
  return globalThis.fetch.bind(globalThis);
70197
70197
  }
70198
- async function Wi(r6, e) {
70198
+ async function qi(r6, e) {
70199
70199
  let t = r6.headers.get("content-location");
70200
70200
  if (t) return t;
70201
70201
  let n = r6.headers.get("location");
70202
70202
  if (n) return n;
70203
70203
  if (ut(e) && e.issue?.[0]?.diagnostics) return e.issue[0].diagnostics;
70204
70204
  }
70205
- function qi(r6) {
70205
+ function ji(r6) {
70206
70206
  let e = r6.entry?.map((t) => t.resource) ?? [];
70207
70207
  return Object.assign(e, { bundle: r6 });
70208
70208
  }
70209
- function Ia(r6) {
70209
+ function ka(r6) {
70210
70210
  return R(r6) && "data" in r6 && "contentType" in r6;
70211
70211
  }
70212
- function ji(r6, e, t, n) {
70213
- return Ia(r6) ? r6 : { data: r6, filename: e, contentType: t, onProgress: n };
70212
+ function $i(r6, e, t, n) {
70213
+ return ka(r6) ? r6 : { data: r6, filename: e, contentType: t, onProgress: n };
70214
70214
  }
70215
- function ka(r6) {
70215
+ function Va(r6) {
70216
70216
  return R(r6) && "docDefinition" in r6;
70217
70217
  }
70218
- function Va(r6, e, t, n) {
70219
- return ka(r6) ? r6 : { docDefinition: r6, filename: e, tableLayouts: t, fonts: n };
70218
+ function Da(r6, e, t, n) {
70219
+ return Va(r6) ? r6 : { docDefinition: r6, filename: e, tableLayouts: t, fonts: n };
70220
70220
  }
70221
- function Da(r6) {
70221
+ function Ma(r6) {
70222
70222
  return r6.status === 429 || r6.status >= 500;
70223
70223
  }
70224
- var Ga = [...Ke, "->", "<<", ">>", "=="];
70225
- var za = Xe().registerInfix("->", { precedence: g.Arrow }).registerInfix(";", { precedence: g.Semicolon });
70226
- var dc = " ".repeat(2);
70227
- var hc = [...Ke, "eq", "ne", "co"];
70228
- var mc = { eq: f.EXACT, ne: f.NOT_EQUALS, co: f.CONTAINS, sw: f.STARTS_WITH, ew: void 0, gt: f.GREATER_THAN, lt: f.LESS_THAN, ge: f.GREATER_THAN_OR_EQUALS, le: f.LESS_THAN_OR_EQUALS, ap: f.APPROXIMATELY, sa: f.STARTS_AFTER, eb: f.ENDS_BEFORE, pr: f.PRESENT, po: void 0, ss: void 0, sb: void 0, in: f.IN, ni: f.NOT_IN, re: f.EQUALS, identifier: f.IDENTIFIER };
70229
- var gc = Xe();
70230
- var xc = { AA: "OK", AE: "Application Error", AR: "Application Reject", CA: "Commit Accept", CE: "Commit Error", CR: "Commit Reject" };
70224
+ var Ha = [...Ke, "->", "<<", ">>", "=="];
70225
+ var Ja = Xe().registerInfix("->", { precedence: g.Arrow }).registerInfix(";", { precedence: g.Semicolon });
70226
+ var fc = " ".repeat(2);
70227
+ var mc = [...Ke, "eq", "ne", "co"];
70228
+ var yc = { eq: f.EXACT, ne: f.NOT_EQUALS, co: f.CONTAINS, sw: f.STARTS_WITH, ew: void 0, gt: f.GREATER_THAN, lt: f.LESS_THAN, ge: f.GREATER_THAN_OR_EQUALS, le: f.LESS_THAN_OR_EQUALS, ap: f.APPROXIMATELY, sa: f.STARTS_AFTER, eb: f.ENDS_BEFORE, pr: f.PRESENT, po: void 0, ss: void 0, sb: void 0, in: f.IN, ni: f.NOT_IN, re: f.EQUALS, identifier: f.IDENTIFIER };
70229
+ var xc = Xe();
70230
+ var vc = { AA: "OK", AE: "Application Error", AR: "Application Reject", CA: "Commit Accept", CE: "Commit Error", CR: "Commit Reject" };
70231
70231
  var he = class {
70232
70232
  constructor(e = "\r", t = "|", n = "^", i = "~", o = "\\", s = "&") {
70233
70233
  this.segmentSeparator = e, this.fieldSeparator = t, this.componentSeparator = n, this.repetitionSeparator = i, this.escapeCharacter = o, this.subcomponentSeparator = s;
@@ -70239,7 +70239,7 @@ var he = class {
70239
70239
  return this.componentSeparator + this.repetitionSeparator + this.escapeCharacter + this.subcomponentSeparator;
70240
70240
  }
70241
70241
  };
70242
- var uo = class r2 {
70242
+ var lo = class r2 {
70243
70243
  constructor(e, t = new he()) {
70244
70244
  this.context = t, this.segments = e;
70245
70245
  }
@@ -70263,7 +70263,7 @@ var uo = class r2 {
70263
70263
  }
70264
70264
  buildAck(e) {
70265
70265
  let t = /* @__PURE__ */ new Date(), n = this.getSegment("MSH"), i = n?.getField(3)?.toString() ?? "", o = n?.getField(4)?.toString() ?? "", s = n?.getField(5)?.toString() ?? "", a = n?.getField(6)?.toString() ?? "", c = n?.getField(10)?.toString() ?? "", u = n?.getField(12)?.toString() ?? "2.5.1", p2 = e?.ackCode ?? "AA";
70266
- return new r2([new it(["MSH", this.context.getMsh2(), s, a, i, o, Tc(t), "", this.buildAckMessageType(n), t.getTime().toString(), "P", u], this.context), new it(["MSA", p2, c, xc[p2]], this.context), ...e?.errSegment ? [e.errSegment] : []]);
70266
+ return new r2([new it(["MSH", this.context.getMsh2(), s, a, i, o, Sc(t), "", this.buildAckMessageType(n), t.getTime().toString(), "P", u], this.context), new it(["MSA", p2, c, vc[p2]], this.context), ...e?.errSegment ? [e.errSegment] : []]);
70267
70267
  }
70268
70268
  buildAckMessageType(e) {
70269
70269
  let t = e?.getField(9), n = t?.getComponent(2), i = t?.getComponent(3), o = "ACK";
@@ -70290,7 +70290,7 @@ var uo = class r2 {
70290
70290
  };
70291
70291
  var it = class r3 {
70292
70292
  constructor(e, t = new he()) {
70293
- this.context = t, Zn(e) ? this.fields = e.map((n) => X.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
70293
+ this.context = t, ei(e) ? this.fields = e.map((n) => X.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
70294
70294
  }
70295
70295
  get(e) {
70296
70296
  return this.fields[e];
@@ -70358,14 +70358,14 @@ var X = class r4 {
70358
70358
  return true;
70359
70359
  }
70360
70360
  };
70361
- function Tc(r6) {
70361
+ function Sc(r6) {
70362
70362
  let e = r6 instanceof Date ? r6 : new Date(r6), n = e.toISOString().replace(/[-:T]/g, "").replace(/(\.\d+)?Z$/, ""), i = e.getUTCMilliseconds();
70363
70363
  return i > 0 && (n += "." + i.toString()), n;
70364
70364
  }
70365
- var We = { NONE: 0, ERROR: 1, WARN: 2, INFO: 3, DEBUG: 4 };
70366
- var Sc = ["NONE", "ERROR", "WARN", "INFO", "DEBUG"];
70367
- var lo = class r5 {
70368
- constructor(e, t = {}, n = We.INFO, i = {}) {
70365
+ var qe = { NONE: 0, ERROR: 1, WARN: 2, INFO: 3, DEBUG: 4 };
70366
+ var bc = ["NONE", "ERROR", "WARN", "INFO", "DEBUG"];
70367
+ var po = class r5 {
70368
+ constructor(e, t = {}, n = qe.INFO, i = {}) {
70369
70369
  this.write = e, this.metadata = t, this.level = n, this.options = i, i?.prefix && (this.prefix = i.prefix), this.error = this.error.bind(this), this.warn = this.warn.bind(this), this.info = this.info.bind(this), this.debug = this.debug.bind(this), this.log = this.log.bind(this);
70370
70370
  }
70371
70371
  clone(e) {
@@ -70377,16 +70377,16 @@ var lo = class r5 {
70377
70377
  return { write: e, metadata: t, level: n, options: i };
70378
70378
  }
70379
70379
  error(e, t) {
70380
- this.log(We.ERROR, e, t);
70380
+ this.log(qe.ERROR, e, t);
70381
70381
  }
70382
70382
  warn(e, t) {
70383
- this.log(We.WARN, e, t);
70383
+ this.log(qe.WARN, e, t);
70384
70384
  }
70385
70385
  info(e, t) {
70386
- this.log(We.INFO, e, t);
70386
+ this.log(qe.INFO, e, t);
70387
70387
  }
70388
70388
  debug(e, t) {
70389
- this.log(We.DEBUG, e, t);
70389
+ this.log(qe.DEBUG, e, t);
70390
70390
  }
70391
70391
  log(e, t, n) {
70392
70392
  if (e > this.level) return;
@@ -70396,11 +70396,11 @@ var lo = class r5 {
70396
70396
  i = { ...n };
70397
70397
  for (let [o, s] of Object.entries(i)) s instanceof Error && (i[o] = nr(s));
70398
70398
  }
70399
- this.write(JSON.stringify({ level: Sc[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: this.prefix ? `${this.prefix}${t}` : t, ...i, ...this.metadata }));
70399
+ this.write(JSON.stringify({ level: bc[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: this.prefix ? `${this.prefix}${t}` : t, ...i, ...this.metadata }));
70400
70400
  }
70401
70401
  };
70402
- function oh(r6) {
70403
- let e = We[r6.toUpperCase()];
70402
+ function sh(r6) {
70403
+ let e = qe[r6.toUpperCase()];
70404
70404
  if (e === void 0) throw new Error(`Invalid log level: ${r6}`);
70405
70405
  return e;
70406
70406
  }
@@ -70417,9 +70417,9 @@ function nr(r6, e = 0, t = 10) {
70417
70417
  }
70418
70418
  return n;
70419
70419
  }
70420
- var Mc = "https://meta.medplum.com/releases";
70420
+ var _c = "https://meta.medplum.com/releases";
70421
70421
  var sr = /* @__PURE__ */ new Map();
70422
- function _c(r6) {
70422
+ function Lc(r6) {
70423
70423
  let e = r6;
70424
70424
  if (!e.tag_name) throw new Error("Manifest missing tag_name");
70425
70425
  let t = e.assets;
@@ -70429,11 +70429,11 @@ function _c(r6) {
70429
70429
  if (!n.name) throw new Error("Asset missing name");
70430
70430
  }
70431
70431
  }
70432
- async function fn(r6, e, t) {
70432
+ async function hn(r6, e, t) {
70433
70433
  let n = sr.get(e ?? "latest");
70434
70434
  if (!n) {
70435
- let i = e ? `v${e}` : "latest", o = new URL(`${Mc}/${i}.json`);
70436
- if (o.searchParams.set("a", r6), o.searchParams.set("c", tn), t) for (let [c, u] of Object.entries(t)) o.searchParams.set(c, u);
70435
+ let i = e ? `v${e}` : "latest", o = new URL(`${_c}/${i}.json`);
70436
+ if (o.searchParams.set("a", r6), o.searchParams.set("c", rn), t) for (let [c, u] of Object.entries(t)) o.searchParams.set(c, u);
70437
70437
  let s = await fetch(o.toString());
70438
70438
  if (s.status !== 200) {
70439
70439
  let c;
@@ -70445,24 +70445,24 @@ async function fn(r6, e, t) {
70445
70445
  throw new Error(`Received status code ${s.status} while fetching manifest for version '${e ?? "latest"}'. Message: ${c}`);
70446
70446
  }
70447
70447
  let a = await s.json();
70448
- _c(a), n = a, sr.set(e ?? "latest", n), e || sr.set(n.tag_name.slice(1), n);
70448
+ Lc(a), n = a, sr.set(e ?? "latest", n), e || sr.set(n.tag_name.slice(1), n);
70449
70449
  }
70450
70450
  return n;
70451
70451
  }
70452
- function Lc(r6) {
70452
+ function Fc(r6) {
70453
70453
  return /^\d+\.\d+\.\d+(-[0-9a-z]{7})?$/.test(r6);
70454
70454
  }
70455
- async function wh(r6, e) {
70456
- if (!Lc(e)) return false;
70455
+ async function Ah(r6, e) {
70456
+ if (!Fc(e)) return false;
70457
70457
  try {
70458
- await fn(r6, e);
70458
+ await hn(r6, e);
70459
70459
  } catch {
70460
70460
  return false;
70461
70461
  }
70462
70462
  return true;
70463
70463
  }
70464
- async function Ah(r6) {
70465
- let e = await fn(r6);
70464
+ async function Oh(r6) {
70465
+ let e = await hn(r6);
70466
70466
  if (!e.tag_name.startsWith("v")) throw new Error(`Invalid release name found. Release tag '${e.tag_name}' did not start with 'v'`);
70467
70467
  return e.tag_name.slice(1);
70468
70468
  }
@@ -70518,7 +70518,7 @@ var h2 = class extends l2 {
70518
70518
  this.socket = e, this.encoding = n, this.enhancedMode = s, this.messagesPerMin = o.messagesPerMin, e.on("data", (i) => {
70519
70519
  try {
70520
70520
  if (this.appendData(i), i.at(-2) === 28 && i.at(-1) === 13) {
70521
- let r6 = Buffer.concat(this.chunks), c = r6.subarray(1, r6.length - 2), u = import_iconv_lite.default.decode(c, this.encoding), y2 = uo.parse(u);
70521
+ let r6 = Buffer.concat(this.chunks), c = r6.subarray(1, r6.length - 2), u = import_iconv_lite.default.decode(c, this.encoding), y2 = lo.parse(u);
70522
70522
  this.responseQueue.push(new g2(this, y2)), this.resetBuffer(), this.processResponseQueue().catch((w2) => {
70523
70523
  this.dispatchEvent(new d2(w2));
70524
70524
  });
@@ -70555,7 +70555,7 @@ var h2 = class extends l2 {
70555
70555
  for (this.responseQueueProcessing = true; this.responseQueue.length; ) {
70556
70556
  if (this.messagesPerMin) {
70557
70557
  let n = b2 / this.messagesPerMin, s = Date.now() - this.lastMessageDispatchedTime;
70558
- n > s && await Ur(n - s);
70558
+ n > s && await Br(n - s);
70559
70559
  }
70560
70560
  let e = this.responseQueue.shift();
70561
70561
  e && this.dispatchEvent(e), this.lastMessageDispatchedTime = Date.now();
@@ -70708,7 +70708,7 @@ var H2 = class {
70708
70708
  this.connections.delete(c);
70709
70709
  });
70710
70710
  }), i = async (r6) => {
70711
- r6?.code === "EADDRINUSE" && (await Ur(50), o.close(), o.listen(t));
70711
+ r6?.code === "EADDRINUSE" && (await Br(50), o.close(), o.listen(t));
70712
70712
  };
70713
70713
  o.on("error", i), o.once("listening", () => {
70714
70714
  o.off("error", i);
@@ -71002,8 +71002,8 @@ var AgentDicomChannel = class extends BaseChannel {
71002
71002
  this.association = association;
71003
71003
  association.setMaxPduLength(65536);
71004
71004
  association.getPresentationContexts().forEach(({ context }) => {
71005
- context.getTransferSyntaxUids().forEach((ts2) => {
71006
- context.setResult(dimse.constants.PresentationContextResult.Accept, ts2);
71005
+ context.getTransferSyntaxUids().forEach((ts) => {
71006
+ context.setResult(dimse.constants.PresentationContextResult.Accept, ts);
71007
71007
  });
71008
71008
  });
71009
71009
  this.sendAssociationAccept();
@@ -71121,7 +71121,7 @@ var AgentDicomChannel = class extends BaseChannel {
71121
71121
  this.server.on("networkError", async (err) => {
71122
71122
  this.log.error("Network error: ", { err });
71123
71123
  if (err?.code === "EADDRINUSE") {
71124
- await Ur(50);
71124
+ await Br(50);
71125
71125
  this.server.close();
71126
71126
  this.server.listen(port);
71127
71127
  }
@@ -71197,7 +71197,7 @@ var AgentHl7Channel = class extends BaseChannel {
71197
71197
  sendToRemote(msg) {
71198
71198
  const connection = this.connections.get(msg.remote);
71199
71199
  if (connection) {
71200
- connection.hl7Connection.send(uo.parse(msg.body));
71200
+ connection.hl7Connection.send(lo.parse(msg.body));
71201
71201
  } else {
71202
71202
  this.log.warn(`Attempted to send message to disconnected remote: ${msg.remote}`);
71203
71203
  }
@@ -71306,7 +71306,7 @@ var DEFAULT_LOGGER_CONFIG = {
71306
71306
  logDir: __dirname,
71307
71307
  maxFileSizeMb: 10,
71308
71308
  filesToKeep: 10,
71309
- logLevel: We.INFO
71309
+ logLevel: qe.INFO
71310
71310
  };
71311
71311
  var LOGGER_CONFIG_INTEGER_KEYS = ["maxFileSizeMb", "filesToKeep"];
71312
71312
  var LEVELS_TO_UPPERCASE = {
@@ -71335,7 +71335,7 @@ function cleanupLoggerConfig(config, configPathRoot = "config") {
71335
71335
  warnings.push(`${configPathRoot}.filesToKeep must be a valid integer`);
71336
71336
  config.filesToKeep = void 0;
71337
71337
  }
71338
- if (typeof config.logLevel !== "undefined" && !(typeof config.logLevel === "number" && Sc[config.logLevel] !== void 0)) {
71338
+ if (typeof config.logLevel !== "undefined" && !(typeof config.logLevel === "number" && bc[config.logLevel] !== void 0)) {
71339
71339
  warnings.push(`${configPathRoot}.logLevel must be a valid log level between LogLevel.NONE and LogLevel.DEBUG`);
71340
71340
  config.logLevel = void 0;
71341
71341
  }
@@ -71373,14 +71373,14 @@ function parseLoggerConfigFromArgs(args) {
71373
71373
  if (!propName.startsWith("logger.") || propVal === void 0) {
71374
71374
  continue;
71375
71375
  }
71376
- const [_, configType, settingName] = Br(propName, ".", 3);
71376
+ const [_, configType, settingName] = Wr(propName, ".", 3);
71377
71377
  if (!LOGGER_CONFIG_KEYS.includes(settingName)) {
71378
71378
  warnings.push(`${propName} is not a valid setting name`);
71379
71379
  }
71380
71380
  let configValue;
71381
71381
  if (settingName === "logLevel") {
71382
71382
  try {
71383
- configValue = oh(propVal);
71383
+ configValue = sh(propVal);
71384
71384
  } catch (err) {
71385
71385
  warnings.push(`Error while parsing ${propName}: ${Ve(err)}`);
71386
71386
  }
@@ -71408,14 +71408,14 @@ function parseLoggerConfigFromArgs(args) {
71408
71408
  function getWinstonLevelFromMedplumLevel(level) {
71409
71409
  switch (level) {
71410
71410
  // Return error for NONE since we are going to turn silent on anyways
71411
- case We.NONE:
71412
- case We.ERROR:
71411
+ case qe.NONE:
71412
+ case qe.ERROR:
71413
71413
  return "error";
71414
- case We.WARN:
71414
+ case qe.WARN:
71415
71415
  return "warn";
71416
- case We.INFO:
71416
+ case qe.INFO:
71417
71417
  return "info";
71418
- case We.DEBUG:
71418
+ case qe.DEBUG:
71419
71419
  return "debug";
71420
71420
  default:
71421
71421
  throw new Error("Invalid log level");
@@ -71425,7 +71425,7 @@ function createWinstonFromLoggerConfig(config, loggerType) {
71425
71425
  const level = getWinstonLevelFromMedplumLevel(config.logLevel);
71426
71426
  const logger = import_winston.default.createLogger({
71427
71427
  level,
71428
- silent: config.logLevel === We.NONE,
71428
+ silent: config.logLevel === qe.NONE,
71429
71429
  format: import_winston.default.format.combine(
71430
71430
  import_winston.default.format.timestamp(),
71431
71431
  // Custom transform to match previous Medplum logger output
@@ -71472,16 +71472,16 @@ var WinstonWrapperLogger = class _WinstonWrapperLogger {
71472
71472
  this.prefix = options?.prefix;
71473
71473
  }
71474
71474
  debug(msg, data2) {
71475
- this.log(We.DEBUG, msg, data2);
71475
+ this.log(qe.DEBUG, msg, data2);
71476
71476
  }
71477
71477
  info(msg, data2) {
71478
- this.log(We.INFO, msg, data2);
71478
+ this.log(qe.INFO, msg, data2);
71479
71479
  }
71480
71480
  warn(msg, data2) {
71481
- this.log(We.WARN, msg, data2);
71481
+ this.log(qe.WARN, msg, data2);
71482
71482
  }
71483
71483
  error(msg, data2) {
71484
- this.log(We.ERROR, msg, data2);
71484
+ this.log(qe.ERROR, msg, data2);
71485
71485
  }
71486
71486
  log(level, msg, data2) {
71487
71487
  if (level > this.level) {
@@ -71496,16 +71496,16 @@ var WinstonWrapperLogger = class _WinstonWrapperLogger {
71496
71496
  const dataToLog = { ...data2, ...this.metadata };
71497
71497
  const msgToLog = this.prefix ? `${this.prefix}${msg}` : msg;
71498
71498
  switch (level) {
71499
- case We.DEBUG:
71499
+ case qe.DEBUG:
71500
71500
  this.winston.debug(msgToLog, dataToLog);
71501
71501
  return;
71502
- case We.INFO:
71502
+ case qe.INFO:
71503
71503
  this.winston.info(msgToLog, dataToLog);
71504
71504
  return;
71505
- case We.WARN:
71505
+ case qe.WARN:
71506
71506
  this.winston.warn(msgToLog, dataToLog);
71507
71507
  return;
71508
- case We.ERROR:
71508
+ case qe.ERROR:
71509
71509
  this.winston.error(msgToLog, dataToLog);
71510
71510
  }
71511
71511
  }
@@ -71547,7 +71547,7 @@ var import_node_os2 = require("node:os");
71547
71547
  var import_node_path2 = __toESM(require("node:path"));
71548
71548
  var import_node_process = __toESM(require("node:process"));
71549
71549
  var EXIT_SIGNALS = ["SIGINT", "SIGTERM", "SIGHUP"];
71550
- var pidLogger = new lo((msg) => `[PID]: ${msg}`);
71550
+ var pidLogger = new po((msg) => `[PID]: ${msg}`);
71551
71551
  var pidFileApps = /* @__PURE__ */ new Set();
71552
71552
  var processExitListener = () => {
71553
71553
  removeAllPidFiles();
@@ -71665,7 +71665,7 @@ async function waitForPidFile(appName, timeoutMs = 3e3) {
71665
71665
  if (Date.now() - startTime > timeoutMs) {
71666
71666
  throw new Error("Timeout while waiting for PID file");
71667
71667
  }
71668
- await Ur(0);
71668
+ await Br(0);
71669
71669
  }
71670
71670
  }
71671
71671
  function removeAllPidFiles() {
@@ -71696,7 +71696,7 @@ var UPGRADER_LOG_PATH = (0, import_node_path3.resolve)(
71696
71696
  );
71697
71697
  var RELEASES_PATH = (0, import_node_path3.resolve)(__dirname);
71698
71698
  async function downloadRelease(version, path4) {
71699
- const release = await fn("agent-upgrader", version);
71699
+ const release = await hn("agent-upgrader", version);
71700
71700
  const downloadUrl = parseDownloadUrl(release, (0, import_node_os3.platform)());
71701
71701
  const { body } = await fetch(downloadUrl);
71702
71702
  if (!body) {
@@ -71770,8 +71770,8 @@ var App = class _App {
71770
71770
  _App.instance = this;
71771
71771
  this.medplum = medplum;
71772
71772
  this.agentId = agentId;
71773
- this.log = options?.mainLogger ?? new lo((msg) => console.log(msg), void 0, logLevel);
71774
- this.channelLog = options?.channelLogger ?? new lo((msg) => console.log(msg), void 0, logLevel);
71773
+ this.log = options?.mainLogger ?? new po((msg) => console.log(msg), void 0, logLevel);
71774
+ this.channelLog = options?.channelLogger ?? new po((msg) => console.log(msg), void 0, logLevel);
71775
71775
  }
71776
71776
  async start() {
71777
71777
  this.log.info("Medplum service starting...");
@@ -71793,7 +71793,7 @@ var App = class _App {
71793
71793
  if ((0, import_node_fs4.existsSync)(UPGRADE_MANIFEST_PATH)) {
71794
71794
  const upgradeFile = (0, import_node_fs4.readFileSync)(UPGRADE_MANIFEST_PATH, { encoding: "utf-8" });
71795
71795
  const upgradeDetails = JSON.parse(upgradeFile);
71796
- if (tn.startsWith(upgradeDetails.targetVersion)) {
71796
+ if (rn.startsWith(upgradeDetails.targetVersion)) {
71797
71797
  await this.sendToWebSocket({
71798
71798
  type: "agent:upgrade:response",
71799
71799
  statusCode: 200,
@@ -71801,7 +71801,7 @@ var App = class _App {
71801
71801
  });
71802
71802
  this.log.info(`Successfully upgraded to version ${upgradeDetails.targetVersion}`);
71803
71803
  } else {
71804
- const errMsg = `Failed to upgrade to version ${upgradeDetails.targetVersion}. Agent still running with version ${tn}`;
71804
+ const errMsg = `Failed to upgrade to version ${upgradeDetails.targetVersion}. Agent still running with version ${rn}`;
71805
71805
  await this.sendToWebSocket({
71806
71806
  type: "agent:error",
71807
71807
  body: errMsg,
@@ -71829,7 +71829,7 @@ var App = class _App {
71829
71829
  if (attempt === maxAttempts) {
71830
71830
  throw new Error("Too many unsuccessful attempts to create agent PID file");
71831
71831
  }
71832
- await Ur(500);
71832
+ await Br(500);
71833
71833
  }
71834
71834
  }
71835
71835
  }
@@ -71899,7 +71899,7 @@ var App = class _App {
71899
71899
  break;
71900
71900
  case "agent:heartbeat:request":
71901
71901
  this.outstandingHeartbeats = 0;
71902
- await this.sendToWebSocket({ type: "agent:heartbeat:response", version: tn });
71902
+ await this.sendToWebSocket({ type: "agent:heartbeat:response", version: rn });
71903
71903
  break;
71904
71904
  case "agent:heartbeat:response":
71905
71905
  this.outstandingHeartbeats = 0;
@@ -72166,8 +72166,8 @@ var App = class _App {
72166
72166
  }
72167
72167
  if (this.hl7Clients.size !== 0) {
72168
72168
  const clientClosePromises = [];
72169
- for (const channel of this.channels.values()) {
72170
- clientClosePromises.push(channel.stop());
72169
+ for (const client of this.hl7Clients.values()) {
72170
+ clientClosePromises.push(client.close());
72171
72171
  }
72172
72172
  await Promise.all(clientClosePromises);
72173
72173
  }
@@ -72214,7 +72214,7 @@ var App = class _App {
72214
72214
  trySendToHl7Connection() {
72215
72215
  while (this.hl7Queue.length > 0) {
72216
72216
  const msg = this.hl7Queue.shift();
72217
- if (msg && msg.type === "agent:transmit:response" && msg.channel) {
72217
+ if (msg?.type === "agent:transmit:response" && msg.channel) {
72218
72218
  const channel = this.channels.get(msg.channel);
72219
72219
  if (channel) {
72220
72220
  channel.sendToRemote(msg);
@@ -72239,7 +72239,7 @@ IPv6 is currently unsupported.`;
72239
72239
  this.log.error(errMsg);
72240
72240
  throw new Error(errMsg);
72241
72241
  }
72242
- if (!((0, import_node_net4.isIPv4)(message.remote) || Sl(message.remote))) {
72242
+ if (!((0, import_node_net4.isIPv4)(message.remote) || bl(message.remote))) {
72243
72243
  const errMsg = `Attempted to ping an invalid host.
72244
72244
 
72245
72245
  "${message.remote}" is not a valid IPv4 address or a resolvable hostname.`;
@@ -72291,7 +72291,7 @@ ${result}`);
72291
72291
  }
72292
72292
  }
72293
72293
  async tryUpgradeAgent(message) {
72294
- this.log.info(`Attempting to upgrade from ${tn} to ${message.version ?? "latest"}...`);
72294
+ this.log.info(`Attempting to upgrade from ${rn} to ${message.version ?? "latest"}...`);
72295
72295
  if ((0, import_node_os4.platform)() !== "win32") {
72296
72296
  const errMsg = "Auto-upgrading is currently only supported on Windows";
72297
72297
  this.log.error(errMsg);
@@ -72314,7 +72314,7 @@ ${result}`);
72314
72314
  return;
72315
72315
  }
72316
72316
  let child;
72317
- if (message.version && !await wh("agent-upgrader", message.version)) {
72317
+ if (message.version && !await Ah("agent-upgrader", message.version)) {
72318
72318
  const versionTag = message.version ? `v${message.version}` : "latest";
72319
72319
  const errMsg = `Error during upgrading to version '${versionTag}'. '${message.version}' is not a valid version`;
72320
72320
  this.log.error(errMsg);
@@ -72325,8 +72325,8 @@ ${result}`);
72325
72325
  });
72326
72326
  return;
72327
72327
  }
72328
- const targetVersion = message.version ?? await Ah("agent-upgrader");
72329
- if (tn.startsWith(targetVersion)) {
72328
+ const targetVersion = message.version ?? await Oh("agent-upgrader");
72329
+ if (rn.startsWith(targetVersion)) {
72330
72330
  if (!message?.force) {
72331
72331
  this.log.info(`Attempted to upgrade to version ${targetVersion}, but agent is already on that version`);
72332
72332
  await this.sendToWebSocket({
@@ -72336,7 +72336,7 @@ ${result}`);
72336
72336
  });
72337
72337
  return;
72338
72338
  }
72339
- this.log.info(`Forcing upgrade from ${tn} to ${targetVersion}`);
72339
+ this.log.info(`Forcing upgrade from ${rn} to ${targetVersion}`);
72340
72340
  }
72341
72341
  if (semver.lt(targetVersion, "4.2.4") && !message.force) {
72342
72342
  const errMsg = `WARNING: ${targetVersion} predates the zero-downtime upgrade feature. Downgrading to this version will 1) incur downtime during the downgrade process, as the current agent must stop itself before installing the older agent, and 2) incur downtime on any subsequent upgrade to a later version. We recommend against downgrading to this version, but if you must, reissue the command with force set to true to downgrade.`;
@@ -72396,11 +72396,11 @@ ${result}`);
72396
72396
  return;
72397
72397
  }
72398
72398
  try {
72399
- this.log.info("Writing upgrade manifest...", { previousVersion: tn, targetVersion });
72399
+ this.log.info("Writing upgrade manifest...", { previousVersion: rn, targetVersion });
72400
72400
  (0, import_node_fs4.writeFileSync)(
72401
72401
  UPGRADE_MANIFEST_PATH,
72402
72402
  JSON.stringify({
72403
- previousVersion: tn,
72403
+ previousVersion: rn,
72404
72404
  targetVersion,
72405
72405
  callback: message.callback ?? null
72406
72406
  }),
@@ -72502,7 +72502,7 @@ ${result}`);
72502
72502
  });
72503
72503
  }
72504
72504
  }
72505
- const requestMsg = uo.parse(message.body);
72505
+ const requestMsg = lo.parse(message.body);
72506
72506
  const msh10 = requestMsg.getSegment("MSH")?.getField(10);
72507
72507
  if (!msh10) {
72508
72508
  this.log.error("MSH.10 is missing but required");
@@ -72598,7 +72598,7 @@ async function agentMain(argv) {
72598
72598
  } catch (err) {
72599
72599
  console.error("Failed to login", { err: Ve(err) });
72600
72600
  console.log("Retrying login in 10 seconds...");
72601
- await Ur(RETRY_WAIT_DURATION_MS);
72601
+ await Br(RETRY_WAIT_DURATION_MS);
72602
72602
  }
72603
72603
  }
72604
72604
  if (args.logLevel) {
@@ -72611,7 +72611,7 @@ async function agentMain(argv) {
72611
72611
  for (const warning of warnings) {
72612
72612
  mainLogger.warn(warning);
72613
72613
  }
72614
- const app = new App(medplum, agentId, args.logLevel ? oh(args.logLevel) : void 0, {
72614
+ const app = new App(medplum, agentId, args.logLevel ? sh(args.logLevel) : void 0, {
72615
72615
  mainLogger,
72616
72616
  channelLogger
72617
72617
  });
@@ -72643,7 +72643,7 @@ async function upgraderMain(argv) {
72643
72643
  if ((0, import_node_os5.platform)() !== "win32") {
72644
72644
  throw new Error(`Unsupported platform: ${(0, import_node_os5.platform)()}. Agent upgrader currently only supports Windows`);
72645
72645
  }
72646
- const globalLogger = new lo((msg) => console.log(msg));
72646
+ const globalLogger = new po((msg) => console.log(msg));
72647
72647
  if (!import_node_process3.default.send) {
72648
72648
  globalLogger.error("Upgrader not started as a child process with Node IPC enabled. Aborting...");
72649
72649
  import_node_process3.default.exit(1);
@@ -72653,10 +72653,10 @@ async function upgraderMain(argv) {
72653
72653
  rejectOnTimeout = () => reject(new Error("Timed out while waiting for IPC to disconnect"));
72654
72654
  import_node_process3.default.once("disconnect", resolve2);
72655
72655
  });
72656
- if (argv[3] && !Lc(argv[3])) {
72656
+ if (argv[3] && !Fc(argv[3])) {
72657
72657
  throw new Error("Invalid version specified");
72658
72658
  }
72659
- const version = argv[3] ?? await Ah("agent-upgrader");
72659
+ const version = argv[3] ?? await Oh("agent-upgrader");
72660
72660
  const binPath = getReleaseBinPath(version);
72661
72661
  if (!(0, import_node_fs6.existsSync)(binPath)) {
72662
72662
  globalLogger.info(`Could not find binary at "${binPath}". Downloading release from GitHub...`);
@@ -72707,7 +72707,7 @@ async function main(argv) {
72707
72707
  } else if (argv[2] === "--remove-old-services") {
72708
72708
  const logFileFd = (0, import_node_fs7.openSync)(TEMP_LOG_FILE, "a");
72709
72709
  let allAgentServices = [];
72710
- const currentServiceName = `MedplumAgent_${tn}`;
72710
+ const currentServiceName = `MedplumAgent_${rn}`;
72711
72711
  while (!allAgentServices.includes(currentServiceName)) {
72712
72712
  const output = (0, import_node_child_process3.execSync)('cmd.exe /c sc query type= service state= all | findstr /i "SERVICE_NAME.*MedplumAgent"');
72713
72713
  (0, import_node_fs7.appendFileSync)(logFileFd, `${output}\r
@@ -72717,8 +72717,8 @@ async function main(argv) {
72717
72717
  ${allAgentServices.join("\r\n")}\r
72718
72718
  `, { encoding: "utf-8" });
72719
72719
  }
72720
- const servicesToRemove = argv[3] === "--all" ? allAgentServices : allAgentServices.filter((serviceName) => serviceName !== `MedplumAgent_${tn}`);
72721
- (0, import_node_fs7.appendFileSync)(logFileFd, `Medplum agent service to filter out: MedplumAgent_${tn}\r
72720
+ const servicesToRemove = argv[3] === "--all" ? allAgentServices : allAgentServices.filter((serviceName) => serviceName !== `MedplumAgent_${rn}`);
72721
+ (0, import_node_fs7.appendFileSync)(logFileFd, `Medplum agent service to filter out: MedplumAgent_${rn}\r
72722
72722
  `, {
72723
72723
  encoding: "utf-8"
72724
72724
  });