@medplum/agent 3.2.23 → 3.2.25

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 +244 -236
  2. package/package.json +5 -5
@@ -12,13 +12,13 @@ var __export = (target, all) => {
12
12
  for (var name in all)
13
13
  __defProp(target, name, { get: all[name], enumerable: true });
14
14
  };
15
- var __copyProps = (to, from, except, desc) => {
15
+ var __copyProps = (to2, from, except, desc) => {
16
16
  if (from && typeof from === "object" || typeof from === "function") {
17
17
  for (let key of __getOwnPropNames(from))
18
- if (!__hasOwnProp.call(to, key) && key !== except)
19
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ if (!__hasOwnProp.call(to2, key) && key !== except)
19
+ __defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
20
  }
21
- return to;
21
+ return to2;
22
22
  };
23
23
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
24
  // If the importer is in node compatibility mode or this is not an ESM
@@ -7767,10 +7767,10 @@ var require_dcmjs = __commonJS({
7767
7767
  var _arr = [];
7768
7768
  var _n = true;
7769
7769
  var _d = false;
7770
- var _s2, _e;
7770
+ var _s, _e;
7771
7771
  try {
7772
- for (_i = _i.call(arr); !(_n = (_s2 = _i.next()).done); _n = true) {
7773
- _arr.push(_s2.value);
7772
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
7773
+ _arr.push(_s.value);
7774
7774
  if (i && _arr.length === i) break;
7775
7775
  }
7776
7776
  } catch (err2) {
@@ -33550,10 +33550,10 @@ var require_stream_transform = __commonJS({
33550
33550
  if (data2 != null)
33551
33551
  this.push(data2);
33552
33552
  cb(er2);
33553
- var rs2 = this._readableState;
33554
- rs2.reading = false;
33555
- if (rs2.needReadable || rs2.length < rs2.highWaterMark) {
33556
- this._read(rs2.highWaterMark);
33553
+ var rs = this._readableState;
33554
+ rs.reading = false;
33555
+ if (rs.needReadable || rs.length < rs.highWaterMark) {
33556
+ this._read(rs.highWaterMark);
33557
33557
  }
33558
33558
  }
33559
33559
  function Transform(options) {
@@ -33598,8 +33598,8 @@ var require_stream_transform = __commonJS({
33598
33598
  ts.writechunk = chunk;
33599
33599
  ts.writeencoding = encoding;
33600
33600
  if (!ts.transforming) {
33601
- var rs2 = this._readableState;
33602
- if (ts.needTransform || rs2.needReadable || rs2.length < rs2.highWaterMark) this._read(rs2.highWaterMark);
33601
+ var rs = this._readableState;
33602
+ if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
33603
33603
  }
33604
33604
  };
33605
33605
  Transform.prototype._read = function(n) {
@@ -33694,8 +33694,8 @@ var require_pipeline = __commonJS({
33694
33694
  function call(fn2) {
33695
33695
  fn2();
33696
33696
  }
33697
- function pipe(from, to) {
33698
- return from.pipe(to);
33697
+ function pipe(from, to2) {
33698
+ return from.pipe(to2);
33699
33699
  }
33700
33700
  function popCallback(streams) {
33701
33701
  if (!streams.length) return noop;
@@ -35155,9 +35155,9 @@ var require_route = __commonJS({
35155
35155
  }
35156
35156
  return graph;
35157
35157
  }
35158
- function link(from, to) {
35158
+ function link(from, to2) {
35159
35159
  return function(args) {
35160
- return to(from(args));
35160
+ return to2(from(args));
35161
35161
  };
35162
35162
  }
35163
35163
  function wrapConversion(toModel, graph) {
@@ -39447,7 +39447,7 @@ var require_dcmjs_dimse_min = __commonJS({
39447
39447
  }
39448
39448
  };
39449
39449
  }, 371: (e2, t2, s2) => {
39450
- const { Association: n2 } = s2(570), { AAbort: i2, AAssociateAC: r8, AAssociateRJ: o2, AAssociateRQ: a2, AReleaseRP: c, AReleaseRQ: d3, PDataTF: u2, Pdv: h2, RawPdu: m2 } = s2(942), { CommandFieldType: g2, RawPduType: l3, Status: p2, TranscodableTransferSyntaxes: R2 } = s2(492), { CCancelRequest: S2, CEchoRequest: f2, CEchoResponse: y2, CFindRequest: I2, CFindResponse: C2, CGetRequest: P2, CGetResponse: A, CMoveRequest: v, CMoveResponse: w3, Command: x2, CStoreRequest: U2, CStoreResponse: q2, NActionRequest: D2, NActionResponse: E2, NCreateRequest: T, NCreateResponse: b2, NDeleteRequest: O2, NDeleteResponse: N2, NEventReportRequest: B2, NEventReportResponse: M3, NGetRequest: L2, NGetResponse: F2, NSetRequest: k2, NSetResponse: $, Response: j2 } = s2(940), V2 = s2(825), _ = s2(139), G2 = s2(906), z2 = s2(547), { SmartBuffer: Q } = s2(766), { EOL: W2 } = s2(857), J2 = s2(733);
39450
+ const { Association: n2 } = s2(570), { AAbort: i2, AAssociateAC: r8, AAssociateRJ: o2, AAssociateRQ: a2, AReleaseRP: c, AReleaseRQ: d3, PDataTF: u2, Pdv: h2, RawPdu: m2 } = s2(942), { CommandFieldType: g2, RawPduType: l3, Status: p2, TranscodableTransferSyntaxes: R2 } = s2(492), { CCancelRequest: S2, CEchoRequest: f2, CEchoResponse: y2, CFindRequest: I2, CFindResponse: C2, CGetRequest: P2, CGetResponse: A, CMoveRequest: v, CMoveResponse: w3, Command: x2, CStoreRequest: U2, CStoreResponse: q2, NActionRequest: D2, NActionResponse: E2, NCreateRequest: T, NCreateResponse: b2, NDeleteRequest: O2, NDeleteResponse: N2, NEventReportRequest: B2, NEventReportResponse: M3, NGetRequest: L2, NGetResponse: F2, NSetRequest: k2, NSetResponse: $2, Response: j2 } = s2(940), V2 = s2(825), _ = s2(139), G2 = s2(906), z2 = s2(547), { SmartBuffer: Q } = s2(766), { EOL: W } = s2(857), J2 = s2(733);
39451
39451
  class X2 extends J2 {
39452
39452
  constructor() {
39453
39453
  super();
@@ -39488,12 +39488,12 @@ var require_dcmjs_dimse_min = __commonJS({
39488
39488
  sendAssociationRequest(e3) {
39489
39489
  this.association = e3;
39490
39490
  const t3 = new a2(this.association).write();
39491
- this.logId = this.association.getCalledAeTitle(), z2.info(`${this.logId} -> Association request:${W2}${this.association.toString()}`), this._sendPdu(t3);
39491
+ this.logId = this.association.getCalledAeTitle(), z2.info(`${this.logId} -> Association request:${W}${this.association.toString()}`), this._sendPdu(t3);
39492
39492
  }
39493
39493
  sendAssociationAccept() {
39494
39494
  this.association.setImplementationClassUid(_.getImplementationClassUid()), this.association.setImplementationVersion(_.getImplementationVersion()), this.association.setMaxPduLength(Math.min(this.association.getMaxPduLength(), _.getMaxPduLength()));
39495
39495
  const e3 = new r8(this.association).write();
39496
- z2.info(`${this.logId} -> Association accept:${W2}${this.association.toString()}`), this._sendPdu(e3);
39496
+ z2.info(`${this.logId} -> Association accept:${W}${this.association.toString()}`), this._sendPdu(e3);
39497
39497
  }
39498
39498
  sendAssociationReject(e3, t3, s3) {
39499
39499
  const n3 = new o2(e3, t3, s3), i3 = n3.write();
@@ -39591,10 +39591,10 @@ var require_dcmjs_dimse_min = __commonJS({
39591
39591
  try {
39592
39592
  switch (t3.readPdu(), t3.getType()) {
39593
39593
  case l3.AAssociateRQ:
39594
- this.association = new n2(), new a2(this.association).read(t3), this.logId = this.association.getCallingAeTitle(), z2.info(`${this.logId} <- Association request:${W2}${this.association.toString()}`), this.emit("associationRequested", this.association);
39594
+ this.association = new n2(), new a2(this.association).read(t3), this.logId = this.association.getCallingAeTitle(), z2.info(`${this.logId} <- Association request:${W}${this.association.toString()}`), this.emit("associationRequested", this.association);
39595
39595
  break;
39596
39596
  case l3.AAssociateAC:
39597
- new r8(this.association).read(t3), this.logId = this.association.getCalledAeTitle(), z2.info(`${this.logId} <- Association accept:${W2}${this.association.toString()}`), this.emit("associationAccepted", this.association);
39597
+ new r8(this.association).read(t3), this.logId = this.association.getCalledAeTitle(), z2.info(`${this.logId} <- Association accept:${W}${this.association.toString()}`), this.emit("associationAccepted", this.association);
39598
39598
  break;
39599
39599
  case l3.AAssociateRJ: {
39600
39600
  const e4 = new o2();
@@ -39698,7 +39698,7 @@ var require_dcmjs_dimse_min = __commonJS({
39698
39698
  this.dimse = Object.assign(new k2(), s3);
39699
39699
  break;
39700
39700
  case g2.NSetResponse:
39701
- this.dimse = Object.assign(new $(), s3);
39701
+ this.dimse = Object.assign(new $2(), s3);
39702
39702
  break;
39703
39703
  case g2.CCancelRequest:
39704
39704
  this.dimse = Object.assign(new S2(), s3);
@@ -40357,7 +40357,7 @@ var require_dcmjs_dimse_min = __commonJS({
40357
40357
  }
40358
40358
  };
40359
40359
  }, 237: (e2, t2, s2) => {
40360
- const { Association: n2, PresentationContext: i2 } = s2(570), { Scp: r8, Server: o2 } = s2(538), { CCancelRequest: a2, CEchoRequest: c, CEchoResponse: d3, CFindRequest: u2, CFindResponse: h2, CGetRequest: m2, CGetResponse: g2, CMoveRequest: l3, CMoveResponse: p2, CStoreRequest: R2, CStoreResponse: S2, NActionRequest: f2, NActionResponse: y2, NCreateRequest: I2, NCreateResponse: C2, NDeleteRequest: P2, NDeleteResponse: A, NEventReportRequest: v, NEventReportResponse: w3, NGetRequest: x2, NGetResponse: U2, NSetRequest: q2, NSetResponse: D2 } = s2(940), { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: B2, RejectReason: M3, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $, StorageClass: j2, TransferSyntax: V2, Uid: _, UserIdentityType: G2 } = s2(492), z2 = s2(422), Q = s2(825), W2 = s2(139), J2 = s2(906), X2 = { association: { Association: n2, PresentationContext: i2 }, Client: z2, constants: { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: B2, RejectReason: M3, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $, StorageClass: j2, TransferSyntax: V2, Uid: _, UserIdentityType: G2 }, Dataset: Q, Implementation: W2, log: s2(547), requests: { CCancelRequest: a2, CEchoRequest: c, CFindRequest: u2, CGetRequest: m2, CMoveRequest: l3, CStoreRequest: R2, NActionRequest: f2, NCreateRequest: I2, NDeleteRequest: P2, NEventReportRequest: v, NGetRequest: x2, NSetRequest: q2 }, responses: { CEchoResponse: d3, CFindResponse: h2, CGetResponse: g2, CMoveResponse: p2, CStoreResponse: S2, NActionResponse: y2, NCreateResponse: C2, NDeleteResponse: A, NEventReportResponse: w3, NGetResponse: U2, NSetResponse: D2 }, Scp: r8, Server: o2, Statistics: J2, version: s2(837) };
40360
+ const { Association: n2, PresentationContext: i2 } = s2(570), { Scp: r8, Server: o2 } = s2(538), { CCancelRequest: a2, CEchoRequest: c, CEchoResponse: d3, CFindRequest: u2, CFindResponse: h2, CGetRequest: m2, CGetResponse: g2, CMoveRequest: l3, CMoveResponse: p2, CStoreRequest: R2, CStoreResponse: S2, NActionRequest: f2, NActionResponse: y2, NCreateRequest: I2, NCreateResponse: C2, NDeleteRequest: P2, NDeleteResponse: A, NEventReportRequest: v, NEventReportResponse: w3, NGetRequest: x2, NGetResponse: U2, NSetRequest: q2, NSetResponse: D2 } = s2(940), { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: B2, RejectReason: M3, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $2, StorageClass: j2, TransferSyntax: V2, Uid: _, UserIdentityType: G2 } = s2(492), z2 = s2(422), Q = s2(825), W = s2(139), J2 = s2(906), X2 = { association: { Association: n2, PresentationContext: i2 }, Client: z2, constants: { AbortReason: E2, AbortSource: T, CommandFieldType: b2, PresentationContextResult: O2, Priority: N2, RawPduType: B2, RejectReason: M3, RejectResult: L2, RejectSource: F2, SopClass: k2, Status: $2, StorageClass: j2, TransferSyntax: V2, Uid: _, UserIdentityType: G2 }, Dataset: Q, Implementation: W, log: s2(547), requests: { CCancelRequest: a2, CEchoRequest: c, CFindRequest: u2, CGetRequest: m2, CMoveRequest: l3, CStoreRequest: R2, NActionRequest: f2, NCreateRequest: I2, NDeleteRequest: P2, NEventReportRequest: v, NGetRequest: x2, NSetRequest: q2 }, responses: { CEchoResponse: d3, CFindResponse: h2, CGetResponse: g2, CMoveResponse: p2, CStoreResponse: S2, NActionResponse: y2, NCreateResponse: C2, NDeleteResponse: A, NEventReportResponse: w3, NGetResponse: U2, NSetResponse: D2 }, Scp: r8, Server: o2, Statistics: J2, version: s2(837) };
40361
40361
  e2.exports = X2;
40362
40362
  }, 547: (e2, t2, s2) => {
40363
40363
  const { createLogger: n2, format: i2, transports: r8 } = s2(688), { combine: o2, printf: a2, timestamp: c } = i2, d3 = n2({ format: o2(c(), a2(({ level: e3, message: t3, timestamp: s3 }) => `${s3} -- ${e3.toUpperCase()} -- ${t3}`)), transports: [new r8.Console()] });
@@ -40541,30 +40541,30 @@ function Ne(r7) {
40541
40541
  return r7 ? typeof r7 == "string" ? r7 : r7 instanceof Error ? r7.message : be(r7) ? cn(r7) : typeof r7 == "object" && "code" in r7 && typeof r7.code == "string" ? r7.code : JSON.stringify(r7) : "Unknown error";
40542
40542
  }
40543
40543
  function cn(r7) {
40544
- let e = r7.issue?.map(Ji) ?? [];
40544
+ let e = r7.issue?.map(Yi) ?? [];
40545
40545
  return e.length > 0 ? e.join("; ") : "Unknown error";
40546
40546
  }
40547
- function Ji(r7) {
40547
+ function Yi(r7) {
40548
40548
  let e;
40549
40549
  return r7.details?.text ? r7.diagnostics ? e = `${r7.details.text} (${r7.diagnostics})` : e = r7.details.text : r7.diagnostics ? e = r7.diagnostics : e = "Unknown error", r7.expression?.length && (e += ` (${r7.expression.join(", ")})`), e;
40550
40550
  }
40551
- function Zi(r7, e) {
40551
+ function Xi(r7, e) {
40552
40552
  let t = e.max && e.max === Number.MAX_SAFE_INTEGER ? Number.POSITIVE_INFINITY : e.max;
40553
40553
  return { path: r7, description: "", type: e.type ?? [], min: e.min ?? 0, max: t ?? 1, isArray: !!t && t > 1, constraints: [] };
40554
40554
  }
40555
40555
  function pn(r7) {
40556
40556
  let e = /* @__PURE__ */ Object.create(null);
40557
- for (let [t, n] of Object.entries(r7)) e[t] = { name: t, type: t, path: t, elements: Object.fromEntries(Object.entries(n.elements).map(([i, o]) => [i, Zi(i, o)])), constraints: [], innerTypes: [] };
40557
+ for (let [t, n] of Object.entries(r7)) e[t] = { name: t, type: t, path: t, elements: Object.fromEntries(Object.entries(n.elements).map(([i, o]) => [i, Xi(i, o)])), constraints: [], innerTypes: [] };
40558
40558
  return e;
40559
40559
  }
40560
- var dn = { Element: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, BackboneElement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, Address: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: 9007199254740991, type: [{ code: "string" }] }, city: { type: [{ code: "string" }] }, district: { type: [{ code: "string" }] }, state: { type: [{ code: "string" }] }, postalCode: { type: [{ code: "string" }] }, country: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Age: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "author[x]": { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Organization"] }, { code: "string" }] }, time: { type: [{ code: "dateTime" }] }, text: { min: 1, type: [{ code: "markdown" }] } } }, Attachment: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, contentType: { type: [{ code: "code" }] }, language: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] }, url: { type: [{ code: "url" }] }, size: { type: [{ code: "unsignedInt" }] }, hash: { type: [{ code: "base64Binary" }] }, title: { type: [{ code: "string" }] }, creation: { type: [{ code: "dateTime" }] } } }, CodeableConcept: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, coding: { max: 9007199254740991, type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: 9007199254740991, type: [{ code: "ContactPoint" }] } } }, ContactPoint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] } } }, Count: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, "subject[x]": { type: [{ code: "CodeableConcept" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Group"] }] }, mustSupport: { max: 9007199254740991, type: [{ code: "string" }] }, codeFilter: { max: 9007199254740991, type: [{ code: "DataRequirementCodeFilter" }] }, dateFilter: { max: 9007199254740991, type: [{ code: "DataRequirementDateFilter" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: 9007199254740991, type: [{ code: "DataRequirementSort" }] } } }, Distance: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] }, patientInstruction: { type: [{ code: "string" }] }, timing: { type: [{ code: "Timing" }] }, "asNeeded[x]": { type: [{ code: "boolean" }, { code: "CodeableConcept" }] }, site: { type: [{ code: "CodeableConcept" }] }, route: { type: [{ code: "CodeableConcept" }] }, method: { type: [{ code: "CodeableConcept" }] }, doseAndRate: { max: 9007199254740991, type: [{ code: "DosageDoseAndRate" }] }, maxDosePerPeriod: { type: [{ code: "Ratio" }] }, maxDosePerAdministration: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, maxDosePerLifetime: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Duration: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: 9007199254740991, type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] }, slicing: { type: [{ code: "ElementDefinitionSlicing" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: 9007199254740991, type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "ElementDefinitionBase" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: 9007199254740991, type: [{ code: "ElementDefinitionType" }] }, "defaultValue[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, meaningWhenMissing: { type: [{ code: "markdown" }] }, orderMeaning: { type: [{ code: "string" }] }, "fixed[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, "pattern[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, example: { max: 9007199254740991, type: [{ code: "ElementDefinitionExample" }] }, "minValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, "maxValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, maxLength: { type: [{ code: "integer" }] }, condition: { max: 9007199254740991, type: [{ code: "id" }] }, constraint: { max: 9007199254740991, type: [{ code: "ElementDefinitionConstraint" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "ElementDefinitionBinding" }] }, mapping: { max: 9007199254740991, type: [{ code: "ElementDefinitionMapping" }] } } }, Expression: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, description: { type: [{ code: "string" }] }, name: { type: [{ code: "id" }] }, language: { min: 1, type: [{ code: "code" }] }, expression: { type: [{ code: "string" }] }, reference: { type: [{ code: "uri" }] } } }, Extension: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "uri" }] }, "value[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, HumanName: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: 9007199254740991, type: [{ code: "string" }] }, prefix: { max: 9007199254740991, type: [{ code: "string" }] }, suffix: { max: 9007199254740991, type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "CodeableConcept" }] }, system: { type: [{ code: "uri" }] }, value: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] }, assigner: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MarketingStatus: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, country: { min: 1, type: [{ code: "CodeableConcept" }] }, jurisdiction: { type: [{ code: "CodeableConcept" }] }, status: { min: 1, type: [{ code: "CodeableConcept" }] }, dateRange: { min: 1, type: [{ code: "Period" }] }, restoreDate: { type: [{ code: "dateTime" }] } } }, Meta: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: 9007199254740991, type: [{ code: "Coding" }] }, tag: { max: 9007199254740991, type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, onBehalfOf: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, accounts: { max: 9007199254740991, type: [{ code: "Reference" }] }, compartment: { max: 9007199254740991, type: [{ code: "Reference" }] } } }, Money: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "code" }] }, use: { min: 1, type: [{ code: "code" }] }, min: { type: [{ code: "integer" }] }, max: { type: [{ code: "string" }] }, documentation: { type: [{ code: "string" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, Period: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, height: { type: [{ code: "Quantity" }] }, width: { type: [{ code: "Quantity" }] }, depth: { type: [{ code: "Quantity" }] }, weight: { type: [{ code: "Quantity" }] }, nominalVolume: { type: [{ code: "Quantity" }] }, externalDiameter: { type: [{ code: "Quantity" }] }, shape: { type: [{ code: "string" }] }, color: { max: 9007199254740991, type: [{ code: "string" }] }, imprint: { max: 9007199254740991, type: [{ code: "string" }] }, image: { max: 9007199254740991, type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, Quantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Range: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, low: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, high: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Ratio: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, label: { type: [{ code: "string" }] }, display: { type: [{ code: "string" }] }, citation: { type: [{ code: "markdown" }] }, url: { type: [{ code: "url" }] }, document: { type: [{ code: "Attachment" }] }, resource: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Resource"] }] } } }, SampledData: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, origin: { min: 1, type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, period: { min: 1, type: [{ code: "decimal" }] }, factor: { type: [{ code: "decimal" }] }, lowerLimit: { type: [{ code: "decimal" }] }, upperLimit: { type: [{ code: "decimal" }] }, dimensions: { min: 1, type: [{ code: "positiveInt" }] }, data: { type: [{ code: "string" }] } } }, Signature: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, max: 9007199254740991, type: [{ code: "Coding" }] }, when: { min: 1, type: [{ code: "instant" }] }, who: { min: 1, type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, onBehalfOf: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, targetFormat: { type: [{ code: "code" }] }, sigFormat: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] } } }, SubstanceAmount: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "SubstanceAmountReferenceRange" }] } } }, Timing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, event: { max: 9007199254740991, type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "TimingRepeat" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TriggerDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { type: [{ code: "string" }] }, "timing[x]": { type: [{ code: "Timing" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Schedule"] }, { code: "date" }, { code: "dateTime" }] }, data: { max: 9007199254740991, type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "Coding" }] }, "value[x]": { min: 1, type: [{ code: "CodeableConcept" }, { code: "Quantity" }, { code: "Range" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/PlanDefinition", "http://hl7.org/fhir/StructureDefinition/ResearchStudy", "http://hl7.org/fhir/StructureDefinition/InsurancePlan", "http://hl7.org/fhir/StructureDefinition/HealthcareService", "http://hl7.org/fhir/StructureDefinition/Group", "http://hl7.org/fhir/StructureDefinition/Location", "http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MoneyQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, SimpleQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { max: 0, type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, IdentityProvider: { elements: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, tokenAuthMethod: { type: [{ code: "code" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, usePkce: { type: [{ code: "boolean" }] }, useSubject: { type: [{ code: "boolean" }] } } } };
40560
+ var dn = { Element: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, BackboneElement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, Address: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: 9007199254740991, type: [{ code: "string" }] }, city: { type: [{ code: "string" }] }, district: { type: [{ code: "string" }] }, state: { type: [{ code: "string" }] }, postalCode: { type: [{ code: "string" }] }, country: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Age: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "author[x]": { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Organization"] }, { code: "string" }] }, time: { type: [{ code: "dateTime" }] }, text: { min: 1, type: [{ code: "markdown" }] } } }, Attachment: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, contentType: { type: [{ code: "code" }] }, language: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] }, url: { type: [{ code: "url" }] }, size: { type: [{ code: "unsignedInt" }] }, hash: { type: [{ code: "base64Binary" }] }, title: { type: [{ code: "string" }] }, creation: { type: [{ code: "dateTime" }] } } }, CodeableConcept: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, coding: { max: 9007199254740991, type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: 9007199254740991, type: [{ code: "ContactPoint" }] } } }, ContactPoint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] } } }, Count: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, "subject[x]": { type: [{ code: "CodeableConcept" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Group"] }] }, mustSupport: { max: 9007199254740991, type: [{ code: "string" }] }, codeFilter: { max: 9007199254740991, type: [{ code: "DataRequirementCodeFilter" }] }, dateFilter: { max: 9007199254740991, type: [{ code: "DataRequirementDateFilter" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: 9007199254740991, type: [{ code: "DataRequirementSort" }] } } }, DataRequirementCodeFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] } } }, DataRequirementDateFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, "value[x]": { type: [{ code: "dateTime" }, { code: "Period" }, { code: "Duration" }] } } }, DataRequirementSort: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, direction: { min: 1, type: [{ code: "code" }] } } }, Distance: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] }, patientInstruction: { type: [{ code: "string" }] }, timing: { type: [{ code: "Timing" }] }, "asNeeded[x]": { type: [{ code: "boolean" }, { code: "CodeableConcept" }] }, site: { type: [{ code: "CodeableConcept" }] }, route: { type: [{ code: "CodeableConcept" }] }, method: { type: [{ code: "CodeableConcept" }] }, doseAndRate: { max: 9007199254740991, type: [{ code: "DosageDoseAndRate" }] }, maxDosePerPeriod: { type: [{ code: "Ratio" }] }, maxDosePerAdministration: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, maxDosePerLifetime: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, DosageDoseAndRate: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { type: [{ code: "CodeableConcept" }] }, "dose[x]": { type: [{ code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, "rate[x]": { type: [{ code: "Ratio" }, { code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Duration: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: 9007199254740991, type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] }, slicing: { type: [{ code: "ElementDefinitionSlicing" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: 9007199254740991, type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "ElementDefinitionBase" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: 9007199254740991, type: [{ code: "ElementDefinitionType" }] }, "defaultValue[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, meaningWhenMissing: { type: [{ code: "markdown" }] }, orderMeaning: { type: [{ code: "string" }] }, "fixed[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, "pattern[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, example: { max: 9007199254740991, type: [{ code: "ElementDefinitionExample" }] }, "minValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, "maxValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, maxLength: { type: [{ code: "integer" }] }, condition: { max: 9007199254740991, type: [{ code: "id" }] }, constraint: { max: 9007199254740991, type: [{ code: "ElementDefinitionConstraint" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "ElementDefinitionBinding" }] }, mapping: { max: 9007199254740991, type: [{ code: "ElementDefinitionMapping" }] } } }, ElementDefinitionSlicingDiscriminator: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, path: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionSlicing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, discriminator: { max: 9007199254740991, type: [{ code: "ElementDefinitionSlicingDiscriminator" }] }, description: { type: [{ code: "string" }] }, ordered: { type: [{ code: "boolean" }] }, rules: { min: 1, type: [{ code: "code" }] } } }, ElementDefinitionBase: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, min: { min: 1, type: [{ code: "unsignedInt" }] }, max: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionType: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, targetProfile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, aggregation: { max: 9007199254740991, type: [{ code: "code" }] }, versioning: { type: [{ code: "code" }] } } }, ElementDefinitionExample: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, label: { min: 1, type: [{ code: "string" }] }, "value[x]": { min: 1, type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, ElementDefinitionConstraint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, key: { min: 1, type: [{ code: "id" }] }, requirements: { type: [{ code: "string" }] }, severity: { min: 1, type: [{ code: "code" }] }, human: { min: 1, type: [{ code: "string" }] }, expression: { type: [{ code: "string" }] }, xpath: { type: [{ code: "string" }] }, source: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, ElementDefinitionBinding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, strength: { min: 1, type: [{ code: "code" }] }, description: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] } } }, ElementDefinitionMapping: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identity: { min: 1, type: [{ code: "id" }] }, language: { type: [{ code: "code" }] }, map: { min: 1, type: [{ code: "string" }] }, comment: { type: [{ code: "string" }] } } }, Expression: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, description: { type: [{ code: "string" }] }, name: { type: [{ code: "id" }] }, language: { min: 1, type: [{ code: "code" }] }, expression: { type: [{ code: "string" }] }, reference: { type: [{ code: "uri" }] } } }, Extension: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "uri" }] }, "value[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, HumanName: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: 9007199254740991, type: [{ code: "string" }] }, prefix: { max: 9007199254740991, type: [{ code: "string" }] }, suffix: { max: 9007199254740991, type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "CodeableConcept" }] }, system: { type: [{ code: "uri" }] }, value: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] }, assigner: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MarketingStatus: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, country: { min: 1, type: [{ code: "CodeableConcept" }] }, jurisdiction: { type: [{ code: "CodeableConcept" }] }, status: { min: 1, type: [{ code: "CodeableConcept" }] }, dateRange: { min: 1, type: [{ code: "Period" }] }, restoreDate: { type: [{ code: "dateTime" }] } } }, Meta: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: 9007199254740991, type: [{ code: "Coding" }] }, tag: { max: 9007199254740991, type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, onBehalfOf: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, accounts: { max: 9007199254740991, type: [{ code: "Reference" }] }, compartment: { max: 9007199254740991, type: [{ code: "Reference" }] } } }, Money: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "code" }] }, use: { min: 1, type: [{ code: "code" }] }, min: { type: [{ code: "integer" }] }, max: { type: [{ code: "string" }] }, documentation: { type: [{ code: "string" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, Period: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, height: { type: [{ code: "Quantity" }] }, width: { type: [{ code: "Quantity" }] }, depth: { type: [{ code: "Quantity" }] }, weight: { type: [{ code: "Quantity" }] }, nominalVolume: { type: [{ code: "Quantity" }] }, externalDiameter: { type: [{ code: "Quantity" }] }, shape: { type: [{ code: "string" }] }, color: { max: 9007199254740991, type: [{ code: "string" }] }, imprint: { max: 9007199254740991, type: [{ code: "string" }] }, image: { max: 9007199254740991, type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, Quantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Range: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, low: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, high: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Ratio: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, label: { type: [{ code: "string" }] }, display: { type: [{ code: "string" }] }, citation: { type: [{ code: "markdown" }] }, url: { type: [{ code: "url" }] }, document: { type: [{ code: "Attachment" }] }, resource: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Resource"] }] } } }, SampledData: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, origin: { min: 1, type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, period: { min: 1, type: [{ code: "decimal" }] }, factor: { type: [{ code: "decimal" }] }, lowerLimit: { type: [{ code: "decimal" }] }, upperLimit: { type: [{ code: "decimal" }] }, dimensions: { min: 1, type: [{ code: "positiveInt" }] }, data: { type: [{ code: "string" }] } } }, Signature: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, max: 9007199254740991, type: [{ code: "Coding" }] }, when: { min: 1, type: [{ code: "instant" }] }, who: { min: 1, type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, onBehalfOf: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, targetFormat: { type: [{ code: "code" }] }, sigFormat: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] } } }, SubstanceAmount: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "SubstanceAmountReferenceRange" }] } } }, SubstanceAmountReferenceRange: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, lowLimit: { type: [{ code: "Quantity" }] }, highLimit: { type: [{ code: "Quantity" }] } } }, Timing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, event: { max: 9007199254740991, type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "TimingRepeat" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TimingRepeat: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "bounds[x]": { type: [{ code: "Duration" }, { code: "Range" }, { code: "Period" }] }, count: { type: [{ code: "positiveInt" }] }, countMax: { type: [{ code: "positiveInt" }] }, duration: { type: [{ code: "decimal" }] }, durationMax: { type: [{ code: "decimal" }] }, durationUnit: { type: [{ code: "code" }] }, frequency: { type: [{ code: "positiveInt" }] }, frequencyMax: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "decimal" }] }, periodMax: { type: [{ code: "decimal" }] }, periodUnit: { type: [{ code: "code" }] }, dayOfWeek: { max: 9007199254740991, type: [{ code: "code" }] }, timeOfDay: { max: 9007199254740991, type: [{ code: "time" }] }, when: { max: 9007199254740991, type: [{ code: "code" }] }, offset: { type: [{ code: "unsignedInt" }] } } }, TriggerDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { type: [{ code: "string" }] }, "timing[x]": { type: [{ code: "Timing" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Schedule"] }, { code: "date" }, { code: "dateTime" }] }, data: { max: 9007199254740991, type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "Coding" }] }, "value[x]": { min: 1, type: [{ code: "CodeableConcept" }, { code: "Quantity" }, { code: "Range" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/PlanDefinition", "http://hl7.org/fhir/StructureDefinition/ResearchStudy", "http://hl7.org/fhir/StructureDefinition/InsurancePlan", "http://hl7.org/fhir/StructureDefinition/HealthcareService", "http://hl7.org/fhir/StructureDefinition/Group", "http://hl7.org/fhir/StructureDefinition/Location", "http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MoneyQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, SimpleQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { max: 0, type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, IdentityProvider: { elements: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, tokenAuthMethod: { type: [{ code: "code" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, usePkce: { type: [{ code: "boolean" }] }, useSubject: { type: [{ code: "boolean" }] } } } };
40561
40561
  function sr(r7) {
40562
40562
  return new ir(r7).parse();
40563
40563
  }
40564
40564
  var ce = pn(dn);
40565
40565
  var ar = /* @__PURE__ */ Object.create(null);
40566
40566
  var fn = /* @__PURE__ */ Object.create(null);
40567
- var eo = { "http://hl7.org/fhir/StructureDefinition/MoneyQuantity": "MoneyQuantity", "http://hl7.org/fhir/StructureDefinition/SimpleQuantity": "SimpleQuantity", "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition": "ViewDefinition" };
40567
+ var to = { "http://hl7.org/fhir/StructureDefinition/MoneyQuantity": "MoneyQuantity", "http://hl7.org/fhir/StructureDefinition/SimpleQuantity": "SimpleQuantity", "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition": "ViewDefinition" };
40568
40568
  function gn(r7) {
40569
40569
  let e;
40570
40570
  return e = fn[r7], e || (e = fn[r7] = /* @__PURE__ */ Object.create(null)), e;
@@ -40576,12 +40576,12 @@ function cr(r7) {
40576
40576
  function ur(r7) {
40577
40577
  if (!r7?.name) throw new Error("Failed loading StructureDefinition from bundle");
40578
40578
  if (r7.resourceType !== "StructureDefinition") return;
40579
- let e = sr(r7), t = eo[r7.url], n, i;
40579
+ let e = sr(r7), t = to[r7.url], n, i;
40580
40580
  t ? (n = ce, i = t) : r7.url === `http://hl7.org/fhir/StructureDefinition/${r7.type}` || r7.url === `https://medplum.com/fhir/StructureDefinition/${r7.type}` || r7.type?.startsWith("http://") || r7.type?.startsWith("https://") ? (n = ce, i = r7.type) : (n = gn(r7.url), i = r7.type), n[i] = e;
40581
40581
  for (let o of e.innerTypes) o.parentType = e, n[o.name] = o;
40582
40582
  ar[r7.url] = e;
40583
40583
  }
40584
- function xn(r7) {
40584
+ function vn(r7) {
40585
40585
  return !!ce[r7];
40586
40586
  }
40587
40587
  function Le(r7, e) {
@@ -40597,7 +40597,7 @@ function Sn(r7) {
40597
40597
  var ir = class {
40598
40598
  constructor(e) {
40599
40599
  if (!e.snapshot?.element || e.snapshot.element.length === 0) throw new Error(`No snapshot defined for StructureDefinition '${e.name}'`);
40600
- this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, path: this.root.path, title: e.title, type: e.type, url: e.url, kind: e.kind, description: io(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
40600
+ this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, path: this.root.path, title: e.title, type: e.type, url: e.url, kind: e.kind, description: oo(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
40601
40601
  }
40602
40602
  parse() {
40603
40603
  let e = this.next();
@@ -40638,7 +40638,7 @@ var ir = class {
40638
40638
  this.backboneContext = { type: { name: t, type: t, path: e.path, title: e.label, description: e.definition, elements: {}, constraints: this.parseElementDefinition(e).constraints, innerTypes: [] }, path: e.path, parent: Re(this.backboneContext?.path, e.path) ? this.backboneContext : this.backboneContext?.parent };
40639
40639
  }
40640
40640
  enterSlice(e, t) {
40641
- no(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
40641
+ io(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
40642
40642
  if (n.type !== "value" && n.type !== "pattern" && n.type !== "type") throw new Error(`Unsupported slicing discriminator type: ${n.type}`);
40643
40643
  return { path: n.path, type: n.type };
40644
40644
  }), slices: [], ordered: e.slicing?.ordered ?? false, rule: e.slicing?.rules }, this.slicingContext = { field: t.slicing, path: e.path ?? "" });
@@ -40686,9 +40686,9 @@ function hn(r7) {
40686
40686
  return r7 === "*" ? Number.POSITIVE_INFINITY : Number.parseInt(r7, 10);
40687
40687
  }
40688
40688
  function nr(r7, e = "") {
40689
- return ro(r7.path, e);
40689
+ return no(r7.path, e);
40690
40690
  }
40691
- function ro(r7, e) {
40691
+ function no(r7, e) {
40692
40692
  return r7 ? e && r7.startsWith(e) ? r7.substring(e.length + 1) : r7 : "";
40693
40693
  }
40694
40694
  function Re(r7, e) {
@@ -40697,11 +40697,11 @@ function Re(r7, e) {
40697
40697
  function yn(r7) {
40698
40698
  return Array.isArray(r7) && r7.length > 0 ? r7[0] : S(r7) ? void 0 : r7;
40699
40699
  }
40700
- function no(r7) {
40700
+ function io(r7) {
40701
40701
  let e = r7.slicing?.discriminator;
40702
40702
  return !!(r7.type?.some((t) => t.code === "Extension") && e?.length === 1 && e[0].type === "value" && e[0].path === "url");
40703
40703
  }
40704
- function io(r7) {
40704
+ function oo(r7) {
40705
40705
  let e = r7.description;
40706
40706
  return e?.startsWith(`Base StructureDefinition for ${r7.name} Type: `) && (e = e.substring(`Base StructureDefinition for ${r7.name} Type: `.length)), e;
40707
40707
  }
@@ -40710,7 +40710,7 @@ function f(r7) {
40710
40710
  return [{ type: l.boolean, value: r7 }];
40711
40711
  }
40712
40712
  function g(r7) {
40713
- return r7 == null ? { type: "undefined", value: void 0 } : Number.isSafeInteger(r7) ? { type: l.integer, value: r7 } : typeof r7 == "number" ? { type: l.decimal, value: r7 } : typeof r7 == "boolean" ? { type: l.boolean, value: r7 } : typeof r7 == "string" ? { type: l.string, value: r7 } : k(r7) ? { type: l.Quantity, value: r7 } : I(r7) ? { type: r7.resourceType, value: r7 } : Tr(r7) ? { type: l.CodeableConcept, value: r7 } : xr(r7) ? { type: l.Coding, value: r7 } : { type: l.BackboneElement, value: r7 };
40713
+ return r7 == null ? { type: "undefined", value: void 0 } : Number.isSafeInteger(r7) ? { type: l.integer, value: r7 } : typeof r7 == "number" ? { type: l.decimal, value: r7 } : typeof r7 == "boolean" ? { type: l.boolean, value: r7 } : typeof r7 == "string" ? { type: l.string, value: r7 } : k(r7) ? { type: l.Quantity, value: r7 } : I(r7) ? { type: r7.resourceType, value: r7 } : Tr(r7) ? { type: l.CodeableConcept, value: r7 } : vr(r7) ? { type: l.Coding, value: r7 } : { type: l.BackboneElement, value: r7 };
40714
40714
  }
40715
40715
  function N(r7) {
40716
40716
  return r7.length === 0 ? false : !!r7[0].value;
@@ -40724,9 +40724,9 @@ function j(r7, e) {
40724
40724
  function P(r7, e, t) {
40725
40725
  if (!r7.value) return;
40726
40726
  let n = st(r7.type, e, t?.profileUrl);
40727
- return n ? yo(r7, e, n) : go(r7, e);
40727
+ return n ? go(r7, e, n) : xo(r7, e);
40728
40728
  }
40729
- function yo(r7, e, t) {
40729
+ function go(r7, e, t) {
40730
40730
  let n = r7.value, i = t.type;
40731
40731
  if (!i || i.length === 0) return;
40732
40732
  let o, s = "undefined", a2, c = t.path.lastIndexOf("."), u2 = t.path.substring(c + 1);
@@ -40746,7 +40746,7 @@ function yo(r7, e, t) {
40746
40746
  function Rn(r7, e) {
40747
40747
  return e === "Resource" && I(r7) && (e = r7.resourceType), { type: e, value: r7 };
40748
40748
  }
40749
- function go(r7, e) {
40749
+ function xo(r7, e) {
40750
40750
  let t = r7.value;
40751
40751
  if (!t || typeof t != "object") return;
40752
40752
  let n;
@@ -40792,14 +40792,14 @@ function kn(r7, e) {
40792
40792
  }
40793
40793
  function yr(r7, e) {
40794
40794
  let t = r7.value?.valueOf(), n = e.value?.valueOf();
40795
- return typeof t == "number" && typeof n == "number" ? f(Math.abs(t - n) < 1e-8) : k(t) && k(n) ? f(Mn(t, n)) : f(typeof t == "object" && typeof n == "object" ? vr(r7, e) : t === n);
40795
+ return typeof t == "number" && typeof n == "number" ? f(Math.abs(t - n) < 1e-8) : k(t) && k(n) ? f(Mn(t, n)) : f(typeof t == "object" && typeof n == "object" ? xr(r7, e) : t === n);
40796
40796
  }
40797
40797
  function gr(r7, e) {
40798
40798
  return r7.length === 0 && e.length === 0 ? f(true) : r7.length !== e.length ? f(false) : (r7.sort(Cn), e.sort(Cn), f(r7.every((t, n) => N(vo(t, e[n])))));
40799
40799
  }
40800
40800
  function vo(r7, e) {
40801
40801
  let { type: t, value: n } = r7, { type: i, value: o } = e, s = n?.valueOf(), a2 = o?.valueOf();
40802
- return typeof s == "number" && typeof a2 == "number" ? f(Math.abs(s - a2) < 0.01) : k(s) && k(a2) ? f(Mn(s, a2)) : f(t === "Coding" && i === "Coding" ? typeof s != "object" || typeof a2 != "object" ? false : s.code === a2.code && s.system === a2.system : typeof s == "object" && typeof a2 == "object" ? vr({ ...s, id: void 0 }, { ...a2, id: void 0 }) : typeof s == "string" && typeof a2 == "string" ? s.toLowerCase() === a2.toLowerCase() : s === a2);
40802
+ return typeof s == "number" && typeof a2 == "number" ? f(Math.abs(s - a2) < 0.01) : k(s) && k(a2) ? f(Mn(s, a2)) : f(t === "Coding" && i === "Coding" ? typeof s != "object" || typeof a2 != "object" ? false : s.code === a2.code && s.system === a2.system : typeof s == "object" && typeof a2 == "object" ? xr({ ...s, id: void 0 }, { ...a2, id: void 0 }) : typeof s == "string" && typeof a2 == "string" ? s.toLowerCase() === a2.toLowerCase() : s === a2);
40803
40803
  }
40804
40804
  function Cn(r7, e) {
40805
40805
  let t = r7.value?.valueOf(), n = e.value?.valueOf();
@@ -40843,13 +40843,13 @@ function k(r7) {
40843
40843
  function Mn(r7, e) {
40844
40844
  return Math.abs(r7.value - e.value) < 0.01 && (r7.unit === e.unit || r7.code === e.code || r7.unit === e.code || r7.code === e.unit);
40845
40845
  }
40846
- function vr(r7, e) {
40846
+ function xr(r7, e) {
40847
40847
  let t = Object.keys(r7), n = Object.keys(e);
40848
40848
  if (t.length !== n.length) return false;
40849
40849
  for (let i of t) {
40850
40850
  let o = r7[i], s = e[i];
40851
40851
  if (wn(o) && wn(s)) {
40852
- if (!vr(o, s)) return false;
40852
+ if (!xr(o, s)) return false;
40853
40853
  } else if (o !== s) return false;
40854
40854
  }
40855
40855
  return true;
@@ -40860,15 +40860,15 @@ function wn(r7) {
40860
40860
  function An(r7, e) {
40861
40861
  if (e) {
40862
40862
  if (typeof e != "object") throw new Error("Primitive extension must be an object");
40863
- return xo(r7 ?? {}, e);
40863
+ return To(r7 ?? {}, e);
40864
40864
  }
40865
40865
  return r7;
40866
40866
  }
40867
- function xo(r7, e) {
40867
+ function To(r7, e) {
40868
40868
  return delete e.__proto__, delete e.constructor, Object.assign(r7, e);
40869
40869
  }
40870
40870
  function te(r7) {
40871
- let e = le(r7), t = So(r7);
40871
+ let e = le(r7), t = Eo(r7);
40872
40872
  return t === e ? { reference: e } : { reference: e, display: t };
40873
40873
  }
40874
40874
  function le(r7) {
@@ -40877,16 +40877,16 @@ function le(r7) {
40877
40877
  function pe(r7) {
40878
40878
  if (r7) return ue(r7) ? r7.reference.split("/")[1] : r7.id;
40879
40879
  }
40880
- function To(r7) {
40880
+ function So(r7) {
40881
40881
  return r7.resourceType === "Patient" || r7.resourceType === "Practitioner" || r7.resourceType === "RelatedPerson";
40882
40882
  }
40883
- function So(r7) {
40884
- if (To(r7)) {
40885
- let e = Eo(r7);
40883
+ function Eo(r7) {
40884
+ if (So(r7)) {
40885
+ let e = bo(r7);
40886
40886
  if (e) return e;
40887
40887
  }
40888
40888
  if (r7.resourceType === "Device") {
40889
- let e = bo(r7);
40889
+ let e = Ro(r7);
40890
40890
  if (e) return e;
40891
40891
  }
40892
40892
  if (r7.resourceType === "MedicationRequest" && r7.medicationCodeableConcept) return at(r7.medicationCodeableConcept);
@@ -40896,15 +40896,15 @@ function So(r7) {
40896
40896
  if ("code" in r7 && r7.code) {
40897
40897
  let e = r7.code;
40898
40898
  if (Array.isArray(e) && (e = e[0]), Tr(e)) return at(e);
40899
- if (Vo(e)) return e.text;
40899
+ if (Do(e)) return e.text;
40900
40900
  }
40901
40901
  return le(r7);
40902
40902
  }
40903
- function Eo(r7) {
40903
+ function bo(r7) {
40904
40904
  let e = r7.name;
40905
40905
  if (e && e.length > 0) return lt(e[0]);
40906
40906
  }
40907
- function bo(r7) {
40907
+ function Ro(r7) {
40908
40908
  let e = r7.deviceName;
40909
40909
  if (e && e.length > 0) return e[0].name;
40910
40910
  }
@@ -40917,8 +40917,8 @@ function ct(r7, e) {
40917
40917
  (c < o || c === o && u2 < s) && p2--;
40918
40918
  let m2 = a2 * 12 + c - (i * 12 + o);
40919
40919
  u2 < s && m2--;
40920
- let v = Math.floor((n.getTime() - t.getTime()) / (1e3 * 60 * 60 * 24));
40921
- return { years: p2, months: m2, days: v };
40920
+ let x2 = Math.floor((n.getTime() - t.getTime()) / (1e3 * 60 * 60 * 24));
40921
+ return { years: p2, months: m2, days: x2 };
40922
40922
  }
40923
40923
  function X(r7, ...e) {
40924
40924
  let t = r7;
@@ -40926,12 +40926,12 @@ function X(r7, ...e) {
40926
40926
  return t;
40927
40927
  }
40928
40928
  function Fn(r7, e) {
40929
- return JSON.stringify(r7, Co, e ? 2 : void 0);
40929
+ return JSON.stringify(r7, Po, e ? 2 : void 0);
40930
40930
  }
40931
- function Co(r7, e) {
40932
- return !Po(r7) && S(e) ? void 0 : e;
40931
+ function Po(r7, e) {
40932
+ return !wo(r7) && S(e) ? void 0 : e;
40933
40933
  }
40934
- function Po(r7) {
40934
+ function wo(r7) {
40935
40935
  return !!/\d+$/.exec(r7);
40936
40936
  }
40937
40937
  function S(r7) {
@@ -40945,14 +40945,14 @@ function K(r7) {
40945
40945
  return e === "string" && r7 !== "" || e === "object" && ("length" in r7 && r7.length > 0 || Object.keys(r7).length > 0);
40946
40946
  }
40947
40947
  function ee(r7, e, t) {
40948
- return r7 === e || S(r7) && S(e) ? true : S(r7) || S(e) ? false : Array.isArray(r7) && Array.isArray(e) ? wo(r7, e) : Array.isArray(r7) || Array.isArray(e) ? false : R(r7) && R(e) ? Ao(r7, e, t) : (R(r7) || R(e), false);
40948
+ return r7 === e || S(r7) && S(e) ? true : S(r7) || S(e) ? false : Array.isArray(r7) && Array.isArray(e) ? Ao(r7, e) : Array.isArray(r7) || Array.isArray(e) ? false : R(r7) && R(e) ? Oo(r7, e, t) : (R(r7) || R(e), false);
40949
40949
  }
40950
- function wo(r7, e) {
40950
+ function Ao(r7, e) {
40951
40951
  if (r7.length !== e.length) return false;
40952
40952
  for (let t = 0; t < r7.length; t++) if (!ee(r7[t], e[t])) return false;
40953
40953
  return true;
40954
40954
  }
40955
- function Ao(r7, e, t) {
40955
+ function Oo(r7, e, t) {
40956
40956
  let n = /* @__PURE__ */ new Set();
40957
40957
  Object.keys(r7).forEach((i) => n.add(i)), Object.keys(e).forEach((i) => n.add(i)), t === "meta" && (n.delete("versionId"), n.delete("lastUpdated"), n.delete("author"));
40958
40958
  for (let i of n) {
@@ -40965,31 +40965,34 @@ function R(r7) {
40965
40965
  return r7 !== null && typeof r7 == "object";
40966
40966
  }
40967
40967
  function Un(r7) {
40968
- return r7.every(ko);
40968
+ return r7.every(Vo);
40969
40969
  }
40970
- function ko(r7) {
40970
+ function Vo(r7) {
40971
40971
  return typeof r7 == "string";
40972
40972
  }
40973
- function xr(r7) {
40973
+ function vr(r7) {
40974
40974
  return R(r7) && "code" in r7 && typeof r7.code == "string";
40975
40975
  }
40976
40976
  function Tr(r7) {
40977
- return R(r7) && "coding" in r7 && Array.isArray(r7.coding) && r7.coding.every(xr);
40977
+ return R(r7) && "coding" in r7 && Array.isArray(r7.coding) && r7.coding.every(vr);
40978
40978
  }
40979
- function Vo(r7) {
40979
+ function Do(r7) {
40980
40980
  return R(r7) && "text" in r7 && typeof r7.text == "string";
40981
40981
  }
40982
40982
  var Bn = [];
40983
40983
  for (let r7 = 0; r7 < 256; r7++) Bn.push(r7.toString(16).padStart(2, "0"));
40984
40984
  function qn(r7) {
40985
- let e = new Uint8Array(r7), t = new Array(e.length);
40986
- for (let n = 0; n < e.length; n++) t[n] = Bn[e[n]];
40987
- return t.join("");
40985
+ let e = Wn(r7), t = new Uint8Array(e), n = new Array(t.length);
40986
+ for (let i = 0; i < t.length; i++) n[i] = Bn[t[i]];
40987
+ return n.join("");
40988
40988
  }
40989
40989
  function jn(r7) {
40990
- let e = new Uint8Array(r7), t = [];
40991
- for (let n = 0; n < e.length; n++) t[n] = String.fromCharCode(e[n]);
40992
- return window.btoa(t.join(""));
40990
+ let e = Wn(r7), t = new Uint8Array(e), n = new Array(t.length);
40991
+ for (let i = 0; i < t.length; i++) n[i] = String.fromCharCode(t[i]);
40992
+ return window.btoa(n.join(""));
40993
+ }
40994
+ function Wn(r7) {
40995
+ return ArrayBuffer.isView(r7) ? r7.buffer : r7;
40993
40996
  }
40994
40997
  function w(r7) {
40995
40998
  return r7 ? r7.charAt(0).toUpperCase() + r7.substring(1) : "";
@@ -41003,21 +41006,21 @@ function ut(r7) {
41003
41006
  function Cr(r7) {
41004
41007
  return r7.endsWith("/") ? r7 : r7 + "/";
41005
41008
  }
41006
- function Fo(r7) {
41009
+ function Uo(r7) {
41007
41010
  return r7.startsWith("/") ? r7.slice(1) : r7;
41008
41011
  }
41009
41012
  function B(r7, e) {
41010
- return new URL(Fo(e), Cr(r7.toString())).toString();
41013
+ return new URL(Uo(e), Cr(r7.toString())).toString();
41011
41014
  }
41012
- function Hn(r7, e) {
41015
+ function Qn(r7, e) {
41013
41016
  return B(r7, e).toString().replace("http://", "ws://").replace("https://", "wss://");
41014
41017
  }
41015
- function Qn(r7) {
41018
+ function Kn(r7) {
41016
41019
  return typeof r7 == "object" && !Array.isArray(r7) && !(r7 instanceof URLSearchParams) && (r7 = Object.fromEntries(Object.entries(r7).filter((e) => e[1] !== void 0))), new URLSearchParams(r7).toString();
41017
41020
  }
41018
- var Uo = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-_]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-_]*[A-Za-z0-9])$/;
41019
- function rl(r7) {
41020
- return Uo.test(r7);
41021
+ var Bo = /^(([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])$/;
41022
+ function il(r7) {
41023
+ return Bo.test(r7);
41021
41024
  }
41022
41025
  function lt(r7, e) {
41023
41026
  let t = [];
@@ -41030,9 +41033,9 @@ function lt(r7, e) {
41030
41033
  function at(r7) {
41031
41034
  if (!r7) return "";
41032
41035
  let e = me(r7.text);
41033
- return e || (r7.coding ? r7.coding.map((t) => Go(t)).join(", ") : "");
41036
+ return e || (r7.coding ? r7.coding.map((t) => Ho(t)).join(", ") : "");
41034
41037
  }
41035
- function Go(r7, e) {
41038
+ function Ho(r7, e) {
41036
41039
  let t = me(r7?.display);
41037
41040
  if (t) {
41038
41041
  let n = e ? me(r7?.code) : void 0;
@@ -41044,28 +41047,28 @@ function me(r7) {
41044
41047
  return typeof r7 == "string" ? r7 : void 0;
41045
41048
  }
41046
41049
  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" };
41047
- function Yn(r7) {
41050
+ function Zn(r7) {
41048
41051
  let e = L.types[r7];
41049
41052
  return e || (e = { searchParamsDetails: {} }, L.types[r7] = e), e.searchParams || (e.searchParams = { _id: { base: [r7], code: "_id", type: "token", expression: r7 + ".id" }, _lastUpdated: { base: [r7], code: "_lastUpdated", type: "date", expression: r7 + ".meta.lastUpdated" }, _compartment: { base: [r7], code: "_compartment", type: "reference", expression: r7 + ".meta.compartment" }, _profile: { base: [r7], code: "_profile", type: "uri", expression: r7 + ".meta.profile" }, _security: { base: [r7], code: "_security", type: "token", expression: r7 + ".meta.security" }, _source: { base: [r7], code: "_source", type: "uri", expression: r7 + ".meta.source" }, _tag: { base: [r7], code: "_tag", type: "token", expression: r7 + ".meta.tag" } }), e;
41050
41053
  }
41051
41054
  function Ar(r7) {
41052
41055
  for (let e of r7.base ?? []) {
41053
- let t = Yn(e);
41056
+ let t = Zn(e);
41054
41057
  t.searchParams || (t.searchParams = {}), t.searchParams[r7.code] = r7;
41055
41058
  }
41056
41059
  }
41057
41060
  function or(r7) {
41058
41061
  let e = r7.type?.[0]?.code;
41059
- return e === "BackboneElement" || e === "Element" ? zo((r7.base?.path ?? r7.path)?.split(".")) : e;
41062
+ return e === "BackboneElement" || e === "Element" ? Jo((r7.base?.path ?? r7.path)?.split(".")) : e;
41060
41063
  }
41061
- function zo(r7) {
41064
+ function Jo(r7) {
41062
41065
  return r7.length === 1 ? r7[0] : r7.map(w).join("");
41063
41066
  }
41064
41067
  function st(r7, e, t) {
41065
41068
  let n = Le(r7, t);
41066
- if (n) return Xo(n.elements, e);
41069
+ if (n) return es(n.elements, e);
41067
41070
  }
41068
- function Xo(r7, e) {
41071
+ function es(r7, e) {
41069
41072
  let t = r7[e] ?? r7[e + "[x]"];
41070
41073
  if (t) return t;
41071
41074
  for (let n = 0; n < e.length; n++) {
@@ -41199,7 +41202,7 @@ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
41199
41202
  let n = t?.eval(r7, he(r7))[0]?.value ?? "";
41200
41203
  if (typeof n != "string") throw new Error("Separator must be a string.");
41201
41204
  return [{ type: l.string, value: e.map((i) => i.value?.toString() ?? "").join(n) }];
41202
- }, abs: (r7, e) => W(Math.abs, r7, e), ceiling: (r7, e) => W(Math.ceil, r7, e), exp: (r7, e) => W(Math.exp, r7, e), floor: (r7, e) => W(Math.floor, r7, e), ln: (r7, e) => W(Math.log, r7, e), log: (r7, e, t) => W((n, i) => Math.log(n) / Math.log(i), r7, e, t), power: (r7, e, t) => W(Math.pow, r7, e, t), round: (r7, e) => W(Math.round, r7, e), sqrt: (r7, e) => W(Math.sqrt, r7, e), truncate: (r7, e) => W((t) => t | 0, r7, e), children: z, descendants: z, trace: (r7, e, t) => e, now: () => [{ type: l.dateTime, value: (/* @__PURE__ */ new Date()).toISOString() }], timeOfDay: () => [{ type: l.time, value: (/* @__PURE__ */ new Date()).toISOString().substring(11) }], today: () => [{ type: l.date, value: (/* @__PURE__ */ new Date()).toISOString().substring(0, 10) }], between: (r7, e, t, n, i) => {
41205
+ }, abs: (r7, e) => $(Math.abs, r7, e), ceiling: (r7, e) => $(Math.ceil, r7, e), exp: (r7, e) => $(Math.exp, r7, e), floor: (r7, e) => $(Math.floor, r7, e), ln: (r7, e) => $(Math.log, r7, e), log: (r7, e, t) => $((n, i) => Math.log(n) / Math.log(i), r7, e, t), power: (r7, e, t) => $(Math.pow, r7, e, t), round: (r7, e) => $(Math.round, r7, e), sqrt: (r7, e) => $(Math.sqrt, r7, e), truncate: (r7, e) => $((t) => t | 0, r7, e), children: z, descendants: z, trace: (r7, e, t) => e, now: () => [{ type: l.dateTime, value: (/* @__PURE__ */ new Date()).toISOString() }], timeOfDay: () => [{ type: l.time, value: (/* @__PURE__ */ new Date()).toISOString().substring(11) }], today: () => [{ type: l.date, value: (/* @__PURE__ */ new Date()).toISOString().substring(0, 10) }], between: (r7, e, t, n, i) => {
41203
41206
  let o = O.toDateTime(r7, t.eval(r7, e));
41204
41207
  if (o.length === 0) throw new Error("Invalid start date");
41205
41208
  let s = O.toDateTime(r7, n.eval(r7, e));
@@ -41256,7 +41259,7 @@ function F(r7, e, t, ...n) {
41256
41259
  let o = r7(i, ...n.map((s) => s?.eval(e, t)[0]?.value));
41257
41260
  return o === void 0 ? [] : Array.isArray(o) ? o.map(g) : [g(o)];
41258
41261
  }
41259
- function W(r7, e, t, ...n) {
41262
+ function $(r7, e, t, ...n) {
41260
41263
  if (t.length === 0) return [];
41261
41264
  let [{ value: i }] = G(t, 1), o = k(i), s = o ? i.value : i;
41262
41265
  if (typeof s != "number") throw new Error("Math function cannot be called with non-number");
@@ -41409,7 +41412,7 @@ var gt = class extends C {
41409
41412
  return In(n, i);
41410
41413
  }
41411
41414
  };
41412
- var vt = class extends C {
41415
+ var xt = class extends C {
41413
41416
  constructor(e, t) {
41414
41417
  super("!=", e, t);
41415
41418
  }
@@ -41418,7 +41421,7 @@ var vt = class extends C {
41418
41421
  return kn(n, i);
41419
41422
  }
41420
41423
  };
41421
- var xt = class extends C {
41424
+ var vt = class extends C {
41422
41425
  constructor(e, t) {
41423
41426
  super("~", e, t);
41424
41427
  }
@@ -41497,7 +41500,7 @@ var J = class {
41497
41500
  return `${this.name}(${this.args.map((e) => e.toString()).join(", ")})`;
41498
41501
  }
41499
41502
  };
41500
- var ve = class {
41503
+ var xe = class {
41501
41504
  constructor(e, t) {
41502
41505
  this.left = e;
41503
41506
  this.expr = t;
@@ -41516,34 +41519,34 @@ var ve = class {
41516
41519
  };
41517
41520
  var qe = ["!=", "!~", "<=", ">=", "{}", "->"];
41518
41521
  var y = { FunctionCall: 0, Dot: 1, Indexer: 2, UnaryAdd: 3, UnarySubtract: 3, Multiply: 4, Divide: 4, IntegerDivide: 4, Modulo: 4, Add: 5, Subtract: 5, Ampersand: 5, Is: 6, As: 6, Union: 7, GreaterThan: 8, GreaterThanOrEquals: 8, LessThan: 8, LessThanOrEquals: 8, Equals: 9, Equivalent: 9, NotEquals: 9, NotEquivalent: 9, In: 10, Contains: 10, And: 11, Xor: 12, Or: 12, Implies: 13, Arrow: 100, Semicolon: 200 };
41519
- var rs = { parse(r7) {
41522
+ var ns = { parse(r7) {
41520
41523
  let e = r7.consumeAndParse();
41521
41524
  if (!r7.match(")")) throw new Error("Parse error: expected `)` got `" + r7.peek()?.value + "`");
41522
41525
  return e;
41523
41526
  } };
41524
- var ns = { parse(r7, e) {
41527
+ var is = { parse(r7, e) {
41525
41528
  let t = r7.consumeAndParse();
41526
41529
  if (!r7.match("]")) throw new Error("Parse error: expected `]`");
41527
- return new ve(e, t);
41530
+ return new xe(e, t);
41528
41531
  }, precedence: y.Indexer };
41529
- var is = { parse(r7, e) {
41532
+ var os = { parse(r7, e) {
41530
41533
  if (!(e instanceof q)) throw new Error("Unexpected parentheses");
41531
41534
  let t = [];
41532
41535
  for (; !r7.match(")"); ) t.push(r7.consumeAndParse()), r7.match(",");
41533
41536
  return new J(e.name, t);
41534
41537
  }, precedence: y.FunctionCall };
41535
- function os(r7) {
41538
+ function ss(r7) {
41536
41539
  let e = r7.split(" "), t = parseFloat(e[0]), n = e[1];
41537
41540
  return n?.startsWith("'") && n.endsWith("'") ? n = n.substring(1, n.length - 1) : n = "{" + n + "}", { value: t, unit: n };
41538
41541
  }
41539
41542
  function je() {
41540
- return new Je().registerPrefix("String", { parse: (r7, e) => new U({ type: l.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r7, e) => new U({ type: l.dateTime, value: Oe(e.value) }) }).registerPrefix("Quantity", { parse: (r7, e) => new U({ type: l.Quantity, value: os(e.value) }) }).registerPrefix("Number", { parse: (r7, e) => new U({ type: e.value.includes(".") ? l.decimal : l.integer, value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new U({ type: l.boolean, value: true }) }).registerPrefix("false", { parse: () => new U({ type: l.boolean, value: false }) }).registerPrefix("Symbol", { parse: (r7, e) => new q(e.value) }).registerPrefix("{}", { parse: () => new dt() }).registerPrefix("(", rs).registerInfix("[", ns).registerInfix("(", is).prefix("+", y.UnaryAdd, (r7, e) => new ft("+", e, (t) => t)).prefix("-", y.UnarySubtract, (r7, e) => new V("-", e, e, (t, n) => -n)).infixLeft(".", y.Dot, (r7, e, t) => new re(r7, t)).infixLeft("/", y.Divide, (r7, e, t) => new V("/", r7, t, (n, i) => n / i)).infixLeft("*", y.Multiply, (r7, e, t) => new V("*", r7, t, (n, i) => n * i)).infixLeft("+", y.Add, (r7, e, t) => new V("+", r7, t, (n, i) => n + i)).infixLeft("-", y.Subtract, (r7, e, t) => new V("-", r7, t, (n, i) => n - i)).infixLeft("|", y.Union, (r7, e, t) => new Ie(r7, t)).infixLeft("=", y.Equals, (r7, e, t) => new gt(r7, t)).infixLeft("!=", y.NotEquals, (r7, e, t) => new vt(r7, t)).infixLeft("~", y.Equivalent, (r7, e, t) => new xt(r7, t)).infixLeft("!~", y.NotEquivalent, (r7, e, t) => new Tt(r7, t)).infixLeft("<", y.LessThan, (r7, e, t) => new V("<", r7, t, (n, i) => n < i)).infixLeft("<=", y.LessThanOrEquals, (r7, e, t) => new V("<=", r7, t, (n, i) => n <= i)).infixLeft(">", y.GreaterThan, (r7, e, t) => new V(">", r7, t, (n, i) => n > i)).infixLeft(">=", y.GreaterThanOrEquals, (r7, e, t) => new V(">=", r7, t, (n, i) => n >= i)).infixLeft("&", y.Ampersand, (r7, e, t) => new mt(r7, t)).infixLeft("and", y.And, (r7, e, t) => new St(r7, t)).infixLeft("as", y.As, (r7, e, t) => new ye(r7, t)).infixLeft("contains", y.Contains, (r7, e, t) => new ht(r7, t)).infixLeft("div", y.Divide, (r7, e, t) => new V("div", r7, t, (n, i) => n / i | 0)).infixLeft("in", y.In, (r7, e, t) => new yt(r7, t)).infixLeft("is", y.Is, (r7, e, t) => new ge(r7, t)).infixLeft("mod", y.Modulo, (r7, e, t) => new V("mod", r7, t, (n, i) => n % i)).infixLeft("or", y.Or, (r7, e, t) => new Et(r7, t)).infixLeft("xor", y.Xor, (r7, e, t) => new bt(r7, t)).infixLeft("implies", y.Implies, (r7, e, t) => new Rt(r7, t));
41543
+ return new Je().registerPrefix("String", { parse: (r7, e) => new U({ type: l.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r7, e) => new U({ type: l.dateTime, value: Oe(e.value) }) }).registerPrefix("Quantity", { parse: (r7, e) => new U({ type: l.Quantity, value: ss(e.value) }) }).registerPrefix("Number", { parse: (r7, e) => new U({ type: e.value.includes(".") ? l.decimal : l.integer, value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new U({ type: l.boolean, value: true }) }).registerPrefix("false", { parse: () => new U({ type: l.boolean, value: false }) }).registerPrefix("Symbol", { parse: (r7, e) => new q(e.value) }).registerPrefix("{}", { parse: () => new dt() }).registerPrefix("(", ns).registerInfix("[", is).registerInfix("(", os).prefix("+", y.UnaryAdd, (r7, e) => new ft("+", e, (t) => t)).prefix("-", y.UnarySubtract, (r7, e) => new V("-", e, e, (t, n) => -n)).infixLeft(".", y.Dot, (r7, e, t) => new re(r7, t)).infixLeft("/", y.Divide, (r7, e, t) => new V("/", r7, t, (n, i) => n / i)).infixLeft("*", y.Multiply, (r7, e, t) => new V("*", r7, t, (n, i) => n * i)).infixLeft("+", y.Add, (r7, e, t) => new V("+", r7, t, (n, i) => n + i)).infixLeft("-", y.Subtract, (r7, e, t) => new V("-", r7, t, (n, i) => n - i)).infixLeft("|", y.Union, (r7, e, t) => new Ie(r7, t)).infixLeft("=", y.Equals, (r7, e, t) => new gt(r7, t)).infixLeft("!=", y.NotEquals, (r7, e, t) => new xt(r7, t)).infixLeft("~", y.Equivalent, (r7, e, t) => new vt(r7, t)).infixLeft("!~", y.NotEquivalent, (r7, e, t) => new Tt(r7, t)).infixLeft("<", y.LessThan, (r7, e, t) => new V("<", r7, t, (n, i) => n < i)).infixLeft("<=", y.LessThanOrEquals, (r7, e, t) => new V("<=", r7, t, (n, i) => n <= i)).infixLeft(">", y.GreaterThan, (r7, e, t) => new V(">", r7, t, (n, i) => n > i)).infixLeft(">=", y.GreaterThanOrEquals, (r7, e, t) => new V(">=", r7, t, (n, i) => n >= i)).infixLeft("&", y.Ampersand, (r7, e, t) => new mt(r7, t)).infixLeft("and", y.And, (r7, e, t) => new St(r7, t)).infixLeft("as", y.As, (r7, e, t) => new ye(r7, t)).infixLeft("contains", y.Contains, (r7, e, t) => new ht(r7, t)).infixLeft("div", y.Divide, (r7, e, t) => new V("div", r7, t, (n, i) => n / i | 0)).infixLeft("in", y.In, (r7, e, t) => new yt(r7, t)).infixLeft("is", y.Is, (r7, e, t) => new ge(r7, t)).infixLeft("mod", y.Modulo, (r7, e, t) => new V("mod", r7, t, (n, i) => n % i)).infixLeft("or", y.Or, (r7, e, t) => new Et(r7, t)).infixLeft("xor", y.Xor, (r7, e, t) => new bt(r7, t)).infixLeft("implies", y.Implies, (r7, e, t) => new Rt(r7, t));
41541
41544
  }
41542
- var ss = je();
41543
- var ei = ((p2) => (p2.BOOLEAN = "BOOLEAN", p2.NUMBER = "NUMBER", p2.QUANTITY = "QUANTITY", p2.TEXT = "TEXT", p2.REFERENCE = "REFERENCE", p2.CANONICAL = "CANONICAL", p2.DATE = "DATE", p2.DATETIME = "DATETIME", p2.PERIOD = "PERIOD", p2.UUID = "UUID", p2))(ei || {});
41544
- var si = ((T) => (T.EQUALS = "eq", T.NOT_EQUALS = "ne", T.GREATER_THAN = "gt", T.LESS_THAN = "lt", T.GREATER_THAN_OR_EQUALS = "ge", T.LESS_THAN_OR_EQUALS = "le", T.STARTS_AFTER = "sa", T.ENDS_BEFORE = "eb", T.APPROXIMATELY = "ap", T.CONTAINS = "contains", T.EXACT = "exact", T.TEXT = "text", T.NOT = "not", T.ABOVE = "above", T.BELOW = "below", T.IN = "in", T.NOT_IN = "not-in", T.OF_TYPE = "of-type", T.MISSING = "missing", T.PRESENT = "present", T.IDENTIFIER = "identifier", T.ITERATE = "iterate", T))(si || {});
41545
- var _s = ((b2) => (b2.READ = "read", b2.VREAD = "vread", b2.UPDATE = "update", b2.PATCH = "patch", b2.DELETE = "delete", b2.HISTORY = "history", b2.HISTORY_INSTANCE = "history-instance", b2.HISTORY_TYPE = "history-type", b2.HISTORY_SYSTEM = "history-system", b2.CREATE = "create", b2.SEARCH = "search", b2.SEARCH_TYPE = "search-type", b2.SEARCH_SYSTEM = "search-system", b2.SEARCH_COMPARTMENT = "search-compartment", b2.CAPABILITIES = "capabilities", b2.TRANSACTION = "transaction", b2.BATCH = "batch", b2.OPERATION = "operation", b2))(_s || {});
41546
- function li(r7) {
41545
+ var as = je();
41546
+ var ti = ((p2) => (p2.BOOLEAN = "BOOLEAN", p2.NUMBER = "NUMBER", p2.QUANTITY = "QUANTITY", p2.TEXT = "TEXT", p2.REFERENCE = "REFERENCE", p2.CANONICAL = "CANONICAL", p2.DATE = "DATE", p2.DATETIME = "DATETIME", p2.PERIOD = "PERIOD", p2.UUID = "UUID", p2))(ti || {});
41547
+ var ai = ((v) => (v.EQUALS = "eq", v.NOT_EQUALS = "ne", v.GREATER_THAN = "gt", v.LESS_THAN = "lt", v.GREATER_THAN_OR_EQUALS = "ge", v.LESS_THAN_OR_EQUALS = "le", v.STARTS_AFTER = "sa", v.ENDS_BEFORE = "eb", v.APPROXIMATELY = "ap", v.CONTAINS = "contains", v.STARTS_WITH = "sw", v.EXACT = "exact", v.TEXT = "text", v.NOT = "not", v.ABOVE = "above", v.BELOW = "below", v.IN = "in", v.NOT_IN = "not-in", v.OF_TYPE = "of-type", v.MISSING = "missing", v.PRESENT = "present", v.IDENTIFIER = "identifier", v.ITERATE = "iterate", v))(ai || {});
41548
+ var Ns = ((b2) => (b2.READ = "read", b2.VREAD = "vread", b2.UPDATE = "update", b2.PATCH = "patch", b2.DELETE = "delete", b2.HISTORY = "history", b2.HISTORY_INSTANCE = "history-instance", b2.HISTORY_TYPE = "history-type", b2.HISTORY_SYSTEM = "history-system", b2.CREATE = "create", b2.SEARCH = "search", b2.SEARCH_TYPE = "search-type", b2.SEARCH_SYSTEM = "search-system", b2.SEARCH_COMPARTMENT = "search-compartment", b2.CAPABILITIES = "capabilities", b2.TRANSACTION = "transaction", b2.BATCH = "batch", b2.OPERATION = "operation", b2))(Ns || {});
41549
+ function pi(r7) {
41547
41550
  if (typeof window < "u") {
41548
41551
  let e = window.atob(r7), t = Uint8Array.from(e, (n) => n.charCodeAt(0));
41549
41552
  return new window.TextDecoder().decode(t);
@@ -41551,7 +41554,7 @@ function li(r7) {
41551
41554
  if (typeof Buffer < "u") return Buffer.from(r7, "base64").toString("utf-8");
41552
41555
  throw new Error("Unable to decode base64");
41553
41556
  }
41554
- function pi(r7) {
41557
+ function di(r7) {
41555
41558
  if (typeof window < "u") {
41556
41559
  let e = new window.TextEncoder().encode(r7), t = String.fromCharCode.apply(null, e);
41557
41560
  return window.btoa(t);
@@ -41563,10 +41566,10 @@ function _r() {
41563
41566
  let r7 = new Uint32Array(28);
41564
41567
  return crypto.getRandomValues(r7), qn(r7.buffer);
41565
41568
  }
41566
- async function di(r7) {
41569
+ async function fi(r7) {
41567
41570
  return crypto.subtle.digest("SHA-256", new TextEncoder().encode(r7));
41568
41571
  }
41569
- function xe() {
41572
+ function ve() {
41570
41573
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (r7) => {
41571
41574
  let e = Math.random() * 16 | 0;
41572
41575
  return (r7 === "x" ? e : e & 3 | 8).toString(16);
@@ -41640,57 +41643,57 @@ var H = class {
41640
41643
  }
41641
41644
  };
41642
41645
  var Lr = { "Patient-open": "Patient-open", "Patient-close": "Patient-close", "ImagingStudy-open": "ImagingStudy-open", "ImagingStudy-close": "ImagingStudy-close", "Encounter-open": "Encounter-open", "Encounter-close": "Encounter-close", "DiagnosticReport-open": "DiagnosticReport-open", "DiagnosticReport-close": "DiagnosticReport-close", "DiagnosticReport-select": "DiagnosticReport-select", "DiagnosticReport-update": "DiagnosticReport-update", syncerror: "syncerror" };
41643
- var Ws = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
41646
+ var Gs = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
41644
41647
  var Fr = ["DiagnosticReport-update"];
41645
- function hi(r7) {
41648
+ function yi(r7) {
41646
41649
  return Fr.includes(r7);
41647
41650
  }
41648
- function yi(r7) {
41651
+ function gi(r7) {
41649
41652
  if (Fr.includes(r7)) throw new d(h(`'context.version' is required for '${r7}'.`));
41650
41653
  }
41651
- var Gs = { "Patient-open": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "Patient-close": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "ImagingStudy-open": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "ImagingStudy-close": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "Encounter-open": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "Encounter-close": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "DiagnosticReport-open": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-close": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-select": { report: { resourceType: "DiagnosticReport" }, select: { resourceType: "*", isArray: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport" }, patient: { resourceType: "Patient", optional: true }, study: { resourceType: "ImagingStudy", optional: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
41652
- function Hs(r7) {
41653
- return Ws.includes(r7);
41654
+ var Hs = { "Patient-open": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "Patient-close": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "ImagingStudy-open": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "ImagingStudy-close": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "Encounter-open": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "Encounter-close": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "DiagnosticReport-open": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-close": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-select": { report: { resourceType: "DiagnosticReport" }, select: { resourceType: "*", isArray: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport" }, patient: { resourceType: "Patient", optional: true }, study: { resourceType: "ImagingStudy", optional: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
41655
+ function Qs(r7) {
41656
+ return Gs.includes(r7);
41654
41657
  }
41655
- function gi(r7) {
41658
+ function xi(r7) {
41656
41659
  return !!r7.endpoint;
41657
41660
  }
41658
41661
  function Ur(r7) {
41659
41662
  if (!It(r7)) throw new d(h("subscriptionRequest must be an object conforming to SubscriptionRequest type."));
41660
41663
  let { channelType: e, mode: t, topic: n, events: i } = r7, o = { "hub.channel.type": e, "hub.mode": t, "hub.topic": n, "hub.events": i.join(",") };
41661
- return gi(r7) && (o.endpoint = r7.endpoint), new URLSearchParams(o).toString();
41664
+ return xi(r7) && (o.endpoint = r7.endpoint), new URLSearchParams(o).toString();
41662
41665
  }
41663
41666
  function It(r7) {
41664
41667
  if (typeof r7 != "object") return false;
41665
41668
  let { channelType: e, mode: t, topic: n, events: i } = r7;
41666
41669
  if (!(e && t && n && i) || typeof n != "string" || typeof i != "object" || !Array.isArray(i) || i.length < 1 || e !== "websocket" || t !== "subscribe" && t !== "unsubscribe") return false;
41667
41670
  for (let o of i) if (!Lr[o]) return false;
41668
- return !(gi(r7) && !(typeof r7.endpoint == "string" && r7.endpoint.startsWith("ws")));
41671
+ return !(xi(r7) && !(typeof r7.endpoint == "string" && r7.endpoint.startsWith("ws")));
41669
41672
  }
41670
- function mi(r7, e, t, n) {
41673
+ function hi(r7, e, t, n) {
41671
41674
  if (typeof e != "object") throw new d(h(`context[${t}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));
41672
41675
  if (!(e.id && typeof e.id == "string")) throw new d(h(`context[${t}] is invalid. Resource must contain a valid string ID.`));
41673
41676
  if (!e.resourceType) throw new d(h(`context[${t}] is invalid. Resource must contain a resource type. No resource type found.`));
41674
41677
  let i = n.resourceType;
41675
41678
  if (i !== "*") {
41676
- if (!Hs(e.resourceType)) throw new d(h(`context[${t}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));
41679
+ if (!Qs(e.resourceType)) throw new d(h(`context[${t}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));
41677
41680
  if (i && e.resourceType !== i) throw new d(h(`context[${t}] is invalid. context[${t}] for the '${r7}' event should contain resource of type ${i}.`));
41678
41681
  }
41679
41682
  }
41680
- function Qs(r7, e, t, n, i) {
41681
- if (i.set(e.key, (i.get(e.key) ?? 0) + 1), !n.isArray) mi(r7, e.resource, t, n);
41683
+ function Ks(r7, e, t, n, i) {
41684
+ if (i.set(e.key, (i.get(e.key) ?? 0) + 1), !n.isArray) hi(r7, e.resource, t, n);
41682
41685
  else {
41683
41686
  let { resources: o } = e;
41684
41687
  if (!o) throw new d(h(`context[${t}] is invalid. context[${t}] for the '${r7}' with key '${String(e.key)}' should contain an array of resources on the key 'resources'.`));
41685
- for (let s of o) mi(r7, s, t, n);
41688
+ for (let s of o) hi(r7, s, t, n);
41686
41689
  }
41687
41690
  }
41688
- function Ks(r7, e) {
41689
- let t = /* @__PURE__ */ new Map(), n = Gs[r7];
41691
+ function zs(r7, e) {
41692
+ let t = /* @__PURE__ */ new Map(), n = Hs[r7];
41690
41693
  for (let i = 0; i < e.length; i++) {
41691
41694
  let o = e[i].key;
41692
41695
  if (!n[o]) throw new d(h(`Key '${o}' not found for event '${r7}'. Make sure to add only valid keys.`));
41693
- Qs(r7, e[i], i, n[o], t);
41696
+ Ks(r7, e[i], i, n[o], t);
41694
41697
  }
41695
41698
  for (let [i, o] of Object.entries(n)) {
41696
41699
  if (!(o.optional || t.has(i))) throw new d(h(`Missing required key '${i}' on context for '${r7}' event.`));
@@ -41703,7 +41706,7 @@ function Br(r7, e, t, n) {
41703
41706
  if (typeof t != "object") throw new d(h("context must be a context object or array of context objects."));
41704
41707
  if (Fr.includes(e) && !n) throw new d(h(`The '${e}' event must contain a 'context.versionId'.`));
41705
41708
  let i = Array.isArray(t) ? t : [t];
41706
- return Ks(e, i), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: xe(), event: { "hub.topic": r7, "hub.event": e, context: i, ...n ? { "context.versionId": n } : {} } };
41709
+ return zs(e, i), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: ve(), event: { "hub.topic": r7, "hub.event": e, context: i, ...n ? { "context.versionId": n } : {} } };
41707
41710
  }
41708
41711
  var Ot = class extends H {
41709
41712
  constructor(e) {
@@ -41725,8 +41728,8 @@ var Ot = class extends H {
41725
41728
  this.websocket.close();
41726
41729
  }
41727
41730
  };
41728
- function zs(r7) {
41729
- let e = r7.replace(/-/g, "+").replace(/_/g, "/"), t = li(e), n = Array.from(t).reduce((o, s) => {
41731
+ function Js(r7) {
41732
+ let e = r7.replace(/-/g, "+").replace(/_/g, "/"), t = pi(e), n = Array.from(t).reduce((o, s) => {
41730
41733
  let a2 = ("00" + s.charCodeAt(0).toString(16)).slice(-2);
41731
41734
  return `${o}%${a2}`;
41732
41735
  }, ""), i = decodeURIComponent(n);
@@ -41737,16 +41740,16 @@ function vi(r7) {
41737
41740
  }
41738
41741
  function kt(r7) {
41739
41742
  let [e, t, n] = r7.split(".");
41740
- return zs(t);
41743
+ return Js(t);
41741
41744
  }
41742
- function xi(r7) {
41745
+ function Ti(r7) {
41743
41746
  try {
41744
41747
  return typeof kt(r7).login_id == "string";
41745
41748
  } catch {
41746
41749
  return false;
41747
41750
  }
41748
41751
  }
41749
- function Ti(r7) {
41752
+ function Si(r7) {
41750
41753
  try {
41751
41754
  let t = kt(r7).exp;
41752
41755
  return typeof t == "number" ? t * 1e3 : void 0;
@@ -41768,11 +41771,11 @@ var Vt = class {
41768
41771
  await this.medplum.delete(`keyvalue/v1/${e}`);
41769
41772
  }
41770
41773
  };
41771
- var Si;
41772
- Si = Symbol.toStringTag;
41774
+ var Ei;
41775
+ Ei = Symbol.toStringTag;
41773
41776
  var M = class {
41774
41777
  constructor(e) {
41775
- this[Si] = "ReadablePromise";
41778
+ this[Ei] = "ReadablePromise";
41776
41779
  this.status = "pending";
41777
41780
  this.suspender = e.then((t) => (this.status = "success", this.response = t, t), (t) => {
41778
41781
  throw this.status = "error", this.error = t, t;
@@ -41804,7 +41807,7 @@ var M = class {
41804
41807
  return this.suspender.finally(e);
41805
41808
  }
41806
41809
  };
41807
- var We = class {
41810
+ var $e = class {
41808
41811
  constructor(e) {
41809
41812
  this.storage = e ?? (typeof localStorage < "u" ? localStorage : new qr());
41810
41813
  }
@@ -41849,8 +41852,8 @@ var qr = class {
41849
41852
  }
41850
41853
  };
41851
41854
  var Ve = { Event: typeof globalThis.Event < "u" ? globalThis.Event : void 0, ErrorEvent: void 0, CloseEvent: void 0 };
41852
- var bi = false;
41853
- function Js() {
41855
+ var Ri = false;
41856
+ function Ys() {
41854
41857
  if (typeof globalThis.Event > "u") throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");
41855
41858
  Ve.Event = globalThis.Event, Ve.ErrorEvent = class extends Event {
41856
41859
  constructor(e, t) {
@@ -41864,17 +41867,17 @@ function Js() {
41864
41867
  }
41865
41868
  };
41866
41869
  }
41867
- function Ys(r7, e) {
41870
+ function Zs(r7, e) {
41868
41871
  if (!r7) throw new Error(e);
41869
41872
  }
41870
41873
  function Dt(r7) {
41871
41874
  return new r7.constructor(r7.type, r7);
41872
41875
  }
41873
41876
  var Te = { maxReconnectionDelay: 1e4, minReconnectionDelay: 1e3 + Math.random() * 4e3, minUptime: 5e3, reconnectionDelayGrowFactor: 1.3, connectionTimeout: 4e3, maxRetries: 1 / 0, maxEnqueuedMessages: 1 / 0, startClosed: false, debug: false };
41874
- var Ri = false;
41877
+ var Ci = false;
41875
41878
  var Mt = class r extends H {
41876
41879
  constructor(t, n, i = {}) {
41877
- bi || (Js(), bi = true);
41880
+ Ri || (Ys(), Ri = true);
41878
41881
  super();
41879
41882
  this._retryCount = -1;
41880
41883
  this._shouldReconnect = true;
@@ -41889,7 +41892,7 @@ var Mt = class r extends H {
41889
41892
  this._handleOpen = (t2) => {
41890
41893
  this._debug("open event");
41891
41894
  let { minUptime: n2 = Te.minUptime } = this._options;
41892
- clearTimeout(this._connectTimeout), this._uptimeTimeout = setTimeout(() => this._acceptOpen(), n2), Ys(this._ws, "WebSocket is not defined"), this._ws.binaryType = this._binaryType, this._messageQueue.forEach((i2) => this._ws?.send(i2)), this._messageQueue = [], this.onopen && this.onopen(t2), this.dispatchEvent(Dt(t2));
41895
+ clearTimeout(this._connectTimeout), this._uptimeTimeout = setTimeout(() => this._acceptOpen(), n2), Zs(this._ws, "WebSocket is not defined"), this._ws.binaryType = this._binaryType, this._messageQueue.forEach((i2) => this._ws?.send(i2)), this._messageQueue = [], this.onopen && this.onopen(t2), this.dispatchEvent(Dt(t2));
41893
41896
  };
41894
41897
  this._handleMessage = (t2) => {
41895
41898
  this._debug("message event"), this.onmessage && this.onmessage(t2), this.dispatchEvent(Dt(t2));
@@ -41999,7 +42002,7 @@ var Mt = class r extends H {
41999
42002
  this._connectLock = false;
42000
42003
  return;
42001
42004
  }
42002
- !this._options.WebSocket && typeof WebSocket > "u" && !Ri && (console.error("\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket."), Ri = true);
42005
+ !this._options.WebSocket && typeof WebSocket > "u" && !Ci && (console.error("\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket."), Ci = true);
42003
42006
  let i = this._options.WebSocket || WebSocket;
42004
42007
  this._debug("connect", { url: this._url, protocols: this._protocols }), this._ws = this._protocols ? new i(this._url, this._protocols) : new i(this._url), this._ws.binaryType = this._binaryType, this._connectLock = false, this._addListeners(), this._connectTimeout = setTimeout(() => this._handleTimeout(), n);
42005
42008
  }).catch((i) => {
@@ -42031,7 +42034,7 @@ var Mt = class r extends H {
42031
42034
  clearTimeout(this._connectTimeout), clearTimeout(this._uptimeTimeout);
42032
42035
  }
42033
42036
  };
42034
- var Zs = 5e3;
42037
+ var Xs = 5e3;
42035
42038
  var Ge = class extends H {
42036
42039
  constructor(...e) {
42037
42040
  super(), this.criteria = new Set(e);
@@ -42067,7 +42070,7 @@ var _t = class {
42067
42070
  throw new d(h("Not a valid URL"));
42068
42071
  }
42069
42072
  let o = n?.ReconnectingWebSocket ? new n.ReconnectingWebSocket(i, void 0, { debug: n?.debug, debugLogger: n?.debugLogger }) : new Mt(i, void 0, { debug: n?.debug, debugLogger: n?.debugLogger });
42070
- this.medplum = e, this.ws = o, this.masterSubEmitter = new Ge(), this.criteriaEntries = /* @__PURE__ */ new Map(), this.criteriaEntriesBySubscriptionId = /* @__PURE__ */ new Map(), this.wsClosed = false, this.pingIntervalMs = n?.pingIntervalMs ?? Zs, this.currentProfile = e.getProfile(), this.setupListeners();
42073
+ this.medplum = e, this.ws = o, this.masterSubEmitter = new Ge(), this.criteriaEntries = /* @__PURE__ */ new Map(), this.criteriaEntriesBySubscriptionId = /* @__PURE__ */ new Map(), this.wsClosed = false, this.pingIntervalMs = n?.pingIntervalMs ?? Xs, this.currentProfile = e.getProfile(), this.setupListeners();
42071
42074
  }
42072
42075
  setupListeners() {
42073
42076
  let e = this.ws;
@@ -42225,25 +42228,25 @@ var _t = class {
42225
42228
  return this.masterSubEmitter || (this.masterSubEmitter = new Ge(...Array.from(this.criteriaEntries.keys()))), this.masterSubEmitter;
42226
42229
  }
42227
42230
  };
42228
- var Xd = "3.2.23-b7a535d09";
42229
- var ta = D.FHIR_JSON + ", */*; q=0.1";
42230
- var ra = "https://api.medplum.com/";
42231
- var na = 1e3;
42232
- var ia = 6e4;
42233
- var oa = 0;
42234
- var sa = 3e5;
42235
- var aa = "Binary/";
42236
- var Ci = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
42237
- var ca = ((o) => (o.ClientCredentials = "client_credentials", o.AuthorizationCode = "authorization_code", o.RefreshToken = "refresh_token", o.JwtBearer = "urn:ietf:params:oauth:grant-type:jwt-bearer", o.TokenExchange = "urn:ietf:params:oauth:grant-type:token-exchange", o))(ca || {});
42238
- var ua = ((o) => (o.AccessToken = "urn:ietf:params:oauth:token-type:access_token", o.RefreshToken = "urn:ietf:params:oauth:token-type:refresh_token", o.IdToken = "urn:ietf:params:oauth:token-type:id_token", o.Saml1Token = "urn:ietf:params:oauth:token-type:saml1", o.Saml2Token = "urn:ietf:params:oauth:token-type:saml2", o))(ua || {});
42239
- var la = ((o) => (o.ClientSecretBasic = "client_secret_basic", o.ClientSecretPost = "client_secret_post", o.ClientSecretJwt = "client_secret_jwt", o.PrivateKeyJwt = "private_key_jwt", o.None = "none", o))(la || {});
42240
- var pa = ((e) => (e.JwtBearer = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", e))(pa || {});
42231
+ var tf = "3.2.25-41ee56551";
42232
+ var ra = D.FHIR_JSON + ", */*; q=0.1";
42233
+ var na = "https://api.medplum.com/";
42234
+ var ia = 1e3;
42235
+ var oa = 6e4;
42236
+ var sa = 0;
42237
+ var aa = 3e5;
42238
+ var ca = "Binary/";
42239
+ var Pi = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
42240
+ var ua = ((o) => (o.ClientCredentials = "client_credentials", o.AuthorizationCode = "authorization_code", o.RefreshToken = "refresh_token", o.JwtBearer = "urn:ietf:params:oauth:grant-type:jwt-bearer", o.TokenExchange = "urn:ietf:params:oauth:grant-type:token-exchange", o))(ua || {});
42241
+ var la = ((o) => (o.AccessToken = "urn:ietf:params:oauth:token-type:access_token", o.RefreshToken = "urn:ietf:params:oauth:token-type:refresh_token", o.IdToken = "urn:ietf:params:oauth:token-type:id_token", o.Saml1Token = "urn:ietf:params:oauth:token-type:saml1", o.Saml2Token = "urn:ietf:params:oauth:token-type:saml2", o))(la || {});
42242
+ var pa = ((o) => (o.ClientSecretBasic = "client_secret_basic", o.ClientSecretPost = "client_secret_post", o.ClientSecretJwt = "client_secret_jwt", o.PrivateKeyJwt = "private_key_jwt", o.None = "none", o))(pa || {});
42243
+ var da = ((e) => (e.JwtBearer = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", e))(da || {});
42241
42244
  var Nt = class extends H {
42242
42245
  constructor(t) {
42243
42246
  super();
42244
42247
  this.initComplete = true;
42245
42248
  if (t?.baseUrl && !t.baseUrl.startsWith("http")) throw new Error("Base URL must start with http or https");
42246
- this.options = t ?? {}, this.fetch = t?.fetch ?? da(), this.storage = t?.storage ?? new We(), this.createPdfImpl = t?.createPdf, this.baseUrl = Cr(t?.baseUrl ?? ra), this.fhirBaseUrl = B(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4"), this.authorizeUrl = B(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = B(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = B(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.fhircastHubUrl = B(this.baseUrl, t?.fhircastHubUrl ?? "fhircast/STU3"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.onUnauthenticated = t?.onUnauthenticated, this.refreshGracePeriod = t?.refreshGracePeriod ?? sa, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? oa : ia), this.cacheTime > 0 ? this.requestCache = new At(t?.resourceCacheSize ?? na) : this.requestCache = void 0, t?.autoBatchTime ? (this.autoBatchTime = t.autoBatchTime, this.autoBatchQueue = []) : (this.autoBatchTime = 0, this.autoBatchQueue = void 0), t?.accessToken && this.setAccessToken(t.accessToken), this.storage.getInitPromise === void 0 ? (t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initPromise = Promise.resolve(), this.dispatchEvent({ type: "storageInitialized" })) : (this.initComplete = false, this.initPromise = this.storage.getInitPromise(), this.initPromise.then(() => {
42249
+ this.options = t ?? {}, this.fetch = t?.fetch ?? fa(), this.storage = t?.storage ?? new $e(), this.createPdfImpl = t?.createPdf, this.baseUrl = Cr(t?.baseUrl ?? na), this.fhirBaseUrl = B(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4"), this.authorizeUrl = B(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = B(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = B(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.fhircastHubUrl = B(this.baseUrl, t?.fhircastHubUrl ?? "fhircast/STU3"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.defaultHeaders = t?.defaultHeaders ?? {}, this.onUnauthenticated = t?.onUnauthenticated, this.refreshGracePeriod = t?.refreshGracePeriod ?? aa, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? sa : oa), this.cacheTime > 0 ? this.requestCache = new At(t?.resourceCacheSize ?? ia) : 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(() => {
42247
42250
  t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initComplete = true, this.dispatchEvent({ type: "storageInitialized" });
42248
42251
  }).catch((n) => {
42249
42252
  console.error(n), this.initComplete = true, this.dispatchEvent({ type: "storageInitFailed", payload: { error: n } });
@@ -42274,6 +42277,9 @@ var Nt = class extends H {
42274
42277
  getFhircastHubUrl() {
42275
42278
  return this.fhircastHubUrl;
42276
42279
  }
42280
+ getDefaultHeaders() {
42281
+ return this.defaultHeaders;
42282
+ }
42277
42283
  clear() {
42278
42284
  this.storage.clear(), typeof window < "u" && sessionStorage.clear(), this.clearActiveLogin();
42279
42285
  }
@@ -42370,7 +42376,7 @@ var Nt = class extends H {
42370
42376
  }
42371
42377
  fhirSearchUrl(t, n) {
42372
42378
  let i = this.fhirUrl(t);
42373
- return n && (i.search = Qn(n)), i;
42379
+ return n && (i.search = Kn(n)), i;
42374
42380
  }
42375
42381
  search(t, n, i) {
42376
42382
  let o = this.fhirSearchUrl(t, n), s = "search-" + o.toString(), a2 = this.getCacheEntry(s, i);
@@ -42393,7 +42399,7 @@ var Nt = class extends H {
42393
42399
  searchResources(t, n, i) {
42394
42400
  let s = "searchResources-" + this.fhirSearchUrl(t, n).toString(), a2 = this.getCacheEntry(s, i);
42395
42401
  if (a2) return a2.value;
42396
- let c = new M(this.search(t, n, i).then(Ai));
42402
+ let c = new M(this.search(t, n, i).then(Oi));
42397
42403
  return this.setCacheEntry(s, c), c;
42398
42404
  }
42399
42405
  async *searchResourcePages(t, n, i) {
@@ -42401,7 +42407,7 @@ var Nt = class extends H {
42401
42407
  for (; o; ) {
42402
42408
  let s = new URL(o).searchParams, a2 = await this.search(t, s, i), c = a2.link?.find((u2) => u2.relation === "next");
42403
42409
  if (!a2.entry?.length && !c) break;
42404
- yield Ai(a2), o = c?.url ? new URL(c.url) : void 0;
42410
+ yield Oi(a2), o = c?.url ? new URL(c.url) : void 0;
42405
42411
  }
42406
42412
  }
42407
42413
  searchValueSet(t, n, i) {
@@ -42418,7 +42424,7 @@ var Nt = class extends H {
42418
42424
  getCachedReference(t) {
42419
42425
  let n = t.reference;
42420
42426
  if (!n) return;
42421
- if (n === "system") return Ci;
42427
+ if (n === "system") return Pi;
42422
42428
  let [i, o] = n.split("/");
42423
42429
  if (!(!i || !o)) return this.getCached(i, o);
42424
42430
  }
@@ -42429,12 +42435,12 @@ var Nt = class extends H {
42429
42435
  readReference(t, n) {
42430
42436
  let i = t.reference;
42431
42437
  if (!i) return new M(Promise.reject(new Error("Missing reference")));
42432
- if (i === "system") return new M(Promise.resolve(Ci));
42438
+ if (i === "system") return new M(Promise.resolve(Pi));
42433
42439
  let [o, s] = i.split("/");
42434
42440
  return !o || !s ? new M(Promise.reject(new Error("Invalid reference"))) : this.readResource(o, s, n);
42435
42441
  }
42436
42442
  requestSchema(t) {
42437
- if (xn(t)) return Promise.resolve();
42443
+ if (vn(t)) return Promise.resolve();
42438
42444
  let n = t + "-requestSchema", i = this.getCacheEntry(n, void 0);
42439
42445
  if (i) return i.value;
42440
42446
  let o = new M((async () => {
@@ -42479,7 +42485,7 @@ var Nt = class extends H {
42479
42485
  target
42480
42486
  }
42481
42487
  }`.replace(/\s+/g, " "), a2 = await this.graphql(s);
42482
- cr(a2.data.StructureDefinitionList);
42488
+ cr(a2.data.StructureDefinitionList.filter((c) => c.name === t));
42483
42489
  for (let c of a2.data.SearchParameterList) Ar(c);
42484
42490
  })());
42485
42491
  return this.setCacheEntry(n, o), o;
@@ -42529,32 +42535,32 @@ var Nt = class extends H {
42529
42535
  return s || (s = t), this.cacheResource(s), this.invalidateUrl(this.fhirUrl(t.resourceType, t.id, "_history")), this.invalidateSearches(t.resourceType), s;
42530
42536
  }
42531
42537
  async createAttachment(t, n, i, o, s) {
42532
- let a2 = Oi(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), u2 = await this.createBinary(a2, c);
42538
+ let a2 = Ii(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), u2 = await this.createBinary(a2, c);
42533
42539
  return { contentType: a2.contentType, url: u2.url, title: a2.filename };
42534
42540
  }
42535
42541
  createBinary(t, n, i, o, s) {
42536
- let a2 = Oi(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: p2, filename: m2, securityContext: v, onProgress: Q } = a2, _e = this.fhirUrl("Binary");
42537
- return m2 && _e.searchParams.set("_filename", m2), v?.reference && this.setRequestHeader(c, "X-Security-Context", v.reference), Q ? this.uploadwithProgress(_e, u2, p2, Q, c) : this.post(_e, u2, p2, c);
42542
+ let a2 = Ii(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: p2, filename: m2, securityContext: x2, onProgress: Q } = a2, _e = this.fhirUrl("Binary");
42543
+ return m2 && _e.searchParams.set("_filename", m2), x2?.reference && this.setRequestHeader(c, "X-Security-Context", x2.reference), Q ? this.uploadwithProgress(_e, u2, p2, Q, c) : this.post(_e, u2, p2, c);
42538
42544
  }
42539
42545
  uploadwithProgress(t, n, i, o, s) {
42540
42546
  return new Promise((a2, c) => {
42541
42547
  let u2 = new XMLHttpRequest(), p2 = () => u2.abort();
42542
42548
  s?.signal?.addEventListener("abort", p2);
42543
- let m2 = (v) => {
42544
- s?.signal?.removeEventListener("abort", p2), v instanceof Error ? c(v) : a2(v);
42549
+ let m2 = (x2) => {
42550
+ s?.signal?.removeEventListener("abort", p2), x2 instanceof Error ? c(x2) : a2(x2);
42545
42551
  };
42546
- if (u2.responseType = "json", u2.onabort = () => m2(new DOMException("Request aborted", "AbortError")), u2.onerror = () => m2(new Error("Request error")), o && (u2.upload.onprogress = (v) => o(v), u2.upload.onload = (v) => o(v)), u2.onload = () => {
42552
+ if (u2.responseType = "json", u2.onabort = () => m2(new DOMException("Request aborted", "AbortError")), u2.onerror = () => m2(new Error("Request error")), o && (u2.upload.onprogress = (x2) => o(x2), u2.upload.onload = (x2) => o(x2)), u2.onload = () => {
42547
42553
  u2.status >= 200 && u2.status < 300 ? m2(u2.response) : m2(new d(Xe(u2.response || u2.statusText)));
42548
42554
  }, u2.open("POST", t), u2.withCredentials = true, u2.setRequestHeader("Authorization", "Bearer " + this.accessToken), u2.setRequestHeader("Cache-Control", "no-cache, no-store, max-age=0"), u2.setRequestHeader("Content-Type", i), this.options.extendedMode !== false && u2.setRequestHeader("X-Medplum", "extended"), s?.headers) {
42549
- let v = s.headers;
42550
- for (let [Q, _e] of Object.entries(v)) u2.setRequestHeader(Q, _e);
42555
+ let x2 = s.headers;
42556
+ for (let [Q, _e] of Object.entries(x2)) u2.setRequestHeader(Q, _e);
42551
42557
  }
42552
42558
  u2.send(n);
42553
42559
  });
42554
42560
  }
42555
42561
  async createPdf(t, n, i, o) {
42556
42562
  if (!this.createPdfImpl) throw new Error("PDF creation not enabled");
42557
- let s = ha(t, n, i, o), a2 = typeof n == "object" ? n : {}, { docDefinition: c, tableLayouts: u2, fonts: p2, ...m2 } = s, v = await this.createPdfImpl(c, u2, p2), Q = { ...m2, data: v, contentType: "application/pdf" };
42563
+ let s = ya(t, n, i, o), a2 = typeof n == "object" ? n : {}, { docDefinition: c, tableLayouts: u2, fonts: p2, ...m2 } = s, x2 = await this.createPdfImpl(c, u2, p2), Q = { ...m2, data: x2, contentType: "application/pdf" };
42558
42564
  return this.createBinary(Q, a2);
42559
42565
  }
42560
42566
  createComment(t, n, i) {
@@ -42613,7 +42619,7 @@ var Nt = class extends H {
42613
42619
  return this.accessToken;
42614
42620
  }
42615
42621
  setAccessToken(t, n) {
42616
- this.accessToken = t, this.refreshToken = n, this.accessTokenExpires = Ti(t), this.medplumServer = xi(t);
42622
+ this.accessToken = t, this.refreshToken = n, this.accessTokenExpires = Si(t), this.medplumServer = Ti(t);
42617
42623
  }
42618
42624
  getLogins() {
42619
42625
  return this.storage.getObject("logins") ?? [];
@@ -42661,7 +42667,7 @@ var Nt = class extends H {
42661
42667
  async download(t, n = {}) {
42662
42668
  this.refreshPromise && await this.refreshPromise;
42663
42669
  let i = t.toString();
42664
- i.startsWith(aa) && (t = this.fhirUrl(i));
42670
+ i.startsWith(ca) && (t = this.fhirUrl(i));
42665
42671
  let o = n.headers;
42666
42672
  return o || (o = {}, n.headers = o), o.Accept || (o.Accept = "*/*"), this.addFetchOptionsDefaults(n), (await this.fetchWithRetry(t.toString(), n)).blob();
42667
42673
  }
@@ -42709,11 +42715,11 @@ var Nt = class extends H {
42709
42715
  if (s.status === 404 && !c) throw new d(on);
42710
42716
  let u2 = await this.parseBody(s, c);
42711
42717
  if (s.status === 200 && i.followRedirectOnOk || s.status === 201 && i.followRedirectOnCreated) {
42712
- let p2 = await wi(s, u2);
42718
+ let p2 = await Ai(s, u2);
42713
42719
  if (p2) return this.request("GET", p2, { ...i, body: void 0 });
42714
42720
  }
42715
42721
  if (s.status === 202 && i.pollStatusOnAccepted) {
42716
- let m2 = await wi(s, u2) ?? o.statusUrl;
42722
+ let m2 = await Ai(s, u2) ?? o.statusUrl;
42717
42723
  if (m2) return this.pollStatus(m2, i, o);
42718
42724
  }
42719
42725
  if (s.status >= 400) throw new d(Xe(u2));
@@ -42781,7 +42787,9 @@ var Nt = class extends H {
42781
42787
  }
42782
42788
  }
42783
42789
  addFetchOptionsDefaults(t) {
42784
- this.setRequestHeader(t, "Accept", ta, true), this.options.extendedMode !== false && this.setRequestHeader(t, "X-Medplum", "extended"), t.body && this.setRequestHeader(t, "Content-Type", D.FHIR_JSON, true), this.accessToken ? this.setRequestHeader(t, "Authorization", "Bearer " + this.accessToken) : this.basicAuth && this.setRequestHeader(t, "Authorization", "Basic " + this.basicAuth), t.cache || (t.cache = "no-cache"), t.credentials || (t.credentials = "include");
42790
+ Object.entries(this.defaultHeaders).forEach(([n, i]) => {
42791
+ this.setRequestHeader(t, n, i);
42792
+ }), this.setRequestHeader(t, "Accept", ra, true), this.options.extendedMode !== false && this.setRequestHeader(t, "X-Medplum", "extended"), t.body && this.setRequestHeader(t, "Content-Type", D.FHIR_JSON, true), this.accessToken ? this.setRequestHeader(t, "Authorization", "Bearer " + this.accessToken) : this.basicAuth && this.setRequestHeader(t, "Authorization", "Basic " + this.basicAuth), t.cache || (t.cache = "no-cache"), t.credentials || (t.credentials = "include");
42785
42793
  }
42786
42794
  setRequestContentType(t, n) {
42787
42795
  this.setRequestHeader(t, "Content-Type", n);
@@ -42802,16 +42810,16 @@ var Nt = class extends H {
42802
42810
  sessionStorage.setItem("pkceState", t);
42803
42811
  let n = _r().slice(0, 128);
42804
42812
  sessionStorage.setItem("codeVerifier", n);
42805
- let i = await di(n), o = jn(i).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
42813
+ let i = await fi(n), o = jn(i).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
42806
42814
  return sessionStorage.setItem("codeChallenge", o), { codeChallengeMethod: "S256", codeChallenge: o };
42807
42815
  }
42808
42816
  async requestAuthorization(t) {
42809
42817
  let n = await this.ensureCodeChallenge(t ?? {}), i = new URL(this.authorizeUrl);
42810
- i.searchParams.set("response_type", "code"), i.searchParams.set("state", sessionStorage.getItem("pkceState")), i.searchParams.set("client_id", n.clientId ?? this.clientId), i.searchParams.set("redirect_uri", n.redirectUri ?? Pi()), i.searchParams.set("code_challenge_method", n.codeChallengeMethod), i.searchParams.set("code_challenge", n.codeChallenge), i.searchParams.set("scope", n.scope ?? "openid profile"), window.location.assign(i.toString());
42818
+ i.searchParams.set("response_type", "code"), i.searchParams.set("state", sessionStorage.getItem("pkceState")), i.searchParams.set("client_id", n.clientId ?? this.clientId), i.searchParams.set("redirect_uri", n.redirectUri ?? wi()), i.searchParams.set("code_challenge_method", n.codeChallengeMethod), i.searchParams.set("code_challenge", n.codeChallenge), i.searchParams.set("scope", n.scope ?? "openid profile"), window.location.assign(i.toString());
42811
42819
  }
42812
42820
  processCode(t, n) {
42813
42821
  let i = new URLSearchParams();
42814
- if (i.set("grant_type", "authorization_code"), i.set("code", t), i.set("client_id", n?.clientId ?? this.clientId), i.set("redirect_uri", n?.redirectUri ?? Pi()), typeof sessionStorage < "u") {
42822
+ if (i.set("grant_type", "authorization_code"), i.set("code", t), i.set("client_id", n?.clientId ?? this.clientId), i.set("redirect_uri", n?.redirectUri ?? wi()), typeof sessionStorage < "u") {
42815
42823
  let o = sessionStorage.getItem("codeVerifier");
42816
42824
  o && i.set("code_verifier", o);
42817
42825
  }
@@ -42843,7 +42851,7 @@ var Nt = class extends H {
42843
42851
  return n.append("grant_type", "client_credentials"), n.append("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.append("client_assertion", t), this.fetchTokens(n);
42844
42852
  }
42845
42853
  setBasicAuth(t, n) {
42846
- this.clientId = t, this.clientSecret = n, this.basicAuth = pi(t + ":" + n);
42854
+ this.clientId = t, this.clientSecret = n, this.basicAuth = di(t + ":" + n);
42847
42855
  }
42848
42856
  async fhircastSubscribe(t, n) {
42849
42857
  if (!(typeof t == "string" && t !== "")) throw new d(h("Invalid topic provided. Topic must be a valid string."));
@@ -42861,7 +42869,7 @@ var Nt = class extends H {
42861
42869
  return new Ot(t);
42862
42870
  }
42863
42871
  async fhircastPublish(t, n, i, o) {
42864
- return hi(n) ? this.post(this.fhircastHubUrl, Br(t, n, i, o), D.JSON) : (yi(n), this.post(this.fhircastHubUrl, Br(t, n, i), D.JSON));
42872
+ return yi(n) ? this.post(this.fhircastHubUrl, Br(t, n, i, o), D.JSON) : (gi(n), this.post(this.fhircastHubUrl, Br(t, n, i), D.JSON));
42865
42873
  }
42866
42874
  async fhircastGetContext(t) {
42867
42875
  return this.get(`${this.fhircastHubUrl}/${t}`);
@@ -42871,7 +42879,7 @@ var Nt = class extends H {
42871
42879
  }
42872
42880
  async fetchTokens(t) {
42873
42881
  let n = { method: "POST", headers: { "Content-Type": D.FORM_URL_ENCODED }, body: t.toString(), credentials: "include" }, i = n.headers;
42874
- this.basicAuth && (i.Authorization = `Basic ${this.basicAuth}`);
42882
+ Object.assign(i, this.defaultHeaders), this.basicAuth && (i.Authorization = `Basic ${this.basicAuth}`);
42875
42883
  let o;
42876
42884
  try {
42877
42885
  o = await this.fetchWithRetry(this.tokenUrl, n);
@@ -42917,7 +42925,7 @@ var Nt = class extends H {
42917
42925
  }
42918
42926
  }
42919
42927
  getSubscriptionManager() {
42920
- return this.subscriptionManager || (this.subscriptionManager = new _t(this, Hn(this.baseUrl, "/ws/subscriptions-r4"))), this.subscriptionManager;
42928
+ return this.subscriptionManager || (this.subscriptionManager = new _t(this, Qn(this.baseUrl, "/ws/subscriptions-r4"))), this.subscriptionManager;
42921
42929
  }
42922
42930
  subscribeToCriteria(t, n) {
42923
42931
  return this.getSubscriptionManager().addCriteria(t, n);
@@ -42929,40 +42937,40 @@ var Nt = class extends H {
42929
42937
  return this.getSubscriptionManager().getMasterEmitter();
42930
42938
  }
42931
42939
  };
42932
- function da() {
42940
+ function fa() {
42933
42941
  if (!globalThis.fetch) throw new Error("Fetch not available in this environment");
42934
42942
  return globalThis.fetch.bind(globalThis);
42935
42943
  }
42936
- function Pi() {
42944
+ function wi() {
42937
42945
  return typeof window > "u" ? "" : window.location.protocol + "//" + window.location.host + "/";
42938
42946
  }
42939
- async function wi(r7, e) {
42947
+ async function Ai(r7, e) {
42940
42948
  let t = r7.headers.get("content-location");
42941
42949
  if (t) return t;
42942
42950
  let n = r7.headers.get("location");
42943
42951
  if (n) return n;
42944
42952
  if (be(e) && e.issue?.[0]?.diagnostics) return e.issue[0].diagnostics;
42945
42953
  }
42946
- function Ai(r7) {
42954
+ function Oi(r7) {
42947
42955
  let e = r7.entry?.map((t) => t.resource) ?? [];
42948
42956
  return Object.assign(e, { bundle: r7 });
42949
42957
  }
42950
- function fa(r7) {
42958
+ function ma(r7) {
42951
42959
  return R(r7) && "data" in r7 && "contentType" in r7;
42952
42960
  }
42953
- function Oi(r7, e, t, n) {
42954
- return fa(r7) ? r7 : { data: r7, filename: e, contentType: t, onProgress: n };
42961
+ function Ii(r7, e, t, n) {
42962
+ return ma(r7) ? r7 : { data: r7, filename: e, contentType: t, onProgress: n };
42955
42963
  }
42956
- function ma(r7) {
42964
+ function ha(r7) {
42957
42965
  return R(r7) && "docDefinition" in r7;
42958
42966
  }
42959
- function ha(r7, e, t, n) {
42960
- return ma(r7) ? r7 : { docDefinition: r7, filename: e, tableLayouts: t, fonts: n };
42967
+ function ya(r7, e, t, n) {
42968
+ return ha(r7) ? r7 : { docDefinition: r7, filename: e, tableLayouts: t, fonts: n };
42961
42969
  }
42962
- var wa = [...qe, "->", "<<", ">>", "=="];
42963
- var Ia = je().registerInfix("->", { precedence: y.Arrow }).registerInfix(";", { precedence: y.Semicolon });
42964
- var Ka = [...qe, "eq", "ne", "co"];
42965
- var Ya = je();
42970
+ var Aa = [...qe, "->", "<<", ">>", "=="];
42971
+ var ka = je().registerInfix("->", { precedence: y.Arrow }).registerInfix(";", { precedence: y.Semicolon });
42972
+ var za = [...qe, "eq", "ne", "co"];
42973
+ var Za = je();
42966
42974
  var se = class {
42967
42975
  constructor(e = "\r", t = "|", n = "^", i = "~", o = "\\", s = "&") {
42968
42976
  this.segmentSeparator = e;
@@ -42979,7 +42987,7 @@ var se = class {
42979
42987
  return this.componentSeparator + this.repetitionSeparator + this.escapeCharacter + this.subcomponentSeparator;
42980
42988
  }
42981
42989
  };
42982
- var Hi = class r2 {
42990
+ var Qi = class r2 {
42983
42991
  constructor(e, t = new se()) {
42984
42992
  this.context = t, this.segments = e;
42985
42993
  }
@@ -43003,7 +43011,7 @@ var Hi = class r2 {
43003
43011
  }
43004
43012
  buildAck() {
43005
43013
  let e = /* @__PURE__ */ new Date(), t = this.getSegment("MSH"), n = t?.getField(3)?.toString() ?? "", i = t?.getField(4)?.toString() ?? "", o = t?.getField(5)?.toString() ?? "", s = t?.getField(6)?.toString() ?? "", a2 = t?.getField(10)?.toString() ?? "", c = t?.getField(12)?.toString() ?? "2.5.1";
43006
- return new r2([new Ke(["MSH", this.context.getMsh2(), o, s, n, i, Xa(e), "", this.buildAckMessageType(t), e.getTime().toString(), "P", c], this.context), new Ke(["MSA", "AA", a2, "OK"], this.context)]);
43014
+ return new r2([new Ke(["MSH", this.context.getMsh2(), o, s, n, i, ec(e), "", this.buildAckMessageType(t), e.getTime().toString(), "P", c], this.context), new Ke(["MSA", "AA", a2, "OK"], this.context)]);
43007
43015
  }
43008
43016
  buildAckMessageType(e) {
43009
43017
  let t = e?.getField(9), n = t?.getComponent(2), i = t?.getComponent(3), o = "ACK";
@@ -43061,12 +43069,12 @@ var Me = class r4 {
43061
43069
  return new r4(e.split(t.repetitionSeparator).map((n) => n.split(t.componentSeparator)), t);
43062
43070
  }
43063
43071
  };
43064
- function Xa(r7) {
43072
+ function ec(r7) {
43065
43073
  let e = r7 instanceof Date ? r7 : new Date(r7), n = e.toISOString().replace(/[-:T]/g, "").replace(/(\.\d+)?Z$/, ""), i = e.getUTCMilliseconds();
43066
43074
  return i > 0 && (n += "." + i.toString()), n;
43067
43075
  }
43068
43076
  var zr = ((o) => (o[o.NONE = 0] = "NONE", o[o.ERROR = 1] = "ERROR", o[o.WARN = 2] = "WARN", o[o.INFO = 3] = "INFO", o[o.DEBUG = 4] = "DEBUG", o))(zr || {});
43069
- var Qi = class r5 {
43077
+ var Ki = class r5 {
43070
43078
  constructor(e, t = {}, n = 3, i) {
43071
43079
  this.write = e;
43072
43080
  this.metadata = t;
@@ -43099,14 +43107,14 @@ var Qi = class r5 {
43099
43107
  `) }), this.write(JSON.stringify({ level: zr[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: this.prefix ? `${this.prefix}${t}` : t, ...n, ...this.metadata })));
43100
43108
  }
43101
43109
  };
43102
- function dm(r7) {
43110
+ function mm(r7) {
43103
43111
  let e = zr[r7.toUpperCase()];
43104
43112
  if (e === void 0) throw new Error(`Invalid log level: ${r7}`);
43105
43113
  return e;
43106
43114
  }
43107
- var sc = "https://api.github.com/repos/medplum/medplum/releases";
43115
+ var ac = "https://api.github.com/repos/medplum/medplum/releases";
43108
43116
  var Qt = /* @__PURE__ */ new Map();
43109
- function ac(r7) {
43117
+ function cc(r7) {
43110
43118
  let e = r7;
43111
43119
  if (!e.tag_name) throw new Error("Manifest missing tag_name");
43112
43120
  let t = e.assets;
@@ -43116,10 +43124,10 @@ function ac(r7) {
43116
43124
  if (!n.name) throw new Error("Asset missing name");
43117
43125
  }
43118
43126
  }
43119
- async function zi(r7) {
43127
+ async function Ji(r7) {
43120
43128
  let e = Qt.get(r7 ?? "latest");
43121
43129
  if (!e) {
43122
- let t = r7 ? `tags/v${r7}` : "latest", n = await fetch(`${sc}/${t}`);
43130
+ let t = r7 ? `tags/v${r7}` : "latest", n = await fetch(`${ac}/${t}`);
43123
43131
  if (n.status !== 200) {
43124
43132
  let o;
43125
43133
  try {
@@ -43130,24 +43138,24 @@ async function zi(r7) {
43130
43138
  throw new Error(`Received status code ${n.status} while fetching manifest for version '${r7 ?? "latest"}'. Message: ${o}`);
43131
43139
  }
43132
43140
  let i = await n.json();
43133
- ac(i), e = i, Qt.set(r7 ?? "latest", e), r7 || Qt.set(e.tag_name.slice(1), e);
43141
+ cc(i), e = i, Qt.set(r7 ?? "latest", e), r7 || Qt.set(e.tag_name.slice(1), e);
43134
43142
  }
43135
43143
  return e;
43136
43144
  }
43137
- function cc(r7) {
43145
+ function uc(r7) {
43138
43146
  return /^\d+\.\d+\.\d+$/.test(r7);
43139
43147
  }
43140
- async function Pm(r7) {
43141
- if (!cc(r7)) return false;
43148
+ async function Am(r7) {
43149
+ if (!uc(r7)) return false;
43142
43150
  try {
43143
- await zi(r7);
43151
+ await Ji(r7);
43144
43152
  } catch {
43145
43153
  return false;
43146
43154
  }
43147
43155
  return true;
43148
43156
  }
43149
- async function wm() {
43150
- let r7 = await zi();
43157
+ async function Om() {
43158
+ let r7 = await Ji();
43151
43159
  if (!r7.tag_name.startsWith("v")) throw new Error(`Invalid release name found. Release tag '${r7.tag_name}' did not start with 'v'`);
43152
43160
  return r7.tag_name.slice(1);
43153
43161
  }
@@ -43195,7 +43203,7 @@ var p = class extends a {
43195
43203
  e.on("data", (s) => {
43196
43204
  try {
43197
43205
  if (this.appendData(s), s.at(-2) === 28 && s.at(-1) === 13) {
43198
- let o = Buffer.concat(this.chunks), i = o.subarray(1, o.length - 2), f2 = (0, import_iconv_lite.decode)(i, this.encoding), g2 = Hi.parse(f2);
43206
+ let o = Buffer.concat(this.chunks), i = o.subarray(1, o.length - 2), f2 = (0, import_iconv_lite.decode)(i, this.encoding), g2 = Qi.parse(f2);
43199
43207
  this.dispatchEvent(new d2(this, g2)), this.resetBuffer();
43200
43208
  }
43201
43209
  } catch (o) {
@@ -43524,7 +43532,7 @@ var AgentHl7Channel = class extends BaseChannel {
43524
43532
  sendToRemote(msg) {
43525
43533
  const connection = this.connections.get(msg.remote);
43526
43534
  if (connection) {
43527
- connection.hl7Connection.send(Hi.parse(msg.body));
43535
+ connection.hl7Connection.send(Qi.parse(msg.body));
43528
43536
  }
43529
43537
  }
43530
43538
  handleNewConnection(connection) {
@@ -43573,7 +43581,7 @@ var UPGRADER_LOG_PATH = (0, import_node_path2.resolve)(
43573
43581
  );
43574
43582
  var RELEASES_PATH = (0, import_node_path2.resolve)(__dirname);
43575
43583
  async function downloadRelease(version, path) {
43576
- const release = await zi(version);
43584
+ const release = await Ji(version);
43577
43585
  const downloadUrl = parseDownloadUrl(release, (0, import_node_os2.platform)());
43578
43586
  const { body } = await fetch(downloadUrl);
43579
43587
  if (!body) {
@@ -43649,7 +43657,7 @@ var App = class _App {
43649
43657
  this.shutdown = false;
43650
43658
  this.keepAlive = false;
43651
43659
  _App.instance = this;
43652
- this.log = new Qi((msg) => console.log(msg), void 0, logLevel);
43660
+ this.log = new Ki((msg) => console.log(msg), void 0, logLevel);
43653
43661
  }
43654
43662
  async start() {
43655
43663
  this.log.info("Medplum service starting...");
@@ -43669,7 +43677,7 @@ var App = class _App {
43669
43677
  if ((0, import_node_fs3.existsSync)(UPGRADE_MANIFEST_PATH)) {
43670
43678
  const upgradeFile = (0, import_node_fs3.readFileSync)(UPGRADE_MANIFEST_PATH, { encoding: "utf-8" });
43671
43679
  const upgradeDetails = JSON.parse(upgradeFile);
43672
- if (upgradeDetails.targetVersion === Xd.split("-")[0]) {
43680
+ if (upgradeDetails.targetVersion === tf.split("-")[0]) {
43673
43681
  await this.sendToWebSocket({
43674
43682
  type: "agent:upgrade:response",
43675
43683
  statusCode: 200,
@@ -43677,7 +43685,7 @@ var App = class _App {
43677
43685
  });
43678
43686
  this.log.info(`Successfully upgraded to version ${upgradeDetails.targetVersion}`);
43679
43687
  } else {
43680
- const errMsg = `Failed to upgrade to version ${upgradeDetails.targetVersion}. Agent still running with version ${Xd}`;
43688
+ const errMsg = `Failed to upgrade to version ${upgradeDetails.targetVersion}. Agent still running with version ${tf}`;
43681
43689
  await this.sendToWebSocket({
43682
43690
  type: "agent:error",
43683
43691
  body: errMsg,
@@ -43752,7 +43760,7 @@ var App = class _App {
43752
43760
  break;
43753
43761
  case "agent:heartbeat:request":
43754
43762
  this.outstandingHeartbeats = 0;
43755
- await this.sendToWebSocket({ type: "agent:heartbeat:response", version: Xd });
43763
+ await this.sendToWebSocket({ type: "agent:heartbeat:response", version: tf });
43756
43764
  break;
43757
43765
  case "agent:heartbeat:response":
43758
43766
  this.outstandingHeartbeats = 0;
@@ -44027,7 +44035,7 @@ IPv6 is currently unsupported.`;
44027
44035
  this.log.error(errMsg);
44028
44036
  throw new Error(errMsg);
44029
44037
  }
44030
- if (!((0, import_node_net3.isIPv4)(message.remote) || rl(message.remote))) {
44038
+ if (!((0, import_node_net3.isIPv4)(message.remote) || il(message.remote))) {
44031
44039
  const errMsg = `Attempted to ping an invalid host.
44032
44040
 
44033
44041
  "${message.remote}" is not a valid IPv4 address or a resolvable hostname.`;
@@ -44090,7 +44098,7 @@ ${result}`);
44090
44098
  return;
44091
44099
  }
44092
44100
  let child;
44093
- if (message.version && !await Pm(message.version)) {
44101
+ if (message.version && !await Am(message.version)) {
44094
44102
  const versionTag = message.version ? `v${message.version}` : "latest";
44095
44103
  const errMsg = `Error during upgrading to version '${versionTag}'. '${message.version}' is not a valid version`;
44096
44104
  this.log.error(errMsg);
@@ -44137,12 +44145,12 @@ ${result}`);
44137
44145
  try {
44138
44146
  await this.stop();
44139
44147
  this.log.info("Successfully stopped agent network services");
44140
- const targetVersion = message.version ?? await wm();
44141
- this.log.info("Writing upgrade manifest...", { previousVersion: Xd, targetVersion });
44148
+ const targetVersion = message.version ?? await Om();
44149
+ this.log.info("Writing upgrade manifest...", { previousVersion: tf, targetVersion });
44142
44150
  (0, import_node_fs3.writeFileSync)(
44143
44151
  UPGRADE_MANIFEST_PATH,
44144
44152
  JSON.stringify({
44145
- previousVersion: Xd,
44153
+ previousVersion: tf,
44146
44154
  targetVersion,
44147
44155
  callback: message.callback ?? null
44148
44156
  }),
@@ -44210,7 +44218,7 @@ ${result}`);
44210
44218
  });
44211
44219
  }
44212
44220
  }
44213
- client.sendAndWait(Hi.parse(message.body)).then((response) => {
44221
+ client.sendAndWait(Qi.parse(message.body)).then((response) => {
44214
44222
  this.log.info(`Response: ${response.toString().replaceAll("\r", "\n")}`);
44215
44223
  this.addToWebSocketQueue({
44216
44224
  type: "agent:transmit:response",
@@ -44279,7 +44287,7 @@ async function agentMain(argv) {
44279
44287
  const { baseUrl, clientId, clientSecret, agentId } = args;
44280
44288
  const medplum = new Nt({ baseUrl, clientId });
44281
44289
  await medplum.startClientLogin(clientId, clientSecret);
44282
- const app = new App(medplum, agentId, dm(args.logLevel ?? "INFO"));
44290
+ const app = new App(medplum, agentId, mm(args.logLevel ?? "INFO"));
44283
44291
  await app.start();
44284
44292
  process.on("SIGINT", async () => {
44285
44293
  console.log("Gracefully shutting down from SIGINT (Ctrl-C)");
@@ -44307,7 +44315,7 @@ async function upgraderMain(argv) {
44307
44315
  if ((0, import_node_os4.platform)() !== "win32") {
44308
44316
  throw new Error(`Unsupported platform: ${(0, import_node_os4.platform)()}. Agent upgrader currently only supports Windows`);
44309
44317
  }
44310
- const globalLogger = new Qi((msg) => console.log(msg));
44318
+ const globalLogger = new Ki((msg) => console.log(msg));
44311
44319
  if (!import_node_process2.default.send) {
44312
44320
  globalLogger.error("Upgrader not started as a child process with Node IPC enabled. Aborting...");
44313
44321
  import_node_process2.default.exit(1);
@@ -44320,10 +44328,10 @@ async function upgraderMain(argv) {
44320
44328
  });
44321
44329
  });
44322
44330
  import_node_process2.default.send({ type: "STARTED" });
44323
- if (argv[3] && !cc(argv[3])) {
44331
+ if (argv[3] && !uc(argv[3])) {
44324
44332
  throw new Error("Invalid version specified");
44325
44333
  }
44326
- const version = argv[3] ?? await wm();
44334
+ const version = argv[3] ?? await Om();
44327
44335
  const binPath = getReleaseBinPath(version);
44328
44336
  if (!(0, import_node_fs5.existsSync)(binPath)) {
44329
44337
  globalLogger.info(`Could not find binary at "${binPath}". Downloading release from GitHub...`);