@medplum/agent 2.1.3 → 2.1.4

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 +248 -248
  2. package/package.json +1 -1
@@ -3513,7 +3513,7 @@ var require_websocket_server = __commonJS({
3513
3513
  socket.once("finish", socket.destroy);
3514
3514
  socket.end(
3515
3515
  `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r
3516
- ` + Object.keys(headers).map((h2) => `${h2}: ${headers[h2]}`).join("\r\n") + "\r\n\r\n" + message
3516
+ ` + Object.keys(headers).map((h) => `${h}: ${headers[h]}`).join("\r\n") + "\r\n\r\n" + message
3517
3517
  );
3518
3518
  }
3519
3519
  function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) {
@@ -3538,83 +3538,83 @@ __export(main_exports, {
3538
3538
  module.exports = __toCommonJS(main_exports);
3539
3539
 
3540
3540
  // ../core/dist/esm/index.mjs
3541
- var Ye = "ok";
3542
- var Xe = "created";
3543
- var et = "not-modified";
3544
- var tt = "not-found";
3545
- var ge = "accepted";
3546
- var jt = { resourceType: "OperationOutcome", id: tt, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
3541
+ var Ze = "ok";
3542
+ var et = "created";
3543
+ var rt = "not-modified";
3544
+ var nt = "not-found";
3545
+ var xe = "accepted";
3546
+ var Qt = { resourceType: "OperationOutcome", id: nt, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
3547
3547
  function k(r4, e) {
3548
3548
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "invalid", details: { text: r4 }, expression: e ? [e] : void 0 }] };
3549
3549
  }
3550
- function xe(r4) {
3550
+ function Te(r4) {
3551
3551
  return typeof r4 == "object" && r4 !== null && r4.resourceType === "OperationOutcome";
3552
3552
  }
3553
- function rt(r4) {
3554
- return r4.id === Ye || r4.id === Xe || r4.id === et || r4.id === ge;
3553
+ function it(r4) {
3554
+ return r4.id === Ze || r4.id === et || r4.id === rt || r4.id === xe;
3555
3555
  }
3556
- var h = class extends Error {
3556
+ var m = class extends Error {
3557
3557
  constructor(t, n) {
3558
- super(Qt(t));
3558
+ super(Wt(t));
3559
3559
  this.outcome = t, this.cause = n;
3560
3560
  }
3561
3561
  };
3562
- function nt(r4) {
3563
- return r4 instanceof h ? r4.outcome : xe(r4) ? r4 : k(Jr(r4));
3562
+ function ot(r4) {
3563
+ return r4 instanceof m ? r4.outcome : Te(r4) ? r4 : k(Zr(r4));
3564
3564
  }
3565
- function Jr(r4) {
3566
- return r4 ? typeof r4 == "string" ? r4 : r4 instanceof Error ? r4.message : xe(r4) ? Qt(r4) : typeof r4 == "object" && "code" in r4 && typeof r4.code == "string" ? r4.code : JSON.stringify(r4) : "Unknown error";
3565
+ function Zr(r4) {
3566
+ return r4 ? typeof r4 == "string" ? r4 : r4 instanceof Error ? r4.message : Te(r4) ? Wt(r4) : typeof r4 == "object" && "code" in r4 && typeof r4.code == "string" ? r4.code : JSON.stringify(r4) : "Unknown error";
3567
3567
  }
3568
- function Qt(r4) {
3569
- let e = r4.issue?.map(Yr) ?? [];
3568
+ function Wt(r4) {
3569
+ let e = r4.issue?.map(en) ?? [];
3570
3570
  return e.length > 0 ? e.join("; ") : "Unknown error";
3571
3571
  }
3572
- function Yr(r4) {
3572
+ function en(r4) {
3573
3573
  let e = r4.details?.text ?? r4.diagnostics ?? "Unknown error";
3574
3574
  return r4.expression?.length && (e += ` (${r4.expression.join(", ")})`), e;
3575
3575
  }
3576
- var Gt = { types: { Element: { display: "Element", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] } } }, BackboneElement: { display: "BackboneElement", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", type: [{ code: "Extension" }] } } }, Address: { display: "Address", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: "*", 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: { display: "Age", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { display: "Annotation", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "Attachment", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "CodeableConcept", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, coding: { max: "*", type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { display: "Coding", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { display: "ContactDetail", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: "*", type: [{ code: "ContactPoint" }] } } }, ContactPoint: { display: "ContactPoint", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { display: "Contributor", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: "*", type: [{ code: "ContactDetail" }] } } }, Count: { display: "Count", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { display: "DataRequirement", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: "*", 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: "*", type: [{ code: "string" }] }, codeFilter: { max: "*", type: [{ code: "Element" }] }, dateFilter: { max: "*", type: [{ code: "Element" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: "*", type: [{ code: "Element" }] } } }, DataRequirementCodeFilter: { display: "DataRequirementCodeFilter", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] }, code: { max: "*", type: [{ code: "Coding" }] } } }, DataRequirementDateFilter: { display: "DataRequirementDateFilter", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, "value[x]": { type: [{ code: "dateTime" }, { code: "Period" }, { code: "Duration" }] } } }, DataRequirementSort: { display: "DataRequirementSort", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, direction: { min: 1, type: [{ code: "code" }] } } }, Distance: { display: "Distance", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { display: "Dosage", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: "*", 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: "*", type: [{ code: "Element" }] }, 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: { display: "DosageDoseAndRate", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "Duration", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { display: "ElementDefinition", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: "*", type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: "*", type: [{ code: "Coding" }] }, slicing: { type: [{ code: "Element" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: "*", type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "Element" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: "*", type: [{ code: "Element" }] }, "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: "*", type: [{ code: "Element" }] }, "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: "*", type: [{ code: "id" }] }, constraint: { max: "*", type: [{ code: "Element" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "Element" }] }, mapping: { max: "*", type: [{ code: "Element" }] } } }, ElementDefinitionSlicing: { display: "ElementDefinitionSlicing", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, discriminator: { max: "*", type: [{ code: "Element" }] }, description: { type: [{ code: "string" }] }, ordered: { type: [{ code: "boolean" }] }, rules: { min: 1, type: [{ code: "code" }] } } }, ElementDefinitionSlicingDiscriminator: { display: "ElementDefinitionSlicingDiscriminator", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, path: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionBase: { display: "ElementDefinitionBase", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, min: { min: 1, type: [{ code: "unsignedInt" }] }, max: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionType: { display: "ElementDefinitionType", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "uri" }] }, profile: { max: "*", type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, targetProfile: { max: "*", type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, aggregation: { max: "*", type: [{ code: "code" }] }, versioning: { type: [{ code: "code" }] } } }, ElementDefinitionExample: { display: "ElementDefinitionExample", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "ElementDefinitionConstraint", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "ElementDefinitionBinding", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "ElementDefinitionMapping", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, identity: { min: 1, type: [{ code: "id" }] }, language: { type: [{ code: "code" }] }, map: { min: 1, type: [{ code: "string" }] }, comment: { type: [{ code: "string" }] } } }, Expression: { display: "Expression", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "Extension", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "string" }] }, "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: { display: "HumanName", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: "*", type: [{ code: "string" }] }, prefix: { max: "*", type: [{ code: "string" }] }, suffix: { max: "*", type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { display: "Identifier", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "MarketingStatus", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", 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: { display: "Meta", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: "*", type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: "*", type: [{ code: "Coding" }] }, tag: { max: "*", type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, compartment: { max: "*", type: [{ code: "Reference" }] } } }, Money: { display: "Money", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { display: "Narrative", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { display: "ParameterDefinition", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "Period", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { display: "Population", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { display: "ProdCharacteristic", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", 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: "*", type: [{ code: "string" }] }, imprint: { max: "*", type: [{ code: "string" }] }, image: { max: "*", type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { display: "ProductShelfLife", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: "*", type: [{ code: "CodeableConcept" }] } } }, Quantity: { display: "Quantity", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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" }] } } }, Range: { display: "Range", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "Ratio", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { display: "Reference", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { display: "RelatedArtifact", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "SampledData", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "Signature", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, type: { min: 1, max: "*", 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: { display: "SubstanceAmount", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "Element" }] } } }, SubstanceAmountReferenceRange: { display: "SubstanceAmountReferenceRange", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, lowLimit: { type: [{ code: "Quantity" }] }, highLimit: { type: [{ code: "Quantity" }] } } }, Timing: { display: "Timing", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", type: [{ code: "Extension" }] }, event: { max: "*", type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "Element" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TimingRepeat: { display: "TimingRepeat", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: "*", type: [{ code: "code" }] }, timeOfDay: { max: "*", type: [{ code: "time" }] }, when: { max: "*", type: [{ code: "code" }] }, offset: { type: [{ code: "unsignedInt" }] } } }, TriggerDefinition: { display: "TriggerDefinition", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: "*", type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { display: "UsageContext", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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"] }] } } }, MetadataResource: { display: "MetadataResource", properties: { id: { type: [{ code: "string" }] }, meta: { type: [{ code: "Meta" }] }, implicitRules: { type: [{ code: "uri" }] }, language: { type: [{ code: "code" }] }, text: { type: [{ code: "Narrative" }] }, contained: { max: "*", type: [{ code: "Resource" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", type: [{ code: "Extension" }] }, url: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, name: { type: [{ code: "string" }] }, title: { type: [{ code: "string" }] }, status: { min: 1, type: [{ code: "code" }] }, experimental: { type: [{ code: "boolean" }] }, date: { type: [{ code: "dateTime" }] }, publisher: { type: [{ code: "string" }] }, contact: { max: "*", type: [{ code: "ContactDetail" }] }, description: { type: [{ code: "markdown" }] }, useContext: { max: "*", type: [{ code: "UsageContext" }] }, jurisdiction: { max: "*", type: [{ code: "CodeableConcept" }] } } }, IdentityProvider: { display: "IdentityProvider", properties: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, useSubject: { type: [{ code: "boolean" }] } } } } };
3577
- function zt(r4, e) {
3576
+ var Kt = { types: { Element: { display: "Element", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] } } }, BackboneElement: { display: "BackboneElement", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", type: [{ code: "Extension" }] } } }, Address: { display: "Address", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: "*", 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: { display: "Age", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { display: "Annotation", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "Attachment", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "CodeableConcept", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, coding: { max: "*", type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { display: "Coding", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { display: "ContactDetail", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: "*", type: [{ code: "ContactPoint" }] } } }, ContactPoint: { display: "ContactPoint", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { display: "Contributor", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: "*", type: [{ code: "ContactDetail" }] } } }, Count: { display: "Count", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { display: "DataRequirement", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: "*", 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: "*", type: [{ code: "string" }] }, codeFilter: { max: "*", type: [{ code: "Element" }] }, dateFilter: { max: "*", type: [{ code: "Element" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: "*", type: [{ code: "Element" }] } } }, DataRequirementCodeFilter: { display: "DataRequirementCodeFilter", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] }, code: { max: "*", type: [{ code: "Coding" }] } } }, DataRequirementDateFilter: { display: "DataRequirementDateFilter", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, "value[x]": { type: [{ code: "dateTime" }, { code: "Period" }, { code: "Duration" }] } } }, DataRequirementSort: { display: "DataRequirementSort", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, direction: { min: 1, type: [{ code: "code" }] } } }, Distance: { display: "Distance", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { display: "Dosage", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: "*", 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: "*", type: [{ code: "Element" }] }, 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: { display: "DosageDoseAndRate", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "Duration", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { display: "ElementDefinition", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: "*", type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: "*", type: [{ code: "Coding" }] }, slicing: { type: [{ code: "Element" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: "*", type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "Element" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: "*", type: [{ code: "Element" }] }, "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: "*", type: [{ code: "Element" }] }, "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: "*", type: [{ code: "id" }] }, constraint: { max: "*", type: [{ code: "Element" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "Element" }] }, mapping: { max: "*", type: [{ code: "Element" }] } } }, ElementDefinitionSlicing: { display: "ElementDefinitionSlicing", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, discriminator: { max: "*", type: [{ code: "Element" }] }, description: { type: [{ code: "string" }] }, ordered: { type: [{ code: "boolean" }] }, rules: { min: 1, type: [{ code: "code" }] } } }, ElementDefinitionSlicingDiscriminator: { display: "ElementDefinitionSlicingDiscriminator", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, path: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionBase: { display: "ElementDefinitionBase", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, min: { min: 1, type: [{ code: "unsignedInt" }] }, max: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionType: { display: "ElementDefinitionType", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "uri" }] }, profile: { max: "*", type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, targetProfile: { max: "*", type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, aggregation: { max: "*", type: [{ code: "code" }] }, versioning: { type: [{ code: "code" }] } } }, ElementDefinitionExample: { display: "ElementDefinitionExample", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "ElementDefinitionConstraint", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "ElementDefinitionBinding", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "ElementDefinitionMapping", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, identity: { min: 1, type: [{ code: "id" }] }, language: { type: [{ code: "code" }] }, map: { min: 1, type: [{ code: "string" }] }, comment: { type: [{ code: "string" }] } } }, Expression: { display: "Expression", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "Extension", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "string" }] }, "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: { display: "HumanName", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: "*", type: [{ code: "string" }] }, prefix: { max: "*", type: [{ code: "string" }] }, suffix: { max: "*", type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { display: "Identifier", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "MarketingStatus", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", 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: { display: "Meta", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: "*", type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: "*", type: [{ code: "Coding" }] }, tag: { max: "*", type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, compartment: { max: "*", type: [{ code: "Reference" }] } } }, Money: { display: "Money", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { display: "Narrative", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { display: "ParameterDefinition", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "Period", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { display: "Population", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { display: "ProdCharacteristic", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", 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: "*", type: [{ code: "string" }] }, imprint: { max: "*", type: [{ code: "string" }] }, image: { max: "*", type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { display: "ProductShelfLife", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: "*", type: [{ code: "CodeableConcept" }] } } }, Quantity: { display: "Quantity", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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" }] } } }, Range: { display: "Range", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "Ratio", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { display: "Reference", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { display: "RelatedArtifact", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "SampledData", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: { display: "Signature", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, type: { min: 1, max: "*", 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: { display: "SubstanceAmount", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "Element" }] } } }, SubstanceAmountReferenceRange: { display: "SubstanceAmountReferenceRange", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, lowLimit: { type: [{ code: "Quantity" }] }, highLimit: { type: [{ code: "Quantity" }] } } }, Timing: { display: "Timing", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", type: [{ code: "Extension" }] }, event: { max: "*", type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "Element" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TimingRepeat: { display: "TimingRepeat", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: "*", type: [{ code: "code" }] }, timeOfDay: { max: "*", type: [{ code: "time" }] }, when: { max: "*", type: [{ code: "code" }] }, offset: { type: [{ code: "unsignedInt" }] } } }, TriggerDefinition: { display: "TriggerDefinition", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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: "*", type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { display: "UsageContext", properties: { id: { type: [{ code: "string" }] }, extension: { max: "*", 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"] }] } } }, MetadataResource: { display: "MetadataResource", properties: { id: { type: [{ code: "string" }] }, meta: { type: [{ code: "Meta" }] }, implicitRules: { type: [{ code: "uri" }] }, language: { type: [{ code: "code" }] }, text: { type: [{ code: "Narrative" }] }, contained: { max: "*", type: [{ code: "Resource" }] }, extension: { max: "*", type: [{ code: "Extension" }] }, modifierExtension: { max: "*", type: [{ code: "Extension" }] }, url: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, name: { type: [{ code: "string" }] }, title: { type: [{ code: "string" }] }, status: { min: 1, type: [{ code: "code" }] }, experimental: { type: [{ code: "boolean" }] }, date: { type: [{ code: "dateTime" }] }, publisher: { type: [{ code: "string" }] }, contact: { max: "*", type: [{ code: "ContactDetail" }] }, description: { type: [{ code: "markdown" }] }, useContext: { max: "*", type: [{ code: "UsageContext" }] }, jurisdiction: { max: "*", type: [{ code: "CodeableConcept" }] } } }, IdentityProvider: { display: "IdentityProvider", properties: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, useSubject: { type: [{ code: "boolean" }] } } } } };
3577
+ function ve(r4, e) {
3578
3578
  let t = [];
3579
3579
  return r4.prefix && e?.prefix !== false && t.push(...r4.prefix), r4.given && t.push(...r4.given), r4.family && t.push(r4.family), r4.suffix && e?.suffix !== false && t.push(...r4.suffix), r4.use && (e?.all || e?.use) && t.push("[" + r4.use + "]"), t.join(" ").trim();
3580
3580
  }
3581
- function ae(r4) {
3582
- let e = Yt(r4), t = ln(r4);
3581
+ function G(r4) {
3582
+ let e = Xt(r4), t = mn(r4);
3583
3583
  return t === e ? { reference: e } : { reference: e, display: t };
3584
3584
  }
3585
- function Yt(r4) {
3585
+ function Xt(r4) {
3586
3586
  return r4.resourceType + "/" + r4.id;
3587
3587
  }
3588
- function wo(r4) {
3588
+ function Oo(r4) {
3589
3589
  return r4?.reference?.split("/")[1];
3590
3590
  }
3591
- function dn(r4) {
3591
+ function fn(r4) {
3592
3592
  return r4.resourceType === "Patient" || r4.resourceType === "Practitioner" || r4.resourceType === "RelatedPerson";
3593
3593
  }
3594
- function ln(r4) {
3595
- if (dn(r4)) {
3596
- let e = pn(r4);
3594
+ function mn(r4) {
3595
+ if (fn(r4)) {
3596
+ let e = hn(r4);
3597
3597
  if (e)
3598
3598
  return e;
3599
3599
  }
3600
3600
  if (r4.resourceType === "Device") {
3601
- let e = fn(r4);
3601
+ let e = yn(r4);
3602
3602
  if (e)
3603
3603
  return e;
3604
3604
  }
3605
- return r4.resourceType === "Observation" && "code" in r4 && r4.code?.text ? r4.code.text : r4.resourceType === "User" && r4.email ? r4.email : "name" in r4 && r4.name && typeof r4.name == "string" ? r4.name : Yt(r4);
3605
+ return r4.resourceType === "Observation" && "code" in r4 && r4.code?.text ? r4.code.text : r4.resourceType === "User" && r4.email ? r4.email : "name" in r4 && r4.name && typeof r4.name == "string" ? r4.name : Xt(r4);
3606
3606
  }
3607
- function pn(r4) {
3607
+ function hn(r4) {
3608
3608
  let e = r4.name;
3609
3609
  if (e && e.length > 0)
3610
- return zt(e[0]);
3610
+ return ve(e[0]);
3611
3611
  }
3612
- function fn(r4) {
3612
+ function yn(r4) {
3613
3613
  let e = r4.deviceName;
3614
3614
  if (e && e.length > 0)
3615
3615
  return e[0].name;
3616
3616
  }
3617
- function Te(r4, e) {
3617
+ function Re(r4, e) {
3618
3618
  let t = new Date(r4);
3619
3619
  t.setUTCHours(0, 0, 0, 0);
3620
3620
  let n = e ? new Date(e) : /* @__PURE__ */ new Date();
@@ -3623,16 +3623,16 @@ function Te(r4, e) {
3623
3623
  (c2 < o || c2 === o && f < s) && l2--;
3624
3624
  let B = a * 12 + c2 - (i2 * 12 + o);
3625
3625
  f < s && B--;
3626
- let Kr = Math.floor((n.getTime() - t.getTime()) / (1e3 * 60 * 60 * 24));
3627
- return { years: l2, months: B, days: Kr };
3626
+ let Xr = Math.floor((n.getTime() - t.getTime()) / (1e3 * 60 * 60 * 24));
3627
+ return { years: l2, months: B, days: Xr };
3628
3628
  }
3629
- function tr(r4, e) {
3630
- return JSON.stringify(r4, hn, e ? 2 : void 0);
3629
+ function rr(r4, e) {
3630
+ return JSON.stringify(r4, gn, e ? 2 : void 0);
3631
3631
  }
3632
- function hn(r4, e) {
3633
- return !mn(r4) && R(e) ? void 0 : e;
3632
+ function gn(r4, e) {
3633
+ return !xn(r4) && R(e) ? void 0 : e;
3634
3634
  }
3635
- function mn(r4) {
3635
+ function xn(r4) {
3636
3636
  return !!/\d+$/.exec(r4);
3637
3637
  }
3638
3638
  function R(r4) {
@@ -3641,19 +3641,19 @@ function R(r4) {
3641
3641
  let e = typeof r4;
3642
3642
  return e === "string" && r4 === "" || e === "object" && Object.keys(r4).length === 0;
3643
3643
  }
3644
- function rr(r4) {
3644
+ function nr(r4) {
3645
3645
  return r4.every((e) => typeof e == "string");
3646
3646
  }
3647
- var nr = [];
3647
+ var ir = [];
3648
3648
  for (let r4 = 0; r4 < 256; r4++)
3649
- nr.push(r4.toString(16).padStart(2, "0"));
3650
- function ir(r4) {
3649
+ ir.push(r4.toString(16).padStart(2, "0"));
3650
+ function or(r4) {
3651
3651
  let e = new Uint8Array(r4), t = new Array(e.length);
3652
3652
  for (let n = 0; n < e.length; n++)
3653
- t[n] = nr[e[n]];
3653
+ t[n] = ir[e[n]];
3654
3654
  return t.join("");
3655
3655
  }
3656
- function or(r4) {
3656
+ function sr(r4) {
3657
3657
  let e = new Uint8Array(r4), t = [];
3658
3658
  for (let n = 0; n < e.length; n++)
3659
3659
  t[n] = String.fromCharCode(e[n]);
@@ -3662,22 +3662,22 @@ function or(r4) {
3662
3662
  function b(r4) {
3663
3663
  return r4.charAt(0).toUpperCase() + r4.substring(1);
3664
3664
  }
3665
- var ut = (r4) => new Promise((e) => {
3665
+ var lt = (r4) => new Promise((e) => {
3666
3666
  setTimeout(e, r4);
3667
3667
  });
3668
- var G = ((u2) => (u2.Address = "Address", u2.Age = "Age", u2.Annotation = "Annotation", u2.Attachment = "Attachment", u2.BackboneElement = "BackboneElement", u2.CodeableConcept = "CodeableConcept", u2.Coding = "Coding", u2.ContactDetail = "ContactDetail", u2.ContactPoint = "ContactPoint", u2.Contributor = "Contributor", u2.Count = "Count", u2.DataRequirement = "DataRequirement", u2.Distance = "Distance", u2.Dosage = "Dosage", u2.Duration = "Duration", u2.Expression = "Expression", u2.Extension = "Extension", u2.HumanName = "HumanName", u2.Identifier = "Identifier", u2.MarketingStatus = "MarketingStatus", u2.Meta = "Meta", u2.Money = "Money", u2.Narrative = "Narrative", u2.ParameterDefinition = "ParameterDefinition", u2.Period = "Period", u2.Population = "Population", u2.ProdCharacteristic = "ProdCharacteristic", u2.ProductShelfLife = "ProductShelfLife", u2.Quantity = "Quantity", u2.Range = "Range", u2.Ratio = "Ratio", u2.Reference = "Reference", u2.RelatedArtifact = "RelatedArtifact", u2.SampledData = "SampledData", u2.Signature = "Signature", u2.SubstanceAmount = "SubstanceAmount", u2.SystemString = "http://hl7.org/fhirpath/System.String", u2.Timing = "Timing", u2.TriggerDefinition = "TriggerDefinition", u2.UsageContext = "UsageContext", u2.base64Binary = "base64Binary", u2.boolean = "boolean", u2.canonical = "canonical", u2.code = "code", u2.date = "date", u2.dateTime = "dateTime", u2.decimal = "decimal", u2.id = "id", u2.instant = "instant", u2.integer = "integer", u2.markdown = "markdown", u2.oid = "oid", u2.positiveInt = "positiveInt", u2.string = "string", u2.time = "time", u2.unsignedInt = "unsignedInt", u2.uri = "uri", u2.url = "url", u2.uuid = "uuid", u2))(G || {});
3669
- function dt(r4) {
3668
+ var z = ((u2) => (u2.Address = "Address", u2.Age = "Age", u2.Annotation = "Annotation", u2.Attachment = "Attachment", u2.BackboneElement = "BackboneElement", u2.CodeableConcept = "CodeableConcept", u2.Coding = "Coding", u2.ContactDetail = "ContactDetail", u2.ContactPoint = "ContactPoint", u2.Contributor = "Contributor", u2.Count = "Count", u2.DataRequirement = "DataRequirement", u2.Distance = "Distance", u2.Dosage = "Dosage", u2.Duration = "Duration", u2.Expression = "Expression", u2.Extension = "Extension", u2.HumanName = "HumanName", u2.Identifier = "Identifier", u2.MarketingStatus = "MarketingStatus", u2.Meta = "Meta", u2.Money = "Money", u2.Narrative = "Narrative", u2.ParameterDefinition = "ParameterDefinition", u2.Period = "Period", u2.Population = "Population", u2.ProdCharacteristic = "ProdCharacteristic", u2.ProductShelfLife = "ProductShelfLife", u2.Quantity = "Quantity", u2.Range = "Range", u2.Ratio = "Ratio", u2.Reference = "Reference", u2.RelatedArtifact = "RelatedArtifact", u2.SampledData = "SampledData", u2.Signature = "Signature", u2.SubstanceAmount = "SubstanceAmount", u2.SystemString = "http://hl7.org/fhirpath/System.String", u2.Timing = "Timing", u2.TriggerDefinition = "TriggerDefinition", u2.UsageContext = "UsageContext", u2.base64Binary = "base64Binary", u2.boolean = "boolean", u2.canonical = "canonical", u2.code = "code", u2.date = "date", u2.dateTime = "dateTime", u2.decimal = "decimal", u2.id = "id", u2.instant = "instant", u2.integer = "integer", u2.markdown = "markdown", u2.oid = "oid", u2.positiveInt = "positiveInt", u2.string = "string", u2.time = "time", u2.unsignedInt = "unsignedInt", u2.uri = "uri", u2.url = "url", u2.uuid = "uuid", u2))(z || {});
3669
+ function pt(r4) {
3670
3670
  if (!r4.name)
3671
3671
  return;
3672
3672
  let t = r4.snapshot?.element;
3673
3673
  if (t) {
3674
3674
  for (let n of t)
3675
- En(r4, n);
3675
+ wn(r4, n);
3676
3676
  for (let n of t)
3677
- Pn(r4, n);
3677
+ In(r4, n);
3678
3678
  }
3679
3679
  }
3680
- function En(r4, e) {
3680
+ function wn(r4, e) {
3681
3681
  let t = e.path, n = e.type?.[0]?.code;
3682
3682
  if (n !== void 0 && n !== "Element" && n !== "BackboneElement")
3683
3683
  return;
@@ -3686,7 +3686,7 @@ function En(r4, e) {
3686
3686
  let o = ce(i2), s = y.types[o];
3687
3687
  s || (y.types[o] = s = {}), s.parentType = s.parentType ?? ce(i2.slice(0, i2.length - 1)), s.display = s.display ?? o, s.structureDefinition = s.structureDefinition ?? r4, s.elementDefinition = s.elementDefinition ?? e, s.description = s.description ?? e.definition, s.properties = s.properties ?? {};
3688
3688
  }
3689
- function Pn(r4, e) {
3689
+ function In(r4, e) {
3690
3690
  let n = e.path.split(".");
3691
3691
  if (n.length === 1)
3692
3692
  return;
@@ -3697,13 +3697,13 @@ function Pn(r4, e) {
3697
3697
  let s = n[n.length - 1];
3698
3698
  o.properties[s] = e;
3699
3699
  }
3700
- function lt(r4) {
3700
+ function ft(r4) {
3701
3701
  for (let e of r4.base ?? []) {
3702
3702
  let t = y.types[e];
3703
3703
  t && (t.searchParams || (t.searchParams = { _id: { base: [e], code: "_id", type: "token", expression: e + ".id" }, _lastUpdated: { base: [e], code: "_lastUpdated", type: "date", expression: e + ".meta.lastUpdated" }, _compartment: { base: [e], code: "_compartment", type: "reference", expression: e + ".meta.compartment" }, _profile: { base: [e], code: "_profile", type: "uri", expression: e + ".meta.profile" }, _security: { base: [e], code: "_security", type: "token", expression: e + ".meta.security" }, _source: { base: [e], code: "_source", type: "uri", expression: e + ".meta.source" }, _tag: { base: [e], code: "_tag", type: "token", expression: e + ".meta.tag" } }), t.searchParams[r4.code] = r4);
3704
3704
  }
3705
3705
  }
3706
- function z(r4) {
3706
+ function K(r4) {
3707
3707
  let e = r4.type?.[0]?.code;
3708
3708
  return e === "BackboneElement" || e === "Element" ? ce((r4.base?.path ?? r4.path)?.split(".")) : e;
3709
3709
  }
@@ -3723,12 +3723,11 @@ function ue(r4, e) {
3723
3723
  return n;
3724
3724
  }
3725
3725
  }
3726
- function L(r4) {
3726
+ function O(r4) {
3727
3727
  return !!(r4 && typeof r4 == "object" && "resourceType" in r4);
3728
3728
  }
3729
- var y = Gt;
3730
- var kn = ((g) => (g.EQUALS = "eq", g.NOT_EQUALS = "ne", g.GREATER_THAN = "gt", g.LESS_THAN = "lt", g.GREATER_THAN_OR_EQUALS = "ge", g.LESS_THAN_OR_EQUALS = "le", g.STARTS_AFTER = "sa", g.ENDS_BEFORE = "eb", g.APPROXIMATELY = "ap", g.CONTAINS = "contains", g.EXACT = "exact", g.TEXT = "text", g.NOT = "not", g.ABOVE = "above", g.BELOW = "below", g.IN = "in", g.NOT_IN = "not-in", g.OF_TYPE = "of-type", g.MISSING = "missing", g.IDENTIFIER = "identifier", g.ITERATE = "iterate", g))(kn || {});
3731
- var Ae = class {
3729
+ var y = Kt;
3730
+ var Ee = class {
3732
3731
  constructor(e, t) {
3733
3732
  this.operator = e;
3734
3733
  this.child = t;
@@ -3747,7 +3746,7 @@ var j = class {
3747
3746
  return `${this.left.toString()} ${this.operator} ${this.right.toString()}`;
3748
3747
  }
3749
3748
  };
3750
- var Ee = class {
3749
+ var Pe = class {
3751
3750
  constructor() {
3752
3751
  this.prefixParselets = {};
3753
3752
  this.infixParselets = {};
@@ -3771,10 +3770,10 @@ var Ee = class {
3771
3770
  }, precedence: t });
3772
3771
  }
3773
3772
  construct(e) {
3774
- return new ft(e, this.prefixParselets, this.infixParselets);
3773
+ return new mt(e, this.prefixParselets, this.infixParselets);
3775
3774
  }
3776
3775
  };
3777
- var ft = class {
3776
+ var mt = class {
3778
3777
  constructor(e, t, n) {
3779
3778
  this.tokens = e, this.prefixParselets = t, this.infixParselets = n;
3780
3779
  }
@@ -3825,7 +3824,7 @@ var ft = class {
3825
3824
  return this.infixParselets[e.id === "Symbol" ? e.value : e.id];
3826
3825
  }
3827
3826
  };
3828
- function te(r4) {
3827
+ function re(r4) {
3829
3828
  if (r4.startsWith("T"))
3830
3829
  return r4 + "T00:00:00.000Z".substring(r4.length);
3831
3830
  if (r4.length <= 10)
@@ -3840,12 +3839,12 @@ function d(r4) {
3840
3839
  return [{ type: "boolean", value: r4 }];
3841
3840
  }
3842
3841
  function x(r4) {
3843
- return r4 == null ? { type: "undefined", value: void 0 } : Number.isSafeInteger(r4) ? { type: "integer", value: r4 } : typeof r4 == "number" ? { type: "decimal", value: r4 } : typeof r4 == "boolean" ? { type: "boolean", value: r4 } : typeof r4 == "string" ? { type: "string", value: r4 } : A(r4) ? { type: "Quantity", value: r4 } : L(r4) ? { type: r4.resourceType, value: r4 } : { type: "BackboneElement", value: r4 };
3842
+ return r4 == null ? { type: "undefined", value: void 0 } : Number.isSafeInteger(r4) ? { type: "integer", value: r4 } : typeof r4 == "number" ? { type: "decimal", value: r4 } : typeof r4 == "boolean" ? { type: "boolean", value: r4 } : typeof r4 == "string" ? { type: "string", value: r4 } : A(r4) ? { type: "Quantity", value: r4 } : O(r4) ? { type: r4.resourceType, value: r4 } : { type: "BackboneElement", value: r4 };
3844
3843
  }
3845
3844
  function _(r4) {
3846
3845
  return r4.length === 0 ? false : !!r4[0].value;
3847
3846
  }
3848
- function O(r4, e) {
3847
+ function V(r4, e) {
3849
3848
  if (r4.length !== 0) {
3850
3849
  if (r4.length === 1 && (!e || r4[0].type === e))
3851
3850
  return r4[0];
@@ -3856,9 +3855,9 @@ function E(r4, e) {
3856
3855
  if (!r4.value)
3857
3856
  return;
3858
3857
  let t = ue(r4.type, e);
3859
- return t ? $n(r4, e, t) : Qn(r4, e);
3858
+ return t ? Ln(r4, e, t) : _n(r4, e);
3860
3859
  }
3861
- function $n(r4, e, t) {
3860
+ function Ln(r4, e, t) {
3862
3861
  let n = t.type;
3863
3862
  if (!n || n.length === 0)
3864
3863
  return;
@@ -3874,13 +3873,13 @@ function $n(r4, e, t) {
3874
3873
  }
3875
3874
  }
3876
3875
  let s = r4.value["_" + e];
3877
- if (s && (Array.isArray(i2) ? i2 = i2.map((a, c2) => s[c2] ? xr(a ?? {}, s[c2]) : a) : i2 = xr(i2 ?? {}, s)), !R(i2))
3878
- return (o === "Element" || o === "BackboneElement") && (o = z(t)), Array.isArray(i2) ? i2.map((a) => mr(a, o)) : mr(i2, o);
3876
+ if (s && (Array.isArray(i2) ? i2 = i2.map((a, c2) => s[c2] ? hr(a ?? {}, s[c2]) : a) : i2 = hr(i2 ?? {}, s)), !R(i2))
3877
+ return (o === "Element" || o === "BackboneElement") && (o = K(t)), Array.isArray(i2) ? i2.map((a) => pr(a, o)) : pr(i2, o);
3879
3878
  }
3880
- function mr(r4, e) {
3881
- return e === "Resource" && L(r4) && (e = r4.resourceType), { type: e, value: r4 };
3879
+ function pr(r4, e) {
3880
+ return e === "Resource" && O(r4) && (e = r4.resourceType), { type: e, value: r4 };
3882
3881
  }
3883
- function Qn(r4, e) {
3882
+ function _n(r4, e) {
3884
3883
  let t = r4.value;
3885
3884
  if (!t || typeof t != "object")
3886
3885
  return;
@@ -3888,7 +3887,7 @@ function Qn(r4, e) {
3888
3887
  if (e in t)
3889
3888
  n = t[e];
3890
3889
  else
3891
- for (let i2 in G) {
3890
+ for (let i2 in z) {
3892
3891
  let o = e + b(i2);
3893
3892
  if (o in t) {
3894
3893
  n = t[o];
@@ -3898,12 +3897,12 @@ function Qn(r4, e) {
3898
3897
  if (!R(n))
3899
3898
  return Array.isArray(n) ? n.map(x) : x(n);
3900
3899
  }
3901
- function Pe(r4) {
3900
+ function Ce(r4) {
3902
3901
  let e = [];
3903
3902
  for (let t of r4) {
3904
3903
  let n = false;
3905
3904
  for (let i2 of e)
3906
- if (_(Tr(t, i2))) {
3905
+ if (_(yr(t, i2))) {
3907
3906
  n = true;
3908
3907
  break;
3909
3908
  }
@@ -3914,25 +3913,25 @@ function Pe(r4) {
3914
3913
  function ht(r4) {
3915
3914
  return d(!_(r4));
3916
3915
  }
3917
- function mt(r4, e) {
3918
- return r4.length === 0 || e.length === 0 ? [] : r4.length !== e.length ? d(false) : d(r4.every((t, n) => _(Tr(t, e[n]))));
3916
+ function yt(r4, e) {
3917
+ return r4.length === 0 || e.length === 0 ? [] : r4.length !== e.length ? d(false) : d(r4.every((t, n) => _(yr(t, e[n]))));
3919
3918
  }
3920
- function Tr(r4, e) {
3919
+ function yr(r4, e) {
3921
3920
  let t = r4.value?.valueOf(), n = e.value?.valueOf();
3922
- return typeof t == "number" && typeof n == "number" ? d(Math.abs(t - n) < 1e-8) : A(t) && A(n) ? d(vr(t, n)) : d(typeof t == "object" && typeof n == "object" ? gt(r4, e) : t === n);
3921
+ return typeof t == "number" && typeof n == "number" ? d(Math.abs(t - n) < 1e-8) : A(t) && A(n) ? d(gr(t, n)) : d(typeof t == "object" && typeof n == "object" ? xt(r4, e) : t === n);
3923
3922
  }
3924
- function yt(r4, e) {
3925
- return r4.length === 0 && e.length === 0 ? d(true) : r4.length !== e.length ? d(false) : (r4.sort(yr), e.sort(yr), d(r4.every((t, n) => _(Hn(t, e[n])))));
3923
+ function gt(r4, e) {
3924
+ return r4.length === 0 && e.length === 0 ? d(true) : r4.length !== e.length ? d(false) : (r4.sort(fr), e.sort(fr), d(r4.every((t, n) => _(Nn(t, e[n])))));
3926
3925
  }
3927
- function Hn(r4, e) {
3926
+ function Nn(r4, e) {
3928
3927
  let { type: t, value: n } = r4, { type: i2, value: o } = e, s = n?.valueOf(), a = o?.valueOf();
3929
- return typeof s == "number" && typeof a == "number" ? d(Math.abs(s - a) < 0.01) : A(s) && A(a) ? d(vr(s, a)) : d(t === "Coding" && i2 === "Coding" ? typeof s != "object" || typeof a != "object" ? false : s.code === a.code && s.system === a.system : typeof s == "object" && typeof a == "object" ? gt({ ...s, id: void 0 }, { ...a, id: void 0 }) : typeof s == "string" && typeof a == "string" ? s.toLowerCase() === a.toLowerCase() : s === a);
3928
+ return typeof s == "number" && typeof a == "number" ? d(Math.abs(s - a) < 0.01) : A(s) && A(a) ? d(gr(s, a)) : d(t === "Coding" && i2 === "Coding" ? typeof s != "object" || typeof a != "object" ? false : s.code === a.code && s.system === a.system : typeof s == "object" && typeof a == "object" ? xt({ ...s, id: void 0 }, { ...a, id: void 0 }) : typeof s == "string" && typeof a == "string" ? s.toLowerCase() === a.toLowerCase() : s === a);
3930
3929
  }
3931
- function yr(r4, e) {
3930
+ function fr(r4, e) {
3932
3931
  let t = r4.value?.valueOf(), n = e.value?.valueOf();
3933
3932
  return typeof t == "number" && typeof n == "number" ? t - n : typeof t == "string" && typeof n == "string" ? t.localeCompare(n) : 0;
3934
3933
  }
3935
- function Ce(r4, e) {
3934
+ function we(r4, e) {
3936
3935
  let { value: t } = r4;
3937
3936
  if (t == null)
3938
3937
  return false;
@@ -3949,40 +3948,40 @@ function Ce(r4, e) {
3949
3948
  case "Time":
3950
3949
  return typeof t == "string" && !!/^T\d/.exec(t);
3951
3950
  case "Period":
3952
- return Wn(t);
3951
+ return Mn(t);
3953
3952
  case "Quantity":
3954
3953
  return A(t);
3955
3954
  default:
3956
3955
  return typeof t == "object" && t?.resourceType === e;
3957
3956
  }
3958
3957
  }
3959
- function Wn(r4) {
3958
+ function Mn(r4) {
3960
3959
  return !!(r4 && typeof r4 == "object" && "start" in r4);
3961
3960
  }
3962
3961
  function A(r4) {
3963
3962
  return !!(r4 && typeof r4 == "object" && "value" in r4 && typeof r4.value == "number");
3964
3963
  }
3965
- function vr(r4, e) {
3964
+ function gr(r4, e) {
3966
3965
  return Math.abs(r4.value - e.value) < 0.01 && (r4.unit === e.unit || r4.code === e.code || r4.unit === e.code || r4.code === e.unit);
3967
3966
  }
3968
- function gt(r4, e) {
3967
+ function xt(r4, e) {
3969
3968
  let t = Object.keys(r4), n = Object.keys(e);
3970
3969
  if (t.length !== n.length)
3971
3970
  return false;
3972
3971
  for (let i2 of t) {
3973
3972
  let o = r4[i2], s = e[i2];
3974
- if (gr(o) && gr(s)) {
3975
- if (!gt(o, s))
3973
+ if (mr(o) && mr(s)) {
3974
+ if (!xt(o, s))
3976
3975
  return false;
3977
3976
  } else if (o !== s)
3978
3977
  return false;
3979
3978
  }
3980
3979
  return true;
3981
3980
  }
3982
- function gr(r4) {
3981
+ function mr(r4) {
3983
3982
  return r4 !== null && typeof r4 == "object";
3984
3983
  }
3985
- function xr(r4, e) {
3984
+ function hr(r4, e) {
3986
3985
  return delete e.__proto__, delete e.constructor, Object.assign(r4, e);
3987
3986
  }
3988
3987
  var de = () => [];
@@ -4043,7 +4042,7 @@ var S = { empty: (r4, e) => d(e.length === 0), exists: (r4, e, t) => t ? d(e.fil
4043
4042
  if (!t)
4044
4043
  return e;
4045
4044
  let n = t.eval(r4, e);
4046
- return Pe([...e, ...n]);
4045
+ return Ce([...e, ...n]);
4047
4046
  }, combine: (r4, e, t) => {
4048
4047
  if (!t)
4049
4048
  return e;
@@ -4057,7 +4056,7 @@ var S = { empty: (r4, e) => d(e.length === 0), exists: (r4, e, t) => t ? d(e.fil
4057
4056
  }, toBoolean: (r4, e) => {
4058
4057
  if (e.length === 0)
4059
4058
  return [];
4060
- let [{ value: t }] = U(e, 1);
4059
+ let [{ value: t }] = L(e, 1);
4061
4060
  if (typeof t == "boolean")
4062
4061
  return [{ type: "boolean", value: t }];
4063
4062
  if (typeof t == "number" && (t === 0 || t === 1))
@@ -4073,47 +4072,47 @@ var S = { empty: (r4, e) => d(e.length === 0), exists: (r4, e, t) => t ? d(e.fil
4073
4072
  }, convertsToBoolean: (r4, e) => e.length === 0 ? [] : d(S.toBoolean(r4, e).length === 1), toInteger: (r4, e) => {
4074
4073
  if (e.length === 0)
4075
4074
  return [];
4076
- let [{ value: t }] = U(e, 1);
4075
+ let [{ value: t }] = L(e, 1);
4077
4076
  return typeof t == "number" ? [{ type: "integer", value: t }] : typeof t == "string" && /^[+-]?\d+$/.exec(t) ? [{ type: "integer", value: parseInt(t, 10) }] : typeof t == "boolean" ? [{ type: "integer", value: t ? 1 : 0 }] : [];
4078
4077
  }, convertsToInteger: (r4, e) => e.length === 0 ? [] : d(S.toInteger(r4, e).length === 1), toDate: (r4, e) => {
4079
4078
  if (e.length === 0)
4080
4079
  return [];
4081
- let [{ value: t }] = U(e, 1);
4082
- return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: "date", value: te(t) }] : [];
4080
+ let [{ value: t }] = L(e, 1);
4081
+ return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: "date", value: re(t) }] : [];
4083
4082
  }, convertsToDate: (r4, e) => e.length === 0 ? [] : d(S.toDate(r4, e).length === 1), toDateTime: (r4, e) => {
4084
4083
  if (e.length === 0)
4085
4084
  return [];
4086
- let [{ value: t }] = U(e, 1);
4087
- return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: "dateTime", value: te(t) }] : [];
4085
+ let [{ value: t }] = L(e, 1);
4086
+ return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: "dateTime", value: re(t) }] : [];
4088
4087
  }, convertsToDateTime: (r4, e) => e.length === 0 ? [] : d(S.toDateTime(r4, e).length === 1), toDecimal: (r4, e) => {
4089
4088
  if (e.length === 0)
4090
4089
  return [];
4091
- let [{ value: t }] = U(e, 1);
4090
+ let [{ value: t }] = L(e, 1);
4092
4091
  return typeof t == "number" ? [{ type: "decimal", value: t }] : typeof t == "string" && /^-?\d{1,9}(\.\d{1,9})?$/.exec(t) ? [{ type: "decimal", value: parseFloat(t) }] : typeof t == "boolean" ? [{ type: "decimal", value: t ? 1 : 0 }] : [];
4093
4092
  }, convertsToDecimal: (r4, e) => e.length === 0 ? [] : d(S.toDecimal(r4, e).length === 1), toQuantity: (r4, e) => {
4094
4093
  if (e.length === 0)
4095
4094
  return [];
4096
- let [{ value: t }] = U(e, 1);
4095
+ let [{ value: t }] = L(e, 1);
4097
4096
  return A(t) ? [{ type: "Quantity", value: t }] : typeof t == "number" ? [{ type: "Quantity", value: { value: t, unit: "1" } }] : typeof t == "string" && /^-?\d{1,9}(\.\d{1,9})?/.exec(t) ? [{ type: "Quantity", value: { value: parseFloat(t), unit: "1" } }] : typeof t == "boolean" ? [{ type: "Quantity", value: { value: t ? 1 : 0, unit: "1" } }] : [];
4098
4097
  }, convertsToQuantity: (r4, e) => e.length === 0 ? [] : d(S.toQuantity(r4, e).length === 1), toString: (r4, e) => {
4099
4098
  if (e.length === 0)
4100
4099
  return [];
4101
- let [{ value: t }] = U(e, 1);
4100
+ let [{ value: t }] = L(e, 1);
4102
4101
  return t == null ? [] : A(t) ? [{ type: "string", value: `${t.value} '${t.unit}'` }] : [{ type: "string", value: t.toString() }];
4103
4102
  }, convertsToString: (r4, e) => e.length === 0 ? [] : d(S.toString(r4, e).length === 1), toTime: (r4, e) => {
4104
4103
  if (e.length === 0)
4105
4104
  return [];
4106
- let [{ value: t }] = U(e, 1);
4105
+ let [{ value: t }] = L(e, 1);
4107
4106
  if (typeof t == "string") {
4108
4107
  let n = /^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(t);
4109
4108
  if (n)
4110
- return [{ type: "time", value: te("T" + n[1]) }];
4109
+ return [{ type: "time", value: re("T" + n[1]) }];
4111
4110
  }
4112
4111
  return [];
4113
4112
  }, convertsToTime: (r4, e) => e.length === 0 ? [] : d(S.toTime(r4, e).length === 1), indexOf: (r4, e, t) => C((n, i2) => n.indexOf(i2), r4, e, t), substring: (r4, e, t, n) => C((i2, o, s) => {
4114
4113
  let a = o, c2 = s ? a + s : i2.length;
4115
4114
  return a < 0 || a >= i2.length ? void 0 : i2.substring(a, c2);
4116
- }, r4, e, t, n), startsWith: (r4, e, t) => C((n, i2) => n.startsWith(i2), r4, e, t), endsWith: (r4, e, t) => C((n, i2) => n.endsWith(i2), r4, e, t), contains: (r4, e, t) => C((n, i2) => n.includes(i2), r4, e, t), upper: (r4, e) => C((t) => t.toUpperCase(), r4, e), lower: (r4, e) => C((t) => t.toLowerCase(), r4, e), replace: (r4, e, t, n) => C((i2, o, s) => i2.replaceAll(o, s), r4, e, t, n), matches: (r4, e, t) => C((n, i2) => !!new RegExp(i2).exec(n), r4, e, t), replaceMatches: (r4, e, t, n) => C((i2, o, s) => i2.replaceAll(o, s), r4, e, t, n), length: (r4, e) => C((t) => t.length, r4, e), toChars: (r4, e) => C((t) => t ? t.split("") : void 0, r4, e), abs: (r4, e) => V(Math.abs, r4, e), ceiling: (r4, e) => V(Math.ceil, r4, e), exp: (r4, e) => V(Math.exp, r4, e), floor: (r4, e) => V(Math.floor, r4, e), ln: (r4, e) => V(Math.log, r4, e), log: (r4, e, t) => V((n, i2) => Math.log(n) / Math.log(i2), r4, e, t), power: (r4, e, t) => V(Math.pow, r4, e, t), round: (r4, e) => V(Math.round, r4, e), sqrt: (r4, e) => V(Math.sqrt, r4, e), truncate: (r4, e) => V((t) => t | 0, r4, e), children: de, descendants: de, trace: (r4, e, t) => (console.log("trace", e, t), e), now: () => [{ type: "dateTime", value: (/* @__PURE__ */ new Date()).toISOString() }], timeOfDay: () => [{ type: "time", value: (/* @__PURE__ */ new Date()).toISOString().substring(11) }], today: () => [{ type: "date", value: (/* @__PURE__ */ new Date()).toISOString().substring(0, 10) }], between: (r4, e, t, n, i2) => {
4115
+ }, r4, e, t, n), startsWith: (r4, e, t) => C((n, i2) => n.startsWith(i2), r4, e, t), endsWith: (r4, e, t) => C((n, i2) => n.endsWith(i2), r4, e, t), contains: (r4, e, t) => C((n, i2) => n.includes(i2), r4, e, t), upper: (r4, e) => C((t) => t.toUpperCase(), r4, e), lower: (r4, e) => C((t) => t.toLowerCase(), r4, e), replace: (r4, e, t, n) => C((i2, o, s) => i2.replaceAll(o, s), r4, e, t, n), matches: (r4, e, t) => C((n, i2) => !!new RegExp(i2).exec(n), r4, e, t), replaceMatches: (r4, e, t, n) => C((i2, o, s) => i2.replaceAll(o, s), r4, e, t, n), length: (r4, e) => C((t) => t.length, r4, e), toChars: (r4, e) => C((t) => t ? t.split("") : void 0, r4, e), abs: (r4, e) => U(Math.abs, r4, e), ceiling: (r4, e) => U(Math.ceil, r4, e), exp: (r4, e) => U(Math.exp, r4, e), floor: (r4, e) => U(Math.floor, r4, e), ln: (r4, e) => U(Math.log, r4, e), log: (r4, e, t) => U((n, i2) => Math.log(n) / Math.log(i2), r4, e, t), power: (r4, e, t) => U(Math.pow, r4, e, t), round: (r4, e) => U(Math.round, r4, e), sqrt: (r4, e) => U(Math.sqrt, r4, e), truncate: (r4, e) => U((t) => t | 0, r4, e), children: de, descendants: de, trace: (r4, e, t) => (console.log("trace", e, t), e), now: () => [{ type: "dateTime", value: (/* @__PURE__ */ new Date()).toISOString() }], timeOfDay: () => [{ type: "time", value: (/* @__PURE__ */ new Date()).toISOString().substring(11) }], today: () => [{ type: "date", value: (/* @__PURE__ */ new Date()).toISOString().substring(0, 10) }], between: (r4, e, t, n, i2) => {
4117
4116
  let o = S.toDateTime(r4, t.eval(r4, e));
4118
4117
  if (o.length === 0)
4119
4118
  throw new Error("Invalid start date");
@@ -4123,11 +4122,11 @@ var S = { empty: (r4, e) => d(e.length === 0), exists: (r4, e, t) => t ? d(e.fil
4123
4122
  let a = i2.eval(r4, e)[0]?.value;
4124
4123
  if (a !== "years" && a !== "months" && a !== "days")
4125
4124
  throw new Error("Invalid units");
4126
- let c2 = Te(o[0].value, s[0].value);
4125
+ let c2 = Re(o[0].value, s[0].value);
4127
4126
  return [{ type: "Quantity", value: { value: c2[a], unit: a } }];
4128
4127
  }, is: (r4, e, t) => {
4129
4128
  let n = "";
4130
- return t instanceof M ? n = t.name : t instanceof Q && (n = t.left.name + "." + t.right.name), n ? e.map((i2) => ({ type: "boolean", value: Ce(i2, n) })) : [];
4129
+ return t instanceof N ? n = t.name : t instanceof Q && (n = t.left.name + "." + t.right.name), n ? e.map((i2) => ({ type: "boolean", value: we(i2, n) })) : [];
4131
4130
  }, not: (r4, e) => S.toBoolean(r4, e).map((t) => ({ type: "boolean", value: !t.value })), resolve: (r4, e) => e.map((t) => {
4132
4131
  let n = t.value, i2;
4133
4132
  if (typeof n == "string")
@@ -4147,7 +4146,7 @@ var S = { empty: (r4, e) => d(e.length === 0), exists: (r4, e, t) => t ? d(e.fil
4147
4146
  return { type: o, value: { resourceType: o, id: s } };
4148
4147
  }
4149
4148
  return { type: "BackboneElement", value: void 0 };
4150
- }).filter((t) => !!t.value), as: (r4, e) => e, type: (r4, e) => e.map(({ value: t }) => typeof t == "boolean" ? { type: "BackboneElement", value: { namespace: "System", name: "Boolean" } } : typeof t == "number" ? { type: "BackboneElement", value: { namespace: "System", name: "Integer" } } : L(t) ? { type: "BackboneElement", value: { namespace: "FHIR", name: t.resourceType } } : { type: "BackboneElement", value: null }), conformsTo: (r4, e, t) => {
4149
+ }).filter((t) => !!t.value), as: (r4, e) => e, type: (r4, e) => e.map(({ value: t }) => typeof t == "boolean" ? { type: "BackboneElement", value: { namespace: "System", name: "Boolean" } } : typeof t == "number" ? { type: "BackboneElement", value: { namespace: "System", name: "Integer" } } : O(t) ? { type: "BackboneElement", value: { namespace: "FHIR", name: t.resourceType } } : { type: "BackboneElement", value: null }), conformsTo: (r4, e, t) => {
4151
4150
  let n = t.eval(r4, e)[0].value;
4152
4151
  if (!n.startsWith("http://hl7.org/fhir/StructureDefinition/"))
4153
4152
  throw new Error("Expected a StructureDefinition URL");
@@ -4157,22 +4156,22 @@ var S = { empty: (r4, e) => d(e.length === 0), exists: (r4, e, t) => t ? d(e.fil
4157
4156
  function C(r4, e, t, ...n) {
4158
4157
  if (t.length === 0)
4159
4158
  return [];
4160
- let [{ value: i2 }] = U(t, 1);
4159
+ let [{ value: i2 }] = L(t, 1);
4161
4160
  if (typeof i2 != "string")
4162
4161
  throw new Error("String function cannot be called with non-string");
4163
4162
  let o = r4(i2, ...n.map((s) => s?.eval(e, t)[0]?.value));
4164
4163
  return o === void 0 ? [] : Array.isArray(o) ? o.map(x) : [x(o)];
4165
4164
  }
4166
- function V(r4, e, t, ...n) {
4165
+ function U(r4, e, t, ...n) {
4167
4166
  if (t.length === 0)
4168
4167
  return [];
4169
- let [{ value: i2 }] = U(t, 1), o = A(i2), s = o ? i2.value : i2;
4168
+ let [{ value: i2 }] = L(t, 1), o = A(i2), s = o ? i2.value : i2;
4170
4169
  if (typeof s != "number")
4171
4170
  throw new Error("Math function cannot be called with non-number");
4172
4171
  let a = r4(s, ...n.map((l2) => l2.eval(e, t)[0]?.value)), c2 = o ? "Quantity" : t[0].type, f = o ? { ...i2, value: a } : a;
4173
4172
  return [{ type: c2, value: f }];
4174
4173
  }
4175
- function U(r4, e) {
4174
+ function L(r4, e) {
4176
4175
  if (r4.length !== e)
4177
4176
  throw new Error(`Expected ${e} arguments`);
4178
4177
  for (let t of r4)
@@ -4192,7 +4191,7 @@ var I = class {
4192
4191
  return typeof e == "string" ? `'${e}'` : e.toString();
4193
4192
  }
4194
4193
  };
4195
- var M = class {
4194
+ var N = class {
4196
4195
  constructor(e) {
4197
4196
  this.name = e;
4198
4197
  }
@@ -4210,13 +4209,13 @@ var M = class {
4210
4209
  evalValue(e) {
4211
4210
  let t = e.value;
4212
4211
  if (!(!t || typeof t != "object"))
4213
- return L(t) && t.resourceType === this.name ? e : E(e, this.name);
4212
+ return O(t) && t.resourceType === this.name ? e : E(e, this.name);
4214
4213
  }
4215
4214
  toString() {
4216
4215
  return this.name;
4217
4216
  }
4218
4217
  };
4219
- var Ie = class {
4218
+ var ke = class {
4220
4219
  eval() {
4221
4220
  return [];
4222
4221
  }
@@ -4224,7 +4223,7 @@ var Ie = class {
4224
4223
  return "{}";
4225
4224
  }
4226
4225
  };
4227
- var ke = class extends Ae {
4226
+ var De = class extends Ee {
4228
4227
  constructor(t, n, i2) {
4229
4228
  super(t, n);
4230
4229
  this.impl = i2;
@@ -4236,7 +4235,7 @@ var ke = class extends Ae {
4236
4235
  return this.operator + this.child.toString();
4237
4236
  }
4238
4237
  };
4239
- var K = class extends j {
4238
+ var J = class extends j {
4240
4239
  constructor(e, t) {
4241
4240
  super("as", e, t);
4242
4241
  }
@@ -4262,7 +4261,7 @@ var P = class extends v {
4262
4261
  return typeof l2 == "boolean" ? d(l2) : A(s) ? [{ type: "Quantity", value: { ...s, value: l2 } }] : [x(l2)];
4263
4262
  }
4264
4263
  };
4265
- var De = class extends j {
4264
+ var Oe = class extends j {
4266
4265
  constructor(e, t) {
4267
4266
  super("&", e, t);
4268
4267
  }
@@ -4271,7 +4270,7 @@ var De = class extends j {
4271
4270
  return o.length > 0 && o.every((s) => typeof s.value == "string") ? [{ type: "string", value: o.map((s) => s.value).join("") }] : o;
4272
4271
  }
4273
4272
  };
4274
- var Oe = class extends v {
4273
+ var Ve = class extends v {
4275
4274
  constructor(e, t) {
4276
4275
  super("contains", e, t);
4277
4276
  }
@@ -4280,12 +4279,12 @@ var Oe = class extends v {
4280
4279
  return d(n.some((o) => o.value === i2[0].value));
4281
4280
  }
4282
4281
  };
4283
- var Ve = class extends v {
4282
+ var Ue = class extends v {
4284
4283
  constructor(e, t) {
4285
4284
  super("in", e, t);
4286
4285
  }
4287
4286
  eval(e, t) {
4288
- let n = O(this.left.eval(e, t)), i2 = this.right.eval(e, t);
4287
+ let n = V(this.left.eval(e, t)), i2 = this.right.eval(e, t);
4289
4288
  return n ? d(i2.some((o) => o.value === n.value)) : [];
4290
4289
  }
4291
4290
  };
@@ -4300,40 +4299,40 @@ var Q = class extends j {
4300
4299
  return `${this.left.toString()}.${this.right.toString()}`;
4301
4300
  }
4302
4301
  };
4303
- var re = class extends j {
4302
+ var ne = class extends j {
4304
4303
  constructor(e, t) {
4305
4304
  super("|", e, t);
4306
4305
  }
4307
4306
  eval(e, t) {
4308
4307
  let n = this.left.eval(e, t), i2 = this.right.eval(e, t);
4309
- return Pe([...n, ...i2]);
4308
+ return Ce([...n, ...i2]);
4310
4309
  }
4311
4310
  };
4312
- var Ue = class extends v {
4311
+ var Le = class extends v {
4313
4312
  constructor(e, t) {
4314
4313
  super("=", e, t);
4315
4314
  }
4316
4315
  eval(e, t) {
4317
4316
  let n = this.left.eval(e, t), i2 = this.right.eval(e, t);
4318
- return mt(n, i2);
4317
+ return yt(n, i2);
4319
4318
  }
4320
4319
  };
4321
- var Le = class extends v {
4320
+ var _e = class extends v {
4322
4321
  constructor(e, t) {
4323
4322
  super("!=", e, t);
4324
4323
  }
4325
4324
  eval(e, t) {
4326
4325
  let n = this.left.eval(e, t), i2 = this.right.eval(e, t);
4327
- return ht(mt(n, i2));
4326
+ return ht(yt(n, i2));
4328
4327
  }
4329
4328
  };
4330
- var _e = class extends v {
4329
+ var Ne = class extends v {
4331
4330
  constructor(e, t) {
4332
4331
  super("~", e, t);
4333
4332
  }
4334
4333
  eval(e, t) {
4335
4334
  let n = this.left.eval(e, t), i2 = this.right.eval(e, t);
4336
- return yt(n, i2);
4335
+ return gt(n, i2);
4337
4336
  }
4338
4337
  };
4339
4338
  var Me = class extends v {
@@ -4342,10 +4341,10 @@ var Me = class extends v {
4342
4341
  }
4343
4342
  eval(e, t) {
4344
4343
  let n = this.left.eval(e, t), i2 = this.right.eval(e, t);
4345
- return ht(yt(n, i2));
4344
+ return ht(gt(n, i2));
4346
4345
  }
4347
4346
  };
4348
- var J = class extends v {
4347
+ var Y = class extends v {
4349
4348
  constructor(e, t) {
4350
4349
  super("is", e, t);
4351
4350
  }
@@ -4354,46 +4353,46 @@ var J = class extends v {
4354
4353
  if (n.length !== 1)
4355
4354
  return [];
4356
4355
  let i2 = this.right.name;
4357
- return d(Ce(n[0], i2));
4356
+ return d(we(n[0], i2));
4358
4357
  }
4359
4358
  };
4360
- var Ne = class extends v {
4359
+ var Be = class extends v {
4361
4360
  constructor(e, t) {
4362
4361
  super("and", e, t);
4363
4362
  }
4364
4363
  eval(e, t) {
4365
- let n = O(this.left.eval(e, t), "boolean"), i2 = O(this.right.eval(e, t), "boolean");
4364
+ let n = V(this.left.eval(e, t), "boolean"), i2 = V(this.right.eval(e, t), "boolean");
4366
4365
  return n?.value === true && i2?.value === true ? d(true) : n?.value === false || i2?.value === false ? d(false) : [];
4367
4366
  }
4368
4367
  };
4369
- var Be = class extends v {
4368
+ var Fe = class extends v {
4370
4369
  constructor(e, t) {
4371
4370
  super("or", e, t);
4372
4371
  }
4373
4372
  eval(e, t) {
4374
- let n = O(this.left.eval(e, t), "boolean"), i2 = O(this.right.eval(e, t), "boolean");
4373
+ let n = V(this.left.eval(e, t), "boolean"), i2 = V(this.right.eval(e, t), "boolean");
4375
4374
  return n?.value === false && i2?.value === false ? d(false) : n?.value || i2?.value ? d(true) : [];
4376
4375
  }
4377
4376
  };
4378
- var Fe = class extends v {
4377
+ var qe = class extends v {
4379
4378
  constructor(e, t) {
4380
4379
  super("xor", e, t);
4381
4380
  }
4382
4381
  eval(e, t) {
4383
- let n = O(this.left.eval(e, t), "boolean"), i2 = O(this.right.eval(e, t), "boolean");
4382
+ let n = V(this.left.eval(e, t), "boolean"), i2 = V(this.right.eval(e, t), "boolean");
4384
4383
  return !n || !i2 ? [] : d(n.value !== i2.value);
4385
4384
  }
4386
4385
  };
4387
- var qe = class extends v {
4386
+ var je = class extends v {
4388
4387
  constructor(e, t) {
4389
4388
  super("implies", e, t);
4390
4389
  }
4391
4390
  eval(e, t) {
4392
- let n = O(this.left.eval(e, t), "boolean"), i2 = O(this.right.eval(e, t), "boolean");
4391
+ let n = V(this.left.eval(e, t), "boolean"), i2 = V(this.right.eval(e, t), "boolean");
4393
4392
  return i2?.value === true || n?.value === false ? d(true) : !n || !i2 ? [] : d(false);
4394
4393
  }
4395
4394
  };
4396
- var N = class {
4395
+ var M = class {
4397
4396
  constructor(e, t) {
4398
4397
  this.name = e;
4399
4398
  this.args = t;
@@ -4408,7 +4407,7 @@ var N = class {
4408
4407
  return `${this.name}(${this.args.map((e) => e.toString()).join(", ")})`;
4409
4408
  }
4410
4409
  };
4411
- var Y = class {
4410
+ var X = class {
4412
4411
  constructor(e, t) {
4413
4412
  this.left = e;
4414
4413
  this.expr = t;
@@ -4429,58 +4428,59 @@ var Y = class {
4429
4428
  };
4430
4429
  var pe = ["!=", "!~", "<=", ">=", "{}", "->"];
4431
4430
  var p = { 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 };
4432
- var Gn = { parse(r4) {
4431
+ var Bn = { parse(r4) {
4433
4432
  let e = r4.consumeAndParse();
4434
4433
  if (!r4.match(")"))
4435
4434
  throw new Error("Parse error: expected `)` got `" + r4.peek()?.value + "`");
4436
4435
  return e;
4437
4436
  } };
4438
- var zn = { parse(r4, e) {
4437
+ var Fn = { parse(r4, e) {
4439
4438
  let t = r4.consumeAndParse();
4440
4439
  if (!r4.match("]"))
4441
4440
  throw new Error("Parse error: expected `]`");
4442
- return new Y(e, t);
4441
+ return new X(e, t);
4443
4442
  }, precedence: p.Indexer };
4444
- var Kn = { parse(r4, e) {
4445
- if (!(e instanceof M))
4443
+ var qn = { parse(r4, e) {
4444
+ if (!(e instanceof N))
4446
4445
  throw new Error("Unexpected parentheses");
4447
4446
  let t = [];
4448
4447
  for (; !r4.match(")"); )
4449
4448
  t.push(r4.consumeAndParse()), r4.match(",");
4450
- return new N(e.name, t);
4449
+ return new M(e.name, t);
4451
4450
  }, precedence: p.FunctionCall };
4452
- function Jn(r4) {
4451
+ function jn(r4) {
4453
4452
  let e = r4.split(" "), t = parseFloat(e[0]), n = e[1];
4454
4453
  return n?.startsWith("'") && n.endsWith("'") ? n = n.substring(1, n.length - 1) : n = "{" + n + "}", { value: t, unit: n };
4455
4454
  }
4456
4455
  function fe() {
4457
- return new Ee().registerPrefix("String", { parse: (r4, e) => new I({ type: "string", value: e.value }) }).registerPrefix("DateTime", { parse: (r4, e) => new I({ type: "dateTime", value: te(e.value) }) }).registerPrefix("Quantity", { parse: (r4, e) => new I({ type: "Quantity", value: Jn(e.value) }) }).registerPrefix("Number", { parse: (r4, e) => new I({ type: "decimal", value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new I({ type: "boolean", value: true }) }).registerPrefix("false", { parse: () => new I({ type: "boolean", value: false }) }).registerPrefix("Symbol", { parse: (r4, e) => new M(e.value) }).registerPrefix("{}", { parse: () => new Ie() }).registerPrefix("(", Gn).registerInfix("[", zn).registerInfix("(", Kn).prefix("+", p.UnaryAdd, (r4, e) => new ke("+", e, (t) => t)).prefix("-", p.UnarySubtract, (r4, e) => new P("-", e, e, (t, n) => -n)).infixLeft(".", p.Dot, (r4, e, t) => new Q(r4, t)).infixLeft("/", p.Divide, (r4, e, t) => new P("/", r4, t, (n, i2) => n / i2)).infixLeft("*", p.Multiply, (r4, e, t) => new P("*", r4, t, (n, i2) => n * i2)).infixLeft("+", p.Add, (r4, e, t) => new P("+", r4, t, (n, i2) => n + i2)).infixLeft("-", p.Subtract, (r4, e, t) => new P("-", r4, t, (n, i2) => n - i2)).infixLeft("|", p.Union, (r4, e, t) => new re(r4, t)).infixLeft("=", p.Equals, (r4, e, t) => new Ue(r4, t)).infixLeft("!=", p.NotEquals, (r4, e, t) => new Le(r4, t)).infixLeft("~", p.Equivalent, (r4, e, t) => new _e(r4, t)).infixLeft("!~", p.NotEquivalent, (r4, e, t) => new Me(r4, t)).infixLeft("<", p.LessThan, (r4, e, t) => new P("<", r4, t, (n, i2) => n < i2)).infixLeft("<=", p.LessThanOrEquals, (r4, e, t) => new P("<=", r4, t, (n, i2) => n <= i2)).infixLeft(">", p.GreaterThan, (r4, e, t) => new P(">", r4, t, (n, i2) => n > i2)).infixLeft(">=", p.GreaterThanOrEquals, (r4, e, t) => new P(">=", r4, t, (n, i2) => n >= i2)).infixLeft("&", p.Ampersand, (r4, e, t) => new De(r4, t)).infixLeft("and", p.And, (r4, e, t) => new Ne(r4, t)).infixLeft("as", p.As, (r4, e, t) => new K(r4, t)).infixLeft("contains", p.Contains, (r4, e, t) => new Oe(r4, t)).infixLeft("div", p.Divide, (r4, e, t) => new P("div", r4, t, (n, i2) => n / i2 | 0)).infixLeft("in", p.In, (r4, e, t) => new Ve(r4, t)).infixLeft("is", p.Is, (r4, e, t) => new J(r4, t)).infixLeft("mod", p.Modulo, (r4, e, t) => new P("mod", r4, t, (n, i2) => n % i2)).infixLeft("or", p.Or, (r4, e, t) => new Be(r4, t)).infixLeft("xor", p.Xor, (r4, e, t) => new Fe(r4, t)).infixLeft("implies", p.Implies, (r4, e, t) => new qe(r4, t));
4456
+ return new Pe().registerPrefix("String", { parse: (r4, e) => new I({ type: "string", value: e.value }) }).registerPrefix("DateTime", { parse: (r4, e) => new I({ type: "dateTime", value: re(e.value) }) }).registerPrefix("Quantity", { parse: (r4, e) => new I({ type: "Quantity", value: jn(e.value) }) }).registerPrefix("Number", { parse: (r4, e) => new I({ type: "decimal", value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new I({ type: "boolean", value: true }) }).registerPrefix("false", { parse: () => new I({ type: "boolean", value: false }) }).registerPrefix("Symbol", { parse: (r4, e) => new N(e.value) }).registerPrefix("{}", { parse: () => new ke() }).registerPrefix("(", Bn).registerInfix("[", Fn).registerInfix("(", qn).prefix("+", p.UnaryAdd, (r4, e) => new De("+", e, (t) => t)).prefix("-", p.UnarySubtract, (r4, e) => new P("-", e, e, (t, n) => -n)).infixLeft(".", p.Dot, (r4, e, t) => new Q(r4, t)).infixLeft("/", p.Divide, (r4, e, t) => new P("/", r4, t, (n, i2) => n / i2)).infixLeft("*", p.Multiply, (r4, e, t) => new P("*", r4, t, (n, i2) => n * i2)).infixLeft("+", p.Add, (r4, e, t) => new P("+", r4, t, (n, i2) => n + i2)).infixLeft("-", p.Subtract, (r4, e, t) => new P("-", r4, t, (n, i2) => n - i2)).infixLeft("|", p.Union, (r4, e, t) => new ne(r4, t)).infixLeft("=", p.Equals, (r4, e, t) => new Le(r4, t)).infixLeft("!=", p.NotEquals, (r4, e, t) => new _e(r4, t)).infixLeft("~", p.Equivalent, (r4, e, t) => new Ne(r4, t)).infixLeft("!~", p.NotEquivalent, (r4, e, t) => new Me(r4, t)).infixLeft("<", p.LessThan, (r4, e, t) => new P("<", r4, t, (n, i2) => n < i2)).infixLeft("<=", p.LessThanOrEquals, (r4, e, t) => new P("<=", r4, t, (n, i2) => n <= i2)).infixLeft(">", p.GreaterThan, (r4, e, t) => new P(">", r4, t, (n, i2) => n > i2)).infixLeft(">=", p.GreaterThanOrEquals, (r4, e, t) => new P(">=", r4, t, (n, i2) => n >= i2)).infixLeft("&", p.Ampersand, (r4, e, t) => new Oe(r4, t)).infixLeft("and", p.And, (r4, e, t) => new Be(r4, t)).infixLeft("as", p.As, (r4, e, t) => new J(r4, t)).infixLeft("contains", p.Contains, (r4, e, t) => new Ve(r4, t)).infixLeft("div", p.Divide, (r4, e, t) => new P("div", r4, t, (n, i2) => n / i2 | 0)).infixLeft("in", p.In, (r4, e, t) => new Ue(r4, t)).infixLeft("is", p.Is, (r4, e, t) => new Y(r4, t)).infixLeft("mod", p.Modulo, (r4, e, t) => new P("mod", r4, t, (n, i2) => n % i2)).infixLeft("or", p.Or, (r4, e, t) => new Fe(r4, t)).infixLeft("xor", p.Xor, (r4, e, t) => new qe(r4, t)).infixLeft("implies", p.Implies, (r4, e, t) => new je(r4, t));
4458
4457
  }
4459
- var Yn = fe();
4460
- var Sr = ((l2) => (l2.BOOLEAN = "BOOLEAN", l2.NUMBER = "NUMBER", l2.QUANTITY = "QUANTITY", l2.TEXT = "TEXT", l2.REFERENCE = "REFERENCE", l2.CANONICAL = "CANONICAL", l2.DATE = "DATE", l2.DATETIME = "DATETIME", l2.PERIOD = "PERIOD", l2.UUID = "UUID", l2))(Sr || {});
4461
- var fi = ((T) => (T.READ = "read", T.VREAD = "vread", T.UPDATE = "update", T.PATCH = "patch", T.DELETE = "delete", T.HISTORY = "history", T.HISTORY_INSTANCE = "history-instance", T.HISTORY_TYPE = "history-type", T.HISTORY_SYSTEM = "history-system", T.CREATE = "create", T.SEARCH = "search", T.SEARCH_TYPE = "search-type", T.SEARCH_SYSTEM = "search-system", T.SEARCH_COMPARTMENT = "search-compartment", T.CAPABILITIES = "capabilities", T.TRANSACTION = "transaction", T.BATCH = "batch", T.OPERATION = "operation", T))(fi || {});
4462
- function Ir(r4) {
4458
+ var $n = fe();
4459
+ var Qn = ((g) => (g.EQUALS = "eq", g.NOT_EQUALS = "ne", g.GREATER_THAN = "gt", g.LESS_THAN = "lt", g.GREATER_THAN_OR_EQUALS = "ge", g.LESS_THAN_OR_EQUALS = "le", g.STARTS_AFTER = "sa", g.ENDS_BEFORE = "eb", g.APPROXIMATELY = "ap", g.CONTAINS = "contains", g.EXACT = "exact", g.TEXT = "text", g.NOT = "not", g.ABOVE = "above", g.BELOW = "below", g.IN = "in", g.NOT_IN = "not-in", g.OF_TYPE = "of-type", g.MISSING = "missing", g.IDENTIFIER = "identifier", g.ITERATE = "iterate", g))(Qn || {});
4460
+ var Ar = ((l2) => (l2.BOOLEAN = "BOOLEAN", l2.NUMBER = "NUMBER", l2.QUANTITY = "QUANTITY", l2.TEXT = "TEXT", l2.REFERENCE = "REFERENCE", l2.CANONICAL = "CANONICAL", l2.DATE = "DATE", l2.DATETIME = "DATETIME", l2.PERIOD = "PERIOD", l2.UUID = "UUID", l2))(Ar || {});
4461
+ var gi = ((T) => (T.READ = "read", T.VREAD = "vread", T.UPDATE = "update", T.PATCH = "patch", T.DELETE = "delete", T.HISTORY = "history", T.HISTORY_INSTANCE = "history-instance", T.HISTORY_TYPE = "history-type", T.HISTORY_SYSTEM = "history-system", T.CREATE = "create", T.SEARCH = "search", T.SEARCH_TYPE = "search-type", T.SEARCH_SYSTEM = "search-system", T.SEARCH_COMPARTMENT = "search-compartment", T.CAPABILITIES = "capabilities", T.TRANSACTION = "transaction", T.BATCH = "batch", T.OPERATION = "operation", T))(gi || {});
4462
+ function Dr(r4) {
4463
4463
  if (typeof window < "u")
4464
4464
  return window.atob(r4);
4465
4465
  if (typeof Buffer < "u")
4466
4466
  return Buffer.from(r4, "base64").toString("binary");
4467
4467
  throw new Error("Unable to decode base64");
4468
4468
  }
4469
- function kr(r4) {
4469
+ function Or(r4) {
4470
4470
  if (typeof window < "u")
4471
4471
  return window.btoa(r4);
4472
4472
  if (typeof Buffer < "u")
4473
4473
  return Buffer.from(r4, "binary").toString("base64");
4474
4474
  throw new Error("Unable to encode base64");
4475
4475
  }
4476
- function bt() {
4476
+ function Et() {
4477
4477
  let r4 = new Uint32Array(28);
4478
- return crypto.getRandomValues(r4), ir(r4.buffer);
4478
+ return crypto.getRandomValues(r4), or(r4.buffer);
4479
4479
  }
4480
- async function Dr(r4) {
4480
+ async function Vr(r4) {
4481
4481
  return crypto.subtle.digest("SHA-256", new TextEncoder().encode(r4));
4482
4482
  }
4483
- var $e = class {
4483
+ var He = class {
4484
4484
  constructor(e = 10) {
4485
4485
  this.max = e, this.cache = /* @__PURE__ */ new Map();
4486
4486
  }
@@ -4504,8 +4504,8 @@ var $e = class {
4504
4504
  return this.cache.keys().next().value;
4505
4505
  }
4506
4506
  };
4507
- var X = { CSS: "text/css", FAVICON: "image/vnd.microsoft.icon", FHIR_JSON: "application/fhir+json", FORM_URL_ENCODED: "application/x-www-form-urlencoded", HL7_V2: "x-application/hl7-v2+er7", HTML: "text/html", JAVASCRIPT: "text/javascript", JSON: "application/json", JSON_PATCH: "application/json-patch+json", PNG: "image/png", SVG: "image/svg+xml", TEXT: "text/plain", TYPESCRIPT: "text/typescript" };
4508
- var Qe = class {
4507
+ var Z = { CSS: "text/css", FAVICON: "image/vnd.microsoft.icon", FHIR_JSON: "application/fhir+json", FORM_URL_ENCODED: "application/x-www-form-urlencoded", HL7_V2: "x-application/hl7-v2+er7", HTML: "text/html", JAVASCRIPT: "text/javascript", JSON: "application/json", JSON_PATCH: "application/json-patch+json", PNG: "image/png", SVG: "image/svg+xml", TEXT: "text/plain", TYPESCRIPT: "text/typescript" };
4508
+ var We = class {
4509
4509
  constructor() {
4510
4510
  this.listeners = {};
4511
4511
  }
@@ -4527,31 +4527,31 @@ var Qe = class {
4527
4527
  return t && t.forEach((n) => n.call(this, e)), !e.defaultPrevented;
4528
4528
  }
4529
4529
  };
4530
- function Si(r4) {
4531
- let e = r4.replace(/-/g, "+").replace(/_/g, "/"), t = Ir(e), n = Array.from(t).reduce((o, s) => {
4530
+ function Pi(r4) {
4531
+ let e = r4.replace(/-/g, "+").replace(/_/g, "/"), t = Dr(e), n = Array.from(t).reduce((o, s) => {
4532
4532
  let a = ("00" + s.charCodeAt(0).toString(16)).slice(-2);
4533
4533
  return `${o}%${a}`;
4534
4534
  }, ""), i2 = decodeURIComponent(n);
4535
4535
  return JSON.parse(i2);
4536
4536
  }
4537
- function Vr(r4) {
4537
+ function Lr(r4) {
4538
4538
  return r4.split(".").length === 3;
4539
4539
  }
4540
- function Et(r4) {
4540
+ function Ct(r4) {
4541
4541
  let [e, t, n] = r4.split(".");
4542
- return Si(t);
4542
+ return Pi(t);
4543
4543
  }
4544
- function Ur(r4) {
4544
+ function _r(r4) {
4545
4545
  try {
4546
- return typeof Et(r4).login_id == "string";
4546
+ return typeof Ct(r4).login_id == "string";
4547
4547
  } catch {
4548
4548
  return false;
4549
4549
  }
4550
4550
  }
4551
- var bi;
4551
+ var Ci;
4552
4552
  var w = class {
4553
4553
  constructor(e) {
4554
- this[bi] = "ReadablePromise";
4554
+ this[Ci] = "ReadablePromise";
4555
4555
  this.status = "pending";
4556
4556
  this.suspender = e.then((t) => (this.status = "success", this.response = t, t), (t) => {
4557
4557
  throw this.status = "error", this.error = t, t;
@@ -4583,10 +4583,10 @@ var w = class {
4583
4583
  return this.suspender.finally(e);
4584
4584
  }
4585
4585
  };
4586
- bi = Symbol.toStringTag;
4587
- var He = class {
4586
+ Ci = Symbol.toStringTag;
4587
+ var Ge = class {
4588
4588
  constructor() {
4589
- this.storage = typeof localStorage < "u" ? localStorage : new Pt();
4589
+ this.storage = typeof localStorage < "u" ? localStorage : new wt();
4590
4590
  }
4591
4591
  clear() {
4592
4592
  this.storage.clear();
@@ -4602,10 +4602,10 @@ var He = class {
4602
4602
  return t ? JSON.parse(t) : void 0;
4603
4603
  }
4604
4604
  setObject(e, t) {
4605
- this.setString(e, t ? tr(t) : void 0);
4605
+ this.setString(e, t ? rr(t) : void 0);
4606
4606
  }
4607
4607
  };
4608
- var Pt = class {
4608
+ var wt = class {
4609
4609
  constructor() {
4610
4610
  this.data = /* @__PURE__ */ new Map();
4611
4611
  }
@@ -4628,20 +4628,20 @@ var Pt = class {
4628
4628
  return Array.from(this.data.keys())[e];
4629
4629
  }
4630
4630
  };
4631
- var Ai = "https://api.medplum.com/";
4632
- var Ei = 1e3;
4633
- var Pi = 6e4;
4634
- var Lr = "Binary/";
4635
- var _r = { resourceType: "Device", id: "system", deviceName: [{ name: "System" }] };
4636
- var Ci = ((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))(Ci || {});
4637
- var wi = ((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))(wi || {});
4638
- var Ii = ((e) => (e.JwtBearer = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", e))(Ii || {});
4639
- var Mr = class extends Qe {
4631
+ var wi = "https://api.medplum.com/";
4632
+ var Ii = 1e3;
4633
+ var ki = 6e4;
4634
+ var Nr = "Binary/";
4635
+ var Mr = { resourceType: "Device", id: "system", deviceName: [{ name: "System" }] };
4636
+ var Di = ((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))(Di || {});
4637
+ var Oi = ((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))(Oi || {});
4638
+ var Vi = ((e) => (e.JwtBearer = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", e))(Vi || {});
4639
+ var Br = class extends We {
4640
4640
  constructor(t) {
4641
4641
  super();
4642
4642
  if (t?.baseUrl && !t.baseUrl.startsWith("http"))
4643
4643
  throw new Error("Base URL must start with http or https");
4644
- this.options = t ?? {}, this.fetch = t?.fetch ?? ki(), this.storage = t?.storage ?? new He(), this.createPdfImpl = t?.createPdf, this.baseUrl = Br(t?.baseUrl ?? Ai), this.fhirBaseUrl = Br(We(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4/")), this.authorizeUrl = We(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = We(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = We(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.onUnauthenticated = t?.onUnauthenticated, this.cacheTime = t?.cacheTime ?? Pi, this.cacheTime > 0 ? this.requestCache = new $e(t?.resourceCacheSize ?? Ei) : this.requestCache = void 0, t?.autoBatchTime ? (this.autoBatchTime = t.autoBatchTime, this.autoBatchQueue = []) : (this.autoBatchTime = 0, this.autoBatchQueue = void 0);
4644
+ this.options = t ?? {}, this.fetch = t?.fetch ?? Ui(), this.storage = t?.storage ?? new Ge(), this.createPdfImpl = t?.createPdf, this.baseUrl = qr(t?.baseUrl ?? wi), this.fhirBaseUrl = qr(ze(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4/")), this.authorizeUrl = ze(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = ze(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = ze(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.onUnauthenticated = t?.onUnauthenticated, this.cacheTime = t?.cacheTime ?? ki, this.cacheTime > 0 ? this.requestCache = new He(t?.resourceCacheSize ?? Ii) : this.requestCache = void 0, t?.autoBatchTime ? (this.autoBatchTime = t.autoBatchTime, this.autoBatchQueue = []) : (this.autoBatchTime = 0, this.autoBatchQueue = void 0);
4645
4645
  let n = this.getActiveLogin();
4646
4646
  n && (this.setAccessToken(n.accessToken, n.refreshToken), this.refreshProfile().catch(console.log)), this.setupStorageListener();
4647
4647
  }
@@ -4694,7 +4694,7 @@ var Mr = class extends Qe {
4694
4694
  return t = t.toString(), this.setRequestBody(o, n), i2 && this.setRequestContentType(o, i2), this.invalidateUrl(t), this.request("PUT", t, o);
4695
4695
  }
4696
4696
  patch(t, n, i2 = {}) {
4697
- return t = t.toString(), this.setRequestBody(i2, n), this.setRequestContentType(i2, X.JSON_PATCH), this.invalidateUrl(t), this.request("PATCH", t, i2);
4697
+ return t = t.toString(), this.setRequestBody(i2, n), this.setRequestContentType(i2, Z.JSON_PATCH), this.invalidateUrl(t), this.request("PATCH", t, i2);
4698
4698
  }
4699
4699
  delete(t, n) {
4700
4700
  return t = t.toString(), this.invalidateUrl(t), this.request("DELETE", t, n);
@@ -4782,7 +4782,7 @@ var Mr = class extends Qe {
4782
4782
  let s = this.fhirSearchUrl(t, n).toString() + "-searchResources", a = this.getCacheEntry(s, i2);
4783
4783
  if (a)
4784
4784
  return a.value;
4785
- let c2 = new w(this.search(t, n, i2).then(qr));
4785
+ let c2 = new w(this.search(t, n, i2).then($r));
4786
4786
  return this.setCacheEntry(s, c2), c2;
4787
4787
  }
4788
4788
  async *searchResourcePages(t, n, i2) {
@@ -4791,7 +4791,7 @@ var Mr = class extends Qe {
4791
4791
  let s = new URL(o).searchParams, a = await this.search(t, s, i2), c2 = a.link?.find((f) => f.relation === "next");
4792
4792
  if (!a.entry?.length && !c2)
4793
4793
  break;
4794
- yield qr(a), o = c2?.url ? new URL(c2.url) : void 0;
4794
+ yield $r(a), o = c2?.url ? new URL(c2.url) : void 0;
4795
4795
  }
4796
4796
  }
4797
4797
  searchValueSet(t, n, i2) {
@@ -4807,7 +4807,7 @@ var Mr = class extends Qe {
4807
4807
  if (!n)
4808
4808
  return;
4809
4809
  if (n === "system")
4810
- return _r;
4810
+ return Mr;
4811
4811
  let [i2, o] = n.split("/");
4812
4812
  if (!(!i2 || !o))
4813
4813
  return this.getCached(i2, o);
@@ -4820,7 +4820,7 @@ var Mr = class extends Qe {
4820
4820
  if (!i2)
4821
4821
  return new w(Promise.reject(new Error("Missing reference")));
4822
4822
  if (i2 === "system")
4823
- return new w(Promise.resolve(_r));
4823
+ return new w(Promise.resolve(Mr));
4824
4824
  let [o, s] = i2.split("/");
4825
4825
  return !o || !s ? new w(Promise.reject(new Error("Invalid reference"))) : this.readResource(o, s, n);
4826
4826
  }
@@ -4864,9 +4864,9 @@ var Mr = class extends Qe {
4864
4864
  }
4865
4865
  }`.replace(/\s+/g, " "), a = await this.graphql(s);
4866
4866
  for (let c2 of a.data.StructureDefinitionList)
4867
- dt(c2);
4867
+ pt(c2);
4868
4868
  for (let c2 of a.data.SearchParameterList)
4869
- lt(c2);
4869
+ ft(c2);
4870
4870
  return y;
4871
4871
  })());
4872
4872
  return this.setCacheEntry(n, o), o;
@@ -4912,7 +4912,7 @@ var Mr = class extends Qe {
4912
4912
  }
4913
4913
  createComment(t, n, i2) {
4914
4914
  let o = this.getProfile(), s, a;
4915
- return t.resourceType === "Encounter" && (s = ae(t), a = t.subject), t.resourceType === "ServiceRequest" && (s = t.encounter, a = t.subject), t.resourceType === "Patient" && (a = ae(t)), this.createResource({ resourceType: "Communication", basedOn: [ae(t)], encounter: s, subject: a, sender: o ? ae(o) : void 0, sent: (/* @__PURE__ */ new Date()).toISOString(), payload: [{ contentString: n }] }, i2);
4915
+ return t.resourceType === "Encounter" && (s = G(t), a = t.subject), t.resourceType === "ServiceRequest" && (s = t.encounter, a = t.subject), t.resourceType === "Patient" && (a = G(t)), this.createResource({ resourceType: "Communication", basedOn: [G(t)], encounter: s, subject: a, sender: o ? G(o) : void 0, sent: (/* @__PURE__ */ new Date()).toISOString(), payload: [{ contentString: n }] }, i2);
4916
4916
  }
4917
4917
  async updateResource(t, n) {
4918
4918
  if (!t.resourceType)
@@ -4947,10 +4947,10 @@ var Mr = class extends Qe {
4947
4947
  return this.post(this.fhirBaseUrl.slice(0, -1), t, void 0, n);
4948
4948
  }
4949
4949
  sendEmail(t, n) {
4950
- return this.post("email/v1/send", t, X.JSON, n);
4950
+ return this.post("email/v1/send", t, Z.JSON, n);
4951
4951
  }
4952
4952
  graphql(t, n, i2, o) {
4953
- return this.post(this.fhirUrl("$graphql"), { query: t, operationName: n, variables: i2 }, X.JSON, o);
4953
+ return this.post(this.fhirUrl("$graphql"), { query: t, operationName: n, variables: i2 }, Z.JSON, o);
4954
4954
  }
4955
4955
  readResourceGraph(t, n, i2, o) {
4956
4956
  return this.get(`${this.fhirUrl(t, n)}/$graph?graph=${i2}`, o);
@@ -4968,7 +4968,7 @@ var Mr = class extends Qe {
4968
4968
  return this.accessToken;
4969
4969
  }
4970
4970
  setAccessToken(t, n) {
4971
- this.accessToken = t, this.refreshToken = n, this.sessionDetails = void 0, this.medplumServer = Ur(t);
4971
+ this.accessToken = t, this.refreshToken = n, this.sessionDetails = void 0, this.medplumServer = _r(t);
4972
4972
  }
4973
4973
  getLogins() {
4974
4974
  return this.storage.getObject("logins") ?? [];
@@ -5014,11 +5014,11 @@ var Mr = class extends Qe {
5014
5014
  async download(t, n = {}) {
5015
5015
  this.refreshPromise && await this.refreshPromise;
5016
5016
  let i2 = t.toString();
5017
- return i2.startsWith(Lr) && (t = this.fhirUrl(i2)), this.addFetchOptionsDefaults(n), (await this.fetchWithRetry(t.toString(), n)).blob();
5017
+ return i2.startsWith(Nr) && (t = this.fhirUrl(i2)), this.addFetchOptionsDefaults(n), (await this.fetchWithRetry(t.toString(), n)).blob();
5018
5018
  }
5019
5019
  async uploadMedia(t, n, i2, o, s) {
5020
5020
  let a = await this.createBinary(t, i2, n);
5021
- return this.createResource({ ...o, resourceType: "Media", content: { contentType: n, url: Lr + a.id, title: i2 } }, s);
5021
+ return this.createResource({ ...o, resourceType: "Media", content: { contentType: n, url: Nr + a.id, title: i2 } }, s);
5022
5022
  }
5023
5023
  async bulkExport(t = "", n, i2, o) {
5024
5024
  let s = t && `${t}/`, a = this.fhirUrl(`${s}$export`);
@@ -5030,7 +5030,7 @@ var Mr = class extends Qe {
5030
5030
  i2.Prefer = "respond-async";
5031
5031
  let o = await this.fetchWithRetry(t, n);
5032
5032
  if (o.status === 202) {
5033
- let s = await Fr(o);
5033
+ let s = await jr(o);
5034
5034
  if (s)
5035
5035
  return this.pollStatus(s);
5036
5036
  }
@@ -5064,7 +5064,7 @@ var Mr = class extends Qe {
5064
5064
  return;
5065
5065
  let a = t.headers.get("content-type")?.includes("json");
5066
5066
  if (t.status === 404 && !a)
5067
- throw new h(jt);
5067
+ throw new m(Qt);
5068
5068
  let c2 = t.headers.get("content-location"), f = o.redirect ?? this.options.redirect;
5069
5069
  if (t.status === 201 && c2 && f === "follow")
5070
5070
  return this.request("GET", c2, { ...o, body: void 0 });
@@ -5078,7 +5078,7 @@ var Mr = class extends Qe {
5078
5078
  else
5079
5079
  l2 = await t.text();
5080
5080
  if (t.status >= 400)
5081
- throw new h(nt(l2));
5081
+ throw new m(ot(l2));
5082
5082
  return l2;
5083
5083
  }
5084
5084
  async fetchWithRetry(t, n) {
@@ -5091,7 +5091,7 @@ var Mr = class extends Qe {
5091
5091
  } catch (c2) {
5092
5092
  this.retryCatch(a, i2, c2);
5093
5093
  }
5094
- await ut(o);
5094
+ await lt(o);
5095
5095
  }
5096
5096
  return s;
5097
5097
  }
@@ -5112,10 +5112,10 @@ var Mr = class extends Qe {
5112
5112
  this.addFetchOptionsDefaults(s);
5113
5113
  let a = await this.fetchWithRetry(t, s);
5114
5114
  if (a.status !== 202 && (n = false, i2 = a, a.status === 201)) {
5115
- let c2 = await Fr(a);
5115
+ let c2 = await jr(a);
5116
5116
  c2 && (i2 = await this.fetchWithRetry(c2, s));
5117
5117
  }
5118
- await ut(o);
5118
+ await lt(o);
5119
5119
  }
5120
5120
  return this.parseResponse(i2, "POST", t);
5121
5121
  }
@@ -5126,19 +5126,19 @@ var Mr = class extends Qe {
5126
5126
  try {
5127
5127
  o.resolve(await this.request(o.method, this.fhirBaseUrl + o.url, o.options));
5128
5128
  } catch (s) {
5129
- o.reject(new h(nt(s)));
5129
+ o.reject(new m(ot(s)));
5130
5130
  }
5131
5131
  return;
5132
5132
  }
5133
5133
  let n = { resourceType: "Bundle", type: "batch", entry: t.map((o) => ({ request: { method: o.method, url: o.url }, resource: o.options.body ? JSON.parse(o.options.body) : void 0 })) }, i2 = await this.post(this.fhirBaseUrl.slice(0, -1), n);
5134
5134
  for (let o = 0; o < t.length; o++) {
5135
5135
  let s = t[o], a = i2.entry?.[o];
5136
- a?.response?.outcome && !rt(a.response.outcome) ? s.reject(new h(a.response.outcome)) : s.resolve(a?.resource);
5136
+ a?.response?.outcome && !it(a.response.outcome) ? s.reject(new m(a.response.outcome)) : s.resolve(a?.resource);
5137
5137
  }
5138
5138
  }
5139
5139
  addFetchOptionsDefaults(t) {
5140
5140
  let n = t.headers;
5141
- n || (n = {}, t.headers = n), n.Accept = X.FHIR_JSON, n["X-Medplum"] = "extended", t.body && !n["Content-Type"] && (n["Content-Type"] = X.FHIR_JSON), this.accessToken ? n.Authorization = "Bearer " + this.accessToken : this.basicAuth && (n.Authorization = "Basic " + this.basicAuth), t.cache || (t.cache = "no-cache"), t.credentials || (t.credentials = "include");
5141
+ n || (n = {}, t.headers = n), n.Accept = Z.FHIR_JSON, n["X-Medplum"] = "extended", t.body && !n["Content-Type"] && (n["Content-Type"] = Z.FHIR_JSON), this.accessToken ? n.Authorization = "Bearer " + this.accessToken : this.basicAuth && (n.Authorization = "Basic " + this.basicAuth), t.cache || (t.cache = "no-cache"), t.credentials || (t.credentials = "include");
5142
5142
  }
5143
5143
  setRequestContentType(t, n) {
5144
5144
  t.headers || (t.headers = {});
@@ -5152,20 +5152,20 @@ var Mr = class extends Qe {
5152
5152
  return this.refresh() ? this.request(t, n, i2) : (this.clearActiveLogin(), this.onUnauthenticated && this.onUnauthenticated(), Promise.reject(new Error("Unauthenticated")));
5153
5153
  }
5154
5154
  async startPkce() {
5155
- let t = bt();
5155
+ let t = Et();
5156
5156
  sessionStorage.setItem("pkceState", t);
5157
- let n = bt();
5157
+ let n = Et();
5158
5158
  sessionStorage.setItem("codeVerifier", n);
5159
- let i2 = await Dr(n), o = or(i2).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
5159
+ let i2 = await Vr(n), o = sr(i2).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
5160
5160
  return sessionStorage.setItem("codeChallenge", o), { codeChallengeMethod: "S256", codeChallenge: o };
5161
5161
  }
5162
5162
  async requestAuthorization(t) {
5163
5163
  let n = await this.ensureCodeChallenge(t ?? {}), i2 = new URL(this.authorizeUrl);
5164
- i2.searchParams.set("response_type", "code"), i2.searchParams.set("state", sessionStorage.getItem("pkceState")), i2.searchParams.set("client_id", n.clientId ?? this.clientId), i2.searchParams.set("redirect_uri", n.redirectUri ?? Nr()), i2.searchParams.set("code_challenge_method", n.codeChallengeMethod), i2.searchParams.set("code_challenge", n.codeChallenge), i2.searchParams.set("scope", n.scope ?? "openid profile"), window.location.assign(i2.toString());
5164
+ i2.searchParams.set("response_type", "code"), i2.searchParams.set("state", sessionStorage.getItem("pkceState")), i2.searchParams.set("client_id", n.clientId ?? this.clientId), i2.searchParams.set("redirect_uri", n.redirectUri ?? Fr()), i2.searchParams.set("code_challenge_method", n.codeChallengeMethod), i2.searchParams.set("code_challenge", n.codeChallenge), i2.searchParams.set("scope", n.scope ?? "openid profile"), window.location.assign(i2.toString());
5165
5165
  }
5166
5166
  processCode(t, n) {
5167
5167
  let i2 = new URLSearchParams();
5168
- if (i2.set("grant_type", "authorization_code"), i2.set("code", t), i2.set("client_id", n?.clientId ?? this.clientId), i2.set("redirect_uri", n?.redirectUri ?? Nr()), typeof sessionStorage < "u") {
5168
+ if (i2.set("grant_type", "authorization_code"), i2.set("code", t), i2.set("client_id", n?.clientId ?? this.clientId), i2.set("redirect_uri", n?.redirectUri ?? Fr()), typeof sessionStorage < "u") {
5169
5169
  let o = sessionStorage.getItem("codeVerifier");
5170
5170
  o && i2.set("code_verifier", o);
5171
5171
  }
@@ -5196,22 +5196,22 @@ var Mr = class extends Qe {
5196
5196
  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);
5197
5197
  }
5198
5198
  setBasicAuth(t, n) {
5199
- this.clientId = t, this.clientSecret = n, this.basicAuth = kr(t + ":" + n);
5199
+ this.clientId = t, this.clientSecret = n, this.basicAuth = Or(t + ":" + n);
5200
5200
  }
5201
5201
  async invite(t, n) {
5202
5202
  return this.post("admin/projects/" + t + "/invite", n);
5203
5203
  }
5204
5204
  async fetchTokens(t) {
5205
- let n = { method: "POST", headers: { "Content-Type": X.FORM_URL_ENCODED }, body: t.toString(), credentials: "include" }, i2 = n.headers;
5205
+ let n = { method: "POST", headers: { "Content-Type": Z.FORM_URL_ENCODED }, body: t.toString(), credentials: "include" }, i2 = n.headers;
5206
5206
  this.basicAuth && (i2.Authorization = `Basic ${this.basicAuth}`);
5207
5207
  let o = await this.fetchWithRetry(this.tokenUrl, n);
5208
5208
  if (!o.ok) {
5209
5209
  this.clearActiveLogin();
5210
5210
  try {
5211
5211
  let a = await o.json();
5212
- throw new h(k(a.error_description));
5212
+ throw new m(k(a.error_description));
5213
5213
  } catch (a) {
5214
- throw new h(k("Failed to fetch tokens"), a);
5214
+ throw new m(k("Failed to fetch tokens"), a);
5215
5215
  }
5216
5216
  }
5217
5217
  let s = await o.json();
@@ -5219,8 +5219,8 @@ var Mr = class extends Qe {
5219
5219
  }
5220
5220
  async verifyTokens(t) {
5221
5221
  let n = t.access_token;
5222
- if (Vr(n)) {
5223
- let i2 = Et(n);
5222
+ if (Lr(n)) {
5223
+ let i2 = Ct(n);
5224
5224
  if (Date.now() >= i2.exp * 1e3)
5225
5225
  throw this.clearActiveLogin(), new Error("Token expired");
5226
5226
  if (i2.cid) {
@@ -5244,21 +5244,21 @@ var Mr = class extends Qe {
5244
5244
  throw i2;
5245
5245
  }
5246
5246
  };
5247
- function ki() {
5247
+ function Ui() {
5248
5248
  if (!globalThis.fetch)
5249
5249
  throw new Error("Fetch not available in this environment");
5250
5250
  return globalThis.fetch.bind(globalThis);
5251
5251
  }
5252
- function Nr() {
5252
+ function Fr() {
5253
5253
  return typeof window > "u" ? "" : window.location.protocol + "//" + window.location.host + "/";
5254
5254
  }
5255
- function Br(r4) {
5255
+ function qr(r4) {
5256
5256
  return r4.endsWith("/") ? r4 : r4 + "/";
5257
5257
  }
5258
- function We(r4, e) {
5258
+ function ze(r4, e) {
5259
5259
  return new URL(e, r4).toString();
5260
5260
  }
5261
- async function Fr(r4) {
5261
+ async function jr(r4) {
5262
5262
  let e = r4.headers.get("content-location");
5263
5263
  if (e)
5264
5264
  return e;
@@ -5266,17 +5266,17 @@ async function Fr(r4) {
5266
5266
  if (t)
5267
5267
  return t;
5268
5268
  let n = await r4.json();
5269
- if (xe(n) && n.issue?.[0]?.diagnostics)
5269
+ if (Te(n) && n.issue?.[0]?.diagnostics)
5270
5270
  return n.issue[0].diagnostics;
5271
5271
  }
5272
- function qr(r4) {
5272
+ function $r(r4) {
5273
5273
  let e = r4.entry?.map((t) => t.resource) ?? [];
5274
5274
  return Object.assign(e, { bundle: r4 });
5275
5275
  }
5276
- var Di = [...pe, "->", "<<", ">>"];
5277
- var Oi = fe().registerInfix("->", { precedence: p.Arrow }).registerInfix(";", { precedence: p.Semicolon });
5278
- var Vi = [...pe, "eq", "ne", "co"];
5279
- var _i = fe();
5276
+ var Li = [...pe, "->", "<<", ">>"];
5277
+ var _i = fe().registerInfix("->", { precedence: p.Arrow }).registerInfix(";", { precedence: p.Semicolon });
5278
+ var Ni = [...pe, "eq", "ne", "co"];
5279
+ var Fi = fe();
5280
5280
  var H = class {
5281
5281
  constructor(e = "\r", t = "|", n = "^", i2 = "~", o = "\\", s = "&") {
5282
5282
  this.segmentSeparator = e;
@@ -5293,7 +5293,7 @@ var H = class {
5293
5293
  return this.componentSeparator + this.repetitionSeparator + this.escapeCharacter + this.subcomponentSeparator;
5294
5294
  }
5295
5295
  };
5296
- var Qr = class r {
5296
+ var Gr = class r {
5297
5297
  constructor(e, t = new H()) {
5298
5298
  this.context = t, this.segments = e;
5299
5299
  }
@@ -5317,7 +5317,7 @@ var Qr = class r {
5317
5317
  }
5318
5318
  buildAck() {
5319
5319
  let e = /* @__PURE__ */ new Date(), t = this.getSegment("MSH"), n = t?.getField(3)?.toString() ?? "", i2 = t?.getField(4)?.toString() ?? "", o = t?.getField(5)?.toString() ?? "", s = t?.getField(6)?.toString() ?? "", a = t?.getField(10)?.toString() ?? "", c2 = t?.getField(12)?.toString() ?? "2.5.1";
5320
- return new r([new me(["MSH", this.context.getMsh2(), o, s, n, i2, Ni(e), "", this.buildAckMessageType(t), e.getTime().toString(), "P", c2], this.context), new me(["MSA", "AA", a, "OK"], this.context)]);
5320
+ return new r([new ye(["MSH", this.context.getMsh2(), o, s, n, i2, ji(e), "", this.buildAckMessageType(t), e.getTime().toString(), "P", c2], this.context), new ye(["MSA", "AA", a, "OK"], this.context)]);
5321
5321
  }
5322
5322
  buildAckMessageType(e) {
5323
5323
  let t = e?.getField(9), n = t?.getComponent(2), i2 = t?.getComponent(3), o = "ACK";
@@ -5329,12 +5329,12 @@ var Qr = class r {
5329
5329
  throw n.type = "entity.parse.failed", n;
5330
5330
  }
5331
5331
  let t = new H("\r", e.charAt(3), e.charAt(4), e.charAt(5), e.charAt(6), e.charAt(7));
5332
- return new r(e.split(/[\r\n]+/).map((n) => me.parse(n, t)), t);
5332
+ return new r(e.split(/[\r\n]+/).map((n) => ye.parse(n, t)), t);
5333
5333
  }
5334
5334
  };
5335
- var me = class r2 {
5335
+ var ye = class r2 {
5336
5336
  constructor(e, t = new H()) {
5337
- this.context = t, rr(e) ? this.fields = e.map((n) => ie.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
5337
+ this.context = t, nr(e) ? this.fields = e.map((n) => oe.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
5338
5338
  }
5339
5339
  get(e) {
5340
5340
  return this.fields[e];
@@ -5342,9 +5342,9 @@ var me = class r2 {
5342
5342
  getField(e) {
5343
5343
  if (this.name === "MSH") {
5344
5344
  if (e === 1)
5345
- return new ie([[this.context.getMsh1()]], this.context);
5345
+ return new oe([[this.context.getMsh1()]], this.context);
5346
5346
  if (e === 2)
5347
- return new ie([[this.context.getMsh2()]], this.context);
5347
+ return new oe([[this.context.getMsh2()]], this.context);
5348
5348
  if (e > 2)
5349
5349
  return this.fields[e - 1];
5350
5350
  }
@@ -5357,10 +5357,10 @@ var me = class r2 {
5357
5357
  return this.fields.map((e) => e.toString()).join(this.context.fieldSeparator);
5358
5358
  }
5359
5359
  static parse(e, t = new H()) {
5360
- return new r2(e.split(t.fieldSeparator).map((n) => ie.parse(n, t)), t);
5360
+ return new r2(e.split(t.fieldSeparator).map((n) => oe.parse(n, t)), t);
5361
5361
  }
5362
5362
  };
5363
- var ie = class r3 {
5363
+ var oe = class r3 {
5364
5364
  constructor(e, t = new H()) {
5365
5365
  this.context = t, this.components = e;
5366
5366
  }
@@ -5378,7 +5378,7 @@ var ie = class r3 {
5378
5378
  return new r3(e.split(t.repetitionSeparator).map((n) => n.split(t.componentSeparator)), t);
5379
5379
  }
5380
5380
  };
5381
- function Ni(r4) {
5381
+ function ji(r4) {
5382
5382
  let e = r4 instanceof Date ? r4 : new Date(r4), n = e.toISOString().replace(/[-:T]/g, "").replace(/(\.\d+)?Z$/, ""), i2 = e.getUTCMilliseconds();
5383
5383
  return i2 > 0 && (n += "." + i2.toString()), n;
5384
5384
  }
@@ -5393,7 +5393,7 @@ var i = class extends EventTarget {
5393
5393
  super.removeEventListener(n, e, t);
5394
5394
  }
5395
5395
  };
5396
- var m = String.fromCharCode(11);
5396
+ var m2 = String.fromCharCode(11);
5397
5397
  var p2 = String.fromCharCode(28);
5398
5398
  var v2 = String.fromCharCode(13);
5399
5399
  var d2 = class extends Event {
@@ -5418,7 +5418,7 @@ var c = class extends i {
5418
5418
  e.on("data", (s) => {
5419
5419
  try {
5420
5420
  if (o += s.toString(), o.endsWith(p2 + v2)) {
5421
- let r4 = Qr.parse(o.substring(1, o.length - 2));
5421
+ let r4 = Gr.parse(o.substring(1, o.length - 2));
5422
5422
  this.dispatchEvent(new d2(this, r4)), o = "";
5423
5423
  }
5424
5424
  } catch (r4) {
@@ -5429,7 +5429,7 @@ var c = class extends i {
5429
5429
  });
5430
5430
  }
5431
5431
  send(e) {
5432
- this.socket.write(m + e.toString() + p2 + v2);
5432
+ this.socket.write(m2 + e.toString() + p2 + v2);
5433
5433
  }
5434
5434
  async sendAndWait(e) {
5435
5435
  let t = new Promise((o) => {
@@ -5546,7 +5546,7 @@ var AgentHl7ChannelConnection = class {
5546
5546
  type: "connect",
5547
5547
  accessToken: medplum.getAccessToken(),
5548
5548
  agentId: channel.app.agentId,
5549
- botId: wo(channel.definition.targetReference)
5549
+ botId: Oo(channel.definition.targetReference)
5550
5550
  })
5551
5551
  );
5552
5552
  });
@@ -5562,7 +5562,7 @@ var AgentHl7ChannelConnection = class {
5562
5562
  this.trySendToWebSocket();
5563
5563
  break;
5564
5564
  case "transmit":
5565
- this.hl7ConnectionQueue.push(Qr.parse(command.message));
5565
+ this.hl7ConnectionQueue.push(Gr.parse(command.message));
5566
5566
  this.trySendToHl7Connection();
5567
5567
  break;
5568
5568
  }
@@ -5616,7 +5616,7 @@ if (typeof require !== "undefined" && require.main === module) {
5616
5616
  process.exit(1);
5617
5617
  }
5618
5618
  const [_node, _script, baseUrl, clientId, clientSecret, agentId] = process.argv;
5619
- const medplum = new Mr({ baseUrl, clientId });
5619
+ const medplum = new Br({ baseUrl, clientId });
5620
5620
  medplum.startClientLogin(clientId, clientSecret).then(() => new App(medplum, agentId).start()).catch(console.error);
5621
5621
  }
5622
5622
  // Annotate the CommonJS export names for ESM import in node: