@medplum/agent 3.2.33 → 3.3.0

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 +550 -534
  2. package/package.json +5 -5
@@ -12,13 +12,13 @@ var __export = (target, all) => {
12
12
  for (var name in all)
13
13
  __defProp(target, name, { get: all[name], enumerable: true });
14
14
  };
15
- var __copyProps = (to, from, except, desc) => {
15
+ var __copyProps = (to2, from, except, desc) => {
16
16
  if (from && typeof from === "object" || typeof from === "function") {
17
17
  for (let key of __getOwnPropNames(from))
18
- if (!__hasOwnProp.call(to, key) && key !== except)
19
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ if (!__hasOwnProp.call(to2, key) && key !== except)
19
+ __defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
20
  }
21
- return to;
21
+ return to2;
22
22
  };
23
23
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
24
  // If the importer is in node compatibility mode or this is not an ESM
@@ -7387,9 +7387,9 @@ var require_dcmjs = __commonJS({
7387
7387
  }
7388
7388
  interpolate(level) {
7389
7389
  return this.options.template.replace(/{{([^{}]*)}}/g, (stache, prop) => {
7390
- const fn = this.options[prop];
7391
- if (fn) {
7392
- return fn({ level, logger: this.logger });
7390
+ const fn2 = this.options[prop];
7391
+ if (fn2) {
7392
+ return fn2({ level, logger: this.logger });
7393
7393
  }
7394
7394
  return stache;
7395
7395
  });
@@ -7667,8 +7667,8 @@ var require_dcmjs = __commonJS({
7667
7667
  }
7668
7668
  return _construct.apply(null, arguments);
7669
7669
  }
7670
- function _isNativeFunction(fn) {
7671
- return Function.toString.call(fn).indexOf("[native code]") !== -1;
7670
+ function _isNativeFunction(fn2) {
7671
+ return Function.toString.call(fn2).indexOf("[native code]") !== -1;
7672
7672
  }
7673
7673
  function _wrapNativeSuper(Class) {
7674
7674
  var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
@@ -13397,17 +13397,17 @@ var require_dcmjs = __commonJS({
13397
13397
  key: "readBytes",
13398
13398
  value: function readBytes(stream, length2) {
13399
13399
  var BACKSLASH = String.fromCharCode(VM_DELIMITER);
13400
- var ds = stream.readAsciiString(length2);
13401
- ds = ds.replace(/[^0-9.\\\-+e]/gi, "");
13402
- if (ds.indexOf(BACKSLASH) !== -1) {
13403
- var dsArray = ds.split(BACKSLASH);
13404
- ds = dsArray.map(function(ds2) {
13405
- return ds2 === "" ? null : Number(ds2);
13400
+ var ds2 = stream.readAsciiString(length2);
13401
+ ds2 = ds2.replace(/[^0-9.\\\-+e]/gi, "");
13402
+ if (ds2.indexOf(BACKSLASH) !== -1) {
13403
+ var dsArray = ds2.split(BACKSLASH);
13404
+ ds2 = dsArray.map(function(ds3) {
13405
+ return ds3 === "" ? null : Number(ds3);
13406
13406
  });
13407
13407
  } else {
13408
- ds = [ds === "" ? null : Number(ds)];
13408
+ ds2 = [ds2 === "" ? null : Number(ds2)];
13409
13409
  }
13410
- return ds;
13410
+ return ds2;
13411
13411
  }
13412
13412
  }, {
13413
13413
  key: "formatValue",
@@ -13434,8 +13434,8 @@ var require_dcmjs = __commonJS({
13434
13434
  key: "writeBytes",
13435
13435
  value: function writeBytes(stream, value, writeOptions) {
13436
13436
  var _this7 = this;
13437
- var val = Array.isArray(value) ? value.map(function(ds) {
13438
- return _this7.formatValue(ds);
13437
+ var val = Array.isArray(value) ? value.map(function(ds2) {
13438
+ return _this7.formatValue(ds2);
13439
13439
  }) : [this.formatValue(value)];
13440
13440
  return _get(_getPrototypeOf(DecimalString2.prototype), "writeBytes", this).call(this, stream, val, writeOptions);
13441
13441
  }
@@ -13522,17 +13522,17 @@ var require_dcmjs = __commonJS({
13522
13522
  key: "readBytes",
13523
13523
  value: function readBytes(stream, length2) {
13524
13524
  var BACKSLASH = String.fromCharCode(VM_DELIMITER);
13525
- var is2 = stream.readAsciiString(length2).trim();
13526
- is2 = is2.replace(/[^0-9.\\\-+e]/gi, "");
13527
- if (is2.indexOf(BACKSLASH) !== -1) {
13528
- var integerStringArray = is2.split(BACKSLASH);
13529
- is2 = integerStringArray.map(function(is3) {
13530
- return is3 === "" ? null : Number(is3);
13525
+ var is = stream.readAsciiString(length2).trim();
13526
+ is = is.replace(/[^0-9.\\\-+e]/gi, "");
13527
+ if (is.indexOf(BACKSLASH) !== -1) {
13528
+ var integerStringArray = is.split(BACKSLASH);
13529
+ is = integerStringArray.map(function(is2) {
13530
+ return is2 === "" ? null : Number(is2);
13531
13531
  });
13532
13532
  } else {
13533
- is2 = [is2 === "" ? null : Number(is2)];
13533
+ is = [is === "" ? null : Number(is)];
13534
13534
  }
13535
- return is2;
13535
+ return is;
13536
13536
  }
13537
13537
  }, {
13538
13538
  key: "formatValue",
@@ -13543,8 +13543,8 @@ var require_dcmjs = __commonJS({
13543
13543
  key: "writeBytes",
13544
13544
  value: function writeBytes(stream, value, writeOptions) {
13545
13545
  var _this12 = this;
13546
- var val = Array.isArray(value) ? value.map(function(is2) {
13547
- return _this12.formatValue(is2);
13546
+ var val = Array.isArray(value) ? value.map(function(is) {
13547
+ return _this12.formatValue(is);
13548
13548
  }) : [this.formatValue(value)];
13549
13549
  return _get(_getPrototypeOf(IntegerString2.prototype), "writeBytes", this).call(this, stream, val, writeOptions);
13550
13550
  }
@@ -14260,7 +14260,7 @@ var require_dcmjs = __commonJS({
14260
14260
  }
14261
14261
  }, {
14262
14262
  key: "is",
14263
- value: function is2(t) {
14263
+ value: function is(t) {
14264
14264
  return this.value == t;
14265
14265
  }
14266
14266
  }, {
@@ -15100,8 +15100,8 @@ var require_dcmjs = __commonJS({
15100
15100
  }, {
15101
15101
  key: "isMultiframeDataset",
15102
15102
  value: function isMultiframeDataset() {
15103
- var ds = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.dataset;
15104
- var sopClassUID = ds.SOPClassUID.replace(/[^0-9.]/g, "");
15103
+ var ds2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.dataset;
15104
+ var sopClassUID = ds2.SOPClassUID.replace(/[^0-9.]/g, "");
15105
15105
  return Normalizer2.isMultiframeSOPClassUID(sopClassUID);
15106
15106
  }
15107
15107
  }, {
@@ -15142,16 +15142,16 @@ var require_dcmjs = __commonJS({
15142
15142
  }
15143
15143
  this.derivation = new DerivedImage(this.datasets);
15144
15144
  this.dataset = this.derivation.dataset;
15145
- var ds = this.dataset;
15145
+ var ds2 = this.dataset;
15146
15146
  var referenceDataset = this.datasets[0];
15147
- ds.NumberOfFrames = this.datasets.length;
15148
- ds.SOPClassUID = referenceDataset.SOPClassUID;
15149
- ds.Rows = referenceDataset.Rows;
15150
- ds.Columns = referenceDataset.Columns;
15151
- ds.BitsAllocated = referenceDataset.BitsAllocated;
15152
- ds.PixelRepresentation = referenceDataset.PixelRepresentation;
15153
- ds.RescaleSlope = referenceDataset.RescaleSlope || "1";
15154
- ds.RescaleIntercept = referenceDataset.RescaleIntercept || "0";
15147
+ ds2.NumberOfFrames = this.datasets.length;
15148
+ ds2.SOPClassUID = referenceDataset.SOPClassUID;
15149
+ ds2.Rows = referenceDataset.Rows;
15150
+ ds2.Columns = referenceDataset.Columns;
15151
+ ds2.BitsAllocated = referenceDataset.BitsAllocated;
15152
+ ds2.PixelRepresentation = referenceDataset.PixelRepresentation;
15153
+ ds2.RescaleSlope = referenceDataset.RescaleSlope || "1";
15154
+ ds2.RescaleIntercept = referenceDataset.RescaleIntercept || "0";
15155
15155
  var referencePosition = referenceDataset.ImagePositionPatient;
15156
15156
  var rowVector = referenceDataset.ImageOrientationPatient.slice(0, 3);
15157
15157
  var columnVector = referenceDataset.ImageOrientationPatient.slice(3, 6);
@@ -15166,43 +15166,43 @@ var require_dcmjs = __commonJS({
15166
15166
  distanceDatasetPairs.sort(function(a2, b3) {
15167
15167
  return b3[0] - a2[0];
15168
15168
  });
15169
- if (ds.BitsAllocated !== 16) {
15169
+ if (ds2.BitsAllocated !== 16) {
15170
15170
  log.error("Only works with 16 bit data, not " + String(this.dataset.BitsAllocated));
15171
15171
  }
15172
15172
  if (referenceDataset._vrMap && !referenceDataset._vrMap.PixelData) {
15173
15173
  log.warn("No vr map given for pixel data, using OW");
15174
- ds._vrMap = {
15174
+ ds2._vrMap = {
15175
15175
  PixelData: "OW"
15176
15176
  };
15177
15177
  } else {
15178
- ds._vrMap = {
15178
+ ds2._vrMap = {
15179
15179
  PixelData: referenceDataset._vrMap.PixelData
15180
15180
  };
15181
15181
  }
15182
15182
  var frameSize = referenceDataset.PixelData.byteLength;
15183
- ds.PixelData = new ArrayBuffer(ds.NumberOfFrames * frameSize);
15183
+ ds2.PixelData = new ArrayBuffer(ds2.NumberOfFrames * frameSize);
15184
15184
  var frame = 0;
15185
15185
  distanceDatasetPairs.forEach(function(pair) {
15186
15186
  var dataset = pair[1];
15187
15187
  var pixels = new Uint16Array(dataset.PixelData);
15188
- var frameView = new Uint16Array(ds.PixelData, frame * frameSize, frameSize / 2);
15188
+ var frameView = new Uint16Array(ds2.PixelData, frame * frameSize, frameSize / 2);
15189
15189
  try {
15190
15190
  frameView.set(pixels);
15191
15191
  } catch (e) {
15192
15192
  if (e instanceof RangeError) {
15193
- var message2 = "Error inserting pixels in PixelData\n" + "frameSize ".concat(frameSize, "\n") + "NumberOfFrames ".concat(ds.NumberOfFrames, "\n") + "pair ".concat(pair, "\n") + "dataset PixelData size ".concat(dataset.PixelData.length);
15193
+ var message2 = "Error inserting pixels in PixelData\n" + "frameSize ".concat(frameSize, "\n") + "NumberOfFrames ".concat(ds2.NumberOfFrames, "\n") + "pair ".concat(pair, "\n") + "dataset PixelData size ".concat(dataset.PixelData.length);
15194
15194
  log.error(message2);
15195
15195
  }
15196
15196
  }
15197
15197
  frame++;
15198
15198
  });
15199
- if (ds.NumberOfFrames < 2) {
15199
+ if (ds2.NumberOfFrames < 2) {
15200
15200
  log.error("Cannot populate shared groups uniquely without multiple frames");
15201
15201
  }
15202
15202
  var _distanceDatasetPairs = _slicedToArray(distanceDatasetPairs[0], 2), distance0 = _distanceDatasetPairs[0], dataset0 = _distanceDatasetPairs[1];
15203
15203
  var distance1 = distanceDatasetPairs[1][0];
15204
15204
  var SpacingBetweenSlices = Math.abs(distance1 - distance0);
15205
- ds.SharedFunctionalGroupsSequence = {
15205
+ ds2.SharedFunctionalGroupsSequence = {
15206
15206
  PlaneOrientationSequence: {
15207
15207
  ImageOrientationPatient: dataset0.ImageOrientationPatient
15208
15208
  },
@@ -15212,14 +15212,14 @@ var require_dcmjs = __commonJS({
15212
15212
  SliceThickness: SpacingBetweenSlices
15213
15213
  }
15214
15214
  };
15215
- ds.ReferencedSeriesSequence = {
15215
+ ds2.ReferencedSeriesSequence = {
15216
15216
  SeriesInstanceUID: dataset0.SeriesInstanceUID,
15217
15217
  ReferencedInstanceSequence: []
15218
15218
  };
15219
- ds.PerFrameFunctionalGroupsSequence = [];
15219
+ ds2.PerFrameFunctionalGroupsSequence = [];
15220
15220
  distanceDatasetPairs.forEach(function(pair) {
15221
15221
  var dataset = pair[1];
15222
- ds.PerFrameFunctionalGroupsSequence.push({
15222
+ ds2.PerFrameFunctionalGroupsSequence.push({
15223
15223
  PlanePositionSequence: {
15224
15224
  ImagePositionPatient: dataset.ImagePositionPatient
15225
15225
  },
@@ -15228,7 +15228,7 @@ var require_dcmjs = __commonJS({
15228
15228
  WindowWidth: dataset.WindowWidth
15229
15229
  }
15230
15230
  });
15231
- ds.ReferencedSeriesSequence.ReferencedInstanceSequence.push({
15231
+ ds2.ReferencedSeriesSequence.ReferencedInstanceSequence.push({
15232
15232
  ReferencedSOPClassUID: dataset.SOPClassUID,
15233
15233
  ReferencedSOPInstanceUID: dataset.SOPInstanceUID
15234
15234
  });
@@ -15248,29 +15248,29 @@ var require_dcmjs = __commonJS({
15248
15248
  }, {
15249
15249
  key: "normalizeMultiframe",
15250
15250
  value: function normalizeMultiframe() {
15251
- var ds = this.dataset;
15252
- if (!ds.NumberOfFrames) {
15251
+ var ds2 = this.dataset;
15252
+ if (!ds2.NumberOfFrames) {
15253
15253
  log.error("Missing number or frames not supported");
15254
15254
  return;
15255
15255
  }
15256
- if (!ds.PixelRepresentation) {
15257
- ds.PixelRepresentation = 1;
15256
+ if (!ds2.PixelRepresentation) {
15257
+ ds2.PixelRepresentation = 1;
15258
15258
  }
15259
- if (!ds.StudyID || ds.StudyID === "") {
15260
- ds.StudyID = "No Study ID";
15259
+ if (!ds2.StudyID || ds2.StudyID === "") {
15260
+ ds2.StudyID = "No Study ID";
15261
15261
  }
15262
15262
  var validLateralities = ["R", "L"];
15263
- if (validLateralities.indexOf(ds.Laterality) === -1) {
15264
- delete ds.Laterality;
15263
+ if (validLateralities.indexOf(ds2.Laterality) === -1) {
15264
+ delete ds2.Laterality;
15265
15265
  }
15266
- if (!ds.PresentationLUTShape) {
15267
- ds.PresentationLUTShape = "IDENTITY";
15266
+ if (!ds2.PresentationLUTShape) {
15267
+ ds2.PresentationLUTShape = "IDENTITY";
15268
15268
  }
15269
- if (!ds.SharedFunctionalGroupsSequence) {
15269
+ if (!ds2.SharedFunctionalGroupsSequence) {
15270
15270
  log.error("Can only process multiframe data with SharedFunctionalGroupsSequence");
15271
15271
  }
15272
- if (ds.BodyPartExamined === "PROSTATE") {
15273
- ds.SharedFunctionalGroupsSequence.FrameAnatomySequence = {
15272
+ if (ds2.BodyPartExamined === "PROSTATE") {
15273
+ ds2.SharedFunctionalGroupsSequence.FrameAnatomySequence = {
15274
15274
  AnatomicRegionSequence: {
15275
15275
  CodeValue: "T-9200B",
15276
15276
  CodingSchemeDesignator: "SRT",
@@ -15279,17 +15279,17 @@ var require_dcmjs = __commonJS({
15279
15279
  FrameLaterality: "U"
15280
15280
  };
15281
15281
  }
15282
- var rescaleIntercept = ds.RescaleIntercept || 0;
15283
- var rescaleSlope = ds.RescaleSlope || 1;
15284
- ds.SharedFunctionalGroupsSequence.PixelValueTransformationSequence = {
15282
+ var rescaleIntercept = ds2.RescaleIntercept || 0;
15283
+ var rescaleSlope = ds2.RescaleSlope || 1;
15284
+ ds2.SharedFunctionalGroupsSequence.PixelValueTransformationSequence = {
15285
15285
  RescaleIntercept: rescaleIntercept,
15286
15286
  RescaleSlope: rescaleSlope,
15287
15287
  RescaleType: "US"
15288
15288
  };
15289
15289
  var frameNumber = 1;
15290
15290
  this.datasets.forEach(function(dataset) {
15291
- if (ds.NumberOfFrames === 1) ds.PerFrameFunctionalGroupsSequence = [ds.PerFrameFunctionalGroupsSequence];
15292
- ds.PerFrameFunctionalGroupsSequence[frameNumber - 1].FrameContentSequence = {
15291
+ if (ds2.NumberOfFrames === 1) ds2.PerFrameFunctionalGroupsSequence = [ds2.PerFrameFunctionalGroupsSequence];
15292
+ ds2.PerFrameFunctionalGroupsSequence[frameNumber - 1].FrameContentSequence = {
15293
15293
  FrameAcquisitionDuration: 0,
15294
15294
  StackID: 1,
15295
15295
  InStackPositionNumber: frameNumber,
@@ -15297,30 +15297,30 @@ var require_dcmjs = __commonJS({
15297
15297
  };
15298
15298
  var frameTime = dataset.AcquisitionDate + dataset.AcquisitionTime;
15299
15299
  if (!isNaN(frameTime)) {
15300
- var frameContentSequence = ds.PerFrameFunctionalGroupsSequence[frameNumber - 1].FrameContentSequence;
15300
+ var frameContentSequence = ds2.PerFrameFunctionalGroupsSequence[frameNumber - 1].FrameContentSequence;
15301
15301
  frameContentSequence.FrameAcquisitionDateTime = frameTime;
15302
15302
  frameContentSequence.FrameReferenceDateTime = frameTime;
15303
15303
  }
15304
15304
  frameNumber++;
15305
15305
  });
15306
- if (ds.WindowCenter && ds.WindowWidth) {
15307
- if (!Array.isArray(ds.WindowCenter)) {
15308
- ds.WindowCenter = [ds.WindowCenter];
15306
+ if (ds2.WindowCenter && ds2.WindowWidth) {
15307
+ if (!Array.isArray(ds2.WindowCenter)) {
15308
+ ds2.WindowCenter = [ds2.WindowCenter];
15309
15309
  }
15310
- if (!Array.isArray(ds.WindowWidth)) {
15311
- ds.WindowWidth = [ds.WindowWidth];
15310
+ if (!Array.isArray(ds2.WindowWidth)) {
15311
+ ds2.WindowWidth = [ds2.WindowWidth];
15312
15312
  }
15313
15313
  }
15314
- if (!ds.WindowCenter || !ds.WindowWidth) {
15315
- ds.WindowCenter = [];
15316
- ds.WindowWidth = [];
15317
- if (ds.PerFrameFunctionalGroupsSequence) {
15314
+ if (!ds2.WindowCenter || !ds2.WindowWidth) {
15315
+ ds2.WindowCenter = [];
15316
+ ds2.WindowWidth = [];
15317
+ if (ds2.PerFrameFunctionalGroupsSequence) {
15318
15318
  var wcww = {
15319
15319
  center: 0,
15320
15320
  width: 0,
15321
15321
  count: 0
15322
15322
  };
15323
- ds.PerFrameFunctionalGroupsSequence.forEach(function(functionalGroup) {
15323
+ ds2.PerFrameFunctionalGroupsSequence.forEach(function(functionalGroup) {
15324
15324
  if (functionalGroup.FrameVOILUT) {
15325
15325
  var wc = functionalGroup.FrameVOILUTSequence.WindowCenter;
15326
15326
  var ww = functionalGroup.FrameVOILUTSequence.WindowWidth;
@@ -15338,16 +15338,16 @@ var require_dcmjs = __commonJS({
15338
15338
  }
15339
15339
  });
15340
15340
  if (wcww.count > 0) {
15341
- ds.WindowCenter.push(String(wcww.center / wcww.count));
15342
- ds.WindowWidth.push(String(wcww.width / wcww.count));
15341
+ ds2.WindowCenter.push(String(wcww.center / wcww.count));
15342
+ ds2.WindowWidth.push(String(wcww.width / wcww.count));
15343
15343
  }
15344
15344
  }
15345
15345
  }
15346
- if (ds.WindowCenter.length === 0) {
15347
- ds.WindowCenter = [300];
15346
+ if (ds2.WindowCenter.length === 0) {
15347
+ ds2.WindowCenter = [300];
15348
15348
  }
15349
- if (ds.WindowWidth.length === 0) {
15350
- ds.WindowWidth = [500];
15349
+ if (ds2.WindowWidth.length === 0) {
15350
+ ds2.WindowWidth = [500];
15351
15351
  }
15352
15352
  }
15353
15353
  }], [{
@@ -15394,12 +15394,12 @@ var require_dcmjs = __commonJS({
15394
15394
  key: "normalizeMultiframe",
15395
15395
  value: function normalizeMultiframe() {
15396
15396
  _get(_getPrototypeOf(MRImageNormalizer2.prototype), "normalizeMultiframe", this).call(this);
15397
- var ds = this.dataset;
15398
- if (!ds.ImageType || !ds.ImageType.constructor || ds.ImageType.constructor.name != "Array" || ds.ImageType.length != 4) {
15399
- ds.ImageType = ["ORIGINAL", "PRIMARY", "OTHER", "NONE"];
15397
+ var ds2 = this.dataset;
15398
+ if (!ds2.ImageType || !ds2.ImageType.constructor || ds2.ImageType.constructor.name != "Array" || ds2.ImageType.length != 4) {
15399
+ ds2.ImageType = ["ORIGINAL", "PRIMARY", "OTHER", "NONE"];
15400
15400
  }
15401
- ds.SharedFunctionalGroupsSequence.MRImageFrameTypeSequence = {
15402
- FrameType: ds.ImageType,
15401
+ ds2.SharedFunctionalGroupsSequence.MRImageFrameTypeSequence = {
15402
+ FrameType: ds2.ImageType,
15403
15403
  PixelPresentation: "MONOCHROME",
15404
15404
  VolumetricProperties: "VOLUME",
15405
15405
  VolumeBasedCalculationTechnique: "NONE",
@@ -15532,9 +15532,9 @@ var require_dcmjs = __commonJS({
15532
15532
  key: "normalize",
15533
15533
  value: function normalize2() {
15534
15534
  _get(_getPrototypeOf(PMImageNormalizer2.prototype), "normalize", this).call(this);
15535
- var ds = this.datasets[0];
15536
- if (ds.BitsAllocated !== 32) {
15537
- log.error("Only works with 32 bit data, not " + String(ds.BitsAllocated));
15535
+ var ds2 = this.datasets[0];
15536
+ if (ds2.BitsAllocated !== 32) {
15537
+ log.error("Only works with 32 bit data, not " + String(ds2.BitsAllocated));
15538
15538
  }
15539
15539
  }
15540
15540
  }]);
@@ -16311,8 +16311,8 @@ var require_dcmjs = __commonJS({
16311
16311
  return contentItem.ConceptNameCodeSequence.CodeMeaning === TRACKING_IDENTIFIER;
16312
16312
  });
16313
16313
  var TrackingIdentifierValue = TrackingIdentifierGroup.TextValue;
16314
- var toolClass = hooks.getToolClass ? hooks.getToolClass(measurementGroup, dataset, registeredToolClasses) : registeredToolClasses.find(function(tc2) {
16315
- return tc2.isValidCornerstoneTrackingIdentifier(TrackingIdentifierValue);
16314
+ var toolClass = hooks.getToolClass ? hooks.getToolClass(measurementGroup, dataset, registeredToolClasses) : registeredToolClasses.find(function(tc) {
16315
+ return tc.isValidCornerstoneTrackingIdentifier(TrackingIdentifierValue);
16316
16316
  });
16317
16317
  if (toolClass) {
16318
16318
  var measurement = toolClass.getMeasurementData(measurementGroup);
@@ -18371,7 +18371,7 @@ var require_dcmjs = __commonJS({
18371
18371
  var sqrLen = squaredLength;
18372
18372
  var forEach = function() {
18373
18373
  var vec = create();
18374
- return function(a2, stride, offset, count, fn, arg) {
18374
+ return function(a2, stride, offset, count, fn2, arg) {
18375
18375
  var i, l2;
18376
18376
  if (!stride) {
18377
18377
  stride = 3;
@@ -18388,7 +18388,7 @@ var require_dcmjs = __commonJS({
18388
18388
  vec[0] = a2[i];
18389
18389
  vec[1] = a2[i + 1];
18390
18390
  vec[2] = a2[i + 2];
18391
- fn(vec, vec, arg);
18391
+ fn2(vec, vec, arg);
18392
18392
  a2[i] = vec[0];
18393
18393
  a2[i + 1] = vec[1];
18394
18394
  a2[i + 2] = vec[2];
@@ -20344,8 +20344,8 @@ var require_dcmjs = __commonJS({
20344
20344
  return contentItem.ConceptNameCodeSequence.CodeMeaning === TRACKING_IDENTIFIER;
20345
20345
  });
20346
20346
  var TrackingIdentifierValue = TrackingIdentifierGroup.TextValue;
20347
- var toolClass = hooks.getToolClass ? hooks.getToolClass(measurementGroup, dataset, registeredToolClasses) : registeredToolClasses.find(function(tc2) {
20348
- return tc2.isValidCornerstoneTrackingIdentifier(TrackingIdentifierValue);
20347
+ var toolClass = hooks.getToolClass ? hooks.getToolClass(measurementGroup, dataset, registeredToolClasses) : registeredToolClasses.find(function(tc) {
20348
+ return tc.isValidCornerstoneTrackingIdentifier(TrackingIdentifierValue);
20349
20349
  });
20350
20350
  if (toolClass) {
20351
20351
  var measurement = toolClass.getMeasurementData(measurementGroup, sopInstanceUIDToImageIdMap, imageToWorldCoords, metadata);
@@ -24860,11 +24860,11 @@ var require_once = __commonJS({
24860
24860
  value: true
24861
24861
  });
24862
24862
  exports2.default = once;
24863
- function once(fn) {
24863
+ function once(fn2) {
24864
24864
  return function() {
24865
- if (fn === null) return;
24866
- var callFn = fn;
24867
- fn = null;
24865
+ if (fn2 === null) return;
24866
+ var callFn = fn2;
24867
+ fn2 = null;
24868
24868
  callFn.apply(this, arguments);
24869
24869
  };
24870
24870
  }
@@ -25404,11 +25404,11 @@ var require_onlyOnce = __commonJS({
25404
25404
  value: true
25405
25405
  });
25406
25406
  exports2.default = onlyOnce;
25407
- function onlyOnce(fn) {
25407
+ function onlyOnce(fn2) {
25408
25408
  return function() {
25409
- if (fn === null) throw new Error("Callback was already called.");
25410
- var callFn = fn;
25411
- fn = null;
25409
+ if (fn2 === null) throw new Error("Callback was already called.");
25410
+ var callFn = fn2;
25411
+ fn2 = null;
25412
25412
  callFn.apply(this, arguments);
25413
25413
  };
25414
25414
  }
@@ -25539,11 +25539,11 @@ var require_initialParams = __commonJS({
25539
25539
  Object.defineProperty(exports2, "__esModule", {
25540
25540
  value: true
25541
25541
  });
25542
- exports2.default = function(fn) {
25542
+ exports2.default = function(fn2) {
25543
25543
  return function() {
25544
25544
  var args = (0, _slice2.default)(arguments);
25545
25545
  var callback = args.pop();
25546
- fn.call(this, args, callback);
25546
+ fn2.call(this, args, callback);
25547
25547
  };
25548
25548
  };
25549
25549
  var _slice = require_slice();
@@ -25572,14 +25572,14 @@ var require_setImmediate = __commonJS({
25572
25572
  }
25573
25573
  var hasSetImmediate = exports2.hasSetImmediate = typeof setImmediate === "function" && setImmediate;
25574
25574
  var hasNextTick = exports2.hasNextTick = typeof process === "object" && typeof process.nextTick === "function";
25575
- function fallback(fn) {
25576
- setTimeout(fn, 0);
25575
+ function fallback(fn2) {
25576
+ setTimeout(fn2, 0);
25577
25577
  }
25578
25578
  function wrap(defer) {
25579
- return function(fn) {
25579
+ return function(fn2) {
25580
25580
  var args = (0, _slice2.default)(arguments, 1);
25581
25581
  defer(function() {
25582
- fn.apply(null, args);
25582
+ fn2.apply(null, args);
25583
25583
  });
25584
25584
  };
25585
25585
  }
@@ -25659,8 +25659,8 @@ var require_wrapAsync = __commonJS({
25659
25659
  return obj && obj.__esModule ? obj : { default: obj };
25660
25660
  }
25661
25661
  var supportsSymbol = typeof Symbol === "function";
25662
- function isAsync(fn) {
25663
- return supportsSymbol && fn[Symbol.toStringTag] === "AsyncFunction";
25662
+ function isAsync(fn2) {
25663
+ return supportsSymbol && fn2[Symbol.toStringTag] === "AsyncFunction";
25664
25664
  }
25665
25665
  function wrapAsync(asyncFn) {
25666
25666
  return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn;
@@ -25702,9 +25702,9 @@ var require_doLimit = __commonJS({
25702
25702
  value: true
25703
25703
  });
25704
25704
  exports2.default = doLimit;
25705
- function doLimit(fn, limit) {
25705
+ function doLimit(fn2, limit) {
25706
25706
  return function(iterable, iteratee, callback) {
25707
- return fn(iterable, limit, iteratee, callback);
25707
+ return fn2(iterable, limit, iteratee, callback);
25708
25708
  };
25709
25709
  }
25710
25710
  module2.exports = exports2["default"];
@@ -25756,17 +25756,17 @@ var require_AsyncEventEmitter = __commonJS({
25756
25756
  callback = void 0;
25757
25757
  }
25758
25758
  listeners = Array.isArray(listeners) ? listeners : [listeners];
25759
- eachSeries(listeners.slice(), function(fn, next) {
25759
+ eachSeries(listeners.slice(), function(fn2, next) {
25760
25760
  var err;
25761
- if (fn.length < 2) {
25761
+ if (fn2.length < 2) {
25762
25762
  try {
25763
- fn.call(self2, data2);
25763
+ fn2.call(self2, data2);
25764
25764
  } catch (e) {
25765
25765
  err = e;
25766
25766
  }
25767
25767
  return next(err);
25768
25768
  }
25769
- fn.call(self2, data2, next);
25769
+ fn2.call(self2, data2, next);
25770
25770
  }, callback);
25771
25771
  return self2;
25772
25772
  };
@@ -27117,8 +27117,8 @@ var require_util = __commonJS({
27117
27117
  };
27118
27118
  exports2.nearestCommonProto = nearestCommonProto;
27119
27119
  var hardMixProtos = (ingredients, constructor, exclude = []) => {
27120
- var _a2;
27121
- const base = (_a2 = (0, exports2.nearestCommonProto)(...ingredients)) !== null && _a2 !== void 0 ? _a2 : Object.prototype;
27120
+ var _a;
27121
+ const base = (_a = (0, exports2.nearestCommonProto)(...ingredients)) !== null && _a !== void 0 ? _a : Object.prototype;
27122
27122
  const mixedProto = Object.create(base);
27123
27123
  const visitedProtos = (0, exports2.protoChain)(base);
27124
27124
  for (let prototype of ingredients) {
@@ -27248,8 +27248,8 @@ var require_mixin_tracking = __commonJS({
27248
27248
  frontier.forEach((item) => visited.add(item));
27249
27249
  const newFrontier = /* @__PURE__ */ new Set();
27250
27250
  frontier.forEach((item) => {
27251
- var _a2;
27252
- const itemConstituents = (_a2 = mixins.get(item)) !== null && _a2 !== void 0 ? _a2 : (0, util_1.protoChain)(item.prototype).map((proto) => proto.constructor).filter((item2) => item2 !== null);
27251
+ var _a;
27252
+ const itemConstituents = (_a = mixins.get(item)) !== null && _a !== void 0 ? _a : (0, util_1.protoChain)(item.prototype).map((proto) => proto.constructor).filter((item2) => item2 !== null);
27253
27253
  if (itemConstituents)
27254
27254
  itemConstituents.forEach((constituent) => {
27255
27255
  if (!visited.has(constituent) && !frontier.has(constituent))
@@ -27273,37 +27273,37 @@ var require_decorator = __commonJS({
27273
27273
  var util_1 = require_util();
27274
27274
  var mixin_tracking_1 = require_mixin_tracking();
27275
27275
  var mergeObjectsOfDecorators = (o1, o2) => {
27276
- var _a2, _b;
27276
+ var _a, _b;
27277
27277
  const allKeys = (0, util_1.unique)([...Object.getOwnPropertyNames(o1), ...Object.getOwnPropertyNames(o2)]);
27278
27278
  const mergedObject = {};
27279
27279
  for (let key of allKeys)
27280
- mergedObject[key] = (0, util_1.unique)([...(_a2 = o1 === null || o1 === void 0 ? void 0 : o1[key]) !== null && _a2 !== void 0 ? _a2 : [], ...(_b = o2 === null || o2 === void 0 ? void 0 : o2[key]) !== null && _b !== void 0 ? _b : []]);
27280
+ mergedObject[key] = (0, util_1.unique)([...(_a = o1 === null || o1 === void 0 ? void 0 : o1[key]) !== null && _a !== void 0 ? _a : [], ...(_b = o2 === null || o2 === void 0 ? void 0 : o2[key]) !== null && _b !== void 0 ? _b : []]);
27281
27281
  return mergedObject;
27282
27282
  };
27283
27283
  var mergePropertyAndMethodDecorators = (d1, d22) => {
27284
- var _a2, _b, _c, _d;
27284
+ var _a, _b, _c, _d;
27285
27285
  return {
27286
- property: mergeObjectsOfDecorators((_a2 = d1 === null || d1 === void 0 ? void 0 : d1.property) !== null && _a2 !== void 0 ? _a2 : {}, (_b = d22 === null || d22 === void 0 ? void 0 : d22.property) !== null && _b !== void 0 ? _b : {}),
27286
+ property: mergeObjectsOfDecorators((_a = d1 === null || d1 === void 0 ? void 0 : d1.property) !== null && _a !== void 0 ? _a : {}, (_b = d22 === null || d22 === void 0 ? void 0 : d22.property) !== null && _b !== void 0 ? _b : {}),
27287
27287
  method: mergeObjectsOfDecorators((_c = d1 === null || d1 === void 0 ? void 0 : d1.method) !== null && _c !== void 0 ? _c : {}, (_d = d22 === null || d22 === void 0 ? void 0 : d22.method) !== null && _d !== void 0 ? _d : {})
27288
27288
  };
27289
27289
  };
27290
27290
  var mergeDecorators = (d1, d22) => {
27291
- var _a2, _b, _c, _d, _e2, _f;
27291
+ var _a, _b, _c, _d, _e2, _f;
27292
27292
  return {
27293
- class: (0, util_1.unique)([...(_a2 = d1 === null || d1 === void 0 ? void 0 : d1.class) !== null && _a2 !== void 0 ? _a2 : [], ...(_b = d22 === null || d22 === void 0 ? void 0 : d22.class) !== null && _b !== void 0 ? _b : []]),
27293
+ class: (0, util_1.unique)([...(_a = d1 === null || d1 === void 0 ? void 0 : d1.class) !== null && _a !== void 0 ? _a : [], ...(_b = d22 === null || d22 === void 0 ? void 0 : d22.class) !== null && _b !== void 0 ? _b : []]),
27294
27294
  static: mergePropertyAndMethodDecorators((_c = d1 === null || d1 === void 0 ? void 0 : d1.static) !== null && _c !== void 0 ? _c : {}, (_d = d22 === null || d22 === void 0 ? void 0 : d22.static) !== null && _d !== void 0 ? _d : {}),
27295
27295
  instance: mergePropertyAndMethodDecorators((_e2 = d1 === null || d1 === void 0 ? void 0 : d1.instance) !== null && _e2 !== void 0 ? _e2 : {}, (_f = d22 === null || d22 === void 0 ? void 0 : d22.instance) !== null && _f !== void 0 ? _f : {})
27296
27296
  };
27297
27297
  };
27298
27298
  var decorators = /* @__PURE__ */ new Map();
27299
27299
  var findAllConstituentClasses = (...classes) => {
27300
- var _a2;
27300
+ var _a;
27301
27301
  const allClasses = /* @__PURE__ */ new Set();
27302
27302
  const frontier = /* @__PURE__ */ new Set([...classes]);
27303
27303
  while (frontier.size > 0) {
27304
27304
  for (let clazz of frontier) {
27305
27305
  const protoChainClasses = (0, util_1.protoChain)(clazz.prototype).map((proto) => proto.constructor);
27306
- const mixinClasses = (_a2 = (0, mixin_tracking_1.getMixinsForClass)(clazz)) !== null && _a2 !== void 0 ? _a2 : [];
27306
+ const mixinClasses = (_a = (0, mixin_tracking_1.getMixinsForClass)(clazz)) !== null && _a !== void 0 ? _a : [];
27307
27307
  const potentiallyNewClasses = [...protoChainClasses, ...mixinClasses];
27308
27308
  const newClasses = potentiallyNewClasses.filter((c) => !allClasses.has(c));
27309
27309
  for (let newClass of newClasses)
@@ -27352,12 +27352,12 @@ var require_decorator = __commonJS({
27352
27352
  return decorator(clazz);
27353
27353
  };
27354
27354
  var decorateMember = (decorator) => (object, key, ...otherArgs) => {
27355
- var _a2, _b, _c;
27355
+ var _a, _b, _c;
27356
27356
  const decoratorTargetType = typeof object === "function" ? "static" : "instance";
27357
27357
  const decoratorType = typeof object[key] === "function" ? "method" : "property";
27358
27358
  const clazz = decoratorTargetType === "static" ? object : object.constructor;
27359
27359
  const decoratorsForClass = (0, exports2.getDecoratorsForClass)(clazz);
27360
- const decoratorsForTargetType = (_a2 = decoratorsForClass === null || decoratorsForClass === void 0 ? void 0 : decoratorsForClass[decoratorTargetType]) !== null && _a2 !== void 0 ? _a2 : {};
27360
+ const decoratorsForTargetType = (_a = decoratorsForClass === null || decoratorsForClass === void 0 ? void 0 : decoratorsForClass[decoratorTargetType]) !== null && _a !== void 0 ? _a : {};
27361
27361
  decoratorsForClass[decoratorTargetType] = decoratorsForTargetType;
27362
27362
  let decoratorsForType = (_b = decoratorsForTargetType === null || decoratorsForTargetType === void 0 ? void 0 : decoratorsForTargetType[decoratorType]) !== null && _b !== void 0 ? _b : {};
27363
27363
  decoratorsForTargetType[decoratorType] = decoratorsForType;
@@ -27387,7 +27387,7 @@ var require_mixins = __commonJS({
27387
27387
  var decorator_1 = require_decorator();
27388
27388
  var mixin_tracking_1 = require_mixin_tracking();
27389
27389
  function Mixin(...constructors) {
27390
- var _a2, _b, _c;
27390
+ var _a, _b, _c;
27391
27391
  const prototypes = constructors.map((constructor) => constructor.prototype);
27392
27392
  const initFunctionName = settings_1.settings.initFunction;
27393
27393
  if (initFunctionName !== null) {
@@ -27410,7 +27410,7 @@ var require_mixins = __commonJS({
27410
27410
  let DecoratedMixedClass = MixedClass;
27411
27411
  if (settings_1.settings.decoratorInheritance !== "none") {
27412
27412
  const classDecorators = settings_1.settings.decoratorInheritance === "deep" ? (0, decorator_1.deepDecoratorSearch)(...constructors) : (0, decorator_1.directDecoratorSearch)(...constructors);
27413
- for (let decorator of (_a2 = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.class) !== null && _a2 !== void 0 ? _a2 : []) {
27413
+ for (let decorator of (_a = classDecorators === null || classDecorators === void 0 ? void 0 : classDecorators.class) !== null && _a !== void 0 ? _a : []) {
27414
27414
  const result = decorator(DecoratedMixedClass);
27415
27415
  if (result) {
27416
27416
  DecoratedMixedClass = result;
@@ -27590,7 +27590,7 @@ var require_has_flag = __commonJS({
27590
27590
  var require_supports_colors = __commonJS({
27591
27591
  "../../node_modules/logform/node_modules/@colors/colors/lib/system/supports-colors.js"(exports2, module2) {
27592
27592
  "use strict";
27593
- var os = require("os");
27593
+ var os2 = require("os");
27594
27594
  var hasFlag = require_has_flag();
27595
27595
  var env = process.env;
27596
27596
  var forceColor = void 0;
@@ -27628,7 +27628,7 @@ var require_supports_colors = __commonJS({
27628
27628
  }
27629
27629
  var min = forceColor ? 1 : 0;
27630
27630
  if (process.platform === "win32") {
27631
- var osRelease = os.release().split(".");
27631
+ var osRelease = os2.release().split(".");
27632
27632
  if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
27633
27633
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
27634
27634
  }
@@ -29587,8 +29587,8 @@ var require_fecha_umd = __commonJS({
29587
29587
  for (var _i = 1; _i < arguments.length; _i++) {
29588
29588
  args[_i - 1] = arguments[_i];
29589
29589
  }
29590
- for (var _a2 = 0, args_1 = args; _a2 < args_1.length; _a2++) {
29591
- var obj = args_1[_a2];
29590
+ for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {
29591
+ var obj = args_1[_a];
29592
29592
  for (var key in obj) {
29593
29593
  origObj[key] = obj[key];
29594
29594
  }
@@ -29909,7 +29909,7 @@ var require_fecha_umd = __commonJS({
29909
29909
  }
29910
29910
  var combinedI18nSettings = assign(assign({}, globalI18n), i18n);
29911
29911
  for (var i = 1; i < matches.length; i++) {
29912
- var _a2 = parseInfo[i - 1], field = _a2[0], parser = _a2[2];
29912
+ var _a = parseInfo[i - 1], field = _a[0], parser = _a[2];
29913
29913
  var value = parser ? parser(matches[i], combinedI18nSettings) : +matches[i];
29914
29914
  if (value == null) {
29915
29915
  return null;
@@ -31298,11 +31298,11 @@ var require_from = __commonJS({
31298
31298
  Promise.resolve(value).then(_next, _throw);
31299
31299
  }
31300
31300
  }
31301
- function _asyncToGenerator(fn) {
31301
+ function _asyncToGenerator(fn2) {
31302
31302
  return function() {
31303
31303
  var self2 = this, args = arguments;
31304
31304
  return new Promise(function(resolve2, reject) {
31305
- var gen = fn.apply(self2, args);
31305
+ var gen = fn2.apply(self2, args);
31306
31306
  function _next(value) {
31307
31307
  asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "next", value);
31308
31308
  }
@@ -31445,11 +31445,11 @@ var require_stream_readable = __commonJS({
31445
31445
  require_inherits()(Readable2, Stream);
31446
31446
  var errorOrDestroy = destroyImpl.errorOrDestroy;
31447
31447
  var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
31448
- function prependListener(emitter, event, fn) {
31449
- if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn);
31450
- if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);
31451
- else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn);
31452
- else emitter._events[event] = [fn, emitter._events[event]];
31448
+ function prependListener(emitter, event, fn2) {
31449
+ if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn2);
31450
+ if (!emitter._events || !emitter._events[event]) emitter.on(event, fn2);
31451
+ else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn2);
31452
+ else emitter._events[event] = [fn2, emitter._events[event]];
31453
31453
  }
31454
31454
  function ReadableState(options, stream, isDuplex) {
31455
31455
  Duplex = Duplex || require_stream_duplex();
@@ -31897,8 +31897,8 @@ var require_stream_readable = __commonJS({
31897
31897
  dest.emit("unpipe", this, unpipeInfo);
31898
31898
  return this;
31899
31899
  };
31900
- Readable2.prototype.on = function(ev, fn) {
31901
- var res = Stream.prototype.on.call(this, ev, fn);
31900
+ Readable2.prototype.on = function(ev, fn2) {
31901
+ var res = Stream.prototype.on.call(this, ev, fn2);
31902
31902
  var state = this._readableState;
31903
31903
  if (ev === "data") {
31904
31904
  state.readableListening = this.listenerCount("readable") > 0;
@@ -31919,8 +31919,8 @@ var require_stream_readable = __commonJS({
31919
31919
  return res;
31920
31920
  };
31921
31921
  Readable2.prototype.addListener = Readable2.prototype.on;
31922
- Readable2.prototype.removeListener = function(ev, fn) {
31923
- var res = Stream.prototype.removeListener.call(this, ev, fn);
31922
+ Readable2.prototype.removeListener = function(ev, fn2) {
31923
+ var res = Stream.prototype.removeListener.call(this, ev, fn2);
31924
31924
  if (ev === "readable") {
31925
31925
  process.nextTick(updateReadableListening, this);
31926
31926
  }
@@ -32889,7 +32889,7 @@ var require_winston_transport = __commonJS({
32889
32889
  var require_console = __commonJS({
32890
32890
  "../../node_modules/winston/lib/winston/transports/console.js"(exports2, module2) {
32891
32891
  "use strict";
32892
- var os = require("os");
32892
+ var os2 = require("os");
32893
32893
  var { LEVEL, MESSAGE } = require_triple_beam();
32894
32894
  var TransportStream = require_winston_transport();
32895
32895
  module2.exports = class Console extends TransportStream {
@@ -32903,7 +32903,7 @@ var require_console = __commonJS({
32903
32903
  this.name = options.name || "console";
32904
32904
  this.stderrLevels = this._stringArrayToSet(options.stderrLevels);
32905
32905
  this.consoleWarnLevels = this._stringArrayToSet(options.consoleWarnLevels);
32906
- this.eol = typeof options.eol === "string" ? options.eol : os.EOL;
32906
+ this.eol = typeof options.eol === "string" ? options.eol : os2.EOL;
32907
32907
  this.forceConsole = options.forceConsole || false;
32908
32908
  this._consoleLog = console.log.bind(console);
32909
32909
  this._consoleWarn = console.warn.bind(console);
@@ -32996,10 +32996,10 @@ var require_initialParams2 = __commonJS({
32996
32996
  Object.defineProperty(exports2, "__esModule", {
32997
32997
  value: true
32998
32998
  });
32999
- exports2.default = function(fn) {
32999
+ exports2.default = function(fn2) {
33000
33000
  return function(...args) {
33001
33001
  var callback = args.pop();
33002
- return fn.call(this, args, callback);
33002
+ return fn2.call(this, args, callback);
33003
33003
  };
33004
33004
  };
33005
33005
  module2.exports = exports2.default;
@@ -33018,11 +33018,11 @@ var require_setImmediate2 = __commonJS({
33018
33018
  var hasQueueMicrotask = exports2.hasQueueMicrotask = typeof queueMicrotask === "function" && queueMicrotask;
33019
33019
  var hasSetImmediate = exports2.hasSetImmediate = typeof setImmediate === "function" && setImmediate;
33020
33020
  var hasNextTick = exports2.hasNextTick = typeof process === "object" && typeof process.nextTick === "function";
33021
- function fallback(fn) {
33022
- setTimeout(fn, 0);
33021
+ function fallback(fn2) {
33022
+ setTimeout(fn2, 0);
33023
33023
  }
33024
33024
  function wrap(defer) {
33025
- return (fn, ...args) => defer(() => fn(...args));
33025
+ return (fn2, ...args) => defer(() => fn2(...args));
33026
33026
  }
33027
33027
  var _defer;
33028
33028
  if (hasQueueMicrotask) {
@@ -33109,11 +33109,11 @@ var require_wrapAsync2 = __commonJS({
33109
33109
  function _interopRequireDefault(obj) {
33110
33110
  return obj && obj.__esModule ? obj : { default: obj };
33111
33111
  }
33112
- function isAsync(fn) {
33113
- return fn[Symbol.toStringTag] === "AsyncFunction";
33112
+ function isAsync(fn2) {
33113
+ return fn2[Symbol.toStringTag] === "AsyncFunction";
33114
33114
  }
33115
- function isAsyncGenerator(fn) {
33116
- return fn[Symbol.toStringTag] === "AsyncGenerator";
33115
+ function isAsyncGenerator(fn2) {
33116
+ return fn2[Symbol.toStringTag] === "AsyncGenerator";
33117
33117
  }
33118
33118
  function isAsyncIterable(obj) {
33119
33119
  return typeof obj[Symbol.asyncIterator] === "function";
@@ -33198,14 +33198,14 @@ var require_once2 = __commonJS({
33198
33198
  value: true
33199
33199
  });
33200
33200
  exports2.default = once;
33201
- function once(fn) {
33201
+ function once(fn2) {
33202
33202
  function wrapper(...args) {
33203
- if (fn === null) return;
33204
- var callFn = fn;
33205
- fn = null;
33203
+ if (fn2 === null) return;
33204
+ var callFn = fn2;
33205
+ fn2 = null;
33206
33206
  callFn.apply(this, args);
33207
33207
  }
33208
- Object.assign(wrapper, fn);
33208
+ Object.assign(wrapper, fn2);
33209
33209
  return wrapper;
33210
33210
  }
33211
33211
  module2.exports = exports2.default;
@@ -33288,11 +33288,11 @@ var require_onlyOnce2 = __commonJS({
33288
33288
  value: true
33289
33289
  });
33290
33290
  exports2.default = onlyOnce;
33291
- function onlyOnce(fn) {
33291
+ function onlyOnce(fn2) {
33292
33292
  return function(...args) {
33293
- if (fn === null) throw new Error("Callback was already called.");
33294
- var callFn = fn;
33295
- fn = null;
33293
+ if (fn2 === null) throw new Error("Callback was already called.");
33294
+ var callFn = fn2;
33295
+ fn2 = null;
33296
33296
  callFn.apply(this, args);
33297
33297
  };
33298
33298
  }
@@ -33539,14 +33539,14 @@ var require_stream_transform = __commonJS({
33539
33539
  var Duplex = require_stream_duplex();
33540
33540
  require_inherits()(Transform, Duplex);
33541
33541
  function afterTransform(er2, data2) {
33542
- var ts = this._transformState;
33543
- ts.transforming = false;
33544
- var cb = ts.writecb;
33542
+ var ts2 = this._transformState;
33543
+ ts2.transforming = false;
33544
+ var cb = ts2.writecb;
33545
33545
  if (cb === null) {
33546
33546
  return this.emit("error", new ERR_MULTIPLE_CALLBACK());
33547
33547
  }
33548
- ts.writechunk = null;
33549
- ts.writecb = null;
33548
+ ts2.writechunk = null;
33549
+ ts2.writecb = null;
33550
33550
  if (data2 != null)
33551
33551
  this.push(data2);
33552
33552
  cb(er2);
@@ -33593,22 +33593,22 @@ var require_stream_transform = __commonJS({
33593
33593
  cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()"));
33594
33594
  };
33595
33595
  Transform.prototype._write = function(chunk, encoding, cb) {
33596
- var ts = this._transformState;
33597
- ts.writecb = cb;
33598
- ts.writechunk = chunk;
33599
- ts.writeencoding = encoding;
33600
- if (!ts.transforming) {
33596
+ var ts2 = this._transformState;
33597
+ ts2.writecb = cb;
33598
+ ts2.writechunk = chunk;
33599
+ ts2.writeencoding = encoding;
33600
+ if (!ts2.transforming) {
33601
33601
  var rs = this._readableState;
33602
- if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
33602
+ if (ts2.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
33603
33603
  }
33604
33604
  };
33605
33605
  Transform.prototype._read = function(n) {
33606
- var ts = this._transformState;
33607
- if (ts.writechunk !== null && !ts.transforming) {
33608
- ts.transforming = true;
33609
- this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
33606
+ var ts2 = this._transformState;
33607
+ if (ts2.writechunk !== null && !ts2.transforming) {
33608
+ ts2.transforming = true;
33609
+ this._transform(ts2.writechunk, ts2.writeencoding, ts2.afterTransform);
33610
33610
  } else {
33611
- ts.needTransform = true;
33611
+ ts2.needTransform = true;
33612
33612
  }
33613
33613
  };
33614
33614
  Transform.prototype._destroy = function(err, cb) {
@@ -33691,11 +33691,11 @@ var require_pipeline = __commonJS({
33691
33691
  callback(err || new ERR_STREAM_DESTROYED("pipe"));
33692
33692
  };
33693
33693
  }
33694
- function call(fn) {
33695
- fn();
33694
+ function call(fn2) {
33695
+ fn2();
33696
33696
  }
33697
- function pipe(from, to) {
33698
- return from.pipe(to);
33697
+ function pipe(from, to2) {
33698
+ return from.pipe(to2);
33699
33699
  }
33700
33700
  function popCallback(streams) {
33701
33701
  if (!streams.length) return noop;
@@ -33780,17 +33780,17 @@ var require_diagnostics = __commonJS({
33780
33780
  if (!async.length) return false;
33781
33781
  return new Promise(function pinky(resolve2) {
33782
33782
  Promise.all(
33783
- async.map(function prebind(fn) {
33784
- return fn(namespace);
33783
+ async.map(function prebind(fn2) {
33784
+ return fn2(namespace);
33785
33785
  })
33786
33786
  ).then(function resolved(values) {
33787
33787
  resolve2(values.some(Boolean));
33788
33788
  });
33789
33789
  });
33790
33790
  }
33791
- function modify(fn) {
33792
- if (~modifiers.indexOf(fn)) return false;
33793
- modifiers.push(fn);
33791
+ function modify(fn2) {
33792
+ if (~modifiers.indexOf(fn2)) return false;
33793
+ modifiers.push(fn2);
33794
33794
  return true;
33795
33795
  }
33796
33796
  function write() {
@@ -33802,14 +33802,14 @@ var require_diagnostics = __commonJS({
33802
33802
  }
33803
33803
  return message;
33804
33804
  }
33805
- function introduce(fn, options) {
33805
+ function introduce(fn2, options) {
33806
33806
  var has = Object.prototype.hasOwnProperty;
33807
33807
  for (var key in options) {
33808
33808
  if (has.call(options, key)) {
33809
- fn[key] = options[key];
33809
+ fn2[key] = options[key];
33810
33810
  }
33811
33811
  }
33812
- return fn;
33812
+ return fn2;
33813
33813
  }
33814
33814
  function nope(options) {
33815
33815
  options.enabled = false;
@@ -34053,9 +34053,9 @@ var require_simple_swizzle = __commonJS({
34053
34053
  }
34054
34054
  return results;
34055
34055
  };
34056
- swizzle.wrap = function(fn) {
34056
+ swizzle.wrap = function(fn2) {
34057
34057
  return function() {
34058
- return fn(swizzle(arguments));
34058
+ return fn2(swizzle(arguments));
34059
34059
  };
34060
34060
  };
34061
34061
  }
@@ -35155,22 +35155,22 @@ var require_route = __commonJS({
35155
35155
  }
35156
35156
  return graph;
35157
35157
  }
35158
- function link(from, to) {
35158
+ function link(from, to2) {
35159
35159
  return function(args) {
35160
- return to(from(args));
35160
+ return to2(from(args));
35161
35161
  };
35162
35162
  }
35163
35163
  function wrapConversion(toModel, graph) {
35164
35164
  var path = [graph[toModel].parent, toModel];
35165
- var fn = conversions[graph[toModel].parent][toModel];
35165
+ var fn2 = conversions[graph[toModel].parent][toModel];
35166
35166
  var cur = graph[toModel].parent;
35167
35167
  while (graph[cur].parent) {
35168
35168
  path.unshift(graph[cur].parent);
35169
- fn = link(conversions[graph[cur].parent][cur], fn);
35169
+ fn2 = link(conversions[graph[cur].parent][cur], fn2);
35170
35170
  cur = graph[cur].parent;
35171
35171
  }
35172
- fn.conversion = path;
35173
- return fn;
35172
+ fn2.conversion = path;
35173
+ return fn2;
35174
35174
  }
35175
35175
  module2.exports = function(fromModel) {
35176
35176
  var graph = deriveBFS(fromModel);
@@ -35197,7 +35197,7 @@ var require_color_convert = __commonJS({
35197
35197
  var route = require_route();
35198
35198
  var convert = {};
35199
35199
  var models = Object.keys(conversions);
35200
- function wrapRaw(fn) {
35200
+ function wrapRaw(fn2) {
35201
35201
  var wrappedFn = function(args) {
35202
35202
  if (args === void 0 || args === null) {
35203
35203
  return args;
@@ -35205,14 +35205,14 @@ var require_color_convert = __commonJS({
35205
35205
  if (arguments.length > 1) {
35206
35206
  args = Array.prototype.slice.call(arguments);
35207
35207
  }
35208
- return fn(args);
35208
+ return fn2(args);
35209
35209
  };
35210
- if ("conversion" in fn) {
35211
- wrappedFn.conversion = fn.conversion;
35210
+ if ("conversion" in fn2) {
35211
+ wrappedFn.conversion = fn2.conversion;
35212
35212
  }
35213
35213
  return wrappedFn;
35214
35214
  }
35215
- function wrapRounded(fn) {
35215
+ function wrapRounded(fn2) {
35216
35216
  var wrappedFn = function(args) {
35217
35217
  if (args === void 0 || args === null) {
35218
35218
  return args;
@@ -35220,7 +35220,7 @@ var require_color_convert = __commonJS({
35220
35220
  if (arguments.length > 1) {
35221
35221
  args = Array.prototype.slice.call(arguments);
35222
35222
  }
35223
- var result = fn(args);
35223
+ var result = fn2(args);
35224
35224
  if (typeof result === "object") {
35225
35225
  for (var len = result.length, i = 0; i < len; i++) {
35226
35226
  result[i] = Math.round(result[i]);
@@ -35228,8 +35228,8 @@ var require_color_convert = __commonJS({
35228
35228
  }
35229
35229
  return result;
35230
35230
  };
35231
- if ("conversion" in fn) {
35232
- wrappedFn.conversion = fn.conversion;
35231
+ if ("conversion" in fn2) {
35232
+ wrappedFn.conversion = fn2.conversion;
35233
35233
  }
35234
35234
  return wrappedFn;
35235
35235
  }
@@ -35240,9 +35240,9 @@ var require_color_convert = __commonJS({
35240
35240
  var routes = route(fromModel);
35241
35241
  var routeModels = Object.keys(routes);
35242
35242
  routeModels.forEach(function(toModel) {
35243
- var fn = routes[toModel];
35244
- convert[fromModel][toModel] = wrapRounded(fn);
35245
- convert[fromModel][toModel].raw = wrapRaw(fn);
35243
+ var fn2 = routes[toModel];
35244
+ convert[fromModel][toModel] = wrapRounded(fn2);
35245
+ convert[fromModel][toModel].raw = wrapRaw(fn2);
35246
35246
  });
35247
35247
  });
35248
35248
  module2.exports = convert;
@@ -35752,10 +35752,10 @@ var require_adapters = __commonJS({
35752
35752
  "../../node_modules/@dabh/diagnostics/adapters/index.js"(exports2, module2) {
35753
35753
  "use strict";
35754
35754
  var enabled = require_enabled();
35755
- module2.exports = function create(fn) {
35755
+ module2.exports = function create(fn2) {
35756
35756
  return function adapter(namespace) {
35757
35757
  try {
35758
- return enabled(namespace, fn());
35758
+ return enabled(namespace, fn2());
35759
35759
  } catch (e) {
35760
35760
  }
35761
35761
  return false;
@@ -35931,7 +35931,7 @@ var require_file = __commonJS({
35931
35931
  var { Stream, PassThrough } = require_readable();
35932
35932
  var TransportStream = require_winston_transport();
35933
35933
  var debug = require_node2()("winston:file");
35934
- var os = require("os");
35934
+ var os2 = require("os");
35935
35935
  var tailFile = require_tail_file();
35936
35936
  module2.exports = class File extends TransportStream {
35937
35937
  /**
@@ -35969,7 +35969,7 @@ var require_file = __commonJS({
35969
35969
  this.rotationFormat = options.rotationFormat || false;
35970
35970
  this.zippedArchive = options.zippedArchive || false;
35971
35971
  this.maxFiles = options.maxFiles || null;
35972
- this.eol = typeof options.eol === "string" ? options.eol : os.EOL;
35972
+ this.eol = typeof options.eol === "string" ? options.eol : os2.EOL;
35973
35973
  this.tailable = options.tailable || false;
35974
35974
  this.lazy = options.lazy || false;
35975
35975
  this._size = 0;
@@ -36750,7 +36750,7 @@ var require_stream3 = __commonJS({
36750
36750
  "use strict";
36751
36751
  var isStream = require_is_stream();
36752
36752
  var { MESSAGE } = require_triple_beam();
36753
- var os = require("os");
36753
+ var os2 = require("os");
36754
36754
  var TransportStream = require_winston_transport();
36755
36755
  module2.exports = class Stream extends TransportStream {
36756
36756
  /**
@@ -36766,7 +36766,7 @@ var require_stream3 = __commonJS({
36766
36766
  this._stream = options.stream;
36767
36767
  this._stream.setMaxListeners(Infinity);
36768
36768
  this.isObjectMode = options.stream._writableState.objectMode;
36769
- this.eol = typeof options.eol === "string" ? options.eol : os.EOL;
36769
+ this.eol = typeof options.eol === "string" ? options.eol : os2.EOL;
36770
36770
  }
36771
36771
  /**
36772
36772
  * Core logging method exposed to Winston.
@@ -36944,14 +36944,14 @@ var require_fn = __commonJS({
36944
36944
  "../../node_modules/fn.name/index.js"(exports2, module2) {
36945
36945
  "use strict";
36946
36946
  var toString = Object.prototype.toString;
36947
- module2.exports = function name(fn) {
36948
- if ("string" === typeof fn.displayName && fn.constructor.name) {
36949
- return fn.displayName;
36950
- } else if ("string" === typeof fn.name && fn.name) {
36951
- return fn.name;
36952
- }
36953
- if ("object" === typeof fn && fn.constructor && "string" === typeof fn.constructor.name) return fn.constructor.name;
36954
- var named = fn.toString(), type = toString.call(fn).slice(8, -1);
36947
+ module2.exports = function name(fn2) {
36948
+ if ("string" === typeof fn2.displayName && fn2.constructor.name) {
36949
+ return fn2.displayName;
36950
+ } else if ("string" === typeof fn2.name && fn2.name) {
36951
+ return fn2.name;
36952
+ }
36953
+ if ("object" === typeof fn2 && fn2.constructor && "string" === typeof fn2.constructor.name) return fn2.constructor.name;
36954
+ var named = fn2.toString(), type = toString.call(fn2).slice(8, -1);
36955
36955
  if ("Function" === type) {
36956
36956
  named = named.substring(named.indexOf("(") + 1, named.indexOf(")"));
36957
36957
  } else {
@@ -36967,16 +36967,16 @@ var require_one_time = __commonJS({
36967
36967
  "../../node_modules/one-time/index.js"(exports2, module2) {
36968
36968
  "use strict";
36969
36969
  var name = require_fn();
36970
- module2.exports = function one(fn) {
36970
+ module2.exports = function one(fn2) {
36971
36971
  var called = 0, value;
36972
36972
  function onetime() {
36973
36973
  if (called) return value;
36974
36974
  called = 1;
36975
- value = fn.apply(this, arguments);
36976
- fn = null;
36975
+ value = fn2.apply(this, arguments);
36976
+ fn2 = null;
36977
36977
  return value;
36978
36978
  }
36979
- onetime.displayName = name(fn);
36979
+ onetime.displayName = name(fn2);
36980
36980
  return onetime;
36981
36981
  };
36982
36982
  }
@@ -37150,7 +37150,7 @@ var require_exception_stream = __commonJS({
37150
37150
  var require_exception_handler = __commonJS({
37151
37151
  "../../node_modules/winston/lib/winston/exception-handler.js"(exports2, module2) {
37152
37152
  "use strict";
37153
- var os = require("os");
37153
+ var os2 = require("os");
37154
37154
  var asyncForEach = require_forEach();
37155
37155
  var debug = require_node2()("winston:exception");
37156
37156
  var once = require_one_time();
@@ -37245,8 +37245,8 @@ var require_exception_handler = __commonJS({
37245
37245
  */
37246
37246
  getOsInfo() {
37247
37247
  return {
37248
- loadavg: os.loadavg(),
37249
- uptime: os.uptime()
37248
+ loadavg: os2.loadavg(),
37249
+ uptime: os2.uptime()
37250
37250
  };
37251
37251
  }
37252
37252
  /**
@@ -37388,7 +37388,7 @@ var require_rejection_stream = __commonJS({
37388
37388
  var require_rejection_handler = __commonJS({
37389
37389
  "../../node_modules/winston/lib/winston/rejection-handler.js"(exports2, module2) {
37390
37390
  "use strict";
37391
- var os = require("os");
37391
+ var os2 = require("os");
37392
37392
  var asyncForEach = require_forEach();
37393
37393
  var debug = require_node2()("winston:rejection");
37394
37394
  var once = require_one_time();
@@ -37485,8 +37485,8 @@ var require_rejection_handler = __commonJS({
37485
37485
  */
37486
37486
  getOsInfo() {
37487
37487
  return {
37488
- loadavg: os.loadavg(),
37489
- uptime: os.uptime()
37488
+ loadavg: os2.loadavg(),
37489
+ uptime: os2.uptime()
37490
37490
  };
37491
37491
  }
37492
37492
  /**
@@ -40510,17 +40510,17 @@ var Jt = "not-modified";
40510
40510
  var Zt = "not-found";
40511
40511
  var er = "unauthorized";
40512
40512
  var Ze = "accepted";
40513
- var un = { resourceType: "OperationOutcome", id: Zt, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
40513
+ var ln = { resourceType: "OperationOutcome", id: Zt, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
40514
40514
  var Re = { resourceType: "OperationOutcome", id: er, issue: [{ severity: "error", code: "login", details: { text: "Unauthorized" } }] };
40515
- var ln = { ...Re, issue: [...Re.issue, { severity: "error", code: "expired", details: { text: "Token expired" } }] };
40515
+ var pn = { ...Re, issue: [...Re.issue, { severity: "error", code: "expired", details: { text: "Token expired" } }] };
40516
40516
  var tr = { ...Re, issue: [...Re.issue, { severity: "error", code: "invalid", details: { text: "Token not issued for this audience" } }] };
40517
- function b(r7, e) {
40517
+ function S(r7, e) {
40518
40518
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "invalid", details: { text: r7 }, ...e ? { expression: [e] } : void 0 }] };
40519
40519
  }
40520
40520
  function m(r7) {
40521
40521
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "structure", details: { text: r7 } }] };
40522
40522
  }
40523
- function pn(r7) {
40523
+ function dn(r7) {
40524
40524
  return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "exception", details: { text: "Internal server error" }, diagnostics: r7.toString() }] };
40525
40525
  }
40526
40526
  function Ce(r7) {
@@ -40531,74 +40531,74 @@ function rr(r7) {
40531
40531
  }
40532
40532
  var d = class extends Error {
40533
40533
  constructor(e, t) {
40534
- super(dn(e)), this.outcome = e, this.cause = t;
40534
+ super(fn(e)), this.outcome = e, this.cause = t;
40535
40535
  }
40536
40536
  };
40537
40537
  function Xe(r7) {
40538
- return r7 instanceof d ? r7.outcome : Ce(r7) ? r7 : b(Pe(r7));
40538
+ return r7 instanceof d ? r7.outcome : Ce(r7) ? r7 : S(Pe(r7));
40539
40539
  }
40540
40540
  function Pe(r7) {
40541
- return r7 ? typeof r7 == "string" ? r7 : r7 instanceof Error ? r7.message : Ce(r7) ? dn(r7) : typeof r7 == "object" && "code" in r7 && typeof r7.code == "string" ? r7.code : JSON.stringify(r7) : "Unknown error";
40541
+ return r7 ? typeof r7 == "string" ? r7 : r7 instanceof Error ? r7.message : Ce(r7) ? fn(r7) : typeof r7 == "object" && "code" in r7 && typeof r7.code == "string" ? r7.code : JSON.stringify(r7) : "Unknown error";
40542
40542
  }
40543
- function dn(r7) {
40544
- let e = r7.issue?.map(eo) ?? [];
40543
+ function fn(r7) {
40544
+ let e = r7.issue?.map(to) ?? [];
40545
40545
  return e.length > 0 ? e.join("; ") : "Unknown error";
40546
40546
  }
40547
- function eo(r7) {
40547
+ function to(r7) {
40548
40548
  let e;
40549
40549
  return r7.details?.text ? r7.diagnostics ? e = `${r7.details.text} (${r7.diagnostics})` : e = r7.details.text : r7.diagnostics ? e = r7.diagnostics : e = "Unknown error", r7.expression?.length && (e += ` (${r7.expression.join(", ")})`), e;
40550
40550
  }
40551
- function ro(r7, e) {
40551
+ function no(r7, e) {
40552
40552
  let t = e.max && e.max === Number.MAX_SAFE_INTEGER ? Number.POSITIVE_INFINITY : e.max;
40553
40553
  return { path: r7, description: "", type: e.type ?? [], min: e.min ?? 0, max: t ?? 1, isArray: !!t && t > 1, constraints: [] };
40554
40554
  }
40555
- function mn(r7) {
40555
+ function yn(r7) {
40556
40556
  let e = /* @__PURE__ */ Object.create(null);
40557
- for (let [t, n] of Object.entries(r7)) e[t] = { name: t, type: t, path: t, elements: Object.fromEntries(Object.entries(n.elements).map(([i, o]) => [i, ro(i, o)])), constraints: [], innerTypes: [] };
40557
+ for (let [t, n] of Object.entries(r7)) e[t] = { name: t, type: t, path: t, elements: Object.fromEntries(Object.entries(n.elements).map(([i, o]) => [i, no(i, o)])), constraints: [], innerTypes: [] };
40558
40558
  return e;
40559
40559
  }
40560
- var yn = { Element: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, BackboneElement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, Address: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: 9007199254740991, type: [{ code: "string" }] }, city: { type: [{ code: "string" }] }, district: { type: [{ code: "string" }] }, state: { type: [{ code: "string" }] }, postalCode: { type: [{ code: "string" }] }, country: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Age: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "author[x]": { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Organization"] }, { code: "string" }] }, time: { type: [{ code: "dateTime" }] }, text: { min: 1, type: [{ code: "markdown" }] } } }, Attachment: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, contentType: { type: [{ code: "code" }] }, language: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] }, url: { type: [{ code: "url" }] }, size: { type: [{ code: "unsignedInt" }] }, hash: { type: [{ code: "base64Binary" }] }, title: { type: [{ code: "string" }] }, creation: { type: [{ code: "dateTime" }] } } }, CodeableConcept: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, coding: { max: 9007199254740991, type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: 9007199254740991, type: [{ code: "ContactPoint" }] } } }, ContactPoint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] } } }, Count: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, "subject[x]": { type: [{ code: "CodeableConcept" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Group"] }] }, mustSupport: { max: 9007199254740991, type: [{ code: "string" }] }, codeFilter: { max: 9007199254740991, type: [{ code: "DataRequirementCodeFilter" }] }, dateFilter: { max: 9007199254740991, type: [{ code: "DataRequirementDateFilter" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: 9007199254740991, type: [{ code: "DataRequirementSort" }] } } }, DataRequirementCodeFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] } } }, DataRequirementDateFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, "value[x]": { type: [{ code: "dateTime" }, { code: "Period" }, { code: "Duration" }] } } }, DataRequirementSort: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, direction: { min: 1, type: [{ code: "code" }] } } }, Distance: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] }, patientInstruction: { type: [{ code: "string" }] }, timing: { type: [{ code: "Timing" }] }, "asNeeded[x]": { type: [{ code: "boolean" }, { code: "CodeableConcept" }] }, site: { type: [{ code: "CodeableConcept" }] }, route: { type: [{ code: "CodeableConcept" }] }, method: { type: [{ code: "CodeableConcept" }] }, doseAndRate: { max: 9007199254740991, type: [{ code: "DosageDoseAndRate" }] }, maxDosePerPeriod: { type: [{ code: "Ratio" }] }, maxDosePerAdministration: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, maxDosePerLifetime: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, DosageDoseAndRate: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { type: [{ code: "CodeableConcept" }] }, "dose[x]": { type: [{ code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, "rate[x]": { type: [{ code: "Ratio" }, { code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Duration: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: 9007199254740991, type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] }, slicing: { type: [{ code: "ElementDefinitionSlicing" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: 9007199254740991, type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "ElementDefinitionBase" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: 9007199254740991, type: [{ code: "ElementDefinitionType" }] }, "defaultValue[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, meaningWhenMissing: { type: [{ code: "markdown" }] }, orderMeaning: { type: [{ code: "string" }] }, "fixed[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, "pattern[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, example: { max: 9007199254740991, type: [{ code: "ElementDefinitionExample" }] }, "minValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, "maxValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, maxLength: { type: [{ code: "integer" }] }, condition: { max: 9007199254740991, type: [{ code: "id" }] }, constraint: { max: 9007199254740991, type: [{ code: "ElementDefinitionConstraint" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "ElementDefinitionBinding" }] }, mapping: { max: 9007199254740991, type: [{ code: "ElementDefinitionMapping" }] } } }, ElementDefinitionSlicingDiscriminator: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, path: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionSlicing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, discriminator: { max: 9007199254740991, type: [{ code: "ElementDefinitionSlicingDiscriminator" }] }, description: { type: [{ code: "string" }] }, ordered: { type: [{ code: "boolean" }] }, rules: { min: 1, type: [{ code: "code" }] } } }, ElementDefinitionBase: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, min: { min: 1, type: [{ code: "unsignedInt" }] }, max: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionType: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, targetProfile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, aggregation: { max: 9007199254740991, type: [{ code: "code" }] }, versioning: { type: [{ code: "code" }] } } }, ElementDefinitionExample: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, label: { min: 1, type: [{ code: "string" }] }, "value[x]": { min: 1, type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, ElementDefinitionConstraint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, key: { min: 1, type: [{ code: "id" }] }, requirements: { type: [{ code: "string" }] }, severity: { min: 1, type: [{ code: "code" }] }, human: { min: 1, type: [{ code: "string" }] }, expression: { type: [{ code: "string" }] }, xpath: { type: [{ code: "string" }] }, source: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, ElementDefinitionBinding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, strength: { min: 1, type: [{ code: "code" }] }, description: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] } } }, ElementDefinitionMapping: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identity: { min: 1, type: [{ code: "id" }] }, language: { type: [{ code: "code" }] }, map: { min: 1, type: [{ code: "string" }] }, comment: { type: [{ code: "string" }] } } }, Expression: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, description: { type: [{ code: "string" }] }, name: { type: [{ code: "id" }] }, language: { min: 1, type: [{ code: "code" }] }, expression: { type: [{ code: "string" }] }, reference: { type: [{ code: "uri" }] } } }, Extension: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "uri" }] }, "value[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, HumanName: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: 9007199254740991, type: [{ code: "string" }] }, prefix: { max: 9007199254740991, type: [{ code: "string" }] }, suffix: { max: 9007199254740991, type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "CodeableConcept" }] }, system: { type: [{ code: "uri" }] }, value: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] }, assigner: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MarketingStatus: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, country: { min: 1, type: [{ code: "CodeableConcept" }] }, jurisdiction: { type: [{ code: "CodeableConcept" }] }, status: { min: 1, type: [{ code: "CodeableConcept" }] }, dateRange: { min: 1, type: [{ code: "Period" }] }, restoreDate: { type: [{ code: "dateTime" }] } } }, Meta: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: 9007199254740991, type: [{ code: "Coding" }] }, tag: { max: 9007199254740991, type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, onBehalfOf: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, accounts: { max: 9007199254740991, type: [{ code: "Reference" }] }, compartment: { max: 9007199254740991, type: [{ code: "Reference" }] } } }, Money: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "code" }] }, use: { min: 1, type: [{ code: "code" }] }, min: { type: [{ code: "integer" }] }, max: { type: [{ code: "string" }] }, documentation: { type: [{ code: "string" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, Period: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, height: { type: [{ code: "Quantity" }] }, width: { type: [{ code: "Quantity" }] }, depth: { type: [{ code: "Quantity" }] }, weight: { type: [{ code: "Quantity" }] }, nominalVolume: { type: [{ code: "Quantity" }] }, externalDiameter: { type: [{ code: "Quantity" }] }, shape: { type: [{ code: "string" }] }, color: { max: 9007199254740991, type: [{ code: "string" }] }, imprint: { max: 9007199254740991, type: [{ code: "string" }] }, image: { max: 9007199254740991, type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, Quantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Range: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, low: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, high: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Ratio: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, label: { type: [{ code: "string" }] }, display: { type: [{ code: "string" }] }, citation: { type: [{ code: "markdown" }] }, url: { type: [{ code: "url" }] }, document: { type: [{ code: "Attachment" }] }, resource: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Resource"] }] } } }, SampledData: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, origin: { min: 1, type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, period: { min: 1, type: [{ code: "decimal" }] }, factor: { type: [{ code: "decimal" }] }, lowerLimit: { type: [{ code: "decimal" }] }, upperLimit: { type: [{ code: "decimal" }] }, dimensions: { min: 1, type: [{ code: "positiveInt" }] }, data: { type: [{ code: "string" }] } } }, Signature: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, max: 9007199254740991, type: [{ code: "Coding" }] }, when: { min: 1, type: [{ code: "instant" }] }, who: { min: 1, type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, onBehalfOf: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, targetFormat: { type: [{ code: "code" }] }, sigFormat: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] } } }, SubstanceAmount: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "SubstanceAmountReferenceRange" }] } } }, SubstanceAmountReferenceRange: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, lowLimit: { type: [{ code: "Quantity" }] }, highLimit: { type: [{ code: "Quantity" }] } } }, Timing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, event: { max: 9007199254740991, type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "TimingRepeat" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TimingRepeat: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "bounds[x]": { type: [{ code: "Duration" }, { code: "Range" }, { code: "Period" }] }, count: { type: [{ code: "positiveInt" }] }, countMax: { type: [{ code: "positiveInt" }] }, duration: { type: [{ code: "decimal" }] }, durationMax: { type: [{ code: "decimal" }] }, durationUnit: { type: [{ code: "code" }] }, frequency: { type: [{ code: "positiveInt" }] }, frequencyMax: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "decimal" }] }, periodMax: { type: [{ code: "decimal" }] }, periodUnit: { type: [{ code: "code" }] }, dayOfWeek: { max: 9007199254740991, type: [{ code: "code" }] }, timeOfDay: { max: 9007199254740991, type: [{ code: "time" }] }, when: { max: 9007199254740991, type: [{ code: "code" }] }, offset: { type: [{ code: "unsignedInt" }] } } }, TriggerDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { type: [{ code: "string" }] }, "timing[x]": { type: [{ code: "Timing" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Schedule"] }, { code: "date" }, { code: "dateTime" }] }, data: { max: 9007199254740991, type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "Coding" }] }, "value[x]": { min: 1, type: [{ code: "CodeableConcept" }, { code: "Quantity" }, { code: "Range" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/PlanDefinition", "http://hl7.org/fhir/StructureDefinition/ResearchStudy", "http://hl7.org/fhir/StructureDefinition/InsurancePlan", "http://hl7.org/fhir/StructureDefinition/HealthcareService", "http://hl7.org/fhir/StructureDefinition/Group", "http://hl7.org/fhir/StructureDefinition/Location", "http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MoneyQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, SimpleQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { max: 0, type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, IdentityProvider: { elements: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, tokenAuthMethod: { type: [{ code: "code" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, usePkce: { type: [{ code: "boolean" }] }, useSubject: { type: [{ code: "boolean" }] } } } };
40560
+ var gn = { Element: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, BackboneElement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] } } }, Address: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, line: { max: 9007199254740991, type: [{ code: "string" }] }, city: { type: [{ code: "string" }] }, district: { type: [{ code: "string" }] }, state: { type: [{ code: "string" }] }, postalCode: { type: [{ code: "string" }] }, country: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Age: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Annotation: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "author[x]": { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Organization"] }, { code: "string" }] }, time: { type: [{ code: "dateTime" }] }, text: { min: 1, type: [{ code: "markdown" }] } } }, Attachment: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, contentType: { type: [{ code: "code" }] }, language: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] }, url: { type: [{ code: "url" }] }, size: { type: [{ code: "unsignedInt" }] }, hash: { type: [{ code: "base64Binary" }] }, title: { type: [{ code: "string" }] }, creation: { type: [{ code: "dateTime" }] } } }, CodeableConcept: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, coding: { max: 9007199254740991, type: [{ code: "Coding" }] }, text: { type: [{ code: "string" }] } } }, Coding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "uri" }] }, version: { type: [{ code: "string" }] }, code: { type: [{ code: "code" }] }, display: { type: [{ code: "string" }] }, userSelected: { type: [{ code: "boolean" }] } } }, ContactDetail: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "string" }] }, telecom: { max: 9007199254740991, type: [{ code: "ContactPoint" }] } } }, ContactPoint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, system: { type: [{ code: "code" }] }, value: { type: [{ code: "string" }] }, use: { type: [{ code: "code" }] }, rank: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "Period" }] } } }, Contributor: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { min: 1, type: [{ code: "string" }] }, contact: { max: 9007199254740991, type: [{ code: "ContactDetail" }] } } }, Count: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, DataRequirement: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, "subject[x]": { type: [{ code: "CodeableConcept" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Group"] }] }, mustSupport: { max: 9007199254740991, type: [{ code: "string" }] }, codeFilter: { max: 9007199254740991, type: [{ code: "DataRequirementCodeFilter" }] }, dateFilter: { max: 9007199254740991, type: [{ code: "DataRequirementDateFilter" }] }, limit: { type: [{ code: "positiveInt" }] }, sort: { max: 9007199254740991, type: [{ code: "DataRequirementSort" }] } } }, DataRequirementCodeFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] } } }, DataRequirementDateFilter: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { type: [{ code: "string" }] }, searchParam: { type: [{ code: "string" }] }, "value[x]": { type: [{ code: "dateTime" }, { code: "Period" }, { code: "Duration" }] } } }, DataRequirementSort: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, direction: { min: 1, type: [{ code: "code" }] } } }, Distance: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Dosage: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, sequence: { type: [{ code: "integer" }] }, text: { type: [{ code: "string" }] }, additionalInstruction: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] }, patientInstruction: { type: [{ code: "string" }] }, timing: { type: [{ code: "Timing" }] }, "asNeeded[x]": { type: [{ code: "boolean" }, { code: "CodeableConcept" }] }, site: { type: [{ code: "CodeableConcept" }] }, route: { type: [{ code: "CodeableConcept" }] }, method: { type: [{ code: "CodeableConcept" }] }, doseAndRate: { max: 9007199254740991, type: [{ code: "DosageDoseAndRate" }] }, maxDosePerPeriod: { type: [{ code: "Ratio" }] }, maxDosePerAdministration: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, maxDosePerLifetime: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, DosageDoseAndRate: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { type: [{ code: "CodeableConcept" }] }, "dose[x]": { type: [{ code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, "rate[x]": { type: [{ code: "Ratio" }, { code: "Range" }, { code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Duration: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, ElementDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, representation: { max: 9007199254740991, type: [{ code: "code" }] }, sliceName: { type: [{ code: "string" }] }, sliceIsConstraining: { type: [{ code: "boolean" }] }, label: { type: [{ code: "string" }] }, code: { max: 9007199254740991, type: [{ code: "Coding" }] }, slicing: { type: [{ code: "ElementDefinitionSlicing" }] }, short: { type: [{ code: "string" }] }, definition: { type: [{ code: "markdown" }] }, comment: { type: [{ code: "markdown" }] }, requirements: { type: [{ code: "markdown" }] }, alias: { max: 9007199254740991, type: [{ code: "string" }] }, min: { type: [{ code: "unsignedInt" }] }, max: { type: [{ code: "string" }] }, base: { type: [{ code: "ElementDefinitionBase" }] }, contentReference: { type: [{ code: "uri" }] }, type: { max: 9007199254740991, type: [{ code: "ElementDefinitionType" }] }, "defaultValue[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, meaningWhenMissing: { type: [{ code: "markdown" }] }, orderMeaning: { type: [{ code: "string" }] }, "fixed[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, "pattern[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] }, example: { max: 9007199254740991, type: [{ code: "ElementDefinitionExample" }] }, "minValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, "maxValue[x]": { type: [{ code: "date" }, { code: "dateTime" }, { code: "instant" }, { code: "time" }, { code: "decimal" }, { code: "integer" }, { code: "positiveInt" }, { code: "unsignedInt" }, { code: "Quantity" }] }, maxLength: { type: [{ code: "integer" }] }, condition: { max: 9007199254740991, type: [{ code: "id" }] }, constraint: { max: 9007199254740991, type: [{ code: "ElementDefinitionConstraint" }] }, mustSupport: { type: [{ code: "boolean" }] }, isModifier: { type: [{ code: "boolean" }] }, isModifierReason: { type: [{ code: "string" }] }, isSummary: { type: [{ code: "boolean" }] }, binding: { type: [{ code: "ElementDefinitionBinding" }] }, mapping: { max: 9007199254740991, type: [{ code: "ElementDefinitionMapping" }] } } }, ElementDefinitionSlicingDiscriminator: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, path: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionSlicing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, discriminator: { max: 9007199254740991, type: [{ code: "ElementDefinitionSlicingDiscriminator" }] }, description: { type: [{ code: "string" }] }, ordered: { type: [{ code: "boolean" }] }, rules: { min: 1, type: [{ code: "code" }] } } }, ElementDefinitionBase: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, path: { min: 1, type: [{ code: "string" }] }, min: { min: 1, type: [{ code: "unsignedInt" }] }, max: { min: 1, type: [{ code: "string" }] } } }, ElementDefinitionType: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, targetProfile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition", "http://hl7.org/fhir/StructureDefinition/ImplementationGuide"] }] }, aggregation: { max: 9007199254740991, type: [{ code: "code" }] }, versioning: { type: [{ code: "code" }] } } }, ElementDefinitionExample: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, label: { min: 1, type: [{ code: "string" }] }, "value[x]": { min: 1, type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, ElementDefinitionConstraint: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, key: { min: 1, type: [{ code: "id" }] }, requirements: { type: [{ code: "string" }] }, severity: { min: 1, type: [{ code: "code" }] }, human: { min: 1, type: [{ code: "string" }] }, expression: { type: [{ code: "string" }] }, xpath: { type: [{ code: "string" }] }, source: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, ElementDefinitionBinding: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, strength: { min: 1, type: [{ code: "code" }] }, description: { type: [{ code: "string" }] }, valueSet: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/ValueSet"] }] } } }, ElementDefinitionMapping: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identity: { min: 1, type: [{ code: "id" }] }, language: { type: [{ code: "code" }] }, map: { min: 1, type: [{ code: "string" }] }, comment: { type: [{ code: "string" }] } } }, Expression: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, description: { type: [{ code: "string" }] }, name: { type: [{ code: "id" }] }, language: { min: 1, type: [{ code: "code" }] }, expression: { type: [{ code: "string" }] }, reference: { type: [{ code: "uri" }] } } }, Extension: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, url: { min: 1, type: [{ code: "uri" }] }, "value[x]": { type: [{ code: "base64Binary" }, { code: "boolean" }, { code: "canonical" }, { code: "code" }, { code: "date" }, { code: "dateTime" }, { code: "decimal" }, { code: "id" }, { code: "instant" }, { code: "integer" }, { code: "markdown" }, { code: "oid" }, { code: "positiveInt" }, { code: "string" }, { code: "time" }, { code: "unsignedInt" }, { code: "uri" }, { code: "url" }, { code: "uuid" }, { code: "Address" }, { code: "Age" }, { code: "Annotation" }, { code: "Attachment" }, { code: "CodeableConcept" }, { code: "Coding" }, { code: "ContactPoint" }, { code: "Count" }, { code: "Distance" }, { code: "Duration" }, { code: "HumanName" }, { code: "Identifier" }, { code: "Money" }, { code: "Period" }, { code: "Quantity" }, { code: "Range" }, { code: "Ratio" }, { code: "Reference" }, { code: "SampledData" }, { code: "Signature" }, { code: "Timing" }, { code: "ContactDetail" }, { code: "Contributor" }, { code: "DataRequirement" }, { code: "Expression" }, { code: "ParameterDefinition" }, { code: "RelatedArtifact" }, { code: "TriggerDefinition" }, { code: "UsageContext" }, { code: "Dosage" }, { code: "Meta" }] } } }, HumanName: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, text: { type: [{ code: "string" }] }, family: { type: [{ code: "string" }] }, given: { max: 9007199254740991, type: [{ code: "string" }] }, prefix: { max: 9007199254740991, type: [{ code: "string" }] }, suffix: { max: 9007199254740991, type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] } } }, Identifier: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, use: { type: [{ code: "code" }] }, type: { type: [{ code: "CodeableConcept" }] }, system: { type: [{ code: "uri" }] }, value: { type: [{ code: "string" }] }, period: { type: [{ code: "Period" }] }, assigner: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MarketingStatus: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, country: { min: 1, type: [{ code: "CodeableConcept" }] }, jurisdiction: { type: [{ code: "CodeableConcept" }] }, status: { min: 1, type: [{ code: "CodeableConcept" }] }, dateRange: { min: 1, type: [{ code: "Period" }] }, restoreDate: { type: [{ code: "dateTime" }] } } }, Meta: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, versionId: { type: [{ code: "id" }] }, lastUpdated: { type: [{ code: "instant" }] }, source: { type: [{ code: "uri" }] }, profile: { max: 9007199254740991, type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] }, security: { max: 9007199254740991, type: [{ code: "Coding" }] }, tag: { max: 9007199254740991, type: [{ code: "Coding" }] }, project: { type: [{ code: "uri" }] }, author: { type: [{ code: "Reference" }] }, onBehalfOf: { type: [{ code: "Reference" }] }, account: { type: [{ code: "Reference" }] }, accounts: { max: 9007199254740991, type: [{ code: "Reference" }] }, compartment: { max: 9007199254740991, type: [{ code: "Reference" }] } } }, Money: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, currency: { type: [{ code: "code" }] } } }, Narrative: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, status: { min: 1, type: [{ code: "code" }] }, div: { min: 1, type: [{ code: "xhtml" }] } } }, ParameterDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, name: { type: [{ code: "code" }] }, use: { min: 1, type: [{ code: "code" }] }, min: { type: [{ code: "integer" }] }, max: { type: [{ code: "string" }] }, documentation: { type: [{ code: "string" }] }, type: { min: 1, type: [{ code: "code" }] }, profile: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/StructureDefinition"] }] } } }, Period: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, start: { type: [{ code: "dateTime" }] }, end: { type: [{ code: "dateTime" }] } } }, Population: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "age[x]": { type: [{ code: "Range" }, { code: "CodeableConcept" }] }, gender: { type: [{ code: "CodeableConcept" }] }, race: { type: [{ code: "CodeableConcept" }] }, physiologicalCondition: { type: [{ code: "CodeableConcept" }] } } }, ProdCharacteristic: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, height: { type: [{ code: "Quantity" }] }, width: { type: [{ code: "Quantity" }] }, depth: { type: [{ code: "Quantity" }] }, weight: { type: [{ code: "Quantity" }] }, nominalVolume: { type: [{ code: "Quantity" }] }, externalDiameter: { type: [{ code: "Quantity" }] }, shape: { type: [{ code: "string" }] }, color: { max: 9007199254740991, type: [{ code: "string" }] }, imprint: { max: 9007199254740991, type: [{ code: "string" }] }, image: { max: 9007199254740991, type: [{ code: "Attachment" }] }, scoring: { type: [{ code: "CodeableConcept" }] } } }, ProductShelfLife: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, identifier: { type: [{ code: "Identifier" }] }, type: { min: 1, type: [{ code: "CodeableConcept" }] }, period: { min: 1, type: [{ code: "Quantity" }] }, specialPrecautionsForStorage: { max: 9007199254740991, type: [{ code: "CodeableConcept" }] } } }, Quantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, Range: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, low: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, high: { type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] } } }, Ratio: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, numerator: { type: [{ code: "Quantity" }] }, denominator: { type: [{ code: "Quantity" }] } } }, Reference: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, reference: { type: [{ code: "string" }] }, type: { type: [{ code: "uri" }] }, identifier: { type: [{ code: "Identifier" }] }, display: { type: [{ code: "string" }] } } }, RelatedArtifact: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, label: { type: [{ code: "string" }] }, display: { type: [{ code: "string" }] }, citation: { type: [{ code: "markdown" }] }, url: { type: [{ code: "url" }] }, document: { type: [{ code: "Attachment" }] }, resource: { type: [{ code: "canonical", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Resource"] }] } } }, SampledData: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, origin: { min: 1, type: [{ code: "Quantity", profile: ["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"] }] }, period: { min: 1, type: [{ code: "decimal" }] }, factor: { type: [{ code: "decimal" }] }, lowerLimit: { type: [{ code: "decimal" }] }, upperLimit: { type: [{ code: "decimal" }] }, dimensions: { min: 1, type: [{ code: "positiveInt" }] }, data: { type: [{ code: "string" }] } } }, Signature: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, max: 9007199254740991, type: [{ code: "Coding" }] }, when: { min: 1, type: [{ code: "instant" }] }, who: { min: 1, type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, onBehalfOf: { type: [{ code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Practitioner", "http://hl7.org/fhir/StructureDefinition/PractitionerRole", "http://hl7.org/fhir/StructureDefinition/RelatedPerson", "http://hl7.org/fhir/StructureDefinition/Patient", "http://hl7.org/fhir/StructureDefinition/Device", "http://hl7.org/fhir/StructureDefinition/Organization"] }] }, targetFormat: { type: [{ code: "code" }] }, sigFormat: { type: [{ code: "code" }] }, data: { type: [{ code: "base64Binary" }] } } }, SubstanceAmount: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "amount[x]": { type: [{ code: "Quantity" }, { code: "Range" }, { code: "string" }] }, amountType: { type: [{ code: "CodeableConcept" }] }, amountText: { type: [{ code: "string" }] }, referenceRange: { type: [{ code: "SubstanceAmountReferenceRange" }] } } }, SubstanceAmountReferenceRange: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, lowLimit: { type: [{ code: "Quantity" }] }, highLimit: { type: [{ code: "Quantity" }] } } }, Timing: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, modifierExtension: { max: 9007199254740991, type: [{ code: "Extension" }] }, event: { max: 9007199254740991, type: [{ code: "dateTime" }] }, repeat: { type: [{ code: "TimingRepeat" }] }, code: { type: [{ code: "CodeableConcept" }] } } }, TimingRepeat: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, "bounds[x]": { type: [{ code: "Duration" }, { code: "Range" }, { code: "Period" }] }, count: { type: [{ code: "positiveInt" }] }, countMax: { type: [{ code: "positiveInt" }] }, duration: { type: [{ code: "decimal" }] }, durationMax: { type: [{ code: "decimal" }] }, durationUnit: { type: [{ code: "code" }] }, frequency: { type: [{ code: "positiveInt" }] }, frequencyMax: { type: [{ code: "positiveInt" }] }, period: { type: [{ code: "decimal" }] }, periodMax: { type: [{ code: "decimal" }] }, periodUnit: { type: [{ code: "code" }] }, dayOfWeek: { max: 9007199254740991, type: [{ code: "code" }] }, timeOfDay: { max: 9007199254740991, type: [{ code: "time" }] }, when: { max: 9007199254740991, type: [{ code: "code" }] }, offset: { type: [{ code: "unsignedInt" }] } } }, TriggerDefinition: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, type: { min: 1, type: [{ code: "code" }] }, name: { type: [{ code: "string" }] }, "timing[x]": { type: [{ code: "Timing" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/Schedule"] }, { code: "date" }, { code: "dateTime" }] }, data: { max: 9007199254740991, type: [{ code: "DataRequirement" }] }, condition: { type: [{ code: "Expression" }] } } }, UsageContext: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, code: { min: 1, type: [{ code: "Coding" }] }, "value[x]": { min: 1, type: [{ code: "CodeableConcept" }, { code: "Quantity" }, { code: "Range" }, { code: "Reference", targetProfile: ["http://hl7.org/fhir/StructureDefinition/PlanDefinition", "http://hl7.org/fhir/StructureDefinition/ResearchStudy", "http://hl7.org/fhir/StructureDefinition/InsurancePlan", "http://hl7.org/fhir/StructureDefinition/HealthcareService", "http://hl7.org/fhir/StructureDefinition/Group", "http://hl7.org/fhir/StructureDefinition/Location", "http://hl7.org/fhir/StructureDefinition/Organization"] }] } } }, MoneyQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, SimpleQuantity: { elements: { id: { type: [{ code: "string" }] }, extension: { max: 9007199254740991, type: [{ code: "Extension" }] }, value: { type: [{ code: "decimal" }] }, comparator: { max: 0, type: [{ code: "code" }] }, unit: { type: [{ code: "string" }] }, system: { type: [{ code: "uri" }] }, code: { type: [{ code: "code" }] } } }, IdentityProvider: { elements: { authorizeUrl: { min: 1, type: [{ code: "string" }] }, tokenUrl: { min: 1, type: [{ code: "string" }] }, tokenAuthMethod: { type: [{ code: "code" }] }, userInfoUrl: { min: 1, type: [{ code: "string" }] }, clientId: { min: 1, type: [{ code: "string" }] }, clientSecret: { min: 1, type: [{ code: "string" }] }, usePkce: { type: [{ code: "boolean" }] }, useSubject: { type: [{ code: "boolean" }] } } } };
40561
40561
  function sr(r7) {
40562
40562
  return new ir(r7).parse();
40563
40563
  }
40564
- var de = mn(yn);
40564
+ var de = yn(gn);
40565
40565
  var ar = /* @__PURE__ */ Object.create(null);
40566
- var gn = /* @__PURE__ */ Object.create(null);
40567
- var io = { "http://hl7.org/fhir/StructureDefinition/MoneyQuantity": "MoneyQuantity", "http://hl7.org/fhir/StructureDefinition/SimpleQuantity": "SimpleQuantity", "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition": "ViewDefinition" };
40568
- function Sn(r7) {
40566
+ var xn = /* @__PURE__ */ Object.create(null);
40567
+ var oo = { "http://hl7.org/fhir/StructureDefinition/MoneyQuantity": "MoneyQuantity", "http://hl7.org/fhir/StructureDefinition/SimpleQuantity": "SimpleQuantity", "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition": "ViewDefinition" };
40568
+ function bn(r7) {
40569
40569
  let e;
40570
- return e = gn[r7], e || (e = gn[r7] = /* @__PURE__ */ Object.create(null)), e;
40570
+ return e = xn[r7], e || (e = xn[r7] = /* @__PURE__ */ Object.create(null)), e;
40571
40571
  }
40572
40572
  function cr(r7) {
40573
40573
  let t = (Array.isArray(r7) ? r7 : r7.entry?.map((n) => n.resource) ?? []).filter((n) => n?.resourceType === "StructureDefinition");
40574
- wn(t);
40574
+ An(t);
40575
40575
  for (let n of t) ur(n);
40576
40576
  }
40577
40577
  function ur(r7) {
40578
40578
  if (!r7?.name) throw new Error("Failed loading StructureDefinition from bundle");
40579
40579
  if (r7.resourceType !== "StructureDefinition") return;
40580
- let e = sr(r7), t = io[r7.url], n, i;
40581
- t ? (n = de, i = t) : r7.url === `http://hl7.org/fhir/StructureDefinition/${r7.type}` || r7.url === `https://medplum.com/fhir/StructureDefinition/${r7.type}` || r7.type?.startsWith("http://") || r7.type?.startsWith("https://") ? (n = de, i = r7.type) : (n = Sn(r7.url), i = r7.type), n[i] = e;
40580
+ let e = sr(r7), t = oo[r7.url], n, i;
40581
+ t ? (n = de, i = t) : r7.url === `http://hl7.org/fhir/StructureDefinition/${r7.type}` || r7.url === `https://medplum.com/fhir/StructureDefinition/${r7.type}` || r7.type?.startsWith("http://") || r7.type?.startsWith("https://") ? (n = de, i = r7.type) : (n = bn(r7.url), i = r7.type), n[i] = e;
40582
40582
  for (let o of e.innerTypes) o.parentType = e, n[o.name] = o;
40583
40583
  ar[r7.url] = e;
40584
40584
  }
40585
- function En(r7) {
40585
+ function Rn(r7) {
40586
40586
  return !!de[r7];
40587
40587
  }
40588
40588
  function Ne(r7, e) {
40589
40589
  if (e) {
40590
- let t = Sn(e)[r7];
40590
+ let t = bn(e)[r7];
40591
40591
  if (t) return t;
40592
40592
  }
40593
40593
  return de[r7];
40594
40594
  }
40595
- function Cn(r7) {
40595
+ function Pn(r7) {
40596
40596
  return !!ar[r7];
40597
40597
  }
40598
40598
  var ir = class {
40599
40599
  constructor(e) {
40600
40600
  if (!e.snapshot?.element || e.snapshot.element.length === 0) throw new Error(`No snapshot defined for StructureDefinition '${e.name}'`);
40601
- this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, path: this.root.path, title: e.title, type: e.type, url: e.url, version: e.version, kind: e.kind, description: co(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
40601
+ this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, path: this.root.path, title: e.title, type: e.type, url: e.url, version: e.version, kind: e.kind, description: uo(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
40602
40602
  }
40603
40603
  parse() {
40604
40604
  let e = this.next();
@@ -40639,7 +40639,7 @@ var ir = class {
40639
40639
  this.backboneContext = { type: { name: t, type: t, path: e.path, title: e.label, description: e.definition, elements: {}, constraints: this.parseElementDefinition(e).constraints, innerTypes: [] }, path: e.path, parent: we(this.backboneContext?.path, e.path) ? this.backboneContext : this.backboneContext?.parent };
40640
40640
  }
40641
40641
  enterSlice(e, t) {
40642
- ao(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
40642
+ co(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
40643
40643
  if (n.type !== "value" && n.type !== "pattern" && n.type !== "type") throw new Error(`Unsupported slicing discriminator type: ${n.type}`);
40644
40644
  return { path: n.path, type: n.type };
40645
40645
  }), slices: [], ordered: e.slicing?.ordered ?? false, rule: e.slicing?.rules }, this.slicingContext = { field: t.slicing, path: e.path ?? "" });
@@ -40679,30 +40679,30 @@ var ir = class {
40679
40679
  });
40680
40680
  }
40681
40681
  parseElementDefinition(e) {
40682
- let t = vn(e.max), n = e.base?.max ? vn(e.base.max) : t, i = { type: "ElementDefinition", value: e };
40683
- return { description: e.definition || "", path: e.path || e.base?.path || "", min: e.min ?? 0, max: t, isArray: n > 1, constraints: (e.constraint ?? []).map((o) => ({ key: o.key ?? "", severity: o.severity ?? "error", expression: o.expression ?? "", description: o.human ?? "" })), type: this.parseElementDefinitionType(e), fixed: Tn(P(i, "fixed[x]")), pattern: Tn(P(i, "pattern[x]")), binding: e.binding };
40682
+ let t = Tn(e.max), n = e.base?.max ? Tn(e.base.max) : t, i = { type: "ElementDefinition", value: e };
40683
+ return { description: e.definition || "", path: e.path || e.base?.path || "", min: e.min ?? 0, max: t, isArray: n > 1, constraints: (e.constraint ?? []).map((o) => ({ key: o.key ?? "", severity: o.severity ?? "error", expression: o.expression ?? "", description: o.human ?? "" })), type: this.parseElementDefinitionType(e), fixed: Sn(P(i, "fixed[x]")), pattern: Sn(P(i, "pattern[x]")), binding: e.binding };
40684
40684
  }
40685
40685
  };
40686
- function vn(r7) {
40686
+ function Tn(r7) {
40687
40687
  return r7 === "*" ? Number.POSITIVE_INFINITY : Number.parseInt(r7, 10);
40688
40688
  }
40689
40689
  function nr(r7, e = "") {
40690
- return so(r7.path, e);
40690
+ return ao(r7.path, e);
40691
40691
  }
40692
- function so(r7, e) {
40692
+ function ao(r7, e) {
40693
40693
  return r7 ? e && r7.startsWith(e) ? r7.substring(e.length + 1) : r7 : "";
40694
40694
  }
40695
40695
  function we(r7, e) {
40696
40696
  return !r7 || !e ? false : e.startsWith(r7 + ".") || e === r7;
40697
40697
  }
40698
- function Tn(r7) {
40699
- return Array.isArray(r7) && r7.length > 0 ? r7[0] : S(r7) ? void 0 : r7;
40698
+ function Sn(r7) {
40699
+ return Array.isArray(r7) && r7.length > 0 ? r7[0] : b(r7) ? void 0 : r7;
40700
40700
  }
40701
- function ao(r7) {
40701
+ function co(r7) {
40702
40702
  let e = r7.slicing?.discriminator;
40703
40703
  return !!(r7.type?.some((t) => t.code === "Extension") && e?.length === 1 && e[0].type === "value" && e[0].path === "url");
40704
40704
  }
40705
- function co(r7) {
40705
+ function uo(r7) {
40706
40706
  let e = r7.description;
40707
40707
  return e?.startsWith(`Base StructureDefinition for ${r7.name} Type: `) && (e = e.substring(`Base StructureDefinition for ${r7.name} Type: `.length)), e;
40708
40708
  }
@@ -40725,9 +40725,9 @@ function G(r7, e) {
40725
40725
  function P(r7, e, t) {
40726
40726
  if (!r7.value) return;
40727
40727
  let n = st(r7.type, e, t?.profileUrl);
40728
- return n ? To(r7, e, n) : So(r7, e);
40728
+ return n ? So(r7, e, n) : bo(r7, e);
40729
40729
  }
40730
- function To(r7, e, t) {
40730
+ function So(r7, e, t) {
40731
40731
  let n = r7.value, i = t.type;
40732
40732
  if (!i || i.length === 0) return;
40733
40733
  let o, s = "undefined", a2, c = t.path.lastIndexOf("."), u2 = t.path.substring(c + 1);
@@ -40740,14 +40740,14 @@ function To(r7, e, t) {
40740
40740
  }
40741
40741
  if (a2) if (Array.isArray(o)) {
40742
40742
  o = o.slice();
40743
- for (let l2 = 0; l2 < Math.max(o.length, a2.length); l2++) o[l2] = Dn(o[l2], a2[l2]);
40744
- } else o = Dn(o, a2);
40745
- if (!S(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((l2) => On(l2, s)) : On(o, s);
40743
+ for (let l2 = 0; l2 < Math.max(o.length, a2.length); l2++) o[l2] = Mn(o[l2], a2[l2]);
40744
+ } else o = Mn(o, a2);
40745
+ if (!b(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((l2) => In(l2, s)) : In(o, s);
40746
40746
  }
40747
- function On(r7, e) {
40747
+ function In(r7, e) {
40748
40748
  return e === "Resource" && k(r7) && (e = r7.resourceType), { type: e, value: r7 };
40749
40749
  }
40750
- function So(r7, e) {
40750
+ function bo(r7, e) {
40751
40751
  let t = r7.value;
40752
40752
  if (!t || typeof t != "object") return;
40753
40753
  let n;
@@ -40766,8 +40766,8 @@ function So(r7, e) {
40766
40766
  }
40767
40767
  }
40768
40768
  if (Array.isArray(n)) {
40769
- if (n.length === 0 || S(n[0])) return;
40770
- } else if (S(n)) return;
40769
+ if (n.length === 0 || b(n[0])) return;
40770
+ } else if (b(n)) return;
40771
40771
  return n;
40772
40772
  }
40773
40773
  function it(r7) {
@@ -40782,27 +40782,27 @@ function it(r7) {
40782
40782
  }
40783
40783
  return e;
40784
40784
  }
40785
- function Mn(r7) {
40785
+ function _n(r7) {
40786
40786
  return f(!N(r7));
40787
40787
  }
40788
- function _n(r7, e) {
40788
+ function Nn(r7, e) {
40789
40789
  return r7.length === 0 || e.length === 0 ? [] : r7.length !== e.length ? f(false) : f(r7.every((t, n) => N(yr(t, e[n]))));
40790
40790
  }
40791
- function Nn(r7, e) {
40791
+ function Ln(r7, e) {
40792
40792
  return r7.length === 0 || e.length === 0 ? [] : r7.length !== e.length ? f(true) : f(r7.some((t, n) => !N(yr(t, e[n]))));
40793
40793
  }
40794
40794
  function yr(r7, e) {
40795
40795
  let t = r7.value?.valueOf(), n = e.value?.valueOf();
40796
- return typeof t == "number" && typeof n == "number" ? f(Math.abs(t - n) < 1e-8) : V(t) && V(n) ? f(Un(t, n)) : f(typeof t == "object" && typeof n == "object" ? xr(r7, e) : t === n);
40796
+ return typeof t == "number" && typeof n == "number" ? f(Math.abs(t - n) < 1e-8) : V(t) && V(n) ? f(Bn(t, n)) : f(typeof t == "object" && typeof n == "object" ? xr(r7, e) : t === n);
40797
40797
  }
40798
40798
  function gr(r7, e) {
40799
- return r7.length === 0 && e.length === 0 ? f(true) : r7.length !== e.length ? f(false) : (r7.sort(In), e.sort(In), f(r7.every((t, n) => N(bo(t, e[n])))));
40799
+ return r7.length === 0 && e.length === 0 ? f(true) : r7.length !== e.length ? f(false) : (r7.sort(kn), e.sort(kn), f(r7.every((t, n) => N(Eo(t, e[n])))));
40800
40800
  }
40801
- function bo(r7, e) {
40801
+ function Eo(r7, e) {
40802
40802
  let { type: t, value: n } = r7, { type: i, value: o } = e, s = n?.valueOf(), a2 = o?.valueOf();
40803
- return typeof s == "number" && typeof a2 == "number" ? f(Math.abs(s - a2) < 0.01) : V(s) && V(a2) ? f(Un(s, a2)) : f(t === "Coding" && i === "Coding" ? typeof s != "object" || typeof a2 != "object" ? false : s.code === a2.code && s.system === a2.system : typeof s == "object" && typeof a2 == "object" ? xr({ ...s, id: void 0 }, { ...a2, id: void 0 }) : typeof s == "string" && typeof a2 == "string" ? s.toLowerCase() === a2.toLowerCase() : s === a2);
40803
+ return typeof s == "number" && typeof a2 == "number" ? f(Math.abs(s - a2) < 0.01) : V(s) && V(a2) ? f(Bn(s, a2)) : f(t === "Coding" && i === "Coding" ? typeof s != "object" || typeof a2 != "object" ? false : s.code === a2.code && s.system === a2.system : typeof s == "object" && typeof a2 == "object" ? xr({ ...s, id: void 0 }, { ...a2, id: void 0 }) : typeof s == "string" && typeof a2 == "string" ? s.toLowerCase() === a2.toLowerCase() : s === a2);
40804
40804
  }
40805
- function In(r7, e) {
40805
+ function kn(r7, e) {
40806
40806
  let t = r7.value?.valueOf(), n = e.value?.valueOf();
40807
40807
  return typeof t == "number" && typeof n == "number" ? t - n : typeof t == "string" && typeof n == "string" ? t.localeCompare(n) : 0;
40808
40808
  }
@@ -40816,32 +40816,32 @@ function ot(r7, e) {
40816
40816
  case "Integer":
40817
40817
  return typeof t == "number";
40818
40818
  case "Date":
40819
- return Ln(t);
40819
+ return Fn(t);
40820
40820
  case "DateTime":
40821
40821
  return Oe(t);
40822
40822
  case "Time":
40823
40823
  return typeof t == "string" && !!/^T\d/.exec(t);
40824
40824
  case "Period":
40825
- return Fn(t);
40825
+ return Un(t);
40826
40826
  case "Quantity":
40827
40827
  return V(t);
40828
40828
  default:
40829
40829
  return r7.type === e || typeof t == "object" && t?.resourceType === e;
40830
40830
  }
40831
40831
  }
40832
- function Ln(r7) {
40832
+ function Fn(r7) {
40833
40833
  return typeof r7 == "string" && !!nt.date.exec(r7);
40834
40834
  }
40835
40835
  function Oe(r7) {
40836
40836
  return typeof r7 == "string" && !!nt.dateTime.exec(r7);
40837
40837
  }
40838
- function Fn(r7) {
40838
+ function Un(r7) {
40839
40839
  return !!(r7 && typeof r7 == "object" && ("start" in r7 && Oe(r7.start) || "end" in r7 && Oe(r7.end)));
40840
40840
  }
40841
40841
  function V(r7) {
40842
40842
  return !!(r7 && typeof r7 == "object" && "value" in r7 && typeof r7.value == "number");
40843
40843
  }
40844
- function Un(r7, e) {
40844
+ function Bn(r7, e) {
40845
40845
  return Math.abs(r7.value - e.value) < 0.01 && (r7.unit === e.unit || r7.code === e.code || r7.unit === e.code || r7.code === e.unit);
40846
40846
  }
40847
40847
  function xr(r7, e) {
@@ -40849,27 +40849,27 @@ function xr(r7, e) {
40849
40849
  if (t.length !== n.length) return false;
40850
40850
  for (let i of t) {
40851
40851
  let o = r7[i], s = e[i];
40852
- if (Vn(o) && Vn(s)) {
40852
+ if (Dn(o) && Dn(s)) {
40853
40853
  if (!xr(o, s)) return false;
40854
40854
  } else if (o !== s) return false;
40855
40855
  }
40856
40856
  return true;
40857
40857
  }
40858
- function Vn(r7) {
40858
+ function Dn(r7) {
40859
40859
  return r7 !== null && typeof r7 == "object";
40860
40860
  }
40861
- function Dn(r7, e) {
40861
+ function Mn(r7, e) {
40862
40862
  if (e) {
40863
40863
  if (typeof e != "object") throw new Error("Primitive extension must be an object");
40864
- return Eo(r7 ?? {}, e);
40864
+ return Ro(r7 ?? {}, e);
40865
40865
  }
40866
40866
  return r7;
40867
40867
  }
40868
- function Eo(r7, e) {
40868
+ function Ro(r7, e) {
40869
40869
  return delete e.__proto__, delete e.constructor, Object.assign(r7, e);
40870
40870
  }
40871
40871
  function ne(r7) {
40872
- let e = fe(r7), t = Co(r7);
40872
+ let e = fe(r7), t = Po(r7);
40873
40873
  return t === e ? { reference: e } : { reference: e, display: t };
40874
40874
  }
40875
40875
  function fe(r7) {
@@ -40878,16 +40878,16 @@ function fe(r7) {
40878
40878
  function he(r7) {
40879
40879
  if (r7) return $(r7) ? r7.reference.split("/")[1] : r7.id;
40880
40880
  }
40881
- function Ro(r7) {
40881
+ function Co(r7) {
40882
40882
  return r7.resourceType === "Patient" || r7.resourceType === "Practitioner" || r7.resourceType === "RelatedPerson";
40883
40883
  }
40884
- function Co(r7) {
40885
- if (Ro(r7)) {
40886
- let e = Po(r7);
40884
+ function Po(r7) {
40885
+ if (Co(r7)) {
40886
+ let e = wo(r7);
40887
40887
  if (e) return e;
40888
40888
  }
40889
40889
  if (r7.resourceType === "Device") {
40890
- let e = wo(r7);
40890
+ let e = Ao(r7);
40891
40891
  if (e) return e;
40892
40892
  }
40893
40893
  if (r7.resourceType === "MedicationRequest" && r7.medicationCodeableConcept) return Ue(r7.medicationCodeableConcept);
@@ -40897,15 +40897,15 @@ function Co(r7) {
40897
40897
  if ("code" in r7 && r7.code) {
40898
40898
  let e = r7.code;
40899
40899
  if (Array.isArray(e) && (e = e[0]), Tr(e)) return Ue(e);
40900
- if (No(e)) return e.text;
40900
+ if (Lo(e)) return e.text;
40901
40901
  }
40902
40902
  return fe(r7);
40903
40903
  }
40904
- function Po(r7) {
40904
+ function wo(r7) {
40905
40905
  let e = r7.name;
40906
40906
  if (e && e.length > 0) return Be(e[0]);
40907
40907
  }
40908
- function wo(r7) {
40908
+ function Ao(r7) {
40909
40909
  let e = r7.deviceName;
40910
40910
  if (e && e.length > 0) return e[0].name;
40911
40911
  }
@@ -40927,15 +40927,31 @@ function te(r7, ...e) {
40927
40927
  return t;
40928
40928
  }
40929
40929
  function ct(r7, e) {
40930
- return JSON.stringify(r7, Oo, e ? 2 : void 0) ?? "";
40930
+ let t = br(r7);
40931
+ return JSON.stringify(t, null, e ? 2 : void 0) ?? "";
40931
40932
  }
40932
- function Oo(r7, e) {
40933
- return !Io(r7) && S(e) ? void 0 : e;
40933
+ function br(r7) {
40934
+ if (!(r7 == null || r7 === "")) return typeof r7 == "object" ? Array.isArray(r7) ? Io(r7) : ko(r7) : r7;
40934
40935
  }
40935
40936
  function Io(r7) {
40936
- return !!/\d+$/.exec(r7);
40937
+ let e = r7.length;
40938
+ if (e === 0) return;
40939
+ let t, n = 0;
40940
+ for (let i = 0; i < e; i++) {
40941
+ let o = r7[i], s = br(o);
40942
+ s !== o && !t && (t = Array.from(r7)), s === void 0 ? t && (t[i] = null) : (t && (t[i] = s), n++);
40943
+ }
40944
+ if (n !== 0) return t ?? r7;
40945
+ }
40946
+ function ko(r7) {
40947
+ let e, t = 0;
40948
+ for (let n in r7) {
40949
+ let i = r7[n], o = br(i);
40950
+ o !== i && !e && (e = { ...r7 }), o === void 0 ? e && delete e[n] : (e && (e[n] = o), t++);
40951
+ }
40952
+ if (t !== 0) return e ?? r7;
40937
40953
  }
40938
- function S(r7) {
40954
+ function b(r7) {
40939
40955
  if (r7 == null) return true;
40940
40956
  let e = typeof r7;
40941
40957
  return e === "string" || e === "object" ? !J(r7) : false;
@@ -40946,14 +40962,14 @@ function J(r7) {
40946
40962
  return e === "string" && r7 !== "" || e === "object" && ("length" in r7 && r7.length > 0 || Object.keys(r7).length > 0);
40947
40963
  }
40948
40964
  function re(r7, e, t) {
40949
- return r7 === e || S(r7) && S(e) ? true : S(r7) || S(e) ? false : Array.isArray(r7) && Array.isArray(e) ? ko(r7, e) : Array.isArray(r7) || Array.isArray(e) ? false : R(r7) && R(e) ? Vo(r7, e, t) : (R(r7) || R(e), false);
40965
+ return r7 === e || b(r7) && b(e) ? true : b(r7) || b(e) ? false : Array.isArray(r7) && Array.isArray(e) ? Vo(r7, e) : Array.isArray(r7) || Array.isArray(e) ? false : R(r7) && R(e) ? Do(r7, e, t) : (R(r7) || R(e), false);
40950
40966
  }
40951
- function ko(r7, e) {
40967
+ function Vo(r7, e) {
40952
40968
  if (r7.length !== e.length) return false;
40953
40969
  for (let t = 0; t < r7.length; t++) if (!re(r7[t], e[t])) return false;
40954
40970
  return true;
40955
40971
  }
40956
- function Vo(r7, e, t) {
40972
+ function Do(r7, e, t) {
40957
40973
  let n = /* @__PURE__ */ new Set();
40958
40974
  Object.keys(r7).forEach((i) => n.add(i)), Object.keys(e).forEach((i) => n.add(i)), t === "meta" && (n.delete("versionId"), n.delete("lastUpdated"), n.delete("author"));
40959
40975
  for (let i of n) {
@@ -40965,10 +40981,10 @@ function Vo(r7, e, t) {
40965
40981
  function R(r7) {
40966
40982
  return r7 !== null && typeof r7 == "object";
40967
40983
  }
40968
- function Wn(r7) {
40969
- return r7.every(_o);
40984
+ function $n(r7) {
40985
+ return r7.every(No);
40970
40986
  }
40971
- function _o(r7) {
40987
+ function No(r7) {
40972
40988
  return typeof r7 == "string";
40973
40989
  }
40974
40990
  function vr(r7) {
@@ -40977,51 +40993,51 @@ function vr(r7) {
40977
40993
  function Tr(r7) {
40978
40994
  return R(r7) && "coding" in r7 && Array.isArray(r7.coding) && r7.coding.every(vr);
40979
40995
  }
40980
- function No(r7) {
40996
+ function Lo(r7) {
40981
40997
  return R(r7) && "text" in r7 && typeof r7.text == "string";
40982
40998
  }
40983
- var $n = [];
40984
- for (let r7 = 0; r7 < 256; r7++) $n.push(r7.toString(16).padStart(2, "0"));
40985
- function Gn(r7) {
40986
- let e = Qn(r7), t = new Uint8Array(e), n = new Array(t.length);
40987
- for (let i = 0; i < t.length; i++) n[i] = $n[t[i]];
40999
+ var Gn = [];
41000
+ for (let r7 = 0; r7 < 256; r7++) Gn.push(r7.toString(16).padStart(2, "0"));
41001
+ function Hn(r7) {
41002
+ let e = zn(r7), t = new Uint8Array(e), n = new Array(t.length);
41003
+ for (let i = 0; i < t.length; i++) n[i] = Gn[t[i]];
40988
41004
  return n.join("");
40989
41005
  }
40990
- function Hn(r7) {
40991
- let e = Qn(r7), t = new Uint8Array(e), n = new Array(t.length);
41006
+ function Qn(r7) {
41007
+ let e = zn(r7), t = new Uint8Array(e), n = new Array(t.length);
40992
41008
  for (let i = 0; i < t.length; i++) n[i] = String.fromCharCode(t[i]);
40993
41009
  return window.btoa(n.join(""));
40994
41010
  }
40995
- function Qn(r7) {
41011
+ function zn(r7) {
40996
41012
  return ArrayBuffer.isView(r7) ? r7.buffer : r7;
40997
41013
  }
40998
41014
  function I(r7) {
40999
41015
  return r7 ? r7.charAt(0).toUpperCase() + r7.substring(1) : "";
41000
41016
  }
41001
- var Er = (r7) => new Promise((e) => {
41017
+ var Rr = (r7) => new Promise((e) => {
41002
41018
  setTimeout(e, r7);
41003
41019
  });
41004
41020
  function ut(r7) {
41005
41021
  return r7.sort((e, t) => e.localeCompare(t));
41006
41022
  }
41007
- function Cr(r7) {
41023
+ function Pr(r7) {
41008
41024
  return r7.endsWith("/") ? r7 : r7 + "/";
41009
41025
  }
41010
- function jo(r7) {
41026
+ function Wo(r7) {
41011
41027
  return r7.startsWith("/") ? r7.slice(1) : r7;
41012
41028
  }
41013
41029
  function q(r7, e) {
41014
- return new URL(jo(e), Cr(r7.toString())).toString();
41030
+ return new URL(Wo(e), Pr(r7.toString())).toString();
41015
41031
  }
41016
- function Yn(r7, e) {
41032
+ function Zn(r7, e) {
41017
41033
  return q(r7, e).toString().replace("http://", "ws://").replace("https://", "wss://");
41018
41034
  }
41019
- function Zn(r7) {
41035
+ function Xn(r7) {
41020
41036
  return typeof r7 == "object" && !Array.isArray(r7) && !(r7 instanceof URLSearchParams) && (r7 = Object.fromEntries(Object.entries(r7).filter((e) => e[1] !== void 0))), new URLSearchParams(r7).toString();
41021
41037
  }
41022
- var Wo = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-_]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-_]*[A-Za-z0-9])$/;
41023
- function dl(r7) {
41024
- return Wo.test(r7);
41038
+ var $o = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-_]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-_]*[A-Za-z0-9])$/;
41039
+ function fl(r7) {
41040
+ return $o.test(r7);
41025
41041
  }
41026
41042
  function Be(r7, e) {
41027
41043
  let t = [];
@@ -41034,9 +41050,9 @@ function Be(r7, e) {
41034
41050
  function Ue(r7) {
41035
41051
  if (!r7) return "";
41036
41052
  let e = ye(r7.text);
41037
- return e || (r7.coding ? r7.coding.map((t) => Xn(t)).join(", ") : "");
41053
+ return e || (r7.coding ? r7.coding.map((t) => ei(t)).join(", ") : "");
41038
41054
  }
41039
- function Xn(r7, e) {
41055
+ function ei(r7, e) {
41040
41056
  let t = ye(r7?.display);
41041
41057
  if (t) {
41042
41058
  let n = e ? ye(r7?.code) : void 0;
@@ -41048,32 +41064,32 @@ function ye(r7) {
41048
41064
  return typeof r7 == "string" ? r7 : void 0;
41049
41065
  }
41050
41066
  var p = { Address: "Address", Age: "Age", Annotation: "Annotation", Attachment: "Attachment", BackboneElement: "BackboneElement", CodeableConcept: "CodeableConcept", Coding: "Coding", ContactDetail: "ContactDetail", ContactPoint: "ContactPoint", Contributor: "Contributor", Count: "Count", DataRequirement: "DataRequirement", Distance: "Distance", Dosage: "Dosage", Duration: "Duration", Expression: "Expression", Extension: "Extension", HumanName: "HumanName", Identifier: "Identifier", MarketingStatus: "MarketingStatus", Meta: "Meta", Money: "Money", Narrative: "Narrative", ParameterDefinition: "ParameterDefinition", Period: "Period", Population: "Population", ProdCharacteristic: "ProdCharacteristic", ProductShelfLife: "ProductShelfLife", Quantity: "Quantity", Range: "Range", Ratio: "Ratio", Reference: "Reference", RelatedArtifact: "RelatedArtifact", SampledData: "SampledData", Signature: "Signature", SubstanceAmount: "SubstanceAmount", SystemString: "http://hl7.org/fhirpath/System.String", Timing: "Timing", TriggerDefinition: "TriggerDefinition", UsageContext: "UsageContext", base64Binary: "base64Binary", boolean: "boolean", canonical: "canonical", code: "code", date: "date", dateTime: "dateTime", decimal: "decimal", id: "id", instant: "instant", integer: "integer", markdown: "markdown", oid: "oid", positiveInt: "positiveInt", string: "string", time: "time", unsignedInt: "unsignedInt", uri: "uri", url: "url", uuid: "uuid" };
41051
- function wn(r7) {
41067
+ function An(r7) {
41052
41068
  let e = Array.isArray(r7) ? r7 : r7.entry?.map((t) => t.resource) ?? [];
41053
- for (let t of e) t?.resourceType === "StructureDefinition" && t.kind === "resource" && ri(t.type);
41069
+ for (let t of e) t?.resourceType === "StructureDefinition" && t.kind === "resource" && ni(t.type);
41054
41070
  }
41055
- function ri(r7) {
41071
+ function ni(r7) {
41056
41072
  let e = L.types[r7];
41057
41073
  return e || (e = { searchParamsDetails: {} }, L.types[r7] = e), e.searchParams || (e.searchParams = { _id: { base: [r7], code: "_id", type: "token", expression: r7 + ".id" }, _lastUpdated: { base: [r7], code: "_lastUpdated", type: "date", expression: r7 + ".meta.lastUpdated" }, _compartment: { base: [r7], code: "_compartment", type: "reference", expression: r7 + ".meta.compartment" }, _profile: { base: [r7], code: "_profile", type: "uri", expression: r7 + ".meta.profile" }, _security: { base: [r7], code: "_security", type: "token", expression: r7 + ".meta.security" }, _source: { base: [r7], code: "_source", type: "uri", expression: r7 + ".meta.source" }, _tag: { base: [r7], code: "_tag", type: "token", expression: r7 + ".meta.tag" } }), e;
41058
41074
  }
41059
- function Ar(r7) {
41075
+ function Or(r7) {
41060
41076
  for (let e of r7.base ?? []) {
41061
- let t = ri(e);
41077
+ let t = ni(e);
41062
41078
  t.searchParams || (t.searchParams = {}), t.searchParams[r7.code] = r7;
41063
41079
  }
41064
41080
  }
41065
41081
  function or(r7) {
41066
41082
  let e = r7.type?.[0]?.code;
41067
- return e === "BackboneElement" || e === "Element" ? es((r7.base?.path ?? r7.path)?.split(".")) : e;
41083
+ return e === "BackboneElement" || e === "Element" ? ts((r7.base?.path ?? r7.path)?.split(".")) : e;
41068
41084
  }
41069
- function es(r7) {
41085
+ function ts(r7) {
41070
41086
  return r7.length === 1 ? r7[0] : r7.map(I).join("");
41071
41087
  }
41072
41088
  function st(r7, e, t) {
41073
41089
  let n = Ne(r7, t);
41074
- if (n) return is(n.elements, e);
41090
+ if (n) return os(n.elements, e);
41075
41091
  }
41076
- function is(r7, e) {
41092
+ function os(r7, e) {
41077
41093
  let t = r7[e] ?? r7[e + "[x]"];
41078
41094
  if (t) return t;
41079
41095
  for (let n = 0; n < e.length; n++) {
@@ -41101,7 +41117,7 @@ function ke(r7) {
41101
41117
  }
41102
41118
  }
41103
41119
  var Y = () => [];
41104
- var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), hasValue: (r7, e) => f(e.length !== 0), exists: (r7, e, t) => t ? f(e.filter((n) => N(t.eval(r7, [n]))).length > 0) : f(e.length > 0 && e.every((n) => !S(n.value))), all: (r7, e, t) => f(e.every((n) => N(t.eval(r7, [n])))), allTrue: (r7, e) => {
41120
+ var O = { empty: (r7, e) => f(e.length === 0 || e.every((t) => b(t.value))), hasValue: (r7, e) => f(e.length !== 0), exists: (r7, e, t) => t ? f(e.filter((n) => N(t.eval(r7, [n]))).length > 0) : f(e.length > 0 && e.every((n) => !b(n.value))), all: (r7, e, t) => f(e.every((n) => N(t.eval(r7, [n])))), allTrue: (r7, e) => {
41105
41121
  for (let t of e) if (!t.value) return f(false);
41106
41122
  return f(true);
41107
41123
  }, anyTrue: (r7, e) => {
@@ -41414,7 +41430,7 @@ var yt = class extends C {
41414
41430
  }
41415
41431
  eval(e, t) {
41416
41432
  let n = this.left.eval(e, t), i = this.right.eval(e, t);
41417
- return _n(n, i);
41433
+ return Nn(n, i);
41418
41434
  }
41419
41435
  };
41420
41436
  var gt = class extends C {
@@ -41423,7 +41439,7 @@ var gt = class extends C {
41423
41439
  }
41424
41440
  eval(e, t) {
41425
41441
  let n = this.left.eval(e, t), i = this.right.eval(e, t);
41426
- return Nn(n, i);
41442
+ return Ln(n, i);
41427
41443
  }
41428
41444
  };
41429
41445
  var xt = class extends C {
@@ -41441,7 +41457,7 @@ var vt = class extends C {
41441
41457
  }
41442
41458
  eval(e, t) {
41443
41459
  let n = this.left.eval(e, t), i = this.right.eval(e, t);
41444
- return Mn(gr(n, i));
41460
+ return _n(gr(n, i));
41445
41461
  }
41446
41462
  };
41447
41463
  var ve = class extends C {
@@ -41524,34 +41540,34 @@ var Te = class {
41524
41540
  };
41525
41541
  var je = ["!=", "!~", "<=", ">=", "{}", "->"];
41526
41542
  var y = { FunctionCall: 0, Dot: 1, Indexer: 2, UnaryAdd: 3, UnarySubtract: 3, Multiply: 4, Divide: 4, IntegerDivide: 4, Modulo: 4, Add: 5, Subtract: 5, Ampersand: 5, Is: 6, As: 6, Union: 7, GreaterThan: 8, GreaterThanOrEquals: 8, LessThan: 8, LessThanOrEquals: 8, Equals: 9, Equivalent: 9, NotEquals: 9, NotEquivalent: 9, In: 10, Contains: 10, And: 11, Xor: 12, Or: 12, Implies: 13, Arrow: 100, Semicolon: 200 };
41527
- var as = { parse(r7) {
41543
+ var cs = { parse(r7) {
41528
41544
  let e = r7.consumeAndParse();
41529
41545
  if (!r7.match(")")) throw new Error("Parse error: expected `)` got `" + r7.peek()?.value + "`");
41530
41546
  return e;
41531
41547
  } };
41532
- var cs = { parse(r7, e) {
41548
+ var us = { parse(r7, e) {
41533
41549
  let t = r7.consumeAndParse();
41534
41550
  if (!r7.match("]")) throw new Error("Parse error: expected `]`");
41535
41551
  return new Te(e, t);
41536
41552
  }, precedence: y.Indexer };
41537
- var us = { parse(r7, e) {
41553
+ var ls = { parse(r7, e) {
41538
41554
  if (!(e instanceof j)) throw new Error("Unexpected parentheses");
41539
41555
  let t = [];
41540
41556
  for (; !r7.match(")"); ) t.push(r7.consumeAndParse()), r7.match(",");
41541
41557
  return new Z(e.name, t);
41542
41558
  }, precedence: y.FunctionCall };
41543
- function ls(r7) {
41559
+ function ps(r7) {
41544
41560
  let e = r7.split(" "), t = parseFloat(e[0]), n = e[1];
41545
41561
  return n?.startsWith("'") && n.endsWith("'") ? n = n.substring(1, n.length - 1) : n = "{" + n + "}", { value: t, unit: n };
41546
41562
  }
41547
41563
  function We() {
41548
- return new Je().registerPrefix("String", { parse: (r7, e) => new U({ type: p.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r7, e) => new U({ type: p.dateTime, value: ke(e.value) }) }).registerPrefix("Quantity", { parse: (r7, e) => new U({ type: p.Quantity, value: ls(e.value) }) }).registerPrefix("Number", { parse: (r7, e) => new U({ type: e.value.includes(".") ? p.decimal : p.integer, value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new U({ type: p.boolean, value: true }) }).registerPrefix("false", { parse: () => new U({ type: p.boolean, value: false }) }).registerPrefix("Symbol", { parse: (r7, e) => new j(e.value) }).registerPrefix("{}", { parse: () => new pt() }).registerPrefix("(", as).registerInfix("[", cs).registerInfix("(", us).prefix("+", y.UnaryAdd, (r7, e) => new dt("+", e, (t) => t)).prefix("-", y.UnarySubtract, (r7, e) => new D("-", e, e, (t, n) => -n)).infixLeft(".", y.Dot, (r7, e, t) => new se(r7, t)).infixLeft("/", y.Divide, (r7, e, t) => new D("/", r7, t, (n, i) => n / i)).infixLeft("*", y.Multiply, (r7, e, t) => new D("*", r7, t, (n, i) => n * i)).infixLeft("+", y.Add, (r7, e, t) => new D("+", r7, t, (n, i) => n + i)).infixLeft("-", y.Subtract, (r7, e, t) => new D("-", r7, t, (n, i) => n - i)).infixLeft("|", y.Union, (r7, e, t) => new Ve(r7, t)).infixLeft("=", y.Equals, (r7, e, t) => new yt(r7, t)).infixLeft("!=", y.NotEquals, (r7, e, t) => new gt(r7, t)).infixLeft("~", y.Equivalent, (r7, e, t) => new xt(r7, t)).infixLeft("!~", y.NotEquivalent, (r7, e, t) => new vt(r7, t)).infixLeft("<", y.LessThan, (r7, e, t) => new D("<", r7, t, (n, i) => n < i)).infixLeft("<=", y.LessThanOrEquals, (r7, e, t) => new D("<=", r7, t, (n, i) => n <= i)).infixLeft(">", y.GreaterThan, (r7, e, t) => new D(">", r7, t, (n, i) => n > i)).infixLeft(">=", y.GreaterThanOrEquals, (r7, e, t) => new D(">=", r7, t, (n, i) => n >= i)).infixLeft("&", y.Ampersand, (r7, e, t) => new ft(r7, t)).infixLeft("and", y.And, (r7, e, t) => new Tt(r7, t)).infixLeft("as", y.As, (r7, e, t) => new xe(r7, t)).infixLeft("contains", y.Contains, (r7, e, t) => new ht(r7, t)).infixLeft("div", y.Divide, (r7, e, t) => new D("div", r7, t, (n, i) => n / i | 0)).infixLeft("in", y.In, (r7, e, t) => new mt(r7, t)).infixLeft("is", y.Is, (r7, e, t) => new ve(r7, t)).infixLeft("mod", y.Modulo, (r7, e, t) => new D("mod", r7, t, (n, i) => n % i)).infixLeft("or", y.Or, (r7, e, t) => new St(r7, t)).infixLeft("xor", y.Xor, (r7, e, t) => new bt(r7, t)).infixLeft("implies", y.Implies, (r7, e, t) => new Et(r7, t));
41564
+ return new Je().registerPrefix("String", { parse: (r7, e) => new U({ type: p.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r7, e) => new U({ type: p.dateTime, value: ke(e.value) }) }).registerPrefix("Quantity", { parse: (r7, e) => new U({ type: p.Quantity, value: ps(e.value) }) }).registerPrefix("Number", { parse: (r7, e) => new U({ type: e.value.includes(".") ? p.decimal : p.integer, value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new U({ type: p.boolean, value: true }) }).registerPrefix("false", { parse: () => new U({ type: p.boolean, value: false }) }).registerPrefix("Symbol", { parse: (r7, e) => new j(e.value) }).registerPrefix("{}", { parse: () => new pt() }).registerPrefix("(", cs).registerInfix("[", us).registerInfix("(", ls).prefix("+", y.UnaryAdd, (r7, e) => new dt("+", e, (t) => t)).prefix("-", y.UnarySubtract, (r7, e) => new D("-", e, e, (t, n) => -n)).infixLeft(".", y.Dot, (r7, e, t) => new se(r7, t)).infixLeft("/", y.Divide, (r7, e, t) => new D("/", r7, t, (n, i) => n / i)).infixLeft("*", y.Multiply, (r7, e, t) => new D("*", r7, t, (n, i) => n * i)).infixLeft("+", y.Add, (r7, e, t) => new D("+", r7, t, (n, i) => n + i)).infixLeft("-", y.Subtract, (r7, e, t) => new D("-", r7, t, (n, i) => n - i)).infixLeft("|", y.Union, (r7, e, t) => new Ve(r7, t)).infixLeft("=", y.Equals, (r7, e, t) => new yt(r7, t)).infixLeft("!=", y.NotEquals, (r7, e, t) => new gt(r7, t)).infixLeft("~", y.Equivalent, (r7, e, t) => new xt(r7, t)).infixLeft("!~", y.NotEquivalent, (r7, e, t) => new vt(r7, t)).infixLeft("<", y.LessThan, (r7, e, t) => new D("<", r7, t, (n, i) => n < i)).infixLeft("<=", y.LessThanOrEquals, (r7, e, t) => new D("<=", r7, t, (n, i) => n <= i)).infixLeft(">", y.GreaterThan, (r7, e, t) => new D(">", r7, t, (n, i) => n > i)).infixLeft(">=", y.GreaterThanOrEquals, (r7, e, t) => new D(">=", r7, t, (n, i) => n >= i)).infixLeft("&", y.Ampersand, (r7, e, t) => new ft(r7, t)).infixLeft("and", y.And, (r7, e, t) => new Tt(r7, t)).infixLeft("as", y.As, (r7, e, t) => new xe(r7, t)).infixLeft("contains", y.Contains, (r7, e, t) => new ht(r7, t)).infixLeft("div", y.Divide, (r7, e, t) => new D("div", r7, t, (n, i) => n / i | 0)).infixLeft("in", y.In, (r7, e, t) => new mt(r7, t)).infixLeft("is", y.Is, (r7, e, t) => new ve(r7, t)).infixLeft("mod", y.Modulo, (r7, e, t) => new D("mod", r7, t, (n, i) => n % i)).infixLeft("or", y.Or, (r7, e, t) => new St(r7, t)).infixLeft("xor", y.Xor, (r7, e, t) => new bt(r7, t)).infixLeft("implies", y.Implies, (r7, e, t) => new Et(r7, t));
41549
41565
  }
41550
- var ps = We();
41551
- var oi = ((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))(oi || {});
41552
- var pi = ((v) => (v.EQUALS = "eq", v.NOT_EQUALS = "ne", v.GREATER_THAN = "gt", v.LESS_THAN = "lt", v.GREATER_THAN_OR_EQUALS = "ge", v.LESS_THAN_OR_EQUALS = "le", v.STARTS_AFTER = "sa", v.ENDS_BEFORE = "eb", v.APPROXIMATELY = "ap", v.CONTAINS = "contains", v.STARTS_WITH = "sw", v.EXACT = "exact", v.TEXT = "text", v.NOT = "not", v.ABOVE = "above", v.BELOW = "below", v.IN = "in", v.NOT_IN = "not-in", v.OF_TYPE = "of-type", v.MISSING = "missing", v.PRESENT = "present", v.IDENTIFIER = "identifier", v.ITERATE = "iterate", v))(pi || {});
41553
- var Bs = ((E) => (E.READ = "read", E.VREAD = "vread", E.UPDATE = "update", E.PATCH = "patch", E.DELETE = "delete", E.HISTORY = "history", E.HISTORY_INSTANCE = "history-instance", E.HISTORY_TYPE = "history-type", E.HISTORY_SYSTEM = "history-system", E.CREATE = "create", E.SEARCH = "search", E.SEARCH_TYPE = "search-type", E.SEARCH_SYSTEM = "search-system", E.SEARCH_COMPARTMENT = "search-compartment", E.CAPABILITIES = "capabilities", E.TRANSACTION = "transaction", E.BATCH = "batch", E.OPERATION = "operation", E))(Bs || {});
41554
- function mi(r7) {
41566
+ var ds = We();
41567
+ var si = ((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))(si || {});
41568
+ var di = ((v) => (v.EQUALS = "eq", v.NOT_EQUALS = "ne", v.GREATER_THAN = "gt", v.LESS_THAN = "lt", v.GREATER_THAN_OR_EQUALS = "ge", v.LESS_THAN_OR_EQUALS = "le", v.STARTS_AFTER = "sa", v.ENDS_BEFORE = "eb", v.APPROXIMATELY = "ap", v.CONTAINS = "contains", v.STARTS_WITH = "sw", v.EXACT = "exact", v.TEXT = "text", v.NOT = "not", v.ABOVE = "above", v.BELOW = "below", v.IN = "in", v.NOT_IN = "not-in", v.OF_TYPE = "of-type", v.MISSING = "missing", v.PRESENT = "present", v.IDENTIFIER = "identifier", v.ITERATE = "iterate", v))(di || {});
41569
+ var qs = ((E) => (E.READ = "read", E.VREAD = "vread", E.UPDATE = "update", E.PATCH = "patch", E.DELETE = "delete", E.HISTORY = "history", E.HISTORY_INSTANCE = "history-instance", E.HISTORY_TYPE = "history-type", E.HISTORY_SYSTEM = "history-system", E.CREATE = "create", E.SEARCH = "search", E.SEARCH_TYPE = "search-type", E.SEARCH_SYSTEM = "search-system", E.SEARCH_COMPARTMENT = "search-compartment", E.CAPABILITIES = "capabilities", E.TRANSACTION = "transaction", E.BATCH = "batch", E.OPERATION = "operation", E))(qs || {});
41570
+ function yi(r7) {
41555
41571
  if (typeof window < "u") {
41556
41572
  let e = window.atob(r7), t = Uint8Array.from(e, (n) => n.charCodeAt(0));
41557
41573
  return new window.TextDecoder().decode(t);
@@ -41559,7 +41575,7 @@ function mi(r7) {
41559
41575
  if (typeof Buffer < "u") return Buffer.from(r7, "base64").toString("utf-8");
41560
41576
  throw new Error("Unable to decode base64");
41561
41577
  }
41562
- function yi(r7) {
41578
+ function gi(r7) {
41563
41579
  if (typeof window < "u") {
41564
41580
  let e = new window.TextEncoder().encode(r7), t = String.fromCharCode.apply(null, e);
41565
41581
  return window.btoa(t);
@@ -41567,11 +41583,11 @@ function yi(r7) {
41567
41583
  if (typeof Buffer < "u") return Buffer.from(r7, "utf8").toString("base64");
41568
41584
  throw new Error("Unable to encode base64");
41569
41585
  }
41570
- function _r() {
41586
+ function Nr() {
41571
41587
  let r7 = new Uint32Array(28);
41572
- return crypto.getRandomValues(r7), Gn(r7.buffer);
41588
+ return crypto.getRandomValues(r7), Hn(r7.buffer);
41573
41589
  }
41574
- async function gi(r7) {
41590
+ async function xi(r7) {
41575
41591
  return crypto.subtle.digest("SHA-256", new TextEncoder().encode(r7));
41576
41592
  }
41577
41593
  function Se() {
@@ -41605,7 +41621,7 @@ var At = class {
41605
41621
  }
41606
41622
  };
41607
41623
  var A = { CSS: "text/css", DICOM: "application/dicom", FAVICON: "image/vnd.microsoft.icon", FHIR_JSON: "application/fhir+json", FORM_URL_ENCODED: "application/x-www-form-urlencoded", HL7_V2: "x-application/hl7-v2+er7", HTML: "text/html", JAVASCRIPT: "text/javascript", JSON: "application/json", JSON_PATCH: "application/json-patch+json", PNG: "image/png", SCIM_JSON: "application/scim+json", SVG: "image/svg+xml", TEXT: "text/plain", TYPESCRIPT: "text/typescript", PING: "x-application/ping", XML: "text/xml", CDA_XML: "application/cda+xml" };
41608
- var Nr = class {
41624
+ var Lr = class {
41609
41625
  constructor() {
41610
41626
  this.listeners = {};
41611
41627
  }
@@ -41632,7 +41648,7 @@ var Nr = class {
41632
41648
  };
41633
41649
  var K = class {
41634
41650
  constructor() {
41635
- this.emitter = new Nr();
41651
+ this.emitter = new Lr();
41636
41652
  }
41637
41653
  dispatchEvent(e) {
41638
41654
  this.emitter.dispatchEvent(e);
@@ -41647,71 +41663,71 @@ var K = class {
41647
41663
  this.emitter.removeAllListeners();
41648
41664
  }
41649
41665
  };
41650
- var Lr = { "Patient-open": "Patient-open", "Patient-close": "Patient-close", "ImagingStudy-open": "ImagingStudy-open", "ImagingStudy-close": "ImagingStudy-close", "Encounter-open": "Encounter-open", "Encounter-close": "Encounter-close", "DiagnosticReport-open": "DiagnosticReport-open", "DiagnosticReport-close": "DiagnosticReport-close", "DiagnosticReport-select": "DiagnosticReport-select", "DiagnosticReport-update": "DiagnosticReport-update", syncerror: "syncerror" };
41651
- var Ks = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
41652
- var Fr = ["DiagnosticReport-update"];
41653
- function vi(r7) {
41654
- return Fr.includes(r7);
41655
- }
41666
+ var Fr = { "Patient-open": "Patient-open", "Patient-close": "Patient-close", "ImagingStudy-open": "ImagingStudy-open", "ImagingStudy-close": "ImagingStudy-close", "Encounter-open": "Encounter-open", "Encounter-close": "Encounter-close", "DiagnosticReport-open": "DiagnosticReport-open", "DiagnosticReport-close": "DiagnosticReport-close", "DiagnosticReport-select": "DiagnosticReport-select", "DiagnosticReport-update": "DiagnosticReport-update", syncerror: "syncerror" };
41667
+ var Js = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
41668
+ var Ur = ["DiagnosticReport-update"];
41656
41669
  function Ti(r7) {
41657
- if (Fr.includes(r7)) throw new d(m(`'context.version' is required for '${r7}'.`));
41658
- }
41659
- var Js = { "Patient-open": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "Patient-close": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "ImagingStudy-open": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "ImagingStudy-close": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "Encounter-open": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "Encounter-close": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "DiagnosticReport-open": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-close": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-select": { report: { resourceType: "DiagnosticReport", reference: true }, patient: { resourceType: "Patient", optional: true, reference: true }, select: { resourceType: "*", array: true, reference: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport", reference: true }, patient: { resourceType: "Patient", optional: true, reference: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
41660
- function Ys(r7) {
41661
- return Ks.includes(r7);
41670
+ return Ur.includes(r7);
41662
41671
  }
41663
41672
  function Si(r7) {
41673
+ if (Ur.includes(r7)) throw new d(m(`'context.version' is required for '${r7}'.`));
41674
+ }
41675
+ var Ys = { "Patient-open": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "Patient-close": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "ImagingStudy-open": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "ImagingStudy-close": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "Encounter-open": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "Encounter-close": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "DiagnosticReport-open": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-close": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-select": { report: { resourceType: "DiagnosticReport", reference: true }, patient: { resourceType: "Patient", optional: true, reference: true }, select: { resourceType: "*", array: true, reference: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport", reference: true }, patient: { resourceType: "Patient", optional: true, reference: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
41676
+ function Zs(r7) {
41677
+ return Js.includes(r7);
41678
+ }
41679
+ function bi(r7) {
41664
41680
  return !!r7.endpoint;
41665
41681
  }
41666
- function Ur(r7) {
41682
+ function Br(r7) {
41667
41683
  if (!It(r7)) throw new d(m("subscriptionRequest must be an object conforming to SubscriptionRequest type."));
41668
41684
  let { channelType: e, mode: t, topic: n, events: i } = r7, o = { "hub.channel.type": e, "hub.mode": t, "hub.topic": n, "hub.events": i.join(",") };
41669
- return Si(r7) && (o.endpoint = r7.endpoint), new URLSearchParams(o).toString();
41685
+ return bi(r7) && (o.endpoint = r7.endpoint), new URLSearchParams(o).toString();
41670
41686
  }
41671
41687
  function It(r7) {
41672
41688
  if (typeof r7 != "object") return false;
41673
41689
  let { channelType: e, mode: t, topic: n, events: i } = r7;
41674
41690
  if (!(e && t && n && i) || typeof n != "string" || typeof i != "object" || !Array.isArray(i) || i.length < 1 || e !== "websocket" || t !== "subscribe" && t !== "unsubscribe") return false;
41675
- for (let o of i) if (!Lr[o]) return false;
41676
- return !(Si(r7) && !(typeof r7.endpoint == "string" && r7.endpoint.startsWith("ws")));
41691
+ for (let o of i) if (!Fr[o]) return false;
41692
+ return !(bi(r7) && !(typeof r7.endpoint == "string" && r7.endpoint.startsWith("ws")));
41677
41693
  }
41678
- function Zs(r7, e, t, n) {
41694
+ function Xs(r7, e, t, n) {
41679
41695
  if (typeof e != "object") throw new d(m(`context[${t}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));
41680
41696
  if (!(e.id && typeof e.id == "string")) throw new d(m(`context[${t}] is invalid. Resource must contain a valid string ID.`));
41681
41697
  if (!e.resourceType) throw new d(m(`context[${t}] is invalid. Resource must contain a resource type. No resource type found.`));
41682
41698
  let i = n.resourceType;
41683
41699
  if (i !== "*") {
41684
- if (!Ys(e.resourceType)) throw new d(m(`context[${t}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));
41700
+ if (!Zs(e.resourceType)) throw new d(m(`context[${t}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));
41685
41701
  if (i && e.resourceType !== i) throw new d(m(`context[${t}] is invalid. context[${t}] for the '${r7}' event should contain resource of type ${i}.`));
41686
41702
  }
41687
41703
  }
41688
- function Xs(r7, e, t, n, i) {
41704
+ function ea(r7, e, t, n, i) {
41689
41705
  if (i.set(e.key, (i.get(e.key) ?? 0) + 1), n.reference) {
41690
41706
  if (n.array) {
41691
41707
  if (!(typeof e.reference == "object" && Array.isArray(e.reference))) throw new d(m(`context[${t}] is invalid. Expected key '${e.key}' to be an array of references.`));
41692
41708
  for (let o of e.reference) if (!$(o)) throw new d(m(`context[${t}] is invalid. Expected key '${e.key}' to be an array of valid references.`));
41693
41709
  } else if (!$(e.reference)) throw new d(m(`context[${t}] is invalid. Expected key '${e.key}' to be a reference.`));
41694
- } else Zs(r7, e.resource, t, n);
41710
+ } else Xs(r7, e.resource, t, n);
41695
41711
  }
41696
- function ea(r7, e) {
41697
- let t = /* @__PURE__ */ new Map(), n = Js[r7];
41712
+ function ta(r7, e) {
41713
+ let t = /* @__PURE__ */ new Map(), n = Ys[r7];
41698
41714
  for (let i = 0; i < e.length; i++) {
41699
41715
  let o = e[i].key;
41700
41716
  if (!n[o]) throw new d(m(`Key '${o}' not found for event '${r7}'. Make sure to add only valid keys.`));
41701
- Xs(r7, e[i], i, n[o], t);
41717
+ ea(r7, e[i], i, n[o], t);
41702
41718
  }
41703
41719
  for (let [i, o] of Object.entries(n)) {
41704
41720
  if (!(o.optional || t.has(i))) throw new d(m(`Missing required key '${i}' on context for '${r7}' event.`));
41705
41721
  if (!o.manyAllowed && (t.get(i) || 0) > 1) throw new d(m(`${t.get(i)} context entries with key '${i}' found for the '${r7}' event when schema only allows for 1.`));
41706
41722
  }
41707
41723
  }
41708
- function Br(r7, e, t, n) {
41724
+ function qr(r7, e, t, n) {
41709
41725
  if (!(r7 && typeof r7 == "string")) throw new d(m("Must provide a topic."));
41710
- if (!Lr[e]) throw new d(m(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Lr).join(", ")}`));
41726
+ if (!Fr[e]) throw new d(m(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Fr).join(", ")}`));
41711
41727
  if (typeof t != "object") throw new d(m("context must be a context object or array of context objects."));
41712
- if (Fr.includes(e) && !n) throw new d(m(`The '${e}' event must contain a 'context.versionId'.`));
41728
+ if (Ur.includes(e) && !n) throw new d(m(`The '${e}' event must contain a 'context.versionId'.`));
41713
41729
  let i = Array.isArray(t) ? t : [t];
41714
- return ea(e, i), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: Se(), event: { "hub.topic": r7, "hub.event": e, context: i, ...n ? { "context.versionId": n } : {} } };
41730
+ return ta(e, i), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: Se(), event: { "hub.topic": r7, "hub.event": e, context: i, ...n ? { "context.versionId": n } : {} } };
41715
41731
  }
41716
41732
  var Ot = class extends K {
41717
41733
  constructor(e) {
@@ -41733,28 +41749,28 @@ var Ot = class extends K {
41733
41749
  this.websocket.close();
41734
41750
  }
41735
41751
  };
41736
- function ta(r7) {
41737
- let e = r7.replace(/-/g, "+").replace(/_/g, "/"), t = mi(e), n = Array.from(t).reduce((o, s) => {
41752
+ function ra(r7) {
41753
+ let e = r7.replace(/-/g, "+").replace(/_/g, "/"), t = yi(e), n = Array.from(t).reduce((o, s) => {
41738
41754
  let a2 = ("00" + s.charCodeAt(0).toString(16)).slice(-2);
41739
41755
  return `${o}%${a2}`;
41740
41756
  }, ""), i = decodeURIComponent(n);
41741
41757
  return JSON.parse(i);
41742
41758
  }
41743
- function bi(r7) {
41759
+ function Ei(r7) {
41744
41760
  return r7.split(".").length === 3;
41745
41761
  }
41746
41762
  function kt(r7) {
41747
41763
  let [e, t, n] = r7.split(".");
41748
- return ta(t);
41764
+ return ra(t);
41749
41765
  }
41750
- function Ei(r7) {
41766
+ function Ri(r7) {
41751
41767
  try {
41752
41768
  return typeof kt(r7).login_id == "string";
41753
41769
  } catch {
41754
41770
  return false;
41755
41771
  }
41756
41772
  }
41757
- function Ri(r7) {
41773
+ function Ci(r7) {
41758
41774
  try {
41759
41775
  let t = kt(r7).exp;
41760
41776
  return typeof t == "number" ? t * 1e3 : void 0;
@@ -41776,11 +41792,11 @@ var Vt = class {
41776
41792
  await this.medplum.delete(`keyvalue/v1/${e}`);
41777
41793
  }
41778
41794
  };
41779
- var Ci;
41780
- Ci = Symbol.toStringTag;
41795
+ var Pi;
41796
+ Pi = Symbol.toStringTag;
41781
41797
  var M = class {
41782
41798
  constructor(e) {
41783
- this[Ci] = "ReadablePromise";
41799
+ this[Pi] = "ReadablePromise";
41784
41800
  this.status = "pending";
41785
41801
  this.suspender = e.then((t) => (this.status = "success", this.response = t, t), (t) => {
41786
41802
  throw this.status = "error", this.error = t, t;
@@ -41814,7 +41830,7 @@ var M = class {
41814
41830
  };
41815
41831
  var $e = class {
41816
41832
  constructor(e) {
41817
- this.storage = e ?? (typeof localStorage < "u" ? localStorage : new qr());
41833
+ this.storage = e ?? (typeof localStorage < "u" ? localStorage : new jr());
41818
41834
  }
41819
41835
  clear() {
41820
41836
  this.storage.clear();
@@ -41833,7 +41849,7 @@ var $e = class {
41833
41849
  this.setString(e, t ? ct(t) : void 0);
41834
41850
  }
41835
41851
  };
41836
- var qr = class {
41852
+ var jr = class {
41837
41853
  constructor() {
41838
41854
  this.data = /* @__PURE__ */ new Map();
41839
41855
  }
@@ -41857,8 +41873,8 @@ var qr = class {
41857
41873
  }
41858
41874
  };
41859
41875
  var Me = { Event: typeof globalThis.Event < "u" ? globalThis.Event : void 0, ErrorEvent: void 0, CloseEvent: void 0 };
41860
- var wi = false;
41861
- function ra() {
41876
+ var Ai = false;
41877
+ function na() {
41862
41878
  if (typeof globalThis.Event > "u") throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");
41863
41879
  Me.Event = globalThis.Event, Me.ErrorEvent = class extends Event {
41864
41880
  constructor(e, t) {
@@ -41872,17 +41888,17 @@ function ra() {
41872
41888
  }
41873
41889
  };
41874
41890
  }
41875
- function na(r7, e) {
41891
+ function ia(r7, e) {
41876
41892
  if (!r7) throw new Error(e);
41877
41893
  }
41878
41894
  function Dt(r7) {
41879
41895
  return new r7.constructor(r7.type, r7);
41880
41896
  }
41881
41897
  var be = { maxReconnectionDelay: 1e4, minReconnectionDelay: 1e3 + Math.random() * 4e3, minUptime: 5e3, reconnectionDelayGrowFactor: 1.3, connectionTimeout: 4e3, maxRetries: 1 / 0, maxEnqueuedMessages: 1 / 0, startClosed: false, debug: false };
41882
- var Ai = false;
41898
+ var Oi = false;
41883
41899
  var Mt = class r extends K {
41884
41900
  constructor(t, n, i = {}) {
41885
- wi || (ra(), wi = true);
41901
+ Ai || (na(), Ai = true);
41886
41902
  super();
41887
41903
  this._retryCount = -1;
41888
41904
  this._shouldReconnect = true;
@@ -41897,7 +41913,7 @@ var Mt = class r extends K {
41897
41913
  this._handleOpen = (t2) => {
41898
41914
  this._debug("open event");
41899
41915
  let { minUptime: n2 = be.minUptime } = this._options;
41900
- clearTimeout(this._connectTimeout), this._uptimeTimeout = setTimeout(() => this._acceptOpen(), n2), na(this._ws, "WebSocket is not defined"), this._ws.binaryType = this._binaryType, this._messageQueue.forEach((i2) => this._ws?.send(i2)), this._messageQueue = [], this.onopen && this.onopen(t2), this.dispatchEvent(Dt(t2));
41916
+ clearTimeout(this._connectTimeout), this._uptimeTimeout = setTimeout(() => this._acceptOpen(), n2), ia(this._ws, "WebSocket is not defined"), this._ws.binaryType = this._binaryType, this._messageQueue.forEach((i2) => this._ws?.send(i2)), this._messageQueue = [], this.onopen && this.onopen(t2), this.dispatchEvent(Dt(t2));
41901
41917
  };
41902
41918
  this._handleMessage = (t2) => {
41903
41919
  this._debug("message event"), this.onmessage && this.onmessage(t2), this.dispatchEvent(Dt(t2));
@@ -42007,7 +42023,7 @@ var Mt = class r extends K {
42007
42023
  this._connectLock = false;
42008
42024
  return;
42009
42025
  }
42010
- !this._options.WebSocket && typeof WebSocket > "u" && !Ai && (console.error("\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket."), Ai = true);
42026
+ !this._options.WebSocket && typeof WebSocket > "u" && !Oi && (console.error("\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket."), Oi = true);
42011
42027
  let i = this._options.WebSocket || WebSocket;
42012
42028
  this._debug("connect", { url: this._url, protocols: this._protocols }), this._ws = this._protocols ? new i(this._url, this._protocols) : new i(this._url), this._ws.binaryType = this._binaryType, this._connectLock = false, this._addListeners(), this._connectTimeout = setTimeout(() => this._handleTimeout(), n);
42013
42029
  }).catch((i) => {
@@ -42039,7 +42055,7 @@ var Mt = class r extends K {
42039
42055
  clearTimeout(this._connectTimeout), clearTimeout(this._uptimeTimeout);
42040
42056
  }
42041
42057
  };
42042
- var ia = 5e3;
42058
+ var oa = 5e3;
42043
42059
  var Ge = class extends K {
42044
42060
  constructor(...e) {
42045
42061
  super(), this.criteria = new Set(e);
@@ -42054,7 +42070,7 @@ var Ge = class extends K {
42054
42070
  this.criteria.delete(e);
42055
42071
  }
42056
42072
  };
42057
- var jr = class {
42073
+ var Wr = class {
42058
42074
  constructor(e, t) {
42059
42075
  this.connecting = false;
42060
42076
  this.criteria = e, this.emitter = new Ge(e), this.refCount = 1, this.subscriptionProps = t ? { ...t } : void 0;
@@ -42075,7 +42091,7 @@ var _t = class {
42075
42091
  throw new d(m("Not a valid URL"));
42076
42092
  }
42077
42093
  let o = n?.ReconnectingWebSocket ? new n.ReconnectingWebSocket(i, void 0, { debug: n?.debug, debugLogger: n?.debugLogger }) : new Mt(i, void 0, { debug: n?.debug, debugLogger: n?.debugLogger });
42078
- this.medplum = e, this.ws = o, this.masterSubEmitter = new Ge(), this.criteriaEntries = /* @__PURE__ */ new Map(), this.criteriaEntriesBySubscriptionId = /* @__PURE__ */ new Map(), this.wsClosed = false, this.pingIntervalMs = n?.pingIntervalMs ?? ia, this.currentProfile = e.getProfile(), this.setupListeners();
42094
+ this.medplum = e, this.ws = o, this.masterSubEmitter = new Ge(), this.criteriaEntries = /* @__PURE__ */ new Map(), this.criteriaEntriesBySubscriptionId = /* @__PURE__ */ new Map(), this.wsClosed = false, this.pingIntervalMs = n?.pingIntervalMs ?? oa, this.currentProfile = e.getProfile(), this.setupListeners();
42079
42095
  }
42080
42096
  setupListeners() {
42081
42097
  let e = this.ws;
@@ -42116,7 +42132,7 @@ var _t = class {
42116
42132
  for (let o of this.getAllCriteriaEmitters()) o.dispatchEvent({ ...i });
42117
42133
  }
42118
42134
  }), e.addEventListener("error", () => {
42119
- let t = { type: "error", payload: new d(pn(new Error("WebSocket error"))) };
42135
+ let t = { type: "error", payload: new d(dn(new Error("WebSocket error"))) };
42120
42136
  this.masterSubEmitter?.dispatchEvent(t);
42121
42137
  for (let n of this.getAllCriteriaEmitters()) n.dispatchEvent({ ...t });
42122
42138
  }), e.addEventListener("close", () => {
@@ -42206,7 +42222,7 @@ var _t = class {
42206
42222
  this.masterSubEmitter && this.masterSubEmitter._addCriteria(e);
42207
42223
  let n = this.maybeGetCriteriaEntry(e, t);
42208
42224
  if (n) return n.refCount += 1, n.emitter;
42209
- let i = new jr(e, t);
42225
+ let i = new Wr(e, t);
42210
42226
  return this.addCriteriaEntry(i), this.subscribeToCriteria(i).catch(console.error), i.emitter;
42211
42227
  }
42212
42228
  removeCriteria(e, t) {
@@ -42233,25 +42249,25 @@ var _t = class {
42233
42249
  return this.masterSubEmitter || (this.masterSubEmitter = new Ge(...Array.from(this.criteriaEntries.keys()))), this.masterSubEmitter;
42234
42250
  }
42235
42251
  };
42236
- var Wr = "3.2.33-6f2add927";
42237
- var aa = A.FHIR_JSON + ", */*; q=0.1";
42238
- var ca = "https://api.medplum.com/";
42239
- var ua = 1e3;
42240
- var la = 6e4;
42241
- var pa = 0;
42242
- var da = 3e5;
42243
- var fa = "Binary/";
42244
- var Oi = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
42245
- var ha = ((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))(ha || {});
42246
- var ma = ((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))(ma || {});
42247
- var ya = ((o) => (o.ClientSecretBasic = "client_secret_basic", o.ClientSecretPost = "client_secret_post", o.ClientSecretJwt = "client_secret_jwt", o.PrivateKeyJwt = "private_key_jwt", o.None = "none", o))(ya || {});
42248
- var ga = ((e) => (e.JwtBearer = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", e))(ga || {});
42252
+ var $r = "3.3.0-0d59ebd14";
42253
+ var ca = A.FHIR_JSON + ", */*; q=0.1";
42254
+ var ua = "https://api.medplum.com/";
42255
+ var la = 1e3;
42256
+ var pa = 6e4;
42257
+ var da = 0;
42258
+ var fa = 3e5;
42259
+ var ha = "Binary/";
42260
+ var Ii = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
42261
+ var ma = ((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))(ma || {});
42262
+ var ya = ((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))(ya || {});
42263
+ var ga = ((o) => (o.ClientSecretBasic = "client_secret_basic", o.ClientSecretPost = "client_secret_post", o.ClientSecretJwt = "client_secret_jwt", o.PrivateKeyJwt = "private_key_jwt", o.None = "none", o))(ga || {});
42264
+ var xa = ((e) => (e.JwtBearer = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", e))(xa || {});
42249
42265
  var Nt = class extends K {
42250
42266
  constructor(t) {
42251
42267
  super();
42252
42268
  this.initComplete = true;
42253
42269
  if (t?.baseUrl && !t.baseUrl.startsWith("http")) throw new Error("Base URL must start with http or https");
42254
- this.options = t ?? {}, this.fetch = t?.fetch ?? xa(), this.storage = t?.storage ?? new $e(), this.createPdfImpl = t?.createPdf, this.baseUrl = Cr(t?.baseUrl ?? ca), this.fhirBaseUrl = q(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4"), this.authorizeUrl = q(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = q(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = q(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.fhircastHubUrl = q(this.baseUrl, t?.fhircastHubUrl ?? "fhircast/STU3"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.defaultHeaders = t?.defaultHeaders ?? {}, this.onUnauthenticated = t?.onUnauthenticated, this.refreshGracePeriod = t?.refreshGracePeriod ?? da, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? pa : la), this.cacheTime > 0 ? this.requestCache = new At(t?.resourceCacheSize ?? ua) : this.requestCache = void 0, t?.autoBatchTime ? (this.autoBatchTime = t.autoBatchTime, this.autoBatchQueue = []) : (this.autoBatchTime = 0, this.autoBatchQueue = void 0), t?.accessToken && this.setAccessToken(t.accessToken), this.storage.getInitPromise === void 0 ? (t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initPromise = Promise.resolve(), this.dispatchEvent({ type: "storageInitialized" })) : (this.initComplete = false, this.initPromise = this.storage.getInitPromise(), this.initPromise.then(() => {
42270
+ this.options = t ?? {}, this.fetch = t?.fetch ?? va(), this.storage = t?.storage ?? new $e(), this.createPdfImpl = t?.createPdf, this.baseUrl = Pr(t?.baseUrl ?? ua), this.fhirBaseUrl = q(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4"), this.authorizeUrl = q(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = q(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = q(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.fhircastHubUrl = q(this.baseUrl, t?.fhircastHubUrl ?? "fhircast/STU3"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.defaultHeaders = t?.defaultHeaders ?? {}, this.onUnauthenticated = t?.onUnauthenticated, this.refreshGracePeriod = t?.refreshGracePeriod ?? fa, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? da : pa), this.cacheTime > 0 ? this.requestCache = new At(t?.resourceCacheSize ?? la) : this.requestCache = void 0, t?.autoBatchTime ? (this.autoBatchTime = t.autoBatchTime, this.autoBatchQueue = []) : (this.autoBatchTime = 0, this.autoBatchQueue = void 0), t?.accessToken && this.setAccessToken(t.accessToken), this.storage.getInitPromise === void 0 ? (t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initPromise = Promise.resolve(), this.dispatchEvent({ type: "storageInitialized" })) : (this.initComplete = false, this.initPromise = this.storage.getInitPromise(), this.initPromise.then(() => {
42255
42271
  t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initComplete = true, this.dispatchEvent({ type: "storageInitialized" });
42256
42272
  }).catch((n) => {
42257
42273
  console.error(n), this.initComplete = true, this.dispatchEvent({ type: "storageInitFailed", payload: { error: n } });
@@ -42381,7 +42397,7 @@ var Nt = class extends K {
42381
42397
  }
42382
42398
  fhirSearchUrl(t, n) {
42383
42399
  let i = this.fhirUrl(t);
42384
- return n && (i.search = Zn(n)), i;
42400
+ return n && (i.search = Xn(n)), i;
42385
42401
  }
42386
42402
  search(t, n, i) {
42387
42403
  let o = this.fhirSearchUrl(t, n), s = "search-" + o.toString(), a2 = this.getCacheEntry(s, i);
@@ -42400,7 +42416,7 @@ var Nt = class extends K {
42400
42416
  searchResources(t, n, i) {
42401
42417
  let s = "searchResources-" + this.fhirSearchUrl(t, n).toString(), a2 = this.getCacheEntry(s, i);
42402
42418
  if (a2) return a2.value;
42403
- let c = new M(this.search(t, n, i).then(Vi));
42419
+ let c = new M(this.search(t, n, i).then(Di));
42404
42420
  return this.setCacheEntry(s, c), c;
42405
42421
  }
42406
42422
  async *searchResourcePages(t, n, i) {
@@ -42408,7 +42424,7 @@ var Nt = class extends K {
42408
42424
  for (; o; ) {
42409
42425
  let s = new URL(o).searchParams, a2 = await this.search(t, s, i), c = a2.link?.find((u2) => u2.relation === "next");
42410
42426
  if (!a2.entry?.length && !c) break;
42411
- yield Vi(a2), o = c?.url ? new URL(c.url) : void 0;
42427
+ yield Di(a2), o = c?.url ? new URL(c.url) : void 0;
42412
42428
  }
42413
42429
  }
42414
42430
  searchValueSet(t, n, i) {
@@ -42425,7 +42441,7 @@ var Nt = class extends K {
42425
42441
  getCachedReference(t) {
42426
42442
  let n = t.reference;
42427
42443
  if (!n) return;
42428
- if (n === "system") return Oi;
42444
+ if (n === "system") return Ii;
42429
42445
  let [i, o] = n.split("/");
42430
42446
  if (!(!i || !o)) return this.getCached(i, o);
42431
42447
  }
@@ -42436,12 +42452,12 @@ var Nt = class extends K {
42436
42452
  readReference(t, n) {
42437
42453
  let i = t.reference;
42438
42454
  if (!i) return new M(Promise.reject(new Error("Missing reference")));
42439
- if (i === "system") return new M(Promise.resolve(Oi));
42455
+ if (i === "system") return new M(Promise.resolve(Ii));
42440
42456
  let [o, s] = i.split("/");
42441
42457
  return !o || !s ? new M(Promise.reject(new Error("Invalid reference"))) : this.readResource(o, s, n);
42442
42458
  }
42443
42459
  requestSchema(t) {
42444
- if (En(t)) return Promise.resolve();
42460
+ if (Rn(t)) return Promise.resolve();
42445
42461
  let n = t + "-requestSchema", i = this.getCacheEntry(n, void 0);
42446
42462
  if (i) return i.value;
42447
42463
  let o = new M((async () => {
@@ -42487,12 +42503,12 @@ var Nt = class extends K {
42487
42503
  }
42488
42504
  }`.replace(/\s+/g, " "), a2 = await this.graphql(s);
42489
42505
  cr(a2.data.StructureDefinitionList.filter((c) => c.name === t));
42490
- for (let c of a2.data.SearchParameterList) Ar(c);
42506
+ for (let c of a2.data.SearchParameterList) Or(c);
42491
42507
  })());
42492
42508
  return this.setCacheEntry(n, o), o;
42493
42509
  }
42494
42510
  requestProfileSchema(t, n) {
42495
- if (!n?.expandProfile && Cn(t)) return Promise.resolve();
42511
+ if (!n?.expandProfile && Pn(t)) return Promise.resolve();
42496
42512
  let i = t + "-requestSchema" + (n?.expandProfile ? "-nested" : ""), o = this.getCacheEntry(i, void 0);
42497
42513
  if (o) return o.value;
42498
42514
  let s = new M((async () => {
@@ -42539,7 +42555,7 @@ var Nt = class extends K {
42539
42555
  return s || (s = t), this.cacheResource(s), this.invalidateUrl(this.fhirUrl(t.resourceType, t.id, "_history")), this.invalidateSearches(t.resourceType), s;
42540
42556
  }
42541
42557
  async createAttachment(t, n, i, o, s) {
42542
- let a2 = Di(t, n, i, o);
42558
+ let a2 = Mi(t, n, i, o);
42543
42559
  if (a2.contentType === A.XML) {
42544
42560
  let l2 = a2.data, h;
42545
42561
  l2 instanceof Blob ? h = await new Promise((x2, B) => {
@@ -42557,7 +42573,7 @@ var Nt = class extends K {
42557
42573
  return { contentType: a2.contentType, url: u2.url, title: a2.filename };
42558
42574
  }
42559
42575
  createBinary(t, n, i, o, s) {
42560
- let a2 = Di(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: l2, filename: h, securityContext: x2, onProgress: B } = a2, W = this.fhirUrl("Binary");
42576
+ let a2 = Mi(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: l2, filename: h, securityContext: x2, onProgress: B } = a2, W = this.fhirUrl("Binary");
42561
42577
  return h && W.searchParams.set("_filename", h), x2?.reference && this.setRequestHeader(c, "X-Security-Context", x2.reference), B ? this.uploadwithProgress(W, u2, l2, B, c) : this.post(W, u2, l2, c);
42562
42578
  }
42563
42579
  uploadwithProgress(t, n, i, o, s) {
@@ -42578,7 +42594,7 @@ var Nt = class extends K {
42578
42594
  }
42579
42595
  async createPdf(t, n, i, o) {
42580
42596
  if (!this.createPdfImpl) throw new Error("PDF creation not enabled");
42581
- let s = Sa(t, n, i, o), a2 = typeof n == "object" ? n : {}, { docDefinition: c, tableLayouts: u2, fonts: l2, ...h } = s, x2 = await this.createPdfImpl(c, u2, l2), B = { ...h, data: x2, contentType: "application/pdf" };
42597
+ let s = ba(t, n, i, o), a2 = typeof n == "object" ? n : {}, { docDefinition: c, tableLayouts: u2, fonts: l2, ...h } = s, x2 = await this.createPdfImpl(c, u2, l2), B = { ...h, data: x2, contentType: "application/pdf" };
42582
42598
  return this.createBinary(B, a2);
42583
42599
  }
42584
42600
  createComment(t, n, i) {
@@ -42640,7 +42656,7 @@ var Nt = class extends K {
42640
42656
  return this.accessTokenExpires !== void 0 && Date.now() < this.accessTokenExpires - (t ?? this.refreshGracePeriod);
42641
42657
  }
42642
42658
  setAccessToken(t, n) {
42643
- this.accessToken = t, this.refreshToken = n, this.accessTokenExpires = Ri(t), this.medplumServer = Ei(t);
42659
+ this.accessToken = t, this.refreshToken = n, this.accessTokenExpires = Ci(t), this.medplumServer = Ri(t);
42644
42660
  }
42645
42661
  getLogins() {
42646
42662
  return this.storage.getObject("logins") ?? [];
@@ -42688,7 +42704,7 @@ var Nt = class extends K {
42688
42704
  async download(t, n = {}) {
42689
42705
  this.refreshPromise && await this.refreshPromise;
42690
42706
  let i = t.toString();
42691
- i.startsWith(fa) && (t = this.fhirUrl(i));
42707
+ i.startsWith(ha) && (t = this.fhirUrl(i));
42692
42708
  let o = n.headers;
42693
42709
  return o || (o = {}, n.headers = o), o.Accept || (o.Accept = "*/*"), this.addFetchOptionsDefaults(n), (await this.fetchWithRetry(t.toString(), n)).blob();
42694
42710
  }
@@ -42740,14 +42756,14 @@ var Nt = class extends K {
42740
42756
  if (s.status === 401) return this.handleUnauthenticated(t, n, i);
42741
42757
  if (s.status === 204 || s.status === 304) return;
42742
42758
  let c = s.headers.get("content-type")?.includes("json");
42743
- if (s.status === 404 && !c) throw new d(un);
42759
+ if (s.status === 404 && !c) throw new d(ln);
42744
42760
  let u2 = await this.parseBody(s, c);
42745
42761
  if (s.status === 200 && i.followRedirectOnOk || s.status === 201 && i.followRedirectOnCreated) {
42746
- let l2 = await ki(s, u2);
42762
+ let l2 = await Vi(s, u2);
42747
42763
  if (l2) return this.request("GET", l2, { ...i, body: void 0 });
42748
42764
  }
42749
42765
  if (s.status === 202 && i.pollStatusOnAccepted) {
42750
- let h = await ki(s, u2) ?? o.statusUrl;
42766
+ let h = await Vi(s, u2) ?? o.statusUrl;
42751
42767
  if (h) return this.pollStatus(h, i, o);
42752
42768
  }
42753
42769
  if (s.status >= 400) throw new d(Xe(u2));
@@ -42776,7 +42792,7 @@ var Nt = class extends K {
42776
42792
  } catch (a2) {
42777
42793
  if (a2.message === "Failed to fetch" && s === 0 && this.dispatchEvent({ type: "offline" }), a2.name === "AbortError" || s === i) throw a2;
42778
42794
  }
42779
- await Er(o);
42795
+ await Rr(o);
42780
42796
  }
42781
42797
  throw new Error("Unreachable");
42782
42798
  }
@@ -42794,7 +42810,7 @@ var Nt = class extends K {
42794
42810
  if (i.pollCount === void 0) n.headers && typeof n.headers == "object" && "Prefer" in n.headers && (o.headers = { ...n.headers }, delete o.headers.Prefer), i.statusUrl = t, i.pollCount = 1;
42795
42811
  else {
42796
42812
  let s = n.pollStatusPeriod ?? 1e3;
42797
- await Er(s), i.pollCount++;
42813
+ await Rr(s), i.pollCount++;
42798
42814
  }
42799
42815
  return this.request("GET", t, o, i);
42800
42816
  }
@@ -42819,7 +42835,7 @@ var Nt = class extends K {
42819
42835
  addFetchOptionsDefaults(t) {
42820
42836
  Object.entries(this.defaultHeaders).forEach(([n, i]) => {
42821
42837
  this.setRequestHeader(t, n, i);
42822
- }), this.setRequestHeader(t, "Accept", aa, true), this.options.extendedMode !== false && this.setRequestHeader(t, "X-Medplum", "extended"), t.body && this.setRequestHeader(t, "Content-Type", A.FHIR_JSON, true), this.accessToken ? this.setRequestHeader(t, "Authorization", "Bearer " + this.accessToken) : this.basicAuth && this.setRequestHeader(t, "Authorization", "Basic " + this.basicAuth), t.cache || (t.cache = "no-cache"), t.credentials || (t.credentials = "include");
42838
+ }), this.setRequestHeader(t, "Accept", ca, true), this.options.extendedMode !== false && this.setRequestHeader(t, "X-Medplum", "extended"), t.body && this.setRequestHeader(t, "Content-Type", A.FHIR_JSON, true), this.accessToken ? this.setRequestHeader(t, "Authorization", "Bearer " + this.accessToken) : this.basicAuth && this.setRequestHeader(t, "Authorization", "Basic " + this.basicAuth), t.cache || (t.cache = "no-cache"), t.credentials || (t.credentials = "include");
42823
42839
  }
42824
42840
  setRequestContentType(t, n) {
42825
42841
  this.setRequestHeader(t, "Content-Type", n);
@@ -42836,20 +42852,20 @@ var Nt = class extends K {
42836
42852
  return this.refresh() ? this.request(t, n, i) : (this.clear(), this.onUnauthenticated && this.onUnauthenticated(), Promise.reject(new d(Re)));
42837
42853
  }
42838
42854
  async startPkce() {
42839
- let t = _r();
42855
+ let t = Nr();
42840
42856
  sessionStorage.setItem("pkceState", t);
42841
- let n = _r().slice(0, 128);
42857
+ let n = Nr().slice(0, 128);
42842
42858
  sessionStorage.setItem("codeVerifier", n);
42843
- let i = await gi(n), o = Hn(i).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
42859
+ let i = await xi(n), o = Qn(i).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
42844
42860
  return sessionStorage.setItem("codeChallenge", o), { codeChallengeMethod: "S256", codeChallenge: o };
42845
42861
  }
42846
42862
  async requestAuthorization(t) {
42847
42863
  let n = await this.ensureCodeChallenge(t ?? {}), i = new URL(this.authorizeUrl);
42848
- i.searchParams.set("response_type", "code"), i.searchParams.set("state", sessionStorage.getItem("pkceState")), i.searchParams.set("client_id", n.clientId ?? this.clientId), i.searchParams.set("redirect_uri", n.redirectUri ?? Ii()), i.searchParams.set("code_challenge_method", n.codeChallengeMethod), i.searchParams.set("code_challenge", n.codeChallenge), i.searchParams.set("scope", n.scope ?? "openid profile"), window.location.assign(i.toString());
42864
+ i.searchParams.set("response_type", "code"), i.searchParams.set("state", sessionStorage.getItem("pkceState")), i.searchParams.set("client_id", n.clientId ?? this.clientId), i.searchParams.set("redirect_uri", n.redirectUri ?? ki()), i.searchParams.set("code_challenge_method", n.codeChallengeMethod), i.searchParams.set("code_challenge", n.codeChallenge), i.searchParams.set("scope", n.scope ?? "openid profile"), window.location.assign(i.toString());
42849
42865
  }
42850
42866
  processCode(t, n) {
42851
42867
  let i = new URLSearchParams();
42852
- if (i.set("grant_type", "authorization_code"), i.set("code", t), i.set("client_id", n?.clientId ?? this.clientId), i.set("redirect_uri", n?.redirectUri ?? Ii()), typeof sessionStorage < "u") {
42868
+ if (i.set("grant_type", "authorization_code"), i.set("code", t), i.set("client_id", n?.clientId ?? this.clientId), i.set("redirect_uri", n?.redirectUri ?? ki()), typeof sessionStorage < "u") {
42853
42869
  let o = sessionStorage.getItem("codeVerifier");
42854
42870
  o && i.set("code_verifier", o);
42855
42871
  }
@@ -42881,25 +42897,25 @@ var Nt = class extends K {
42881
42897
  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);
42882
42898
  }
42883
42899
  setBasicAuth(t, n) {
42884
- this.clientId = t, this.clientSecret = n, this.basicAuth = yi(t + ":" + n);
42900
+ this.clientId = t, this.clientSecret = n, this.basicAuth = gi(t + ":" + n);
42885
42901
  }
42886
42902
  async fhircastSubscribe(t, n) {
42887
42903
  if (!(typeof t == "string" && t !== "")) throw new d(m("Invalid topic provided. Topic must be a valid string."));
42888
42904
  if (!(typeof n == "object" && Array.isArray(n) && n.length > 0)) throw new d(m("Invalid events provided. Events must be an array of event names containing at least one event."));
42889
- let i = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post(this.fhircastHubUrl, Ur(i), A.FORM_URL_ENCODED))["hub.channel.endpoint"];
42905
+ let i = { channelType: "websocket", mode: "subscribe", topic: t, events: n }, s = (await this.post(this.fhircastHubUrl, Br(i), A.FORM_URL_ENCODED))["hub.channel.endpoint"];
42890
42906
  if (!s) throw new Error("Invalid response!");
42891
42907
  return i.endpoint = s, i;
42892
42908
  }
42893
42909
  async fhircastUnsubscribe(t) {
42894
42910
  if (!It(t)) throw new d(m("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));
42895
42911
  if (!(t.endpoint && typeof t.endpoint == "string" && t.endpoint.startsWith("ws"))) throw new d(m("Provided subscription request must have an endpoint in order to unsubscribe."));
42896
- t.mode = "unsubscribe", await this.post(this.fhircastHubUrl, Ur(t), A.FORM_URL_ENCODED);
42912
+ t.mode = "unsubscribe", await this.post(this.fhircastHubUrl, Br(t), A.FORM_URL_ENCODED);
42897
42913
  }
42898
42914
  fhircastConnect(t) {
42899
42915
  return new Ot(t);
42900
42916
  }
42901
42917
  async fhircastPublish(t, n, i, o) {
42902
- return vi(n) ? this.post(this.fhircastHubUrl, Br(t, n, i, o), A.JSON) : (Ti(n), this.post(this.fhircastHubUrl, Br(t, n, i), A.JSON));
42918
+ return Ti(n) ? this.post(this.fhircastHubUrl, qr(t, n, i, o), A.JSON) : (Si(n), this.post(this.fhircastHubUrl, qr(t, n, i), A.JSON));
42903
42919
  }
42904
42920
  async fhircastGetContext(t) {
42905
42921
  return this.get(`${this.fhircastHubUrl}/${t}`);
@@ -42920,9 +42936,9 @@ var Nt = class extends K {
42920
42936
  this.clearActiveLogin();
42921
42937
  try {
42922
42938
  let a2 = await o.json();
42923
- throw new d(b(a2.error_description));
42939
+ throw new d(S(a2.error_description));
42924
42940
  } catch (a2) {
42925
- throw new d(b("Failed to fetch tokens"), a2);
42941
+ throw new d(S("Failed to fetch tokens"), a2);
42926
42942
  }
42927
42943
  }
42928
42944
  let s = await o.json();
@@ -42930,9 +42946,9 @@ var Nt = class extends K {
42930
42946
  }
42931
42947
  async verifyTokens(t) {
42932
42948
  let n = t.access_token;
42933
- if (bi(n)) {
42949
+ if (Ei(n)) {
42934
42950
  let i = kt(n);
42935
- if (Date.now() >= i.exp * 1e3) throw this.clearActiveLogin(), new d(ln);
42951
+ if (Date.now() >= i.exp * 1e3) throw this.clearActiveLogin(), new d(pn);
42936
42952
  if (i.cid) {
42937
42953
  if (i.cid !== this.clientId) throw this.clearActiveLogin(), new d(tr);
42938
42954
  } else if (this.clientId && i.client_id !== this.clientId) throw this.clearActiveLogin(), new d(tr);
@@ -42955,7 +42971,7 @@ var Nt = class extends K {
42955
42971
  }
42956
42972
  }
42957
42973
  getSubscriptionManager() {
42958
- return this.subscriptionManager || (this.subscriptionManager = new _t(this, Yn(this.baseUrl, "/ws/subscriptions-r4"))), this.subscriptionManager;
42974
+ return this.subscriptionManager || (this.subscriptionManager = new _t(this, Zn(this.baseUrl, "/ws/subscriptions-r4"))), this.subscriptionManager;
42959
42975
  }
42960
42976
  subscribeToCriteria(t, n) {
42961
42977
  return this.getSubscriptionManager().addCriteria(t, n);
@@ -42967,41 +42983,41 @@ var Nt = class extends K {
42967
42983
  return this.getSubscriptionManager().getMasterEmitter();
42968
42984
  }
42969
42985
  };
42970
- function xa() {
42986
+ function va() {
42971
42987
  if (!globalThis.fetch) throw new Error("Fetch not available in this environment");
42972
42988
  return globalThis.fetch.bind(globalThis);
42973
42989
  }
42974
- function Ii() {
42990
+ function ki() {
42975
42991
  return typeof window > "u" ? "" : window.location.protocol + "//" + window.location.host + "/";
42976
42992
  }
42977
- async function ki(r7, e) {
42993
+ async function Vi(r7, e) {
42978
42994
  let t = r7.headers.get("content-location");
42979
42995
  if (t) return t;
42980
42996
  let n = r7.headers.get("location");
42981
42997
  if (n) return n;
42982
42998
  if (Ce(e) && e.issue?.[0]?.diagnostics) return e.issue[0].diagnostics;
42983
42999
  }
42984
- function Vi(r7) {
43000
+ function Di(r7) {
42985
43001
  let e = r7.entry?.map((t) => t.resource) ?? [];
42986
43002
  return Object.assign(e, { bundle: r7 });
42987
43003
  }
42988
- function va(r7) {
43004
+ function Ta(r7) {
42989
43005
  return R(r7) && "data" in r7 && "contentType" in r7;
42990
43006
  }
42991
- function Di(r7, e, t, n) {
42992
- return va(r7) ? r7 : { data: r7, filename: e, contentType: t, onProgress: n };
43007
+ function Mi(r7, e, t, n) {
43008
+ return Ta(r7) ? r7 : { data: r7, filename: e, contentType: t, onProgress: n };
42993
43009
  }
42994
- function Ta(r7) {
43010
+ function Sa(r7) {
42995
43011
  return R(r7) && "docDefinition" in r7;
42996
43012
  }
42997
- function Sa(r7, e, t, n) {
42998
- return Ta(r7) ? r7 : { docDefinition: r7, filename: e, tableLayouts: t, fonts: n };
43013
+ function ba(r7, e, t, n) {
43014
+ return Sa(r7) ? r7 : { docDefinition: r7, filename: e, tableLayouts: t, fonts: n };
42999
43015
  }
43000
- var Va = [...je, "->", "<<", ">>", "=="];
43001
- var _a = We().registerInfix("->", { precedence: y.Arrow }).registerInfix(";", { precedence: y.Semicolon });
43002
- var Xa = " ".repeat(2);
43003
- var tc = [...je, "eq", "ne", "co"];
43004
- var ic = We();
43016
+ var Da = [...je, "->", "<<", ">>", "=="];
43017
+ var Na = We().registerInfix("->", { precedence: y.Arrow }).registerInfix(";", { precedence: y.Semicolon });
43018
+ var ec = " ".repeat(2);
43019
+ var rc = [...je, "eq", "ne", "co"];
43020
+ var oc = We();
43005
43021
  var le = class {
43006
43022
  constructor(e = "\r", t = "|", n = "^", i = "~", o = "\\", s = "&") {
43007
43023
  this.segmentSeparator = e;
@@ -43018,7 +43034,7 @@ var le = class {
43018
43034
  return this.componentSeparator + this.repetitionSeparator + this.escapeCharacter + this.subcomponentSeparator;
43019
43035
  }
43020
43036
  };
43021
- var Yi = class r2 {
43037
+ var Zi = class r2 {
43022
43038
  constructor(e, t = new le()) {
43023
43039
  this.context = t, this.segments = e;
43024
43040
  }
@@ -43042,7 +43058,7 @@ var Yi = class r2 {
43042
43058
  }
43043
43059
  buildAck() {
43044
43060
  let e = /* @__PURE__ */ new Date(), t = this.getSegment("MSH"), n = t?.getField(3)?.toString() ?? "", i = t?.getField(4)?.toString() ?? "", o = t?.getField(5)?.toString() ?? "", s = t?.getField(6)?.toString() ?? "", a2 = t?.getField(10)?.toString() ?? "", c = t?.getField(12)?.toString() ?? "2.5.1";
43045
- return new r2([new ze(["MSH", this.context.getMsh2(), o, s, n, i, sc(e), "", this.buildAckMessageType(t), e.getTime().toString(), "P", c], this.context), new ze(["MSA", "AA", a2, "OK"], this.context)]);
43061
+ return new r2([new ze(["MSH", this.context.getMsh2(), o, s, n, i, ac(e), "", this.buildAckMessageType(t), e.getTime().toString(), "P", c], this.context), new ze(["MSA", "AA", a2, "OK"], this.context)]);
43046
43062
  }
43047
43063
  buildAckMessageType(e) {
43048
43064
  let t = e?.getField(9), n = t?.getComponent(2), i = t?.getComponent(3), o = "ACK";
@@ -43059,7 +43075,7 @@ var Yi = class r2 {
43059
43075
  };
43060
43076
  var ze = class r3 {
43061
43077
  constructor(e, t = new le()) {
43062
- this.context = t, Wn(e) ? this.fields = e.map((n) => _e.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
43078
+ this.context = t, $n(e) ? this.fields = e.map((n) => _e.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
43063
43079
  }
43064
43080
  get(e) {
43065
43081
  return this.fields[e];
@@ -43100,12 +43116,12 @@ var _e = class r4 {
43100
43116
  return new r4(e.split(t.repetitionSeparator).map((n) => n.split(t.componentSeparator)), t);
43101
43117
  }
43102
43118
  };
43103
- function sc(r7) {
43119
+ function ac(r7) {
43104
43120
  let e = r7 instanceof Date ? r7 : new Date(r7), n = e.toISOString().replace(/[-:T]/g, "").replace(/(\.\d+)?Z$/, ""), i = e.getUTCMilliseconds();
43105
43121
  return i > 0 && (n += "." + i.toString()), n;
43106
43122
  }
43107
- var Zr = ((o) => (o[o.NONE = 0] = "NONE", o[o.ERROR = 1] = "ERROR", o[o.WARN = 2] = "WARN", o[o.INFO = 3] = "INFO", o[o.DEBUG = 4] = "DEBUG", o))(Zr || {});
43108
- var Zi = class r5 {
43123
+ var Xr = ((o) => (o[o.NONE = 0] = "NONE", o[o.ERROR = 1] = "ERROR", o[o.WARN = 2] = "WARN", o[o.INFO = 3] = "INFO", o[o.DEBUG = 4] = "DEBUG", o))(Xr || {});
43124
+ var Xi = class r5 {
43109
43125
  constructor(e, t = {}, n = 3, i) {
43110
43126
  this.write = e;
43111
43127
  this.metadata = t;
@@ -43135,17 +43151,17 @@ var Zi = class r5 {
43135
43151
  }
43136
43152
  log(e, t, n) {
43137
43153
  e > this.level || (n instanceof Error && (n = { error: n.toString(), stack: n.stack?.split(`
43138
- `) }), this.write(JSON.stringify({ level: Zr[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: this.prefix ? `${this.prefix}${t}` : t, ...n, ...this.metadata })));
43154
+ `) }), this.write(JSON.stringify({ level: Xr[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: this.prefix ? `${this.prefix}${t}` : t, ...n, ...this.metadata })));
43139
43155
  }
43140
43156
  };
43141
- function bh(r7) {
43142
- let e = Zr[r7.toUpperCase()];
43157
+ function Eh(r7) {
43158
+ let e = Xr[r7.toUpperCase()];
43143
43159
  if (e === void 0) throw new Error(`Invalid log level: ${r7}`);
43144
43160
  return e;
43145
43161
  }
43146
- var fc = "https://meta.medplum.com/releases";
43162
+ var hc = "https://meta.medplum.com/releases";
43147
43163
  var Ht = /* @__PURE__ */ new Map();
43148
- function hc(r7) {
43164
+ function mc(r7) {
43149
43165
  let e = r7;
43150
43166
  if (!e.tag_name) throw new Error("Manifest missing tag_name");
43151
43167
  let t = e.assets;
@@ -43155,11 +43171,11 @@ function hc(r7) {
43155
43171
  if (!n.name) throw new Error("Asset missing name");
43156
43172
  }
43157
43173
  }
43158
- async function en(r7, e, t) {
43174
+ async function tn(r7, e, t) {
43159
43175
  let n = Ht.get(e ?? "latest");
43160
43176
  if (!n) {
43161
- let i = e ? `v${e}` : "latest", o = new URL(`${fc}/${i}.json`);
43162
- if (o.searchParams.set("a", r7), o.searchParams.set("c", Wr), t) for (let [c, u2] of Object.entries(t)) o.searchParams.set(c, u2);
43177
+ let i = e ? `v${e}` : "latest", o = new URL(`${hc}/${i}.json`);
43178
+ if (o.searchParams.set("a", r7), o.searchParams.set("c", $r), t) for (let [c, u2] of Object.entries(t)) o.searchParams.set(c, u2);
43163
43179
  let s = await fetch(o.toString());
43164
43180
  if (s.status !== 200) {
43165
43181
  let c;
@@ -43171,24 +43187,24 @@ async function en(r7, e, t) {
43171
43187
  throw new Error(`Received status code ${s.status} while fetching manifest for version '${e ?? "latest"}'. Message: ${c}`);
43172
43188
  }
43173
43189
  let a2 = await s.json();
43174
- hc(a2), n = a2, Ht.set(e ?? "latest", n), e || Ht.set(n.tag_name.slice(1), n);
43190
+ mc(a2), n = a2, Ht.set(e ?? "latest", n), e || Ht.set(n.tag_name.slice(1), n);
43175
43191
  }
43176
43192
  return n;
43177
43193
  }
43178
- function mc(r7) {
43194
+ function yc(r7) {
43179
43195
  return /^\d+\.\d+\.\d+$/.test(r7);
43180
43196
  }
43181
- async function Lh(r7, e) {
43182
- if (!mc(e)) return false;
43197
+ async function Fh(r7, e) {
43198
+ if (!yc(e)) return false;
43183
43199
  try {
43184
- await en(r7, e);
43200
+ await tn(r7, e);
43185
43201
  } catch {
43186
43202
  return false;
43187
43203
  }
43188
43204
  return true;
43189
43205
  }
43190
- async function Fh(r7) {
43191
- let e = await en(r7);
43206
+ async function Uh(r7) {
43207
+ let e = await tn(r7);
43192
43208
  if (!e.tag_name.startsWith("v")) throw new Error(`Invalid release name found. Release tag '${e.tag_name}' did not start with 'v'`);
43193
43209
  return e.tag_name.slice(1);
43194
43210
  }
@@ -43236,7 +43252,7 @@ var p2 = class extends a {
43236
43252
  e.on("data", (s) => {
43237
43253
  try {
43238
43254
  if (this.appendData(s), s.at(-2) === 28 && s.at(-1) === 13) {
43239
- let o = Buffer.concat(this.chunks), i = o.subarray(1, o.length - 2), f2 = (0, import_iconv_lite.decode)(i, this.encoding), g2 = Yi.parse(f2);
43255
+ let o = Buffer.concat(this.chunks), i = o.subarray(1, o.length - 2), f2 = (0, import_iconv_lite.decode)(i, this.encoding), g2 = Zi.parse(f2);
43240
43256
  this.dispatchEvent(new d2(this, g2)), this.resetBuffer();
43241
43257
  }
43242
43258
  } catch (o) {
@@ -43419,8 +43435,8 @@ var AgentDicomChannel = class extends BaseChannel {
43419
43435
  this.association = association;
43420
43436
  association.setMaxPduLength(65536);
43421
43437
  association.getPresentationContexts().forEach(({ context }) => {
43422
- context.getTransferSyntaxUids().forEach((ts) => {
43423
- context.setResult(dimse.constants.PresentationContextResult.Accept, ts);
43438
+ context.getTransferSyntaxUids().forEach((ts2) => {
43439
+ context.setResult(dimse.constants.PresentationContextResult.Accept, ts2);
43424
43440
  });
43425
43441
  });
43426
43442
  this.sendAssociationAccept();
@@ -43565,7 +43581,7 @@ var AgentHl7Channel = class extends BaseChannel {
43565
43581
  sendToRemote(msg) {
43566
43582
  const connection = this.connections.get(msg.remote);
43567
43583
  if (connection) {
43568
- connection.hl7Connection.send(Yi.parse(msg.body));
43584
+ connection.hl7Connection.send(Zi.parse(msg.body));
43569
43585
  }
43570
43586
  }
43571
43587
  handleNewConnection(connection) {
@@ -43614,7 +43630,7 @@ var UPGRADER_LOG_PATH = (0, import_node_path2.resolve)(
43614
43630
  );
43615
43631
  var RELEASES_PATH = (0, import_node_path2.resolve)(__dirname);
43616
43632
  async function downloadRelease(version, path) {
43617
- const release = await en("agent-upgrader", version);
43633
+ const release = await tn("agent-upgrader", version);
43618
43634
  const downloadUrl = parseDownloadUrl(release, (0, import_node_os2.platform)());
43619
43635
  const { body } = await fetch(downloadUrl);
43620
43636
  if (!body) {
@@ -43626,9 +43642,9 @@ async function downloadRelease(version, path) {
43626
43642
  writeStream.once("close", resolve2);
43627
43643
  });
43628
43644
  }
43629
- function parseDownloadUrl(release, os) {
43645
+ function parseDownloadUrl(release, os2) {
43630
43646
  let endingToMatch;
43631
- switch (os) {
43647
+ switch (os2) {
43632
43648
  case "win32":
43633
43649
  endingToMatch = ".exe";
43634
43650
  break;
@@ -43636,14 +43652,14 @@ function parseDownloadUrl(release, os) {
43636
43652
  endingToMatch = "linux";
43637
43653
  break;
43638
43654
  default:
43639
- throw new Error(`Unsupported platform: ${os}`);
43655
+ throw new Error(`Unsupported platform: ${os2}`);
43640
43656
  }
43641
43657
  for (const asset of release.assets) {
43642
43658
  if (asset.name.endsWith(endingToMatch)) {
43643
43659
  return asset.browser_download_url;
43644
43660
  }
43645
43661
  }
43646
- throw new Error(`No download URL found for release '${release.tag_name}' for ${os}`);
43662
+ throw new Error(`No download URL found for release '${release.tag_name}' for ${os2}`);
43647
43663
  }
43648
43664
  function getReleaseBinPath(version) {
43649
43665
  let binaryName;
@@ -43690,7 +43706,7 @@ var App = class _App {
43690
43706
  this.shutdown = false;
43691
43707
  this.keepAlive = false;
43692
43708
  _App.instance = this;
43693
- this.log = new Zi((msg) => console.log(msg), void 0, logLevel);
43709
+ this.log = new Xi((msg) => console.log(msg), void 0, logLevel);
43694
43710
  }
43695
43711
  async start() {
43696
43712
  this.log.info("Medplum service starting...");
@@ -43710,7 +43726,7 @@ var App = class _App {
43710
43726
  if ((0, import_node_fs3.existsSync)(UPGRADE_MANIFEST_PATH)) {
43711
43727
  const upgradeFile = (0, import_node_fs3.readFileSync)(UPGRADE_MANIFEST_PATH, { encoding: "utf-8" });
43712
43728
  const upgradeDetails = JSON.parse(upgradeFile);
43713
- if (upgradeDetails.targetVersion === Wr.split("-")[0]) {
43729
+ if (upgradeDetails.targetVersion === $r.split("-")[0]) {
43714
43730
  await this.sendToWebSocket({
43715
43731
  type: "agent:upgrade:response",
43716
43732
  statusCode: 200,
@@ -43718,7 +43734,7 @@ var App = class _App {
43718
43734
  });
43719
43735
  this.log.info(`Successfully upgraded to version ${upgradeDetails.targetVersion}`);
43720
43736
  } else {
43721
- const errMsg = `Failed to upgrade to version ${upgradeDetails.targetVersion}. Agent still running with version ${Wr}`;
43737
+ const errMsg = `Failed to upgrade to version ${upgradeDetails.targetVersion}. Agent still running with version ${$r}`;
43722
43738
  await this.sendToWebSocket({
43723
43739
  type: "agent:error",
43724
43740
  body: errMsg,
@@ -43793,7 +43809,7 @@ var App = class _App {
43793
43809
  break;
43794
43810
  case "agent:heartbeat:request":
43795
43811
  this.outstandingHeartbeats = 0;
43796
- await this.sendToWebSocket({ type: "agent:heartbeat:response", version: Wr });
43812
+ await this.sendToWebSocket({ type: "agent:heartbeat:response", version: $r });
43797
43813
  break;
43798
43814
  case "agent:heartbeat:response":
43799
43815
  this.outstandingHeartbeats = 0;
@@ -44068,7 +44084,7 @@ IPv6 is currently unsupported.`;
44068
44084
  this.log.error(errMsg);
44069
44085
  throw new Error(errMsg);
44070
44086
  }
44071
- if (!((0, import_node_net3.isIPv4)(message.remote) || dl(message.remote))) {
44087
+ if (!((0, import_node_net3.isIPv4)(message.remote) || fl(message.remote))) {
44072
44088
  const errMsg = `Attempted to ping an invalid host.
44073
44089
 
44074
44090
  "${message.remote}" is not a valid IPv4 address or a resolvable hostname.`;
@@ -44131,7 +44147,7 @@ ${result}`);
44131
44147
  return;
44132
44148
  }
44133
44149
  let child;
44134
- if (message.version && !await Lh("agent-upgrader", message.version)) {
44150
+ if (message.version && !await Fh("agent-upgrader", message.version)) {
44135
44151
  const versionTag = message.version ? `v${message.version}` : "latest";
44136
44152
  const errMsg = `Error during upgrading to version '${versionTag}'. '${message.version}' is not a valid version`;
44137
44153
  this.log.error(errMsg);
@@ -44178,12 +44194,12 @@ ${result}`);
44178
44194
  try {
44179
44195
  await this.stop();
44180
44196
  this.log.info("Successfully stopped agent network services");
44181
- const targetVersion = message.version ?? await Fh("agent-upgrader");
44182
- this.log.info("Writing upgrade manifest...", { previousVersion: Wr, targetVersion });
44197
+ const targetVersion = message.version ?? await Uh("agent-upgrader");
44198
+ this.log.info("Writing upgrade manifest...", { previousVersion: $r, targetVersion });
44183
44199
  (0, import_node_fs3.writeFileSync)(
44184
44200
  UPGRADE_MANIFEST_PATH,
44185
44201
  JSON.stringify({
44186
- previousVersion: Wr,
44202
+ previousVersion: $r,
44187
44203
  targetVersion,
44188
44204
  callback: message.callback ?? null
44189
44205
  }),
@@ -44251,7 +44267,7 @@ ${result}`);
44251
44267
  });
44252
44268
  }
44253
44269
  }
44254
- client.sendAndWait(Yi.parse(message.body)).then((response) => {
44270
+ client.sendAndWait(Zi.parse(message.body)).then((response) => {
44255
44271
  this.log.info(`Response: ${response.toString().replaceAll("\r", "\n")}`);
44256
44272
  this.addToWebSocketQueue({
44257
44273
  type: "agent:transmit:response",
@@ -44320,7 +44336,7 @@ async function agentMain(argv) {
44320
44336
  const { baseUrl, clientId, clientSecret, agentId } = args;
44321
44337
  const medplum = new Nt({ baseUrl, clientId });
44322
44338
  await medplum.startClientLogin(clientId, clientSecret);
44323
- const app = new App(medplum, agentId, bh(args.logLevel ?? "INFO"));
44339
+ const app = new App(medplum, agentId, Eh(args.logLevel ?? "INFO"));
44324
44340
  await app.start();
44325
44341
  process.on("SIGINT", async () => {
44326
44342
  console.log("Gracefully shutting down from SIGINT (Ctrl-C)");
@@ -44348,7 +44364,7 @@ async function upgraderMain(argv) {
44348
44364
  if ((0, import_node_os4.platform)() !== "win32") {
44349
44365
  throw new Error(`Unsupported platform: ${(0, import_node_os4.platform)()}. Agent upgrader currently only supports Windows`);
44350
44366
  }
44351
- const globalLogger = new Zi((msg) => console.log(msg));
44367
+ const globalLogger = new Xi((msg) => console.log(msg));
44352
44368
  if (!import_node_process2.default.send) {
44353
44369
  globalLogger.error("Upgrader not started as a child process with Node IPC enabled. Aborting...");
44354
44370
  import_node_process2.default.exit(1);
@@ -44361,10 +44377,10 @@ async function upgraderMain(argv) {
44361
44377
  });
44362
44378
  });
44363
44379
  import_node_process2.default.send({ type: "STARTED" });
44364
- if (argv[3] && !mc(argv[3])) {
44380
+ if (argv[3] && !yc(argv[3])) {
44365
44381
  throw new Error("Invalid version specified");
44366
44382
  }
44367
- const version = argv[3] ?? await Fh("agent-upgrader");
44383
+ const version = argv[3] ?? await Uh("agent-upgrader");
44368
44384
  const binPath = getReleaseBinPath(version);
44369
44385
  if (!(0, import_node_fs5.existsSync)(binPath)) {
44370
44386
  globalLogger.info(`Could not find binary at "${binPath}". Downloading release from GitHub...`);