@medplum/agent 3.2.1 → 3.2.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 +456 -453
  2. package/package.json +6 -6
@@ -3686,7 +3686,7 @@ var require_stream = __commonJS({
3686
3686
  this.emit("error", err);
3687
3687
  }
3688
3688
  }
3689
- function createWebSocketStream2(ws2, options) {
3689
+ function createWebSocketStream2(ws, options) {
3690
3690
  let terminateOnDestroy = true;
3691
3691
  const duplex = new Duplex({
3692
3692
  ...options,
@@ -3695,65 +3695,65 @@ var require_stream = __commonJS({
3695
3695
  objectMode: false,
3696
3696
  writableObjectMode: false
3697
3697
  });
3698
- ws2.on("message", function message(msg, isBinary) {
3698
+ ws.on("message", function message(msg, isBinary) {
3699
3699
  const data2 = !isBinary && duplex._readableState.objectMode ? msg.toString() : msg;
3700
- if (!duplex.push(data2)) ws2.pause();
3700
+ if (!duplex.push(data2)) ws.pause();
3701
3701
  });
3702
- ws2.once("error", function error(err) {
3702
+ ws.once("error", function error(err) {
3703
3703
  if (duplex.destroyed) return;
3704
3704
  terminateOnDestroy = false;
3705
3705
  duplex.destroy(err);
3706
3706
  });
3707
- ws2.once("close", function close() {
3707
+ ws.once("close", function close() {
3708
3708
  if (duplex.destroyed) return;
3709
3709
  duplex.push(null);
3710
3710
  });
3711
3711
  duplex._destroy = function(err, callback) {
3712
- if (ws2.readyState === ws2.CLOSED) {
3712
+ if (ws.readyState === ws.CLOSED) {
3713
3713
  callback(err);
3714
3714
  process.nextTick(emitClose, duplex);
3715
3715
  return;
3716
3716
  }
3717
3717
  let called = false;
3718
- ws2.once("error", function error(err2) {
3718
+ ws.once("error", function error(err2) {
3719
3719
  called = true;
3720
3720
  callback(err2);
3721
3721
  });
3722
- ws2.once("close", function close() {
3722
+ ws.once("close", function close() {
3723
3723
  if (!called) callback(err);
3724
3724
  process.nextTick(emitClose, duplex);
3725
3725
  });
3726
- if (terminateOnDestroy) ws2.terminate();
3726
+ if (terminateOnDestroy) ws.terminate();
3727
3727
  };
3728
3728
  duplex._final = function(callback) {
3729
- if (ws2.readyState === ws2.CONNECTING) {
3730
- ws2.once("open", function open() {
3729
+ if (ws.readyState === ws.CONNECTING) {
3730
+ ws.once("open", function open() {
3731
3731
  duplex._final(callback);
3732
3732
  });
3733
3733
  return;
3734
3734
  }
3735
- if (ws2._socket === null) return;
3736
- if (ws2._socket._writableState.finished) {
3735
+ if (ws._socket === null) return;
3736
+ if (ws._socket._writableState.finished) {
3737
3737
  callback();
3738
3738
  if (duplex._readableState.endEmitted) duplex.destroy();
3739
3739
  } else {
3740
- ws2._socket.once("finish", function finish() {
3740
+ ws._socket.once("finish", function finish() {
3741
3741
  callback();
3742
3742
  });
3743
- ws2.close();
3743
+ ws.close();
3744
3744
  }
3745
3745
  };
3746
3746
  duplex._read = function() {
3747
- if (ws2.isPaused) ws2.resume();
3747
+ if (ws.isPaused) ws.resume();
3748
3748
  };
3749
3749
  duplex._write = function(chunk, encoding, callback) {
3750
- if (ws2.readyState === ws2.CONNECTING) {
3751
- ws2.once("open", function open() {
3750
+ if (ws.readyState === ws.CONNECTING) {
3751
+ ws.once("open", function open() {
3752
3752
  duplex._write(chunk, encoding, callback);
3753
3753
  });
3754
3754
  return;
3755
3755
  }
3756
- ws2.send(chunk, callback);
3756
+ ws.send(chunk, callback);
3757
3757
  };
3758
3758
  duplex.on("end", duplexOnEnd);
3759
3759
  duplex.on("error", duplexOnError);
@@ -7189,12 +7189,12 @@ var require_websocket_server = __commonJS({
7189
7189
  "Connection: Upgrade",
7190
7190
  `Sec-WebSocket-Accept: ${digest}`
7191
7191
  ];
7192
- const ws2 = new this.options.WebSocket(null, void 0, this.options);
7192
+ const ws = new this.options.WebSocket(null, void 0, this.options);
7193
7193
  if (protocols.size) {
7194
7194
  const protocol = this.options.handleProtocols ? this.options.handleProtocols(protocols, req) : protocols.values().next().value;
7195
7195
  if (protocol) {
7196
7196
  headers.push(`Sec-WebSocket-Protocol: ${protocol}`);
7197
- ws2._protocol = protocol;
7197
+ ws._protocol = protocol;
7198
7198
  }
7199
7199
  }
7200
7200
  if (extensions[PerMessageDeflate.extensionName]) {
@@ -7203,26 +7203,26 @@ var require_websocket_server = __commonJS({
7203
7203
  [PerMessageDeflate.extensionName]: [params]
7204
7204
  });
7205
7205
  headers.push(`Sec-WebSocket-Extensions: ${value}`);
7206
- ws2._extensions = extensions;
7206
+ ws._extensions = extensions;
7207
7207
  }
7208
7208
  this.emit("headers", headers, req);
7209
7209
  socket.write(headers.concat("\r\n").join("\r\n"));
7210
7210
  socket.removeListener("error", socketOnError);
7211
- ws2.setSocket(socket, head, {
7211
+ ws.setSocket(socket, head, {
7212
7212
  allowSynchronousEvents: this.options.allowSynchronousEvents,
7213
7213
  maxPayload: this.options.maxPayload,
7214
7214
  skipUTF8Validation: this.options.skipUTF8Validation
7215
7215
  });
7216
7216
  if (this.clients) {
7217
- this.clients.add(ws2);
7218
- ws2.on("close", () => {
7219
- this.clients.delete(ws2);
7217
+ this.clients.add(ws);
7218
+ ws.on("close", () => {
7219
+ this.clients.delete(ws);
7220
7220
  if (this._shouldEmitClose && !this.clients.size) {
7221
7221
  process.nextTick(emitClose, this);
7222
7222
  }
7223
7223
  });
7224
7224
  }
7225
- cb(ws2, req);
7225
+ cb(ws, req);
7226
7226
  }
7227
7227
  };
7228
7228
  module2.exports = WebSocketServer2;
@@ -7387,9 +7387,9 @@ var require_dcmjs = __commonJS({
7387
7387
  }
7388
7388
  interpolate(level) {
7389
7389
  return this.options.template.replace(/{{([^{}]*)}}/g, (stache, prop) => {
7390
- const fn2 = this.options[prop];
7391
- if (fn2) {
7392
- return fn2({ level, logger: this.logger });
7390
+ const fn = this.options[prop];
7391
+ if (fn) {
7392
+ return fn({ level, logger: this.logger });
7393
7393
  }
7394
7394
  return stache;
7395
7395
  });
@@ -7667,8 +7667,8 @@ var require_dcmjs = __commonJS({
7667
7667
  }
7668
7668
  return _construct.apply(null, arguments);
7669
7669
  }
7670
- function _isNativeFunction(fn2) {
7671
- return Function.toString.call(fn2).indexOf("[native code]") !== -1;
7670
+ function _isNativeFunction(fn) {
7671
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
7672
7672
  }
7673
7673
  function _wrapNativeSuper(Class) {
7674
7674
  var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
@@ -7762,14 +7762,14 @@ var require_dcmjs = __commonJS({
7762
7762
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
7763
7763
  }
7764
7764
  function _iterableToArrayLimit(arr, i) {
7765
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
7766
- if (_i == null) return;
7765
+ var _i2 = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
7766
+ if (_i2 == null) return;
7767
7767
  var _arr = [];
7768
- var _n2 = true;
7768
+ var _n = true;
7769
7769
  var _d = false;
7770
7770
  var _s2, _e2;
7771
7771
  try {
7772
- for (_i = _i.call(arr); !(_n2 = (_s2 = _i.next()).done); _n2 = true) {
7772
+ for (_i2 = _i2.call(arr); !(_n = (_s2 = _i2.next()).done); _n = true) {
7773
7773
  _arr.push(_s2.value);
7774
7774
  if (i && _arr.length === i) break;
7775
7775
  }
@@ -7778,7 +7778,7 @@ var require_dcmjs = __commonJS({
7778
7778
  _e2 = err2;
7779
7779
  } finally {
7780
7780
  try {
7781
- if (!_n2 && _i["return"] != null) _i["return"]();
7781
+ if (!_n && _i2["return"] != null) _i2["return"]();
7782
7782
  } finally {
7783
7783
  if (_d) throw _e2;
7784
7784
  }
@@ -17738,9 +17738,9 @@ var require_dcmjs = __commonJS({
17738
17738
  NumberOfFrames += referencedFramesPerSegment[i].length;
17739
17739
  }
17740
17740
  seg.setNumberOfFrames(NumberOfFrames);
17741
- for (var _i = 0; _i < segmentIndicies.length; _i++) {
17742
- var segmentIndex = segmentIndicies[_i];
17743
- var referencedFrameIndicies = referencedFramesPerSegment[_i];
17741
+ for (var _i2 = 0; _i2 < segmentIndicies.length; _i2++) {
17742
+ var segmentIndex = segmentIndicies[_i2];
17743
+ var referencedFrameIndicies = referencedFramesPerSegment[_i2];
17744
17744
  var referencedFrameNumbers = referencedFrameIndicies.map(function(element) {
17745
17745
  return element + 1;
17746
17746
  });
@@ -18305,7 +18305,7 @@ var require_dcmjs = __commonJS({
18305
18305
  var sqrLen = squaredLength;
18306
18306
  var forEach = function() {
18307
18307
  var vec = create();
18308
- return function(a2, stride, offset, count, fn2, arg) {
18308
+ return function(a2, stride, offset, count, fn, arg) {
18309
18309
  var i, l3;
18310
18310
  if (!stride) {
18311
18311
  stride = 3;
@@ -18322,7 +18322,7 @@ var require_dcmjs = __commonJS({
18322
18322
  vec[0] = a2[i];
18323
18323
  vec[1] = a2[i + 1];
18324
18324
  vec[2] = a2[i + 2];
18325
- fn2(vec, vec, arg);
18325
+ fn(vec, vec, arg);
18326
18326
  a2[i] = vec[0];
18327
18327
  a2[i + 1] = vec[1];
18328
18328
  a2[i + 2] = vec[2];
@@ -18420,11 +18420,11 @@ var require_dcmjs = __commonJS({
18420
18420
  var bodyLength = rleArray.length % 2 === 0 ? rleArray.length : rleArray.length + 1;
18421
18421
  var encodedFrameBuffer = new ArrayBuffer(headerLength + bodyLength);
18422
18422
  var headerView = new Uint32Array(encodedFrameBuffer, 0, 16);
18423
- for (var _i = 0; _i < headerView.length; _i++) {
18424
- headerView[_i] = header[_i];
18425
- }
18426
18423
  for (var _i2 = 0; _i2 < headerView.length; _i2++) {
18427
- rleArray.push(headerView[_i2]);
18424
+ headerView[_i2] = header[_i2];
18425
+ }
18426
+ for (var _i22 = 0; _i22 < headerView.length; _i22++) {
18427
+ rleArray.push(headerView[_i22]);
18428
18428
  }
18429
18429
  var bodyView = new Uint8Array(encodedFrameBuffer, 64);
18430
18430
  for (var _i3 = 0; _i3 < rleArray.length; _i3++) {
@@ -19125,20 +19125,20 @@ var require_dcmjs = __commonJS({
19125
19125
  referencedFramesPerSegment2[i] = [];
19126
19126
  }
19127
19127
  }
19128
- var _loop22 = function _loop23(_i2) {
19129
- var labelmap2D = labelmaps2D[_i2];
19130
- if (labelmaps2D[_i2]) {
19128
+ var _loop22 = function _loop23(_i3) {
19129
+ var labelmap2D = labelmaps2D[_i3];
19130
+ if (labelmaps2D[_i3]) {
19131
19131
  var segmentsOnLabelmap = labelmap2D.segmentsOnLabelmap;
19132
19132
  segmentsOnLabelmap.forEach(function(segmentIndex2) {
19133
19133
  if (segmentIndex2 !== 0) {
19134
- referencedFramesPerSegment2[segmentIndex2].push(_i2);
19134
+ referencedFramesPerSegment2[segmentIndex2].push(_i3);
19135
19135
  numberOfFrames++;
19136
19136
  }
19137
19137
  });
19138
19138
  }
19139
19139
  };
19140
- for (var _i = 0; _i < labelmaps2D.length; _i++) {
19141
- _loop22(_i);
19140
+ for (var _i2 = 0; _i2 < labelmaps2D.length; _i2++) {
19141
+ _loop22(_i2);
19142
19142
  }
19143
19143
  referencedFramesPerLabelmap[labelmapIndex2] = referencedFramesPerSegment2;
19144
19144
  };
@@ -24793,11 +24793,11 @@ var require_once = __commonJS({
24793
24793
  value: true
24794
24794
  });
24795
24795
  exports2.default = once;
24796
- function once(fn2) {
24796
+ function once(fn) {
24797
24797
  return function() {
24798
- if (fn2 === null) return;
24799
- var callFn = fn2;
24800
- fn2 = null;
24798
+ if (fn === null) return;
24799
+ var callFn = fn;
24800
+ fn = null;
24801
24801
  callFn.apply(this, arguments);
24802
24802
  };
24803
24803
  }
@@ -25337,11 +25337,11 @@ var require_onlyOnce = __commonJS({
25337
25337
  value: true
25338
25338
  });
25339
25339
  exports2.default = onlyOnce;
25340
- function onlyOnce(fn2) {
25340
+ function onlyOnce(fn) {
25341
25341
  return function() {
25342
- if (fn2 === null) throw new Error("Callback was already called.");
25343
- var callFn = fn2;
25344
- fn2 = null;
25342
+ if (fn === null) throw new Error("Callback was already called.");
25343
+ var callFn = fn;
25344
+ fn = null;
25345
25345
  callFn.apply(this, arguments);
25346
25346
  };
25347
25347
  }
@@ -25472,11 +25472,11 @@ var require_initialParams = __commonJS({
25472
25472
  Object.defineProperty(exports2, "__esModule", {
25473
25473
  value: true
25474
25474
  });
25475
- exports2.default = function(fn2) {
25475
+ exports2.default = function(fn) {
25476
25476
  return function() {
25477
25477
  var args = (0, _slice2.default)(arguments);
25478
25478
  var callback = args.pop();
25479
- fn2.call(this, args, callback);
25479
+ fn.call(this, args, callback);
25480
25480
  };
25481
25481
  };
25482
25482
  var _slice = require_slice();
@@ -25505,14 +25505,14 @@ var require_setImmediate = __commonJS({
25505
25505
  }
25506
25506
  var hasSetImmediate = exports2.hasSetImmediate = typeof setImmediate === "function" && setImmediate;
25507
25507
  var hasNextTick = exports2.hasNextTick = typeof process === "object" && typeof process.nextTick === "function";
25508
- function fallback(fn2) {
25509
- setTimeout(fn2, 0);
25508
+ function fallback(fn) {
25509
+ setTimeout(fn, 0);
25510
25510
  }
25511
25511
  function wrap(defer) {
25512
- return function(fn2) {
25512
+ return function(fn) {
25513
25513
  var args = (0, _slice2.default)(arguments, 1);
25514
25514
  defer(function() {
25515
- fn2.apply(null, args);
25515
+ fn.apply(null, args);
25516
25516
  });
25517
25517
  };
25518
25518
  }
@@ -25592,8 +25592,8 @@ var require_wrapAsync = __commonJS({
25592
25592
  return obj && obj.__esModule ? obj : { default: obj };
25593
25593
  }
25594
25594
  var supportsSymbol = typeof Symbol === "function";
25595
- function isAsync(fn2) {
25596
- return supportsSymbol && fn2[Symbol.toStringTag] === "AsyncFunction";
25595
+ function isAsync(fn) {
25596
+ return supportsSymbol && fn[Symbol.toStringTag] === "AsyncFunction";
25597
25597
  }
25598
25598
  function wrapAsync(asyncFn) {
25599
25599
  return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn;
@@ -25635,9 +25635,9 @@ var require_doLimit = __commonJS({
25635
25635
  value: true
25636
25636
  });
25637
25637
  exports2.default = doLimit;
25638
- function doLimit(fn2, limit) {
25638
+ function doLimit(fn, limit) {
25639
25639
  return function(iterable, iteratee, callback) {
25640
- return fn2(iterable, limit, iteratee, callback);
25640
+ return fn(iterable, limit, iteratee, callback);
25641
25641
  };
25642
25642
  }
25643
25643
  module2.exports = exports2["default"];
@@ -25689,17 +25689,17 @@ var require_AsyncEventEmitter = __commonJS({
25689
25689
  callback = void 0;
25690
25690
  }
25691
25691
  listeners = Array.isArray(listeners) ? listeners : [listeners];
25692
- eachSeries(listeners.slice(), function(fn2, next) {
25692
+ eachSeries(listeners.slice(), function(fn, next) {
25693
25693
  var err;
25694
- if (fn2.length < 2) {
25694
+ if (fn.length < 2) {
25695
25695
  try {
25696
- fn2.call(self2, data2);
25696
+ fn.call(self2, data2);
25697
25697
  } catch (e) {
25698
25698
  err = e;
25699
25699
  }
25700
25700
  return next(err);
25701
25701
  }
25702
- fn2.call(self2, data2, next);
25702
+ fn.call(self2, data2, next);
25703
25703
  }, callback);
25704
25704
  return self2;
25705
25705
  };
@@ -29501,8 +29501,8 @@ var require_fecha_umd = __commonJS({
29501
29501
  };
29502
29502
  function assign(origObj) {
29503
29503
  var args = [];
29504
- for (var _i = 1; _i < arguments.length; _i++) {
29505
- args[_i - 1] = arguments[_i];
29504
+ for (var _i2 = 1; _i2 < arguments.length; _i2++) {
29505
+ args[_i2 - 1] = arguments[_i2];
29506
29506
  }
29507
29507
  for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {
29508
29508
  var obj = args_1[_a];
@@ -30034,7 +30034,7 @@ var require_package = __commonJS({
30034
30034
  module2.exports = {
30035
30035
  name: "winston",
30036
30036
  description: "A logger for just about everything.",
30037
- version: "3.13.0",
30037
+ version: "3.13.1",
30038
30038
  author: "Charlie Robbins <charlie.robbins@gmail.com>",
30039
30039
  maintainers: [
30040
30040
  "David Hyde <dabh@alumni.stanford.edu>"
@@ -30061,7 +30061,7 @@ var require_package = __commonJS({
30061
30061
  "@colors/colors": "^1.6.0",
30062
30062
  async: "^3.2.3",
30063
30063
  "is-stream": "^2.0.0",
30064
- logform: "^2.4.0",
30064
+ logform: "^2.6.0",
30065
30065
  "one-time": "^1.0.0",
30066
30066
  "readable-stream": "^3.4.0",
30067
30067
  "safe-stable-stringify": "^2.3.1",
@@ -30073,7 +30073,7 @@ var require_package = __commonJS({
30073
30073
  "@babel/cli": "^7.23.9",
30074
30074
  "@babel/core": "^7.24.0",
30075
30075
  "@babel/preset-env": "^7.24.0",
30076
- "@dabh/eslint-config-populist": "^5.0.0",
30076
+ "@dabh/eslint-config-populist": "^4.4.0",
30077
30077
  "@types/node": "^20.11.24",
30078
30078
  "abstract-winston-transport": "^0.5.1",
30079
30079
  assume: "^2.2.0",
@@ -30082,7 +30082,7 @@ var require_package = __commonJS({
30082
30082
  hock: "^1.4.1",
30083
30083
  mocha: "^10.3.0",
30084
30084
  nyc: "^15.1.0",
30085
- rimraf: "^5.0.5",
30085
+ rimraf: "5.0.1",
30086
30086
  split2: "^4.1.0",
30087
30087
  "std-mocks": "^2.0.0",
30088
30088
  through2: "^4.0.2",
@@ -31214,11 +31214,11 @@ var require_from = __commonJS({
31214
31214
  Promise.resolve(value).then(_next, _throw);
31215
31215
  }
31216
31216
  }
31217
- function _asyncToGenerator(fn2) {
31217
+ function _asyncToGenerator(fn) {
31218
31218
  return function() {
31219
31219
  var self2 = this, args = arguments;
31220
31220
  return new Promise(function(resolve2, reject) {
31221
- var gen = fn2.apply(self2, args);
31221
+ var gen = fn.apply(self2, args);
31222
31222
  function _next(value) {
31223
31223
  asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "next", value);
31224
31224
  }
@@ -31361,11 +31361,11 @@ var require_stream_readable = __commonJS({
31361
31361
  require_inherits()(Readable2, Stream);
31362
31362
  var errorOrDestroy = destroyImpl.errorOrDestroy;
31363
31363
  var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
31364
- function prependListener(emitter, event, fn2) {
31365
- if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn2);
31366
- if (!emitter._events || !emitter._events[event]) emitter.on(event, fn2);
31367
- else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn2);
31368
- else emitter._events[event] = [fn2, emitter._events[event]];
31364
+ function prependListener(emitter, event, fn) {
31365
+ if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn);
31366
+ if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);
31367
+ else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);
31368
+ else emitter._events[event] = [fn, emitter._events[event]];
31369
31369
  }
31370
31370
  function ReadableState(options, stream, isDuplex) {
31371
31371
  Duplex = Duplex || require_stream_duplex();
@@ -31813,8 +31813,8 @@ var require_stream_readable = __commonJS({
31813
31813
  dest.emit("unpipe", this, unpipeInfo);
31814
31814
  return this;
31815
31815
  };
31816
- Readable2.prototype.on = function(ev, fn2) {
31817
- var res = Stream.prototype.on.call(this, ev, fn2);
31816
+ Readable2.prototype.on = function(ev, fn) {
31817
+ var res = Stream.prototype.on.call(this, ev, fn);
31818
31818
  var state = this._readableState;
31819
31819
  if (ev === "data") {
31820
31820
  state.readableListening = this.listenerCount("readable") > 0;
@@ -31835,8 +31835,8 @@ var require_stream_readable = __commonJS({
31835
31835
  return res;
31836
31836
  };
31837
31837
  Readable2.prototype.addListener = Readable2.prototype.on;
31838
- Readable2.prototype.removeListener = function(ev, fn2) {
31839
- var res = Stream.prototype.removeListener.call(this, ev, fn2);
31838
+ Readable2.prototype.removeListener = function(ev, fn) {
31839
+ var res = Stream.prototype.removeListener.call(this, ev, fn);
31840
31840
  if (ev === "readable") {
31841
31841
  process.nextTick(updateReadableListening, this);
31842
31842
  }
@@ -32041,9 +32041,9 @@ var require_stream_readable = __commonJS({
32041
32041
  return from(Readable2, iterable, opts);
32042
32042
  };
32043
32043
  }
32044
- function indexOf(xs2, x3) {
32045
- for (var i = 0, l3 = xs2.length; i < l3; i++) {
32046
- if (xs2[i] === x3) return i;
32044
+ function indexOf(xs, x3) {
32045
+ for (var i = 0, l3 = xs.length; i < l3; i++) {
32046
+ if (xs[i] === x3) return i;
32047
32047
  }
32048
32048
  return -1;
32049
32049
  }
@@ -32909,10 +32909,10 @@ var require_initialParams2 = __commonJS({
32909
32909
  Object.defineProperty(exports2, "__esModule", {
32910
32910
  value: true
32911
32911
  });
32912
- exports2.default = function(fn2) {
32912
+ exports2.default = function(fn) {
32913
32913
  return function(...args) {
32914
32914
  var callback = args.pop();
32915
- return fn2.call(this, args, callback);
32915
+ return fn.call(this, args, callback);
32916
32916
  };
32917
32917
  };
32918
32918
  module2.exports = exports2.default;
@@ -32931,11 +32931,11 @@ var require_setImmediate2 = __commonJS({
32931
32931
  var hasQueueMicrotask = exports2.hasQueueMicrotask = typeof queueMicrotask === "function" && queueMicrotask;
32932
32932
  var hasSetImmediate = exports2.hasSetImmediate = typeof setImmediate === "function" && setImmediate;
32933
32933
  var hasNextTick = exports2.hasNextTick = typeof process === "object" && typeof process.nextTick === "function";
32934
- function fallback(fn2) {
32935
- setTimeout(fn2, 0);
32934
+ function fallback(fn) {
32935
+ setTimeout(fn, 0);
32936
32936
  }
32937
32937
  function wrap(defer) {
32938
- return (fn2, ...args) => defer(() => fn2(...args));
32938
+ return (fn, ...args) => defer(() => fn(...args));
32939
32939
  }
32940
32940
  var _defer;
32941
32941
  if (hasQueueMicrotask) {
@@ -33022,11 +33022,11 @@ var require_wrapAsync2 = __commonJS({
33022
33022
  function _interopRequireDefault(obj) {
33023
33023
  return obj && obj.__esModule ? obj : { default: obj };
33024
33024
  }
33025
- function isAsync(fn2) {
33026
- return fn2[Symbol.toStringTag] === "AsyncFunction";
33025
+ function isAsync(fn) {
33026
+ return fn[Symbol.toStringTag] === "AsyncFunction";
33027
33027
  }
33028
- function isAsyncGenerator(fn2) {
33029
- return fn2[Symbol.toStringTag] === "AsyncGenerator";
33028
+ function isAsyncGenerator(fn) {
33029
+ return fn[Symbol.toStringTag] === "AsyncGenerator";
33030
33030
  }
33031
33031
  function isAsyncIterable(obj) {
33032
33032
  return typeof obj[Symbol.asyncIterator] === "function";
@@ -33111,14 +33111,14 @@ var require_once2 = __commonJS({
33111
33111
  value: true
33112
33112
  });
33113
33113
  exports2.default = once;
33114
- function once(fn2) {
33114
+ function once(fn) {
33115
33115
  function wrapper(...args) {
33116
- if (fn2 === null) return;
33117
- var callFn = fn2;
33118
- fn2 = null;
33116
+ if (fn === null) return;
33117
+ var callFn = fn;
33118
+ fn = null;
33119
33119
  callFn.apply(this, args);
33120
33120
  }
33121
- Object.assign(wrapper, fn2);
33121
+ Object.assign(wrapper, fn);
33122
33122
  return wrapper;
33123
33123
  }
33124
33124
  module2.exports = exports2.default;
@@ -33201,11 +33201,11 @@ var require_onlyOnce2 = __commonJS({
33201
33201
  value: true
33202
33202
  });
33203
33203
  exports2.default = onlyOnce;
33204
- function onlyOnce(fn2) {
33204
+ function onlyOnce(fn) {
33205
33205
  return function(...args) {
33206
- if (fn2 === null) throw new Error("Callback was already called.");
33207
- var callFn = fn2;
33208
- fn2 = null;
33206
+ if (fn === null) throw new Error("Callback was already called.");
33207
+ var callFn = fn;
33208
+ fn = null;
33209
33209
  callFn.apply(this, args);
33210
33210
  };
33211
33211
  }
@@ -34757,11 +34757,11 @@ var require_from2 = __commonJS({
34757
34757
  Promise.resolve(value).then(_next, _throw);
34758
34758
  }
34759
34759
  }
34760
- function _asyncToGenerator(fn2) {
34760
+ function _asyncToGenerator(fn) {
34761
34761
  return function() {
34762
34762
  var self2 = this, args = arguments;
34763
34763
  return new Promise(function(resolve2, reject) {
34764
- var gen = fn2.apply(self2, args);
34764
+ var gen = fn.apply(self2, args);
34765
34765
  function _next(value) {
34766
34766
  asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "next", value);
34767
34767
  }
@@ -34904,11 +34904,11 @@ var require_stream_readable2 = __commonJS({
34904
34904
  require_inherits()(Readable2, Stream);
34905
34905
  var errorOrDestroy = destroyImpl.errorOrDestroy;
34906
34906
  var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
34907
- function prependListener(emitter, event, fn2) {
34908
- if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn2);
34909
- if (!emitter._events || !emitter._events[event]) emitter.on(event, fn2);
34910
- else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn2);
34911
- else emitter._events[event] = [fn2, emitter._events[event]];
34907
+ function prependListener(emitter, event, fn) {
34908
+ if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn);
34909
+ if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);
34910
+ else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);
34911
+ else emitter._events[event] = [fn, emitter._events[event]];
34912
34912
  }
34913
34913
  function ReadableState(options, stream, isDuplex) {
34914
34914
  Duplex = Duplex || require_stream_duplex2();
@@ -35356,8 +35356,8 @@ var require_stream_readable2 = __commonJS({
35356
35356
  dest.emit("unpipe", this, unpipeInfo);
35357
35357
  return this;
35358
35358
  };
35359
- Readable2.prototype.on = function(ev, fn2) {
35360
- var res = Stream.prototype.on.call(this, ev, fn2);
35359
+ Readable2.prototype.on = function(ev, fn) {
35360
+ var res = Stream.prototype.on.call(this, ev, fn);
35361
35361
  var state = this._readableState;
35362
35362
  if (ev === "data") {
35363
35363
  state.readableListening = this.listenerCount("readable") > 0;
@@ -35378,8 +35378,8 @@ var require_stream_readable2 = __commonJS({
35378
35378
  return res;
35379
35379
  };
35380
35380
  Readable2.prototype.addListener = Readable2.prototype.on;
35381
- Readable2.prototype.removeListener = function(ev, fn2) {
35382
- var res = Stream.prototype.removeListener.call(this, ev, fn2);
35381
+ Readable2.prototype.removeListener = function(ev, fn) {
35382
+ var res = Stream.prototype.removeListener.call(this, ev, fn);
35383
35383
  if (ev === "readable") {
35384
35384
  process.nextTick(updateReadableListening, this);
35385
35385
  }
@@ -35584,9 +35584,9 @@ var require_stream_readable2 = __commonJS({
35584
35584
  return from(Readable2, iterable, opts);
35585
35585
  };
35586
35586
  }
35587
- function indexOf(xs2, x3) {
35588
- for (var i = 0, l3 = xs2.length; i < l3; i++) {
35589
- if (xs2[i] === x3) return i;
35587
+ function indexOf(xs, x3) {
35588
+ for (var i = 0, l3 = xs.length; i < l3; i++) {
35589
+ if (xs[i] === x3) return i;
35590
35590
  }
35591
35591
  return -1;
35592
35592
  }
@@ -35758,8 +35758,8 @@ var require_pipeline = __commonJS({
35758
35758
  callback(err || new ERR_STREAM_DESTROYED("pipe"));
35759
35759
  };
35760
35760
  }
35761
- function call(fn2) {
35762
- fn2();
35761
+ function call(fn) {
35762
+ fn();
35763
35763
  }
35764
35764
  function pipe(from, to2) {
35765
35765
  return from.pipe(to2);
@@ -35847,17 +35847,17 @@ var require_diagnostics = __commonJS({
35847
35847
  if (!async.length) return false;
35848
35848
  return new Promise(function pinky(resolve2) {
35849
35849
  Promise.all(
35850
- async.map(function prebind(fn2) {
35851
- return fn2(namespace);
35850
+ async.map(function prebind(fn) {
35851
+ return fn(namespace);
35852
35852
  })
35853
35853
  ).then(function resolved(values) {
35854
35854
  resolve2(values.some(Boolean));
35855
35855
  });
35856
35856
  });
35857
35857
  }
35858
- function modify(fn2) {
35859
- if (~modifiers.indexOf(fn2)) return false;
35860
- modifiers.push(fn2);
35858
+ function modify(fn) {
35859
+ if (~modifiers.indexOf(fn)) return false;
35860
+ modifiers.push(fn);
35861
35861
  return true;
35862
35862
  }
35863
35863
  function write() {
@@ -35869,14 +35869,14 @@ var require_diagnostics = __commonJS({
35869
35869
  }
35870
35870
  return message;
35871
35871
  }
35872
- function introduce(fn2, options) {
35872
+ function introduce(fn, options) {
35873
35873
  var has = Object.prototype.hasOwnProperty;
35874
35874
  for (var key in options) {
35875
35875
  if (has.call(options, key)) {
35876
- fn2[key] = options[key];
35876
+ fn[key] = options[key];
35877
35877
  }
35878
35878
  }
35879
- return fn2;
35879
+ return fn;
35880
35880
  }
35881
35881
  function nope(options) {
35882
35882
  options.enabled = false;
@@ -36120,9 +36120,9 @@ var require_simple_swizzle = __commonJS({
36120
36120
  }
36121
36121
  return results;
36122
36122
  };
36123
- swizzle.wrap = function(fn2) {
36123
+ swizzle.wrap = function(fn) {
36124
36124
  return function() {
36125
- return fn2(swizzle(arguments));
36125
+ return fn(swizzle(arguments));
36126
36126
  };
36127
36127
  };
36128
36128
  }
@@ -36904,11 +36904,11 @@ var require_conversions = __commonJS({
36904
36904
  var l3 = lab[0];
36905
36905
  var a2 = lab[1];
36906
36906
  var b3 = lab[2];
36907
- var hr;
36907
+ var hr2;
36908
36908
  var h2;
36909
36909
  var c;
36910
- hr = Math.atan2(b3, a2);
36911
- h2 = hr * 360 / 2 / Math.PI;
36910
+ hr2 = Math.atan2(b3, a2);
36911
+ h2 = hr2 * 360 / 2 / Math.PI;
36912
36912
  if (h2 < 0) {
36913
36913
  h2 += 360;
36914
36914
  }
@@ -36921,10 +36921,10 @@ var require_conversions = __commonJS({
36921
36921
  var h2 = lch[2];
36922
36922
  var a2;
36923
36923
  var b3;
36924
- var hr;
36925
- hr = h2 / 360 * 2 * Math.PI;
36926
- a2 = c * Math.cos(hr);
36927
- b3 = c * Math.sin(hr);
36924
+ var hr2;
36925
+ hr2 = h2 / 360 * 2 * Math.PI;
36926
+ a2 = c * Math.cos(hr2);
36927
+ b3 = c * Math.sin(hr2);
36928
36928
  return [l3, a2, b3];
36929
36929
  };
36930
36930
  convert.rgb.ansi16 = function(args) {
@@ -37229,15 +37229,15 @@ var require_route = __commonJS({
37229
37229
  }
37230
37230
  function wrapConversion(toModel, graph) {
37231
37231
  var path = [graph[toModel].parent, toModel];
37232
- var fn2 = conversions[graph[toModel].parent][toModel];
37232
+ var fn = conversions[graph[toModel].parent][toModel];
37233
37233
  var cur = graph[toModel].parent;
37234
37234
  while (graph[cur].parent) {
37235
37235
  path.unshift(graph[cur].parent);
37236
- fn2 = link(conversions[graph[cur].parent][cur], fn2);
37236
+ fn = link(conversions[graph[cur].parent][cur], fn);
37237
37237
  cur = graph[cur].parent;
37238
37238
  }
37239
- fn2.conversion = path;
37240
- return fn2;
37239
+ fn.conversion = path;
37240
+ return fn;
37241
37241
  }
37242
37242
  module2.exports = function(fromModel) {
37243
37243
  var graph = deriveBFS(fromModel);
@@ -37264,7 +37264,7 @@ var require_color_convert = __commonJS({
37264
37264
  var route = require_route();
37265
37265
  var convert = {};
37266
37266
  var models = Object.keys(conversions);
37267
- function wrapRaw(fn2) {
37267
+ function wrapRaw(fn) {
37268
37268
  var wrappedFn = function(args) {
37269
37269
  if (args === void 0 || args === null) {
37270
37270
  return args;
@@ -37272,14 +37272,14 @@ var require_color_convert = __commonJS({
37272
37272
  if (arguments.length > 1) {
37273
37273
  args = Array.prototype.slice.call(arguments);
37274
37274
  }
37275
- return fn2(args);
37275
+ return fn(args);
37276
37276
  };
37277
- if ("conversion" in fn2) {
37278
- wrappedFn.conversion = fn2.conversion;
37277
+ if ("conversion" in fn) {
37278
+ wrappedFn.conversion = fn.conversion;
37279
37279
  }
37280
37280
  return wrappedFn;
37281
37281
  }
37282
- function wrapRounded(fn2) {
37282
+ function wrapRounded(fn) {
37283
37283
  var wrappedFn = function(args) {
37284
37284
  if (args === void 0 || args === null) {
37285
37285
  return args;
@@ -37287,7 +37287,7 @@ var require_color_convert = __commonJS({
37287
37287
  if (arguments.length > 1) {
37288
37288
  args = Array.prototype.slice.call(arguments);
37289
37289
  }
37290
- var result = fn2(args);
37290
+ var result = fn(args);
37291
37291
  if (typeof result === "object") {
37292
37292
  for (var len = result.length, i = 0; i < len; i++) {
37293
37293
  result[i] = Math.round(result[i]);
@@ -37295,8 +37295,8 @@ var require_color_convert = __commonJS({
37295
37295
  }
37296
37296
  return result;
37297
37297
  };
37298
- if ("conversion" in fn2) {
37299
- wrappedFn.conversion = fn2.conversion;
37298
+ if ("conversion" in fn) {
37299
+ wrappedFn.conversion = fn.conversion;
37300
37300
  }
37301
37301
  return wrappedFn;
37302
37302
  }
@@ -37307,9 +37307,9 @@ var require_color_convert = __commonJS({
37307
37307
  var routes = route(fromModel);
37308
37308
  var routeModels = Object.keys(routes);
37309
37309
  routeModels.forEach(function(toModel) {
37310
- var fn2 = routes[toModel];
37311
- convert[fromModel][toModel] = wrapRounded(fn2);
37312
- convert[fromModel][toModel].raw = wrapRaw(fn2);
37310
+ var fn = routes[toModel];
37311
+ convert[fromModel][toModel] = wrapRounded(fn);
37312
+ convert[fromModel][toModel].raw = wrapRaw(fn);
37313
37313
  });
37314
37314
  });
37315
37315
  module2.exports = convert;
@@ -37819,10 +37819,10 @@ var require_adapters = __commonJS({
37819
37819
  "../../node_modules/@dabh/diagnostics/adapters/index.js"(exports2, module2) {
37820
37820
  "use strict";
37821
37821
  var enabled = require_enabled();
37822
- module2.exports = function create(fn2) {
37822
+ module2.exports = function create(fn) {
37823
37823
  return function adapter(namespace) {
37824
37824
  try {
37825
- return enabled(namespace, fn2());
37825
+ return enabled(namespace, fn());
37826
37826
  } catch (e) {
37827
37827
  }
37828
37828
  return false;
@@ -37916,7 +37916,7 @@ var require_tail_file = __commonJS({
37916
37916
  stream.emit("end");
37917
37917
  stream.emit("close");
37918
37918
  };
37919
- fs.open(options.file, "a+", "0644", (err, fd) => {
37919
+ fs.open(options.file, "a+", "0644", (err, fd2) => {
37920
37920
  if (err) {
37921
37921
  if (!iter) {
37922
37922
  stream.emit("error", err);
@@ -37928,10 +37928,10 @@ var require_tail_file = __commonJS({
37928
37928
  }
37929
37929
  (function read() {
37930
37930
  if (stream.destroyed) {
37931
- fs.close(fd, noop);
37931
+ fs.close(fd2, noop);
37932
37932
  return;
37933
37933
  }
37934
- return fs.read(fd, buffer, 0, buffer.length, pos, (error, bytes) => {
37934
+ return fs.read(fd2, buffer, 0, buffer.length, pos, (error, bytes) => {
37935
37935
  if (error) {
37936
37936
  if (!iter) {
37937
37937
  stream.emit("error", error);
@@ -39013,14 +39013,14 @@ var require_fn = __commonJS({
39013
39013
  "../../node_modules/fn.name/index.js"(exports2, module2) {
39014
39014
  "use strict";
39015
39015
  var toString = Object.prototype.toString;
39016
- module2.exports = function name(fn2) {
39017
- if ("string" === typeof fn2.displayName && fn2.constructor.name) {
39018
- return fn2.displayName;
39019
- } else if ("string" === typeof fn2.name && fn2.name) {
39020
- return fn2.name;
39021
- }
39022
- if ("object" === typeof fn2 && fn2.constructor && "string" === typeof fn2.constructor.name) return fn2.constructor.name;
39023
- var named = fn2.toString(), type = toString.call(fn2).slice(8, -1);
39016
+ module2.exports = function name(fn) {
39017
+ if ("string" === typeof fn.displayName && fn.constructor.name) {
39018
+ return fn.displayName;
39019
+ } else if ("string" === typeof fn.name && fn.name) {
39020
+ return fn.name;
39021
+ }
39022
+ if ("object" === typeof fn && fn.constructor && "string" === typeof fn.constructor.name) return fn.constructor.name;
39023
+ var named = fn.toString(), type = toString.call(fn).slice(8, -1);
39024
39024
  if ("Function" === type) {
39025
39025
  named = named.substring(named.indexOf("(") + 1, named.indexOf(")"));
39026
39026
  } else {
@@ -39036,16 +39036,16 @@ var require_one_time = __commonJS({
39036
39036
  "../../node_modules/one-time/index.js"(exports2, module2) {
39037
39037
  "use strict";
39038
39038
  var name = require_fn();
39039
- module2.exports = function one(fn2) {
39039
+ module2.exports = function one(fn) {
39040
39040
  var called = 0, value;
39041
39041
  function onetime() {
39042
39042
  if (called) return value;
39043
39043
  called = 1;
39044
- value = fn2.apply(this, arguments);
39045
- fn2 = null;
39044
+ value = fn.apply(this, arguments);
39045
+ fn = null;
39046
39046
  return value;
39047
39047
  }
39048
- onetime.displayName = name(fn2);
39048
+ onetime.displayName = name(fn);
39049
39049
  return onetime;
39050
39050
  };
39051
39051
  }
@@ -42558,14 +42558,14 @@ var Qe = "created";
42558
42558
  var jt = "not-modified";
42559
42559
  var $t = "not-found";
42560
42560
  var Ke = "accepted";
42561
- var Kr = { resourceType: "OperationOutcome", id: $t, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
42561
+ var Qr = { resourceType: "OperationOutcome", id: $t, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
42562
42562
  function R(r6, e) {
42563
42563
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "invalid", details: { text: r6 }, ...e ? { expression: [e] } : void 0 }] };
42564
42564
  }
42565
42565
  function h(r6) {
42566
42566
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "structure", details: { text: r6 } }] };
42567
42567
  }
42568
- function zr(r6) {
42568
+ function Kr(r6) {
42569
42569
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "exception", details: { text: "Internal server error" }, diagnostics: r6.toString() }] };
42570
42570
  }
42571
42571
  function xe(r6) {
@@ -42576,42 +42576,42 @@ function Wt(r6) {
42576
42576
  }
42577
42577
  var f = class extends Error {
42578
42578
  constructor(e, t) {
42579
- super(Jr(e)), this.outcome = e, this.cause = t;
42579
+ super(zr(e)), this.outcome = e, this.cause = t;
42580
42580
  }
42581
42581
  };
42582
42582
  function ze(r6) {
42583
- return r6 instanceof f ? r6.outcome : xe(r6) ? r6 : R(Oi(r6));
42583
+ return r6 instanceof f ? r6.outcome : xe(r6) ? r6 : R(Ii(r6));
42584
42584
  }
42585
- function Oi(r6) {
42586
- return r6 ? typeof r6 == "string" ? r6 : r6 instanceof Error ? r6.message : xe(r6) ? Jr(r6) : typeof r6 == "object" && "code" in r6 && typeof r6.code == "string" ? r6.code : JSON.stringify(r6) : "Unknown error";
42585
+ function Ii(r6) {
42586
+ return r6 ? typeof r6 == "string" ? r6 : r6 instanceof Error ? r6.message : xe(r6) ? zr(r6) : typeof r6 == "object" && "code" in r6 && typeof r6.code == "string" ? r6.code : JSON.stringify(r6) : "Unknown error";
42587
42587
  }
42588
- function Jr(r6) {
42589
- let e = r6.issue?.map(Ii) ?? [];
42588
+ function zr(r6) {
42589
+ let e = r6.issue?.map(ki) ?? [];
42590
42590
  return e.length > 0 ? e.join("; ") : "Unknown error";
42591
42591
  }
42592
- function Ii(r6) {
42592
+ function ki(r6) {
42593
42593
  let e;
42594
42594
  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;
42595
42595
  }
42596
- function Vi(r6, e) {
42596
+ function Di(r6, e) {
42597
42597
  let t = e.max && e.max === Number.MAX_SAFE_INTEGER ? Number.POSITIVE_INFINITY : e.max;
42598
42598
  return { path: r6, description: "", type: e.type ?? [], min: e.min ?? 0, max: t ?? 1, isArray: !!t && t > 1, constraints: [] };
42599
42599
  }
42600
- function Xr(r6) {
42600
+ function Zr(r6) {
42601
42601
  let e = /* @__PURE__ */ Object.create(null);
42602
- for (let [t, n] of Object.entries(r6)) e[t] = { name: t, elements: Object.fromEntries(Object.entries(n.elements).map(([i, o]) => [i, Vi(i, o)])), constraints: [], innerTypes: [] };
42602
+ for (let [t, n] of Object.entries(r6)) e[t] = { name: t, elements: Object.fromEntries(Object.entries(n.elements).map(([i, o]) => [i, Di(i, o)])), constraints: [], innerTypes: [] };
42603
42603
  return e;
42604
42604
  }
42605
- var en = { Element: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, BackboneElement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, Address: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: 9007199254740991, type: [{ code: "string" }] }, city: { type: [{ code: "string" }] }, district: { type: [{ code: "string" }] }, state: { type: [{ code: "string" }] }, postalCode: { type: [{ code: "string" }] }, country: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Age: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "author[x]": { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Organization"] }, { code: "string" }] }, time: { type: [{ code: "dateTime" }] }, text: { min: 1, type: [{ code: "markdown" }] } } }, Attachment: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, contentType: { type: [{ code: "code" }] }, language: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] }, url: { type: [{ code: "url" }] }, size: { type: [{ code: "unsignedInt" }] }, hash: { type: [{ code: "base64Binary" }] }, title: { type: [{ code: "string" }] }, creation: { type: [{ code: "dateTime" }] } } }, CodeableConcept: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, coding: { max: 9007199254740991, type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: 9007199254740991, type: [{ code: "ContactPoint" }] } } }, ContactPoint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] } } }, Count: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, "subject[x]": { type: [{ code: "CodeableConcept" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Group"] }] }, mustSupport: { max: 9007199254740991, type: [{ code: "string" }] }, codeFilter: { max: 9007199254740991, type: [{ code: "DataRequirementCodeFilter" }] }, dateFilter: { max: 9007199254740991, type: [{ code: "DataRequirementDateFilter" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: 9007199254740991, type: [{ code: "DataRequirementSort" }] } } }, Distance: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] }, patientInstruction: { type: [{ code: "string" }] }, timing: { type: [{ code: "Timing" }] }, "asNeeded[x]": { type: [{ code: "boolean" }, { code: "CodeableConcept" }] }, site: { type: [{ code: "CodeableConcept" }] }, route: { type: [{ code: "CodeableConcept" }] }, method: { type: [{ code: "CodeableConcept" }] }, doseAndRate: { max: 9007199254740991, type: [{ code: "DosageDoseAndRate" }] }, maxDosePerPeriod: { type: [{ code: "Ratio" }] }, maxDosePerAdministration: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, maxDosePerLifetime: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Duration: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: 9007199254740991, type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] }, slicing: { type: [{ code: "ElementDefinitionSlicing" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: 9007199254740991, type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "ElementDefinitionBase" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: 9007199254740991, type: [{ code: "ElementDefinitionType" }] }, "defaultValue[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, meaningWhenMissing: { type: [{ code: "markdown" }] }, orderMeaning: { type: [{ code: "string" }] }, "fixed[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, "pattern[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, example: { max: 9007199254740991, type: [{ code: "ElementDefinitionExample" }] }, "minValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, "maxValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, maxLength: { type: [{ code: "integer" }] }, condition: { max: 9007199254740991, type: [{ code: "id" }] }, constraint: { max: 9007199254740991, type: [{ code: "ElementDefinitionConstraint" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "ElementDefinitionBinding" }] }, mapping: { max: 9007199254740991, type: [{ code: "ElementDefinitionMapping" }] } } }, Expression: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, description: { type: [{ code: "string" }] }, name: { type: [{ code: "id" }] }, language: { min: 1, type: [{ code: "code" }] }, expression: { type: [{ code: "string" }] }, reference: { type: [{ code: "uri" }] } } }, Extension: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "uri" }] }, "value[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, HumanName: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: 9007199254740991, type: [{ code: "string" }] }, prefix: { max: 9007199254740991, type: [{ code: "string" }] }, suffix: { max: 9007199254740991, type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "CodeableConcept" }] }, system: { type: [{ code: "uri" }] }, value: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] }, assigner: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MarketingStatus: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, country: { min: 1, type: [{ code: "CodeableConcept" }] }, jurisdiction: { type: [{ code: "CodeableConcept" }] }, status: { min: 1, type: [{ code: "CodeableConcept" }] }, dateRange: { min: 1, type: [{ code: "Period" }] }, restoreDate: { type: [{ code: "dateTime" }] } } }, Meta: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: 9007199254740991, type: [{ code: "Coding" }] }, tag: { max: 9007199254740991, type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, onBehalfOf: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, compartment: { max: 9007199254740991, type: [{ code: "Reference" }] } } }, Money: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "code" }] }, use: { min: 1, type: [{ code: "code" }] }, min: { type: [{ code: "integer" }] }, max: { type: [{ code: "string" }] }, documentation: { type: [{ code: "string" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, Period: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, height: { type: [{ code: "Quantity" }] }, width: { type: [{ code: "Quantity" }] }, depth: { type: [{ code: "Quantity" }] }, weight: { type: [{ code: "Quantity" }] }, nominalVolume: { type: [{ code: "Quantity" }] }, externalDiameter: { type: [{ code: "Quantity" }] }, shape: { type: [{ code: "string" }] }, color: { max: 9007199254740991, type: [{ code: "string" }] }, imprint: { max: 9007199254740991, type: [{ code: "string" }] }, image: { max: 9007199254740991, type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, Quantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Range: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, low: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, high: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Ratio: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, label: { type: [{ code: "string" }] }, display: { type: [{ code: "string" }] }, citation: { type: [{ code: "markdown" }] }, url: { type: [{ code: "url" }] }, document: { type: [{ code: "Attachment" }] }, resource: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Resource"] }] } } }, SampledData: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, origin: { min: 1, type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, period: { min: 1, type: [{ code: "decimal" }] }, factor: { type: [{ code: "decimal" }] }, lowerLimit: { type: [{ code: "decimal" }] }, upperLimit: { type: [{ code: "decimal" }] }, dimensions: { min: 1, type: [{ code: "positiveInt" }] }, data: { type: [{ code: "string" }] } } }, Signature: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, max: 9007199254740991, type: [{ code: "Coding" }] }, when: { min: 1, type: [{ code: "instant" }] }, who: { min: 1, type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, onBehalfOf: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, targetFormat: { type: [{ code: "code" }] }, sigFormat: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] } } }, SubstanceAmount: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "SubstanceAmountReferenceRange" }] } } }, Timing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, event: { max: 9007199254740991, type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "TimingRepeat" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TriggerDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { type: [{ code: "string" }] }, "timing[x]": { type: [{ code: "Timing" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Schedule"] }, { code: "date" }, { code: "dateTime" }] }, data: { max: 9007199254740991, type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "Coding" }] }, "value[x]": { min: 1, type: [{ code: "CodeableConcept" }, { code: "Quantity" }, { code: "Range" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/PlanDefinition", "http://hl7.org/fhir/StructureDefinition/ResearchStudy", "http://hl7.org/fhir/StructureDefinition/InsurancePlan", "http://hl7.org/fhir/StructureDefinition/HealthcareService", "http://hl7.org/fhir/StructureDefinition/Group", "http://hl7.org/fhir/StructureDefinition/Location", "http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MoneyQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, SimpleQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { max: 0, type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, IdentityProvider: { elements: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, tokenAuthMethod: { type: [{ code: "code" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, usePkce: { type: [{ code: "boolean" }] }, useSubject: { type: [{ code: "boolean" }] } } } };
42605
+ var Xr = { Element: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, BackboneElement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, Address: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: 9007199254740991, type: [{ code: "string" }] }, city: { type: [{ code: "string" }] }, district: { type: [{ code: "string" }] }, state: { type: [{ code: "string" }] }, postalCode: { type: [{ code: "string" }] }, country: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Age: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "author[x]": { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Organization"] }, { code: "string" }] }, time: { type: [{ code: "dateTime" }] }, text: { min: 1, type: [{ code: "markdown" }] } } }, Attachment: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, contentType: { type: [{ code: "code" }] }, language: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] }, url: { type: [{ code: "url" }] }, size: { type: [{ code: "unsignedInt" }] }, hash: { type: [{ code: "base64Binary" }] }, title: { type: [{ code: "string" }] }, creation: { type: [{ code: "dateTime" }] } } }, CodeableConcept: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, coding: { max: 9007199254740991, type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: 9007199254740991, type: [{ code: "ContactPoint" }] } } }, ContactPoint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] } } }, Count: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, "subject[x]": { type: [{ code: "CodeableConcept" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Group"] }] }, mustSupport: { max: 9007199254740991, type: [{ code: "string" }] }, codeFilter: { max: 9007199254740991, type: [{ code: "DataRequirementCodeFilter" }] }, dateFilter: { max: 9007199254740991, type: [{ code: "DataRequirementDateFilter" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: 9007199254740991, type: [{ code: "DataRequirementSort" }] } } }, Distance: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] }, patientInstruction: { type: [{ code: "string" }] }, timing: { type: [{ code: "Timing" }] }, "asNeeded[x]": { type: [{ code: "boolean" }, { code: "CodeableConcept" }] }, site: { type: [{ code: "CodeableConcept" }] }, route: { type: [{ code: "CodeableConcept" }] }, method: { type: [{ code: "CodeableConcept" }] }, doseAndRate: { max: 9007199254740991, type: [{ code: "DosageDoseAndRate" }] }, maxDosePerPeriod: { type: [{ code: "Ratio" }] }, maxDosePerAdministration: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, maxDosePerLifetime: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Duration: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: 9007199254740991, type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] }, slicing: { type: [{ code: "ElementDefinitionSlicing" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: 9007199254740991, type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "ElementDefinitionBase" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: 9007199254740991, type: [{ code: "ElementDefinitionType" }] }, "defaultValue[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, meaningWhenMissing: { type: [{ code: "markdown" }] }, orderMeaning: { type: [{ code: "string" }] }, "fixed[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, "pattern[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, example: { max: 9007199254740991, type: [{ code: "ElementDefinitionExample" }] }, "minValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, "maxValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, maxLength: { type: [{ code: "integer" }] }, condition: { max: 9007199254740991, type: [{ code: "id" }] }, constraint: { max: 9007199254740991, type: [{ code: "ElementDefinitionConstraint" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "ElementDefinitionBinding" }] }, mapping: { max: 9007199254740991, type: [{ code: "ElementDefinitionMapping" }] } } }, Expression: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, description: { type: [{ code: "string" }] }, name: { type: [{ code: "id" }] }, language: { min: 1, type: [{ code: "code" }] }, expression: { type: [{ code: "string" }] }, reference: { type: [{ code: "uri" }] } } }, Extension: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "uri" }] }, "value[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, HumanName: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: 9007199254740991, type: [{ code: "string" }] }, prefix: { max: 9007199254740991, type: [{ code: "string" }] }, suffix: { max: 9007199254740991, type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "CodeableConcept" }] }, system: { type: [{ code: "uri" }] }, value: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] }, assigner: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MarketingStatus: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, country: { min: 1, type: [{ code: "CodeableConcept" }] }, jurisdiction: { type: [{ code: "CodeableConcept" }] }, status: { min: 1, type: [{ code: "CodeableConcept" }] }, dateRange: { min: 1, type: [{ code: "Period" }] }, restoreDate: { type: [{ code: "dateTime" }] } } }, Meta: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: 9007199254740991, type: [{ code: "Coding" }] }, tag: { max: 9007199254740991, type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, onBehalfOf: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, compartment: { max: 9007199254740991, type: [{ code: "Reference" }] } } }, Money: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "code" }] }, use: { min: 1, type: [{ code: "code" }] }, min: { type: [{ code: "integer" }] }, max: { type: [{ code: "string" }] }, documentation: { type: [{ code: "string" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, Period: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, height: { type: [{ code: "Quantity" }] }, width: { type: [{ code: "Quantity" }] }, depth: { type: [{ code: "Quantity" }] }, weight: { type: [{ code: "Quantity" }] }, nominalVolume: { type: [{ code: "Quantity" }] }, externalDiameter: { type: [{ code: "Quantity" }] }, shape: { type: [{ code: "string" }] }, color: { max: 9007199254740991, type: [{ code: "string" }] }, imprint: { max: 9007199254740991, type: [{ code: "string" }] }, image: { max: 9007199254740991, type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, Quantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Range: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, low: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, high: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Ratio: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, label: { type: [{ code: "string" }] }, display: { type: [{ code: "string" }] }, citation: { type: [{ code: "markdown" }] }, url: { type: [{ code: "url" }] }, document: { type: [{ code: "Attachment" }] }, resource: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Resource"] }] } } }, SampledData: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, origin: { min: 1, type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, period: { min: 1, type: [{ code: "decimal" }] }, factor: { type: [{ code: "decimal" }] }, lowerLimit: { type: [{ code: "decimal" }] }, upperLimit: { type: [{ code: "decimal" }] }, dimensions: { min: 1, type: [{ code: "positiveInt" }] }, data: { type: [{ code: "string" }] } } }, Signature: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, max: 9007199254740991, type: [{ code: "Coding" }] }, when: { min: 1, type: [{ code: "instant" }] }, who: { min: 1, type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, onBehalfOf: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, targetFormat: { type: [{ code: "code" }] }, sigFormat: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] } } }, SubstanceAmount: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "SubstanceAmountReferenceRange" }] } } }, Timing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, event: { max: 9007199254740991, type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "TimingRepeat" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TriggerDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { type: [{ code: "string" }] }, "timing[x]": { type: [{ code: "Timing" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Schedule"] }, { code: "date" }, { code: "dateTime" }] }, data: { max: 9007199254740991, type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "Coding" }] }, "value[x]": { min: 1, type: [{ code: "CodeableConcept" }, { code: "Quantity" }, { code: "Range" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/PlanDefinition", "http://hl7.org/fhir/StructureDefinition/ResearchStudy", "http://hl7.org/fhir/StructureDefinition/InsurancePlan", "http://hl7.org/fhir/StructureDefinition/HealthcareService", "http://hl7.org/fhir/StructureDefinition/Group", "http://hl7.org/fhir/StructureDefinition/Location", "http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MoneyQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, SimpleQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { max: 0, type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, IdentityProvider: { elements: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, tokenAuthMethod: { type: [{ code: "code" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, usePkce: { type: [{ code: "boolean" }] }, useSubject: { type: [{ code: "boolean" }] } } } };
42606
42606
  function zt(r6) {
42607
42607
  return new Qt(r6).parse();
42608
42608
  }
42609
- var ke = Xr(en);
42609
+ var ke = Zr(Xr);
42610
42610
  var Jt = /* @__PURE__ */ Object.create(null);
42611
- var tn = /* @__PURE__ */ Object.create(null);
42611
+ var en = /* @__PURE__ */ Object.create(null);
42612
42612
  function Ht(r6) {
42613
42613
  let e;
42614
- return r6 ? (e = tn[r6], e || (e = tn[r6] = /* @__PURE__ */ Object.create(null))) : e = ke, e;
42614
+ return r6 ? (e = en[r6], e || (e = en[r6] = /* @__PURE__ */ Object.create(null))) : e = ke, e;
42615
42615
  }
42616
42616
  function Yt(r6, e) {
42617
42617
  let t = Array.isArray(r6) ? r6 : r6.entry?.map((n) => n.resource) ?? [];
@@ -42624,20 +42624,20 @@ function Zt(r6, e) {
42624
42624
  n[r6.name] = t, e && r6.url === e && (Jt[e] = t);
42625
42625
  for (let i of t.innerTypes) i.parentType = t, n[i.name] = i;
42626
42626
  }
42627
- function an(r6) {
42627
+ function sn(r6) {
42628
42628
  return !!ke[r6];
42629
42629
  }
42630
42630
  function Ve(r6, e) {
42631
42631
  let t = Ht(e)[r6];
42632
42632
  return !t && e && (t = Ht()[r6]), t;
42633
42633
  }
42634
- function un(r6) {
42634
+ function cn(r6) {
42635
42635
  return !!Jt[r6];
42636
42636
  }
42637
42637
  var Qt = class {
42638
42638
  constructor(e) {
42639
42639
  if (!e.snapshot?.element || e.snapshot.element.length === 0) throw new Error(`No snapshot defined for StructureDefinition '${e.name}'`);
42640
- 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, title: e.title, type: e.type, url: e.url, kind: e.kind, description: Li(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
42640
+ 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, title: e.title, type: e.type, url: e.url, kind: e.kind, description: _i(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
42641
42641
  }
42642
42642
  parse() {
42643
42643
  let e = this.next();
@@ -42677,7 +42677,7 @@ var Qt = class {
42677
42677
  this.backboneContext = { type: { name: Kt(e), title: e.label, description: e.definition, elements: {}, constraints: this.parseElementDefinition(e).constraints, innerTypes: [] }, path: e.path ?? "", parent: ve(this.backboneContext?.path, e.path) ? this.backboneContext : this.backboneContext?.parent };
42678
42678
  }
42679
42679
  enterSlice(e, t) {
42680
- Fi(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
42680
+ Li(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
42681
42681
  if (n.type !== "value" && n.type !== "pattern" && n.type !== "type") throw new Error(`Unsupported slicing discriminator type: ${n.type}`);
42682
42682
  return { path: n.path, type: n.type };
42683
42683
  }), slices: [], ordered: e.slicing?.ordered ?? false, rule: e.slicing?.rules }, this.slicingContext = { field: t.slicing, path: e.path ?? "" });
@@ -42718,30 +42718,30 @@ var Qt = class {
42718
42718
  });
42719
42719
  }
42720
42720
  parseElementDefinition(e) {
42721
- let t = nn(e.max), n = e.base?.max ? nn(e.base.max) : t, i = { type: "ElementDefinition", value: e };
42722
- 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: on(C(i, "fixed[x]")), pattern: on(C(i, "pattern[x]")), binding: e.binding };
42721
+ let t = rn(e.max), n = e.base?.max ? rn(e.base.max) : t, i = { type: "ElementDefinition", value: e };
42722
+ 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: nn(C(i, "fixed[x]")), pattern: nn(C(i, "pattern[x]")), binding: e.binding };
42723
42723
  }
42724
42724
  };
42725
- function nn(r6) {
42725
+ function rn(r6) {
42726
42726
  return r6 === "*" ? Number.POSITIVE_INFINITY : Number.parseInt(r6, 10);
42727
42727
  }
42728
42728
  function Gt(r6, e = "") {
42729
- return Ni(r6.path, e);
42729
+ return Fi(r6.path, e);
42730
42730
  }
42731
- function Ni(r6, e) {
42731
+ function Fi(r6, e) {
42732
42732
  return r6 ? e && r6.startsWith(e) ? r6.substring(e.length + 1) : r6 : "";
42733
42733
  }
42734
42734
  function ve(r6, e) {
42735
42735
  return !r6 || !e ? false : e.startsWith(r6 + ".") || e === r6;
42736
42736
  }
42737
- function on(r6) {
42737
+ function nn(r6) {
42738
42738
  return Array.isArray(r6) && r6.length > 0 ? r6[0] : S(r6) ? void 0 : r6;
42739
42739
  }
42740
- function Fi(r6) {
42740
+ function Li(r6) {
42741
42741
  let e = r6.slicing?.discriminator;
42742
42742
  return !!(r6.type?.some((t) => t.code === "Extension") && e?.length === 1 && e[0].type === "value" && e[0].path === "url");
42743
42743
  }
42744
- function Li(r6) {
42744
+ function _i(r6) {
42745
42745
  let e = r6.description;
42746
42746
  return e?.startsWith(`Base StructureDefinition for ${r6.name} Type: `) && (e = e.substring(`Base StructureDefinition for ${r6.name} Type: `.length)), e;
42747
42747
  }
@@ -42752,7 +42752,7 @@ function d(r6) {
42752
42752
  function x(r6) {
42753
42753
  return r6 == null ? { type: "undefined", value: void 0 } : Number.isSafeInteger(r6) ? { type: l.integer, value: r6 } : typeof r6 == "number" ? { type: l.decimal, value: r6 } : typeof r6 == "boolean" ? { type: l.boolean, value: r6 } : typeof r6 == "string" ? { type: l.string, value: r6 } : k(r6) ? { type: l.Quantity, value: r6 } : I(r6) ? { type: r6.resourceType, value: r6 } : { type: l.BackboneElement, value: r6 };
42754
42754
  }
42755
- function _(r6) {
42755
+ function N(r6) {
42756
42756
  return r6.length === 0 ? false : !!r6[0].value;
42757
42757
  }
42758
42758
  function B(r6, e) {
@@ -42764,9 +42764,9 @@ function B(r6, e) {
42764
42764
  function C(r6, e, t) {
42765
42765
  if (!r6.value) return;
42766
42766
  let n = tt(r6.type, e, t?.profileUrl);
42767
- return n ? Ki(r6, e, n) : zi(r6, e);
42767
+ return n ? zi(r6, e, n) : Ji(r6, e);
42768
42768
  }
42769
- function Ki(r6, e, t) {
42769
+ function zi(r6, e, t) {
42770
42770
  let n = r6.value, i = t.type;
42771
42771
  if (!i || i.length === 0) return;
42772
42772
  let o, s = "undefined", a2;
@@ -42782,14 +42782,14 @@ function Ki(r6, e, t) {
42782
42782
  } else console.assert(i.length === 1, "Expected single type", t.path), o = n[e], s = i[0].code, a2 = n["_" + e];
42783
42783
  if (a2) if (Array.isArray(o)) {
42784
42784
  o = o.slice();
42785
- for (let c = 0; c < Math.max(o.length, a2.length); c++) o[c] = yn(o[c], a2[c]);
42786
- } else o = yn(o, a2);
42787
- if (!S(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((c) => dn(c, s)) : dn(o, s);
42785
+ for (let c = 0; c < Math.max(o.length, a2.length); c++) o[c] = hn(o[c], a2[c]);
42786
+ } else o = hn(o, a2);
42787
+ if (!S(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((c) => pn(c, s)) : pn(o, s);
42788
42788
  }
42789
- function dn(r6, e) {
42789
+ function pn(r6, e) {
42790
42790
  return e === "Resource" && I(r6) && (e = r6.resourceType), { type: e, value: r6 };
42791
42791
  }
42792
- function zi(r6, e) {
42792
+ function Ji(r6, e) {
42793
42793
  let t = r6.value;
42794
42794
  if (!t || typeof t != "object") return;
42795
42795
  let n;
@@ -42807,7 +42807,7 @@ function Xe(r6) {
42807
42807
  let e = [];
42808
42808
  for (let t of r6) {
42809
42809
  let n = false;
42810
- for (let i of e) if (_(gn(t, i))) {
42810
+ for (let i of e) if (N(or(t, i))) {
42811
42811
  n = true;
42812
42812
  break;
42813
42813
  }
@@ -42815,24 +42815,27 @@ function Xe(r6) {
42815
42815
  }
42816
42816
  return e;
42817
42817
  }
42818
- function or(r6) {
42819
- return d(!_(r6));
42820
- }
42821
- function sr(r6, e) {
42822
- return r6.length === 0 || e.length === 0 ? [] : r6.length !== e.length ? d(false) : d(r6.every((t, n) => _(gn(t, e[n]))));
42818
+ function yn(r6) {
42819
+ return d(!N(r6));
42823
42820
  }
42824
42821
  function gn(r6, e) {
42822
+ return r6.length === 0 || e.length === 0 ? [] : r6.length !== e.length ? d(false) : d(r6.every((t, n) => N(or(t, e[n]))));
42823
+ }
42824
+ function xn(r6, e) {
42825
+ return r6.length === 0 || e.length === 0 ? [] : r6.length !== e.length ? d(true) : d(r6.some((t, n) => !N(or(t, e[n]))));
42826
+ }
42827
+ function or(r6, e) {
42825
42828
  let t = r6.value?.valueOf(), n = e.value?.valueOf();
42826
- return typeof t == "number" && typeof n == "number" ? d(Math.abs(t - n) < 1e-8) : k(t) && k(n) ? d(Tn(t, n)) : d(typeof t == "object" && typeof n == "object" ? cr(r6, e) : t === n);
42829
+ return typeof t == "number" && typeof n == "number" ? d(Math.abs(t - n) < 1e-8) : k(t) && k(n) ? d(Sn(t, n)) : d(typeof t == "object" && typeof n == "object" ? ar(r6, e) : t === n);
42827
42830
  }
42828
- function ar(r6, e) {
42829
- return r6.length === 0 && e.length === 0 ? d(true) : r6.length !== e.length ? d(false) : (r6.sort(fn), e.sort(fn), d(r6.every((t, n) => _(Ji(t, e[n])))));
42831
+ function sr(r6, e) {
42832
+ return r6.length === 0 && e.length === 0 ? d(true) : r6.length !== e.length ? d(false) : (r6.sort(dn), e.sort(dn), d(r6.every((t, n) => N(Yi(t, e[n])))));
42830
42833
  }
42831
- function Ji(r6, e) {
42834
+ function Yi(r6, e) {
42832
42835
  let { type: t, value: n } = r6, { type: i, value: o } = e, s = n?.valueOf(), a2 = o?.valueOf();
42833
- return typeof s == "number" && typeof a2 == "number" ? d(Math.abs(s - a2) < 0.01) : k(s) && k(a2) ? d(Tn(s, a2)) : d(t === "Coding" && i === "Coding" ? typeof s != "object" || typeof a2 != "object" ? false : s.code === a2.code && s.system === a2.system : typeof s == "object" && typeof a2 == "object" ? cr({ ...s, id: void 0 }, { ...a2, id: void 0 }) : typeof s == "string" && typeof a2 == "string" ? s.toLowerCase() === a2.toLowerCase() : s === a2);
42836
+ return typeof s == "number" && typeof a2 == "number" ? d(Math.abs(s - a2) < 0.01) : k(s) && k(a2) ? d(Sn(s, a2)) : d(t === "Coding" && i === "Coding" ? typeof s != "object" || typeof a2 != "object" ? false : s.code === a2.code && s.system === a2.system : typeof s == "object" && typeof a2 == "object" ? ar({ ...s, id: void 0 }, { ...a2, id: void 0 }) : typeof s == "string" && typeof a2 == "string" ? s.toLowerCase() === a2.toLowerCase() : s === a2);
42834
42837
  }
42835
- function fn(r6, e) {
42838
+ function dn(r6, e) {
42836
42839
  let t = r6.value?.valueOf(), n = e.value?.valueOf();
42837
42840
  return typeof t == "number" && typeof n == "number" ? t - n : typeof t == "string" && typeof n == "string" ? t.localeCompare(n) : 0;
42838
42841
  }
@@ -42846,60 +42849,60 @@ function et(r6, e) {
42846
42849
  case "Integer":
42847
42850
  return typeof t == "number";
42848
42851
  case "Date":
42849
- return xn(t);
42852
+ return vn(t);
42850
42853
  case "DateTime":
42851
42854
  return Ze(t);
42852
42855
  case "Time":
42853
42856
  return typeof t == "string" && !!/^T\d/.exec(t);
42854
42857
  case "Period":
42855
- return vn(t);
42858
+ return Tn(t);
42856
42859
  case "Quantity":
42857
42860
  return k(t);
42858
42861
  default:
42859
42862
  return typeof t == "object" && t?.resourceType === e;
42860
42863
  }
42861
42864
  }
42862
- function xn(r6) {
42865
+ function vn(r6) {
42863
42866
  return typeof r6 == "string" && !!Ye.date.exec(r6);
42864
42867
  }
42865
42868
  function Ze(r6) {
42866
42869
  return typeof r6 == "string" && !!Ye.dateTime.exec(r6);
42867
42870
  }
42868
- function vn(r6) {
42871
+ function Tn(r6) {
42869
42872
  return !!(r6 && typeof r6 == "object" && ("start" in r6 && Ze(r6.start) || "end" in r6 && Ze(r6.end)));
42870
42873
  }
42871
42874
  function k(r6) {
42872
42875
  return !!(r6 && typeof r6 == "object" && "value" in r6 && typeof r6.value == "number");
42873
42876
  }
42874
- function Tn(r6, e) {
42877
+ function Sn(r6, e) {
42875
42878
  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);
42876
42879
  }
42877
- function cr(r6, e) {
42880
+ function ar(r6, e) {
42878
42881
  let t = Object.keys(r6), n = Object.keys(e);
42879
42882
  if (t.length !== n.length) return false;
42880
42883
  for (let i of t) {
42881
42884
  let o = r6[i], s = e[i];
42882
- if (hn(o) && hn(s)) {
42883
- if (!cr(o, s)) return false;
42885
+ if (mn(o) && mn(s)) {
42886
+ if (!ar(o, s)) return false;
42884
42887
  } else if (o !== s) return false;
42885
42888
  }
42886
42889
  return true;
42887
42890
  }
42888
- function hn(r6) {
42891
+ function mn(r6) {
42889
42892
  return r6 !== null && typeof r6 == "object";
42890
42893
  }
42891
- function yn(r6, e) {
42894
+ function hn(r6, e) {
42892
42895
  if (e) {
42893
42896
  if (typeof e != "object") throw new Error("Primitive extension must be an object");
42894
- return Yi(r6 ?? {}, e);
42897
+ return Zi(r6 ?? {}, e);
42895
42898
  }
42896
42899
  return r6;
42897
42900
  }
42898
- function Yi(r6, e) {
42901
+ function Zi(r6, e) {
42899
42902
  return delete e.__proto__, delete e.constructor, Object.assign(r6, e);
42900
42903
  }
42901
42904
  function te(r6) {
42902
- let e = ue(r6), t = Xi(r6);
42905
+ let e = ue(r6), t = eo(r6);
42903
42906
  return t === e ? { reference: e } : { reference: e, display: t };
42904
42907
  }
42905
42908
  function ue(r6) {
@@ -42908,16 +42911,16 @@ function ue(r6) {
42908
42911
  function Se(r6) {
42909
42912
  if (r6) return ce(r6) ? r6.reference.split("/")[1] : r6.id;
42910
42913
  }
42911
- function Zi(r6) {
42914
+ function Xi(r6) {
42912
42915
  return r6.resourceType === "Patient" || r6.resourceType === "Practitioner" || r6.resourceType === "RelatedPerson";
42913
42916
  }
42914
- function Xi(r6) {
42915
- if (Zi(r6)) {
42916
- let e = eo(r6);
42917
+ function eo(r6) {
42918
+ if (Xi(r6)) {
42919
+ let e = to(r6);
42917
42920
  if (e) return e;
42918
42921
  }
42919
42922
  if (r6.resourceType === "Device") {
42920
- let e = to(r6);
42923
+ let e = ro(r6);
42921
42924
  if (e) return e;
42922
42925
  }
42923
42926
  if (r6.resourceType === "MedicationRequest") {
@@ -42928,16 +42931,16 @@ function Xi(r6) {
42928
42931
  if ("name" in r6 && r6.name && typeof r6.name == "string") return r6.name;
42929
42932
  if ("code" in r6 && r6.code) {
42930
42933
  let e = r6.code;
42931
- if (Array.isArray(e) && (e = e[0]), po(e)) return rt(e);
42932
- if (fo(e)) return e.text;
42934
+ if (Array.isArray(e) && (e = e[0]), fo(e)) return rt(e);
42935
+ if (mo(e)) return e.text;
42933
42936
  }
42934
42937
  return ue(r6);
42935
42938
  }
42936
- function eo(r6) {
42939
+ function to(r6) {
42937
42940
  let e = r6.name;
42938
42941
  if (e && e.length > 0) return ot(e[0]);
42939
42942
  }
42940
- function to(r6) {
42943
+ function ro(r6) {
42941
42944
  let e = r6.deviceName;
42942
42945
  if (e && e.length > 0) return e[0].name;
42943
42946
  }
@@ -42958,13 +42961,13 @@ function X(r6, ...e) {
42958
42961
  for (let n = 0; n < e.length && t; n++) t = t?.extension?.find((i) => i.url === e[n]);
42959
42962
  return t;
42960
42963
  }
42961
- function Rn(r6, e) {
42962
- return JSON.stringify(r6, no, e ? 2 : void 0);
42964
+ function Pn(r6, e) {
42965
+ return JSON.stringify(r6, io, e ? 2 : void 0);
42963
42966
  }
42964
- function no(r6, e) {
42965
- return !io(r6) && S(e) ? void 0 : e;
42967
+ function io(r6, e) {
42968
+ return !oo(r6) && S(e) ? void 0 : e;
42966
42969
  }
42967
- function io(r6) {
42970
+ function oo(r6) {
42968
42971
  return !!/\d+$/.exec(r6);
42969
42972
  }
42970
42973
  function S(r6) {
@@ -42978,14 +42981,14 @@ function H(r6) {
42978
42981
  return e === "string" && r6 !== "" || e === "object" && ("length" in r6 && r6.length > 0 || Object.keys(r6).length > 0);
42979
42982
  }
42980
42983
  function ee(r6, e, t) {
42981
- return r6 === e || S(r6) && S(e) ? true : S(r6) || S(e) ? false : Array.isArray(r6) && Array.isArray(e) ? oo(r6, e) : Array.isArray(r6) || Array.isArray(e) ? false : b(r6) && b(e) ? so(r6, e, t) : (b(r6) || b(e), false);
42984
+ return r6 === e || S(r6) && S(e) ? true : S(r6) || S(e) ? false : Array.isArray(r6) && Array.isArray(e) ? so(r6, e) : Array.isArray(r6) || Array.isArray(e) ? false : b(r6) && b(e) ? ao(r6, e, t) : (b(r6) || b(e), false);
42982
42985
  }
42983
- function oo(r6, e) {
42986
+ function so(r6, e) {
42984
42987
  if (r6.length !== e.length) return false;
42985
42988
  for (let t = 0; t < r6.length; t++) if (!ee(r6[t], e[t])) return false;
42986
42989
  return true;
42987
42990
  }
42988
- function so(r6, e, t) {
42991
+ function ao(r6, e, t) {
42989
42992
  let n = /* @__PURE__ */ new Set();
42990
42993
  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"));
42991
42994
  for (let i of n) {
@@ -42997,29 +43000,29 @@ function so(r6, e, t) {
42997
43000
  function b(r6) {
42998
43001
  return r6 !== null && typeof r6 == "object";
42999
43002
  }
43000
- function Pn(r6) {
43001
- return r6.every(uo);
43002
- }
43003
- function uo(r6) {
43004
- return typeof r6 == "string";
43003
+ function Cn(r6) {
43004
+ return r6.every(lo);
43005
43005
  }
43006
43006
  function lo(r6) {
43007
- return b(r6) && "code" in r6 && typeof r6.code == "string";
43007
+ return typeof r6 == "string";
43008
43008
  }
43009
43009
  function po(r6) {
43010
- return b(r6) && "coding" in r6 && Array.isArray(r6.coding) && r6.coding.every(lo);
43010
+ return b(r6) && "code" in r6 && typeof r6.code == "string";
43011
43011
  }
43012
43012
  function fo(r6) {
43013
+ return b(r6) && "coding" in r6 && Array.isArray(r6.coding) && r6.coding.every(po);
43014
+ }
43015
+ function mo(r6) {
43013
43016
  return b(r6) && "text" in r6 && typeof r6.text == "string";
43014
43017
  }
43015
- var Cn = [];
43016
- for (let r6 = 0; r6 < 256; r6++) Cn.push(r6.toString(16).padStart(2, "0"));
43017
- function wn(r6) {
43018
+ var wn = [];
43019
+ for (let r6 = 0; r6 < 256; r6++) wn.push(r6.toString(16).padStart(2, "0"));
43020
+ function An(r6) {
43018
43021
  let e = new Uint8Array(r6), t = new Array(e.length);
43019
- for (let n = 0; n < e.length; n++) t[n] = Cn[e[n]];
43022
+ for (let n = 0; n < e.length; n++) t[n] = wn[e[n]];
43020
43023
  return t.join("");
43021
43024
  }
43022
- function An(r6) {
43025
+ function On(r6) {
43023
43026
  let e = new Uint8Array(r6), t = [];
43024
43027
  for (let n = 0; n < e.length; n++) t[n] = String.fromCharCode(e[n]);
43025
43028
  return window.btoa(t.join(""));
@@ -43027,30 +43030,30 @@ function An(r6) {
43027
43030
  function w(r6) {
43028
43031
  return r6 ? r6.charAt(0).toUpperCase() + r6.substring(1) : "";
43029
43032
  }
43030
- var pr = (r6) => new Promise((e) => {
43033
+ var lr = (r6) => new Promise((e) => {
43031
43034
  setTimeout(e, r6);
43032
43035
  });
43033
43036
  function it(r6) {
43034
43037
  return r6.sort((e, t) => e.localeCompare(t));
43035
43038
  }
43036
- function fr(r6) {
43039
+ function dr(r6) {
43037
43040
  return r6.endsWith("/") ? r6 : r6 + "/";
43038
43041
  }
43039
- function vo(r6) {
43042
+ function To(r6) {
43040
43043
  return r6.startsWith("/") ? r6.slice(1) : r6;
43041
43044
  }
43042
43045
  function j(r6, e) {
43043
- return new URL(vo(e), fr(r6.toString())).toString();
43046
+ return new URL(To(e), dr(r6.toString())).toString();
43044
43047
  }
43045
- function Vn(r6, e) {
43048
+ function Dn(r6, e) {
43046
43049
  return j(r6, e).toString().replace("http://", "ws://").replace("https://", "wss://");
43047
43050
  }
43048
- function Dn(r6) {
43051
+ function Mn(r6) {
43049
43052
  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();
43050
43053
  }
43051
- var To = /^(([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])$/;
43052
- function bu(r6) {
43053
- return To.test(r6);
43054
+ var So = /^(([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])$/;
43055
+ function Ru(r6) {
43056
+ return So.test(r6);
43054
43057
  }
43055
43058
  function ot(r6, e) {
43056
43059
  let t = [];
@@ -43063,33 +43066,33 @@ function ot(r6, e) {
43063
43066
  function rt(r6) {
43064
43067
  if (!r6) return "";
43065
43068
  let e = Re(r6.text);
43066
- return e || (r6.coding ? r6.coding.map((t) => Co(t)).join(", ") : "");
43069
+ return e || (r6.coding ? r6.coding.map((t) => wo(t)).join(", ") : "");
43067
43070
  }
43068
- function Co(r6) {
43071
+ function wo(r6) {
43069
43072
  return Re(r6?.display) ?? Re(r6?.code) ?? "";
43070
43073
  }
43071
43074
  function Re(r6) {
43072
43075
  return typeof r6 == "string" ? r6 : void 0;
43073
43076
  }
43074
43077
  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" };
43075
- function yr(r6) {
43078
+ function hr(r6) {
43076
43079
  for (let e of r6.base ?? []) {
43077
- let t = N.types[e];
43078
- t || (t = { searchParamsDetails: {} }, N.types[e] = t), t.searchParams || (t.searchParams = { _id: { base: [e], code: "_id", type: "token", expression: e + ".id" }, _lastUpdated: { base: [e], code: "_lastUpdated", type: "date", expression: e + ".meta.lastUpdated" }, _compartment: { base: [e], code: "_compartment", type: "reference", expression: e + ".meta.compartment" }, _profile: { base: [e], code: "_profile", type: "uri", expression: e + ".meta.profile" }, _security: { base: [e], code: "_security", type: "token", expression: e + ".meta.security" }, _source: { base: [e], code: "_source", type: "uri", expression: e + ".meta.source" }, _tag: { base: [e], code: "_tag", type: "token", expression: e + ".meta.tag" } }), t.searchParams[r6.code] = r6;
43080
+ let t = F.types[e];
43081
+ t || (t = { searchParamsDetails: {} }, F.types[e] = t), t.searchParams || (t.searchParams = { _id: { base: [e], code: "_id", type: "token", expression: e + ".id" }, _lastUpdated: { base: [e], code: "_lastUpdated", type: "date", expression: e + ".meta.lastUpdated" }, _compartment: { base: [e], code: "_compartment", type: "reference", expression: e + ".meta.compartment" }, _profile: { base: [e], code: "_profile", type: "uri", expression: e + ".meta.profile" }, _security: { base: [e], code: "_security", type: "token", expression: e + ".meta.security" }, _source: { base: [e], code: "_source", type: "uri", expression: e + ".meta.source" }, _tag: { base: [e], code: "_tag", type: "token", expression: e + ".meta.tag" } }), t.searchParams[r6.code] = r6;
43079
43082
  }
43080
43083
  }
43081
43084
  function Kt(r6) {
43082
43085
  let e = r6.type?.[0]?.code;
43083
- return e === "BackboneElement" || e === "Element" ? Io((r6.base?.path ?? r6.path)?.split(".")) : e;
43086
+ return e === "BackboneElement" || e === "Element" ? ko((r6.base?.path ?? r6.path)?.split(".")) : e;
43084
43087
  }
43085
- function Io(r6) {
43088
+ function ko(r6) {
43086
43089
  return r6.length === 1 ? r6[0] : r6.map(w).join("");
43087
43090
  }
43088
43091
  function tt(r6, e, t) {
43089
43092
  let n = Ve(r6, t);
43090
- if (n) return Mo(n.elements, e);
43093
+ if (n) return No(n.elements, e);
43091
43094
  }
43092
- function Mo(r6, e) {
43095
+ function No(r6, e) {
43093
43096
  let t = r6[e] ?? r6[e + "[x]"];
43094
43097
  if (t) return t;
43095
43098
  for (let n = 0; n < e.length; n++) {
@@ -43106,7 +43109,7 @@ function I(r6) {
43106
43109
  function ce(r6) {
43107
43110
  return !!(r6 && typeof r6 == "object" && "reference" in r6 && typeof r6.reference == "string");
43108
43111
  }
43109
- var N = { types: {} };
43112
+ var F = { types: {} };
43110
43113
  function Pe(r6) {
43111
43114
  if (r6.startsWith("T")) return r6 + "T00:00:00.000Z".substring(r6.length);
43112
43115
  if (r6.length <= 10) return r6;
@@ -43117,7 +43120,7 @@ function Pe(r6) {
43117
43120
  }
43118
43121
  }
43119
43122
  var Q = () => [];
43120
- var O = { empty: (r6, e) => d(e.length === 0 || e.every((t) => S(t.value))), hasValue: (r6, e) => d(e.length !== 0), exists: (r6, e, t) => t ? d(e.filter((n) => _(t.eval(r6, [n]))).length > 0) : d(e.length > 0 && e.every((n) => !S(n.value))), all: (r6, e, t) => d(e.every((n) => _(t.eval(r6, [n])))), allTrue: (r6, e) => {
43123
+ var O = { empty: (r6, e) => d(e.length === 0 || e.every((t) => S(t.value))), hasValue: (r6, e) => d(e.length !== 0), exists: (r6, e, t) => t ? d(e.filter((n) => N(t.eval(r6, [n]))).length > 0) : d(e.length > 0 && e.every((n) => !S(n.value))), all: (r6, e, t) => d(e.every((n) => N(t.eval(r6, [n])))), allTrue: (r6, e) => {
43121
43124
  for (let t of e) if (!t.value) return d(false);
43122
43125
  return d(true);
43123
43126
  }, anyTrue: (r6, e) => {
@@ -43140,7 +43143,7 @@ var O = { empty: (r6, e) => d(e.length === 0 || e.every((t) => S(t.value))), has
43140
43143
  let t = [];
43141
43144
  for (let n of e) t.some((i) => i.value === n.value) || t.push(n);
43142
43145
  return t;
43143
- }, isDistinct: (r6, e) => d(e.length === O.distinct(r6, e).length), where: (r6, e, t) => e.filter((n) => _(t.eval(r6, [n]))), select: (r6, e, t) => e.map((n) => t.eval(r6, [n])).flat(), repeat: Q, ofType: (r6, e, t) => e.filter((n) => n.type === t.name), single: (r6, e) => {
43146
+ }, isDistinct: (r6, e) => d(e.length === O.distinct(r6, e).length), where: (r6, e, t) => e.filter((n) => N(t.eval(r6, [n]))), select: (r6, e, t) => e.map((n) => t.eval(r6, [n])).flat(), repeat: Q, ofType: (r6, e, t) => e.filter((n) => n.type === t.name), single: (r6, e) => {
43144
43147
  if (e.length > 1) throw new Error("Expected input length one for single()");
43145
43148
  return e.length === 0 ? [] : e.slice(0, 1);
43146
43149
  }, first: (r6, e) => e.length === 0 ? [] : e.slice(0, 1), last: (r6, e) => e.length === 0 ? [] : e.slice(e.length - 1, e.length), tail: (r6, e) => e.length === 0 ? [] : e.slice(1, e.length), skip: (r6, e, t) => {
@@ -43172,7 +43175,7 @@ var O = { empty: (r6, e) => d(e.length === 0 || e.every((t) => S(t.value))), has
43172
43175
  }, htmlChecks: (r6, e, t) => [x(true)], iif: (r6, e, t, n, i) => {
43173
43176
  let o = t.eval(r6, e);
43174
43177
  if (o.length > 1 || o.length === 1 && typeof o[0].value != "boolean") throw new Error("Expected criterion to evaluate to a Boolean");
43175
- return _(o) ? n.eval(r6, e) : i ? i.eval(r6, e) : [];
43178
+ return N(o) ? n.eval(r6, e) : i ? i.eval(r6, e) : [];
43176
43179
  }, toBoolean: (r6, e) => {
43177
43180
  if (e.length === 0) return [];
43178
43181
  let [{ value: t }] = W(e, 1);
@@ -43216,10 +43219,10 @@ var O = { empty: (r6, e) => d(e.length === 0 || e.every((t) => S(t.value))), has
43216
43219
  if (n) return [{ type: l.time, value: Pe("T" + n[1]) }];
43217
43220
  }
43218
43221
  return [];
43219
- }, convertsToTime: (r6, e) => e.length === 0 ? [] : d(O.toTime(r6, e).length === 1), indexOf: (r6, e, t) => F((n, i) => n.indexOf(i), r6, e, t), substring: (r6, e, t, n) => F((i, o, s) => {
43222
+ }, convertsToTime: (r6, e) => e.length === 0 ? [] : d(O.toTime(r6, e).length === 1), indexOf: (r6, e, t) => L((n, i) => n.indexOf(i), r6, e, t), substring: (r6, e, t, n) => L((i, o, s) => {
43220
43223
  let a2 = o, c = s ? a2 + s : i.length;
43221
43224
  return a2 < 0 || a2 >= i.length ? void 0 : i.substring(a2, c);
43222
- }, r6, e, t, n), startsWith: (r6, e, t) => F((n, i) => n.startsWith(i), r6, e, t), endsWith: (r6, e, t) => F((n, i) => n.endsWith(i), r6, e, t), contains: (r6, e, t) => F((n, i) => n.includes(i), r6, e, t), upper: (r6, e) => F((t) => t.toUpperCase(), r6, e), lower: (r6, e) => F((t) => t.toLowerCase(), r6, e), replace: (r6, e, t, n) => F((i, o, s) => i.replaceAll(o, s), r6, e, t, n), matches: (r6, e, t) => F((n, i) => !!new RegExp(i).exec(n), r6, e, t), replaceMatches: (r6, e, t, n) => F((i, o, s) => i.replaceAll(o, s), r6, e, t, n), length: (r6, e) => F((t) => t.length, r6, e), toChars: (r6, e) => F((t) => t ? t.split("") : void 0, r6, e), encode: Q, decode: Q, escape: Q, unescape: Q, trim: Q, split: Q, join: (r6, e, t) => {
43225
+ }, r6, e, t, n), startsWith: (r6, e, t) => L((n, i) => n.startsWith(i), r6, e, t), endsWith: (r6, e, t) => L((n, i) => n.endsWith(i), r6, e, t), contains: (r6, e, t) => L((n, i) => n.includes(i), r6, e, t), upper: (r6, e) => L((t) => t.toUpperCase(), r6, e), lower: (r6, e) => L((t) => t.toLowerCase(), r6, e), replace: (r6, e, t, n) => L((i, o, s) => i.replaceAll(o, s), r6, e, t, n), matches: (r6, e, t) => L((n, i) => !!new RegExp(i).exec(n), r6, e, t), replaceMatches: (r6, e, t, n) => L((i, o, s) => i.replaceAll(o, s), r6, e, t, n), length: (r6, e) => L((t) => t.length, r6, e), toChars: (r6, e) => L((t) => t ? t.split("") : void 0, r6, e), encode: Q, decode: Q, escape: Q, unescape: Q, trim: Q, split: Q, join: (r6, e, t) => {
43223
43226
  let n = t?.eval(r6, de(r6))[0]?.value ?? "";
43224
43227
  if (typeof n != "string") throw new Error("Separator must be a string.");
43225
43228
  return [{ type: l.string, value: e.map((i) => i.value?.toString() ?? "").join(n) }];
@@ -43273,7 +43276,7 @@ var O = { empty: (r6, e) => d(e.length === 0 || e.every((t) => S(t.value))), has
43273
43276
  }
43274
43277
  return [];
43275
43278
  } };
43276
- function F(r6, e, t, ...n) {
43279
+ function L(r6, e, t, ...n) {
43277
43280
  if (t.length === 0) return [];
43278
43281
  let [{ value: i }] = W(t, 1);
43279
43282
  if (typeof i != "string") throw new Error("String function cannot be called with non-string");
@@ -43297,7 +43300,7 @@ function de(r6) {
43297
43300
  for (; e.parent?.variables.$this; ) e = e.parent;
43298
43301
  return [e.variables.$this];
43299
43302
  }
43300
- var L = class {
43303
+ var _ = class {
43301
43304
  constructor(e) {
43302
43305
  this.value = e;
43303
43306
  }
@@ -43430,7 +43433,7 @@ var dt = class extends P {
43430
43433
  }
43431
43434
  eval(e, t) {
43432
43435
  let n = this.left.eval(e, t), i = this.right.eval(e, t);
43433
- return sr(n, i);
43436
+ return gn(n, i);
43434
43437
  }
43435
43438
  };
43436
43439
  var ft = class extends P {
@@ -43439,7 +43442,7 @@ var ft = class extends P {
43439
43442
  }
43440
43443
  eval(e, t) {
43441
43444
  let n = this.left.eval(e, t), i = this.right.eval(e, t);
43442
- return or(sr(n, i));
43445
+ return xn(n, i);
43443
43446
  }
43444
43447
  };
43445
43448
  var mt = class extends P {
@@ -43448,7 +43451,7 @@ var mt = class extends P {
43448
43451
  }
43449
43452
  eval(e, t) {
43450
43453
  let n = this.left.eval(e, t), i = this.right.eval(e, t);
43451
- return ar(n, i);
43454
+ return sr(n, i);
43452
43455
  }
43453
43456
  };
43454
43457
  var ht = class extends P {
@@ -43457,7 +43460,7 @@ var ht = class extends P {
43457
43460
  }
43458
43461
  eval(e, t) {
43459
43462
  let n = this.left.eval(e, t), i = this.right.eval(e, t);
43460
- return or(ar(n, i));
43463
+ return yn(sr(n, i));
43461
43464
  }
43462
43465
  };
43463
43466
  var me = class extends P {
@@ -43540,48 +43543,48 @@ var he = class {
43540
43543
  };
43541
43544
  var Le = ["!=", "!~", "<=", ">=", "{}", "->"];
43542
43545
  var y = { FunctionCall: 0, Dot: 1, Indexer: 2, UnaryAdd: 3, UnarySubtract: 3, Multiply: 4, Divide: 4, IntegerDivide: 4, Modulo: 4, Add: 5, Subtract: 5, Ampersand: 5, Is: 6, As: 6, Union: 7, GreaterThan: 8, GreaterThanOrEquals: 8, LessThan: 8, LessThanOrEquals: 8, Equals: 9, Equivalent: 9, NotEquals: 9, NotEquivalent: 9, In: 10, Contains: 10, And: 11, Xor: 12, Or: 12, Implies: 13, Arrow: 100, Semicolon: 200 };
43543
- var Lo = { parse(r6) {
43546
+ var _o = { parse(r6) {
43544
43547
  let e = r6.consumeAndParse();
43545
43548
  if (!r6.match(")")) throw new Error("Parse error: expected `)` got `" + r6.peek()?.value + "`");
43546
43549
  return e;
43547
43550
  } };
43548
- var _o = { parse(r6, e) {
43551
+ var Uo = { parse(r6, e) {
43549
43552
  let t = r6.consumeAndParse();
43550
43553
  if (!r6.match("]")) throw new Error("Parse error: expected `]`");
43551
43554
  return new he(e, t);
43552
43555
  }, precedence: y.Indexer };
43553
- var Uo = { parse(r6, e) {
43556
+ var Bo = { parse(r6, e) {
43554
43557
  if (!(e instanceof U)) throw new Error("Unexpected parentheses");
43555
43558
  let t = [];
43556
43559
  for (; !r6.match(")"); ) t.push(r6.consumeAndParse()), r6.match(",");
43557
43560
  return new K(e.name, t);
43558
43561
  }, precedence: y.FunctionCall };
43559
- function Bo(r6) {
43562
+ function qo(r6) {
43560
43563
  let e = r6.split(" "), t = parseFloat(e[0]), n = e[1];
43561
43564
  return n?.startsWith("'") && n.endsWith("'") ? n = n.substring(1, n.length - 1) : n = "{" + n + "}", { value: t, unit: n };
43562
43565
  }
43563
43566
  function _e() {
43564
- return new He().registerPrefix("String", { parse: (r6, e) => new L({ type: l.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r6, e) => new L({ type: l.dateTime, value: Pe(e.value) }) }).registerPrefix("Quantity", { parse: (r6, e) => new L({ type: l.Quantity, value: Bo(e.value) }) }).registerPrefix("Number", { parse: (r6, e) => new L({ type: e.value.includes(".") ? l.decimal : l.integer, value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new L({ type: l.boolean, value: true }) }).registerPrefix("false", { parse: () => new L({ type: l.boolean, value: false }) }).registerPrefix("Symbol", { parse: (r6, e) => new U(e.value) }).registerPrefix("{}", { parse: () => new at() }).registerPrefix("(", Lo).registerInfix("[", _o).registerInfix("(", Uo).prefix("+", y.UnaryAdd, (r6, e) => new ct("+", e, (t) => t)).prefix("-", y.UnarySubtract, (r6, e) => new V("-", e, e, (t, n) => -n)).infixLeft(".", y.Dot, (r6, e, t) => new re(r6, t)).infixLeft("/", y.Divide, (r6, e, t) => new V("/", r6, t, (n, i) => n / i)).infixLeft("*", y.Multiply, (r6, e, t) => new V("*", r6, t, (n, i) => n * i)).infixLeft("+", y.Add, (r6, e, t) => new V("+", r6, t, (n, i) => n + i)).infixLeft("-", y.Subtract, (r6, e, t) => new V("-", r6, t, (n, i) => n - i)).infixLeft("|", y.Union, (r6, e, t) => new Ce(r6, t)).infixLeft("=", y.Equals, (r6, e, t) => new dt(r6, t)).infixLeft("!=", y.NotEquals, (r6, e, t) => new ft(r6, t)).infixLeft("~", y.Equivalent, (r6, e, t) => new mt(r6, t)).infixLeft("!~", y.NotEquivalent, (r6, e, t) => new ht(r6, t)).infixLeft("<", y.LessThan, (r6, e, t) => new V("<", r6, t, (n, i) => n < i)).infixLeft("<=", y.LessThanOrEquals, (r6, e, t) => new V("<=", r6, t, (n, i) => n <= i)).infixLeft(">", y.GreaterThan, (r6, e, t) => new V(">", r6, t, (n, i) => n > i)).infixLeft(">=", y.GreaterThanOrEquals, (r6, e, t) => new V(">=", r6, t, (n, i) => n >= i)).infixLeft("&", y.Ampersand, (r6, e, t) => new ut(r6, t)).infixLeft("and", y.And, (r6, e, t) => new yt(r6, t)).infixLeft("as", y.As, (r6, e, t) => new fe(r6, t)).infixLeft("contains", y.Contains, (r6, e, t) => new lt(r6, t)).infixLeft("div", y.Divide, (r6, e, t) => new V("div", r6, t, (n, i) => n / i | 0)).infixLeft("in", y.In, (r6, e, t) => new pt(r6, t)).infixLeft("is", y.Is, (r6, e, t) => new me(r6, t)).infixLeft("mod", y.Modulo, (r6, e, t) => new V("mod", r6, t, (n, i) => n % i)).infixLeft("or", y.Or, (r6, e, t) => new gt(r6, t)).infixLeft("xor", y.Xor, (r6, e, t) => new xt(r6, t)).infixLeft("implies", y.Implies, (r6, e, t) => new vt(r6, t));
43567
+ return new He().registerPrefix("String", { parse: (r6, e) => new _({ type: l.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r6, e) => new _({ type: l.dateTime, value: Pe(e.value) }) }).registerPrefix("Quantity", { parse: (r6, e) => new _({ type: l.Quantity, value: qo(e.value) }) }).registerPrefix("Number", { parse: (r6, e) => new _({ type: e.value.includes(".") ? l.decimal : l.integer, value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new _({ type: l.boolean, value: true }) }).registerPrefix("false", { parse: () => new _({ type: l.boolean, value: false }) }).registerPrefix("Symbol", { parse: (r6, e) => new U(e.value) }).registerPrefix("{}", { parse: () => new at() }).registerPrefix("(", _o).registerInfix("[", Uo).registerInfix("(", Bo).prefix("+", y.UnaryAdd, (r6, e) => new ct("+", e, (t) => t)).prefix("-", y.UnarySubtract, (r6, e) => new V("-", e, e, (t, n) => -n)).infixLeft(".", y.Dot, (r6, e, t) => new re(r6, t)).infixLeft("/", y.Divide, (r6, e, t) => new V("/", r6, t, (n, i) => n / i)).infixLeft("*", y.Multiply, (r6, e, t) => new V("*", r6, t, (n, i) => n * i)).infixLeft("+", y.Add, (r6, e, t) => new V("+", r6, t, (n, i) => n + i)).infixLeft("-", y.Subtract, (r6, e, t) => new V("-", r6, t, (n, i) => n - i)).infixLeft("|", y.Union, (r6, e, t) => new Ce(r6, t)).infixLeft("=", y.Equals, (r6, e, t) => new dt(r6, t)).infixLeft("!=", y.NotEquals, (r6, e, t) => new ft(r6, t)).infixLeft("~", y.Equivalent, (r6, e, t) => new mt(r6, t)).infixLeft("!~", y.NotEquivalent, (r6, e, t) => new ht(r6, t)).infixLeft("<", y.LessThan, (r6, e, t) => new V("<", r6, t, (n, i) => n < i)).infixLeft("<=", y.LessThanOrEquals, (r6, e, t) => new V("<=", r6, t, (n, i) => n <= i)).infixLeft(">", y.GreaterThan, (r6, e, t) => new V(">", r6, t, (n, i) => n > i)).infixLeft(">=", y.GreaterThanOrEquals, (r6, e, t) => new V(">=", r6, t, (n, i) => n >= i)).infixLeft("&", y.Ampersand, (r6, e, t) => new ut(r6, t)).infixLeft("and", y.And, (r6, e, t) => new yt(r6, t)).infixLeft("as", y.As, (r6, e, t) => new fe(r6, t)).infixLeft("contains", y.Contains, (r6, e, t) => new lt(r6, t)).infixLeft("div", y.Divide, (r6, e, t) => new V("div", r6, t, (n, i) => n / i | 0)).infixLeft("in", y.In, (r6, e, t) => new pt(r6, t)).infixLeft("is", y.Is, (r6, e, t) => new me(r6, t)).infixLeft("mod", y.Modulo, (r6, e, t) => new V("mod", r6, t, (n, i) => n % i)).infixLeft("or", y.Or, (r6, e, t) => new gt(r6, t)).infixLeft("xor", y.Xor, (r6, e, t) => new xt(r6, t)).infixLeft("implies", y.Implies, (r6, e, t) => new vt(r6, t));
43565
43568
  }
43566
- var qo = _e();
43567
- var _n = ((p2) => (p2.BOOLEAN = "BOOLEAN", p2.NUMBER = "NUMBER", p2.QUANTITY = "QUANTITY", p2.TEXT = "TEXT", p2.REFERENCE = "REFERENCE", p2.CANONICAL = "CANONICAL", p2.DATE = "DATE", p2.DATETIME = "DATETIME", p2.PERIOD = "PERIOD", p2.UUID = "UUID", p2))(_n || {});
43568
- var $n = ((T) => (T.EQUALS = "eq", T.NOT_EQUALS = "ne", T.GREATER_THAN = "gt", T.LESS_THAN = "lt", T.GREATER_THAN_OR_EQUALS = "ge", T.LESS_THAN_OR_EQUALS = "le", T.STARTS_AFTER = "sa", T.ENDS_BEFORE = "eb", T.APPROXIMATELY = "ap", T.CONTAINS = "contains", T.EXACT = "exact", T.TEXT = "text", T.NOT = "not", T.ABOVE = "above", T.BELOW = "below", T.IN = "in", T.NOT_IN = "not-in", T.OF_TYPE = "of-type", T.MISSING = "missing", T.PRESENT = "present", T.IDENTIFIER = "identifier", T.ITERATE = "iterate", T))($n || {});
43569
- var xs = ((E) => (E.READ = "read", E.VREAD = "vread", E.UPDATE = "update", E.PATCH = "patch", E.DELETE = "delete", E.HISTORY = "history", E.HISTORY_INSTANCE = "history-instance", E.HISTORY_TYPE = "history-type", E.HISTORY_SYSTEM = "history-system", E.CREATE = "create", E.SEARCH = "search", E.SEARCH_TYPE = "search-type", E.SEARCH_SYSTEM = "search-system", E.SEARCH_COMPARTMENT = "search-compartment", E.CAPABILITIES = "capabilities", E.TRANSACTION = "transaction", E.BATCH = "batch", E.OPERATION = "operation", E))(xs || {});
43570
- function Qn(r6) {
43569
+ var jo = _e();
43570
+ var Un = ((p2) => (p2.BOOLEAN = "BOOLEAN", p2.NUMBER = "NUMBER", p2.QUANTITY = "QUANTITY", p2.TEXT = "TEXT", p2.REFERENCE = "REFERENCE", p2.CANONICAL = "CANONICAL", p2.DATE = "DATE", p2.DATETIME = "DATETIME", p2.PERIOD = "PERIOD", p2.UUID = "UUID", p2))(Un || {});
43571
+ var Wn = ((T) => (T.EQUALS = "eq", T.NOT_EQUALS = "ne", T.GREATER_THAN = "gt", T.LESS_THAN = "lt", T.GREATER_THAN_OR_EQUALS = "ge", T.LESS_THAN_OR_EQUALS = "le", T.STARTS_AFTER = "sa", T.ENDS_BEFORE = "eb", T.APPROXIMATELY = "ap", T.CONTAINS = "contains", T.EXACT = "exact", T.TEXT = "text", T.NOT = "not", T.ABOVE = "above", T.BELOW = "below", T.IN = "in", T.NOT_IN = "not-in", T.OF_TYPE = "of-type", T.MISSING = "missing", T.PRESENT = "present", T.IDENTIFIER = "identifier", T.ITERATE = "iterate", T))(Wn || {});
43572
+ var vs = ((E) => (E.READ = "read", E.VREAD = "vread", E.UPDATE = "update", E.PATCH = "patch", E.DELETE = "delete", E.HISTORY = "history", E.HISTORY_INSTANCE = "history-instance", E.HISTORY_TYPE = "history-type", E.HISTORY_SYSTEM = "history-system", E.CREATE = "create", E.SEARCH = "search", E.SEARCH_TYPE = "search-type", E.SEARCH_SYSTEM = "search-system", E.SEARCH_COMPARTMENT = "search-compartment", E.CAPABILITIES = "capabilities", E.TRANSACTION = "transaction", E.BATCH = "batch", E.OPERATION = "operation", E))(vs || {});
43573
+ function Kn(r6) {
43571
43574
  if (typeof window < "u") return window.atob(r6);
43572
43575
  if (typeof Buffer < "u") return Buffer.from(r6, "base64").toString("binary");
43573
43576
  throw new Error("Unable to decode base64");
43574
43577
  }
43575
- function Kn(r6) {
43578
+ function zn(r6) {
43576
43579
  if (typeof window < "u") return window.btoa(r6);
43577
43580
  if (typeof Buffer < "u") return Buffer.from(r6, "binary").toString("base64");
43578
43581
  throw new Error("Unable to encode base64");
43579
43582
  }
43580
- function br() {
43583
+ function Er() {
43581
43584
  let r6 = new Uint32Array(28);
43582
- return crypto.getRandomValues(r6), wn(r6.buffer);
43585
+ return crypto.getRandomValues(r6), An(r6.buffer);
43583
43586
  }
43584
- async function zn(r6) {
43587
+ async function Jn(r6) {
43585
43588
  return crypto.subtle.digest("SHA-256", new TextEncoder().encode(r6));
43586
43589
  }
43587
43590
  function ye() {
@@ -43615,7 +43618,7 @@ var bt = class {
43615
43618
  }
43616
43619
  };
43617
43620
  var D = { CSS: "text/css", DICOM: "application/dicom", FAVICON: "image/vnd.microsoft.icon", FHIR_JSON: "application/fhir+json", FORM_URL_ENCODED: "application/x-www-form-urlencoded", HL7_V2: "x-application/hl7-v2+er7", HTML: "text/html", JAVASCRIPT: "text/javascript", JSON: "application/json", JSON_PATCH: "application/json-patch+json", PNG: "image/png", SCIM_JSON: "application/scim+json", SVG: "image/svg+xml", TEXT: "text/plain", TYPESCRIPT: "text/typescript", PING: "x-application/ping" };
43618
- var Rr = class {
43621
+ var br = class {
43619
43622
  constructor() {
43620
43623
  this.listeners = {};
43621
43624
  }
@@ -43642,7 +43645,7 @@ var Rr = class {
43642
43645
  };
43643
43646
  var z = class {
43644
43647
  constructor() {
43645
- this.emitter = new Rr();
43648
+ this.emitter = new br();
43646
43649
  }
43647
43650
  dispatchEvent(e) {
43648
43651
  this.emitter.dispatchEvent(e);
@@ -43657,71 +43660,71 @@ var z = class {
43657
43660
  this.emitter.removeAllListeners();
43658
43661
  }
43659
43662
  };
43660
- var Pr = { "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" };
43661
- var ws = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
43662
- var Cr = ["DiagnosticReport-update"];
43663
- function Zn(r6) {
43664
- return Cr.includes(r6);
43665
- }
43663
+ var Rr = { "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" };
43664
+ var As = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
43665
+ var Pr = ["DiagnosticReport-update"];
43666
43666
  function Xn(r6) {
43667
- if (Cr.includes(r6)) throw new f(h(`'context.version' is required for '${r6}'.`));
43668
- }
43669
- var As = { "Patient-open": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "Patient-close": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "ImagingStudy-open": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "ImagingStudy-close": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "Encounter-open": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "Encounter-close": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "DiagnosticReport-open": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-close": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-select": { report: { resourceType: "DiagnosticReport" }, select: { resourceType: "*", isArray: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport" }, patient: { resourceType: "Patient", optional: true }, study: { resourceType: "ImagingStudy", optional: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
43670
- function Os(r6) {
43671
- return ws.includes(r6);
43667
+ return Pr.includes(r6);
43672
43668
  }
43673
43669
  function ei(r6) {
43670
+ if (Pr.includes(r6)) throw new f(h(`'context.version' is required for '${r6}'.`));
43671
+ }
43672
+ var Os = { "Patient-open": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "Patient-close": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "ImagingStudy-open": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "ImagingStudy-close": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "Encounter-open": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "Encounter-close": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "DiagnosticReport-open": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-close": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-select": { report: { resourceType: "DiagnosticReport" }, select: { resourceType: "*", isArray: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport" }, patient: { resourceType: "Patient", optional: true }, study: { resourceType: "ImagingStudy", optional: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
43673
+ function Is(r6) {
43674
+ return As.includes(r6);
43675
+ }
43676
+ function ti(r6) {
43674
43677
  return !!r6.endpoint;
43675
43678
  }
43676
- function wr(r6) {
43679
+ function Cr(r6) {
43677
43680
  if (!Pt(r6)) throw new f(h("subscriptionRequest must be an object conforming to SubscriptionRequest type."));
43678
43681
  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(",") };
43679
- return ei(r6) && (o.endpoint = r6.endpoint), new URLSearchParams(o).toString();
43682
+ return ti(r6) && (o.endpoint = r6.endpoint), new URLSearchParams(o).toString();
43680
43683
  }
43681
43684
  function Pt(r6) {
43682
43685
  if (typeof r6 != "object") return false;
43683
43686
  let { channelType: e, mode: t, topic: n, events: i } = r6;
43684
43687
  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;
43685
- for (let o of i) if (!Pr[o]) return false;
43686
- return !(ei(r6) && !(typeof r6.endpoint == "string" && r6.endpoint.startsWith("ws")));
43688
+ for (let o of i) if (!Rr[o]) return false;
43689
+ return !(ti(r6) && !(typeof r6.endpoint == "string" && r6.endpoint.startsWith("ws")));
43687
43690
  }
43688
- function Yn(r6, e, t, n) {
43691
+ function Zn(r6, e, t, n) {
43689
43692
  if (typeof e != "object") throw new f(h(`context[${t}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));
43690
43693
  if (!(e.id && typeof e.id == "string")) throw new f(h(`context[${t}] is invalid. Resource must contain a valid string ID.`));
43691
43694
  if (!e.resourceType) throw new f(h(`context[${t}] is invalid. Resource must contain a resource type. No resource type found.`));
43692
43695
  let i = n.resourceType;
43693
43696
  if (i !== "*") {
43694
- if (!Os(e.resourceType)) throw new f(h(`context[${t}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));
43697
+ if (!Is(e.resourceType)) throw new f(h(`context[${t}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));
43695
43698
  if (i && e.resourceType !== i) throw new f(h(`context[${t}] is invalid. context[${t}] for the '${r6}' event should contain resource of type ${i}.`));
43696
43699
  }
43697
43700
  }
43698
- function Is(r6, e, t, n, i) {
43699
- if (i.set(e.key, (i.get(e.key) ?? 0) + 1), !n.isArray) Yn(r6, e.resource, t, n);
43701
+ function ks(r6, e, t, n, i) {
43702
+ if (i.set(e.key, (i.get(e.key) ?? 0) + 1), !n.isArray) Zn(r6, e.resource, t, n);
43700
43703
  else {
43701
43704
  let { resources: o } = e;
43702
43705
  if (!o) throw new f(h(`context[${t}] is invalid. context[${t}] for the '${r6}' with key '${String(e.key)}' should contain an array of resources on the key 'resources'.`));
43703
- for (let s of o) Yn(r6, s, t, n);
43706
+ for (let s of o) Zn(r6, s, t, n);
43704
43707
  }
43705
43708
  }
43706
- function ks(r6, e) {
43707
- let t = /* @__PURE__ */ new Map(), n = As[r6];
43709
+ function Vs(r6, e) {
43710
+ let t = /* @__PURE__ */ new Map(), n = Os[r6];
43708
43711
  for (let i = 0; i < e.length; i++) {
43709
43712
  let o = e[i].key;
43710
43713
  if (!n[o]) throw new f(h(`Key '${o}' not found for event '${r6}'. Make sure to add only valid keys.`));
43711
- Is(r6, e[i], i, n[o], t);
43714
+ ks(r6, e[i], i, n[o], t);
43712
43715
  }
43713
43716
  for (let [i, o] of Object.entries(n)) {
43714
43717
  if (!(o.optional || t.has(i))) throw new f(h(`Missing required key '${i}' on context for '${r6}' event.`));
43715
43718
  if (!o.manyAllowed && (t.get(i) || 0) > 1) throw new f(h(`${t.get(i)} context entries with key '${i}' found for the '${r6}' event when schema only allows for 1.`));
43716
43719
  }
43717
43720
  }
43718
- function Ar(r6, e, t, n) {
43721
+ function wr(r6, e, t, n) {
43719
43722
  if (!(r6 && typeof r6 == "string")) throw new f(h("Must provide a topic."));
43720
- if (!Pr[e]) throw new f(h(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Pr).join(", ")}`));
43723
+ if (!Rr[e]) throw new f(h(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Rr).join(", ")}`));
43721
43724
  if (typeof t != "object") throw new f(h("context must be a context object or array of context objects."));
43722
- if (Cr.includes(e) && !n) throw new f(h(`The '${e}' event must contain a 'context.versionId'.`));
43725
+ if (Pr.includes(e) && !n) throw new f(h(`The '${e}' event must contain a 'context.versionId'.`));
43723
43726
  let i = Array.isArray(t) ? t : [t];
43724
- return ks(e, i), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: ye(), event: { "hub.topic": r6, "hub.event": e, context: i, ...n ? { "context.versionId": n } : {} } };
43727
+ return Vs(e, i), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: ye(), event: { "hub.topic": r6, "hub.event": e, context: i, ...n ? { "context.versionId": n } : {} } };
43725
43728
  }
43726
43729
  var Rt = class extends z {
43727
43730
  constructor(e) {
@@ -43743,28 +43746,28 @@ var Rt = class extends z {
43743
43746
  this.websocket.close();
43744
43747
  }
43745
43748
  };
43746
- function Vs(r6) {
43747
- let e = r6.replace(/-/g, "+").replace(/_/g, "/"), t = Qn(e), n = Array.from(t).reduce((o, s) => {
43749
+ function Ds(r6) {
43750
+ let e = r6.replace(/-/g, "+").replace(/_/g, "/"), t = Kn(e), n = Array.from(t).reduce((o, s) => {
43748
43751
  let a2 = ("00" + s.charCodeAt(0).toString(16)).slice(-2);
43749
43752
  return `${o}%${a2}`;
43750
43753
  }, ""), i = decodeURIComponent(n);
43751
43754
  return JSON.parse(i);
43752
43755
  }
43753
- function ti(r6) {
43756
+ function ri(r6) {
43754
43757
  return r6.split(".").length === 3;
43755
43758
  }
43756
43759
  function Ct(r6) {
43757
43760
  let [e, t, n] = r6.split(".");
43758
- return Vs(t);
43761
+ return Ds(t);
43759
43762
  }
43760
- function ri(r6) {
43763
+ function ni(r6) {
43761
43764
  try {
43762
43765
  return typeof Ct(r6).login_id == "string";
43763
43766
  } catch {
43764
43767
  return false;
43765
43768
  }
43766
43769
  }
43767
- function ni(r6) {
43770
+ function ii(r6) {
43768
43771
  try {
43769
43772
  let t = Ct(r6).exp;
43770
43773
  return typeof t == "number" ? t * 1e3 : void 0;
@@ -43786,11 +43789,11 @@ var wt = class {
43786
43789
  await this.medplum.delete(`keyvalue/v1/${e}`);
43787
43790
  }
43788
43791
  };
43789
- var ii;
43790
- ii = Symbol.toStringTag;
43792
+ var oi;
43793
+ oi = Symbol.toStringTag;
43791
43794
  var M = class {
43792
43795
  constructor(e) {
43793
- this[ii] = "ReadablePromise";
43796
+ this[oi] = "ReadablePromise";
43794
43797
  this.status = "pending";
43795
43798
  this.suspender = e.then((t) => (this.status = "success", this.response = t, t), (t) => {
43796
43799
  throw this.status = "error", this.error = t, t;
@@ -43824,7 +43827,7 @@ var M = class {
43824
43827
  };
43825
43828
  var Be = class {
43826
43829
  constructor(e) {
43827
- this.storage = e ?? (typeof localStorage < "u" ? localStorage : new Or());
43830
+ this.storage = e ?? (typeof localStorage < "u" ? localStorage : new Ar());
43828
43831
  }
43829
43832
  clear() {
43830
43833
  this.storage.clear();
@@ -43840,10 +43843,10 @@ var Be = class {
43840
43843
  return t ? JSON.parse(t) : void 0;
43841
43844
  }
43842
43845
  setObject(e, t) {
43843
- this.setString(e, t ? Rn(t) : void 0);
43846
+ this.setString(e, t ? Pn(t) : void 0);
43844
43847
  }
43845
43848
  };
43846
- var Or = class {
43849
+ var Ar = class {
43847
43850
  constructor() {
43848
43851
  this.data = /* @__PURE__ */ new Map();
43849
43852
  }
@@ -43866,7 +43869,7 @@ var Or = class {
43866
43869
  return Array.from(this.data.keys())[e];
43867
43870
  }
43868
43871
  };
43869
- var Ir = class extends z {
43872
+ var Or = class extends z {
43870
43873
  constructor(t) {
43871
43874
  super();
43872
43875
  this.bufferedAmount = -1 / 0;
@@ -43919,7 +43922,7 @@ var qe = class extends z {
43919
43922
  this.criteria.delete(e);
43920
43923
  }
43921
43924
  };
43922
- var kr = class {
43925
+ var Ir = class {
43923
43926
  constructor(e, t) {
43924
43927
  this.criteria = e, this.emitter = new qe(e), this.refCount = 1, this.subscriptionProps = t ? { ...t } : void 0;
43925
43928
  }
@@ -43933,7 +43936,7 @@ var At = class {
43933
43936
  } catch {
43934
43937
  throw new f(h("Not a valid URL"));
43935
43938
  }
43936
- let o = n?.RobustWebSocket ? new n.RobustWebSocket(i) : new Ir(i);
43939
+ let o = n?.RobustWebSocket ? new n.RobustWebSocket(i) : new Or(i);
43937
43940
  this.medplum = e, this.ws = o, this.masterSubEmitter = new qe(), this.criteriaEntries = /* @__PURE__ */ new Map(), this.criteriaEntriesBySubscriptionId = /* @__PURE__ */ new Map(), this.wsClosed = false, this.setupWebSocketListeners();
43938
43941
  }
43939
43942
  setupWebSocketListeners() {
@@ -43959,7 +43962,7 @@ var At = class {
43959
43962
  for (let o of this.getAllCriteriaEmitters()) o.dispatchEvent(i);
43960
43963
  }
43961
43964
  }), e.addEventListener("error", () => {
43962
- let t = { type: "error", payload: new f(zr(new Error("WebSocket error"))) };
43965
+ let t = { type: "error", payload: new f(Kr(new Error("WebSocket error"))) };
43963
43966
  this.masterSubEmitter?.dispatchEvent(t);
43964
43967
  for (let n of this.getAllCriteriaEmitters()) n.dispatchEvent(t);
43965
43968
  }), e.addEventListener("close", () => {
@@ -44024,7 +44027,7 @@ var At = class {
44024
44027
  this.masterSubEmitter && this.masterSubEmitter._addCriteria(e);
44025
44028
  let n = this.maybeGetCriteriaEntry(e, t);
44026
44029
  if (n) return n.refCount += 1, n.emitter;
44027
- let i = new kr(e, t);
44030
+ let i = new Ir(e, t);
44028
44031
  return this.addCriteriaEntry(i), this.getTokenForCriteria(i).then(([o, s]) => {
44029
44032
  i.subscriptionId = o, i.token = s, this.criteriaEntriesBySubscriptionId.set(o, i), this.emitConnect(i), this.ws.send(JSON.stringify({ type: "bind-with-token", payload: { token: s } }));
44030
44033
  }).catch((o) => {
@@ -44049,24 +44052,24 @@ var At = class {
44049
44052
  return this.masterSubEmitter || (this.masterSubEmitter = new qe(...Array.from(this.criteriaEntries.keys()))), this.masterSubEmitter;
44050
44053
  }
44051
44054
  };
44052
- var ld = "3.2.1-e374fc0fb";
44053
- var Ns = D.FHIR_JSON + ", */*; q=0.1";
44054
- var Fs = "https://api.medplum.com/";
44055
- var Ls = 1e3;
44056
- var _s = 6e4;
44057
- var Us = 0;
44058
- var Bs = "Binary/";
44059
- var si = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
44060
- var qs = ((o) => (o.ClientCredentials = "client_credentials", o.AuthorizationCode = "authorization_code", o.RefreshToken = "refresh_token", o.JwtBearer = "urn:ietf:params:oauth:grant-type:jwt-bearer", o.TokenExchange = "urn:ietf:params:oauth:grant-type:token-exchange", o))(qs || {});
44061
- var js = ((o) => (o.AccessToken = "urn:ietf:params:oauth:token-type:access_token", o.RefreshToken = "urn:ietf:params:oauth:token-type:refresh_token", o.IdToken = "urn:ietf:params:oauth:token-type:id_token", o.Saml1Token = "urn:ietf:params:oauth:token-type:saml1", o.Saml2Token = "urn:ietf:params:oauth:token-type:saml2", o))(js || {});
44062
- var $s = ((o) => (o.ClientSecretBasic = "client_secret_basic", o.ClientSecretPost = "client_secret_post", o.ClientSecretJwt = "client_secret_jwt", o.PrivateKeyJwt = "private_key_jwt", o.None = "none", o))($s || {});
44063
- var Ws = ((e) => (e.JwtBearer = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", e))(Ws || {});
44055
+ var fd = "3.2.2-14a39532e";
44056
+ var Fs = D.FHIR_JSON + ", */*; q=0.1";
44057
+ var Ls = "https://api.medplum.com/";
44058
+ var _s = 1e3;
44059
+ var Us = 6e4;
44060
+ var Bs = 0;
44061
+ var qs = "Binary/";
44062
+ var ai = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
44063
+ var js = ((o) => (o.ClientCredentials = "client_credentials", o.AuthorizationCode = "authorization_code", o.RefreshToken = "refresh_token", o.JwtBearer = "urn:ietf:params:oauth:grant-type:jwt-bearer", o.TokenExchange = "urn:ietf:params:oauth:grant-type:token-exchange", o))(js || {});
44064
+ var $s = ((o) => (o.AccessToken = "urn:ietf:params:oauth:token-type:access_token", o.RefreshToken = "urn:ietf:params:oauth:token-type:refresh_token", o.IdToken = "urn:ietf:params:oauth:token-type:id_token", o.Saml1Token = "urn:ietf:params:oauth:token-type:saml1", o.Saml2Token = "urn:ietf:params:oauth:token-type:saml2", o))($s || {});
44065
+ var Ws = ((o) => (o.ClientSecretBasic = "client_secret_basic", o.ClientSecretPost = "client_secret_post", o.ClientSecretJwt = "client_secret_jwt", o.PrivateKeyJwt = "private_key_jwt", o.None = "none", o))(Ws || {});
44066
+ var Gs = ((e) => (e.JwtBearer = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", e))(Gs || {});
44064
44067
  var Ot = class extends z {
44065
44068
  constructor(t) {
44066
44069
  super();
44067
44070
  this.initComplete = true;
44068
44071
  if (t?.baseUrl && !t.baseUrl.startsWith("http")) throw new Error("Base URL must start with http or https");
44069
- this.options = t ?? {}, this.fetch = t?.fetch ?? Gs(), this.storage = t?.storage ?? new Be(), this.createPdfImpl = t?.createPdf, this.baseUrl = fr(t?.baseUrl ?? Fs), 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.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.onUnauthenticated = t?.onUnauthenticated, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? Us : _s), this.cacheTime > 0 ? this.requestCache = new bt(t?.resourceCacheSize ?? Ls) : 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(() => {
44072
+ this.options = t ?? {}, this.fetch = t?.fetch ?? Hs(), this.storage = t?.storage ?? new Be(), this.createPdfImpl = t?.createPdf, this.baseUrl = dr(t?.baseUrl ?? Ls), 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.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.onUnauthenticated = t?.onUnauthenticated, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? Bs : Us), this.cacheTime > 0 ? this.requestCache = new bt(t?.resourceCacheSize ?? _s) : 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(() => {
44070
44073
  t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initComplete = true, this.dispatchEvent({ type: "storageInitialized" });
44071
44074
  }).catch((n) => {
44072
44075
  console.error(n), this.initComplete = true, this.dispatchEvent({ type: "storageInitFailed", payload: { error: n } });
@@ -44190,7 +44193,7 @@ var Ot = class extends z {
44190
44193
  }
44191
44194
  fhirSearchUrl(t, n) {
44192
44195
  let i = this.fhirUrl(t);
44193
- return n && (i.search = Dn(n)), i;
44196
+ return n && (i.search = Mn(n)), i;
44194
44197
  }
44195
44198
  search(t, n, i) {
44196
44199
  let o = this.fhirSearchUrl(t, n), s = "search-" + o.toString(), a2 = this.getCacheEntry(s, i);
@@ -44213,7 +44216,7 @@ var Ot = class extends z {
44213
44216
  searchResources(t, n, i) {
44214
44217
  let s = "searchResources-" + this.fhirSearchUrl(t, n).toString(), a2 = this.getCacheEntry(s, i);
44215
44218
  if (a2) return a2.value;
44216
- let c = new M(this.search(t, n, i).then(Vr));
44219
+ let c = new M(this.search(t, n, i).then(kr));
44217
44220
  return this.setCacheEntry(s, c), c;
44218
44221
  }
44219
44222
  async *searchResourcePages(t, n, i) {
@@ -44221,7 +44224,7 @@ var Ot = class extends z {
44221
44224
  for (; o; ) {
44222
44225
  let s = new URL(o).searchParams, a2 = await this.search(t, s, i), c = a2.link?.find((u2) => u2.relation === "next");
44223
44226
  if (!a2.entry?.length && !c) break;
44224
- yield Vr(a2), o = c?.url ? new URL(c.url) : void 0;
44227
+ yield kr(a2), o = c?.url ? new URL(c.url) : void 0;
44225
44228
  }
44226
44229
  }
44227
44230
  searchValueSet(t, n, i) {
@@ -44238,7 +44241,7 @@ var Ot = class extends z {
44238
44241
  getCachedReference(t) {
44239
44242
  let n = t.reference;
44240
44243
  if (!n) return;
44241
- if (n === "system") return si;
44244
+ if (n === "system") return ai;
44242
44245
  let [i, o] = n.split("/");
44243
44246
  if (!(!i || !o)) return this.getCached(i, o);
44244
44247
  }
@@ -44248,12 +44251,12 @@ var Ot = class extends z {
44248
44251
  readReference(t, n) {
44249
44252
  let i = t.reference;
44250
44253
  if (!i) return new M(Promise.reject(new Error("Missing reference")));
44251
- if (i === "system") return new M(Promise.resolve(si));
44254
+ if (i === "system") return new M(Promise.resolve(ai));
44252
44255
  let [o, s] = i.split("/");
44253
44256
  return !o || !s ? new M(Promise.reject(new Error("Invalid reference"))) : this.readResource(o, s, n);
44254
44257
  }
44255
44258
  requestSchema(t) {
44256
- if (an(t)) return Promise.resolve();
44259
+ if (sn(t)) return Promise.resolve();
44257
44260
  let n = t + "-requestSchema", i = this.getCacheEntry(n, void 0);
44258
44261
  if (i) return i.value;
44259
44262
  let o = new M((async () => {
@@ -44298,12 +44301,12 @@ var Ot = class extends z {
44298
44301
  }
44299
44302
  }`.replace(/\s+/g, " "), a2 = await this.graphql(s);
44300
44303
  Yt(a2.data.StructureDefinitionList);
44301
- for (let c of a2.data.SearchParameterList) yr(c);
44304
+ for (let c of a2.data.SearchParameterList) hr(c);
44302
44305
  })());
44303
44306
  return this.setCacheEntry(n, o), o;
44304
44307
  }
44305
44308
  requestProfileSchema(t, n) {
44306
- if (!n?.expandProfile && un(t)) return Promise.resolve([t]);
44309
+ if (!n?.expandProfile && cn(t)) return Promise.resolve([t]);
44307
44310
  let i = t + "-requestSchema" + (n?.expandProfile ? "-nested" : ""), o = this.getCacheEntry(i, void 0);
44308
44311
  if (o) return o.value;
44309
44312
  let s = new M((async () => {
@@ -44311,7 +44314,7 @@ var Ot = class extends z {
44311
44314
  let a2 = this.fhirUrl("StructureDefinition", "$expand-profile");
44312
44315
  a2.search = new URLSearchParams({ url: t }).toString();
44313
44316
  let c = await this.post(a2.toString(), {});
44314
- return Vr(c).map((u2) => (Zt(u2, u2.url), u2.url));
44317
+ return kr(c).map((u2) => (Zt(u2, u2.url), u2.url));
44315
44318
  } else {
44316
44319
  let a2 = await this.searchOne("StructureDefinition", { url: t, _sort: "-_lastUpdated" });
44317
44320
  return a2 ? (Yt([a2], t), [t]) : (console.warn(`No StructureDefinition found for ${t}!`), []);
@@ -44340,11 +44343,11 @@ var Ot = class extends z {
44340
44343
  return s || (s = t), this.cacheResource(s), this.invalidateUrl(this.fhirUrl(t.resourceType, t.id, "_history")), this.invalidateSearches(t.resourceType), s;
44341
44344
  }
44342
44345
  async createAttachment(t, n, i, o, s) {
44343
- let a2 = ui(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), u2 = await this.createBinary(a2, c);
44346
+ let a2 = li(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), u2 = await this.createBinary(a2, c);
44344
44347
  return { contentType: a2.contentType, url: u2.url, title: a2.filename };
44345
44348
  }
44346
44349
  createBinary(t, n, i, o, s) {
44347
- let a2 = ui(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: p2, filename: m2, securityContext: g, onProgress: G } = a2, Ie = this.fhirUrl("Binary");
44350
+ let a2 = li(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: p2, filename: m2, securityContext: g, onProgress: G } = a2, Ie = this.fhirUrl("Binary");
44348
44351
  return m2 && Ie.searchParams.set("_filename", m2), g?.reference && this.setRequestHeader(c, "X-Security-Context", g.reference), G ? this.uploadwithProgress(Ie, u2, p2, G, c) : this.post(Ie, u2, p2, c);
44349
44352
  }
44350
44353
  uploadwithProgress(t, n, i, o, s) {
@@ -44365,7 +44368,7 @@ var Ot = class extends z {
44365
44368
  }
44366
44369
  async createPdf(t, n, i, o) {
44367
44370
  if (!this.createPdfImpl) throw new Error("PDF creation not enabled");
44368
- let s = Ks(t, n, i, o), a2 = typeof n == "object" ? n : {}, { docDefinition: c, tableLayouts: u2, fonts: p2, ...m2 } = s, g = await this.createPdfImpl(c, u2, p2), G = { ...m2, data: g, contentType: "application/pdf" };
44371
+ let s = zs(t, n, i, o), a2 = typeof n == "object" ? n : {}, { docDefinition: c, tableLayouts: u2, fonts: p2, ...m2 } = s, g = await this.createPdfImpl(c, u2, p2), G = { ...m2, data: g, contentType: "application/pdf" };
44369
44372
  return this.createBinary(G, a2);
44370
44373
  }
44371
44374
  createComment(t, n, i) {
@@ -44423,7 +44426,7 @@ var Ot = class extends z {
44423
44426
  return this.accessToken;
44424
44427
  }
44425
44428
  setAccessToken(t, n) {
44426
- this.accessToken = t, this.refreshToken = n, this.sessionDetails = void 0, this.accessTokenExpires = ni(t), this.medplumServer = ri(t);
44429
+ this.accessToken = t, this.refreshToken = n, this.sessionDetails = void 0, this.accessTokenExpires = ii(t), this.medplumServer = ni(t);
44427
44430
  }
44428
44431
  getLogins() {
44429
44432
  return this.storage.getObject("logins") ?? [];
@@ -44471,7 +44474,7 @@ var Ot = class extends z {
44471
44474
  async download(t, n = {}) {
44472
44475
  this.refreshPromise && await this.refreshPromise;
44473
44476
  let i = t.toString();
44474
- i.startsWith(Bs) && (t = this.fhirUrl(i));
44477
+ i.startsWith(qs) && (t = this.fhirUrl(i));
44475
44478
  let o = n.headers;
44476
44479
  return o || (o = {}, n.headers = o), o.Accept || (o.Accept = "*/*"), this.addFetchOptionsDefaults(n), (await this.fetchWithRetry(t.toString(), n)).blob();
44477
44480
  }
@@ -44516,14 +44519,14 @@ var Ot = class extends z {
44516
44519
  if (s.status === 401) return this.handleUnauthenticated(t, n, i);
44517
44520
  if (s.status === 204 || s.status === 304) return;
44518
44521
  let c = s.headers.get("content-type")?.includes("json");
44519
- if (s.status === 404 && !c) throw new f(Kr);
44522
+ if (s.status === 404 && !c) throw new f(Qr);
44520
44523
  let u2 = await this.parseBody(s, c);
44521
44524
  if (s.status === 200 && i.followRedirectOnOk || s.status === 201 && i.followRedirectOnCreated) {
44522
- let p2 = await ci(s, u2);
44525
+ let p2 = await ui(s, u2);
44523
44526
  if (p2) return this.request("GET", p2, { ...i, body: void 0 });
44524
44527
  }
44525
44528
  if (s.status === 202 && i.pollStatusOnAccepted) {
44526
- let m2 = await ci(s, u2) ?? o.statusUrl;
44529
+ let m2 = await ui(s, u2) ?? o.statusUrl;
44527
44530
  if (m2) return this.pollStatus(m2, i, o);
44528
44531
  }
44529
44532
  if (s.status >= 400) throw new f(ze(u2));
@@ -44550,7 +44553,7 @@ var Ot = class extends z {
44550
44553
  } catch (a2) {
44551
44554
  if (a2.message === "Failed to fetch" && s === 0 && this.dispatchEvent({ type: "offline" }), a2.name === "AbortError" || s === i) throw a2;
44552
44555
  }
44553
- await pr(o);
44556
+ await lr(o);
44554
44557
  }
44555
44558
  throw new Error("Unreachable");
44556
44559
  }
@@ -44568,7 +44571,7 @@ var Ot = class extends z {
44568
44571
  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;
44569
44572
  else {
44570
44573
  let s = n.pollStatusPeriod ?? 1e3;
44571
- await pr(s), i.pollCount++;
44574
+ await lr(s), i.pollCount++;
44572
44575
  }
44573
44576
  return this.request("GET", t, o, i);
44574
44577
  }
@@ -44590,7 +44593,7 @@ var Ot = class extends z {
44590
44593
  }
44591
44594
  }
44592
44595
  addFetchOptionsDefaults(t) {
44593
- this.setRequestHeader(t, "X-Medplum", "extended"), this.setRequestHeader(t, "Accept", Ns, true), t.body && this.setRequestHeader(t, "Content-Type", D.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");
44596
+ this.setRequestHeader(t, "X-Medplum", "extended"), this.setRequestHeader(t, "Accept", Fs, true), t.body && this.setRequestHeader(t, "Content-Type", D.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");
44594
44597
  }
44595
44598
  setRequestContentType(t, n) {
44596
44599
  this.setRequestHeader(t, "Content-Type", n);
@@ -44607,20 +44610,20 @@ var Ot = class extends z {
44607
44610
  return this.refresh() ? this.request(t, n, i) : (this.clear(), this.onUnauthenticated && this.onUnauthenticated(), Promise.reject(new Error("Unauthenticated")));
44608
44611
  }
44609
44612
  async startPkce() {
44610
- let t = br();
44613
+ let t = Er();
44611
44614
  sessionStorage.setItem("pkceState", t);
44612
- let n = br();
44615
+ let n = Er();
44613
44616
  sessionStorage.setItem("codeVerifier", n);
44614
- let i = await zn(n), o = An(i).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
44617
+ let i = await Jn(n), o = On(i).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
44615
44618
  return sessionStorage.setItem("codeChallenge", o), { codeChallengeMethod: "S256", codeChallenge: o };
44616
44619
  }
44617
44620
  async requestAuthorization(t) {
44618
44621
  let n = await this.ensureCodeChallenge(t ?? {}), i = new URL(this.authorizeUrl);
44619
- 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 ?? ai()), i.searchParams.set("code_challenge_method", n.codeChallengeMethod), i.searchParams.set("code_challenge", n.codeChallenge), i.searchParams.set("scope", n.scope ?? "openid profile"), window.location.assign(i.toString());
44622
+ 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 ?? ci()), i.searchParams.set("code_challenge_method", n.codeChallengeMethod), i.searchParams.set("code_challenge", n.codeChallenge), i.searchParams.set("scope", n.scope ?? "openid profile"), window.location.assign(i.toString());
44620
44623
  }
44621
44624
  processCode(t, n) {
44622
44625
  let i = new URLSearchParams();
44623
- if (i.set("grant_type", "authorization_code"), i.set("code", t), i.set("client_id", n?.clientId ?? this.clientId), i.set("redirect_uri", n?.redirectUri ?? ai()), typeof sessionStorage < "u") {
44626
+ if (i.set("grant_type", "authorization_code"), i.set("code", t), i.set("client_id", n?.clientId ?? this.clientId), i.set("redirect_uri", n?.redirectUri ?? ci()), typeof sessionStorage < "u") {
44624
44627
  let o = sessionStorage.getItem("codeVerifier");
44625
44628
  o && i.set("code_verifier", o);
44626
44629
  }
@@ -44652,25 +44655,25 @@ var Ot = class extends z {
44652
44655
  return n.append("grant_type", "client_credentials"), n.append("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.append("client_assertion", t), this.fetchTokens(n);
44653
44656
  }
44654
44657
  setBasicAuth(t, n) {
44655
- this.clientId = t, this.clientSecret = n, this.basicAuth = Kn(t + ":" + n);
44658
+ this.clientId = t, this.clientSecret = n, this.basicAuth = zn(t + ":" + n);
44656
44659
  }
44657
44660
  async fhircastSubscribe(t, n) {
44658
44661
  if (!(typeof t == "string" && t !== "")) throw new f(h("Invalid topic provided. Topic must be a valid string."));
44659
44662
  if (!(typeof n == "object" && Array.isArray(n) && n.length > 0)) throw new f(h("Invalid events provided. Events must be an array of event names containing at least one event."));
44660
- let i = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post("/fhircast/STU3", wr(i), D.FORM_URL_ENCODED))["hub.channel.endpoint"];
44663
+ let i = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post("/fhircast/STU3", Cr(i), D.FORM_URL_ENCODED))["hub.channel.endpoint"];
44661
44664
  if (!s) throw new Error("Invalid response!");
44662
44665
  return i.endpoint = s, i;
44663
44666
  }
44664
44667
  async fhircastUnsubscribe(t) {
44665
44668
  if (!Pt(t)) throw new f(h("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));
44666
44669
  if (!(t.endpoint && typeof t.endpoint == "string" && t.endpoint.startsWith("ws"))) throw new f(h("Provided subscription request must have an endpoint in order to unsubscribe."));
44667
- t.mode = "unsubscribe", await this.post("/fhircast/STU3", wr(t), D.FORM_URL_ENCODED);
44670
+ t.mode = "unsubscribe", await this.post("/fhircast/STU3", Cr(t), D.FORM_URL_ENCODED);
44668
44671
  }
44669
44672
  fhircastConnect(t) {
44670
44673
  return new Rt(t);
44671
44674
  }
44672
44675
  async fhircastPublish(t, n, i, o) {
44673
- return Zn(n) ? this.post(`/fhircast/STU3/${t}`, Ar(t, n, i, o), D.JSON) : (Xn(n), this.post(`/fhircast/STU3/${t}`, Ar(t, n, i), D.JSON));
44676
+ return Xn(n) ? this.post(`/fhircast/STU3/${t}`, wr(t, n, i, o), D.JSON) : (ei(n), this.post(`/fhircast/STU3/${t}`, wr(t, n, i), D.JSON));
44674
44677
  }
44675
44678
  async fhircastGetContext(t) {
44676
44679
  return this.get(`/fhircast/STU3/${t}`);
@@ -44701,7 +44704,7 @@ var Ot = class extends z {
44701
44704
  }
44702
44705
  async verifyTokens(t) {
44703
44706
  let n = t.access_token;
44704
- if (ti(n)) {
44707
+ if (ri(n)) {
44705
44708
  let i = Ct(n);
44706
44709
  if (Date.now() >= i.exp * 1e3) throw this.clearActiveLogin(), new Error("Token expired");
44707
44710
  if (i.cid) {
@@ -44719,7 +44722,7 @@ var Ot = class extends z {
44719
44722
  }
44720
44723
  }
44721
44724
  getSubscriptionManager() {
44722
- return this.subscriptionManager || (this.subscriptionManager = new At(this, Vn(this.baseUrl, "/ws/subscriptions-r4"))), this.subscriptionManager;
44725
+ return this.subscriptionManager || (this.subscriptionManager = new At(this, Dn(this.baseUrl, "/ws/subscriptions-r4"))), this.subscriptionManager;
44723
44726
  }
44724
44727
  subscribeToCriteria(t, n) {
44725
44728
  return this.getSubscriptionManager().addCriteria(t, n);
@@ -44731,40 +44734,40 @@ var Ot = class extends z {
44731
44734
  return this.getSubscriptionManager().getMasterEmitter();
44732
44735
  }
44733
44736
  };
44734
- function Gs() {
44737
+ function Hs() {
44735
44738
  if (!globalThis.fetch) throw new Error("Fetch not available in this environment");
44736
44739
  return globalThis.fetch.bind(globalThis);
44737
44740
  }
44738
- function ai() {
44741
+ function ci() {
44739
44742
  return typeof window > "u" ? "" : window.location.protocol + "//" + window.location.host + "/";
44740
44743
  }
44741
- async function ci(r6, e) {
44744
+ async function ui(r6, e) {
44742
44745
  let t = r6.headers.get("content-location");
44743
44746
  if (t) return t;
44744
44747
  let n = r6.headers.get("location");
44745
44748
  if (n) return n;
44746
44749
  if (xe(e) && e.issue?.[0]?.diagnostics) return e.issue[0].diagnostics;
44747
44750
  }
44748
- function Vr(r6) {
44751
+ function kr(r6) {
44749
44752
  let e = r6.entry?.map((t) => t.resource) ?? [];
44750
44753
  return Object.assign(e, { bundle: r6 });
44751
44754
  }
44752
- function Hs(r6) {
44755
+ function Qs(r6) {
44753
44756
  return b(r6) && "data" in r6 && "contentType" in r6;
44754
44757
  }
44755
- function ui(r6, e, t, n) {
44756
- return Hs(r6) ? r6 : { data: r6, filename: e, contentType: t, onProgress: n };
44758
+ function li(r6, e, t, n) {
44759
+ return Qs(r6) ? r6 : { data: r6, filename: e, contentType: t, onProgress: n };
44757
44760
  }
44758
- function Qs(r6) {
44761
+ function Ks(r6) {
44759
44762
  return b(r6) && "docDefinition" in r6;
44760
44763
  }
44761
- function Ks(r6, e, t, n) {
44762
- return Qs(r6) ? r6 : { docDefinition: r6, filename: e, tableLayouts: t, fonts: n };
44764
+ function zs(r6, e, t, n) {
44765
+ return Ks(r6) ? r6 : { docDefinition: r6, filename: e, tableLayouts: t, fonts: n };
44763
44766
  }
44764
- var sa = [...Le, "->", "<<", ">>", "=="];
44765
- var ua = _e().registerInfix("->", { precedence: y.Arrow }).registerInfix(";", { precedence: y.Semicolon });
44766
- var Pa = [...Le, "eq", "ne", "co"];
44767
- var Aa = _e();
44767
+ var aa = [...Le, "->", "<<", ">>", "=="];
44768
+ var la = _e().registerInfix("->", { precedence: y.Arrow }).registerInfix(";", { precedence: y.Semicolon });
44769
+ var Ca = [...Le, "eq", "ne", "co"];
44770
+ var Oa = _e();
44768
44771
  var se = class {
44769
44772
  constructor(e = "\r", t = "|", n = "^", i = "~", o = "\\", s = "&") {
44770
44773
  this.segmentSeparator = e;
@@ -44781,7 +44784,7 @@ var se = class {
44781
44784
  return this.componentSeparator + this.repetitionSeparator + this.escapeCharacter + this.subcomponentSeparator;
44782
44785
  }
44783
44786
  };
44784
- var Ci = class r {
44787
+ var wi = class r {
44785
44788
  constructor(e, t = new se()) {
44786
44789
  this.context = t, this.segments = e;
44787
44790
  }
@@ -44805,7 +44808,7 @@ var Ci = class r {
44805
44808
  }
44806
44809
  buildAck() {
44807
44810
  let e = /* @__PURE__ */ new Date(), t = this.getSegment("MSH"), n = t?.getField(3)?.toString() ?? "", i = t?.getField(4)?.toString() ?? "", o = t?.getField(5)?.toString() ?? "", s = t?.getField(6)?.toString() ?? "", a2 = t?.getField(10)?.toString() ?? "", c = t?.getField(12)?.toString() ?? "2.5.1";
44808
- return new r([new We(["MSH", this.context.getMsh2(), o, s, n, i, Ia(e), "", this.buildAckMessageType(t), e.getTime().toString(), "P", c], this.context), new We(["MSA", "AA", a2, "OK"], this.context)]);
44811
+ return new r([new We(["MSH", this.context.getMsh2(), o, s, n, i, ka(e), "", this.buildAckMessageType(t), e.getTime().toString(), "P", c], this.context), new We(["MSA", "AA", a2, "OK"], this.context)]);
44809
44812
  }
44810
44813
  buildAckMessageType(e) {
44811
44814
  let t = e?.getField(9), n = t?.getComponent(2), i = t?.getComponent(3), o = "ACK";
@@ -44822,7 +44825,7 @@ var Ci = class r {
44822
44825
  };
44823
44826
  var We = class r2 {
44824
44827
  constructor(e, t = new se()) {
44825
- this.context = t, Pn(e) ? this.fields = e.map((n) => Oe.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
44828
+ this.context = t, Cn(e) ? this.fields = e.map((n) => Oe.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
44826
44829
  }
44827
44830
  get(e) {
44828
44831
  return this.fields[e];
@@ -44863,12 +44866,12 @@ var Oe = class r3 {
44863
44866
  return new r3(e.split(t.repetitionSeparator).map((n) => n.split(t.componentSeparator)), t);
44864
44867
  }
44865
44868
  };
44866
- function Ia(r6) {
44869
+ function ka(r6) {
44867
44870
  let e = r6 instanceof Date ? r6 : new Date(r6), n = e.toISOString().replace(/[-:T]/g, "").replace(/(\.\d+)?Z$/, ""), i = e.getUTCMilliseconds();
44868
44871
  return i > 0 && (n += "." + i.toString()), n;
44869
44872
  }
44870
- var _r = ((o) => (o[o.NONE = 0] = "NONE", o[o.ERROR = 1] = "ERROR", o[o.WARN = 2] = "WARN", o[o.INFO = 3] = "INFO", o[o.DEBUG = 4] = "DEBUG", o))(_r || {});
44871
- var wi = class r4 {
44873
+ var Lr = ((o) => (o[o.NONE = 0] = "NONE", o[o.ERROR = 1] = "ERROR", o[o.WARN = 2] = "WARN", o[o.INFO = 3] = "INFO", o[o.DEBUG = 4] = "DEBUG", o))(Lr || {});
44874
+ var Ai = class r4 {
44872
44875
  constructor(e, t = {}, n = 3, i) {
44873
44876
  this.write = e;
44874
44877
  this.metadata = t;
@@ -44898,11 +44901,11 @@ var wi = class r4 {
44898
44901
  }
44899
44902
  log(e, t, n) {
44900
44903
  e > this.level || (n instanceof Error && (n = { error: n.toString(), stack: n.stack?.split(`
44901
- `) }), this.write(JSON.stringify({ level: _r[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: this.prefix ? `${this.prefix}${t}` : t, ...n, ...this.metadata })));
44904
+ `) }), this.write(JSON.stringify({ level: Lr[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: this.prefix ? `${this.prefix}${t}` : t, ...n, ...this.metadata })));
44902
44905
  }
44903
44906
  };
44904
- function bf(r6) {
44905
- let e = _r[r6.toUpperCase()];
44907
+ function Cf(r6) {
44908
+ let e = Lr[r6.toUpperCase()];
44906
44909
  if (e === void 0) throw new Error(`Invalid log level: ${r6}`);
44907
44910
  return e;
44908
44911
  }
@@ -44950,7 +44953,7 @@ var p = class extends a {
44950
44953
  e.on("data", (s) => {
44951
44954
  try {
44952
44955
  if (this.appendData(s), s.at(-2) === 28 && s.at(-1) === 13) {
44953
- let o = Buffer.concat(this.chunks), i = o.subarray(1, o.length - 2), f2 = (0, import_iconv_lite.decode)(i, this.encoding), g = Ci.parse(f2);
44956
+ let o = Buffer.concat(this.chunks), i = o.subarray(1, o.length - 2), f2 = (0, import_iconv_lite.decode)(i, this.encoding), g = wi.parse(f2);
44954
44957
  this.dispatchEvent(new d2(this, g)), this.resetBuffer();
44955
44958
  }
44956
44959
  } catch (o) {
@@ -45202,7 +45205,7 @@ var AgentDicomChannel = class extends BaseChannel {
45202
45205
  });
45203
45206
  response.setStatus(dimse.constants.Status.Success);
45204
45207
  } catch (err) {
45205
- DcmjsDimseScp.channel.log.error(`DICOM error: ${Oi(err)}`);
45208
+ DcmjsDimseScp.channel.log.error(`DICOM error: ${Ii(err)}`);
45206
45209
  response.setStatus(dimse.constants.Status.ProcessingFailure);
45207
45210
  }
45208
45211
  return response;
@@ -45277,7 +45280,7 @@ var AgentHl7Channel = class extends BaseChannel {
45277
45280
  sendToRemote(msg) {
45278
45281
  const connection = this.connections.get(msg.remote);
45279
45282
  if (connection) {
45280
- connection.hl7Connection.send(Ci.parse(msg.body));
45283
+ connection.hl7Connection.send(wi.parse(msg.body));
45281
45284
  }
45282
45285
  }
45283
45286
  handleNewConnection(connection) {
@@ -45305,7 +45308,7 @@ var AgentHl7ChannelConnection = class {
45305
45308
  body: event.message.toString()
45306
45309
  });
45307
45310
  } catch (err) {
45308
- this.channel.log.error(`HL7 error: ${Oi(err)}`);
45311
+ this.channel.log.error(`HL7 error: ${Ii(err)}`);
45309
45312
  }
45310
45313
  }
45311
45314
  close() {
@@ -45388,7 +45391,7 @@ async function fetchVersionManifest(version) {
45388
45391
  try {
45389
45392
  message = (await res.json()).message;
45390
45393
  } catch (err) {
45391
- console.error(`Failed to parse message from body: ${Oi(err)}`);
45394
+ console.error(`Failed to parse message from body: ${Ii(err)}`);
45392
45395
  }
45393
45396
  throw new Error(
45394
45397
  `Received status code ${res.status} while fetching manifest for version '${version ?? "latest"}'. Message: ${message}`
@@ -45466,7 +45469,7 @@ var App = class _App {
45466
45469
  this.shutdown = false;
45467
45470
  this.keepAlive = false;
45468
45471
  _App.instance = this;
45469
- this.log = new wi((msg) => console.log(msg), void 0, logLevel);
45472
+ this.log = new Ai((msg) => console.log(msg), void 0, logLevel);
45470
45473
  }
45471
45474
  async start() {
45472
45475
  this.log.info("Medplum service starting...");
@@ -45486,7 +45489,7 @@ var App = class _App {
45486
45489
  if ((0, import_node_fs3.existsSync)(UPGRADE_MANIFEST_PATH)) {
45487
45490
  const upgradeFile = (0, import_node_fs3.readFileSync)(UPGRADE_MANIFEST_PATH, { encoding: "utf-8" });
45488
45491
  const upgradeDetails = JSON.parse(upgradeFile);
45489
- if (upgradeDetails.targetVersion === ld.split("-")[0]) {
45492
+ if (upgradeDetails.targetVersion === fd.split("-")[0]) {
45490
45493
  await this.sendToWebSocket({
45491
45494
  type: "agent:upgrade:response",
45492
45495
  statusCode: 200,
@@ -45494,7 +45497,7 @@ var App = class _App {
45494
45497
  });
45495
45498
  this.log.info(`Successfully upgraded to version ${upgradeDetails.targetVersion}`);
45496
45499
  } else {
45497
- const errMsg = `Failed to upgrade to version ${upgradeDetails.targetVersion}. Agent still running with version ${ld}`;
45500
+ const errMsg = `Failed to upgrade to version ${upgradeDetails.targetVersion}. Agent still running with version ${fd}`;
45498
45501
  await this.sendToWebSocket({
45499
45502
  type: "agent:error",
45500
45503
  body: errMsg,
@@ -45532,7 +45535,7 @@ var App = class _App {
45532
45535
  this.webSocket.binaryType = "nodebuffer";
45533
45536
  this.webSocket.addEventListener("error", (err) => {
45534
45537
  if (!this.shutdown) {
45535
- this.log.error(`WebSocket closed due to an error: ${Oi(err)}`);
45538
+ this.log.error(`WebSocket closed due to an error: ${Ii(err)}`);
45536
45539
  }
45537
45540
  });
45538
45541
  this.webSocket.addEventListener("open", async () => {
@@ -45563,7 +45566,7 @@ var App = class _App {
45563
45566
  this.startWebSocketWorker();
45564
45567
  break;
45565
45568
  case "agent:heartbeat:request":
45566
- await this.sendToWebSocket({ type: "agent:heartbeat:response", version: ld });
45569
+ await this.sendToWebSocket({ type: "agent:heartbeat:response", version: fd });
45567
45570
  break;
45568
45571
  case "agent:heartbeat:response":
45569
45572
  break;
@@ -45597,7 +45600,7 @@ var App = class _App {
45597
45600
  } catch (err) {
45598
45601
  await this.sendToWebSocket({
45599
45602
  type: "agent:error",
45600
- body: Oi(err),
45603
+ body: Ii(err),
45601
45604
  callback: command.callback
45602
45605
  });
45603
45606
  }
@@ -45612,7 +45615,7 @@ var App = class _App {
45612
45615
  this.log.error(`Unknown message type: ${command.type}`);
45613
45616
  }
45614
45617
  } catch (err) {
45615
- this.log.error(`WebSocket error on incoming message: ${Oi(err)}`);
45618
+ this.log.error(`WebSocket error on incoming message: ${Ii(err)}`);
45616
45619
  }
45617
45620
  });
45618
45621
  return new Promise((resolve2, reject) => {
@@ -45687,7 +45690,7 @@ var App = class _App {
45687
45690
  try {
45688
45691
  await this.startOrReloadChannel(definition, endpoint);
45689
45692
  } catch (err) {
45690
- this.log.error(Oi(err));
45693
+ this.log.error(Ii(err));
45691
45694
  }
45692
45695
  }
45693
45696
  }
@@ -45713,7 +45716,7 @@ var App = class _App {
45713
45716
  parsedEndpoint = new URL(endpoint.address);
45714
45717
  } catch (err) {
45715
45718
  throw new Error(
45716
- `Error while validating endpoint address for channel '${channel.name}': ${Oi(err)}`
45719
+ `Error while validating endpoint address for channel '${channel.name}': ${Ii(err)}`
45717
45720
  );
45718
45721
  }
45719
45722
  if (seenPorts.has(parsedEndpoint.port)) {
@@ -45796,7 +45799,7 @@ var App = class _App {
45796
45799
  try {
45797
45800
  await this.sendToWebSocket(msg);
45798
45801
  } catch (err) {
45799
- this.log.error(`WebSocket error while attempting to send message: ${Oi(err)}`);
45802
+ this.log.error(`WebSocket error while attempting to send message: ${Ii(err)}`);
45800
45803
  this.webSocketQueue.unshift(msg);
45801
45804
  throw err;
45802
45805
  }
@@ -45833,7 +45836,7 @@ IPv6 is currently unsupported.`;
45833
45836
  this.log.error(errMsg);
45834
45837
  throw new Error(errMsg);
45835
45838
  }
45836
- if (!((0, import_node_net.isIPv4)(message.remote) || bu(message.remote))) {
45839
+ if (!((0, import_node_net.isIPv4)(message.remote) || Ru(message.remote))) {
45837
45840
  const errMsg = `Attempted to ping an invalid host.
45838
45841
 
45839
45842
  "${message.remote}" is not a valid IPv4 address or a resolvable hostname.`;
@@ -45872,7 +45875,7 @@ ${result}`);
45872
45875
  body: result
45873
45876
  });
45874
45877
  } catch (err) {
45875
- this.log.error(`Error during ping attempt to ${message.remote ?? "NO_HOST_GIVEN"}: ${Oi(err)}`);
45878
+ this.log.error(`Error during ping attempt to ${message.remote ?? "NO_HOST_GIVEN"}: ${Ii(err)}`);
45876
45879
  this.addToWebSocketQueue({
45877
45880
  type: "agent:transmit:response",
45878
45881
  channel: message.channel,
@@ -45880,7 +45883,7 @@ ${result}`);
45880
45883
  remote: message.remote,
45881
45884
  callback: message.callback,
45882
45885
  statusCode: 400,
45883
- body: Oi(err)
45886
+ body: Ii(err)
45884
45887
  });
45885
45888
  }
45886
45889
  }
@@ -45927,11 +45930,11 @@ ${result}`);
45927
45930
  });
45928
45931
  });
45929
45932
  child.on("error", (err) => {
45930
- this.log.error(Oi(err));
45933
+ this.log.error(Ii(err));
45931
45934
  });
45932
45935
  } catch (err) {
45933
45936
  const versionTag = message.version ? `v${message.version}` : "latest";
45934
- const errMsg = `Error during upgrading to version '${versionTag}': ${Oi(err)}`;
45937
+ const errMsg = `Error during upgrading to version '${versionTag}': ${Ii(err)}`;
45935
45938
  this.log.error(errMsg);
45936
45939
  await this.sendToWebSocket({
45937
45940
  type: "agent:error",
@@ -45944,11 +45947,11 @@ ${result}`);
45944
45947
  await this.stop();
45945
45948
  this.log.info("Successfully stopped agent network services");
45946
45949
  const targetVersion = message.version ?? await fetchLatestVersionString();
45947
- this.log.info("Writing upgrade manifest...", { previousVersion: ld, targetVersion });
45950
+ this.log.info("Writing upgrade manifest...", { previousVersion: fd, targetVersion });
45948
45951
  (0, import_node_fs3.writeFileSync)(
45949
45952
  UPGRADE_MANIFEST_PATH,
45950
45953
  JSON.stringify({
45951
- previousVersion: ld,
45954
+ previousVersion: fd,
45952
45955
  targetVersion,
45953
45956
  callback: message.callback ?? null
45954
45957
  }),
@@ -45958,7 +45961,7 @@ ${result}`);
45958
45961
  child.disconnect();
45959
45962
  } catch (err) {
45960
45963
  this.log.error(
45961
- `Error while stopping agent or messaging child process as part of upgrade: ${Oi(err)}`
45964
+ `Error while stopping agent or messaging child process as part of upgrade: ${Ii(err)}`
45962
45965
  );
45963
45966
  import_node_process.default.exit(1);
45964
45967
  }
@@ -46016,7 +46019,7 @@ ${result}`);
46016
46019
  });
46017
46020
  }
46018
46021
  }
46019
- client.sendAndWait(Ci.parse(message.body)).then((response) => {
46022
+ client.sendAndWait(wi.parse(message.body)).then((response) => {
46020
46023
  this.log.info(`Response: ${response.toString().replaceAll("\r", "\n")}`);
46021
46024
  this.addToWebSocketQueue({
46022
46025
  type: "agent:transmit:response",
@@ -46028,7 +46031,7 @@ ${result}`);
46028
46031
  body: response.toString()
46029
46032
  });
46030
46033
  }).catch((err) => {
46031
- this.log.error(`HL7 error: ${Oi(err)}`);
46034
+ this.log.error(`HL7 error: ${Ii(err)}`);
46032
46035
  this.addToWebSocketQueue({
46033
46036
  type: "agent:transmit:response",
46034
46037
  channel: message.channel,
@@ -46036,7 +46039,7 @@ ${result}`);
46036
46039
  callback: message.callback,
46037
46040
  contentType: D.TEXT,
46038
46041
  statusCode: 400,
46039
- body: Oi(err)
46042
+ body: Ii(err)
46040
46043
  });
46041
46044
  if (client.keepAlive) {
46042
46045
  this.hl7Clients.delete(message.remote);
@@ -46085,7 +46088,7 @@ async function agentMain(argv) {
46085
46088
  const { baseUrl, clientId, clientSecret, agentId } = args;
46086
46089
  const medplum = new Ot({ baseUrl, clientId });
46087
46090
  await medplum.startClientLogin(clientId, clientSecret);
46088
- const app = new App(medplum, agentId, bf(args.logLevel ?? "INFO"));
46091
+ const app = new App(medplum, agentId, Cf(args.logLevel ?? "INFO"));
46089
46092
  await app.start();
46090
46093
  process.on("SIGINT", async () => {
46091
46094
  console.log("Gracefully shutting down from SIGINT (Ctrl-C)");
@@ -46113,7 +46116,7 @@ async function upgraderMain(argv) {
46113
46116
  if ((0, import_node_os4.platform)() !== "win32") {
46114
46117
  throw new Error(`Unsupported platform: ${(0, import_node_os4.platform)()}. Agent upgrader currently only supports Windows`);
46115
46118
  }
46116
- const globalLogger = new wi((msg) => console.log(msg));
46119
+ const globalLogger = new Ai((msg) => console.log(msg));
46117
46120
  if (!import_node_process2.default.send) {
46118
46121
  globalLogger.error("Upgrader not started as a child process with Node IPC enabled. Aborting...");
46119
46122
  import_node_process2.default.exit(1);
@@ -46152,7 +46155,7 @@ async function upgraderMain(argv) {
46152
46155
  (0, import_node_child_process2.spawnSync)(binPath, ["/S"]);
46153
46156
  globalLogger.info(`Agent version ${version} successfully installed`);
46154
46157
  } catch (err) {
46155
- globalLogger.error(`Error while attempting to run installer: ${Oi(err)}`);
46158
+ globalLogger.error(`Error while attempting to run installer: ${Ii(err)}`);
46156
46159
  globalLogger.error("Failed to run installer, attempting to restart agent service...");
46157
46160
  try {
46158
46161
  (0, import_node_child_process2.execSync)('net start "Medplum Agent"');