@medplum/agent 4.1.9 → 4.1.10

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 +342 -341
  2. package/package.json +5 -5
@@ -6763,7 +6763,7 @@ var require_stream = __commonJS({
6763
6763
  this.emit("error", err);
6764
6764
  }
6765
6765
  }
6766
- function createWebSocketStream2(ws, options) {
6766
+ function createWebSocketStream2(ws2, options) {
6767
6767
  let terminateOnDestroy = true;
6768
6768
  const duplex = new Duplex({
6769
6769
  ...options,
@@ -6772,65 +6772,65 @@ var require_stream = __commonJS({
6772
6772
  objectMode: false,
6773
6773
  writableObjectMode: false
6774
6774
  });
6775
- ws.on("message", function message(msg, isBinary) {
6775
+ ws2.on("message", function message(msg, isBinary) {
6776
6776
  const data2 = !isBinary && duplex._readableState.objectMode ? msg.toString() : msg;
6777
- if (!duplex.push(data2)) ws.pause();
6777
+ if (!duplex.push(data2)) ws2.pause();
6778
6778
  });
6779
- ws.once("error", function error(err) {
6779
+ ws2.once("error", function error(err) {
6780
6780
  if (duplex.destroyed) return;
6781
6781
  terminateOnDestroy = false;
6782
6782
  duplex.destroy(err);
6783
6783
  });
6784
- ws.once("close", function close() {
6784
+ ws2.once("close", function close() {
6785
6785
  if (duplex.destroyed) return;
6786
6786
  duplex.push(null);
6787
6787
  });
6788
6788
  duplex._destroy = function(err, callback) {
6789
- if (ws.readyState === ws.CLOSED) {
6789
+ if (ws2.readyState === ws2.CLOSED) {
6790
6790
  callback(err);
6791
6791
  process.nextTick(emitClose, duplex);
6792
6792
  return;
6793
6793
  }
6794
6794
  let called = false;
6795
- ws.once("error", function error(err2) {
6795
+ ws2.once("error", function error(err2) {
6796
6796
  called = true;
6797
6797
  callback(err2);
6798
6798
  });
6799
- ws.once("close", function close() {
6799
+ ws2.once("close", function close() {
6800
6800
  if (!called) callback(err);
6801
6801
  process.nextTick(emitClose, duplex);
6802
6802
  });
6803
- if (terminateOnDestroy) ws.terminate();
6803
+ if (terminateOnDestroy) ws2.terminate();
6804
6804
  };
6805
6805
  duplex._final = function(callback) {
6806
- if (ws.readyState === ws.CONNECTING) {
6807
- ws.once("open", function open() {
6806
+ if (ws2.readyState === ws2.CONNECTING) {
6807
+ ws2.once("open", function open() {
6808
6808
  duplex._final(callback);
6809
6809
  });
6810
6810
  return;
6811
6811
  }
6812
- if (ws._socket === null) return;
6813
- if (ws._socket._writableState.finished) {
6812
+ if (ws2._socket === null) return;
6813
+ if (ws2._socket._writableState.finished) {
6814
6814
  callback();
6815
6815
  if (duplex._readableState.endEmitted) duplex.destroy();
6816
6816
  } else {
6817
- ws._socket.once("finish", function finish() {
6817
+ ws2._socket.once("finish", function finish() {
6818
6818
  callback();
6819
6819
  });
6820
- ws.close();
6820
+ ws2.close();
6821
6821
  }
6822
6822
  };
6823
6823
  duplex._read = function() {
6824
- if (ws.isPaused) ws.resume();
6824
+ if (ws2.isPaused) ws2.resume();
6825
6825
  };
6826
6826
  duplex._write = function(chunk, encoding, callback) {
6827
- if (ws.readyState === ws.CONNECTING) {
6828
- ws.once("open", function open() {
6827
+ if (ws2.readyState === ws2.CONNECTING) {
6828
+ ws2.once("open", function open() {
6829
6829
  duplex._write(chunk, encoding, callback);
6830
6830
  });
6831
6831
  return;
6832
6832
  }
6833
- ws.send(chunk, callback);
6833
+ ws2.send(chunk, callback);
6834
6834
  };
6835
6835
  duplex.on("end", duplexOnEnd);
6836
6836
  duplex.on("error", duplexOnError);
@@ -7194,12 +7194,12 @@ var require_websocket_server = __commonJS({
7194
7194
  "Connection: Upgrade",
7195
7195
  `Sec-WebSocket-Accept: ${digest}`
7196
7196
  ];
7197
- const ws = new this.options.WebSocket(null, void 0, this.options);
7197
+ const ws2 = new this.options.WebSocket(null, void 0, this.options);
7198
7198
  if (protocols.size) {
7199
7199
  const protocol = this.options.handleProtocols ? this.options.handleProtocols(protocols, req) : protocols.values().next().value;
7200
7200
  if (protocol) {
7201
7201
  headers.push(`Sec-WebSocket-Protocol: ${protocol}`);
7202
- ws._protocol = protocol;
7202
+ ws2._protocol = protocol;
7203
7203
  }
7204
7204
  }
7205
7205
  if (extensions[PerMessageDeflate.extensionName]) {
@@ -7208,26 +7208,26 @@ var require_websocket_server = __commonJS({
7208
7208
  [PerMessageDeflate.extensionName]: [params]
7209
7209
  });
7210
7210
  headers.push(`Sec-WebSocket-Extensions: ${value}`);
7211
- ws._extensions = extensions;
7211
+ ws2._extensions = extensions;
7212
7212
  }
7213
7213
  this.emit("headers", headers, req);
7214
7214
  socket.write(headers.concat("\r\n").join("\r\n"));
7215
7215
  socket.removeListener("error", socketOnError);
7216
- ws.setSocket(socket, head, {
7216
+ ws2.setSocket(socket, head, {
7217
7217
  allowSynchronousEvents: this.options.allowSynchronousEvents,
7218
7218
  maxPayload: this.options.maxPayload,
7219
7219
  skipUTF8Validation: this.options.skipUTF8Validation
7220
7220
  });
7221
7221
  if (this.clients) {
7222
- this.clients.add(ws);
7223
- ws.on("close", () => {
7224
- this.clients.delete(ws);
7222
+ this.clients.add(ws2);
7223
+ ws2.on("close", () => {
7224
+ this.clients.delete(ws2);
7225
7225
  if (this._shouldEmitClose && !this.clients.size) {
7226
7226
  process.nextTick(emitClose, this);
7227
7227
  }
7228
7228
  });
7229
7229
  }
7230
- cb(ws, req);
7230
+ cb(ws2, req);
7231
7231
  }
7232
7232
  };
7233
7233
  module2.exports = WebSocketServer2;
@@ -15169,9 +15169,9 @@ var require_dcmjs = __commonJS({
15169
15169
  key: "rgb2XYZ",
15170
15170
  value: function rgb2XYZ(rgb) {
15171
15171
  var R2 = Colors2.invGammaCorrection(rgb[0]);
15172
- var G = Colors2.invGammaCorrection(rgb[1]);
15172
+ var G2 = Colors2.invGammaCorrection(rgb[1]);
15173
15173
  var B2 = Colors2.invGammaCorrection(rgb[2]);
15174
- return [0.41239558896741424 * R2 + 0.3575834307637148 * G + 0.18049264738170157 * B2, 0.21258623078559555 * R2 + 0.7151703037034108 * G + 0.07220049864333623 * B2, 0.019297215491746945 * R2 + 0.11918386458084854 * G + 0.9504971251315798 * B2];
15174
+ return [0.41239558896741424 * R2 + 0.3575834307637148 * G2 + 0.18049264738170157 * B2, 0.21258623078559555 * R2 + 0.7151703037034108 * G2 + 0.07220049864333623 * B2, 0.019297215491746945 * R2 + 0.11918386458084854 * G2 + 0.9504971251315798 * B2];
15175
15175
  }
15176
15176
  }, {
15177
15177
  key: "xyz2LAB",
@@ -29305,8 +29305,8 @@ var require_dcmjs_dimse_min = __commonJS({
29305
29305
  "use strict";
29306
29306
  e2.exports = t;
29307
29307
  }, 237: (e2, t2, s2) => {
29308
- const { Association: n2, PresentationContext: i3 } = s2(570), { Scp: r7, Server: a3 } = s2(538), { CCancelRequest: o2, CEchoRequest: c2, CEchoResponse: d3, CFindRequest: u2, CFindResponse: h3, CGetRequest: m2, CGetResponse: g2, CMoveRequest: l3, CMoveResponse: p2, CStoreRequest: R2, CStoreResponse: S2, NActionRequest: y3, NActionResponse: f3, NCreateRequest: I2, NCreateResponse: C2, NDeleteRequest: P, NDeleteResponse: A2, NEventReportRequest: v2, NEventReportResponse: x, NGetRequest: w2, NGetResponse: U, NSetRequest: q2, NSetResponse: D2 } = s2(940), { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: M2, RejectReason: B2, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $, StorageClass: j, TransferSyntax: V2, Uid: _2, UserIdentityType: G } = s2(492), z2 = s2(422), Q2 = s2(825), W2 = s2(139), J2 = s2(906), X2 = s2(73), H2 = { association: { Association: n2, PresentationContext: i3 }, Client: z2, constants: { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: M2, RejectReason: B2, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $, StorageClass: j, TransferSyntax: V2, Uid: _2, UserIdentityType: G }, Dataset: Q2, Implementation: W2, log: s2(547), requests: { CCancelRequest: o2, CEchoRequest: c2, CFindRequest: u2, CGetRequest: m2, CMoveRequest: l3, CStoreRequest: R2, NActionRequest: y3, NCreateRequest: I2, NDeleteRequest: P, NEventReportRequest: v2, NGetRequest: w2, NSetRequest: q2 }, responses: { CEchoResponse: d3, CFindResponse: h3, CGetResponse: g2, CMoveResponse: p2, CStoreResponse: S2, NActionResponse: f3, NCreateResponse: C2, NDeleteResponse: A2, NEventReportResponse: x, NGetResponse: U, NSetResponse: D2 }, Scp: r7, Server: a3, Statistics: J2, Transcoding: X2, version: s2(837) };
29309
- e2.exports = H2;
29308
+ const { Association: n2, PresentationContext: i3 } = s2(570), { Scp: r7, Server: a3 } = s2(538), { CCancelRequest: o2, CEchoRequest: c2, CEchoResponse: d3, CFindRequest: u2, CFindResponse: h3, CGetRequest: m2, CGetResponse: g2, CMoveRequest: l3, CMoveResponse: p2, CStoreRequest: R2, CStoreResponse: S2, NActionRequest: y3, NActionResponse: f3, NCreateRequest: I2, NCreateResponse: C2, NDeleteRequest: P, NDeleteResponse: A2, NEventReportRequest: v2, NEventReportResponse: x, NGetRequest: w2, NGetResponse: U, NSetRequest: q2, NSetResponse: D2 } = s2(940), { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: M2, RejectReason: B2, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $, StorageClass: j, TransferSyntax: V2, Uid: _2, UserIdentityType: G2 } = s2(492), z2 = s2(422), Q2 = s2(825), W2 = s2(139), J2 = s2(906), X2 = s2(73), H = { association: { Association: n2, PresentationContext: i3 }, Client: z2, constants: { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: M2, RejectReason: B2, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $, StorageClass: j, TransferSyntax: V2, Uid: _2, UserIdentityType: G2 }, Dataset: Q2, Implementation: W2, log: s2(547), requests: { CCancelRequest: o2, CEchoRequest: c2, CFindRequest: u2, CGetRequest: m2, CMoveRequest: l3, CStoreRequest: R2, NActionRequest: y3, NCreateRequest: I2, NDeleteRequest: P, NEventReportRequest: v2, NGetRequest: w2, NSetRequest: q2 }, responses: { CEchoResponse: d3, CFindResponse: h3, CGetResponse: g2, CMoveResponse: p2, CStoreResponse: S2, NActionResponse: f3, NCreateResponse: C2, NDeleteResponse: A2, NEventReportResponse: x, NGetResponse: U, NSetResponse: D2 }, Scp: r7, Server: a3, Statistics: J2, Transcoding: X2, version: s2(837) };
29309
+ e2.exports = H;
29310
29310
  }, 278: (e2) => {
29311
29311
  "use strict";
29312
29312
  e2.exports = require("net");
@@ -29314,8 +29314,8 @@ var require_dcmjs_dimse_min = __commonJS({
29314
29314
  "use strict";
29315
29315
  e2.exports = s;
29316
29316
  }, 371: (e2, t2, s2) => {
29317
- const { Association: n2 } = s2(570), { AAbort: i3, AAssociateAC: r7, AAssociateRJ: a3, AAssociateRQ: o2, AReleaseRP: c2, AReleaseRQ: d3, PDataTF: u2, Pdv: h3, RawPdu: m2 } = s2(942), { CommandFieldType: g2, RawPduType: l3, Status: p2 } = s2(492), { CCancelRequest: R2, CEchoRequest: S2, CEchoResponse: y3, CFindRequest: f3, CFindResponse: I2, CGetRequest: C2, CGetResponse: P, CMoveRequest: A2, CMoveResponse: v2, Command: x, CStoreRequest: w2, CStoreResponse: U, NActionRequest: q2, NActionResponse: D2, NCreateRequest: E2, NCreateResponse: T, NDeleteRequest: b2, NDeleteResponse: O2, NEventReportRequest: N2, NEventReportResponse: M2, NGetRequest: B2, NGetResponse: L2, NSetRequest: F2, NSetResponse: k2, Response: $ } = s2(940), j = s2(825), V2 = s2(139), _2 = s2(906), G = s2(73), z2 = s2(547), { SmartBuffer: Q2 } = s2(766), { EOL: W2 } = s2(857), J2 = s2(733), X2 = s2(235);
29318
- class H2 extends J2 {
29317
+ const { Association: n2 } = s2(570), { AAbort: i3, AAssociateAC: r7, AAssociateRJ: a3, AAssociateRQ: o2, AReleaseRP: c2, AReleaseRQ: d3, PDataTF: u2, Pdv: h3, RawPdu: m2 } = s2(942), { CommandFieldType: g2, RawPduType: l3, Status: p2 } = s2(492), { CCancelRequest: R2, CEchoRequest: S2, CEchoResponse: y3, CFindRequest: f3, CFindResponse: I2, CGetRequest: C2, CGetResponse: P, CMoveRequest: A2, CMoveResponse: v2, Command: x, CStoreRequest: w2, CStoreResponse: U, NActionRequest: q2, NActionResponse: D2, NCreateRequest: E2, NCreateResponse: T, NDeleteRequest: b2, NDeleteResponse: O2, NEventReportRequest: N2, NEventReportResponse: M2, NGetRequest: B2, NGetResponse: L2, NSetRequest: F2, NSetResponse: k2, Response: $ } = s2(940), j = s2(825), V2 = s2(139), _2 = s2(906), G2 = s2(73), z2 = s2(547), { SmartBuffer: Q2 } = s2(766), { EOL: W2 } = s2(857), J2 = s2(733), X2 = s2(235);
29318
+ class H extends J2 {
29319
29319
  constructor() {
29320
29320
  super();
29321
29321
  }
@@ -29435,7 +29435,7 @@ var require_dcmjs_dimse_min = __commonJS({
29435
29435
  try {
29436
29436
  const t3 = e3.command.getDataset(), s3 = this.association.getPresentationContext(e3.context.getPresentationContextId()).getAcceptedTransferSyntaxUid();
29437
29437
  if (t3 && s3 !== t3.getTransferSyntaxUid()) try {
29438
- const n3 = G.transcodeDataset(t3, s3, this.datasetTranscodeOptions);
29438
+ const n3 = G2.transcodeDataset(t3, s3, this.datasetTranscodeOptions);
29439
29439
  e3.command.setDataset(n3);
29440
29440
  } catch (t4) {
29441
29441
  return z2.error(t4.message), void e3.command.raiseDoneEvent();
@@ -29641,7 +29641,7 @@ var require_dcmjs_dimse_min = __commonJS({
29641
29641
  this.socket.setTimeout(this.connectTimeout), this.socket.on("connect", () => {
29642
29642
  this.connected = true, this.connectedTime = Date.now(), this.emit("connect");
29643
29643
  });
29644
- const e3 = new H2();
29644
+ const e3 = new H();
29645
29645
  e3.on("pdu", async (e4) => {
29646
29646
  this.lastPduTime = Date.now(), await this._processPdu(e4);
29647
29647
  }), e3.on("error", (e4) => {
@@ -31453,7 +31453,7 @@ var rr = class {
31453
31453
  return this.infixParselets[e.id === "Symbol" ? e.value : e.id];
31454
31454
  }
31455
31455
  };
31456
- var Ce = class {
31456
+ var Pe = class {
31457
31457
  constructor(e = 10) {
31458
31458
  this.max = e, this.cache = /* @__PURE__ */ new Map();
31459
31459
  }
@@ -31483,20 +31483,20 @@ var or = "not-modified";
31483
31483
  var ar = "not-found";
31484
31484
  var ur = "unauthorized";
31485
31485
  var ot = "accepted";
31486
- var vn = { resourceType: "OperationOutcome", id: ar, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
31487
- var Pe = { resourceType: "OperationOutcome", id: ur, issue: [{ severity: "error", code: "login", details: { text: "Unauthorized" } }] };
31488
- var Tn = { ...Pe, issue: [...Pe.issue, { severity: "error", code: "expired", details: { text: "Token expired" } }] };
31489
- var lr = { ...Pe, issue: [...Pe.issue, { severity: "error", code: "invalid", details: { text: "Token not issued for this audience" } }] };
31486
+ var xn = { resourceType: "OperationOutcome", id: ar, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
31487
+ var we = { resourceType: "OperationOutcome", id: ur, issue: [{ severity: "error", code: "login", details: { text: "Unauthorized" } }] };
31488
+ var vn = { ...we, issue: [...we.issue, { severity: "error", code: "expired", details: { text: "Token expired" } }] };
31489
+ var lr = { ...we, issue: [...we.issue, { severity: "error", code: "invalid", details: { text: "Token not issued for this audience" } }] };
31490
31490
  function b(r6, e) {
31491
31491
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "invalid", details: { text: r6 }, ...e ? { expression: [e] } : void 0 }] };
31492
31492
  }
31493
31493
  function y(r6) {
31494
31494
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "structure", details: { text: r6 } }] };
31495
31495
  }
31496
- function Sn(r6) {
31496
+ function Tn(r6) {
31497
31497
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "exception", details: { text: "Internal server error" }, diagnostics: r6.toString() }] };
31498
31498
  }
31499
- function we(r6) {
31499
+ function Ae(r6) {
31500
31500
  return typeof r6 == "object" && r6 !== null && r6.resourceType === "OperationOutcome";
31501
31501
  }
31502
31502
  function dr(r6) {
@@ -31504,74 +31504,74 @@ function dr(r6) {
31504
31504
  }
31505
31505
  var p = class extends Error {
31506
31506
  constructor(e, t) {
31507
- super(bn(e)), this.outcome = e, this.cause = t;
31507
+ super(Sn(e)), this.outcome = e, this.cause = t;
31508
31508
  }
31509
31509
  };
31510
31510
  function st(r6) {
31511
- return r6 instanceof p ? r6.outcome : we(r6) ? r6 : b(Ae(r6));
31511
+ return r6 instanceof p ? r6.outcome : Ae(r6) ? r6 : b(Oe(r6));
31512
31512
  }
31513
- function Ae(r6) {
31514
- return r6 ? typeof r6 == "string" ? r6 : r6 instanceof Error ? r6.message : we(r6) ? bn(r6) : typeof r6 == "object" && "code" in r6 && typeof r6.code == "string" ? r6.code : JSON.stringify(r6) : "Unknown error";
31513
+ function Oe(r6) {
31514
+ return r6 ? typeof r6 == "string" ? r6 : r6 instanceof Error ? r6.message : Ae(r6) ? Sn(r6) : typeof r6 == "object" && "code" in r6 && typeof r6.code == "string" ? r6.code : JSON.stringify(r6) : "Unknown error";
31515
31515
  }
31516
- function bn(r6) {
31517
- let e = r6.issue?.map(so) ?? [];
31516
+ function Sn(r6) {
31517
+ let e = r6.issue?.map(ao) ?? [];
31518
31518
  return e.length > 0 ? e.join("; ") : "Unknown error";
31519
31519
  }
31520
- function so(r6) {
31520
+ function ao(r6) {
31521
31521
  let e;
31522
31522
  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;
31523
31523
  }
31524
- function co(r6, e) {
31524
+ function uo(r6, e) {
31525
31525
  let t = e.max && e.max === Number.MAX_SAFE_INTEGER ? Number.POSITIVE_INFINITY : e.max;
31526
31526
  return { path: r6, description: "", type: e.type ?? [], min: e.min ?? 0, max: t ?? 1, isArray: !!t && t > 1, constraints: [] };
31527
31527
  }
31528
- function Cn(r6) {
31528
+ function Rn(r6) {
31529
31529
  let e = /* @__PURE__ */ Object.create(null);
31530
- for (let [t, n] of Object.entries(r6)) e[t] = { name: t, type: t, path: t, elements: Object.fromEntries(Object.entries(n.elements).map(([i2, o]) => [i2, co(i2, o)])), constraints: [], innerTypes: [] };
31530
+ for (let [t, n] of Object.entries(r6)) e[t] = { name: t, type: t, path: t, elements: Object.fromEntries(Object.entries(n.elements).map(([i2, o]) => [i2, uo(i2, o)])), constraints: [], innerTypes: [] };
31531
31531
  return e;
31532
31532
  }
31533
- var Pn = { Element: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, BackboneElement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, Address: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: 9007199254740991, type: [{ code: "string" }] }, city: { type: [{ code: "string" }] }, district: { type: [{ code: "string" }] }, state: { type: [{ code: "string" }] }, postalCode: { type: [{ code: "string" }] }, country: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Age: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "author[x]": { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Organization"] }, { code: "string" }] }, time: { type: [{ code: "dateTime" }] }, text: { min: 1, type: [{ code: "markdown" }] } } }, Attachment: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, contentType: { type: [{ code: "code" }] }, language: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] }, url: { type: [{ code: "url" }] }, size: { type: [{ code: "unsignedInt" }] }, hash: { type: [{ code: "base64Binary" }] }, title: { type: [{ code: "string" }] }, creation: { type: [{ code: "dateTime" }] } } }, CodeableConcept: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, coding: { max: 9007199254740991, type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: 9007199254740991, type: [{ code: "ContactPoint" }] } } }, ContactPoint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] } } }, Count: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, "subject[x]": { type: [{ code: "CodeableConcept" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Group"] }] }, mustSupport: { max: 9007199254740991, type: [{ code: "string" }] }, codeFilter: { max: 9007199254740991, type: [{ code: "DataRequirementCodeFilter" }] }, dateFilter: { max: 9007199254740991, type: [{ code: "DataRequirementDateFilter" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: 9007199254740991, type: [{ code: "DataRequirementSort" }] } } }, DataRequirementCodeFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] } } }, DataRequirementDateFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, "value[x]": { type: [{ code: "dateTime" }, { code: "Period" }, { code: "Duration" }] } } }, DataRequirementSort: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, direction: { min: 1, type: [{ code: "code" }] } } }, Distance: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] }, patientInstruction: { type: [{ code: "string" }] }, timing: { type: [{ code: "Timing" }] }, "asNeeded[x]": { type: [{ code: "boolean" }, { code: "CodeableConcept" }] }, site: { type: [{ code: "CodeableConcept" }] }, route: { type: [{ code: "CodeableConcept" }] }, method: { type: [{ code: "CodeableConcept" }] }, doseAndRate: { max: 9007199254740991, type: [{ code: "DosageDoseAndRate" }] }, maxDosePerPeriod: { type: [{ code: "Ratio" }] }, maxDosePerAdministration: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, maxDosePerLifetime: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, DosageDoseAndRate: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { type: [{ code: "CodeableConcept" }] }, "dose[x]": { type: [{ code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, "rate[x]": { type: [{ code: "Ratio" }, { code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Duration: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: 9007199254740991, type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] }, slicing: { type: [{ code: "ElementDefinitionSlicing" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: 9007199254740991, type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "ElementDefinitionBase" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: 9007199254740991, type: [{ code: "ElementDefinitionType" }] }, "defaultValue[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, meaningWhenMissing: { type: [{ code: "markdown" }] }, orderMeaning: { type: [{ code: "string" }] }, "fixed[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, "pattern[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, example: { max: 9007199254740991, type: [{ code: "ElementDefinitionExample" }] }, "minValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, "maxValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, maxLength: { type: [{ code: "integer" }] }, condition: { max: 9007199254740991, type: [{ code: "id" }] }, constraint: { max: 9007199254740991, type: [{ code: "ElementDefinitionConstraint" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "ElementDefinitionBinding" }] }, mapping: { max: 9007199254740991, type: [{ code: "ElementDefinitionMapping" }] } } }, ElementDefinitionSlicingDiscriminator: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, path: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionSlicing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, discriminator: { max: 9007199254740991, type: [{ code: "ElementDefinitionSlicingDiscriminator" }] }, description: { type: [{ code: "string" }] }, ordered: { type: [{ code: "boolean" }] }, rules: { min: 1, type: [{ code: "code" }] } } }, ElementDefinitionBase: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, min: { min: 1, type: [{ code: "unsignedInt" }] }, max: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionType: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, targetProfile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, aggregation: { max: 9007199254740991, type: [{ code: "code" }] }, versioning: { type: [{ code: "code" }] } } }, ElementDefinitionExample: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, label: { min: 1, type: [{ code: "string" }] }, "value[x]": { min: 1, type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, ElementDefinitionConstraint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, key: { min: 1, type: [{ code: "id" }] }, requirements: { type: [{ code: "string" }] }, severity: { min: 1, type: [{ code: "code" }] }, human: { min: 1, type: [{ code: "string" }] }, expression: { type: [{ code: "string" }] }, xpath: { type: [{ code: "string" }] }, source: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, ElementDefinitionBinding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, strength: { min: 1, type: [{ code: "code" }] }, description: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] } } }, ElementDefinitionMapping: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identity: { min: 1, type: [{ code: "id" }] }, language: { type: [{ code: "code" }] }, map: { min: 1, type: [{ code: "string" }] }, comment: { type: [{ code: "string" }] } } }, Expression: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, description: { type: [{ code: "string" }] }, name: { type: [{ code: "id" }] }, language: { min: 1, type: [{ code: "code" }] }, expression: { type: [{ code: "string" }] }, reference: { type: [{ code: "uri" }] } } }, Extension: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "uri" }] }, "value[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, HumanName: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: 9007199254740991, type: [{ code: "string" }] }, prefix: { max: 9007199254740991, type: [{ code: "string" }] }, suffix: { max: 9007199254740991, type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "CodeableConcept" }] }, system: { type: [{ code: "uri" }] }, value: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] }, assigner: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MarketingStatus: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, country: { min: 1, type: [{ code: "CodeableConcept" }] }, jurisdiction: { type: [{ code: "CodeableConcept" }] }, status: { min: 1, type: [{ code: "CodeableConcept" }] }, dateRange: { min: 1, type: [{ code: "Period" }] }, restoreDate: { type: [{ code: "dateTime" }] } } }, Meta: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: 9007199254740991, type: [{ code: "Coding" }] }, tag: { max: 9007199254740991, type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, onBehalfOf: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, accounts: { max: 9007199254740991, type: [{ code: "Reference" }] }, compartment: { max: 9007199254740991, type: [{ code: "Reference" }] } } }, Money: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "code" }] }, use: { min: 1, type: [{ code: "code" }] }, min: { type: [{ code: "integer" }] }, max: { type: [{ code: "string" }] }, documentation: { type: [{ code: "string" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, Period: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, height: { type: [{ code: "Quantity" }] }, width: { type: [{ code: "Quantity" }] }, depth: { type: [{ code: "Quantity" }] }, weight: { type: [{ code: "Quantity" }] }, nominalVolume: { type: [{ code: "Quantity" }] }, externalDiameter: { type: [{ code: "Quantity" }] }, shape: { type: [{ code: "string" }] }, color: { max: 9007199254740991, type: [{ code: "string" }] }, imprint: { max: 9007199254740991, type: [{ code: "string" }] }, image: { max: 9007199254740991, type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, Quantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Range: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, low: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, high: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Ratio: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, label: { type: [{ code: "string" }] }, display: { type: [{ code: "string" }] }, citation: { type: [{ code: "markdown" }] }, url: { type: [{ code: "url" }] }, document: { type: [{ code: "Attachment" }] }, resource: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Resource"] }] } } }, SampledData: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, origin: { min: 1, type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, period: { min: 1, type: [{ code: "decimal" }] }, factor: { type: [{ code: "decimal" }] }, lowerLimit: { type: [{ code: "decimal" }] }, upperLimit: { type: [{ code: "decimal" }] }, dimensions: { min: 1, type: [{ code: "positiveInt" }] }, data: { type: [{ code: "string" }] } } }, Signature: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, max: 9007199254740991, type: [{ code: "Coding" }] }, when: { min: 1, type: [{ code: "instant" }] }, who: { min: 1, type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, onBehalfOf: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, targetFormat: { type: [{ code: "code" }] }, sigFormat: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] } } }, SubstanceAmount: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "SubstanceAmountReferenceRange" }] } } }, SubstanceAmountReferenceRange: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, lowLimit: { type: [{ code: "Quantity" }] }, highLimit: { type: [{ code: "Quantity" }] } } }, Timing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, event: { max: 9007199254740991, type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "TimingRepeat" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TimingRepeat: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "bounds[x]": { type: [{ code: "Duration" }, { code: "Range" }, { code: "Period" }] }, count: { type: [{ code: "positiveInt" }] }, countMax: { type: [{ code: "positiveInt" }] }, duration: { type: [{ code: "decimal" }] }, durationMax: { type: [{ code: "decimal" }] }, durationUnit: { type: [{ code: "code" }] }, frequency: { type: [{ code: "positiveInt" }] }, frequencyMax: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "decimal" }] }, periodMax: { type: [{ code: "decimal" }] }, periodUnit: { type: [{ code: "code" }] }, dayOfWeek: { max: 9007199254740991, type: [{ code: "code" }] }, timeOfDay: { max: 9007199254740991, type: [{ code: "time" }] }, when: { max: 9007199254740991, type: [{ code: "code" }] }, offset: { type: [{ code: "unsignedInt" }] } } }, TriggerDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { type: [{ code: "string" }] }, "timing[x]": { type: [{ code: "Timing" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Schedule"] }, { code: "date" }, { code: "dateTime" }] }, data: { max: 9007199254740991, type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "Coding" }] }, "value[x]": { min: 1, type: [{ code: "CodeableConcept" }, { code: "Quantity" }, { code: "Range" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/PlanDefinition", "http://hl7.org/fhir/StructureDefinition/ResearchStudy", "http://hl7.org/fhir/StructureDefinition/InsurancePlan", "http://hl7.org/fhir/StructureDefinition/HealthcareService", "http://hl7.org/fhir/StructureDefinition/Group", "http://hl7.org/fhir/StructureDefinition/Location", "http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MoneyQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, SimpleQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { max: 0, type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, IdentityProvider: { elements: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, tokenAuthMethod: { type: [{ code: "code" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, usePkce: { type: [{ code: "boolean" }] }, useSubject: { type: [{ code: "boolean" }] } } } };
31533
+ var Cn = { Element: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, BackboneElement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, Address: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: 9007199254740991, type: [{ code: "string" }] }, city: { type: [{ code: "string" }] }, district: { type: [{ code: "string" }] }, state: { type: [{ code: "string" }] }, postalCode: { type: [{ code: "string" }] }, country: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Age: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "author[x]": { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Organization"] }, { code: "string" }] }, time: { type: [{ code: "dateTime" }] }, text: { min: 1, type: [{ code: "markdown" }] } } }, Attachment: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, contentType: { type: [{ code: "code" }] }, language: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] }, url: { type: [{ code: "url" }] }, size: { type: [{ code: "unsignedInt" }] }, hash: { type: [{ code: "base64Binary" }] }, title: { type: [{ code: "string" }] }, creation: { type: [{ code: "dateTime" }] } } }, CodeableConcept: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, coding: { max: 9007199254740991, type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: 9007199254740991, type: [{ code: "ContactPoint" }] } } }, ContactPoint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] } } }, Count: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, "subject[x]": { type: [{ code: "CodeableConcept" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Group"] }] }, mustSupport: { max: 9007199254740991, type: [{ code: "string" }] }, codeFilter: { max: 9007199254740991, type: [{ code: "DataRequirementCodeFilter" }] }, dateFilter: { max: 9007199254740991, type: [{ code: "DataRequirementDateFilter" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: 9007199254740991, type: [{ code: "DataRequirementSort" }] } } }, DataRequirementCodeFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] } } }, DataRequirementDateFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, "value[x]": { type: [{ code: "dateTime" }, { code: "Period" }, { code: "Duration" }] } } }, DataRequirementSort: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, direction: { min: 1, type: [{ code: "code" }] } } }, Distance: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] }, patientInstruction: { type: [{ code: "string" }] }, timing: { type: [{ code: "Timing" }] }, "asNeeded[x]": { type: [{ code: "boolean" }, { code: "CodeableConcept" }] }, site: { type: [{ code: "CodeableConcept" }] }, route: { type: [{ code: "CodeableConcept" }] }, method: { type: [{ code: "CodeableConcept" }] }, doseAndRate: { max: 9007199254740991, type: [{ code: "DosageDoseAndRate" }] }, maxDosePerPeriod: { type: [{ code: "Ratio" }] }, maxDosePerAdministration: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, maxDosePerLifetime: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, DosageDoseAndRate: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { type: [{ code: "CodeableConcept" }] }, "dose[x]": { type: [{ code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, "rate[x]": { type: [{ code: "Ratio" }, { code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Duration: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: 9007199254740991, type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] }, slicing: { type: [{ code: "ElementDefinitionSlicing" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: 9007199254740991, type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "ElementDefinitionBase" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: 9007199254740991, type: [{ code: "ElementDefinitionType" }] }, "defaultValue[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, meaningWhenMissing: { type: [{ code: "markdown" }] }, orderMeaning: { type: [{ code: "string" }] }, "fixed[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, "pattern[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, example: { max: 9007199254740991, type: [{ code: "ElementDefinitionExample" }] }, "minValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, "maxValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, maxLength: { type: [{ code: "integer" }] }, condition: { max: 9007199254740991, type: [{ code: "id" }] }, constraint: { max: 9007199254740991, type: [{ code: "ElementDefinitionConstraint" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "ElementDefinitionBinding" }] }, mapping: { max: 9007199254740991, type: [{ code: "ElementDefinitionMapping" }] } } }, ElementDefinitionSlicingDiscriminator: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, path: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionSlicing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, discriminator: { max: 9007199254740991, type: [{ code: "ElementDefinitionSlicingDiscriminator" }] }, description: { type: [{ code: "string" }] }, ordered: { type: [{ code: "boolean" }] }, rules: { min: 1, type: [{ code: "code" }] } } }, ElementDefinitionBase: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, min: { min: 1, type: [{ code: "unsignedInt" }] }, max: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionType: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, targetProfile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, aggregation: { max: 9007199254740991, type: [{ code: "code" }] }, versioning: { type: [{ code: "code" }] } } }, ElementDefinitionExample: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, label: { min: 1, type: [{ code: "string" }] }, "value[x]": { min: 1, type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, ElementDefinitionConstraint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, key: { min: 1, type: [{ code: "id" }] }, requirements: { type: [{ code: "string" }] }, severity: { min: 1, type: [{ code: "code" }] }, human: { min: 1, type: [{ code: "string" }] }, expression: { type: [{ code: "string" }] }, xpath: { type: [{ code: "string" }] }, source: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, ElementDefinitionBinding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, strength: { min: 1, type: [{ code: "code" }] }, description: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] } } }, ElementDefinitionMapping: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identity: { min: 1, type: [{ code: "id" }] }, language: { type: [{ code: "code" }] }, map: { min: 1, type: [{ code: "string" }] }, comment: { type: [{ code: "string" }] } } }, Expression: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, description: { type: [{ code: "string" }] }, name: { type: [{ code: "id" }] }, language: { min: 1, type: [{ code: "code" }] }, expression: { type: [{ code: "string" }] }, reference: { type: [{ code: "uri" }] } } }, Extension: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "uri" }] }, "value[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, HumanName: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: 9007199254740991, type: [{ code: "string" }] }, prefix: { max: 9007199254740991, type: [{ code: "string" }] }, suffix: { max: 9007199254740991, type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "CodeableConcept" }] }, system: { type: [{ code: "uri" }] }, value: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] }, assigner: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MarketingStatus: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, country: { min: 1, type: [{ code: "CodeableConcept" }] }, jurisdiction: { type: [{ code: "CodeableConcept" }] }, status: { min: 1, type: [{ code: "CodeableConcept" }] }, dateRange: { min: 1, type: [{ code: "Period" }] }, restoreDate: { type: [{ code: "dateTime" }] } } }, Meta: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: 9007199254740991, type: [{ code: "Coding" }] }, tag: { max: 9007199254740991, type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, onBehalfOf: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, accounts: { max: 9007199254740991, type: [{ code: "Reference" }] }, compartment: { max: 9007199254740991, type: [{ code: "Reference" }] } } }, Money: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "code" }] }, use: { min: 1, type: [{ code: "code" }] }, min: { type: [{ code: "integer" }] }, max: { type: [{ code: "string" }] }, documentation: { type: [{ code: "string" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, Period: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, height: { type: [{ code: "Quantity" }] }, width: { type: [{ code: "Quantity" }] }, depth: { type: [{ code: "Quantity" }] }, weight: { type: [{ code: "Quantity" }] }, nominalVolume: { type: [{ code: "Quantity" }] }, externalDiameter: { type: [{ code: "Quantity" }] }, shape: { type: [{ code: "string" }] }, color: { max: 9007199254740991, type: [{ code: "string" }] }, imprint: { max: 9007199254740991, type: [{ code: "string" }] }, image: { max: 9007199254740991, type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, Quantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Range: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, low: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, high: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Ratio: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, label: { type: [{ code: "string" }] }, display: { type: [{ code: "string" }] }, citation: { type: [{ code: "markdown" }] }, url: { type: [{ code: "url" }] }, document: { type: [{ code: "Attachment" }] }, resource: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Resource"] }] } } }, SampledData: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, origin: { min: 1, type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, period: { min: 1, type: [{ code: "decimal" }] }, factor: { type: [{ code: "decimal" }] }, lowerLimit: { type: [{ code: "decimal" }] }, upperLimit: { type: [{ code: "decimal" }] }, dimensions: { min: 1, type: [{ code: "positiveInt" }] }, data: { type: [{ code: "string" }] } } }, Signature: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, max: 9007199254740991, type: [{ code: "Coding" }] }, when: { min: 1, type: [{ code: "instant" }] }, who: { min: 1, type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, onBehalfOf: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, targetFormat: { type: [{ code: "code" }] }, sigFormat: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] } } }, SubstanceAmount: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "SubstanceAmountReferenceRange" }] } } }, SubstanceAmountReferenceRange: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, lowLimit: { type: [{ code: "Quantity" }] }, highLimit: { type: [{ code: "Quantity" }] } } }, Timing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, event: { max: 9007199254740991, type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "TimingRepeat" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TimingRepeat: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "bounds[x]": { type: [{ code: "Duration" }, { code: "Range" }, { code: "Period" }] }, count: { type: [{ code: "positiveInt" }] }, countMax: { type: [{ code: "positiveInt" }] }, duration: { type: [{ code: "decimal" }] }, durationMax: { type: [{ code: "decimal" }] }, durationUnit: { type: [{ code: "code" }] }, frequency: { type: [{ code: "positiveInt" }] }, frequencyMax: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "decimal" }] }, periodMax: { type: [{ code: "decimal" }] }, periodUnit: { type: [{ code: "code" }] }, dayOfWeek: { max: 9007199254740991, type: [{ code: "code" }] }, timeOfDay: { max: 9007199254740991, type: [{ code: "time" }] }, when: { max: 9007199254740991, type: [{ code: "code" }] }, offset: { type: [{ code: "unsignedInt" }] } } }, TriggerDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { type: [{ code: "string" }] }, "timing[x]": { type: [{ code: "Timing" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Schedule"] }, { code: "date" }, { code: "dateTime" }] }, data: { max: 9007199254740991, type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "Coding" }] }, "value[x]": { min: 1, type: [{ code: "CodeableConcept" }, { code: "Quantity" }, { code: "Range" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/PlanDefinition", "http://hl7.org/fhir/StructureDefinition/ResearchStudy", "http://hl7.org/fhir/StructureDefinition/InsurancePlan", "http://hl7.org/fhir/StructureDefinition/HealthcareService", "http://hl7.org/fhir/StructureDefinition/Group", "http://hl7.org/fhir/StructureDefinition/Location", "http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MoneyQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, SimpleQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { max: 0, type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, IdentityProvider: { elements: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, tokenAuthMethod: { type: [{ code: "code" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, usePkce: { type: [{ code: "boolean" }] }, useSubject: { type: [{ code: "boolean" }] } } } };
31534
31534
  function mr(r6) {
31535
31535
  return new fr(r6).parse();
31536
31536
  }
31537
- var fe = Cn(Pn);
31537
+ var fe = Rn(Cn);
31538
31538
  var yr = /* @__PURE__ */ Object.create(null);
31539
- var wn = /* @__PURE__ */ Object.create(null);
31540
- var lo = { "http://hl7.org/fhir/StructureDefinition/MoneyQuantity": "MoneyQuantity", "http://hl7.org/fhir/StructureDefinition/SimpleQuantity": "SimpleQuantity", "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition": "ViewDefinition" };
31541
- function kn(r6) {
31539
+ var Pn = /* @__PURE__ */ Object.create(null);
31540
+ var po = { "http://hl7.org/fhir/StructureDefinition/MoneyQuantity": "MoneyQuantity", "http://hl7.org/fhir/StructureDefinition/SimpleQuantity": "SimpleQuantity", "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition": "ViewDefinition" };
31541
+ function In(r6) {
31542
31542
  let e;
31543
- return e = wn[r6], e || (e = wn[r6] = /* @__PURE__ */ Object.create(null)), e;
31543
+ return e = Pn[r6], e || (e = Pn[r6] = /* @__PURE__ */ Object.create(null)), e;
31544
31544
  }
31545
31545
  function gr(r6) {
31546
31546
  let t = (Array.isArray(r6) ? r6 : r6.entry?.map((n) => n.resource) ?? []).filter((n) => n?.resourceType === "StructureDefinition");
31547
- Fn(t);
31547
+ Ln(t);
31548
31548
  for (let n of t) xr(n);
31549
31549
  }
31550
31550
  function xr(r6) {
31551
31551
  if (!r6?.name) throw new Error("Failed loading StructureDefinition from bundle");
31552
31552
  if (r6.resourceType !== "StructureDefinition") return;
31553
- let e = mr(r6), t = lo[r6.url], n, i2;
31554
- t ? (n = fe, i2 = t) : r6.url === `http://hl7.org/fhir/StructureDefinition/${r6.type}` || r6.url === `https://medplum.com/fhir/StructureDefinition/${r6.type}` || r6.type?.startsWith("http://") || r6.type?.startsWith("https://") ? (n = fe, i2 = r6.type) : (n = kn(r6.url), i2 = r6.type), n[i2] = e;
31553
+ let e = mr(r6), t = po[r6.url], n, i2;
31554
+ t ? (n = fe, i2 = t) : r6.url === `http://hl7.org/fhir/StructureDefinition/${r6.type}` || r6.url === `https://medplum.com/fhir/StructureDefinition/${r6.type}` || r6.type?.startsWith("http://") || r6.type?.startsWith("https://") ? (n = fe, i2 = r6.type) : (n = In(r6.url), i2 = r6.type), n[i2] = e;
31555
31555
  for (let o of e.innerTypes) o.parentType = e, n[o.name] = o;
31556
31556
  yr[r6.url] = e;
31557
31557
  }
31558
- function Vn(r6) {
31558
+ function Dn(r6) {
31559
31559
  return !!fe[r6];
31560
31560
  }
31561
- function Be(r6, e) {
31561
+ function We(r6, e) {
31562
31562
  if (e) {
31563
- let t = kn(e)[r6];
31563
+ let t = In(e)[r6];
31564
31564
  if (t) return t;
31565
31565
  }
31566
31566
  return fe[r6];
31567
31567
  }
31568
- function _n(r6) {
31568
+ function Mn(r6) {
31569
31569
  return !!yr[r6];
31570
31570
  }
31571
31571
  var fr = class {
31572
31572
  constructor(e) {
31573
31573
  if (!e.snapshot?.element || e.snapshot.element.length === 0) throw new Error(`No snapshot defined for StructureDefinition '${e.name}'`);
31574
- this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, path: this.root.path, title: e.title, type: e.type, url: e.url, version: e.version, kind: e.kind, description: mo(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
31574
+ this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, path: this.root.path, title: e.title, type: e.type, url: e.url, version: e.version, kind: e.kind, description: yo(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
31575
31575
  }
31576
31576
  parse() {
31577
31577
  let e = this.next();
@@ -31604,23 +31604,23 @@ var fr = class {
31604
31604
  return this.checkFieldExit(), this.innerTypes.length > 0 && (this.resourceSchema.innerTypes = this.innerTypes), this.resourceSchema;
31605
31605
  }
31606
31606
  checkFieldEnter(e, t) {
31607
- this.isInnerType(e) && this.enterInnerType(e), this.slicingContext && !Oe(this.slicingContext.path, e?.path) && (this.slicingContext = void 0), e.slicing && !this.slicingContext && this.enterSlice(e, t);
31607
+ this.isInnerType(e) && this.enterInnerType(e), this.slicingContext && !Ie(this.slicingContext.path, e?.path) && (this.slicingContext = void 0), e.slicing && !this.slicingContext && this.enterSlice(e, t);
31608
31608
  }
31609
31609
  enterInnerType(e) {
31610
- for (; this.backboneContext && !Oe(this.backboneContext?.path, e.path); ) this.innerTypes.push(this.backboneContext.type), this.backboneContext = this.backboneContext.parent;
31610
+ for (; this.backboneContext && !Ie(this.backboneContext?.path, e.path); ) this.innerTypes.push(this.backboneContext.type), this.backboneContext = this.backboneContext.parent;
31611
31611
  let t = hr(e);
31612
- this.backboneContext = { type: { name: t, type: t, path: e.path, title: e.label, description: e.definition, elements: {}, constraints: this.parseElementDefinition(e).constraints, innerTypes: [] }, path: e.path, parent: Oe(this.backboneContext?.path, e.path) ? this.backboneContext : this.backboneContext?.parent };
31612
+ this.backboneContext = { type: { name: t, type: t, path: e.path, title: e.label, description: e.definition, elements: {}, constraints: this.parseElementDefinition(e).constraints, innerTypes: [] }, path: e.path, parent: Ie(this.backboneContext?.path, e.path) ? this.backboneContext : this.backboneContext?.parent };
31613
31613
  }
31614
31614
  enterSlice(e, t) {
31615
- ho(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
31615
+ mo(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
31616
31616
  if (n.type !== "value" && n.type !== "pattern" && n.type !== "type") throw new Error(`Unsupported slicing discriminator type: ${n.type}`);
31617
31617
  return { path: n.path, type: n.type };
31618
31618
  }), slices: [], ordered: e.slicing?.ordered ?? false, rule: e.slicing?.rules }, this.slicingContext = { field: t.slicing, path: e.path ?? "" });
31619
31619
  }
31620
31620
  checkFieldExit(e = void 0) {
31621
- if (this.backboneContext && !Oe(this.backboneContext.path, e?.path)) if (this.backboneContext.parent) do
31621
+ if (this.backboneContext && !Ie(this.backboneContext.path, e?.path)) if (this.backboneContext.parent) do
31622
31622
  this.innerTypes.push(this.backboneContext.type), this.backboneContext = this.backboneContext.parent;
31623
- while (this.backboneContext && !Oe(this.backboneContext.path, e?.path));
31623
+ while (this.backboneContext && !Ie(this.backboneContext.path, e?.path));
31624
31624
  else this.innerTypes.push(this.backboneContext.type), this.backboneContext = void 0;
31625
31625
  }
31626
31626
  next() {
@@ -31639,7 +31639,7 @@ var fr = class {
31639
31639
  }
31640
31640
  isInnerType(e) {
31641
31641
  let t = this.peek();
31642
- return !!(Oe(e?.path, t?.path) && e.type?.some((n) => ["BackboneElement", "Element"].includes(n.code)));
31642
+ return !!(Ie(e?.path, t?.path) && e.type?.some((n) => ["BackboneElement", "Element"].includes(n.code)));
31643
31643
  }
31644
31644
  parseSliceStart(e) {
31645
31645
  if (!this.slicingContext) throw new Error(`Invalid slice start before discriminator: ${e.sliceName} (${e.id})`);
@@ -31652,34 +31652,34 @@ var fr = class {
31652
31652
  });
31653
31653
  }
31654
31654
  parseElementDefinition(e) {
31655
- let t = On(e.max), n = e.base?.max ? On(e.base.max) : t, i2 = { type: "ElementDefinition", value: e };
31656
- 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: In(C(i2, "fixed[x]")), pattern: In(C(i2, "pattern[x]")), binding: e.binding };
31655
+ let t = An(e.max), n = e.base?.max ? An(e.base.max) : t, i2 = { type: "ElementDefinition", value: e };
31656
+ 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(i2, "fixed[x]")), pattern: On(C(i2, "pattern[x]")), binding: e.binding };
31657
31657
  }
31658
31658
  };
31659
- function On(r6) {
31659
+ function An(r6) {
31660
31660
  return r6 === "*" ? Number.POSITIVE_INFINITY : Number.parseInt(r6, 10);
31661
31661
  }
31662
31662
  function pr(r6, e = "") {
31663
- return fo(r6.path, e);
31663
+ return ho(r6.path, e);
31664
31664
  }
31665
- function fo(r6, e) {
31665
+ function ho(r6, e) {
31666
31666
  return r6 ? e && r6.startsWith(e) ? r6.substring(e.length + 1) : r6 : "";
31667
31667
  }
31668
- function Oe(r6, e) {
31668
+ function Ie(r6, e) {
31669
31669
  return !r6 || !e ? false : e.startsWith(r6 + ".") || e === r6;
31670
31670
  }
31671
- function In(r6) {
31671
+ function On(r6) {
31672
31672
  return Array.isArray(r6) && r6.length > 0 ? r6[0] : S(r6) ? void 0 : r6;
31673
31673
  }
31674
- function ho(r6) {
31674
+ function mo(r6) {
31675
31675
  let e = r6.slicing?.discriminator;
31676
31676
  return !!(r6.type?.some((t) => t.code === "Extension") && e?.length === 1 && e[0].type === "value" && e[0].path === "url");
31677
31677
  }
31678
- function mo(r6) {
31678
+ function yo(r6) {
31679
31679
  let e = r6.description;
31680
31680
  return e?.startsWith(`Base StructureDefinition for ${r6.name} Type: `) && (e = e.substring(`Base StructureDefinition for ${r6.name} Type: `.length)), e;
31681
31681
  }
31682
- var xo = new Ce(1e3);
31682
+ var vo = new Pe(1e3);
31683
31683
  var ut = { base64Binary: /^([A-Za-z\d+/]{4})*([A-Za-z\d+/]{2}==|[A-Za-z\d+/]{3}=)?$/, canonical: /^\S*$/, code: /^[^\s]+( [^\s]+)*$/, date: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1]))?)?$/, dateTime: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1])(T([01]\d|2[0-3])(:[0-5]\d:([0-5]\d|60)(\.\d{1,9})?)?)?)?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00)?)?)?$/, id: /^[A-Za-z0-9\-.]{1,64}$/, instant: /^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2]\d|3[0-1])T([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00))$/, markdown: /^[\r\n\t\u0020-\uFFFF]+$/, oid: /^urn:oid:[0-2](\.(0|[1-9]\d*))+$/, string: /^[\r\n\t\u0020-\uFFFF]+$/, time: /^([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?$/, uri: /^\S*$/, url: /^\S*$/, uuid: /^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/, xhtml: /.*/ };
31684
31684
  function h(r6) {
31685
31685
  return [{ type: l.boolean, value: r6 }];
@@ -31690,7 +31690,7 @@ function v(r6) {
31690
31690
  function _(r6) {
31691
31691
  return r6.length === 0 ? false : !!r6[0].value;
31692
31692
  }
31693
- function H(r6, e) {
31693
+ function G(r6, e) {
31694
31694
  if (r6.length !== 0) {
31695
31695
  if (r6.length === 1 && (!e || r6[0].type === e)) return r6[0];
31696
31696
  throw new Error(`Expected singleton of type ${e}, but found ${JSON.stringify(r6)}`);
@@ -31699,9 +31699,9 @@ function H(r6, e) {
31699
31699
  function C(r6, e, t) {
31700
31700
  if (!r6.value) return;
31701
31701
  let n = ft(r6.type, e, t?.profileUrl);
31702
- return n ? Co(r6, e, n) : Po(r6, e);
31702
+ return n ? Po(r6, e, n) : wo(r6, e);
31703
31703
  }
31704
- function Co(r6, e, t) {
31704
+ function Po(r6, e, t) {
31705
31705
  let n = r6.value, i2 = t.type;
31706
31706
  if (!i2 || i2.length === 0) return;
31707
31707
  let o, s = "undefined", a2, c = t.path.lastIndexOf("."), u2 = t.path.substring(c + 1);
@@ -31714,14 +31714,14 @@ function Co(r6, e, t) {
31714
31714
  }
31715
31715
  if (a2) if (Array.isArray(o)) {
31716
31716
  o = o.slice();
31717
- for (let d2 = 0; d2 < Math.max(o.length, a2.length); d2++) o[d2] = qn(o[d2], a2[d2]);
31718
- } else o = qn(o, a2);
31719
- if (!S(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((d2) => Nn(d2, s)) : Nn(o, s);
31717
+ for (let d2 = 0; d2 < Math.max(o.length, a2.length); d2++) o[d2] = Wn(o[d2], a2[d2]);
31718
+ } else o = Wn(o, a2);
31719
+ if (!S(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((d2) => Fn(d2, s)) : Fn(o, s);
31720
31720
  }
31721
- function Nn(r6, e) {
31721
+ function Fn(r6, e) {
31722
31722
  return e === "Resource" && A(r6) && (e = r6.resourceType), { type: e, value: r6 };
31723
31723
  }
31724
- function Po(r6, e) {
31724
+ function wo(r6, e) {
31725
31725
  let t = r6.value;
31726
31726
  if (!t || typeof t != "object") return;
31727
31727
  let n;
@@ -31748,7 +31748,7 @@ function lt(r6) {
31748
31748
  let e = [];
31749
31749
  for (let t of r6) {
31750
31750
  let n = false;
31751
- for (let i2 of e) if (_(je(t, i2))) {
31751
+ for (let i2 of e) if (_($e(t, i2))) {
31752
31752
  n = true;
31753
31753
  break;
31754
31754
  }
@@ -31756,27 +31756,27 @@ function lt(r6) {
31756
31756
  }
31757
31757
  return e;
31758
31758
  }
31759
- function jn(r6) {
31759
+ function qn(r6) {
31760
31760
  return h(!_(r6));
31761
31761
  }
31762
- function $n(r6, e) {
31763
- return r6.length === 0 || e.length === 0 ? [] : r6.length !== e.length ? h(false) : h(r6.every((t, n) => _(je(t, e[n]))));
31762
+ function jn(r6, e) {
31763
+ return r6.length === 0 || e.length === 0 ? [] : r6.length !== e.length ? h(false) : h(r6.every((t, n) => _($e(t, e[n]))));
31764
31764
  }
31765
- function Hn(r6, e) {
31766
- return r6.length === 0 || e.length === 0 ? [] : r6.length !== e.length ? h(true) : h(r6.some((t, n) => !_(je(t, e[n]))));
31765
+ function $n(r6, e) {
31766
+ return r6.length === 0 || e.length === 0 ? [] : r6.length !== e.length ? h(true) : h(r6.some((t, n) => !_($e(t, e[n]))));
31767
31767
  }
31768
- function je(r6, e) {
31768
+ function $e(r6, e) {
31769
31769
  let t = r6.value?.valueOf(), n = e.value?.valueOf();
31770
- return typeof t == "number" && typeof n == "number" ? h(Math.abs(t - n) < 1e-8) : k(t) && k(n) ? h(Qn(t, n)) : h(typeof t == "object" && typeof n == "object" ? wr(r6, e) : t === n);
31770
+ return typeof t == "number" && typeof n == "number" ? h(Math.abs(t - n) < 1e-8) : k(t) && k(n) ? h(Hn(t, n)) : h(typeof t == "object" && typeof n == "object" ? wr(r6, e) : t === n);
31771
31771
  }
31772
31772
  function Pr(r6, e) {
31773
- return r6.length === 0 && e.length === 0 ? h(true) : r6.length !== e.length ? h(false) : (r6.sort(Un), e.sort(Un), h(r6.every((t, n) => _(wo(t, e[n])))));
31773
+ return r6.length === 0 && e.length === 0 ? h(true) : r6.length !== e.length ? h(false) : (r6.sort(Nn), e.sort(Nn), h(r6.every((t, n) => _(Ao(t, e[n])))));
31774
31774
  }
31775
- function wo(r6, e) {
31775
+ function Ao(r6, e) {
31776
31776
  let { type: t, value: n } = r6, { type: i2, value: o } = e, s = n?.valueOf(), a2 = o?.valueOf();
31777
- return typeof s == "number" && typeof a2 == "number" ? h(Math.abs(s - a2) < 0.01) : k(s) && k(a2) ? h(Qn(s, a2)) : h(t === "Coding" && i2 === "Coding" ? typeof s != "object" || typeof a2 != "object" ? false : s.code === a2.code && s.system === a2.system : typeof s == "object" && typeof a2 == "object" ? wr({ ...s, id: void 0 }, { ...a2, id: void 0 }) : typeof s == "string" && typeof a2 == "string" ? s.toLowerCase() === a2.toLowerCase() : s === a2);
31777
+ return typeof s == "number" && typeof a2 == "number" ? h(Math.abs(s - a2) < 0.01) : k(s) && k(a2) ? h(Hn(s, a2)) : h(t === "Coding" && i2 === "Coding" ? typeof s != "object" || typeof a2 != "object" ? false : s.code === a2.code && s.system === a2.system : typeof s == "object" && typeof a2 == "object" ? wr({ ...s, id: void 0 }, { ...a2, id: void 0 }) : typeof s == "string" && typeof a2 == "string" ? s.toLowerCase() === a2.toLowerCase() : s === a2);
31778
31778
  }
31779
- function Un(r6, e) {
31779
+ function Nn(r6, e) {
31780
31780
  let t = r6.value?.valueOf(), n = e.value?.valueOf();
31781
31781
  return typeof t == "number" && typeof n == "number" ? t - n : typeof t == "string" && typeof n == "string" ? t.localeCompare(n) : 0;
31782
31782
  }
@@ -31793,7 +31793,7 @@ function dt(r6, e) {
31793
31793
  case "Date":
31794
31794
  return Gn(t);
31795
31795
  case "DateTime":
31796
- return ke(t);
31796
+ return De(t);
31797
31797
  case "Time":
31798
31798
  return typeof t == "string" && !!/^T\d/.exec(t);
31799
31799
  case "Period":
@@ -31807,16 +31807,16 @@ function dt(r6, e) {
31807
31807
  function Gn(r6) {
31808
31808
  return typeof r6 == "string" && !!ut.date.exec(r6);
31809
31809
  }
31810
- function ke(r6) {
31810
+ function De(r6) {
31811
31811
  return typeof r6 == "string" && !!ut.dateTime.exec(r6);
31812
31812
  }
31813
31813
  function pt(r6) {
31814
- return !!(r6 && typeof r6 == "object" && ("start" in r6 && ke(r6.start) || "end" in r6 && ke(r6.end)));
31814
+ return !!(r6 && typeof r6 == "object" && ("start" in r6 && De(r6.start) || "end" in r6 && De(r6.end)));
31815
31815
  }
31816
31816
  function k(r6) {
31817
31817
  return !!(r6 && typeof r6 == "object" && "value" in r6 && typeof r6.value == "number");
31818
31818
  }
31819
- function Qn(r6, e) {
31819
+ function Hn(r6, e) {
31820
31820
  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);
31821
31821
  }
31822
31822
  function wr(r6, e) {
@@ -31824,67 +31824,67 @@ function wr(r6, e) {
31824
31824
  if (t.length !== n.length) return false;
31825
31825
  for (let i2 of t) {
31826
31826
  let o = r6[i2], s = e[i2];
31827
- if (Wn(o) && Wn(s)) {
31827
+ if (Bn(o) && Bn(s)) {
31828
31828
  if (!wr(o, s)) return false;
31829
31829
  } else if (o !== s) return false;
31830
31830
  }
31831
31831
  return true;
31832
31832
  }
31833
- function Wn(r6) {
31833
+ function Bn(r6) {
31834
31834
  return r6 !== null && typeof r6 == "object";
31835
31835
  }
31836
- function qn(r6, e) {
31836
+ function Wn(r6, e) {
31837
31837
  if (e) {
31838
31838
  if (typeof e != "object") throw new Error("Primitive extension must be an object");
31839
- return Ao(r6 ?? {}, e);
31839
+ return Oo(r6 ?? {}, e);
31840
31840
  }
31841
31841
  return r6;
31842
31842
  }
31843
- function Ao(r6, e) {
31843
+ function Oo(r6, e) {
31844
31844
  return delete e.__proto__, delete e.constructor, Object.assign(r6, e);
31845
31845
  }
31846
31846
  function kr(r6, e) {
31847
31847
  return A(r6, e) && "id" in r6 && typeof r6.id == "string";
31848
31848
  }
31849
31849
  function he(r6) {
31850
- let e = B(r6) ?? "undefined/undefined", t = Io(r6);
31850
+ let e = B(r6) ?? "undefined/undefined", t = ko(r6);
31851
31851
  return t === e ? { reference: e } : { reference: e, display: t };
31852
31852
  }
31853
31853
  function B(r6) {
31854
- if (Y(r6)) return r6.reference;
31854
+ if (X(r6)) return r6.reference;
31855
31855
  if (kr(r6)) return `${r6.resourceType}/${r6.id}`;
31856
31856
  }
31857
31857
  function me(r6) {
31858
- if (r6) return Y(r6) ? r6.reference.split("/")[1] : r6.id;
31858
+ if (r6) return X(r6) ? r6.reference.split("/")[1] : r6.id;
31859
31859
  }
31860
- function Oo(r6) {
31860
+ function Io(r6) {
31861
31861
  return r6.resourceType === "Patient" || r6.resourceType === "Practitioner" || r6.resourceType === "RelatedPerson";
31862
31862
  }
31863
- function Io(r6) {
31864
- if (Oo(r6)) {
31865
- let e = ko(r6);
31863
+ function ko(r6) {
31864
+ if (Io(r6)) {
31865
+ let e = Do(r6);
31866
31866
  if (e) return e;
31867
31867
  }
31868
31868
  if (r6.resourceType === "Device") {
31869
- let e = Do(r6);
31869
+ let e = Vo(r6);
31870
31870
  if (e) return e;
31871
31871
  }
31872
- if (r6.resourceType === "MedicationRequest" && r6.medicationCodeableConcept) return $e(r6.medicationCodeableConcept);
31872
+ if (r6.resourceType === "MedicationRequest" && r6.medicationCodeableConcept) return Ge(r6.medicationCodeableConcept);
31873
31873
  if (r6.resourceType === "Subscription" && r6.criteria) return r6.criteria;
31874
31874
  if (r6.resourceType === "User" && r6.email) return r6.email;
31875
31875
  if ("name" in r6 && r6.name && typeof r6.name == "string") return r6.name;
31876
31876
  if ("code" in r6 && r6.code) {
31877
31877
  let e = r6.code;
31878
- if (Array.isArray(e) && (e = e[0]), Or(e)) return $e(e);
31879
- if (Bo(e)) return e.text;
31878
+ if (Array.isArray(e) && (e = e[0]), Or(e)) return Ge(e);
31879
+ if (Wo(e)) return e.text;
31880
31880
  }
31881
31881
  return B(r6) ?? "";
31882
31882
  }
31883
- function ko(r6) {
31883
+ function Do(r6) {
31884
31884
  let e = r6.name;
31885
31885
  if (e && e.length > 0) return He(e[0]);
31886
31886
  }
31887
- function Do(r6) {
31887
+ function Vo(r6) {
31888
31888
  let e = r6.deviceName;
31889
31889
  if (e && e.length > 0) return e[0].name;
31890
31890
  }
@@ -31910,9 +31910,9 @@ function mt(r6, e) {
31910
31910
  return JSON.stringify(t, null, e ? 2 : void 0) ?? "";
31911
31911
  }
31912
31912
  function Dr(r6) {
31913
- if (!(r6 == null || r6 === "")) return typeof r6 == "object" ? Array.isArray(r6) ? Mo(r6) : _o(r6) : r6;
31913
+ if (!(r6 == null || r6 === "")) return typeof r6 == "object" ? Array.isArray(r6) ? _o(r6) : Lo(r6) : r6;
31914
31914
  }
31915
- function Mo(r6) {
31915
+ function _o(r6) {
31916
31916
  let e = r6.length;
31917
31917
  if (e === 0) return;
31918
31918
  let t, n = 0;
@@ -31922,7 +31922,7 @@ function Mo(r6) {
31922
31922
  }
31923
31923
  if (n !== 0) return t ?? r6;
31924
31924
  }
31925
- function _o(r6) {
31925
+ function Lo(r6) {
31926
31926
  let e, t = 0;
31927
31927
  for (let n in r6) {
31928
31928
  let i2 = r6[n], o = Dr(i2);
@@ -31933,22 +31933,22 @@ function _o(r6) {
31933
31933
  function S(r6) {
31934
31934
  if (r6 == null) return true;
31935
31935
  let e = typeof r6;
31936
- return e === "string" || e === "object" ? !X(r6) : false;
31936
+ return e === "string" || e === "object" ? !Y(r6) : false;
31937
31937
  }
31938
- function X(r6) {
31938
+ function Y(r6) {
31939
31939
  if (r6 == null) return false;
31940
31940
  let e = typeof r6;
31941
31941
  return e === "string" && r6 !== "" || e === "object" && ("length" in r6 && r6.length > 0 || Object.keys(r6).length > 0);
31942
31942
  }
31943
31943
  function ie(r6, e, t) {
31944
- return r6 === e || S(r6) && S(e) ? true : S(r6) || S(e) ? false : Array.isArray(r6) && Array.isArray(e) ? Lo(r6, e) : Array.isArray(r6) || Array.isArray(e) ? false : E(r6) && E(e) ? Fo(r6, e, t) : (E(r6) || E(e), false);
31944
+ return r6 === e || S(r6) && S(e) ? true : S(r6) || S(e) ? false : Array.isArray(r6) && Array.isArray(e) ? Fo(r6, e) : Array.isArray(r6) || Array.isArray(e) ? false : E(r6) && E(e) ? No(r6, e, t) : (E(r6) || E(e), false);
31945
31945
  }
31946
- function Lo(r6, e) {
31946
+ function Fo(r6, e) {
31947
31947
  if (r6.length !== e.length) return false;
31948
31948
  for (let t = 0; t < r6.length; t++) if (!ie(r6[t], e[t])) return false;
31949
31949
  return true;
31950
31950
  }
31951
- function Fo(r6, e, t) {
31951
+ function No(r6, e, t) {
31952
31952
  let n = /* @__PURE__ */ new Set();
31953
31953
  Object.keys(r6).forEach((i2) => n.add(i2)), Object.keys(e).forEach((i2) => n.add(i2)), t === "meta" && (n.delete("versionId"), n.delete("lastUpdated"), n.delete("author"));
31954
31954
  for (let i2 of n) {
@@ -31960,7 +31960,7 @@ function Fo(r6, e, t) {
31960
31960
  function E(r6) {
31961
31961
  return r6 !== null && typeof r6 == "object";
31962
31962
  }
31963
- function Yn(r6) {
31963
+ function Kn(r6) {
31964
31964
  return r6.every(Vr);
31965
31965
  }
31966
31966
  function Vr(r6) {
@@ -31972,22 +31972,22 @@ function Ar(r6) {
31972
31972
  function Or(r6) {
31973
31973
  return E(r6) && "coding" in r6 && Array.isArray(r6.coding) && r6.coding.every(Ar);
31974
31974
  }
31975
- function Bo(r6) {
31975
+ function Wo(r6) {
31976
31976
  return E(r6) && "text" in r6 && typeof r6.text == "string";
31977
31977
  }
31978
31978
  var Xn = [];
31979
31979
  for (let r6 = 0; r6 < 256; r6++) Xn.push(r6.toString(16).padStart(2, "0"));
31980
- function Zn(r6) {
31981
- let e = ti(r6), t = new Uint8Array(e), n = new Array(t.length);
31980
+ function Yn(r6) {
31981
+ let e = ei(r6), t = new Uint8Array(e), n = new Array(t.length);
31982
31982
  for (let i2 = 0; i2 < t.length; i2++) n[i2] = Xn[t[i2]];
31983
31983
  return n.join("");
31984
31984
  }
31985
- function ei(r6) {
31986
- let e = ti(r6), t = new Uint8Array(e), n = new Array(t.length);
31985
+ function Zn(r6) {
31986
+ let e = ei(r6), t = new Uint8Array(e), n = new Array(t.length);
31987
31987
  for (let i2 = 0; i2 < t.length; i2++) n[i2] = String.fromCharCode(t[i2]);
31988
31988
  return window.btoa(n.join(""));
31989
31989
  }
31990
- function ti(r6) {
31990
+ function ei(r6) {
31991
31991
  return ArrayBuffer.isView(r6) ? r6.buffer : r6;
31992
31992
  }
31993
31993
  function I(r6) {
@@ -32002,21 +32002,21 @@ function yt(r6) {
32002
32002
  function Fr(r6) {
32003
32003
  return r6.endsWith("/") ? r6 : r6 + "/";
32004
32004
  }
32005
- function Qo(r6) {
32005
+ function zo(r6) {
32006
32006
  return r6.startsWith("/") ? r6.slice(1) : r6;
32007
32007
  }
32008
32008
  function W(r6, e) {
32009
- return new URL(Qo(e), Fr(r6.toString())).toString();
32009
+ return new URL(zo(e), Fr(r6.toString())).toString();
32010
32010
  }
32011
- function oi(r6, e) {
32011
+ function ii(r6, e) {
32012
32012
  return W(r6, e).toString().replace("http://", "ws://").replace("https://", "wss://");
32013
32013
  }
32014
- function si(r6) {
32014
+ function oi(r6) {
32015
32015
  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();
32016
32016
  }
32017
- var zo = /^(([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])$/;
32017
+ var Jo = /^(([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])$/;
32018
32018
  function El(r6) {
32019
- return zo.test(r6);
32019
+ return Jo.test(r6);
32020
32020
  }
32021
32021
  function He(r6, e) {
32022
32022
  if (!r6) return "";
@@ -32027,12 +32027,12 @@ function He(r6, e) {
32027
32027
  }
32028
32028
  return t.join(" ").trim();
32029
32029
  }
32030
- function $e(r6) {
32030
+ function Ge(r6) {
32031
32031
  if (!r6) return "";
32032
32032
  let e = ge(r6.text);
32033
- return e || (r6.coding ? r6.coding.map((t) => ai(t)).join(", ") : "");
32033
+ return e || (r6.coding ? r6.coding.map((t) => si(t)).join(", ") : "");
32034
32034
  }
32035
- function ai(r6, e) {
32035
+ function si(r6, e) {
32036
32036
  let t = ge(r6?.display);
32037
32037
  if (t) {
32038
32038
  let n = e ? ge(r6?.code) : void 0;
@@ -32044,32 +32044,32 @@ function ge(r6) {
32044
32044
  return typeof r6 == "string" ? r6 : void 0;
32045
32045
  }
32046
32046
  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" };
32047
- function Fn(r6) {
32047
+ function Ln(r6) {
32048
32048
  let e = Array.isArray(r6) ? r6 : r6.entry?.map((t) => t.resource) ?? [];
32049
- for (let t of e) t?.resourceType === "StructureDefinition" && t.kind === "resource" && li(t.type);
32049
+ for (let t of e) t?.resourceType === "StructureDefinition" && t.kind === "resource" && ui(t.type);
32050
32050
  }
32051
- function li(r6) {
32051
+ function ui(r6) {
32052
32052
  let e = L.types[r6];
32053
- return e || (e = { searchParamsDetails: {} }, L.types[r6] = e), e.searchParams || (e.searchParams = { _id: { base: [r6], code: "_id", type: "token", expression: r6 + ".id" }, _lastUpdated: { base: [r6], code: "_lastUpdated", type: "date", expression: r6 + ".meta.lastUpdated" }, _compartment: { base: [r6], code: "_compartment", type: "reference", expression: r6 + ".meta.compartment" }, _profile: { base: [r6], code: "_profile", type: "uri", expression: r6 + ".meta.profile" }, _security: { base: [r6], code: "_security", type: "token", expression: r6 + ".meta.security" }, _source: { base: [r6], code: "_source", type: "uri", expression: r6 + ".meta.source" }, _tag: { base: [r6], code: "_tag", type: "token", expression: r6 + ".meta.tag" } }), e;
32053
+ return e || (e = { searchParamsDetails: {} }, L.types[r6] = e), !e.searchParams && r6 !== "Binary" && (e.searchParams = { _id: { base: [r6], code: "_id", type: "token", expression: r6 + ".id" }, _lastUpdated: { base: [r6], code: "_lastUpdated", type: "date", expression: r6 + ".meta.lastUpdated" }, _compartment: { base: [r6], code: "_compartment", type: "reference", expression: r6 + ".meta.compartment" }, _profile: { base: [r6], code: "_profile", type: "uri", expression: r6 + ".meta.profile" }, _security: { base: [r6], code: "_security", type: "token", expression: r6 + ".meta.security" }, _source: { base: [r6], code: "_source", type: "uri", expression: r6 + ".meta.source" }, _tag: { base: [r6], code: "_tag", type: "token", expression: r6 + ".meta.tag" } }), e;
32054
32054
  }
32055
32055
  function Br(r6) {
32056
32056
  for (let e of r6.base ?? []) {
32057
- let t = li(e);
32057
+ let t = ui(e);
32058
32058
  t.searchParams || (t.searchParams = {}), t.searchParams[r6.code] = r6;
32059
32059
  }
32060
32060
  }
32061
32061
  function hr(r6) {
32062
32062
  let e = r6.type?.[0]?.code;
32063
- return e === "BackboneElement" || e === "Element" ? os((r6.base?.path ?? r6.path)?.split(".")) : e;
32063
+ return e === "BackboneElement" || e === "Element" ? ss((r6.base?.path ?? r6.path)?.split(".")) : e;
32064
32064
  }
32065
- function os(r6) {
32065
+ function ss(r6) {
32066
32066
  return r6.length === 1 ? r6[0] : r6.map(I).join("");
32067
32067
  }
32068
32068
  function ft(r6, e, t) {
32069
- let n = Be(r6, t);
32070
- if (n) return us(n.elements, e);
32069
+ let n = We(r6, t);
32070
+ if (n) return ls(n.elements, e);
32071
32071
  }
32072
- function us(r6, e) {
32072
+ function ls(r6, e) {
32073
32073
  let t = r6[e] ?? r6[e + "[x]"];
32074
32074
  if (t) return t;
32075
32075
  for (let n = 0; n < e.length; n++) {
@@ -32083,11 +32083,11 @@ function us(r6, e) {
32083
32083
  function A(r6, e) {
32084
32084
  return !(!r6 || typeof r6 != "object" || !("resourceType" in r6) || e && r6.resourceType !== e);
32085
32085
  }
32086
- function Y(r6) {
32086
+ function X(r6) {
32087
32087
  return !!(r6 && typeof r6 == "object" && "reference" in r6 && typeof r6.reference == "string");
32088
32088
  }
32089
32089
  var L = { types: {} };
32090
- function Ve(r6) {
32090
+ function Me(r6) {
32091
32091
  if (r6.startsWith("T")) return r6 + "T00:00:00.000Z".substring(r6.length);
32092
32092
  if (r6.length <= 10) return r6;
32093
32093
  try {
@@ -32171,11 +32171,11 @@ var O = { empty: (r6, e) => h(e.length === 0 || e.every((t) => S(t.value))), has
32171
32171
  }, convertsToInteger: (r6, e) => e.length === 0 ? [] : h(O.toInteger(r6, e).length === 1), toDate: (r6, e) => {
32172
32172
  if (e.length === 0) return [];
32173
32173
  let [{ value: t }] = z(e, 1);
32174
- return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.date, value: Ve(t) }] : [];
32174
+ return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.date, value: Me(t) }] : [];
32175
32175
  }, convertsToDate: (r6, e) => e.length === 0 ? [] : h(O.toDate(r6, e).length === 1), toDateTime: (r6, e) => {
32176
32176
  if (e.length === 0) return [];
32177
32177
  let [{ value: t }] = z(e, 1);
32178
- return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.dateTime, value: Ve(t) }] : [];
32178
+ return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.dateTime, value: Me(t) }] : [];
32179
32179
  }, convertsToDateTime: (r6, e) => e.length === 0 ? [] : h(O.toDateTime(r6, e).length === 1), toDecimal: (r6, e) => {
32180
32180
  if (e.length === 0) return [];
32181
32181
  let [{ value: t }] = z(e, 1);
@@ -32193,7 +32193,7 @@ var O = { empty: (r6, e) => h(e.length === 0 || e.every((t) => S(t.value))), has
32193
32193
  let [{ value: t }] = z(e, 1);
32194
32194
  if (typeof t == "string") {
32195
32195
  let n = /^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(t);
32196
- if (n) return [{ type: l.time, value: Ve("T" + n[1]) }];
32196
+ if (n) return [{ type: l.time, value: Me("T" + n[1]) }];
32197
32197
  }
32198
32198
  return [];
32199
32199
  }, convertsToTime: (r6, e) => e.length === 0 ? [] : h(O.toTime(r6, e).length === 1), indexOf: (r6, e, t) => F((n, i2) => n.indexOf(i2), r6, e, t), substring: (r6, e, t, n) => F((i2, o, s) => {
@@ -32378,8 +32378,8 @@ var St = class extends R {
32378
32378
  super("in", e, t);
32379
32379
  }
32380
32380
  eval(e, t) {
32381
- let n = H(this.left.eval(e, t)), i2 = this.right.eval(e, t);
32382
- return n ? h(i2.some((o) => je(n, o)[0].value)) : [];
32381
+ let n = G(this.left.eval(e, t)), i2 = this.right.eval(e, t);
32382
+ return n ? h(i2.some((o) => $e(n, o)[0].value)) : [];
32383
32383
  }
32384
32384
  };
32385
32385
  var ae = class extends te {
@@ -32408,7 +32408,7 @@ var bt = class extends R {
32408
32408
  }
32409
32409
  eval(e, t) {
32410
32410
  let n = this.left.eval(e, t), i2 = this.right.eval(e, t);
32411
- return $n(n, i2);
32411
+ return jn(n, i2);
32412
32412
  }
32413
32413
  };
32414
32414
  var Et = class extends R {
@@ -32417,7 +32417,7 @@ var Et = class extends R {
32417
32417
  }
32418
32418
  eval(e, t) {
32419
32419
  let n = this.left.eval(e, t), i2 = this.right.eval(e, t);
32420
- return Hn(n, i2);
32420
+ return $n(n, i2);
32421
32421
  }
32422
32422
  };
32423
32423
  var Rt = class extends R {
@@ -32435,7 +32435,7 @@ var Ct = class extends R {
32435
32435
  }
32436
32436
  eval(e, t) {
32437
32437
  let n = this.left.eval(e, t), i2 = this.right.eval(e, t);
32438
- return jn(Pr(n, i2));
32438
+ return qn(Pr(n, i2));
32439
32439
  }
32440
32440
  };
32441
32441
  var Te = class extends R {
@@ -32454,7 +32454,7 @@ var Pt = class extends R {
32454
32454
  super("and", e, t);
32455
32455
  }
32456
32456
  eval(e, t) {
32457
- let n = H(this.left.eval(e, t), "boolean"), i2 = H(this.right.eval(e, t), "boolean");
32457
+ let n = G(this.left.eval(e, t), "boolean"), i2 = G(this.right.eval(e, t), "boolean");
32458
32458
  return n?.value === true && i2?.value === true ? h(true) : n?.value === false || i2?.value === false ? h(false) : [];
32459
32459
  }
32460
32460
  };
@@ -32463,7 +32463,7 @@ var wt = class extends R {
32463
32463
  super("or", e, t);
32464
32464
  }
32465
32465
  eval(e, t) {
32466
- let n = H(this.left.eval(e, t), "boolean"), i2 = H(this.right.eval(e, t), "boolean");
32466
+ let n = G(this.left.eval(e, t), "boolean"), i2 = G(this.right.eval(e, t), "boolean");
32467
32467
  return n?.value === false && i2?.value === false ? h(false) : n?.value || i2?.value ? h(true) : [];
32468
32468
  }
32469
32469
  };
@@ -32472,7 +32472,7 @@ var At = class extends R {
32472
32472
  super("xor", e, t);
32473
32473
  }
32474
32474
  eval(e, t) {
32475
- let n = H(this.left.eval(e, t), "boolean"), i2 = H(this.right.eval(e, t), "boolean");
32475
+ let n = G(this.left.eval(e, t), "boolean"), i2 = G(this.right.eval(e, t), "boolean");
32476
32476
  return !n || !i2 ? [] : h(n.value !== i2.value);
32477
32477
  }
32478
32478
  };
@@ -32481,7 +32481,7 @@ var Ot = class extends R {
32481
32481
  super("implies", e, t);
32482
32482
  }
32483
32483
  eval(e, t) {
32484
- let n = H(this.left.eval(e, t), "boolean"), i2 = H(this.right.eval(e, t), "boolean");
32484
+ let n = G(this.left.eval(e, t), "boolean"), i2 = G(this.right.eval(e, t), "boolean");
32485
32485
  return i2?.value === true || n?.value === false ? h(true) : !n || !i2 ? [] : h(false);
32486
32486
  }
32487
32487
  };
@@ -32514,38 +32514,38 @@ var Se = class {
32514
32514
  return `${this.left.toString()}[${this.expr.toString()}]`;
32515
32515
  }
32516
32516
  };
32517
- var Qe = ["!=", "!~", "<=", ">=", "{}", "->"];
32517
+ var ze = ["!=", "!~", "<=", ">=", "{}", "->"];
32518
32518
  var g = { FunctionCall: 0, Dot: 1, Indexer: 2, UnaryAdd: 3, UnarySubtract: 3, Multiply: 4, Divide: 4, IntegerDivide: 4, Modulo: 4, Add: 5, Subtract: 5, Ampersand: 5, Is: 6, As: 6, Union: 7, GreaterThan: 8, GreaterThanOrEquals: 8, LessThan: 8, LessThanOrEquals: 8, Equals: 9, Equivalent: 9, NotEquals: 9, NotEquivalent: 9, In: 10, Contains: 10, And: 11, Xor: 12, Or: 12, Implies: 13, Arrow: 100, Semicolon: 200 };
32519
- var ps = { parse(r6) {
32519
+ var fs2 = { parse(r6) {
32520
32520
  let e = r6.consumeAndParse();
32521
32521
  if (!r6.match(")")) throw new Error("Parse error: expected `)` got `" + r6.peek()?.value + "`");
32522
32522
  return e;
32523
32523
  } };
32524
- var fs2 = { parse(r6, e) {
32524
+ var hs = { parse(r6, e) {
32525
32525
  let t = r6.consumeAndParse();
32526
32526
  if (!r6.match("]")) throw new Error("Parse error: expected `]`");
32527
32527
  return new Se(e, t);
32528
32528
  }, precedence: g.Indexer };
32529
- var hs = { parse(r6, e) {
32529
+ var ms = { parse(r6, e) {
32530
32530
  if (!(e instanceof q)) throw new Error("Unexpected parentheses");
32531
32531
  let t = [];
32532
32532
  for (; !r6.match(")"); ) t.push(r6.consumeAndParse()), r6.match(",");
32533
32533
  return new ee(e.name, t);
32534
32534
  }, precedence: g.FunctionCall };
32535
- function ms(r6) {
32535
+ function ys(r6) {
32536
32536
  let e = r6.split(" "), t = parseFloat(e[0]), n = e[1];
32537
32537
  return n?.startsWith("'") && n.endsWith("'") ? n = n.substring(1, n.length - 1) : n = "{" + n + "}", { value: t, unit: n };
32538
32538
  }
32539
- function ze() {
32540
- return new nt().registerPrefix("String", { parse: (r6, e) => new N({ type: l.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r6, e) => new N({ type: l.dateTime, value: Ve(e.value) }) }).registerPrefix("Quantity", { parse: (r6, e) => new N({ type: l.Quantity, value: ms(e.value) }) }).registerPrefix("Number", { parse: (r6, e) => new N({ type: e.value.includes(".") ? l.decimal : l.integer, value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new N({ type: l.boolean, value: true }) }).registerPrefix("false", { parse: () => new N({ type: l.boolean, value: false }) }).registerPrefix("Symbol", { parse: (r6, e) => new q(e.value) }).registerPrefix("{}", { parse: () => new gt() }).registerPrefix("(", ps).registerInfix("[", fs2).registerInfix("(", hs).prefix("+", g.UnaryAdd, (r6, e) => new xt("+", e, (t) => t)).prefix("-", g.UnarySubtract, (r6, e) => new D("-", e, e, (t, n) => -n)).infixLeft(".", g.Dot, (r6, e, t) => new ae(r6, t)).infixLeft("/", g.Divide, (r6, e, t) => new D("/", r6, t, (n, i2) => n / i2)).infixLeft("*", g.Multiply, (r6, e, t) => new D("*", r6, t, (n, i2) => n * i2)).infixLeft("+", g.Add, (r6, e, t) => new D("+", r6, t, (n, i2) => n + i2)).infixLeft("-", g.Subtract, (r6, e, t) => new D("-", r6, t, (n, i2) => n - i2)).infixLeft("|", g.Union, (r6, e, t) => new ve(r6, t)).infixLeft("=", g.Equals, (r6, e, t) => new bt(r6, t)).infixLeft("!=", g.NotEquals, (r6, e, t) => new Et(r6, t)).infixLeft("~", g.Equivalent, (r6, e, t) => new Rt(r6, t)).infixLeft("!~", g.NotEquivalent, (r6, e, t) => new Ct(r6, t)).infixLeft("<", g.LessThan, (r6, e, t) => new D("<", r6, t, (n, i2) => n < i2)).infixLeft("<=", g.LessThanOrEquals, (r6, e, t) => new D("<=", r6, t, (n, i2) => n <= i2)).infixLeft(">", g.GreaterThan, (r6, e, t) => new D(">", r6, t, (n, i2) => n > i2)).infixLeft(">=", g.GreaterThanOrEquals, (r6, e, t) => new D(">=", r6, t, (n, i2) => n >= i2)).infixLeft("&", g.Ampersand, (r6, e, t) => new vt(r6, t)).infixLeft("and", g.And, (r6, e, t) => new Pt(r6, t)).infixLeft("as", g.As, (r6, e, t) => new ce(r6, t)).infixLeft("contains", g.Contains, (r6, e, t) => new Tt(r6, t)).infixLeft("div", g.Divide, (r6, e, t) => new D("div", r6, t, (n, i2) => n / i2 | 0)).infixLeft("in", g.In, (r6, e, t) => new St(r6, t)).infixLeft("is", g.Is, (r6, e, t) => new Te(r6, t)).infixLeft("mod", g.Modulo, (r6, e, t) => new D("mod", r6, t, (n, i2) => n % i2)).infixLeft("or", g.Or, (r6, e, t) => new wt(r6, t)).infixLeft("xor", g.Xor, (r6, e, t) => new At(r6, t)).infixLeft("implies", g.Implies, (r6, e, t) => new Ot(r6, t));
32539
+ function Je() {
32540
+ return new nt().registerPrefix("String", { parse: (r6, e) => new N({ type: l.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r6, e) => new N({ type: l.dateTime, value: Me(e.value) }) }).registerPrefix("Quantity", { parse: (r6, e) => new N({ type: l.Quantity, value: ys(e.value) }) }).registerPrefix("Number", { parse: (r6, e) => new N({ type: e.value.includes(".") ? l.decimal : l.integer, value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new N({ type: l.boolean, value: true }) }).registerPrefix("false", { parse: () => new N({ type: l.boolean, value: false }) }).registerPrefix("Symbol", { parse: (r6, e) => new q(e.value) }).registerPrefix("{}", { parse: () => new gt() }).registerPrefix("(", fs2).registerInfix("[", hs).registerInfix("(", ms).prefix("+", g.UnaryAdd, (r6, e) => new xt("+", e, (t) => t)).prefix("-", g.UnarySubtract, (r6, e) => new D("-", e, e, (t, n) => -n)).infixLeft(".", g.Dot, (r6, e, t) => new ae(r6, t)).infixLeft("/", g.Divide, (r6, e, t) => new D("/", r6, t, (n, i2) => n / i2)).infixLeft("*", g.Multiply, (r6, e, t) => new D("*", r6, t, (n, i2) => n * i2)).infixLeft("+", g.Add, (r6, e, t) => new D("+", r6, t, (n, i2) => n + i2)).infixLeft("-", g.Subtract, (r6, e, t) => new D("-", r6, t, (n, i2) => n - i2)).infixLeft("|", g.Union, (r6, e, t) => new ve(r6, t)).infixLeft("=", g.Equals, (r6, e, t) => new bt(r6, t)).infixLeft("!=", g.NotEquals, (r6, e, t) => new Et(r6, t)).infixLeft("~", g.Equivalent, (r6, e, t) => new Rt(r6, t)).infixLeft("!~", g.NotEquivalent, (r6, e, t) => new Ct(r6, t)).infixLeft("<", g.LessThan, (r6, e, t) => new D("<", r6, t, (n, i2) => n < i2)).infixLeft("<=", g.LessThanOrEquals, (r6, e, t) => new D("<=", r6, t, (n, i2) => n <= i2)).infixLeft(">", g.GreaterThan, (r6, e, t) => new D(">", r6, t, (n, i2) => n > i2)).infixLeft(">=", g.GreaterThanOrEquals, (r6, e, t) => new D(">=", r6, t, (n, i2) => n >= i2)).infixLeft("&", g.Ampersand, (r6, e, t) => new vt(r6, t)).infixLeft("and", g.And, (r6, e, t) => new Pt(r6, t)).infixLeft("as", g.As, (r6, e, t) => new ce(r6, t)).infixLeft("contains", g.Contains, (r6, e, t) => new Tt(r6, t)).infixLeft("div", g.Divide, (r6, e, t) => new D("div", r6, t, (n, i2) => n / i2 | 0)).infixLeft("in", g.In, (r6, e, t) => new St(r6, t)).infixLeft("is", g.Is, (r6, e, t) => new Te(r6, t)).infixLeft("mod", g.Modulo, (r6, e, t) => new D("mod", r6, t, (n, i2) => n % i2)).infixLeft("or", g.Or, (r6, e, t) => new wt(r6, t)).infixLeft("xor", g.Xor, (r6, e, t) => new At(r6, t)).infixLeft("implies", g.Implies, (r6, e, t) => new Ot(r6, t));
32541
32541
  }
32542
- var ys = ze();
32542
+ var gs = Je();
32543
32543
  var f = { EQUALS: "eq", NOT_EQUALS: "ne", GREATER_THAN: "gt", LESS_THAN: "lt", GREATER_THAN_OR_EQUALS: "ge", LESS_THAN_OR_EQUALS: "le", STARTS_AFTER: "sa", ENDS_BEFORE: "eb", APPROXIMATELY: "ap", CONTAINS: "contains", STARTS_WITH: "sw", EXACT: "exact", TEXT: "text", NOT: "not", ABOVE: "above", BELOW: "below", IN: "in", NOT_IN: "not-in", OF_TYPE: "of-type", MISSING: "missing", PRESENT: "present", IDENTIFIER: "identifier", ITERATE: "iterate" };
32544
- var xi = { contains: f.CONTAINS, exact: f.EXACT, above: f.ABOVE, below: f.BELOW, text: f.TEXT, not: f.NOT, in: f.IN, "not-in": f.NOT_IN, "of-type": f.OF_TYPE, missing: f.MISSING, identifier: f.IDENTIFIER, iterate: f.ITERATE };
32544
+ var gi = { contains: f.CONTAINS, exact: f.EXACT, above: f.ABOVE, below: f.BELOW, text: f.TEXT, not: f.NOT, in: f.IN, "not-in": f.NOT_IN, "of-type": f.OF_TYPE, missing: f.MISSING, identifier: f.IDENTIFIER, iterate: f.ITERATE };
32545
32545
  var qr = { eq: f.EQUALS, ne: f.NOT_EQUALS, lt: f.LESS_THAN, le: f.LESS_THAN_OR_EQUALS, gt: f.GREATER_THAN, ge: f.GREATER_THAN_OR_EQUALS, sa: f.STARTS_AFTER, eb: f.ENDS_BEFORE, ap: f.APPROXIMATELY, sw: f.STARTS_WITH };
32546
- var Ps = [f.MISSING, f.PRESENT];
32547
- var Ke = { READ: "read", VREAD: "vread", UPDATE: "update", PATCH: "patch", DELETE: "delete", HISTORY: "history", HISTORY_INSTANCE: "history-instance", HISTORY_TYPE: "history-type", HISTORY_SYSTEM: "history-system", CREATE: "create", SEARCH: "search", SEARCH_TYPE: "search-type", SEARCH_SYSTEM: "search-system", SEARCH_COMPARTMENT: "search-compartment", CAPABILITIES: "capabilities", TRANSACTION: "transaction", BATCH: "batch", OPERATION: "operation" };
32548
- var Gs = [Ke.READ, Ke.VREAD, Ke.HISTORY, Ke.HISTORY_INSTANCE];
32546
+ var ws = [f.MISSING, f.PRESENT];
32547
+ var be = { READ: "read", VREAD: "vread", UPDATE: "update", DELETE: "delete", HISTORY: "history", CREATE: "create", SEARCH: "search" };
32548
+ var Qs = [be.READ, be.VREAD, be.HISTORY, be.SEARCH];
32549
32549
  function Ks(r6) {
32550
32550
  if (typeof window < "u") {
32551
32551
  let e = window.atob(r6), t = Uint8Array.from(e, (n) => n.charCodeAt(0));
@@ -32562,20 +32562,19 @@ function Ft(r6) {
32562
32562
  if (typeof Buffer < "u") return Buffer.from(r6, "utf8").toString("base64");
32563
32563
  throw new Error("Unable to encode base64");
32564
32564
  }
32565
- function Ti(r6) {
32566
- if (typeof Buffer < "u") return Buffer.from(r6, "base64url").toString("utf-8");
32565
+ function Si(r6) {
32567
32566
  r6 = r6.padEnd(r6.length + (4 - r6.length % 4) % 4, "=");
32568
32567
  let e = r6.replace(/-/g, "+").replace(/_/g, "/");
32569
32568
  return Ks(e);
32570
32569
  }
32571
- function Hr() {
32570
+ function $r() {
32572
32571
  let r6 = new Uint32Array(28);
32573
- return crypto.getRandomValues(r6), Zn(r6.buffer);
32572
+ return crypto.getRandomValues(r6), Yn(r6.buffer);
32574
32573
  }
32575
- async function Si(r6) {
32574
+ async function bi(r6) {
32576
32575
  return crypto.subtle.digest("SHA-256", new TextEncoder().encode(r6));
32577
32576
  }
32578
- function be() {
32577
+ function Ee() {
32579
32578
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (r6) => {
32580
32579
  let e = Math.random() * 16 | 0;
32581
32580
  return (r6 === "x" ? e : e & 3 | 8).toString(16);
@@ -32624,33 +32623,33 @@ var J = class {
32624
32623
  this.emitter.removeAllListeners();
32625
32624
  }
32626
32625
  };
32627
- var Qr = { "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" };
32626
+ var Hr = { "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" };
32628
32627
  var ra = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
32629
- var zr = ["DiagnosticReport-update"];
32630
- function Ei(r6) {
32631
- return zr.includes(r6);
32632
- }
32628
+ var Qr = ["DiagnosticReport-update"];
32633
32629
  function Ri(r6) {
32634
- if (zr.includes(r6)) throw new p(y(`'context.version' is required for '${r6}'.`));
32630
+ return Qr.includes(r6);
32631
+ }
32632
+ function Ci(r6) {
32633
+ if (Qr.includes(r6)) throw new p(y(`'context.version' is required for '${r6}'.`));
32635
32634
  }
32636
32635
  var na = { "Patient-open": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "Patient-close": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "ImagingStudy-open": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "ImagingStudy-close": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "Encounter-open": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "Encounter-close": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "DiagnosticReport-open": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-close": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-select": { report: { resourceType: "DiagnosticReport", reference: true }, patient: { resourceType: "Patient", optional: true, reference: true }, select: { resourceType: "*", reference: true, manyAllowed: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport", reference: true }, patient: { resourceType: "Patient", optional: true, reference: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
32637
32636
  function ia(r6) {
32638
32637
  return ra.includes(r6);
32639
32638
  }
32640
- function Ci(r6) {
32639
+ function Pi(r6) {
32641
32640
  return !!r6.endpoint;
32642
32641
  }
32643
- function Jr(r6) {
32642
+ function zr(r6) {
32644
32643
  if (!Ut(r6)) throw new p(y("subscriptionRequest must be an object conforming to SubscriptionRequest type."));
32645
32644
  let { channelType: e, mode: t, topic: n, events: i2 } = r6, o = { "hub.channel.type": e, "hub.mode": t, "hub.topic": n, "hub.events": i2.join(",") };
32646
- return Ci(r6) && (o.endpoint = r6.endpoint), new URLSearchParams(o).toString();
32645
+ return Pi(r6) && (o.endpoint = r6.endpoint), new URLSearchParams(o).toString();
32647
32646
  }
32648
32647
  function Ut(r6) {
32649
32648
  if (typeof r6 != "object") return false;
32650
32649
  let { channelType: e, mode: t, topic: n, events: i2 } = r6;
32651
32650
  if (!(e && t && n && i2) || typeof n != "string" || typeof i2 != "object" || !Array.isArray(i2) || i2.length < 1 || e !== "websocket" || t !== "subscribe" && t !== "unsubscribe") return false;
32652
- for (let o of i2) if (!Qr[o]) return false;
32653
- return !(Ci(r6) && !(typeof r6.endpoint == "string" && r6.endpoint.startsWith("ws")));
32651
+ for (let o of i2) if (!Hr[o]) return false;
32652
+ return !(Pi(r6) && !(typeof r6.endpoint == "string" && r6.endpoint.startsWith("ws")));
32654
32653
  }
32655
32654
  function oa(r6, e, t, n) {
32656
32655
  if (typeof e != "object") throw new p(y(`context[${t}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));
@@ -32664,7 +32663,7 @@ function oa(r6, e, t, n) {
32664
32663
  }
32665
32664
  function sa(r6, e, t, n, i2) {
32666
32665
  if (i2.set(e.key, (i2.get(e.key) ?? 0) + 1), n.reference) {
32667
- if (!Y(e.reference)) throw new p(y(`context[${t}] is invalid. Expected key '${e.key}' to be a reference.`));
32666
+ if (!X(e.reference)) throw new p(y(`context[${t}] is invalid. Expected key '${e.key}' to be a reference.`));
32668
32667
  } else oa(r6, e.resource, t, n);
32669
32668
  }
32670
32669
  function aa(r6, e) {
@@ -32679,13 +32678,13 @@ function aa(r6, e) {
32679
32678
  if (!o.manyAllowed && (t.get(i2) ?? 0) > 1) throw new p(y(`${t.get(i2)} context entries with key '${i2}' found for the '${r6}' event when schema only allows for 1.`));
32680
32679
  }
32681
32680
  }
32682
- function Kr(r6, e, t, n) {
32681
+ function Jr(r6, e, t, n) {
32683
32682
  if (!(r6 && typeof r6 == "string")) throw new p(y("Must provide a topic."));
32684
- if (!Qr[e]) throw new p(y(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Qr).join(", ")}`));
32683
+ if (!Hr[e]) throw new p(y(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Hr).join(", ")}`));
32685
32684
  if (typeof t != "object") throw new p(y("context must be a context object or array of context objects."));
32686
- if (zr.includes(e) && !n) throw new p(y(`The '${e}' event must contain a 'context.versionId'.`));
32685
+ if (Qr.includes(e) && !n) throw new p(y(`The '${e}' event must contain a 'context.versionId'.`));
32687
32686
  let i2 = Array.isArray(t) ? t : [t];
32688
- return aa(e, i2), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: be(), event: { "hub.topic": r6, "hub.event": e, context: i2, ...n ? { "context.versionId": n } : {} } };
32687
+ return aa(e, i2), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: Ee(), event: { "hub.topic": r6, "hub.event": e, context: i2, ...n ? { "context.versionId": n } : {} } };
32689
32688
  }
32690
32689
  var Nt = class extends J {
32691
32690
  constructor(e) {
@@ -32708,23 +32707,23 @@ var Nt = class extends J {
32708
32707
  }
32709
32708
  };
32710
32709
  function ca(r6) {
32711
- return JSON.parse(Ti(r6));
32710
+ return JSON.parse(Si(r6));
32712
32711
  }
32713
- function Pi(r6) {
32712
+ function wi(r6) {
32714
32713
  return r6.split(".").length === 3;
32715
32714
  }
32716
32715
  function Bt(r6) {
32717
32716
  let [e, t, n] = r6.split(".");
32718
32717
  return ca(t);
32719
32718
  }
32720
- function wi(r6) {
32719
+ function Ai(r6) {
32721
32720
  try {
32722
32721
  return typeof Bt(r6).login_id == "string";
32723
32722
  } catch {
32724
32723
  return false;
32725
32724
  }
32726
32725
  }
32727
- function Ai(r6) {
32726
+ function Oi(r6) {
32728
32727
  try {
32729
32728
  let t = Bt(r6).exp;
32730
32729
  return typeof t == "number" ? t * 1e3 : void 0;
@@ -32746,11 +32745,11 @@ var Wt = class {
32746
32745
  await this.medplum.delete(`keyvalue/v1/${e}`);
32747
32746
  }
32748
32747
  };
32749
- var Oi;
32750
- Oi = Symbol.toStringTag;
32748
+ var Ii;
32749
+ Ii = Symbol.toStringTag;
32751
32750
  var V = class {
32752
32751
  constructor(e) {
32753
- this[Oi] = "ReadablePromise";
32752
+ this[Ii] = "ReadablePromise";
32754
32753
  this.status = "pending";
32755
32754
  this.suspender = e.then((t) => (this.status = "success", this.response = t, t), (t) => {
32756
32755
  throw this.status = "error", this.error = t, t;
@@ -32782,9 +32781,9 @@ var V = class {
32782
32781
  return this.suspender.finally(e);
32783
32782
  }
32784
32783
  };
32785
- var Ye = class {
32784
+ var Xe = class {
32786
32785
  constructor(e) {
32787
- this.storage = e ?? (typeof localStorage < "u" ? localStorage : new Yr());
32786
+ this.storage = e ?? (typeof localStorage < "u" ? localStorage : new Kr());
32788
32787
  }
32789
32788
  clear() {
32790
32789
  this.storage.clear();
@@ -32803,7 +32802,7 @@ var Ye = class {
32803
32802
  this.setString(e, t ? mt(t) : void 0);
32804
32803
  }
32805
32804
  };
32806
- var Yr = class {
32805
+ var Kr = class {
32807
32806
  constructor() {
32808
32807
  this.data = /* @__PURE__ */ new Map();
32809
32808
  }
@@ -32826,15 +32825,15 @@ var Yr = class {
32826
32825
  return Array.from(this.data.keys())[e];
32827
32826
  }
32828
32827
  };
32829
- var Fe = { Event: typeof globalThis.Event < "u" ? globalThis.Event : void 0, ErrorEvent: void 0, CloseEvent: void 0 };
32830
- var ki = false;
32828
+ var Ne = { Event: typeof globalThis.Event < "u" ? globalThis.Event : void 0, ErrorEvent: void 0, CloseEvent: void 0 };
32829
+ var Di = false;
32831
32830
  function ua() {
32832
32831
  if (typeof globalThis.Event > "u") throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");
32833
- Fe.Event = globalThis.Event, Fe.ErrorEvent = class extends Event {
32832
+ Ne.Event = globalThis.Event, Ne.ErrorEvent = class extends Event {
32834
32833
  constructor(e, t) {
32835
32834
  super("error", t), this.message = e.message, this.error = e;
32836
32835
  }
32837
- }, Fe.CloseEvent = class extends Event {
32836
+ }, Ne.CloseEvent = class extends Event {
32838
32837
  constructor(t = 1e3, n = "", i2) {
32839
32838
  super("close", i2);
32840
32839
  this.wasClean = true;
@@ -32848,11 +32847,11 @@ function la(r6, e) {
32848
32847
  function qt(r6) {
32849
32848
  return new r6.constructor(r6.type, r6);
32850
32849
  }
32851
- var Ee = { maxReconnectionDelay: 1e4, minReconnectionDelay: 1e3 + Math.random() * 4e3, minUptime: 5e3, reconnectionDelayGrowFactor: 1.3, connectionTimeout: 4e3, maxRetries: 1 / 0, maxEnqueuedMessages: 1 / 0, startClosed: false, debug: false };
32852
- var Di = false;
32850
+ var Re = { maxReconnectionDelay: 1e4, minReconnectionDelay: 1e3 + Math.random() * 4e3, minUptime: 5e3, reconnectionDelayGrowFactor: 1.3, connectionTimeout: 4e3, maxRetries: 1 / 0, maxEnqueuedMessages: 1 / 0, startClosed: false, debug: false };
32851
+ var Vi = false;
32853
32852
  var jt = class r extends J {
32854
32853
  constructor(t, n, i2 = {}) {
32855
- ki || (ua(), ki = true);
32854
+ Di || (ua(), Di = true);
32856
32855
  super();
32857
32856
  this._retryCount = -1;
32858
32857
  this._shouldReconnect = true;
@@ -32866,7 +32865,7 @@ var jt = class r extends J {
32866
32865
  this.onopen = null;
32867
32866
  this._handleOpen = (t2) => {
32868
32867
  this._debug("open event");
32869
- let { minUptime: n2 = Ee.minUptime } = this._options;
32868
+ let { minUptime: n2 = Re.minUptime } = this._options;
32870
32869
  clearTimeout(this._connectTimeout), this._uptimeTimeout = setTimeout(() => this._acceptOpen(), n2), la(this._ws, "WebSocket is not defined"), this._ws.binaryType = this._binaryType, this._messageQueue.forEach((i3) => this._ws?.send(i3)), this._messageQueue = [], this.onopen && this.onopen(t2), this.dispatchEvent(qt(t2));
32871
32870
  };
32872
32871
  this._handleMessage = (t2) => {
@@ -32948,7 +32947,7 @@ var jt = class r extends J {
32948
32947
  send(t) {
32949
32948
  if (this._ws && this._ws.readyState === this.OPEN) this._debug("send", t), this._ws.send(t);
32950
32949
  else {
32951
- let { maxEnqueuedMessages: n = Ee.maxEnqueuedMessages } = this._options;
32950
+ let { maxEnqueuedMessages: n = Re.maxEnqueuedMessages } = this._options;
32952
32951
  this._messageQueue.length < n && (this._debug("enqueue", t), this._messageQueue.push(t));
32953
32952
  }
32954
32953
  }
@@ -32956,7 +32955,7 @@ var jt = class r extends J {
32956
32955
  this._options.debug && this._debugLogger("RWS>", ...t);
32957
32956
  }
32958
32957
  _getNextDelay() {
32959
- let { reconnectionDelayGrowFactor: t = Ee.reconnectionDelayGrowFactor, minReconnectionDelay: n = Ee.minReconnectionDelay, maxReconnectionDelay: i2 = Ee.maxReconnectionDelay } = this._options, o = 0;
32958
+ let { reconnectionDelayGrowFactor: t = Re.reconnectionDelayGrowFactor, minReconnectionDelay: n = Re.minReconnectionDelay, maxReconnectionDelay: i2 = Re.maxReconnectionDelay } = this._options, o = 0;
32960
32959
  return this._retryCount > 0 && (o = n * Math.pow(t, this._retryCount - 1), o > i2 && (o = i2)), this._debug("next delay", o), o;
32961
32960
  }
32962
32961
  _wait() {
@@ -32967,7 +32966,7 @@ var jt = class r extends J {
32967
32966
  _connect() {
32968
32967
  if (this._connectLock || !this._shouldReconnect) return;
32969
32968
  this._connectLock = true;
32970
- let { maxRetries: t = Ee.maxRetries, connectionTimeout: n = Ee.connectionTimeout } = this._options;
32969
+ let { maxRetries: t = Re.maxRetries, connectionTimeout: n = Re.connectionTimeout } = this._options;
32971
32970
  if (this._retryCount >= t) {
32972
32971
  this._debug("max retries reached", this._retryCount, ">=", t);
32973
32972
  return;
@@ -32977,21 +32976,21 @@ var jt = class r extends J {
32977
32976
  this._connectLock = false;
32978
32977
  return;
32979
32978
  }
32980
- !this._options.WebSocket && typeof WebSocket > "u" && !Di && (console.error("\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket."), Di = true);
32979
+ !this._options.WebSocket && typeof WebSocket > "u" && !Vi && (console.error("\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket."), Vi = true);
32981
32980
  let i2 = this._options.WebSocket || WebSocket;
32982
32981
  this._debug("connect", { url: this._url, protocols: this._protocols }), this._ws = this._protocols ? new i2(this._url, this._protocols) : new i2(this._url), this._ws.binaryType = this._binaryType, this._connectLock = false, this._addListeners(), this._connectTimeout = setTimeout(() => this._handleTimeout(), n);
32983
32982
  }).catch((i2) => {
32984
- this._connectLock = false, this._handleError(new Fe.ErrorEvent(Error(i2.message), this));
32983
+ this._connectLock = false, this._handleError(new Ne.ErrorEvent(Error(i2.message), this));
32985
32984
  });
32986
32985
  }
32987
32986
  _handleTimeout() {
32988
- this._debug("timeout event"), this._handleError(new Fe.ErrorEvent(Error("TIMEOUT"), this));
32987
+ this._debug("timeout event"), this._handleError(new Ne.ErrorEvent(Error("TIMEOUT"), this));
32989
32988
  }
32990
32989
  _disconnect(t = 1e3, n) {
32991
32990
  if (this._clearTimeouts(), !!this._ws) {
32992
32991
  this._removeListeners();
32993
32992
  try {
32994
- this._ws.close(t, n), this._handleClose(new Fe.CloseEvent(t, n, this));
32993
+ this._ws.close(t, n), this._handleClose(new Ne.CloseEvent(t, n, this));
32995
32994
  } catch {
32996
32995
  }
32997
32996
  }
@@ -33010,7 +33009,7 @@ var jt = class r extends J {
33010
33009
  }
33011
33010
  };
33012
33011
  var da = 5e3;
33013
- var Xe = class extends J {
33012
+ var Ye = class extends J {
33014
33013
  constructor(...e) {
33015
33014
  super(), this.criteria = new Set(e);
33016
33015
  }
@@ -33027,7 +33026,7 @@ var Xe = class extends J {
33027
33026
  var Xr = class {
33028
33027
  constructor(e, t) {
33029
33028
  this.connecting = false;
33030
- this.criteria = e, this.emitter = new Xe(e), this.refCount = 1, this.subscriptionProps = t ? { ...t } : void 0;
33029
+ this.criteria = e, this.emitter = new Ye(e), this.refCount = 1, this.subscriptionProps = t ? { ...t } : void 0;
33031
33030
  }
33032
33031
  clearAttachedSubscription() {
33033
33032
  this.subscriptionId = void 0, this.token = void 0;
@@ -33037,7 +33036,7 @@ var $t = class {
33037
33036
  constructor(e, t, n) {
33038
33037
  this.pingTimer = void 0;
33039
33038
  this.waitingForPong = false;
33040
- if (!(e instanceof Ht)) throw new p(y("First arg of constructor should be a `MedplumClient`"));
33039
+ if (!(e instanceof Gt)) throw new p(y("First arg of constructor should be a `MedplumClient`"));
33041
33040
  let i2;
33042
33041
  try {
33043
33042
  i2 = new URL(t).toString();
@@ -33045,7 +33044,7 @@ var $t = class {
33045
33044
  throw new p(y("Not a valid URL"));
33046
33045
  }
33047
33046
  let o = n?.ReconnectingWebSocket ? new n.ReconnectingWebSocket(i2, void 0, { debug: n?.debug, debugLogger: n?.debugLogger }) : new jt(i2, void 0, { debug: n?.debug, debugLogger: n?.debugLogger });
33048
- this.medplum = e, this.ws = o, this.masterSubEmitter = new Xe(), this.criteriaEntries = /* @__PURE__ */ new Map(), this.criteriaEntriesBySubscriptionId = /* @__PURE__ */ new Map(), this.wsClosed = false, this.pingIntervalMs = n?.pingIntervalMs ?? da, this.currentProfile = e.getProfile(), this.setupListeners();
33047
+ this.medplum = e, this.ws = o, this.masterSubEmitter = new Ye(), this.criteriaEntries = /* @__PURE__ */ new Map(), this.criteriaEntriesBySubscriptionId = /* @__PURE__ */ new Map(), this.wsClosed = false, this.pingIntervalMs = n?.pingIntervalMs ?? da, this.currentProfile = e.getProfile(), this.setupListeners();
33049
33048
  }
33050
33049
  setupListeners() {
33051
33050
  let e = this.ws;
@@ -33086,7 +33085,7 @@ var $t = class {
33086
33085
  for (let o of this.getAllCriteriaEmitters()) o.dispatchEvent({ ...i2 });
33087
33086
  }
33088
33087
  }), e.addEventListener("error", () => {
33089
- let t = { type: "error", payload: new p(Sn(new Error("WebSocket error"))) };
33088
+ let t = { type: "error", payload: new p(Tn(new Error("WebSocket error"))) };
33090
33089
  this.masterSubEmitter?.dispatchEvent(t);
33091
33090
  for (let n of this.getAllCriteriaEmitters()) n.dispatchEvent({ ...t });
33092
33091
  }), e.addEventListener("close", () => {
@@ -33164,7 +33163,7 @@ var $t = class {
33164
33163
  let [t, n] = await this.getTokenForCriteria(e);
33165
33164
  e.subscriptionId = t, e.token = n, this.criteriaEntriesBySubscriptionId.set(t, e), this.ws.send(JSON.stringify({ type: "bind-with-token", payload: { token: n } }));
33166
33165
  } catch (t) {
33167
- console.error(Ae(t)), this.emitError(e, t), this.removeCriteriaEntry(e);
33166
+ console.error(Oe(t)), this.emitError(e, t), this.removeCriteriaEntry(e);
33168
33167
  }
33169
33168
  }
33170
33169
  }
@@ -33200,10 +33199,10 @@ var $t = class {
33200
33199
  return this.getAllCriteriaEmitters().length;
33201
33200
  }
33202
33201
  getMasterEmitter() {
33203
- return this.masterSubEmitter || (this.masterSubEmitter = new Xe(...Array.from(this.criteriaEntries.keys()))), this.masterSubEmitter;
33202
+ return this.masterSubEmitter || (this.masterSubEmitter = new Ye(...Array.from(this.criteriaEntries.keys()))), this.masterSubEmitter;
33204
33203
  }
33205
33204
  };
33206
- var Zr = "4.1.9-916e31cb9";
33205
+ var Yr = "4.1.10-b8a9c246d";
33207
33206
  var ha = w.FHIR_JSON + ", */*; q=0.1";
33208
33207
  var ma = "https://api.medplum.com/";
33209
33208
  var ya = 1e3;
@@ -33211,16 +33210,16 @@ var ga = 6e4;
33211
33210
  var xa = 0;
33212
33211
  var va = 3e5;
33213
33212
  var Ta = "Binary/";
33214
- var Vi = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
33215
- var Ne = { ClientCredentials: "client_credentials", AuthorizationCode: "authorization_code", RefreshToken: "refresh_token", JwtBearer: "urn:ietf:params:oauth:grant-type:jwt-bearer", TokenExchange: "urn:ietf:params:oauth:grant-type:token-exchange" };
33213
+ var Mi = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
33214
+ var Ue = { ClientCredentials: "client_credentials", AuthorizationCode: "authorization_code", RefreshToken: "refresh_token", JwtBearer: "urn:ietf:params:oauth:grant-type:jwt-bearer", TokenExchange: "urn:ietf:params:oauth:grant-type:token-exchange" };
33216
33215
  var Sa = { AccessToken: "urn:ietf:params:oauth:token-type:access_token", RefreshToken: "urn:ietf:params:oauth:token-type:refresh_token", IdToken: "urn:ietf:params:oauth:token-type:id_token", Saml1Token: "urn:ietf:params:oauth:token-type:saml1", Saml2Token: "urn:ietf:params:oauth:token-type:saml2" };
33217
33216
  var ba = { JwtBearer: "urn:ietf:params:oauth:client-assertion-type:jwt-bearer" };
33218
- var Ht = class extends J {
33217
+ var Gt = class extends J {
33219
33218
  constructor(t) {
33220
33219
  super();
33221
33220
  this.initComplete = true;
33222
33221
  if (t?.baseUrl && !t.baseUrl.startsWith("http")) throw new Error("Base URL must start with http or https");
33223
- this.options = t ?? {}, this.fetch = t?.fetch ?? Ea(), this.storage = t?.storage ?? new Ye(), this.createPdfImpl = t?.createPdf, this.baseUrl = Fr(t?.baseUrl ?? ma), this.fhirBaseUrl = W(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4"), this.authorizeUrl = W(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = W(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = W(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.fhircastHubUrl = W(this.baseUrl, t?.fhircastHubUrl ?? "fhircast/STU3"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.credentialsInHeader = t?.authCredentialsMethod === "header", this.defaultHeaders = t?.defaultHeaders ?? {}, this.onUnauthenticated = t?.onUnauthenticated, this.refreshGracePeriod = t?.refreshGracePeriod ?? va, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? xa : ga), this.cacheTime > 0 ? this.requestCache = new Ce(t?.resourceCacheSize ?? ya) : 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(() => {
33222
+ this.options = t ?? {}, this.fetch = t?.fetch ?? Ea(), this.storage = t?.storage ?? new Xe(), this.createPdfImpl = t?.createPdf, this.baseUrl = Fr(t?.baseUrl ?? ma), this.fhirBaseUrl = W(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4"), this.authorizeUrl = W(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = W(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = W(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.fhircastHubUrl = W(this.baseUrl, t?.fhircastHubUrl ?? "fhircast/STU3"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.credentialsInHeader = t?.authCredentialsMethod === "header", this.defaultHeaders = t?.defaultHeaders ?? {}, this.onUnauthenticated = t?.onUnauthenticated, this.refreshGracePeriod = t?.refreshGracePeriod ?? va, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? xa : ga), this.cacheTime > 0 ? this.requestCache = new Pe(t?.resourceCacheSize ?? ya) : 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(() => {
33224
33223
  t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initComplete = true, this.dispatchEvent({ type: "storageInitialized" });
33225
33224
  }).catch((n) => {
33226
33225
  console.error(n), this.initComplete = true, this.dispatchEvent({ type: "storageInitFailed", payload: { error: n } });
@@ -33332,7 +33331,7 @@ var Ht = class extends J {
33332
33331
  }
33333
33332
  async exchangeExternalAccessToken(t, n) {
33334
33333
  if (n = n ?? this.clientId, !n) throw new Error("MedplumClient is missing clientId");
33335
- return this.fetchTokens({ grant_type: Ne.TokenExchange, subject_token_type: Sa.AccessToken, client_id: n, subject_token: t });
33334
+ return this.fetchTokens({ grant_type: Ue.TokenExchange, subject_token_type: Sa.AccessToken, client_id: n, subject_token: t });
33336
33335
  }
33337
33336
  getExternalAuthRedirectUri(t, n, i2, o, s = true) {
33338
33337
  let a2 = new URL(t);
@@ -33349,7 +33348,7 @@ var Ht = class extends J {
33349
33348
  }
33350
33349
  fhirSearchUrl(t, n) {
33351
33350
  let i2 = this.fhirUrl(t);
33352
- return n && (i2.search = si(n)), i2;
33351
+ return n && (i2.search = oi(n)), i2;
33353
33352
  }
33354
33353
  search(t, n, i2) {
33355
33354
  let o = this.fhirSearchUrl(t, n), s = "search-" + o.toString(), a2 = this.getCacheEntry(s, i2);
@@ -33368,15 +33367,17 @@ var Ht = class extends J {
33368
33367
  searchResources(t, n, i2) {
33369
33368
  let s = "searchResources-" + this.fhirSearchUrl(t, n).toString(), a2 = this.getCacheEntry(s, i2);
33370
33369
  if (a2) return a2.value;
33371
- let c = new V(this.search(t, n, i2).then(Li));
33370
+ let c = new V(this.search(t, n, i2).then(Fi));
33372
33371
  return this.setCacheEntry(s, c), c;
33373
33372
  }
33374
33373
  async *searchResourcePages(t, n, i2) {
33375
33374
  let o = this.fhirSearchUrl(t, n);
33376
33375
  for (; o; ) {
33377
- let s = new URL(o).searchParams, a2 = await this.search(t, s, i2), c = a2.link?.find((u2) => u2.relation === "next");
33376
+ let s = new URL(o).searchParams;
33377
+ s.has("_count") || s.set("_count", "1000");
33378
+ let a2 = await this.search(t, s, i2), c = a2.link?.find((u2) => u2.relation === "next");
33378
33379
  if (!a2.entry?.length && !c) break;
33379
- yield Li(a2), o = c?.url ? new URL(c.url) : void 0;
33380
+ yield Fi(a2), o = c?.url ? new URL(c.url) : void 0;
33380
33381
  }
33381
33382
  }
33382
33383
  valueSetExpand(t, n) {
@@ -33390,7 +33391,7 @@ var Ht = class extends J {
33390
33391
  getCachedReference(t) {
33391
33392
  let n = t.reference;
33392
33393
  if (!n) return;
33393
- if (n === "system") return Vi;
33394
+ if (n === "system") return Mi;
33394
33395
  let [i2, o] = n.split("/");
33395
33396
  if (!(!i2 || !o)) return this.getCached(i2, o);
33396
33397
  }
@@ -33401,12 +33402,12 @@ var Ht = class extends J {
33401
33402
  readReference(t, n) {
33402
33403
  let i2 = t.reference;
33403
33404
  if (!i2) return new V(Promise.reject(new Error("Missing reference")));
33404
- if (i2 === "system") return new V(Promise.resolve(Vi));
33405
+ if (i2 === "system") return new V(Promise.resolve(Mi));
33405
33406
  let [o, s] = i2.split("/");
33406
33407
  return !o || !s ? new V(Promise.reject(new Error("Invalid reference"))) : this.readResource(o, s, n);
33407
33408
  }
33408
33409
  requestSchema(t) {
33409
- if (Vn(t)) return Promise.resolve();
33410
+ if (Dn(t)) return Promise.resolve();
33410
33411
  let n = t + "-requestSchema", i2 = this.getCacheEntry(n, void 0);
33411
33412
  if (i2) return i2.value;
33412
33413
  let o = new V((async () => {
@@ -33457,7 +33458,7 @@ var Ht = class extends J {
33457
33458
  return this.setCacheEntry(n, o), o;
33458
33459
  }
33459
33460
  requestProfileSchema(t, n) {
33460
- if (!n?.expandProfile && _n(t)) return Promise.resolve();
33461
+ if (!n?.expandProfile && Mn(t)) return Promise.resolve();
33461
33462
  let i2 = t + "-requestSchema" + (n?.expandProfile ? "-nested" : ""), o = this.getCacheEntry(i2, void 0);
33462
33463
  if (o) return o.value;
33463
33464
  let s = new V((async () => {
@@ -33504,7 +33505,7 @@ var Ht = class extends J {
33504
33505
  return s || (s = t), this.cacheResource(s), this.invalidateUrl(this.fhirUrl(t.resourceType, t.id, "_history")), this.invalidateSearches(t.resourceType), s;
33505
33506
  }
33506
33507
  async createAttachment(t, n, i2, o, s) {
33507
- let a2 = Fi(t, n, i2, o);
33508
+ let a2 = Ni(t, n, i2, o);
33508
33509
  if (a2.contentType === w.XML) {
33509
33510
  let d2 = a2.data, m2;
33510
33511
  d2 instanceof Blob ? m2 = await new Promise((x, U) => {
@@ -33522,7 +33523,7 @@ var Ht = class extends J {
33522
33523
  return { contentType: a2.contentType, url: u2.url, title: a2.filename };
33523
33524
  }
33524
33525
  createBinary(t, n, i2, o, s) {
33525
- let a2 = Fi(t, n, i2, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: d2, filename: m2, securityContext: x, onProgress: U } = a2, $ = this.fhirUrl("Binary");
33526
+ let a2 = Ni(t, n, i2, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: d2, filename: m2, securityContext: x, onProgress: U } = a2, $ = this.fhirUrl("Binary");
33526
33527
  return m2 && $.searchParams.set("_filename", m2), x?.reference && this.setRequestHeader(c, "X-Security-Context", x.reference), U ? this.uploadwithProgress($, u2, d2, U, c) : this.post($, u2, d2, c);
33527
33528
  }
33528
33529
  uploadwithProgress(t, n, i2, o, s) {
@@ -33605,7 +33606,7 @@ var Ht = class extends J {
33605
33606
  return this.accessTokenExpires !== void 0 && Date.now() < this.accessTokenExpires - (t ?? this.refreshGracePeriod);
33606
33607
  }
33607
33608
  setAccessToken(t, n) {
33608
- this.accessToken = t, this.refreshToken = n, this.accessTokenExpires = Ai(t), this.medplumServer = wi(t);
33609
+ this.accessToken = t, this.refreshToken = n, this.accessTokenExpires = Oi(t), this.medplumServer = Ai(t);
33609
33610
  }
33610
33611
  getLogins() {
33611
33612
  return this.storage.getObject("logins") ?? [];
@@ -33711,14 +33712,14 @@ var Ht = class extends J {
33711
33712
  if (s.status === 401) return this.handleUnauthenticated(t, n, i2);
33712
33713
  if (s.status === 204 || s.status === 304) return;
33713
33714
  let c = s.headers.get("content-type")?.includes("json");
33714
- if (s.status === 404 && !c) throw new p(vn);
33715
+ if (s.status === 404 && !c) throw new p(xn);
33715
33716
  let u2 = await this.parseBody(s, c);
33716
33717
  if (s.status === 200 && i2.followRedirectOnOk || s.status === 201 && i2.followRedirectOnCreated) {
33717
- let d2 = await _i(s, u2);
33718
+ let d2 = await Li(s, u2);
33718
33719
  if (d2) return this.request("GET", d2, { ...i2, body: void 0 });
33719
33720
  }
33720
33721
  if (s.status === 202 && i2.pollStatusOnAccepted) {
33721
- let m2 = await _i(s, u2) ?? o.statusUrl;
33722
+ let m2 = await Li(s, u2) ?? o.statusUrl;
33722
33723
  if (m2) return this.pollStatus(m2, i2, o);
33723
33724
  }
33724
33725
  if (s.status >= 400) throw new p(st(u2));
@@ -33824,22 +33825,22 @@ var Ht = class extends J {
33824
33825
  typeof n == "string" || typeof Blob < "u" && (n instanceof Blob || n?.constructor.name === "Blob") || typeof File < "u" && (n instanceof File || n?.constructor.name === "File") || typeof Uint8Array < "u" && (n instanceof Uint8Array || n?.constructor.name === "Uint8Array") ? t.body = n : n && (t.body = JSON.stringify(n));
33825
33826
  }
33826
33827
  handleUnauthenticated(t, n, i2) {
33827
- return this.refresh() ? this.request(t, n, i2) : (this.clear(), this.onUnauthenticated && this.onUnauthenticated(), Promise.reject(new p(Pe)));
33828
+ return this.refresh() ? this.request(t, n, i2) : (this.clear(), this.onUnauthenticated && this.onUnauthenticated(), Promise.reject(new p(we)));
33828
33829
  }
33829
33830
  async startPkce() {
33830
- let t = Hr();
33831
+ let t = $r();
33831
33832
  sessionStorage.setItem("pkceState", t);
33832
- let n = Hr().slice(0, 128);
33833
+ let n = $r().slice(0, 128);
33833
33834
  sessionStorage.setItem("codeVerifier", n);
33834
- let i2 = await Si(n), o = ei(i2).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
33835
+ let i2 = await bi(n), o = Zn(i2).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
33835
33836
  return sessionStorage.setItem("codeChallenge", o), { codeChallengeMethod: "S256", codeChallenge: o };
33836
33837
  }
33837
33838
  async requestAuthorization(t) {
33838
33839
  let n = await this.ensureCodeChallenge(t ?? {}), i2 = new URL(this.authorizeUrl);
33839
- i2.searchParams.set("response_type", "code"), i2.searchParams.set("state", sessionStorage.getItem("pkceState")), i2.searchParams.set("client_id", n.clientId ?? this.clientId), i2.searchParams.set("redirect_uri", n.redirectUri ?? Mi()), i2.searchParams.set("code_challenge_method", n.codeChallengeMethod), i2.searchParams.set("code_challenge", n.codeChallenge), i2.searchParams.set("scope", n.scope ?? "openid profile"), window.location.assign(i2.toString());
33840
+ i2.searchParams.set("response_type", "code"), i2.searchParams.set("state", sessionStorage.getItem("pkceState")), i2.searchParams.set("client_id", n.clientId ?? this.clientId), i2.searchParams.set("redirect_uri", n.redirectUri ?? _i()), i2.searchParams.set("code_challenge_method", n.codeChallengeMethod), i2.searchParams.set("code_challenge", n.codeChallenge), i2.searchParams.set("scope", n.scope ?? "openid profile"), window.location.assign(i2.toString());
33840
33841
  }
33841
33842
  processCode(t, n) {
33842
- let i2 = { grant_type: Ne.AuthorizationCode, code: t, client_id: n?.clientId ?? this.clientId ?? "", redirect_uri: n?.redirectUri ?? Mi() };
33843
+ let i2 = { grant_type: Ue.AuthorizationCode, code: t, client_id: n?.clientId ?? this.clientId ?? "", redirect_uri: n?.redirectUri ?? _i() };
33843
33844
  if (typeof sessionStorage < "u") {
33844
33845
  let o = sessionStorage.getItem("codeVerifier");
33845
33846
  o && (i2.code_verifier = o);
@@ -33851,17 +33852,17 @@ var Ht = class extends J {
33851
33852
  }
33852
33853
  refresh() {
33853
33854
  if (this.refreshPromise) return this.refreshPromise;
33854
- if (this.refreshToken) return this.refreshPromise = this.fetchTokens({ grant_type: Ne.RefreshToken, client_id: this.clientId ?? "", refresh_token: this.refreshToken }), this.refreshPromise;
33855
+ if (this.refreshToken) return this.refreshPromise = this.fetchTokens({ grant_type: Ue.RefreshToken, client_id: this.clientId ?? "", refresh_token: this.refreshToken }), this.refreshPromise;
33855
33856
  if (this.clientId && this.clientSecret) return this.refreshPromise = this.startClientLogin(this.clientId, this.clientSecret), this.refreshPromise;
33856
33857
  }
33857
33858
  async startClientLogin(t, n) {
33858
- return this.clientId = t, this.clientSecret = n, this.fetchTokens({ grant_type: Ne.ClientCredentials, client_id: t, client_secret: n });
33859
+ return this.clientId = t, this.clientSecret = n, this.fetchTokens({ grant_type: Ue.ClientCredentials, client_id: t, client_secret: n });
33859
33860
  }
33860
33861
  async startJwtBearerLogin(t, n, i2) {
33861
- return this.clientId = t, this.fetchTokens({ grant_type: Ne.JwtBearer, client_id: t, assertion: n, scope: i2 });
33862
+ return this.clientId = t, this.fetchTokens({ grant_type: Ue.JwtBearer, client_id: t, assertion: n, scope: i2 });
33862
33863
  }
33863
33864
  async startJwtAssertionLogin(t) {
33864
- return this.fetchTokens({ grant_type: Ne.ClientCredentials, client_assertion_type: ba.JwtBearer, client_assertion: t });
33865
+ return this.fetchTokens({ grant_type: Ue.ClientCredentials, client_assertion_type: ba.JwtBearer, client_assertion: t });
33865
33866
  }
33866
33867
  setBasicAuth(t, n) {
33867
33868
  this.clientId = t, this.clientSecret = n, this.basicAuth = Ft(t + ":" + n);
@@ -33869,20 +33870,20 @@ var Ht = class extends J {
33869
33870
  async fhircastSubscribe(t, n) {
33870
33871
  if (!(typeof t == "string" && t !== "")) throw new p(y("Invalid topic provided. Topic must be a valid string."));
33871
33872
  if (!(typeof n == "object" && Array.isArray(n) && n.length > 0)) throw new p(y("Invalid events provided. Events must be an array of event names containing at least one event."));
33872
- let i2 = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post(this.fhircastHubUrl, Jr(i2), w.FORM_URL_ENCODED))["hub.channel.endpoint"];
33873
+ let i2 = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post(this.fhircastHubUrl, zr(i2), w.FORM_URL_ENCODED))["hub.channel.endpoint"];
33873
33874
  if (!s) throw new Error("Invalid response!");
33874
33875
  return i2.endpoint = s, i2;
33875
33876
  }
33876
33877
  async fhircastUnsubscribe(t) {
33877
33878
  if (!Ut(t)) throw new p(y("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));
33878
33879
  if (!(t.endpoint && typeof t.endpoint == "string" && t.endpoint.startsWith("ws"))) throw new p(y("Provided subscription request must have an endpoint in order to unsubscribe."));
33879
- t.mode = "unsubscribe", await this.post(this.fhircastHubUrl, Jr(t), w.FORM_URL_ENCODED);
33880
+ t.mode = "unsubscribe", await this.post(this.fhircastHubUrl, zr(t), w.FORM_URL_ENCODED);
33880
33881
  }
33881
33882
  fhircastConnect(t) {
33882
33883
  return new Nt(t);
33883
33884
  }
33884
33885
  async fhircastPublish(t, n, i2, o) {
33885
- return Ei(n) ? this.post(this.fhircastHubUrl, Kr(t, n, i2, o), w.JSON) : (Ri(n), this.post(this.fhircastHubUrl, Kr(t, n, i2), w.JSON));
33886
+ return Ri(n) ? this.post(this.fhircastHubUrl, Jr(t, n, i2, o), w.JSON) : (Ci(n), this.post(this.fhircastHubUrl, Jr(t, n, i2), w.JSON));
33886
33887
  }
33887
33888
  async fhircastGetContext(t) {
33888
33889
  return this.get(`${this.fhircastHubUrl}/${t}`, { cache: "no-cache" });
@@ -33913,9 +33914,9 @@ var Ht = class extends J {
33913
33914
  }
33914
33915
  async verifyTokens(t) {
33915
33916
  let n = t.access_token;
33916
- if (Pi(n)) {
33917
+ if (wi(n)) {
33917
33918
  let i2 = Bt(n);
33918
- if (Date.now() >= i2.exp * 1e3) throw this.clearActiveLogin(), new p(Tn);
33919
+ if (Date.now() >= i2.exp * 1e3) throw this.clearActiveLogin(), new p(vn);
33919
33920
  if (i2.cid) {
33920
33921
  if (i2.cid !== this.clientId) throw this.clearActiveLogin(), new p(lr);
33921
33922
  } else if (this.clientId && i2.client_id !== this.clientId) throw this.clearActiveLogin(), new p(lr);
@@ -33938,7 +33939,7 @@ var Ht = class extends J {
33938
33939
  }
33939
33940
  }
33940
33941
  getSubscriptionManager() {
33941
- return this.subscriptionManager || (this.subscriptionManager = new $t(this, oi(this.baseUrl, "/ws/subscriptions-r4"))), this.subscriptionManager;
33942
+ return this.subscriptionManager || (this.subscriptionManager = new $t(this, ii(this.baseUrl, "/ws/subscriptions-r4"))), this.subscriptionManager;
33942
33943
  }
33943
33944
  subscribeToCriteria(t, n) {
33944
33945
  return this.getSubscriptionManager().addCriteria(t, n);
@@ -33954,24 +33955,24 @@ function Ea() {
33954
33955
  if (!globalThis.fetch) throw new Error("Fetch not available in this environment");
33955
33956
  return globalThis.fetch.bind(globalThis);
33956
33957
  }
33957
- function Mi() {
33958
+ function _i() {
33958
33959
  return typeof window > "u" ? "" : window.location.protocol + "//" + window.location.host + "/";
33959
33960
  }
33960
- async function _i(r6, e) {
33961
+ async function Li(r6, e) {
33961
33962
  let t = r6.headers.get("content-location");
33962
33963
  if (t) return t;
33963
33964
  let n = r6.headers.get("location");
33964
33965
  if (n) return n;
33965
- if (we(e) && e.issue?.[0]?.diagnostics) return e.issue[0].diagnostics;
33966
+ if (Ae(e) && e.issue?.[0]?.diagnostics) return e.issue[0].diagnostics;
33966
33967
  }
33967
- function Li(r6) {
33968
+ function Fi(r6) {
33968
33969
  let e = r6.entry?.map((t) => t.resource) ?? [];
33969
33970
  return Object.assign(e, { bundle: r6 });
33970
33971
  }
33971
33972
  function Ra(r6) {
33972
33973
  return E(r6) && "data" in r6 && "contentType" in r6;
33973
33974
  }
33974
- function Fi(r6, e, t, n) {
33975
+ function Ni(r6, e, t, n) {
33975
33976
  return Ra(r6) ? r6 : { data: r6, filename: e, contentType: t, onProgress: n };
33976
33977
  }
33977
33978
  function Ca(r6) {
@@ -33983,12 +33984,12 @@ function Pa(r6, e, t, n) {
33983
33984
  function wa(r6) {
33984
33985
  return r6.status === 429 || r6.status >= 500;
33985
33986
  }
33986
- var Ba = [...Qe, "->", "<<", ">>", "=="];
33987
- var ja = ze().registerInfix("->", { precedence: g.Arrow }).registerInfix(";", { precedence: g.Semicolon });
33987
+ var Ba = [...ze, "->", "<<", ">>", "=="];
33988
+ var ja = Je().registerInfix("->", { precedence: g.Arrow }).registerInfix(";", { precedence: g.Semicolon });
33988
33989
  var ac = " ".repeat(2);
33989
- var uc = [...Qe, "eq", "ne", "co"];
33990
+ var uc = [...ze, "eq", "ne", "co"];
33990
33991
  var lc = { eq: f.EXACT, ne: f.NOT_EQUALS, co: f.CONTAINS, sw: f.STARTS_WITH, ew: void 0, gt: f.GREATER_THAN, lt: f.LESS_THAN, ge: f.GREATER_THAN_OR_EQUALS, le: f.LESS_THAN_OR_EQUALS, ap: f.APPROXIMATELY, sa: f.STARTS_AFTER, eb: f.ENDS_BEFORE, pr: f.PRESENT, po: void 0, ss: void 0, sb: void 0, in: f.IN, ni: f.NOT_IN, re: f.EQUALS, identifier: f.IDENTIFIER };
33991
- var pc = ze();
33992
+ var pc = Je();
33992
33993
  var fc = { AA: "OK", AE: "Application Error", AR: "Application Reject", CA: "Commit Accept", CE: "Commit Error", CR: "Commit Reject" };
33993
33994
  var de = class {
33994
33995
  constructor(e = "\r", t = "|", n = "^", i2 = "~", o = "\\", s = "&") {
@@ -34001,7 +34002,7 @@ var de = class {
34001
34002
  return this.componentSeparator + this.repetitionSeparator + this.escapeCharacter + this.subcomponentSeparator;
34002
34003
  }
34003
34004
  };
34004
- var no = class r2 {
34005
+ var io = class r2 {
34005
34006
  constructor(e, t = new de()) {
34006
34007
  this.context = t, this.segments = e;
34007
34008
  }
@@ -34052,7 +34053,7 @@ var no = class r2 {
34052
34053
  };
34053
34054
  var tt = class r3 {
34054
34055
  constructor(e, t = new de()) {
34055
- this.context = t, Yn(e) ? this.fields = e.map((n) => K.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
34056
+ this.context = t, Kn(e) ? this.fields = e.map((n) => K.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
34056
34057
  }
34057
34058
  get(e) {
34058
34059
  return this.fields[e];
@@ -34124,10 +34125,10 @@ function mc(r6) {
34124
34125
  let e = r6 instanceof Date ? r6 : new Date(r6), n = e.toISOString().replace(/[-:T]/g, "").replace(/(\.\d+)?Z$/, ""), i2 = e.getUTCMilliseconds();
34125
34126
  return i2 > 0 && (n += "." + i2.toString()), n;
34126
34127
  }
34127
- var Ue = { NONE: 0, ERROR: 1, WARN: 2, INFO: 3, DEBUG: 4 };
34128
+ var Be = { NONE: 0, ERROR: 1, WARN: 2, INFO: 3, DEBUG: 4 };
34128
34129
  var yc = ["NONE", "ERROR", "WARN", "INFO", "DEBUG"];
34129
- var io = class r5 {
34130
- constructor(e, t = {}, n = Ue.INFO, i2 = {}) {
34130
+ var oo = class r5 {
34131
+ constructor(e, t = {}, n = Be.INFO, i2 = {}) {
34131
34132
  this.write = e, this.metadata = t, this.level = n, this.options = i2, i2?.prefix && (this.prefix = i2.prefix), this.error = this.error.bind(this), this.warn = this.warn.bind(this), this.info = this.info.bind(this), this.debug = this.debug.bind(this), this.log = this.log.bind(this);
34132
34133
  }
34133
34134
  clone(e) {
@@ -34139,24 +34140,24 @@ var io = class r5 {
34139
34140
  return { write: e, metadata: t, level: n, options: i2 };
34140
34141
  }
34141
34142
  error(e, t) {
34142
- this.log(Ue.ERROR, e, t);
34143
+ this.log(Be.ERROR, e, t);
34143
34144
  }
34144
34145
  warn(e, t) {
34145
- this.log(Ue.WARN, e, t);
34146
+ this.log(Be.WARN, e, t);
34146
34147
  }
34147
34148
  info(e, t) {
34148
- this.log(Ue.INFO, e, t);
34149
+ this.log(Be.INFO, e, t);
34149
34150
  }
34150
34151
  debug(e, t) {
34151
- this.log(Ue.DEBUG, e, t);
34152
+ this.log(Be.DEBUG, e, t);
34152
34153
  }
34153
34154
  log(e, t, n) {
34154
34155
  e > this.level || (n instanceof Error && (n = { error: n.toString(), stack: n.stack?.split(`
34155
34156
  `) }), this.write(JSON.stringify({ level: yc[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: this.prefix ? `${this.prefix}${t}` : t, ...n, ...this.metadata })));
34156
34157
  }
34157
34158
  };
34158
- function qh(r6) {
34159
- let e = Ue[r6.toUpperCase()];
34159
+ function jh(r6) {
34160
+ let e = Be[r6.toUpperCase()];
34160
34161
  if (e === void 0) throw new Error(`Invalid log level: ${r6}`);
34161
34162
  return e;
34162
34163
  }
@@ -34172,18 +34173,18 @@ function Rc(r6) {
34172
34173
  if (!n.name) throw new Error("Asset missing name");
34173
34174
  }
34174
34175
  }
34175
- async function dn(r6, e, t) {
34176
+ async function ln(r6, e, t) {
34176
34177
  let n = tr.get(e ?? "latest");
34177
34178
  if (!n) {
34178
34179
  let i2 = e ? `v${e}` : "latest", o = new URL(`${Ec}/${i2}.json`);
34179
- if (o.searchParams.set("a", r6), o.searchParams.set("c", Zr), t) for (let [c, u2] of Object.entries(t)) o.searchParams.set(c, u2);
34180
+ if (o.searchParams.set("a", r6), o.searchParams.set("c", Yr), t) for (let [c, u2] of Object.entries(t)) o.searchParams.set(c, u2);
34180
34181
  let s = await fetch(o.toString());
34181
34182
  if (s.status !== 200) {
34182
34183
  let c;
34183
34184
  try {
34184
34185
  c = (await s.json()).message;
34185
34186
  } catch (u2) {
34186
- console.error(`Failed to parse message from body: ${Ae(u2)}`);
34187
+ console.error(`Failed to parse message from body: ${Oe(u2)}`);
34187
34188
  }
34188
34189
  throw new Error(`Received status code ${s.status} while fetching manifest for version '${e ?? "latest"}'. Message: ${c}`);
34189
34190
  }
@@ -34195,17 +34196,17 @@ async function dn(r6, e, t) {
34195
34196
  function Cc(r6) {
34196
34197
  return /^\d+\.\d+\.\d+$/.test(r6);
34197
34198
  }
34198
- async function nm(r6, e) {
34199
+ async function im(r6, e) {
34199
34200
  if (!Cc(e)) return false;
34200
34201
  try {
34201
- await dn(r6, e);
34202
+ await ln(r6, e);
34202
34203
  } catch {
34203
34204
  return false;
34204
34205
  }
34205
34206
  return true;
34206
34207
  }
34207
- async function im(r6) {
34208
- let e = await dn(r6);
34208
+ async function om(r6) {
34209
+ let e = await ln(r6);
34209
34210
  if (!e.tag_name.startsWith("v")) throw new Error(`Invalid release name found. Release tag '${e.tag_name}' did not start with 'v'`);
34210
34211
  return e.tag_name.slice(1);
34211
34212
  }
@@ -34248,7 +34249,7 @@ var d = class extends a {
34248
34249
  this.socket = e, this.encoding = s, this.enhancedMode = r6, e.on("data", (n) => {
34249
34250
  try {
34250
34251
  if (this.appendData(n), n.at(-2) === 28 && n.at(-1) === 13) {
34251
- let o = Buffer.concat(this.chunks), g2 = o.subarray(1, o.length - 2), E2 = import_iconv_lite.default.decode(g2, this.encoding), k2 = no.parse(E2);
34252
+ let o = Buffer.concat(this.chunks), g2 = o.subarray(1, o.length - 2), E2 = import_iconv_lite.default.decode(g2, this.encoding), k2 = io.parse(E2);
34252
34253
  this.dispatchEvent(new h2(this, k2)), this.resetBuffer();
34253
34254
  }
34254
34255
  } catch (o) {
@@ -34523,7 +34524,7 @@ var AgentDicomChannel = class extends BaseChannel {
34523
34524
  });
34524
34525
  response2.setStatus(dimse.constants.Status.Success);
34525
34526
  } catch (err) {
34526
- DcmjsDimseScp.channel.log.error(`DICOM error: ${Ae(err)}`);
34527
+ DcmjsDimseScp.channel.log.error(`DICOM error: ${Oe(err)}`);
34527
34528
  response2.setStatus(dimse.constants.Status.ProcessingFailure);
34528
34529
  }
34529
34530
  return response2;
@@ -34599,7 +34600,7 @@ var AgentHl7Channel = class extends BaseChannel {
34599
34600
  sendToRemote(msg) {
34600
34601
  const connection = this.connections.get(msg.remote);
34601
34602
  if (connection) {
34602
- connection.hl7Connection.send(no.parse(msg.body));
34603
+ connection.hl7Connection.send(io.parse(msg.body));
34603
34604
  }
34604
34605
  }
34605
34606
  handleNewConnection(connection) {
@@ -34628,7 +34629,7 @@ var AgentHl7ChannelConnection = class {
34628
34629
  callback: `Agent/${this.channel.app.agentId}-${(0, import_node_crypto2.randomUUID)()}`
34629
34630
  });
34630
34631
  } catch (err) {
34631
- this.channel.log.error(`HL7 error: ${Ae(err)}`);
34632
+ this.channel.log.error(`HL7 error: ${Oe(err)}`);
34632
34633
  }
34633
34634
  }
34634
34635
  close() {
@@ -34648,7 +34649,7 @@ var UPGRADER_LOG_PATH = (0, import_node_path2.resolve)(
34648
34649
  );
34649
34650
  var RELEASES_PATH = (0, import_node_path2.resolve)(__dirname);
34650
34651
  async function downloadRelease(version, path3) {
34651
- const release = await dn("agent-upgrader", version);
34652
+ const release = await ln("agent-upgrader", version);
34652
34653
  const downloadUrl = parseDownloadUrl(release, (0, import_node_os2.platform)());
34653
34654
  const { body } = await fetch(downloadUrl);
34654
34655
  if (!body) {
@@ -34660,9 +34661,9 @@ async function downloadRelease(version, path3) {
34660
34661
  writeStream.once("close", resolve2);
34661
34662
  });
34662
34663
  }
34663
- function parseDownloadUrl(release, os2) {
34664
+ function parseDownloadUrl(release, os) {
34664
34665
  let endingToMatch;
34665
- switch (os2) {
34666
+ switch (os) {
34666
34667
  case "win32":
34667
34668
  endingToMatch = ".exe";
34668
34669
  break;
@@ -34670,14 +34671,14 @@ function parseDownloadUrl(release, os2) {
34670
34671
  endingToMatch = "linux";
34671
34672
  break;
34672
34673
  default:
34673
- throw new Error(`Unsupported platform: ${os2}`);
34674
+ throw new Error(`Unsupported platform: ${os}`);
34674
34675
  }
34675
34676
  for (const asset of release.assets) {
34676
34677
  if (asset.name.endsWith(endingToMatch)) {
34677
34678
  return asset.browser_download_url;
34678
34679
  }
34679
34680
  }
34680
- throw new Error(`No download URL found for release '${release.tag_name}' for ${os2}`);
34681
+ throw new Error(`No download URL found for release '${release.tag_name}' for ${os}`);
34681
34682
  }
34682
34683
  function getReleaseBinPath(version) {
34683
34684
  let binaryName;
@@ -34722,7 +34723,7 @@ var App = class _App {
34722
34723
  this.medplum = medplum;
34723
34724
  this.agentId = agentId;
34724
34725
  this.logLevel = logLevel;
34725
- this.log = new io((msg) => console.log(msg), void 0, logLevel);
34726
+ this.log = new oo((msg) => console.log(msg), void 0, logLevel);
34726
34727
  }
34727
34728
  async start() {
34728
34729
  this.log.info("Medplum service starting...");
@@ -34742,7 +34743,7 @@ var App = class _App {
34742
34743
  if ((0, import_node_fs3.existsSync)(UPGRADE_MANIFEST_PATH)) {
34743
34744
  const upgradeFile = (0, import_node_fs3.readFileSync)(UPGRADE_MANIFEST_PATH, { encoding: "utf-8" });
34744
34745
  const upgradeDetails = JSON.parse(upgradeFile);
34745
- if (upgradeDetails.targetVersion === Zr.split("-")[0]) {
34746
+ if (upgradeDetails.targetVersion === Yr.split("-")[0]) {
34746
34747
  await this.sendToWebSocket({
34747
34748
  type: "agent:upgrade:response",
34748
34749
  statusCode: 200,
@@ -34750,7 +34751,7 @@ var App = class _App {
34750
34751
  });
34751
34752
  this.log.info(`Successfully upgraded to version ${upgradeDetails.targetVersion}`);
34752
34753
  } else {
34753
- const errMsg = `Failed to upgrade to version ${upgradeDetails.targetVersion}. Agent still running with version ${Zr}`;
34754
+ const errMsg = `Failed to upgrade to version ${upgradeDetails.targetVersion}. Agent still running with version ${Yr}`;
34754
34755
  await this.sendToWebSocket({
34755
34756
  type: "agent:error",
34756
34757
  body: errMsg,
@@ -34825,7 +34826,7 @@ var App = class _App {
34825
34826
  break;
34826
34827
  case "agent:heartbeat:request":
34827
34828
  this.outstandingHeartbeats = 0;
34828
- await this.sendToWebSocket({ type: "agent:heartbeat:response", version: Zr });
34829
+ await this.sendToWebSocket({ type: "agent:heartbeat:response", version: Yr });
34829
34830
  break;
34830
34831
  case "agent:heartbeat:response":
34831
34832
  this.outstandingHeartbeats = 0;
@@ -34868,7 +34869,7 @@ var App = class _App {
34868
34869
  } catch (err) {
34869
34870
  await this.sendToWebSocket({
34870
34871
  type: "agent:error",
34871
- body: Ae(err),
34872
+ body: Oe(err),
34872
34873
  callback: command.callback
34873
34874
  });
34874
34875
  }
@@ -34883,7 +34884,7 @@ var App = class _App {
34883
34884
  this.log.error(`Unknown message type: ${command.type}`);
34884
34885
  }
34885
34886
  } catch (err) {
34886
- this.log.error(`WebSocket error on incoming message: ${Ae(err)}`);
34887
+ this.log.error(`WebSocket error on incoming message: ${Oe(err)}`);
34887
34888
  }
34888
34889
  });
34889
34890
  return new Promise((resolve2) => {
@@ -34955,7 +34956,7 @@ var App = class _App {
34955
34956
  try {
34956
34957
  await this.startOrReloadChannel(definition, endpoint);
34957
34958
  } catch (err) {
34958
- this.log.error(Ae(err));
34959
+ this.log.error(Oe(err));
34959
34960
  }
34960
34961
  }
34961
34962
  }
@@ -34981,7 +34982,7 @@ var App = class _App {
34981
34982
  parsedEndpoint = new URL(endpoint.address);
34982
34983
  } catch (err) {
34983
34984
  throw new Error(
34984
- `Error while validating endpoint address for channel '${channel.name}': ${Ae(err)}`
34985
+ `Error while validating endpoint address for channel '${channel.name}': ${Oe(err)}`
34985
34986
  );
34986
34987
  }
34987
34988
  if (seenPorts.has(parsedEndpoint.port)) {
@@ -35060,7 +35061,7 @@ var App = class _App {
35060
35061
  try {
35061
35062
  await this.sendToWebSocket(msg);
35062
35063
  } catch (err) {
35063
- this.log.error(`WebSocket error while attempting to send message: ${Ae(err)}`);
35064
+ this.log.error(`WebSocket error while attempting to send message: ${Oe(err)}`);
35064
35065
  this.webSocketQueue.unshift(msg);
35065
35066
  throw err;
35066
35067
  }
@@ -35136,7 +35137,7 @@ ${result}`);
35136
35137
  body: result
35137
35138
  });
35138
35139
  } catch (err) {
35139
- this.log.error(`Error during ping attempt to ${message.remote ?? "NO_HOST_GIVEN"}: ${Ae(err)}`);
35140
+ this.log.error(`Error during ping attempt to ${message.remote ?? "NO_HOST_GIVEN"}: ${Oe(err)}`);
35140
35141
  this.addToWebSocketQueue({
35141
35142
  type: "agent:transmit:response",
35142
35143
  channel: message.channel,
@@ -35144,7 +35145,7 @@ ${result}`);
35144
35145
  remote: message.remote,
35145
35146
  callback: message.callback,
35146
35147
  statusCode: 400,
35147
- body: Ae(err)
35148
+ body: Oe(err)
35148
35149
  });
35149
35150
  }
35150
35151
  }
@@ -35160,7 +35161,7 @@ ${result}`);
35160
35161
  return;
35161
35162
  }
35162
35163
  let child;
35163
- if (message.version && !await nm("agent-upgrader", message.version)) {
35164
+ if (message.version && !await im("agent-upgrader", message.version)) {
35164
35165
  const versionTag = message.version ? `v${message.version}` : "latest";
35165
35166
  const errMsg = `Error during upgrading to version '${versionTag}'. '${message.version}' is not a valid version`;
35166
35167
  this.log.error(errMsg);
@@ -35171,8 +35172,8 @@ ${result}`);
35171
35172
  });
35172
35173
  return;
35173
35174
  }
35174
- const targetVersion = message.version ?? await im("agent-upgrader");
35175
- if (Zr.startsWith(targetVersion)) {
35175
+ const targetVersion = message.version ?? await om("agent-upgrader");
35176
+ if (Yr.startsWith(targetVersion)) {
35176
35177
  if (!message?.force) {
35177
35178
  this.log.info(`Attempted to upgrade to version ${targetVersion}, but agent is already on that version`);
35178
35179
  await this.sendToWebSocket({
@@ -35182,7 +35183,7 @@ ${result}`);
35182
35183
  });
35183
35184
  return;
35184
35185
  }
35185
- this.log.info(`Forcing upgrade from ${Zr} to ${targetVersion}`);
35186
+ this.log.info(`Forcing upgrade from ${Yr} to ${targetVersion}`);
35186
35187
  }
35187
35188
  try {
35188
35189
  const command = __filename;
@@ -35204,11 +35205,11 @@ ${result}`);
35204
35205
  });
35205
35206
  });
35206
35207
  child.on("error", (err) => {
35207
- this.log.error(Ae(err));
35208
+ this.log.error(Oe(err));
35208
35209
  });
35209
35210
  } catch (err) {
35210
35211
  const versionTag = message.version ? `v${message.version}` : "latest";
35211
- const errMsg = `Error during upgrading to version '${versionTag}': ${Ae(err)}`;
35212
+ const errMsg = `Error during upgrading to version '${versionTag}': ${Oe(err)}`;
35212
35213
  this.log.error(errMsg);
35213
35214
  await this.sendToWebSocket({
35214
35215
  type: "agent:error",
@@ -35220,11 +35221,11 @@ ${result}`);
35220
35221
  try {
35221
35222
  await this.stop();
35222
35223
  this.log.info("Successfully stopped agent network services");
35223
- this.log.info("Writing upgrade manifest...", { previousVersion: Zr, targetVersion });
35224
+ this.log.info("Writing upgrade manifest...", { previousVersion: Yr, targetVersion });
35224
35225
  (0, import_node_fs3.writeFileSync)(
35225
35226
  UPGRADE_MANIFEST_PATH,
35226
35227
  JSON.stringify({
35227
- previousVersion: Zr,
35228
+ previousVersion: Yr,
35228
35229
  targetVersion,
35229
35230
  callback: message.callback ?? null
35230
35231
  }),
@@ -35234,7 +35235,7 @@ ${result}`);
35234
35235
  child.disconnect();
35235
35236
  } catch (err) {
35236
35237
  this.log.error(
35237
- `Error while stopping agent or messaging child process as part of upgrade: ${Ae(err)}`
35238
+ `Error while stopping agent or messaging child process as part of upgrade: ${Oe(err)}`
35238
35239
  );
35239
35240
  import_node_process.default.exit(1);
35240
35241
  }
@@ -35292,7 +35293,7 @@ ${result}`);
35292
35293
  });
35293
35294
  }
35294
35295
  }
35295
- client.sendAndWait(no.parse(message.body)).then((response2) => {
35296
+ client.sendAndWait(io.parse(message.body)).then((response2) => {
35296
35297
  this.log.info(`Response: ${response2.toString().replaceAll("\r", "\n")}`);
35297
35298
  this.addToWebSocketQueue({
35298
35299
  type: "agent:transmit:response",
@@ -35304,7 +35305,7 @@ ${result}`);
35304
35305
  body: response2.toString()
35305
35306
  });
35306
35307
  }).catch((err) => {
35307
- this.log.error(`HL7 error: ${Ae(err)}`);
35308
+ this.log.error(`HL7 error: ${Oe(err)}`);
35308
35309
  this.addToWebSocketQueue({
35309
35310
  type: "agent:transmit:response",
35310
35311
  channel: message.channel,
@@ -35312,7 +35313,7 @@ ${result}`);
35312
35313
  callback: message.callback,
35313
35314
  contentType: w.TEXT,
35314
35315
  statusCode: 400,
35315
- body: Ae(err)
35316
+ body: Oe(err)
35316
35317
  });
35317
35318
  if (client.keepAlive) {
35318
35319
  this.hl7Clients.delete(message.remote);
@@ -35359,19 +35360,19 @@ async function agentMain(argv) {
35359
35360
  process.exit(1);
35360
35361
  }
35361
35362
  const { baseUrl, clientId, clientSecret, agentId } = args;
35362
- const medplum = new Ht({ baseUrl, clientId });
35363
+ const medplum = new Gt({ baseUrl, clientId });
35363
35364
  let loggedIn = false;
35364
35365
  while (!loggedIn) {
35365
35366
  try {
35366
35367
  await medplum.startClientLogin(clientId, clientSecret);
35367
35368
  loggedIn = true;
35368
35369
  } catch (err) {
35369
- console.error("Failed to login", { err: Ae(err) });
35370
+ console.error("Failed to login", { err: Oe(err) });
35370
35371
  console.log("Retrying login in 10 seconds...");
35371
35372
  await _r(RETRY_WAIT_DURATION_MS);
35372
35373
  }
35373
35374
  }
35374
- const app = new App(medplum, agentId, qh(args.logLevel ?? "INFO"));
35375
+ const app = new App(medplum, agentId, jh(args.logLevel ?? "INFO"));
35375
35376
  await app.start();
35376
35377
  process.on("SIGINT", async () => {
35377
35378
  console.log("Gracefully shutting down from SIGINT (Ctrl-C)");
@@ -35396,7 +35397,7 @@ var import_node_os4 = require("node:os");
35396
35397
  var import_node_path3 = __toESM(require("node:path"));
35397
35398
  var import_node_process2 = __toESM(require("node:process"));
35398
35399
  var EXIT_SIGNALS = ["SIGINT", "SIGTERM", "SIGHUP"];
35399
- var pidLogger = new io((msg) => `[PID]: ${msg}`);
35400
+ var pidLogger = new oo((msg) => `[PID]: ${msg}`);
35400
35401
  var pidFilePaths = /* @__PURE__ */ new Set();
35401
35402
  var processExitListener = () => {
35402
35403
  removeAllPidFiles();
@@ -35498,7 +35499,7 @@ async function upgraderMain(argv) {
35498
35499
  if ((0, import_node_os5.platform)() !== "win32") {
35499
35500
  throw new Error(`Unsupported platform: ${(0, import_node_os5.platform)()}. Agent upgrader currently only supports Windows`);
35500
35501
  }
35501
- const globalLogger = new io((msg) => console.log(msg));
35502
+ const globalLogger = new oo((msg) => console.log(msg));
35502
35503
  if (!import_node_process3.default.send) {
35503
35504
  globalLogger.error("Upgrader not started as a child process with Node IPC enabled. Aborting...");
35504
35505
  import_node_process3.default.exit(1);
@@ -35514,7 +35515,7 @@ async function upgraderMain(argv) {
35514
35515
  if (argv[3] && !Cc(argv[3])) {
35515
35516
  throw new Error("Invalid version specified");
35516
35517
  }
35517
- const version = argv[3] ?? await im("agent-upgrader");
35518
+ const version = argv[3] ?? await om("agent-upgrader");
35518
35519
  const binPath = getReleaseBinPath(version);
35519
35520
  if (!(0, import_node_fs6.existsSync)(binPath)) {
35520
35521
  globalLogger.info(`Could not find binary at "${binPath}". Downloading release from GitHub...`);
@@ -35537,7 +35538,7 @@ async function upgraderMain(argv) {
35537
35538
  (0, import_node_child_process2.spawnSync)(binPath, ["/S"]);
35538
35539
  globalLogger.info(`Agent version ${version} successfully installed`);
35539
35540
  } catch (err) {
35540
- globalLogger.error(`Error while attempting to run installer: ${Ae(err)}`);
35541
+ globalLogger.error(`Error while attempting to run installer: ${Oe(err)}`);
35541
35542
  globalLogger.error("Failed to run installer, attempting to restart agent service...");
35542
35543
  try {
35543
35544
  (0, import_node_child_process2.execSync)('net start "Medplum Agent"');