@medplum/agent 3.2.26 → 3.2.27
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.
- package/dist/cjs/index.cjs +436 -432
- package/package.json +5 -5
package/dist/cjs/index.cjs
CHANGED
|
@@ -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 = (
|
|
15
|
+
var __copyProps = (to, 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(
|
|
19
|
-
__defProp(
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
20
|
}
|
|
21
|
-
return
|
|
21
|
+
return to;
|
|
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
|
|
7391
|
-
if (
|
|
7392
|
-
return
|
|
7390
|
+
const fn = this.options[prop];
|
|
7391
|
+
if (fn) {
|
|
7392
|
+
return fn({ level, logger: this.logger });
|
|
7393
7393
|
}
|
|
7394
7394
|
return stache;
|
|
7395
7395
|
});
|
|
@@ -7667,8 +7667,8 @@ var require_dcmjs = __commonJS({
|
|
|
7667
7667
|
}
|
|
7668
7668
|
return _construct.apply(null, arguments);
|
|
7669
7669
|
}
|
|
7670
|
-
function _isNativeFunction(
|
|
7671
|
-
return Function.toString.call(
|
|
7670
|
+
function _isNativeFunction(fn) {
|
|
7671
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
7672
7672
|
}
|
|
7673
7673
|
function _wrapNativeSuper(Class) {
|
|
7674
7674
|
var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
@@ -7767,7 +7767,7 @@ var require_dcmjs = __commonJS({
|
|
|
7767
7767
|
var _arr = [];
|
|
7768
7768
|
var _n2 = true;
|
|
7769
7769
|
var _d = false;
|
|
7770
|
-
var _s,
|
|
7770
|
+
var _s, _e2;
|
|
7771
7771
|
try {
|
|
7772
7772
|
for (_i = _i.call(arr); !(_n2 = (_s = _i.next()).done); _n2 = true) {
|
|
7773
7773
|
_arr.push(_s.value);
|
|
@@ -7775,12 +7775,12 @@ var require_dcmjs = __commonJS({
|
|
|
7775
7775
|
}
|
|
7776
7776
|
} catch (err2) {
|
|
7777
7777
|
_d = true;
|
|
7778
|
-
|
|
7778
|
+
_e2 = err2;
|
|
7779
7779
|
} finally {
|
|
7780
7780
|
try {
|
|
7781
7781
|
if (!_n2 && _i["return"] != null) _i["return"]();
|
|
7782
7782
|
} finally {
|
|
7783
|
-
if (_d) throw
|
|
7783
|
+
if (_d) throw _e2;
|
|
7784
7784
|
}
|
|
7785
7785
|
}
|
|
7786
7786
|
return _arr;
|
|
@@ -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
|
|
13526
|
-
|
|
13527
|
-
if (
|
|
13528
|
-
var integerStringArray =
|
|
13529
|
-
|
|
13530
|
-
return
|
|
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);
|
|
13531
13531
|
});
|
|
13532
13532
|
} else {
|
|
13533
|
-
|
|
13533
|
+
is2 = [is2 === "" ? null : Number(is2)];
|
|
13534
13534
|
}
|
|
13535
|
-
return
|
|
13535
|
+
return is2;
|
|
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(
|
|
13547
|
-
return _this12.formatValue(
|
|
13546
|
+
var val = Array.isArray(value) ? value.map(function(is2) {
|
|
13547
|
+
return _this12.formatValue(is2);
|
|
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
|
|
14263
|
+
value: function is2(t) {
|
|
14264
14264
|
return this.value == t;
|
|
14265
14265
|
}
|
|
14266
14266
|
}, {
|
|
@@ -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,
|
|
18374
|
+
return function(a2, stride, offset, count, fn, arg) {
|
|
18375
18375
|
var i, l3;
|
|
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
|
-
|
|
18391
|
+
fn(vec, vec, arg);
|
|
18392
18392
|
a2[i] = vec[0];
|
|
18393
18393
|
a2[i + 1] = vec[1];
|
|
18394
18394
|
a2[i + 2] = vec[2];
|
|
@@ -24860,11 +24860,11 @@ var require_once = __commonJS({
|
|
|
24860
24860
|
value: true
|
|
24861
24861
|
});
|
|
24862
24862
|
exports2.default = once;
|
|
24863
|
-
function once(
|
|
24863
|
+
function once(fn) {
|
|
24864
24864
|
return function() {
|
|
24865
|
-
if (
|
|
24866
|
-
var callFn =
|
|
24867
|
-
|
|
24865
|
+
if (fn === null) return;
|
|
24866
|
+
var callFn = fn;
|
|
24867
|
+
fn = 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(
|
|
25407
|
+
function onlyOnce(fn) {
|
|
25408
25408
|
return function() {
|
|
25409
|
-
if (
|
|
25410
|
-
var callFn =
|
|
25411
|
-
|
|
25409
|
+
if (fn === null) throw new Error("Callback was already called.");
|
|
25410
|
+
var callFn = fn;
|
|
25411
|
+
fn = 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(
|
|
25542
|
+
exports2.default = function(fn) {
|
|
25543
25543
|
return function() {
|
|
25544
25544
|
var args = (0, _slice2.default)(arguments);
|
|
25545
25545
|
var callback = args.pop();
|
|
25546
|
-
|
|
25546
|
+
fn.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(
|
|
25576
|
-
setTimeout(
|
|
25575
|
+
function fallback(fn) {
|
|
25576
|
+
setTimeout(fn, 0);
|
|
25577
25577
|
}
|
|
25578
25578
|
function wrap(defer) {
|
|
25579
|
-
return function(
|
|
25579
|
+
return function(fn) {
|
|
25580
25580
|
var args = (0, _slice2.default)(arguments, 1);
|
|
25581
25581
|
defer(function() {
|
|
25582
|
-
|
|
25582
|
+
fn.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(
|
|
25663
|
-
return supportsSymbol &&
|
|
25662
|
+
function isAsync(fn) {
|
|
25663
|
+
return supportsSymbol && fn[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(
|
|
25705
|
+
function doLimit(fn, limit) {
|
|
25706
25706
|
return function(iterable, iteratee, callback) {
|
|
25707
|
-
return
|
|
25707
|
+
return fn(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(
|
|
25759
|
+
eachSeries(listeners.slice(), function(fn, next) {
|
|
25760
25760
|
var err;
|
|
25761
|
-
if (
|
|
25761
|
+
if (fn.length < 2) {
|
|
25762
25762
|
try {
|
|
25763
|
-
|
|
25763
|
+
fn.call(self2, data2);
|
|
25764
25764
|
} catch (e) {
|
|
25765
25765
|
err = e;
|
|
25766
25766
|
}
|
|
25767
25767
|
return next(err);
|
|
25768
25768
|
}
|
|
25769
|
-
|
|
25769
|
+
fn.call(self2, data2, next);
|
|
25770
25770
|
}, callback);
|
|
25771
25771
|
return self2;
|
|
25772
25772
|
};
|
|
@@ -27288,11 +27288,11 @@ var require_decorator = __commonJS({
|
|
|
27288
27288
|
};
|
|
27289
27289
|
};
|
|
27290
27290
|
var mergeDecorators = (d1, d22) => {
|
|
27291
|
-
var _a, _b, _c, _d,
|
|
27291
|
+
var _a, _b, _c, _d, _e2, _f;
|
|
27292
27292
|
return {
|
|
27293
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
|
-
instance: mergePropertyAndMethodDecorators((
|
|
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();
|
|
@@ -31298,11 +31298,11 @@ var require_from = __commonJS({
|
|
|
31298
31298
|
Promise.resolve(value).then(_next, _throw);
|
|
31299
31299
|
}
|
|
31300
31300
|
}
|
|
31301
|
-
function _asyncToGenerator(
|
|
31301
|
+
function _asyncToGenerator(fn) {
|
|
31302
31302
|
return function() {
|
|
31303
31303
|
var self2 = this, args = arguments;
|
|
31304
31304
|
return new Promise(function(resolve2, reject) {
|
|
31305
|
-
var gen =
|
|
31305
|
+
var gen = fn.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,
|
|
31449
|
-
if (typeof emitter.prependListener === "function") return emitter.prependListener(event,
|
|
31450
|
-
if (!emitter._events || !emitter._events[event]) emitter.on(event,
|
|
31451
|
-
else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(
|
|
31452
|
-
else emitter._events[event] = [
|
|
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]];
|
|
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,
|
|
31901
|
-
var res = Stream.prototype.on.call(this, ev,
|
|
31900
|
+
Readable2.prototype.on = function(ev, fn) {
|
|
31901
|
+
var res = Stream.prototype.on.call(this, ev, fn);
|
|
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,
|
|
31923
|
-
var res = Stream.prototype.removeListener.call(this, ev,
|
|
31922
|
+
Readable2.prototype.removeListener = function(ev, fn) {
|
|
31923
|
+
var res = Stream.prototype.removeListener.call(this, ev, fn);
|
|
31924
31924
|
if (ev === "readable") {
|
|
31925
31925
|
process.nextTick(updateReadableListening, this);
|
|
31926
31926
|
}
|
|
@@ -32996,10 +32996,10 @@ var require_initialParams2 = __commonJS({
|
|
|
32996
32996
|
Object.defineProperty(exports2, "__esModule", {
|
|
32997
32997
|
value: true
|
|
32998
32998
|
});
|
|
32999
|
-
exports2.default = function(
|
|
32999
|
+
exports2.default = function(fn) {
|
|
33000
33000
|
return function(...args) {
|
|
33001
33001
|
var callback = args.pop();
|
|
33002
|
-
return
|
|
33002
|
+
return fn.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(
|
|
33022
|
-
setTimeout(
|
|
33021
|
+
function fallback(fn) {
|
|
33022
|
+
setTimeout(fn, 0);
|
|
33023
33023
|
}
|
|
33024
33024
|
function wrap(defer) {
|
|
33025
|
-
return (
|
|
33025
|
+
return (fn, ...args) => defer(() => fn(...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(
|
|
33113
|
-
return
|
|
33112
|
+
function isAsync(fn) {
|
|
33113
|
+
return fn[Symbol.toStringTag] === "AsyncFunction";
|
|
33114
33114
|
}
|
|
33115
|
-
function isAsyncGenerator(
|
|
33116
|
-
return
|
|
33115
|
+
function isAsyncGenerator(fn) {
|
|
33116
|
+
return fn[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(
|
|
33201
|
+
function once(fn) {
|
|
33202
33202
|
function wrapper(...args) {
|
|
33203
|
-
if (
|
|
33204
|
-
var callFn =
|
|
33205
|
-
|
|
33203
|
+
if (fn === null) return;
|
|
33204
|
+
var callFn = fn;
|
|
33205
|
+
fn = null;
|
|
33206
33206
|
callFn.apply(this, args);
|
|
33207
33207
|
}
|
|
33208
|
-
Object.assign(wrapper,
|
|
33208
|
+
Object.assign(wrapper, fn);
|
|
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(
|
|
33291
|
+
function onlyOnce(fn) {
|
|
33292
33292
|
return function(...args) {
|
|
33293
|
-
if (
|
|
33294
|
-
var callFn =
|
|
33295
|
-
|
|
33293
|
+
if (fn === null) throw new Error("Callback was already called.");
|
|
33294
|
+
var callFn = fn;
|
|
33295
|
+
fn = null;
|
|
33296
33296
|
callFn.apply(this, args);
|
|
33297
33297
|
};
|
|
33298
33298
|
}
|
|
@@ -33691,11 +33691,11 @@ var require_pipeline = __commonJS({
|
|
|
33691
33691
|
callback(err || new ERR_STREAM_DESTROYED("pipe"));
|
|
33692
33692
|
};
|
|
33693
33693
|
}
|
|
33694
|
-
function call(
|
|
33695
|
-
|
|
33694
|
+
function call(fn) {
|
|
33695
|
+
fn();
|
|
33696
33696
|
}
|
|
33697
|
-
function pipe(from,
|
|
33698
|
-
return from.pipe(
|
|
33697
|
+
function pipe(from, to) {
|
|
33698
|
+
return from.pipe(to);
|
|
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(
|
|
33784
|
-
return
|
|
33783
|
+
async.map(function prebind(fn) {
|
|
33784
|
+
return fn(namespace);
|
|
33785
33785
|
})
|
|
33786
33786
|
).then(function resolved(values) {
|
|
33787
33787
|
resolve2(values.some(Boolean));
|
|
33788
33788
|
});
|
|
33789
33789
|
});
|
|
33790
33790
|
}
|
|
33791
|
-
function modify(
|
|
33792
|
-
if (~modifiers.indexOf(
|
|
33793
|
-
modifiers.push(
|
|
33791
|
+
function modify(fn) {
|
|
33792
|
+
if (~modifiers.indexOf(fn)) return false;
|
|
33793
|
+
modifiers.push(fn);
|
|
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(
|
|
33805
|
+
function introduce(fn, options) {
|
|
33806
33806
|
var has = Object.prototype.hasOwnProperty;
|
|
33807
33807
|
for (var key in options) {
|
|
33808
33808
|
if (has.call(options, key)) {
|
|
33809
|
-
|
|
33809
|
+
fn[key] = options[key];
|
|
33810
33810
|
}
|
|
33811
33811
|
}
|
|
33812
|
-
return
|
|
33812
|
+
return fn;
|
|
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(
|
|
34056
|
+
swizzle.wrap = function(fn) {
|
|
34057
34057
|
return function() {
|
|
34058
|
-
return
|
|
34058
|
+
return fn(swizzle(arguments));
|
|
34059
34059
|
};
|
|
34060
34060
|
};
|
|
34061
34061
|
}
|
|
@@ -34667,13 +34667,13 @@ var require_conversions = __commonJS({
|
|
|
34667
34667
|
var h2 = hsv[0] / 60;
|
|
34668
34668
|
var s = hsv[1] / 100;
|
|
34669
34669
|
var v = hsv[2] / 100;
|
|
34670
|
-
var
|
|
34670
|
+
var hi2 = Math.floor(h2) % 6;
|
|
34671
34671
|
var f2 = h2 - Math.floor(h2);
|
|
34672
34672
|
var p2 = 255 * v * (1 - s);
|
|
34673
34673
|
var q2 = 255 * v * (1 - s * f2);
|
|
34674
34674
|
var t = 255 * v * (1 - s * (1 - f2));
|
|
34675
34675
|
v *= 255;
|
|
34676
|
-
switch (
|
|
34676
|
+
switch (hi2) {
|
|
34677
34677
|
case 0:
|
|
34678
34678
|
return [v, t, p2];
|
|
34679
34679
|
case 1:
|
|
@@ -35003,11 +35003,11 @@ var require_conversions = __commonJS({
|
|
|
35003
35003
|
return [g2 * 255, g2 * 255, g2 * 255];
|
|
35004
35004
|
}
|
|
35005
35005
|
var pure = [0, 0, 0];
|
|
35006
|
-
var
|
|
35007
|
-
var v =
|
|
35006
|
+
var hi2 = h2 % 1 * 6;
|
|
35007
|
+
var v = hi2 % 1;
|
|
35008
35008
|
var w2 = 1 - v;
|
|
35009
35009
|
var mg = 0;
|
|
35010
|
-
switch (Math.floor(
|
|
35010
|
+
switch (Math.floor(hi2)) {
|
|
35011
35011
|
case 0:
|
|
35012
35012
|
pure[0] = 1;
|
|
35013
35013
|
pure[1] = v;
|
|
@@ -35155,22 +35155,22 @@ var require_route = __commonJS({
|
|
|
35155
35155
|
}
|
|
35156
35156
|
return graph;
|
|
35157
35157
|
}
|
|
35158
|
-
function link(from,
|
|
35158
|
+
function link(from, to) {
|
|
35159
35159
|
return function(args) {
|
|
35160
|
-
return
|
|
35160
|
+
return to(from(args));
|
|
35161
35161
|
};
|
|
35162
35162
|
}
|
|
35163
35163
|
function wrapConversion(toModel, graph) {
|
|
35164
35164
|
var path = [graph[toModel].parent, toModel];
|
|
35165
|
-
var
|
|
35165
|
+
var fn = 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
|
-
|
|
35169
|
+
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
35170
35170
|
cur = graph[cur].parent;
|
|
35171
35171
|
}
|
|
35172
|
-
|
|
35173
|
-
return
|
|
35172
|
+
fn.conversion = path;
|
|
35173
|
+
return fn;
|
|
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(
|
|
35200
|
+
function wrapRaw(fn) {
|
|
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
|
|
35208
|
+
return fn(args);
|
|
35209
35209
|
};
|
|
35210
|
-
if ("conversion" in
|
|
35211
|
-
wrappedFn.conversion =
|
|
35210
|
+
if ("conversion" in fn) {
|
|
35211
|
+
wrappedFn.conversion = fn.conversion;
|
|
35212
35212
|
}
|
|
35213
35213
|
return wrappedFn;
|
|
35214
35214
|
}
|
|
35215
|
-
function wrapRounded(
|
|
35215
|
+
function wrapRounded(fn) {
|
|
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 =
|
|
35223
|
+
var result = fn(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
|
|
35232
|
-
wrappedFn.conversion =
|
|
35231
|
+
if ("conversion" in fn) {
|
|
35232
|
+
wrappedFn.conversion = fn.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
|
|
35244
|
-
convert[fromModel][toModel] = wrapRounded(
|
|
35245
|
-
convert[fromModel][toModel].raw = wrapRaw(
|
|
35243
|
+
var fn = routes[toModel];
|
|
35244
|
+
convert[fromModel][toModel] = wrapRounded(fn);
|
|
35245
|
+
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
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(
|
|
35755
|
+
module2.exports = function create(fn) {
|
|
35756
35756
|
return function adapter(namespace) {
|
|
35757
35757
|
try {
|
|
35758
|
-
return enabled(namespace,
|
|
35758
|
+
return enabled(namespace, fn());
|
|
35759
35759
|
} catch (e) {
|
|
35760
35760
|
}
|
|
35761
35761
|
return false;
|
|
@@ -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(
|
|
36948
|
-
if ("string" === typeof
|
|
36949
|
-
return
|
|
36950
|
-
} else if ("string" === typeof
|
|
36951
|
-
return
|
|
36952
|
-
}
|
|
36953
|
-
if ("object" === typeof
|
|
36954
|
-
var named =
|
|
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);
|
|
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(
|
|
36970
|
+
module2.exports = function one(fn) {
|
|
36971
36971
|
var called = 0, value;
|
|
36972
36972
|
function onetime() {
|
|
36973
36973
|
if (called) return value;
|
|
36974
36974
|
called = 1;
|
|
36975
|
-
value =
|
|
36976
|
-
|
|
36975
|
+
value = fn.apply(this, arguments);
|
|
36976
|
+
fn = null;
|
|
36977
36977
|
return value;
|
|
36978
36978
|
}
|
|
36979
|
-
onetime.displayName = name(
|
|
36979
|
+
onetime.displayName = name(fn);
|
|
36980
36980
|
return onetime;
|
|
36981
36981
|
};
|
|
36982
36982
|
}
|
|
@@ -40510,9 +40510,9 @@ var Zt = "not-modified";
|
|
|
40510
40510
|
var Xt = "not-found";
|
|
40511
40511
|
var tr = "unauthorized";
|
|
40512
40512
|
var et = "accepted";
|
|
40513
|
-
var
|
|
40513
|
+
var cn = { resourceType: "OperationOutcome", id: Xt, issue: [{ severity: "error", code: "not-found", details: { text: "Not found" } }] };
|
|
40514
40514
|
var Ee = { resourceType: "OperationOutcome", id: tr, issue: [{ severity: "error", code: "login", details: { text: "Unauthorized" } }] };
|
|
40515
|
-
var
|
|
40515
|
+
var un = { ...Ee, issue: [...Ee.issue, { severity: "error", code: "expired", details: { text: "Token expired" } }] };
|
|
40516
40516
|
var rr = { ...Ee, issue: [...Ee.issue, { severity: "error", code: "invalid", details: { text: "Token not issued for this audience" } }] };
|
|
40517
40517
|
function E(r7, e) {
|
|
40518
40518
|
return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "invalid", details: { text: r7 }, ...e ? { expression: [e] } : void 0 }] };
|
|
@@ -40520,7 +40520,7 @@ function E(r7, e) {
|
|
|
40520
40520
|
function h(r7) {
|
|
40521
40521
|
return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "structure", details: { text: r7 } }] };
|
|
40522
40522
|
}
|
|
40523
|
-
function
|
|
40523
|
+
function ln(r7) {
|
|
40524
40524
|
return { resourceType: "OperationOutcome", issue: [{ severity: "error", code: "exception", details: { text: "Internal server error" }, diagnostics: r7.toString() }] };
|
|
40525
40525
|
}
|
|
40526
40526
|
function be(r7) {
|
|
@@ -40531,43 +40531,43 @@ function nr(r7) {
|
|
|
40531
40531
|
}
|
|
40532
40532
|
var d = class extends Error {
|
|
40533
40533
|
constructor(e, t) {
|
|
40534
|
-
super(
|
|
40534
|
+
super(pn(e)), this.outcome = e, this.cause = t;
|
|
40535
40535
|
}
|
|
40536
40536
|
};
|
|
40537
40537
|
function tt(r7) {
|
|
40538
|
-
return r7 instanceof d ? r7.outcome : be(r7) ? r7 : E(
|
|
40538
|
+
return r7 instanceof d ? r7.outcome : be(r7) ? r7 : E(Re(r7));
|
|
40539
40539
|
}
|
|
40540
|
-
function
|
|
40541
|
-
return r7 ? typeof r7 == "string" ? r7 : r7 instanceof Error ? r7.message : be(r7) ?
|
|
40540
|
+
function Re(r7) {
|
|
40541
|
+
return r7 ? typeof r7 == "string" ? r7 : r7 instanceof Error ? r7.message : be(r7) ? pn(r7) : typeof r7 == "object" && "code" in r7 && typeof r7.code == "string" ? r7.code : JSON.stringify(r7) : "Unknown error";
|
|
40542
40542
|
}
|
|
40543
|
-
function
|
|
40544
|
-
let e = r7.issue?.map(
|
|
40543
|
+
function pn(r7) {
|
|
40544
|
+
let e = r7.issue?.map(eo) ?? [];
|
|
40545
40545
|
return e.length > 0 ? e.join("; ") : "Unknown error";
|
|
40546
40546
|
}
|
|
40547
|
-
function
|
|
40547
|
+
function eo(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
|
|
40551
|
+
function ro(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
|
|
40555
|
+
function mn(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,
|
|
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: [] };
|
|
40558
40558
|
return e;
|
|
40559
40559
|
}
|
|
40560
|
-
var fn = { 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 hn = { 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 ar(r7) {
|
|
40562
40562
|
return new or(r7).parse();
|
|
40563
40563
|
}
|
|
40564
|
-
var ue =
|
|
40564
|
+
var ue = mn(hn);
|
|
40565
40565
|
var cr = /* @__PURE__ */ Object.create(null);
|
|
40566
|
-
var
|
|
40567
|
-
var
|
|
40568
|
-
function
|
|
40566
|
+
var yn = /* @__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 Tn(r7) {
|
|
40569
40569
|
let e;
|
|
40570
|
-
return e =
|
|
40570
|
+
return e = yn[r7], e || (e = yn[r7] = /* @__PURE__ */ Object.create(null)), e;
|
|
40571
40571
|
}
|
|
40572
40572
|
function ur(r7) {
|
|
40573
40573
|
let e = Array.isArray(r7) ? r7 : r7.entry?.map((t) => t.resource) ?? [];
|
|
@@ -40576,28 +40576,28 @@ function ur(r7) {
|
|
|
40576
40576
|
function lr(r7) {
|
|
40577
40577
|
if (!r7?.name) throw new Error("Failed loading StructureDefinition from bundle");
|
|
40578
40578
|
if (r7.resourceType !== "StructureDefinition") return;
|
|
40579
|
-
let e = ar(r7), t =
|
|
40580
|
-
t ? (n = ue, 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 = ue, i = r7.type) : (n =
|
|
40579
|
+
let e = ar(r7), t = io[r7.url], n, i;
|
|
40580
|
+
t ? (n = ue, 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 = ue, i = r7.type) : (n = Tn(r7.url), i = r7.type), n[i] = e;
|
|
40581
40581
|
for (let o of e.innerTypes) o.parentType = e, n[o.name] = o;
|
|
40582
40582
|
cr[r7.url] = e;
|
|
40583
40583
|
}
|
|
40584
|
-
function
|
|
40584
|
+
function En(r7) {
|
|
40585
40585
|
return !!ue[r7];
|
|
40586
40586
|
}
|
|
40587
40587
|
function Le(r7, e) {
|
|
40588
40588
|
if (e) {
|
|
40589
|
-
let t =
|
|
40589
|
+
let t = Tn(e)[r7];
|
|
40590
40590
|
if (t) return t;
|
|
40591
40591
|
}
|
|
40592
40592
|
return ue[r7];
|
|
40593
40593
|
}
|
|
40594
|
-
function
|
|
40594
|
+
function Rn(r7) {
|
|
40595
40595
|
return !!cr[r7];
|
|
40596
40596
|
}
|
|
40597
40597
|
var or = class {
|
|
40598
40598
|
constructor(e) {
|
|
40599
40599
|
if (!e.snapshot?.element || e.snapshot.element.length === 0) throw new Error(`No snapshot defined for StructureDefinition '${e.name}'`);
|
|
40600
|
-
this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, path: this.root.path, title: e.title, type: e.type, url: e.url, kind: e.kind, description:
|
|
40600
|
+
this.root = e.snapshot.element[0], this.elements = e.snapshot.element.slice(1), this.elementIndex = /* @__PURE__ */ Object.create(null), this.index = 0, this.resourceSchema = { name: e.name, path: this.root.path, title: e.title, type: e.type, url: e.url, kind: e.kind, description: co(e), elements: {}, constraints: this.parseElementDefinition(this.root).constraints, innerTypes: [], summaryProperties: /* @__PURE__ */ new Set(), mandatoryProperties: /* @__PURE__ */ new Set() }, this.innerTypes = [];
|
|
40601
40601
|
}
|
|
40602
40602
|
parse() {
|
|
40603
40603
|
let e = this.next();
|
|
@@ -40630,23 +40630,23 @@ var or = class {
|
|
|
40630
40630
|
return this.checkFieldExit(), this.innerTypes.length > 0 && (this.resourceSchema.innerTypes = this.innerTypes), this.resourceSchema;
|
|
40631
40631
|
}
|
|
40632
40632
|
checkFieldEnter(e, t) {
|
|
40633
|
-
this.isInnerType(e) && this.enterInnerType(e), this.slicingContext && !
|
|
40633
|
+
this.isInnerType(e) && this.enterInnerType(e), this.slicingContext && !Ce(this.slicingContext.path, e?.path) && (this.slicingContext = void 0), e.slicing && !this.slicingContext && this.enterSlice(e, t);
|
|
40634
40634
|
}
|
|
40635
40635
|
enterInnerType(e) {
|
|
40636
|
-
for (; this.backboneContext && !
|
|
40636
|
+
for (; this.backboneContext && !Ce(this.backboneContext?.path, e.path); ) this.innerTypes.push(this.backboneContext.type), this.backboneContext = this.backboneContext.parent;
|
|
40637
40637
|
let t = sr(e);
|
|
40638
|
-
this.backboneContext = { type: { name: t, type: t, path: e.path, title: e.label, description: e.definition, elements: {}, constraints: this.parseElementDefinition(e).constraints, innerTypes: [] }, path: e.path, parent:
|
|
40638
|
+
this.backboneContext = { type: { name: t, type: t, path: e.path, title: e.label, description: e.definition, elements: {}, constraints: this.parseElementDefinition(e).constraints, innerTypes: [] }, path: e.path, parent: Ce(this.backboneContext?.path, e.path) ? this.backboneContext : this.backboneContext?.parent };
|
|
40639
40639
|
}
|
|
40640
40640
|
enterSlice(e, t) {
|
|
40641
|
-
|
|
40641
|
+
ao(e) && !this.peek()?.sliceName || (t.slicing = { discriminator: (e.slicing?.discriminator ?? []).map((n) => {
|
|
40642
40642
|
if (n.type !== "value" && n.type !== "pattern" && n.type !== "type") throw new Error(`Unsupported slicing discriminator type: ${n.type}`);
|
|
40643
40643
|
return { path: n.path, type: n.type };
|
|
40644
40644
|
}), slices: [], ordered: e.slicing?.ordered ?? false, rule: e.slicing?.rules }, this.slicingContext = { field: t.slicing, path: e.path ?? "" });
|
|
40645
40645
|
}
|
|
40646
40646
|
checkFieldExit(e = void 0) {
|
|
40647
|
-
if (this.backboneContext && !
|
|
40647
|
+
if (this.backboneContext && !Ce(this.backboneContext.path, e?.path)) if (this.backboneContext.parent) do
|
|
40648
40648
|
this.innerTypes.push(this.backboneContext.type), this.backboneContext = this.backboneContext.parent;
|
|
40649
|
-
while (this.backboneContext && !
|
|
40649
|
+
while (this.backboneContext && !Ce(this.backboneContext.path, e?.path));
|
|
40650
40650
|
else this.innerTypes.push(this.backboneContext.type), this.backboneContext = void 0;
|
|
40651
40651
|
}
|
|
40652
40652
|
next() {
|
|
@@ -40665,7 +40665,7 @@ var or = class {
|
|
|
40665
40665
|
}
|
|
40666
40666
|
isInnerType(e) {
|
|
40667
40667
|
let t = this.peek();
|
|
40668
|
-
return !!(
|
|
40668
|
+
return !!(Ce(e?.path, t?.path) && e.type?.some((n) => ["BackboneElement", "Element"].includes(n.code)));
|
|
40669
40669
|
}
|
|
40670
40670
|
parseSliceStart(e) {
|
|
40671
40671
|
if (!this.slicingContext) throw new Error(`Invalid slice start before discriminator: ${e.sliceName} (${e.id})`);
|
|
@@ -40678,30 +40678,30 @@ var or = class {
|
|
|
40678
40678
|
});
|
|
40679
40679
|
}
|
|
40680
40680
|
parseElementDefinition(e) {
|
|
40681
|
-
let t =
|
|
40682
|
-
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:
|
|
40681
|
+
let t = xn(e.max), n = e.base?.max ? xn(e.base.max) : t, i = { type: "ElementDefinition", value: e };
|
|
40682
|
+
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: vn(P(i, "fixed[x]")), pattern: vn(P(i, "pattern[x]")), binding: e.binding };
|
|
40683
40683
|
}
|
|
40684
40684
|
};
|
|
40685
|
-
function
|
|
40685
|
+
function xn(r7) {
|
|
40686
40686
|
return r7 === "*" ? Number.POSITIVE_INFINITY : Number.parseInt(r7, 10);
|
|
40687
40687
|
}
|
|
40688
40688
|
function ir(r7, e = "") {
|
|
40689
|
-
return
|
|
40689
|
+
return so(r7.path, e);
|
|
40690
40690
|
}
|
|
40691
|
-
function
|
|
40691
|
+
function so(r7, e) {
|
|
40692
40692
|
return r7 ? e && r7.startsWith(e) ? r7.substring(e.length + 1) : r7 : "";
|
|
40693
40693
|
}
|
|
40694
|
-
function
|
|
40694
|
+
function Ce(r7, e) {
|
|
40695
40695
|
return !r7 || !e ? false : e.startsWith(r7 + ".") || e === r7;
|
|
40696
40696
|
}
|
|
40697
|
-
function
|
|
40697
|
+
function vn(r7) {
|
|
40698
40698
|
return Array.isArray(r7) && r7.length > 0 ? r7[0] : S(r7) ? void 0 : r7;
|
|
40699
40699
|
}
|
|
40700
|
-
function
|
|
40700
|
+
function ao(r7) {
|
|
40701
40701
|
let e = r7.slicing?.discriminator;
|
|
40702
40702
|
return !!(r7.type?.some((t) => t.code === "Extension") && e?.length === 1 && e[0].type === "value" && e[0].path === "url");
|
|
40703
40703
|
}
|
|
40704
|
-
function
|
|
40704
|
+
function co(r7) {
|
|
40705
40705
|
let e = r7.description;
|
|
40706
40706
|
return e?.startsWith(`Base StructureDefinition for ${r7.name} Type: `) && (e = e.substring(`Base StructureDefinition for ${r7.name} Type: `.length)), e;
|
|
40707
40707
|
}
|
|
@@ -40724,9 +40724,9 @@ function W(r7, e) {
|
|
|
40724
40724
|
function P(r7, e, t) {
|
|
40725
40725
|
if (!r7.value) return;
|
|
40726
40726
|
let n = ct(r7.type, e, t?.profileUrl);
|
|
40727
|
-
return n ?
|
|
40727
|
+
return n ? To(r7, e, n) : So(r7, e);
|
|
40728
40728
|
}
|
|
40729
|
-
function
|
|
40729
|
+
function To(r7, e, t) {
|
|
40730
40730
|
let n = r7.value, i = t.type;
|
|
40731
40731
|
if (!i || i.length === 0) return;
|
|
40732
40732
|
let o, s = "undefined", a2, c = t.path.lastIndexOf("."), u2 = t.path.substring(c + 1);
|
|
@@ -40739,14 +40739,14 @@ function vo(r7, e, t) {
|
|
|
40739
40739
|
}
|
|
40740
40740
|
if (a2) if (Array.isArray(o)) {
|
|
40741
40741
|
o = o.slice();
|
|
40742
|
-
for (let p2 = 0; p2 < Math.max(o.length, a2.length); p2++) o[p2] =
|
|
40743
|
-
} else o =
|
|
40744
|
-
if (!S(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((p2) =>
|
|
40742
|
+
for (let p2 = 0; p2 < Math.max(o.length, a2.length); p2++) o[p2] = kn(o[p2], a2[p2]);
|
|
40743
|
+
} else o = kn(o, a2);
|
|
40744
|
+
if (!S(o)) return (s === "Element" || s === "BackboneElement") && (s = t.type[0].code), Array.isArray(o) ? o.map((p2) => wn(p2, s)) : wn(o, s);
|
|
40745
40745
|
}
|
|
40746
|
-
function
|
|
40746
|
+
function wn(r7, e) {
|
|
40747
40747
|
return e === "Resource" && I(r7) && (e = r7.resourceType), { type: e, value: r7 };
|
|
40748
40748
|
}
|
|
40749
|
-
function
|
|
40749
|
+
function So(r7, e) {
|
|
40750
40750
|
let t = r7.value;
|
|
40751
40751
|
if (!t || typeof t != "object") return;
|
|
40752
40752
|
let n;
|
|
@@ -40781,27 +40781,27 @@ function st(r7) {
|
|
|
40781
40781
|
}
|
|
40782
40782
|
return e;
|
|
40783
40783
|
}
|
|
40784
|
-
function
|
|
40784
|
+
function Vn(r7) {
|
|
40785
40785
|
return f(!N(r7));
|
|
40786
40786
|
}
|
|
40787
|
-
function
|
|
40787
|
+
function Dn(r7, e) {
|
|
40788
40788
|
return r7.length === 0 || e.length === 0 ? [] : r7.length !== e.length ? f(false) : f(r7.every((t, n) => N(gr(t, e[n]))));
|
|
40789
40789
|
}
|
|
40790
|
-
function
|
|
40790
|
+
function Mn(r7, e) {
|
|
40791
40791
|
return r7.length === 0 || e.length === 0 ? [] : r7.length !== e.length ? f(true) : f(r7.some((t, n) => !N(gr(t, e[n]))));
|
|
40792
40792
|
}
|
|
40793
40793
|
function gr(r7, e) {
|
|
40794
40794
|
let t = r7.value?.valueOf(), n = e.value?.valueOf();
|
|
40795
|
-
return typeof t == "number" && typeof n == "number" ? f(Math.abs(t - n) < 1e-8) : k(t) && k(n) ? f(
|
|
40795
|
+
return typeof t == "number" && typeof n == "number" ? f(Math.abs(t - n) < 1e-8) : k(t) && k(n) ? f(Ln(t, n)) : f(typeof t == "object" && typeof n == "object" ? vr(r7, e) : t === n);
|
|
40796
40796
|
}
|
|
40797
40797
|
function xr(r7, e) {
|
|
40798
|
-
return r7.length === 0 && e.length === 0 ? f(true) : r7.length !== e.length ? f(false) : (r7.sort(
|
|
40798
|
+
return r7.length === 0 && e.length === 0 ? f(true) : r7.length !== e.length ? f(false) : (r7.sort(An), e.sort(An), f(r7.every((t, n) => N(Eo(t, e[n])))));
|
|
40799
40799
|
}
|
|
40800
|
-
function
|
|
40800
|
+
function Eo(r7, e) {
|
|
40801
40801
|
let { type: t, value: n } = r7, { type: i, value: o } = e, s = n?.valueOf(), a2 = o?.valueOf();
|
|
40802
|
-
return typeof s == "number" && typeof a2 == "number" ? f(Math.abs(s - a2) < 0.01) : k(s) && k(a2) ? f(
|
|
40802
|
+
return typeof s == "number" && typeof a2 == "number" ? f(Math.abs(s - a2) < 0.01) : k(s) && k(a2) ? f(Ln(s, a2)) : f(t === "Coding" && i === "Coding" ? typeof s != "object" || typeof a2 != "object" ? false : s.code === a2.code && s.system === a2.system : typeof s == "object" && typeof a2 == "object" ? vr({ ...s, id: void 0 }, { ...a2, id: void 0 }) : typeof s == "string" && typeof a2 == "string" ? s.toLowerCase() === a2.toLowerCase() : s === a2);
|
|
40803
40803
|
}
|
|
40804
|
-
function
|
|
40804
|
+
function An(r7, e) {
|
|
40805
40805
|
let t = r7.value?.valueOf(), n = e.value?.valueOf();
|
|
40806
40806
|
return typeof t == "number" && typeof n == "number" ? t - n : typeof t == "string" && typeof n == "string" ? t.localeCompare(n) : 0;
|
|
40807
40807
|
}
|
|
@@ -40815,32 +40815,32 @@ function at(r7, e) {
|
|
|
40815
40815
|
case "Integer":
|
|
40816
40816
|
return typeof t == "number";
|
|
40817
40817
|
case "Date":
|
|
40818
|
-
return
|
|
40818
|
+
return _n(t);
|
|
40819
40819
|
case "DateTime":
|
|
40820
|
-
return
|
|
40820
|
+
return we(t);
|
|
40821
40821
|
case "Time":
|
|
40822
40822
|
return typeof t == "string" && !!/^T\d/.exec(t);
|
|
40823
40823
|
case "Period":
|
|
40824
|
-
return
|
|
40824
|
+
return Nn(t);
|
|
40825
40825
|
case "Quantity":
|
|
40826
40826
|
return k(t);
|
|
40827
40827
|
default:
|
|
40828
40828
|
return typeof t == "object" && t?.resourceType === e;
|
|
40829
40829
|
}
|
|
40830
40830
|
}
|
|
40831
|
-
function
|
|
40831
|
+
function _n(r7) {
|
|
40832
40832
|
return typeof r7 == "string" && !!ot.date.exec(r7);
|
|
40833
40833
|
}
|
|
40834
|
-
function
|
|
40834
|
+
function we(r7) {
|
|
40835
40835
|
return typeof r7 == "string" && !!ot.dateTime.exec(r7);
|
|
40836
40836
|
}
|
|
40837
|
-
function
|
|
40838
|
-
return !!(r7 && typeof r7 == "object" && ("start" in r7 &&
|
|
40837
|
+
function Nn(r7) {
|
|
40838
|
+
return !!(r7 && typeof r7 == "object" && ("start" in r7 && we(r7.start) || "end" in r7 && we(r7.end)));
|
|
40839
40839
|
}
|
|
40840
40840
|
function k(r7) {
|
|
40841
40841
|
return !!(r7 && typeof r7 == "object" && "value" in r7 && typeof r7.value == "number");
|
|
40842
40842
|
}
|
|
40843
|
-
function
|
|
40843
|
+
function Ln(r7, e) {
|
|
40844
40844
|
return Math.abs(r7.value - e.value) < 0.01 && (r7.unit === e.unit || r7.code === e.code || r7.unit === e.code || r7.code === e.unit);
|
|
40845
40845
|
}
|
|
40846
40846
|
function vr(r7, e) {
|
|
@@ -40848,27 +40848,27 @@ function vr(r7, e) {
|
|
|
40848
40848
|
if (t.length !== n.length) return false;
|
|
40849
40849
|
for (let i of t) {
|
|
40850
40850
|
let o = r7[i], s = e[i];
|
|
40851
|
-
if (
|
|
40851
|
+
if (In(o) && In(s)) {
|
|
40852
40852
|
if (!vr(o, s)) return false;
|
|
40853
40853
|
} else if (o !== s) return false;
|
|
40854
40854
|
}
|
|
40855
40855
|
return true;
|
|
40856
40856
|
}
|
|
40857
|
-
function
|
|
40857
|
+
function In(r7) {
|
|
40858
40858
|
return r7 !== null && typeof r7 == "object";
|
|
40859
40859
|
}
|
|
40860
|
-
function
|
|
40860
|
+
function kn(r7, e) {
|
|
40861
40861
|
if (e) {
|
|
40862
40862
|
if (typeof e != "object") throw new Error("Primitive extension must be an object");
|
|
40863
|
-
return
|
|
40863
|
+
return bo(r7 ?? {}, e);
|
|
40864
40864
|
}
|
|
40865
40865
|
return r7;
|
|
40866
40866
|
}
|
|
40867
|
-
function
|
|
40867
|
+
function bo(r7, e) {
|
|
40868
40868
|
return delete e.__proto__, delete e.constructor, Object.assign(r7, e);
|
|
40869
40869
|
}
|
|
40870
40870
|
function te(r7) {
|
|
40871
|
-
let e = pe(r7), t =
|
|
40871
|
+
let e = pe(r7), t = Co(r7);
|
|
40872
40872
|
return t === e ? { reference: e } : { reference: e, display: t };
|
|
40873
40873
|
}
|
|
40874
40874
|
function pe(r7) {
|
|
@@ -40877,16 +40877,16 @@ function pe(r7) {
|
|
|
40877
40877
|
function de(r7) {
|
|
40878
40878
|
if (r7) return le(r7) ? r7.reference.split("/")[1] : r7.id;
|
|
40879
40879
|
}
|
|
40880
|
-
function
|
|
40880
|
+
function Ro(r7) {
|
|
40881
40881
|
return r7.resourceType === "Patient" || r7.resourceType === "Practitioner" || r7.resourceType === "RelatedPerson";
|
|
40882
40882
|
}
|
|
40883
|
-
function
|
|
40884
|
-
if (
|
|
40885
|
-
let e =
|
|
40883
|
+
function Co(r7) {
|
|
40884
|
+
if (Ro(r7)) {
|
|
40885
|
+
let e = Po(r7);
|
|
40886
40886
|
if (e) return e;
|
|
40887
40887
|
}
|
|
40888
40888
|
if (r7.resourceType === "Device") {
|
|
40889
|
-
let e =
|
|
40889
|
+
let e = wo(r7);
|
|
40890
40890
|
if (e) return e;
|
|
40891
40891
|
}
|
|
40892
40892
|
if (r7.resourceType === "MedicationRequest" && r7.medicationCodeableConcept) return Be(r7.medicationCodeableConcept);
|
|
@@ -40896,15 +40896,15 @@ function Ro(r7) {
|
|
|
40896
40896
|
if ("code" in r7 && r7.code) {
|
|
40897
40897
|
let e = r7.code;
|
|
40898
40898
|
if (Array.isArray(e) && (e = e[0]), Sr(e)) return Be(e);
|
|
40899
|
-
if (
|
|
40899
|
+
if (No(e)) return e.text;
|
|
40900
40900
|
}
|
|
40901
40901
|
return pe(r7);
|
|
40902
40902
|
}
|
|
40903
|
-
function
|
|
40903
|
+
function Po(r7) {
|
|
40904
40904
|
let e = r7.name;
|
|
40905
40905
|
if (e && e.length > 0) return qe(e[0]);
|
|
40906
40906
|
}
|
|
40907
|
-
function
|
|
40907
|
+
function wo(r7) {
|
|
40908
40908
|
let e = r7.deviceName;
|
|
40909
40909
|
if (e && e.length > 0) return e[0].name;
|
|
40910
40910
|
}
|
|
@@ -40926,12 +40926,12 @@ function X(r7, ...e) {
|
|
|
40926
40926
|
return t;
|
|
40927
40927
|
}
|
|
40928
40928
|
function lt(r7, e) {
|
|
40929
|
-
return JSON.stringify(r7,
|
|
40929
|
+
return JSON.stringify(r7, Oo, e ? 2 : void 0) ?? "";
|
|
40930
40930
|
}
|
|
40931
|
-
function
|
|
40932
|
-
return !
|
|
40931
|
+
function Oo(r7, e) {
|
|
40932
|
+
return !Io(r7) && S(e) ? void 0 : e;
|
|
40933
40933
|
}
|
|
40934
|
-
function
|
|
40934
|
+
function Io(r7) {
|
|
40935
40935
|
return !!/\d+$/.exec(r7);
|
|
40936
40936
|
}
|
|
40937
40937
|
function S(r7) {
|
|
@@ -40945,14 +40945,14 @@ function K(r7) {
|
|
|
40945
40945
|
return e === "string" && r7 !== "" || e === "object" && ("length" in r7 && r7.length > 0 || Object.keys(r7).length > 0);
|
|
40946
40946
|
}
|
|
40947
40947
|
function ee(r7, e, t) {
|
|
40948
|
-
return r7 === e || S(r7) && S(e) ? true : S(r7) || S(e) ? false : Array.isArray(r7) && Array.isArray(e) ?
|
|
40948
|
+
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);
|
|
40949
40949
|
}
|
|
40950
|
-
function
|
|
40950
|
+
function ko(r7, e) {
|
|
40951
40951
|
if (r7.length !== e.length) return false;
|
|
40952
40952
|
for (let t = 0; t < r7.length; t++) if (!ee(r7[t], e[t])) return false;
|
|
40953
40953
|
return true;
|
|
40954
40954
|
}
|
|
40955
|
-
function
|
|
40955
|
+
function Vo(r7, e, t) {
|
|
40956
40956
|
let n = /* @__PURE__ */ new Set();
|
|
40957
40957
|
Object.keys(r7).forEach((i) => n.add(i)), Object.keys(e).forEach((i) => n.add(i)), t === "meta" && (n.delete("versionId"), n.delete("lastUpdated"), n.delete("author"));
|
|
40958
40958
|
for (let i of n) {
|
|
@@ -40964,10 +40964,10 @@ function ko(r7, e, t) {
|
|
|
40964
40964
|
function R(r7) {
|
|
40965
40965
|
return r7 !== null && typeof r7 == "object";
|
|
40966
40966
|
}
|
|
40967
|
-
function
|
|
40968
|
-
return r7.every(
|
|
40967
|
+
function qn(r7) {
|
|
40968
|
+
return r7.every(_o);
|
|
40969
40969
|
}
|
|
40970
|
-
function
|
|
40970
|
+
function _o(r7) {
|
|
40971
40971
|
return typeof r7 == "string";
|
|
40972
40972
|
}
|
|
40973
40973
|
function Tr(r7) {
|
|
@@ -40976,22 +40976,22 @@ function Tr(r7) {
|
|
|
40976
40976
|
function Sr(r7) {
|
|
40977
40977
|
return R(r7) && "coding" in r7 && Array.isArray(r7.coding) && r7.coding.every(Tr);
|
|
40978
40978
|
}
|
|
40979
|
-
function
|
|
40979
|
+
function No(r7) {
|
|
40980
40980
|
return R(r7) && "text" in r7 && typeof r7.text == "string";
|
|
40981
40981
|
}
|
|
40982
|
-
var
|
|
40983
|
-
for (let r7 = 0; r7 < 256; r7++)
|
|
40984
|
-
function
|
|
40985
|
-
let e =
|
|
40986
|
-
for (let i = 0; i < t.length; i++) n[i] =
|
|
40982
|
+
var Wn = [];
|
|
40983
|
+
for (let r7 = 0; r7 < 256; r7++) Wn.push(r7.toString(16).padStart(2, "0"));
|
|
40984
|
+
function jn(r7) {
|
|
40985
|
+
let e = Gn(r7), t = new Uint8Array(e), n = new Array(t.length);
|
|
40986
|
+
for (let i = 0; i < t.length; i++) n[i] = Wn[t[i]];
|
|
40987
40987
|
return n.join("");
|
|
40988
40988
|
}
|
|
40989
|
-
function
|
|
40990
|
-
let e =
|
|
40989
|
+
function $n(r7) {
|
|
40990
|
+
let e = Gn(r7), t = new Uint8Array(e), n = new Array(t.length);
|
|
40991
40991
|
for (let i = 0; i < t.length; i++) n[i] = String.fromCharCode(t[i]);
|
|
40992
40992
|
return window.btoa(n.join(""));
|
|
40993
40993
|
}
|
|
40994
|
-
function
|
|
40994
|
+
function Gn(r7) {
|
|
40995
40995
|
return ArrayBuffer.isView(r7) ? r7.buffer : r7;
|
|
40996
40996
|
}
|
|
40997
40997
|
function O(r7) {
|
|
@@ -41006,21 +41006,21 @@ function pt(r7) {
|
|
|
41006
41006
|
function Pr(r7) {
|
|
41007
41007
|
return r7.endsWith("/") ? r7 : r7 + "/";
|
|
41008
41008
|
}
|
|
41009
|
-
function
|
|
41009
|
+
function Wo(r7) {
|
|
41010
41010
|
return r7.startsWith("/") ? r7.slice(1) : r7;
|
|
41011
41011
|
}
|
|
41012
41012
|
function B(r7, e) {
|
|
41013
|
-
return new URL(
|
|
41013
|
+
return new URL(Wo(e), Pr(r7.toString())).toString();
|
|
41014
41014
|
}
|
|
41015
|
-
function
|
|
41015
|
+
function zn(r7, e) {
|
|
41016
41016
|
return B(r7, e).toString().replace("http://", "ws://").replace("https://", "wss://");
|
|
41017
41017
|
}
|
|
41018
|
-
function
|
|
41018
|
+
function Jn(r7) {
|
|
41019
41019
|
return typeof r7 == "object" && !Array.isArray(r7) && !(r7 instanceof URLSearchParams) && (r7 = Object.fromEntries(Object.entries(r7).filter((e) => e[1] !== void 0))), new URLSearchParams(r7).toString();
|
|
41020
41020
|
}
|
|
41021
|
-
var
|
|
41022
|
-
function
|
|
41023
|
-
return
|
|
41021
|
+
var jo = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-_]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-_]*[A-Za-z0-9])$/;
|
|
41022
|
+
function ul(r7) {
|
|
41023
|
+
return jo.test(r7);
|
|
41024
41024
|
}
|
|
41025
41025
|
function qe(r7, e) {
|
|
41026
41026
|
let t = [];
|
|
@@ -41033,9 +41033,9 @@ function qe(r7, e) {
|
|
|
41033
41033
|
function Be(r7) {
|
|
41034
41034
|
if (!r7) return "";
|
|
41035
41035
|
let e = me(r7.text);
|
|
41036
|
-
return e || (r7.coding ? r7.coding.map((t) =>
|
|
41036
|
+
return e || (r7.coding ? r7.coding.map((t) => Zn(t)).join(", ") : "");
|
|
41037
41037
|
}
|
|
41038
|
-
function
|
|
41038
|
+
function Zn(r7, e) {
|
|
41039
41039
|
let t = me(r7?.display);
|
|
41040
41040
|
if (t) {
|
|
41041
41041
|
let n = e ? me(r7?.code) : void 0;
|
|
@@ -41047,28 +41047,28 @@ function me(r7) {
|
|
|
41047
41047
|
return typeof r7 == "string" ? r7 : void 0;
|
|
41048
41048
|
}
|
|
41049
41049
|
var l = { Address: "Address", Age: "Age", Annotation: "Annotation", Attachment: "Attachment", BackboneElement: "BackboneElement", CodeableConcept: "CodeableConcept", Coding: "Coding", ContactDetail: "ContactDetail", ContactPoint: "ContactPoint", Contributor: "Contributor", Count: "Count", DataRequirement: "DataRequirement", Distance: "Distance", Dosage: "Dosage", Duration: "Duration", Expression: "Expression", Extension: "Extension", HumanName: "HumanName", Identifier: "Identifier", MarketingStatus: "MarketingStatus", Meta: "Meta", Money: "Money", Narrative: "Narrative", ParameterDefinition: "ParameterDefinition", Period: "Period", Population: "Population", ProdCharacteristic: "ProdCharacteristic", ProductShelfLife: "ProductShelfLife", Quantity: "Quantity", Range: "Range", Ratio: "Ratio", Reference: "Reference", RelatedArtifact: "RelatedArtifact", SampledData: "SampledData", Signature: "Signature", SubstanceAmount: "SubstanceAmount", SystemString: "http://hl7.org/fhirpath/System.String", Timing: "Timing", TriggerDefinition: "TriggerDefinition", UsageContext: "UsageContext", base64Binary: "base64Binary", boolean: "boolean", canonical: "canonical", code: "code", date: "date", dateTime: "dateTime", decimal: "decimal", id: "id", instant: "instant", integer: "integer", markdown: "markdown", oid: "oid", positiveInt: "positiveInt", string: "string", time: "time", unsignedInt: "unsignedInt", uri: "uri", url: "url", uuid: "uuid" };
|
|
41050
|
-
function
|
|
41050
|
+
function ti(r7) {
|
|
41051
41051
|
let e = L.types[r7];
|
|
41052
41052
|
return e || (e = { searchParamsDetails: {} }, L.types[r7] = e), e.searchParams || (e.searchParams = { _id: { base: [r7], code: "_id", type: "token", expression: r7 + ".id" }, _lastUpdated: { base: [r7], code: "_lastUpdated", type: "date", expression: r7 + ".meta.lastUpdated" }, _compartment: { base: [r7], code: "_compartment", type: "reference", expression: r7 + ".meta.compartment" }, _profile: { base: [r7], code: "_profile", type: "uri", expression: r7 + ".meta.profile" }, _security: { base: [r7], code: "_security", type: "token", expression: r7 + ".meta.security" }, _source: { base: [r7], code: "_source", type: "uri", expression: r7 + ".meta.source" }, _tag: { base: [r7], code: "_tag", type: "token", expression: r7 + ".meta.tag" } }), e;
|
|
41053
41053
|
}
|
|
41054
41054
|
function Or(r7) {
|
|
41055
41055
|
for (let e of r7.base ?? []) {
|
|
41056
|
-
let t =
|
|
41056
|
+
let t = ti(e);
|
|
41057
41057
|
t.searchParams || (t.searchParams = {}), t.searchParams[r7.code] = r7;
|
|
41058
41058
|
}
|
|
41059
41059
|
}
|
|
41060
41060
|
function sr(r7) {
|
|
41061
41061
|
let e = r7.type?.[0]?.code;
|
|
41062
|
-
return e === "BackboneElement" || e === "Element" ?
|
|
41062
|
+
return e === "BackboneElement" || e === "Element" ? es((r7.base?.path ?? r7.path)?.split(".")) : e;
|
|
41063
41063
|
}
|
|
41064
|
-
function
|
|
41064
|
+
function es(r7) {
|
|
41065
41065
|
return r7.length === 1 ? r7[0] : r7.map(O).join("");
|
|
41066
41066
|
}
|
|
41067
41067
|
function ct(r7, e, t) {
|
|
41068
41068
|
let n = Le(r7, t);
|
|
41069
|
-
if (n) return
|
|
41069
|
+
if (n) return is(n.elements, e);
|
|
41070
41070
|
}
|
|
41071
|
-
function
|
|
41071
|
+
function is(r7, e) {
|
|
41072
41072
|
let t = r7[e] ?? r7[e + "[x]"];
|
|
41073
41073
|
if (t) return t;
|
|
41074
41074
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -41086,7 +41086,7 @@ function le(r7) {
|
|
|
41086
41086
|
return !!(r7 && typeof r7 == "object" && "reference" in r7 && typeof r7.reference == "string");
|
|
41087
41087
|
}
|
|
41088
41088
|
var L = { types: {} };
|
|
41089
|
-
function
|
|
41089
|
+
function Ie(r7) {
|
|
41090
41090
|
if (r7.startsWith("T")) return r7 + "T00:00:00.000Z".substring(r7.length);
|
|
41091
41091
|
if (r7.length <= 10) return r7;
|
|
41092
41092
|
try {
|
|
@@ -41170,11 +41170,11 @@ var A = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
|
|
|
41170
41170
|
}, convertsToInteger: (r7, e) => e.length === 0 ? [] : f(A.toInteger(r7, e).length === 1), toDate: (r7, e) => {
|
|
41171
41171
|
if (e.length === 0) return [];
|
|
41172
41172
|
let [{ value: t }] = G(e, 1);
|
|
41173
|
-
return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.date, value:
|
|
41173
|
+
return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.date, value: Ie(t) }] : [];
|
|
41174
41174
|
}, convertsToDate: (r7, e) => e.length === 0 ? [] : f(A.toDate(r7, e).length === 1), toDateTime: (r7, e) => {
|
|
41175
41175
|
if (e.length === 0) return [];
|
|
41176
41176
|
let [{ value: t }] = G(e, 1);
|
|
41177
|
-
return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.dateTime, value:
|
|
41177
|
+
return typeof t == "string" && /^\d{4}(-\d{2}(-\d{2})?)?/.exec(t) ? [{ type: l.dateTime, value: Ie(t) }] : [];
|
|
41178
41178
|
}, convertsToDateTime: (r7, e) => e.length === 0 ? [] : f(A.toDateTime(r7, e).length === 1), toDecimal: (r7, e) => {
|
|
41179
41179
|
if (e.length === 0) return [];
|
|
41180
41180
|
let [{ value: t }] = G(e, 1);
|
|
@@ -41192,7 +41192,7 @@ var A = { empty: (r7, e) => f(e.length === 0 || e.every((t) => S(t.value))), has
|
|
|
41192
41192
|
let [{ value: t }] = G(e, 1);
|
|
41193
41193
|
if (typeof t == "string") {
|
|
41194
41194
|
let n = /^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(t);
|
|
41195
|
-
if (n) return [{ type: l.time, value:
|
|
41195
|
+
if (n) return [{ type: l.time, value: Ie("T" + n[1]) }];
|
|
41196
41196
|
}
|
|
41197
41197
|
return [];
|
|
41198
41198
|
}, convertsToTime: (r7, e) => e.length === 0 ? [] : f(A.toTime(r7, e).length === 1), indexOf: (r7, e, t) => F((n, i) => n.indexOf(i), r7, e, t), substring: (r7, e, t, n) => F((i, o, s) => {
|
|
@@ -41394,7 +41394,7 @@ var ne = class extends Y {
|
|
|
41394
41394
|
return `${this.left.toString()}.${this.right.toString()}`;
|
|
41395
41395
|
}
|
|
41396
41396
|
};
|
|
41397
|
-
var
|
|
41397
|
+
var ke = class extends Y {
|
|
41398
41398
|
constructor(e, t) {
|
|
41399
41399
|
super("|", e, t);
|
|
41400
41400
|
}
|
|
@@ -41409,7 +41409,7 @@ var xt = class extends C {
|
|
|
41409
41409
|
}
|
|
41410
41410
|
eval(e, t) {
|
|
41411
41411
|
let n = this.left.eval(e, t), i = this.right.eval(e, t);
|
|
41412
|
-
return
|
|
41412
|
+
return Dn(n, i);
|
|
41413
41413
|
}
|
|
41414
41414
|
};
|
|
41415
41415
|
var vt = class extends C {
|
|
@@ -41418,7 +41418,7 @@ var vt = class extends C {
|
|
|
41418
41418
|
}
|
|
41419
41419
|
eval(e, t) {
|
|
41420
41420
|
let n = this.left.eval(e, t), i = this.right.eval(e, t);
|
|
41421
|
-
return
|
|
41421
|
+
return Mn(n, i);
|
|
41422
41422
|
}
|
|
41423
41423
|
};
|
|
41424
41424
|
var Tt = class extends C {
|
|
@@ -41436,7 +41436,7 @@ var St = class extends C {
|
|
|
41436
41436
|
}
|
|
41437
41437
|
eval(e, t) {
|
|
41438
41438
|
let n = this.left.eval(e, t), i = this.right.eval(e, t);
|
|
41439
|
-
return
|
|
41439
|
+
return Vn(xr(n, i));
|
|
41440
41440
|
}
|
|
41441
41441
|
};
|
|
41442
41442
|
var ge = class extends C {
|
|
@@ -41519,34 +41519,34 @@ var xe = class {
|
|
|
41519
41519
|
};
|
|
41520
41520
|
var je = ["!=", "!~", "<=", ">=", "{}", "->"];
|
|
41521
41521
|
var y = { FunctionCall: 0, Dot: 1, Indexer: 2, UnaryAdd: 3, UnarySubtract: 3, Multiply: 4, Divide: 4, IntegerDivide: 4, Modulo: 4, Add: 5, Subtract: 5, Ampersand: 5, Is: 6, As: 6, Union: 7, GreaterThan: 8, GreaterThanOrEquals: 8, LessThan: 8, LessThanOrEquals: 8, Equals: 9, Equivalent: 9, NotEquals: 9, NotEquivalent: 9, In: 10, Contains: 10, And: 11, Xor: 12, Or: 12, Implies: 13, Arrow: 100, Semicolon: 200 };
|
|
41522
|
-
var
|
|
41522
|
+
var as = { parse(r7) {
|
|
41523
41523
|
let e = r7.consumeAndParse();
|
|
41524
41524
|
if (!r7.match(")")) throw new Error("Parse error: expected `)` got `" + r7.peek()?.value + "`");
|
|
41525
41525
|
return e;
|
|
41526
41526
|
} };
|
|
41527
|
-
var
|
|
41527
|
+
var cs = { parse(r7, e) {
|
|
41528
41528
|
let t = r7.consumeAndParse();
|
|
41529
41529
|
if (!r7.match("]")) throw new Error("Parse error: expected `]`");
|
|
41530
41530
|
return new xe(e, t);
|
|
41531
41531
|
}, precedence: y.Indexer };
|
|
41532
|
-
var
|
|
41532
|
+
var us = { parse(r7, e) {
|
|
41533
41533
|
if (!(e instanceof q)) throw new Error("Unexpected parentheses");
|
|
41534
41534
|
let t = [];
|
|
41535
41535
|
for (; !r7.match(")"); ) t.push(r7.consumeAndParse()), r7.match(",");
|
|
41536
41536
|
return new J(e.name, t);
|
|
41537
41537
|
}, precedence: y.FunctionCall };
|
|
41538
|
-
function
|
|
41538
|
+
function ls(r7) {
|
|
41539
41539
|
let e = r7.split(" "), t = parseFloat(e[0]), n = e[1];
|
|
41540
41540
|
return n?.startsWith("'") && n.endsWith("'") ? n = n.substring(1, n.length - 1) : n = "{" + n + "}", { value: t, unit: n };
|
|
41541
41541
|
}
|
|
41542
41542
|
function $e() {
|
|
41543
|
-
return new Ze().registerPrefix("String", { parse: (r7, e) => new U({ type: l.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r7, e) => new U({ type: l.dateTime, value:
|
|
41543
|
+
return new Ze().registerPrefix("String", { parse: (r7, e) => new U({ type: l.string, value: e.value }) }).registerPrefix("DateTime", { parse: (r7, e) => new U({ type: l.dateTime, value: Ie(e.value) }) }).registerPrefix("Quantity", { parse: (r7, e) => new U({ type: l.Quantity, value: ls(e.value) }) }).registerPrefix("Number", { parse: (r7, e) => new U({ type: e.value.includes(".") ? l.decimal : l.integer, value: parseFloat(e.value) }) }).registerPrefix("true", { parse: () => new U({ type: l.boolean, value: true }) }).registerPrefix("false", { parse: () => new U({ type: l.boolean, value: false }) }).registerPrefix("Symbol", { parse: (r7, e) => new q(e.value) }).registerPrefix("{}", { parse: () => new ft() }).registerPrefix("(", as).registerInfix("[", cs).registerInfix("(", us).prefix("+", y.UnaryAdd, (r7, e) => new mt("+", e, (t) => t)).prefix("-", y.UnarySubtract, (r7, e) => new V("-", e, e, (t, n) => -n)).infixLeft(".", y.Dot, (r7, e, t) => new ne(r7, t)).infixLeft("/", y.Divide, (r7, e, t) => new V("/", r7, t, (n, i) => n / i)).infixLeft("*", y.Multiply, (r7, e, t) => new V("*", r7, t, (n, i) => n * i)).infixLeft("+", y.Add, (r7, e, t) => new V("+", r7, t, (n, i) => n + i)).infixLeft("-", y.Subtract, (r7, e, t) => new V("-", r7, t, (n, i) => n - i)).infixLeft("|", y.Union, (r7, e, t) => new ke(r7, t)).infixLeft("=", y.Equals, (r7, e, t) => new xt(r7, t)).infixLeft("!=", y.NotEquals, (r7, e, t) => new vt(r7, t)).infixLeft("~", y.Equivalent, (r7, e, t) => new Tt(r7, t)).infixLeft("!~", y.NotEquivalent, (r7, e, t) => new St(r7, t)).infixLeft("<", y.LessThan, (r7, e, t) => new V("<", r7, t, (n, i) => n < i)).infixLeft("<=", y.LessThanOrEquals, (r7, e, t) => new V("<=", r7, t, (n, i) => n <= i)).infixLeft(">", y.GreaterThan, (r7, e, t) => new V(">", r7, t, (n, i) => n > i)).infixLeft(">=", y.GreaterThanOrEquals, (r7, e, t) => new V(">=", r7, t, (n, i) => n >= i)).infixLeft("&", y.Ampersand, (r7, e, t) => new ht(r7, t)).infixLeft("and", y.And, (r7, e, t) => new Et(r7, t)).infixLeft("as", y.As, (r7, e, t) => new ye(r7, t)).infixLeft("contains", y.Contains, (r7, e, t) => new yt(r7, t)).infixLeft("div", y.Divide, (r7, e, t) => new V("div", r7, t, (n, i) => n / i | 0)).infixLeft("in", y.In, (r7, e, t) => new gt(r7, t)).infixLeft("is", y.Is, (r7, e, t) => new ge(r7, t)).infixLeft("mod", y.Modulo, (r7, e, t) => new V("mod", r7, t, (n, i) => n % i)).infixLeft("or", y.Or, (r7, e, t) => new bt(r7, t)).infixLeft("xor", y.Xor, (r7, e, t) => new Rt(r7, t)).infixLeft("implies", y.Implies, (r7, e, t) => new Ct(r7, t));
|
|
41544
41544
|
}
|
|
41545
|
-
var
|
|
41546
|
-
var
|
|
41547
|
-
var
|
|
41548
|
-
var
|
|
41549
|
-
function
|
|
41545
|
+
var ps = $e();
|
|
41546
|
+
var ii = ((p2) => (p2.BOOLEAN = "BOOLEAN", p2.NUMBER = "NUMBER", p2.QUANTITY = "QUANTITY", p2.TEXT = "TEXT", p2.REFERENCE = "REFERENCE", p2.CANONICAL = "CANONICAL", p2.DATE = "DATE", p2.DATETIME = "DATETIME", p2.PERIOD = "PERIOD", p2.UUID = "UUID", p2))(ii || {});
|
|
41547
|
+
var li = ((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))(li || {});
|
|
41548
|
+
var Us = ((b2) => (b2.READ = "read", b2.VREAD = "vread", b2.UPDATE = "update", b2.PATCH = "patch", b2.DELETE = "delete", b2.HISTORY = "history", b2.HISTORY_INSTANCE = "history-instance", b2.HISTORY_TYPE = "history-type", b2.HISTORY_SYSTEM = "history-system", b2.CREATE = "create", b2.SEARCH = "search", b2.SEARCH_TYPE = "search-type", b2.SEARCH_SYSTEM = "search-system", b2.SEARCH_COMPARTMENT = "search-compartment", b2.CAPABILITIES = "capabilities", b2.TRANSACTION = "transaction", b2.BATCH = "batch", b2.OPERATION = "operation", b2))(Us || {});
|
|
41549
|
+
function mi(r7) {
|
|
41550
41550
|
if (typeof window < "u") {
|
|
41551
41551
|
let e = window.atob(r7), t = Uint8Array.from(e, (n) => n.charCodeAt(0));
|
|
41552
41552
|
return new window.TextDecoder().decode(t);
|
|
@@ -41554,7 +41554,7 @@ function di(r7) {
|
|
|
41554
41554
|
if (typeof Buffer < "u") return Buffer.from(r7, "base64").toString("utf-8");
|
|
41555
41555
|
throw new Error("Unable to decode base64");
|
|
41556
41556
|
}
|
|
41557
|
-
function
|
|
41557
|
+
function hi(r7) {
|
|
41558
41558
|
if (typeof window < "u") {
|
|
41559
41559
|
let e = new window.TextEncoder().encode(r7), t = String.fromCharCode.apply(null, e);
|
|
41560
41560
|
return window.btoa(t);
|
|
@@ -41564,9 +41564,9 @@ function fi(r7) {
|
|
|
41564
41564
|
}
|
|
41565
41565
|
function Nr() {
|
|
41566
41566
|
let r7 = new Uint32Array(28);
|
|
41567
|
-
return crypto.getRandomValues(r7),
|
|
41567
|
+
return crypto.getRandomValues(r7), jn(r7.buffer);
|
|
41568
41568
|
}
|
|
41569
|
-
async function
|
|
41569
|
+
async function yi(r7) {
|
|
41570
41570
|
return crypto.subtle.digest("SHA-256", new TextEncoder().encode(r7));
|
|
41571
41571
|
}
|
|
41572
41572
|
function ve() {
|
|
@@ -41643,57 +41643,57 @@ var H = class {
|
|
|
41643
41643
|
}
|
|
41644
41644
|
};
|
|
41645
41645
|
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" };
|
|
41646
|
-
var
|
|
41646
|
+
var Ks = ["Patient", "Encounter", "ImagingStudy", "DiagnosticReport", "OperationOutcome", "Bundle"];
|
|
41647
41647
|
var Ur = ["DiagnosticReport-update"];
|
|
41648
|
-
function
|
|
41648
|
+
function vi(r7) {
|
|
41649
41649
|
return Ur.includes(r7);
|
|
41650
41650
|
}
|
|
41651
|
-
function
|
|
41651
|
+
function Ti(r7) {
|
|
41652
41652
|
if (Ur.includes(r7)) throw new d(h(`'context.version' is required for '${r7}'.`));
|
|
41653
41653
|
}
|
|
41654
|
-
var
|
|
41655
|
-
function
|
|
41656
|
-
return
|
|
41654
|
+
var zs = { "Patient-open": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "Patient-close": { patient: { resourceType: "Patient" }, encounter: { resourceType: "Encounter", optional: true } }, "ImagingStudy-open": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "ImagingStudy-close": { study: { resourceType: "ImagingStudy" }, encounter: { resourceType: "Encounter", optional: true }, patient: { resourceType: "Patient", optional: true } }, "Encounter-open": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "Encounter-close": { encounter: { resourceType: "Encounter" }, patient: { resourceType: "Patient" } }, "DiagnosticReport-open": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-close": { report: { resourceType: "DiagnosticReport" }, encounter: { resourceType: "Encounter", optional: true }, study: { resourceType: "ImagingStudy", optional: true, manyAllowed: true }, patient: { resourceType: "Patient" } }, "DiagnosticReport-select": { report: { resourceType: "DiagnosticReport" }, select: { resourceType: "*", isArray: true } }, "DiagnosticReport-update": { report: { resourceType: "DiagnosticReport" }, patient: { resourceType: "Patient", optional: true }, study: { resourceType: "ImagingStudy", optional: true }, updates: { resourceType: "Bundle" } }, syncerror: { operationoutcome: { resourceType: "OperationOutcome" } } };
|
|
41655
|
+
function Js(r7) {
|
|
41656
|
+
return Ks.includes(r7);
|
|
41657
41657
|
}
|
|
41658
|
-
function
|
|
41658
|
+
function Si(r7) {
|
|
41659
41659
|
return !!r7.endpoint;
|
|
41660
41660
|
}
|
|
41661
41661
|
function Br(r7) {
|
|
41662
41662
|
if (!kt(r7)) throw new d(h("subscriptionRequest must be an object conforming to SubscriptionRequest type."));
|
|
41663
41663
|
let { channelType: e, mode: t, topic: n, events: i } = r7, o = { "hub.channel.type": e, "hub.mode": t, "hub.topic": n, "hub.events": i.join(",") };
|
|
41664
|
-
return
|
|
41664
|
+
return Si(r7) && (o.endpoint = r7.endpoint), new URLSearchParams(o).toString();
|
|
41665
41665
|
}
|
|
41666
41666
|
function kt(r7) {
|
|
41667
41667
|
if (typeof r7 != "object") return false;
|
|
41668
41668
|
let { channelType: e, mode: t, topic: n, events: i } = r7;
|
|
41669
41669
|
if (!(e && t && n && i) || typeof n != "string" || typeof i != "object" || !Array.isArray(i) || i.length < 1 || e !== "websocket" || t !== "subscribe" && t !== "unsubscribe") return false;
|
|
41670
41670
|
for (let o of i) if (!Fr[o]) return false;
|
|
41671
|
-
return !(
|
|
41671
|
+
return !(Si(r7) && !(typeof r7.endpoint == "string" && r7.endpoint.startsWith("ws")));
|
|
41672
41672
|
}
|
|
41673
|
-
function
|
|
41673
|
+
function xi(r7, e, t, n) {
|
|
41674
41674
|
if (typeof e != "object") throw new d(h(`context[${t}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));
|
|
41675
41675
|
if (!(e.id && typeof e.id == "string")) throw new d(h(`context[${t}] is invalid. Resource must contain a valid string ID.`));
|
|
41676
41676
|
if (!e.resourceType) throw new d(h(`context[${t}] is invalid. Resource must contain a resource type. No resource type found.`));
|
|
41677
41677
|
let i = n.resourceType;
|
|
41678
41678
|
if (i !== "*") {
|
|
41679
|
-
if (!
|
|
41679
|
+
if (!Js(e.resourceType)) throw new d(h(`context[${t}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));
|
|
41680
41680
|
if (i && e.resourceType !== i) throw new d(h(`context[${t}] is invalid. context[${t}] for the '${r7}' event should contain resource of type ${i}.`));
|
|
41681
41681
|
}
|
|
41682
41682
|
}
|
|
41683
|
-
function
|
|
41684
|
-
if (i.set(e.key, (i.get(e.key) ?? 0) + 1), !n.isArray)
|
|
41683
|
+
function Ys(r7, e, t, n, i) {
|
|
41684
|
+
if (i.set(e.key, (i.get(e.key) ?? 0) + 1), !n.isArray) xi(r7, e.resource, t, n);
|
|
41685
41685
|
else {
|
|
41686
41686
|
let { resources: o } = e;
|
|
41687
41687
|
if (!o) throw new d(h(`context[${t}] is invalid. context[${t}] for the '${r7}' with key '${String(e.key)}' should contain an array of resources on the key 'resources'.`));
|
|
41688
|
-
for (let s of o)
|
|
41688
|
+
for (let s of o) xi(r7, s, t, n);
|
|
41689
41689
|
}
|
|
41690
41690
|
}
|
|
41691
|
-
function
|
|
41692
|
-
let t = /* @__PURE__ */ new Map(), n =
|
|
41691
|
+
function Zs(r7, e) {
|
|
41692
|
+
let t = /* @__PURE__ */ new Map(), n = zs[r7];
|
|
41693
41693
|
for (let i = 0; i < e.length; i++) {
|
|
41694
41694
|
let o = e[i].key;
|
|
41695
41695
|
if (!n[o]) throw new d(h(`Key '${o}' not found for event '${r7}'. Make sure to add only valid keys.`));
|
|
41696
|
-
|
|
41696
|
+
Ys(r7, e[i], i, n[o], t);
|
|
41697
41697
|
}
|
|
41698
41698
|
for (let [i, o] of Object.entries(n)) {
|
|
41699
41699
|
if (!(o.optional || t.has(i))) throw new d(h(`Missing required key '${i}' on context for '${r7}' event.`));
|
|
@@ -41706,7 +41706,7 @@ function qr(r7, e, t, n) {
|
|
|
41706
41706
|
if (typeof t != "object") throw new d(h("context must be a context object or array of context objects."));
|
|
41707
41707
|
if (Ur.includes(e) && !n) throw new d(h(`The '${e}' event must contain a 'context.versionId'.`));
|
|
41708
41708
|
let i = Array.isArray(t) ? t : [t];
|
|
41709
|
-
return
|
|
41709
|
+
return Zs(e, i), { timestamp: (/* @__PURE__ */ new Date()).toISOString(), id: ve(), event: { "hub.topic": r7, "hub.event": e, context: i, ...n ? { "context.versionId": n } : {} } };
|
|
41710
41710
|
}
|
|
41711
41711
|
var It = class extends H {
|
|
41712
41712
|
constructor(e) {
|
|
@@ -41728,28 +41728,28 @@ var It = class extends H {
|
|
|
41728
41728
|
this.websocket.close();
|
|
41729
41729
|
}
|
|
41730
41730
|
};
|
|
41731
|
-
function
|
|
41732
|
-
let e = r7.replace(/-/g, "+").replace(/_/g, "/"), t =
|
|
41731
|
+
function Xs(r7) {
|
|
41732
|
+
let e = r7.replace(/-/g, "+").replace(/_/g, "/"), t = mi(e), n = Array.from(t).reduce((o, s) => {
|
|
41733
41733
|
let a2 = ("00" + s.charCodeAt(0).toString(16)).slice(-2);
|
|
41734
41734
|
return `${o}%${a2}`;
|
|
41735
41735
|
}, ""), i = decodeURIComponent(n);
|
|
41736
41736
|
return JSON.parse(i);
|
|
41737
41737
|
}
|
|
41738
|
-
function
|
|
41738
|
+
function Ei(r7) {
|
|
41739
41739
|
return r7.split(".").length === 3;
|
|
41740
41740
|
}
|
|
41741
41741
|
function Vt(r7) {
|
|
41742
41742
|
let [e, t, n] = r7.split(".");
|
|
41743
|
-
return
|
|
41743
|
+
return Xs(t);
|
|
41744
41744
|
}
|
|
41745
|
-
function
|
|
41745
|
+
function bi(r7) {
|
|
41746
41746
|
try {
|
|
41747
41747
|
return typeof Vt(r7).login_id == "string";
|
|
41748
41748
|
} catch {
|
|
41749
41749
|
return false;
|
|
41750
41750
|
}
|
|
41751
41751
|
}
|
|
41752
|
-
function
|
|
41752
|
+
function Ri(r7) {
|
|
41753
41753
|
try {
|
|
41754
41754
|
let t = Vt(r7).exp;
|
|
41755
41755
|
return typeof t == "number" ? t * 1e3 : void 0;
|
|
@@ -41771,11 +41771,11 @@ var Dt = class {
|
|
|
41771
41771
|
await this.medplum.delete(`keyvalue/v1/${e}`);
|
|
41772
41772
|
}
|
|
41773
41773
|
};
|
|
41774
|
-
var
|
|
41775
|
-
|
|
41774
|
+
var Ci;
|
|
41775
|
+
Ci = Symbol.toStringTag;
|
|
41776
41776
|
var M = class {
|
|
41777
41777
|
constructor(e) {
|
|
41778
|
-
this[
|
|
41778
|
+
this[Ci] = "ReadablePromise";
|
|
41779
41779
|
this.status = "pending";
|
|
41780
41780
|
this.suspender = e.then((t) => (this.status = "success", this.response = t, t), (t) => {
|
|
41781
41781
|
throw this.status = "error", this.error = t, t;
|
|
@@ -41851,15 +41851,15 @@ var Wr = class {
|
|
|
41851
41851
|
return Array.from(this.data.keys())[e];
|
|
41852
41852
|
}
|
|
41853
41853
|
};
|
|
41854
|
-
var
|
|
41855
|
-
var
|
|
41856
|
-
function
|
|
41854
|
+
var De = { Event: typeof globalThis.Event < "u" ? globalThis.Event : void 0, ErrorEvent: void 0, CloseEvent: void 0 };
|
|
41855
|
+
var wi = false;
|
|
41856
|
+
function ea() {
|
|
41857
41857
|
if (typeof globalThis.Event > "u") throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");
|
|
41858
|
-
|
|
41858
|
+
De.Event = globalThis.Event, De.ErrorEvent = class extends Event {
|
|
41859
41859
|
constructor(e, t) {
|
|
41860
41860
|
super("error", t), this.message = e.message, this.error = e;
|
|
41861
41861
|
}
|
|
41862
|
-
},
|
|
41862
|
+
}, De.CloseEvent = class extends Event {
|
|
41863
41863
|
constructor(t = 1e3, n = "", i) {
|
|
41864
41864
|
super("close", i);
|
|
41865
41865
|
this.wasClean = true;
|
|
@@ -41867,17 +41867,17 @@ function Xs() {
|
|
|
41867
41867
|
}
|
|
41868
41868
|
};
|
|
41869
41869
|
}
|
|
41870
|
-
function
|
|
41870
|
+
function ta(r7, e) {
|
|
41871
41871
|
if (!r7) throw new Error(e);
|
|
41872
41872
|
}
|
|
41873
41873
|
function Mt(r7) {
|
|
41874
41874
|
return new r7.constructor(r7.type, r7);
|
|
41875
41875
|
}
|
|
41876
41876
|
var Te = { maxReconnectionDelay: 1e4, minReconnectionDelay: 1e3 + Math.random() * 4e3, minUptime: 5e3, reconnectionDelayGrowFactor: 1.3, connectionTimeout: 4e3, maxRetries: 1 / 0, maxEnqueuedMessages: 1 / 0, startClosed: false, debug: false };
|
|
41877
|
-
var
|
|
41877
|
+
var Ai = false;
|
|
41878
41878
|
var _t = class r extends H {
|
|
41879
41879
|
constructor(t, n, i = {}) {
|
|
41880
|
-
|
|
41880
|
+
wi || (ea(), wi = true);
|
|
41881
41881
|
super();
|
|
41882
41882
|
this._retryCount = -1;
|
|
41883
41883
|
this._shouldReconnect = true;
|
|
@@ -41892,7 +41892,7 @@ var _t = class r extends H {
|
|
|
41892
41892
|
this._handleOpen = (t2) => {
|
|
41893
41893
|
this._debug("open event");
|
|
41894
41894
|
let { minUptime: n2 = Te.minUptime } = this._options;
|
|
41895
|
-
clearTimeout(this._connectTimeout), this._uptimeTimeout = setTimeout(() => this._acceptOpen(), n2),
|
|
41895
|
+
clearTimeout(this._connectTimeout), this._uptimeTimeout = setTimeout(() => this._acceptOpen(), n2), ta(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(Mt(t2));
|
|
41896
41896
|
};
|
|
41897
41897
|
this._handleMessage = (t2) => {
|
|
41898
41898
|
this._debug("message event"), this.onmessage && this.onmessage(t2), this.dispatchEvent(Mt(t2));
|
|
@@ -42002,21 +42002,21 @@ var _t = class r extends H {
|
|
|
42002
42002
|
this._connectLock = false;
|
|
42003
42003
|
return;
|
|
42004
42004
|
}
|
|
42005
|
-
!this._options.WebSocket && typeof WebSocket > "u" && !
|
|
42005
|
+
!this._options.WebSocket && typeof WebSocket > "u" && !Ai && (console.error("\u203C\uFE0F No WebSocket implementation available. You should define options.WebSocket."), Ai = true);
|
|
42006
42006
|
let i = this._options.WebSocket || WebSocket;
|
|
42007
42007
|
this._debug("connect", { url: this._url, protocols: this._protocols }), this._ws = this._protocols ? new i(this._url, this._protocols) : new i(this._url), this._ws.binaryType = this._binaryType, this._connectLock = false, this._addListeners(), this._connectTimeout = setTimeout(() => this._handleTimeout(), n);
|
|
42008
42008
|
}).catch((i) => {
|
|
42009
|
-
this._connectLock = false, this._handleError(new
|
|
42009
|
+
this._connectLock = false, this._handleError(new De.ErrorEvent(Error(i.message), this));
|
|
42010
42010
|
});
|
|
42011
42011
|
}
|
|
42012
42012
|
_handleTimeout() {
|
|
42013
|
-
this._debug("timeout event"), this._handleError(new
|
|
42013
|
+
this._debug("timeout event"), this._handleError(new De.ErrorEvent(Error("TIMEOUT"), this));
|
|
42014
42014
|
}
|
|
42015
42015
|
_disconnect(t = 1e3, n) {
|
|
42016
42016
|
if (this._clearTimeouts(), !!this._ws) {
|
|
42017
42017
|
this._removeListeners();
|
|
42018
42018
|
try {
|
|
42019
|
-
this._ws.close(t, n), this._handleClose(new
|
|
42019
|
+
this._ws.close(t, n), this._handleClose(new De.CloseEvent(t, n, this));
|
|
42020
42020
|
} catch {
|
|
42021
42021
|
}
|
|
42022
42022
|
}
|
|
@@ -42034,7 +42034,7 @@ var _t = class r extends H {
|
|
|
42034
42034
|
clearTimeout(this._connectTimeout), clearTimeout(this._uptimeTimeout);
|
|
42035
42035
|
}
|
|
42036
42036
|
};
|
|
42037
|
-
var
|
|
42037
|
+
var ra = 5e3;
|
|
42038
42038
|
var Qe = class extends H {
|
|
42039
42039
|
constructor(...e) {
|
|
42040
42040
|
super(), this.criteria = new Set(e);
|
|
@@ -42070,7 +42070,7 @@ var Nt = class {
|
|
|
42070
42070
|
throw new d(h("Not a valid URL"));
|
|
42071
42071
|
}
|
|
42072
42072
|
let o = n?.ReconnectingWebSocket ? new n.ReconnectingWebSocket(i, void 0, { debug: n?.debug, debugLogger: n?.debugLogger }) : new _t(i, void 0, { debug: n?.debug, debugLogger: n?.debugLogger });
|
|
42073
|
-
this.medplum = e, this.ws = o, this.masterSubEmitter = new Qe(), this.criteriaEntries = /* @__PURE__ */ new Map(), this.criteriaEntriesBySubscriptionId = /* @__PURE__ */ new Map(), this.wsClosed = false, this.pingIntervalMs = n?.pingIntervalMs ??
|
|
42073
|
+
this.medplum = e, this.ws = o, this.masterSubEmitter = new Qe(), this.criteriaEntries = /* @__PURE__ */ new Map(), this.criteriaEntriesBySubscriptionId = /* @__PURE__ */ new Map(), this.wsClosed = false, this.pingIntervalMs = n?.pingIntervalMs ?? ra, this.currentProfile = e.getProfile(), this.setupListeners();
|
|
42074
42074
|
}
|
|
42075
42075
|
setupListeners() {
|
|
42076
42076
|
let e = this.ws;
|
|
@@ -42111,7 +42111,7 @@ var Nt = class {
|
|
|
42111
42111
|
for (let o of this.getAllCriteriaEmitters()) o.dispatchEvent({ ...i });
|
|
42112
42112
|
}
|
|
42113
42113
|
}), e.addEventListener("error", () => {
|
|
42114
|
-
let t = { type: "error", payload: new d(
|
|
42114
|
+
let t = { type: "error", payload: new d(ln(new Error("WebSocket error"))) };
|
|
42115
42115
|
this.masterSubEmitter?.dispatchEvent(t);
|
|
42116
42116
|
for (let n of this.getAllCriteriaEmitters()) n.dispatchEvent({ ...t });
|
|
42117
42117
|
}), e.addEventListener("close", () => {
|
|
@@ -42189,7 +42189,7 @@ var Nt = class {
|
|
|
42189
42189
|
let [t, n] = await this.getTokenForCriteria(e);
|
|
42190
42190
|
e.subscriptionId = t, e.token = n, this.criteriaEntriesBySubscriptionId.set(t, e), this.ws.send(JSON.stringify({ type: "bind-with-token", payload: { token: n } }));
|
|
42191
42191
|
} catch (t) {
|
|
42192
|
-
console.error(
|
|
42192
|
+
console.error(Re(t)), this.emitError(e, t), this.removeCriteriaEntry(e);
|
|
42193
42193
|
}
|
|
42194
42194
|
}
|
|
42195
42195
|
}
|
|
@@ -42228,25 +42228,25 @@ var Nt = class {
|
|
|
42228
42228
|
return this.masterSubEmitter || (this.masterSubEmitter = new Qe(...Array.from(this.criteriaEntries.keys()))), this.masterSubEmitter;
|
|
42229
42229
|
}
|
|
42230
42230
|
};
|
|
42231
|
-
var
|
|
42232
|
-
var
|
|
42233
|
-
var
|
|
42234
|
-
var
|
|
42235
|
-
var
|
|
42236
|
-
var
|
|
42237
|
-
var
|
|
42238
|
-
var
|
|
42239
|
-
var
|
|
42240
|
-
var
|
|
42241
|
-
var
|
|
42242
|
-
var
|
|
42243
|
-
var
|
|
42231
|
+
var $r = "3.2.27-4cec0e5ad";
|
|
42232
|
+
var oa = D.FHIR_JSON + ", */*; q=0.1";
|
|
42233
|
+
var sa = "https://api.medplum.com/";
|
|
42234
|
+
var aa = 1e3;
|
|
42235
|
+
var ca = 6e4;
|
|
42236
|
+
var ua = 0;
|
|
42237
|
+
var la = 3e5;
|
|
42238
|
+
var pa = "Binary/";
|
|
42239
|
+
var Oi = { resourceType: "Device", id: "system", deviceName: [{ type: "model-name", name: "System" }] };
|
|
42240
|
+
var da = ((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))(da || {});
|
|
42241
|
+
var fa = ((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))(fa || {});
|
|
42242
|
+
var ma = ((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))(ma || {});
|
|
42243
|
+
var ha = ((e) => (e.JwtBearer = "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", e))(ha || {});
|
|
42244
42244
|
var Lt = class extends H {
|
|
42245
42245
|
constructor(t) {
|
|
42246
42246
|
super();
|
|
42247
42247
|
this.initComplete = true;
|
|
42248
42248
|
if (t?.baseUrl && !t.baseUrl.startsWith("http")) throw new Error("Base URL must start with http or https");
|
|
42249
|
-
this.options = t ?? {}, this.fetch = t?.fetch ??
|
|
42249
|
+
this.options = t ?? {}, this.fetch = t?.fetch ?? ya(), this.storage = t?.storage ?? new He(), this.createPdfImpl = t?.createPdf, this.baseUrl = Pr(t?.baseUrl ?? sa), this.fhirBaseUrl = B(this.baseUrl, t?.fhirUrlPath ?? "fhir/R4"), this.authorizeUrl = B(this.baseUrl, t?.authorizeUrl ?? "oauth2/authorize"), this.tokenUrl = B(this.baseUrl, t?.tokenUrl ?? "oauth2/token"), this.logoutUrl = B(this.baseUrl, t?.logoutUrl ?? "oauth2/logout"), this.fhircastHubUrl = B(this.baseUrl, t?.fhircastHubUrl ?? "fhircast/STU3"), this.clientId = t?.clientId ?? "", this.clientSecret = t?.clientSecret ?? "", this.defaultHeaders = t?.defaultHeaders ?? {}, this.onUnauthenticated = t?.onUnauthenticated, this.refreshGracePeriod = t?.refreshGracePeriod ?? la, this.cacheTime = t?.cacheTime ?? (typeof window > "u" ? ua : ca), this.cacheTime > 0 ? this.requestCache = new Ot(t?.resourceCacheSize ?? aa) : 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(() => {
|
|
42250
42250
|
t?.accessToken || this.attemptResumeActiveLogin().catch(console.error), this.initComplete = true, this.dispatchEvent({ type: "storageInitialized" });
|
|
42251
42251
|
}).catch((n) => {
|
|
42252
42252
|
console.error(n), this.initComplete = true, this.dispatchEvent({ type: "storageInitFailed", payload: { error: n } });
|
|
@@ -42376,7 +42376,7 @@ var Lt = class extends H {
|
|
|
42376
42376
|
}
|
|
42377
42377
|
fhirSearchUrl(t, n) {
|
|
42378
42378
|
let i = this.fhirUrl(t);
|
|
42379
|
-
return n && (i.search =
|
|
42379
|
+
return n && (i.search = Jn(n)), i;
|
|
42380
42380
|
}
|
|
42381
42381
|
search(t, n, i) {
|
|
42382
42382
|
let o = this.fhirSearchUrl(t, n), s = "search-" + o.toString(), a2 = this.getCacheEntry(s, i);
|
|
@@ -42399,7 +42399,7 @@ var Lt = class extends H {
|
|
|
42399
42399
|
searchResources(t, n, i) {
|
|
42400
42400
|
let s = "searchResources-" + this.fhirSearchUrl(t, n).toString(), a2 = this.getCacheEntry(s, i);
|
|
42401
42401
|
if (a2) return a2.value;
|
|
42402
|
-
let c = new M(this.search(t, n, i).then(
|
|
42402
|
+
let c = new M(this.search(t, n, i).then(Vi));
|
|
42403
42403
|
return this.setCacheEntry(s, c), c;
|
|
42404
42404
|
}
|
|
42405
42405
|
async *searchResourcePages(t, n, i) {
|
|
@@ -42407,7 +42407,7 @@ var Lt = class extends H {
|
|
|
42407
42407
|
for (; o; ) {
|
|
42408
42408
|
let s = new URL(o).searchParams, a2 = await this.search(t, s, i), c = a2.link?.find((u2) => u2.relation === "next");
|
|
42409
42409
|
if (!a2.entry?.length && !c) break;
|
|
42410
|
-
yield
|
|
42410
|
+
yield Vi(a2), o = c?.url ? new URL(c.url) : void 0;
|
|
42411
42411
|
}
|
|
42412
42412
|
}
|
|
42413
42413
|
searchValueSet(t, n, i) {
|
|
@@ -42424,7 +42424,7 @@ var Lt = class extends H {
|
|
|
42424
42424
|
getCachedReference(t) {
|
|
42425
42425
|
let n = t.reference;
|
|
42426
42426
|
if (!n) return;
|
|
42427
|
-
if (n === "system") return
|
|
42427
|
+
if (n === "system") return Oi;
|
|
42428
42428
|
let [i, o] = n.split("/");
|
|
42429
42429
|
if (!(!i || !o)) return this.getCached(i, o);
|
|
42430
42430
|
}
|
|
@@ -42435,12 +42435,12 @@ var Lt = class extends H {
|
|
|
42435
42435
|
readReference(t, n) {
|
|
42436
42436
|
let i = t.reference;
|
|
42437
42437
|
if (!i) return new M(Promise.reject(new Error("Missing reference")));
|
|
42438
|
-
if (i === "system") return new M(Promise.resolve(
|
|
42438
|
+
if (i === "system") return new M(Promise.resolve(Oi));
|
|
42439
42439
|
let [o, s] = i.split("/");
|
|
42440
42440
|
return !o || !s ? new M(Promise.reject(new Error("Invalid reference"))) : this.readResource(o, s, n);
|
|
42441
42441
|
}
|
|
42442
42442
|
requestSchema(t) {
|
|
42443
|
-
if (
|
|
42443
|
+
if (En(t)) return Promise.resolve();
|
|
42444
42444
|
let n = t + "-requestSchema", i = this.getCacheEntry(n, void 0);
|
|
42445
42445
|
if (i) return i.value;
|
|
42446
42446
|
let o = new M((async () => {
|
|
@@ -42491,7 +42491,7 @@ var Lt = class extends H {
|
|
|
42491
42491
|
return this.setCacheEntry(n, o), o;
|
|
42492
42492
|
}
|
|
42493
42493
|
requestProfileSchema(t, n) {
|
|
42494
|
-
if (!n?.expandProfile &&
|
|
42494
|
+
if (!n?.expandProfile && Rn(t)) return Promise.resolve();
|
|
42495
42495
|
let i = t + "-requestSchema" + (n?.expandProfile ? "-nested" : ""), o = this.getCacheEntry(i, void 0);
|
|
42496
42496
|
if (o) return o.value;
|
|
42497
42497
|
let s = new M((async () => {
|
|
@@ -42535,12 +42535,12 @@ var Lt = class extends H {
|
|
|
42535
42535
|
return s || (s = t), this.cacheResource(s), this.invalidateUrl(this.fhirUrl(t.resourceType, t.id, "_history")), this.invalidateSearches(t.resourceType), s;
|
|
42536
42536
|
}
|
|
42537
42537
|
async createAttachment(t, n, i, o, s) {
|
|
42538
|
-
let a2 =
|
|
42538
|
+
let a2 = Di(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), u2 = await this.createBinary(a2, c);
|
|
42539
42539
|
return { contentType: a2.contentType, url: u2.url, title: a2.filename };
|
|
42540
42540
|
}
|
|
42541
42541
|
createBinary(t, n, i, o, s) {
|
|
42542
|
-
let a2 =
|
|
42543
|
-
return m2 &&
|
|
42542
|
+
let a2 = Di(t, n, i, o), c = s ?? (typeof n == "object" ? n : {}), { data: u2, contentType: p2, filename: m2, securityContext: x2, onProgress: Q } = a2, Ne = this.fhirUrl("Binary");
|
|
42543
|
+
return m2 && Ne.searchParams.set("_filename", m2), x2?.reference && this.setRequestHeader(c, "X-Security-Context", x2.reference), Q ? this.uploadwithProgress(Ne, u2, p2, Q, c) : this.post(Ne, u2, p2, c);
|
|
42544
42544
|
}
|
|
42545
42545
|
uploadwithProgress(t, n, i, o, s) {
|
|
42546
42546
|
return new Promise((a2, c) => {
|
|
@@ -42553,14 +42553,14 @@ var Lt = class extends H {
|
|
|
42553
42553
|
u2.status >= 200 && u2.status < 300 ? m2(u2.response) : m2(new d(tt(u2.response || u2.statusText)));
|
|
42554
42554
|
}, u2.open("POST", t), u2.withCredentials = true, u2.setRequestHeader("Authorization", "Bearer " + this.accessToken), u2.setRequestHeader("Cache-Control", "no-cache, no-store, max-age=0"), u2.setRequestHeader("Content-Type", i), this.options.extendedMode !== false && u2.setRequestHeader("X-Medplum", "extended"), s?.headers) {
|
|
42555
42555
|
let x2 = s.headers;
|
|
42556
|
-
for (let [Q,
|
|
42556
|
+
for (let [Q, Ne] of Object.entries(x2)) u2.setRequestHeader(Q, Ne);
|
|
42557
42557
|
}
|
|
42558
42558
|
u2.send(n);
|
|
42559
42559
|
});
|
|
42560
42560
|
}
|
|
42561
42561
|
async createPdf(t, n, i, o) {
|
|
42562
42562
|
if (!this.createPdfImpl) throw new Error("PDF creation not enabled");
|
|
42563
|
-
let s =
|
|
42563
|
+
let s = va(t, n, i, o), a2 = typeof n == "object" ? n : {}, { docDefinition: c, tableLayouts: u2, fonts: p2, ...m2 } = s, x2 = await this.createPdfImpl(c, u2, p2), Q = { ...m2, data: x2, contentType: "application/pdf" };
|
|
42564
42564
|
return this.createBinary(Q, a2);
|
|
42565
42565
|
}
|
|
42566
42566
|
createComment(t, n, i) {
|
|
@@ -42622,7 +42622,7 @@ var Lt = class extends H {
|
|
|
42622
42622
|
return this.accessTokenExpires !== void 0 && Date.now() < this.accessTokenExpires - (t ?? this.refreshGracePeriod);
|
|
42623
42623
|
}
|
|
42624
42624
|
setAccessToken(t, n) {
|
|
42625
|
-
this.accessToken = t, this.refreshToken = n, this.accessTokenExpires =
|
|
42625
|
+
this.accessToken = t, this.refreshToken = n, this.accessTokenExpires = Ri(t), this.medplumServer = bi(t);
|
|
42626
42626
|
}
|
|
42627
42627
|
getLogins() {
|
|
42628
42628
|
return this.storage.getObject("logins") ?? [];
|
|
@@ -42670,7 +42670,7 @@ var Lt = class extends H {
|
|
|
42670
42670
|
async download(t, n = {}) {
|
|
42671
42671
|
this.refreshPromise && await this.refreshPromise;
|
|
42672
42672
|
let i = t.toString();
|
|
42673
|
-
i.startsWith(
|
|
42673
|
+
i.startsWith(pa) && (t = this.fhirUrl(i));
|
|
42674
42674
|
let o = n.headers;
|
|
42675
42675
|
return o || (o = {}, n.headers = o), o.Accept || (o.Accept = "*/*"), this.addFetchOptionsDefaults(n), (await this.fetchWithRetry(t.toString(), n)).blob();
|
|
42676
42676
|
}
|
|
@@ -42715,14 +42715,14 @@ var Lt = class extends H {
|
|
|
42715
42715
|
if (s.status === 401) return this.handleUnauthenticated(t, n, i);
|
|
42716
42716
|
if (s.status === 204 || s.status === 304) return;
|
|
42717
42717
|
let c = s.headers.get("content-type")?.includes("json");
|
|
42718
|
-
if (s.status === 404 && !c) throw new d(
|
|
42718
|
+
if (s.status === 404 && !c) throw new d(cn);
|
|
42719
42719
|
let u2 = await this.parseBody(s, c);
|
|
42720
42720
|
if (s.status === 200 && i.followRedirectOnOk || s.status === 201 && i.followRedirectOnCreated) {
|
|
42721
|
-
let p2 = await
|
|
42721
|
+
let p2 = await ki(s, u2);
|
|
42722
42722
|
if (p2) return this.request("GET", p2, { ...i, body: void 0 });
|
|
42723
42723
|
}
|
|
42724
42724
|
if (s.status === 202 && i.pollStatusOnAccepted) {
|
|
42725
|
-
let m2 = await
|
|
42725
|
+
let m2 = await ki(s, u2) ?? o.statusUrl;
|
|
42726
42726
|
if (m2) return this.pollStatus(m2, i, o);
|
|
42727
42727
|
}
|
|
42728
42728
|
if (s.status >= 400) throw new d(tt(u2));
|
|
@@ -42730,13 +42730,15 @@ var Lt = class extends H {
|
|
|
42730
42730
|
}
|
|
42731
42731
|
async parseBody(t, n) {
|
|
42732
42732
|
let i;
|
|
42733
|
-
if (
|
|
42734
|
-
|
|
42735
|
-
|
|
42736
|
-
|
|
42733
|
+
if (t.headers.get("content-length") !== "0") {
|
|
42734
|
+
if (n) try {
|
|
42735
|
+
i = await t.json();
|
|
42736
|
+
} catch (o) {
|
|
42737
|
+
throw console.error("Error parsing response", t.status, o), o;
|
|
42738
|
+
}
|
|
42739
|
+
else i = await t.text();
|
|
42740
|
+
return i;
|
|
42737
42741
|
}
|
|
42738
|
-
else i = await t.text();
|
|
42739
|
-
return i;
|
|
42740
42742
|
}
|
|
42741
42743
|
async fetchWithRetry(t, n) {
|
|
42742
42744
|
t.startsWith("http") || (t = B(this.baseUrl, t));
|
|
@@ -42792,7 +42794,7 @@ var Lt = class extends H {
|
|
|
42792
42794
|
addFetchOptionsDefaults(t) {
|
|
42793
42795
|
Object.entries(this.defaultHeaders).forEach(([n, i]) => {
|
|
42794
42796
|
this.setRequestHeader(t, n, i);
|
|
42795
|
-
}), this.setRequestHeader(t, "Accept",
|
|
42797
|
+
}), this.setRequestHeader(t, "Accept", oa, true), this.options.extendedMode !== false && this.setRequestHeader(t, "X-Medplum", "extended"), t.body && this.setRequestHeader(t, "Content-Type", D.FHIR_JSON, true), this.accessToken ? this.setRequestHeader(t, "Authorization", "Bearer " + this.accessToken) : this.basicAuth && this.setRequestHeader(t, "Authorization", "Basic " + this.basicAuth), t.cache || (t.cache = "no-cache"), t.credentials || (t.credentials = "include");
|
|
42796
42798
|
}
|
|
42797
42799
|
setRequestContentType(t, n) {
|
|
42798
42800
|
this.setRequestHeader(t, "Content-Type", n);
|
|
@@ -42813,16 +42815,16 @@ var Lt = class extends H {
|
|
|
42813
42815
|
sessionStorage.setItem("pkceState", t);
|
|
42814
42816
|
let n = Nr().slice(0, 128);
|
|
42815
42817
|
sessionStorage.setItem("codeVerifier", n);
|
|
42816
|
-
let i = await
|
|
42818
|
+
let i = await yi(n), o = $n(i).replaceAll("+", "-").replaceAll("/", "_").replaceAll("=", "");
|
|
42817
42819
|
return sessionStorage.setItem("codeChallenge", o), { codeChallengeMethod: "S256", codeChallenge: o };
|
|
42818
42820
|
}
|
|
42819
42821
|
async requestAuthorization(t) {
|
|
42820
42822
|
let n = await this.ensureCodeChallenge(t ?? {}), i = new URL(this.authorizeUrl);
|
|
42821
|
-
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 ??
|
|
42823
|
+
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());
|
|
42822
42824
|
}
|
|
42823
42825
|
processCode(t, n) {
|
|
42824
42826
|
let i = new URLSearchParams();
|
|
42825
|
-
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 ??
|
|
42827
|
+
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") {
|
|
42826
42828
|
let o = sessionStorage.getItem("codeVerifier");
|
|
42827
42829
|
o && i.set("code_verifier", o);
|
|
42828
42830
|
}
|
|
@@ -42854,7 +42856,7 @@ var Lt = class extends H {
|
|
|
42854
42856
|
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);
|
|
42855
42857
|
}
|
|
42856
42858
|
setBasicAuth(t, n) {
|
|
42857
|
-
this.clientId = t, this.clientSecret = n, this.basicAuth =
|
|
42859
|
+
this.clientId = t, this.clientSecret = n, this.basicAuth = hi(t + ":" + n);
|
|
42858
42860
|
}
|
|
42859
42861
|
async fhircastSubscribe(t, n) {
|
|
42860
42862
|
if (!(typeof t == "string" && t !== "")) throw new d(h("Invalid topic provided. Topic must be a valid string."));
|
|
@@ -42872,7 +42874,7 @@ var Lt = class extends H {
|
|
|
42872
42874
|
return new It(t);
|
|
42873
42875
|
}
|
|
42874
42876
|
async fhircastPublish(t, n, i, o) {
|
|
42875
|
-
return
|
|
42877
|
+
return vi(n) ? this.post(this.fhircastHubUrl, qr(t, n, i, o), D.JSON) : (Ti(n), this.post(this.fhircastHubUrl, qr(t, n, i), D.JSON));
|
|
42876
42878
|
}
|
|
42877
42879
|
async fhircastGetContext(t) {
|
|
42878
42880
|
return this.get(`${this.fhircastHubUrl}/${t}`);
|
|
@@ -42903,9 +42905,9 @@ var Lt = class extends H {
|
|
|
42903
42905
|
}
|
|
42904
42906
|
async verifyTokens(t) {
|
|
42905
42907
|
let n = t.access_token;
|
|
42906
|
-
if (
|
|
42908
|
+
if (Ei(n)) {
|
|
42907
42909
|
let i = Vt(n);
|
|
42908
|
-
if (Date.now() >= i.exp * 1e3) throw this.clearActiveLogin(), new d(
|
|
42910
|
+
if (Date.now() >= i.exp * 1e3) throw this.clearActiveLogin(), new d(un);
|
|
42909
42911
|
if (i.cid) {
|
|
42910
42912
|
if (i.cid !== this.clientId) throw this.clearActiveLogin(), new d(rr);
|
|
42911
42913
|
} else if (this.clientId && i.client_id !== this.clientId) throw this.clearActiveLogin(), new d(rr);
|
|
@@ -42928,7 +42930,7 @@ var Lt = class extends H {
|
|
|
42928
42930
|
}
|
|
42929
42931
|
}
|
|
42930
42932
|
getSubscriptionManager() {
|
|
42931
|
-
return this.subscriptionManager || (this.subscriptionManager = new Nt(this,
|
|
42933
|
+
return this.subscriptionManager || (this.subscriptionManager = new Nt(this, zn(this.baseUrl, "/ws/subscriptions-r4"))), this.subscriptionManager;
|
|
42932
42934
|
}
|
|
42933
42935
|
subscribeToCriteria(t, n) {
|
|
42934
42936
|
return this.getSubscriptionManager().addCriteria(t, n);
|
|
@@ -42940,41 +42942,41 @@ var Lt = class extends H {
|
|
|
42940
42942
|
return this.getSubscriptionManager().getMasterEmitter();
|
|
42941
42943
|
}
|
|
42942
42944
|
};
|
|
42943
|
-
function
|
|
42945
|
+
function ya() {
|
|
42944
42946
|
if (!globalThis.fetch) throw new Error("Fetch not available in this environment");
|
|
42945
42947
|
return globalThis.fetch.bind(globalThis);
|
|
42946
42948
|
}
|
|
42947
|
-
function
|
|
42949
|
+
function Ii() {
|
|
42948
42950
|
return typeof window > "u" ? "" : window.location.protocol + "//" + window.location.host + "/";
|
|
42949
42951
|
}
|
|
42950
|
-
async function
|
|
42952
|
+
async function ki(r7, e) {
|
|
42951
42953
|
let t = r7.headers.get("content-location");
|
|
42952
42954
|
if (t) return t;
|
|
42953
42955
|
let n = r7.headers.get("location");
|
|
42954
42956
|
if (n) return n;
|
|
42955
42957
|
if (be(e) && e.issue?.[0]?.diagnostics) return e.issue[0].diagnostics;
|
|
42956
42958
|
}
|
|
42957
|
-
function
|
|
42959
|
+
function Vi(r7) {
|
|
42958
42960
|
let e = r7.entry?.map((t) => t.resource) ?? [];
|
|
42959
42961
|
return Object.assign(e, { bundle: r7 });
|
|
42960
42962
|
}
|
|
42961
|
-
function
|
|
42963
|
+
function ga(r7) {
|
|
42962
42964
|
return R(r7) && "data" in r7 && "contentType" in r7;
|
|
42963
42965
|
}
|
|
42964
|
-
function
|
|
42965
|
-
return
|
|
42966
|
+
function Di(r7, e, t, n) {
|
|
42967
|
+
return ga(r7) ? r7 : { data: r7, filename: e, contentType: t, onProgress: n };
|
|
42966
42968
|
}
|
|
42967
|
-
function
|
|
42969
|
+
function xa(r7) {
|
|
42968
42970
|
return R(r7) && "docDefinition" in r7;
|
|
42969
42971
|
}
|
|
42970
|
-
function
|
|
42971
|
-
return
|
|
42972
|
+
function va(r7, e, t, n) {
|
|
42973
|
+
return xa(r7) ? r7 : { docDefinition: r7, filename: e, tableLayouts: t, fonts: n };
|
|
42972
42974
|
}
|
|
42973
|
-
var
|
|
42974
|
-
var
|
|
42975
|
-
var
|
|
42976
|
-
var
|
|
42977
|
-
var
|
|
42975
|
+
var ka = [...je, "->", "<<", ">>", "=="];
|
|
42976
|
+
var Ma = $e().registerInfix("->", { precedence: y.Arrow }).registerInfix(";", { precedence: y.Semicolon });
|
|
42977
|
+
var Za = " ".repeat(2);
|
|
42978
|
+
var ec = [...je, "eq", "ne", "co"];
|
|
42979
|
+
var nc = $e();
|
|
42978
42980
|
var ae = class {
|
|
42979
42981
|
constructor(e = "\r", t = "|", n = "^", i = "~", o = "\\", s = "&") {
|
|
42980
42982
|
this.segmentSeparator = e;
|
|
@@ -42991,7 +42993,7 @@ var ae = class {
|
|
|
42991
42993
|
return this.componentSeparator + this.repetitionSeparator + this.escapeCharacter + this.subcomponentSeparator;
|
|
42992
42994
|
}
|
|
42993
42995
|
};
|
|
42994
|
-
var
|
|
42996
|
+
var Yi = class r2 {
|
|
42995
42997
|
constructor(e, t = new ae()) {
|
|
42996
42998
|
this.context = t, this.segments = e;
|
|
42997
42999
|
}
|
|
@@ -43015,7 +43017,7 @@ var zi = class r2 {
|
|
|
43015
43017
|
}
|
|
43016
43018
|
buildAck() {
|
|
43017
43019
|
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";
|
|
43018
|
-
return new r2([new Je(["MSH", this.context.getMsh2(), o, s, n, i,
|
|
43020
|
+
return new r2([new Je(["MSH", this.context.getMsh2(), o, s, n, i, oc(e), "", this.buildAckMessageType(t), e.getTime().toString(), "P", c], this.context), new Je(["MSA", "AA", a2, "OK"], this.context)]);
|
|
43019
43021
|
}
|
|
43020
43022
|
buildAckMessageType(e) {
|
|
43021
43023
|
let t = e?.getField(9), n = t?.getComponent(2), i = t?.getComponent(3), o = "ACK";
|
|
@@ -43032,15 +43034,15 @@ var zi = class r2 {
|
|
|
43032
43034
|
};
|
|
43033
43035
|
var Je = class r3 {
|
|
43034
43036
|
constructor(e, t = new ae()) {
|
|
43035
|
-
this.context = t,
|
|
43037
|
+
this.context = t, qn(e) ? this.fields = e.map((n) => _e.parse(n, t)) : this.fields = e, this.name = this.fields[0].components[0][0];
|
|
43036
43038
|
}
|
|
43037
43039
|
get(e) {
|
|
43038
43040
|
return this.fields[e];
|
|
43039
43041
|
}
|
|
43040
43042
|
getField(e) {
|
|
43041
43043
|
if (this.name === "MSH") {
|
|
43042
|
-
if (e === 1) return new
|
|
43043
|
-
if (e === 2) return new
|
|
43044
|
+
if (e === 1) return new _e([[this.context.getMsh1()]], this.context);
|
|
43045
|
+
if (e === 2) return new _e([[this.context.getMsh2()]], this.context);
|
|
43044
43046
|
if (e > 2) return this.fields[e - 1];
|
|
43045
43047
|
}
|
|
43046
43048
|
return this.fields[e];
|
|
@@ -43052,10 +43054,10 @@ var Je = class r3 {
|
|
|
43052
43054
|
return this.fields.map((e) => e.toString()).join(this.context.fieldSeparator);
|
|
43053
43055
|
}
|
|
43054
43056
|
static parse(e, t = new ae()) {
|
|
43055
|
-
return new r3(e.split(t.fieldSeparator).map((n) =>
|
|
43057
|
+
return new r3(e.split(t.fieldSeparator).map((n) => _e.parse(n, t)), t);
|
|
43056
43058
|
}
|
|
43057
43059
|
};
|
|
43058
|
-
var
|
|
43060
|
+
var _e = class r4 {
|
|
43059
43061
|
constructor(e, t = new ae()) {
|
|
43060
43062
|
this.context = t, this.components = e;
|
|
43061
43063
|
}
|
|
@@ -43073,12 +43075,12 @@ var Me = class r4 {
|
|
|
43073
43075
|
return new r4(e.split(t.repetitionSeparator).map((n) => n.split(t.componentSeparator)), t);
|
|
43074
43076
|
}
|
|
43075
43077
|
};
|
|
43076
|
-
function
|
|
43078
|
+
function oc(r7) {
|
|
43077
43079
|
let e = r7 instanceof Date ? r7 : new Date(r7), n = e.toISOString().replace(/[-:T]/g, "").replace(/(\.\d+)?Z$/, ""), i = e.getUTCMilliseconds();
|
|
43078
43080
|
return i > 0 && (n += "." + i.toString()), n;
|
|
43079
43081
|
}
|
|
43080
|
-
var
|
|
43081
|
-
var
|
|
43082
|
+
var Yr = ((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))(Yr || {});
|
|
43083
|
+
var Zi = class r5 {
|
|
43082
43084
|
constructor(e, t = {}, n = 3, i) {
|
|
43083
43085
|
this.write = e;
|
|
43084
43086
|
this.metadata = t;
|
|
@@ -43108,17 +43110,17 @@ var Ji = class r5 {
|
|
|
43108
43110
|
}
|
|
43109
43111
|
log(e, t, n) {
|
|
43110
43112
|
e > this.level || (n instanceof Error && (n = { error: n.toString(), stack: n.stack?.split(`
|
|
43111
|
-
`) }), this.write(JSON.stringify({ level:
|
|
43113
|
+
`) }), this.write(JSON.stringify({ level: Yr[e], timestamp: (/* @__PURE__ */ new Date()).toISOString(), msg: this.prefix ? `${this.prefix}${t}` : t, ...n, ...this.metadata })));
|
|
43112
43114
|
}
|
|
43113
43115
|
};
|
|
43114
43116
|
function vm(r7) {
|
|
43115
|
-
let e =
|
|
43117
|
+
let e = Yr[r7.toUpperCase()];
|
|
43116
43118
|
if (e === void 0) throw new Error(`Invalid log level: ${r7}`);
|
|
43117
43119
|
return e;
|
|
43118
43120
|
}
|
|
43119
|
-
var
|
|
43121
|
+
var dc = "https://meta.medplum.com/releases";
|
|
43120
43122
|
var Kt = /* @__PURE__ */ new Map();
|
|
43121
|
-
function
|
|
43123
|
+
function fc(r7) {
|
|
43122
43124
|
let e = r7;
|
|
43123
43125
|
if (!e.tag_name) throw new Error("Manifest missing tag_name");
|
|
43124
43126
|
let t = e.assets;
|
|
@@ -43128,40 +43130,42 @@ function dc(r7) {
|
|
|
43128
43130
|
if (!n.name) throw new Error("Asset missing name");
|
|
43129
43131
|
}
|
|
43130
43132
|
}
|
|
43131
|
-
async function
|
|
43132
|
-
let
|
|
43133
|
-
if (!
|
|
43134
|
-
let
|
|
43135
|
-
if (
|
|
43136
|
-
|
|
43133
|
+
async function Xr(r7, e, t) {
|
|
43134
|
+
let n = Kt.get(e ?? "latest");
|
|
43135
|
+
if (!n) {
|
|
43136
|
+
let i = e ? `v${e}` : "latest", o = new URL(`${dc}/${i}.json`);
|
|
43137
|
+
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);
|
|
43138
|
+
let s = await fetch(o.toString());
|
|
43139
|
+
if (s.status !== 200) {
|
|
43140
|
+
let c;
|
|
43137
43141
|
try {
|
|
43138
|
-
|
|
43139
|
-
} catch (
|
|
43140
|
-
console.error(`Failed to parse message from body: ${
|
|
43142
|
+
c = (await s.json()).message;
|
|
43143
|
+
} catch (u2) {
|
|
43144
|
+
console.error(`Failed to parse message from body: ${Re(u2)}`);
|
|
43141
43145
|
}
|
|
43142
|
-
throw new Error(`Received status code ${
|
|
43146
|
+
throw new Error(`Received status code ${s.status} while fetching manifest for version '${e ?? "latest"}'. Message: ${c}`);
|
|
43143
43147
|
}
|
|
43144
|
-
let
|
|
43145
|
-
|
|
43148
|
+
let a2 = await s.json();
|
|
43149
|
+
fc(a2), n = a2, Kt.set(e ?? "latest", n), e || Kt.set(n.tag_name.slice(1), n);
|
|
43146
43150
|
}
|
|
43147
|
-
return
|
|
43151
|
+
return n;
|
|
43148
43152
|
}
|
|
43149
|
-
function
|
|
43153
|
+
function mc(r7) {
|
|
43150
43154
|
return /^\d+\.\d+\.\d+$/.test(r7);
|
|
43151
43155
|
}
|
|
43152
|
-
async function
|
|
43153
|
-
if (!
|
|
43156
|
+
async function Mm(r7, e) {
|
|
43157
|
+
if (!mc(e)) return false;
|
|
43154
43158
|
try {
|
|
43155
|
-
await
|
|
43159
|
+
await Xr(r7, e);
|
|
43156
43160
|
} catch {
|
|
43157
43161
|
return false;
|
|
43158
43162
|
}
|
|
43159
43163
|
return true;
|
|
43160
43164
|
}
|
|
43161
|
-
async function
|
|
43162
|
-
let
|
|
43163
|
-
if (!
|
|
43164
|
-
return
|
|
43165
|
+
async function _m(r7) {
|
|
43166
|
+
let e = await Xr(r7);
|
|
43167
|
+
if (!e.tag_name.startsWith("v")) throw new Error(`Invalid release name found. Release tag '${e.tag_name}' did not start with 'v'`);
|
|
43168
|
+
return e.tag_name.slice(1);
|
|
43165
43169
|
}
|
|
43166
43170
|
|
|
43167
43171
|
// src/agent-main.ts
|
|
@@ -43207,7 +43211,7 @@ var p = class extends a {
|
|
|
43207
43211
|
e.on("data", (s) => {
|
|
43208
43212
|
try {
|
|
43209
43213
|
if (this.appendData(s), s.at(-2) === 28 && s.at(-1) === 13) {
|
|
43210
|
-
let o = Buffer.concat(this.chunks), i = o.subarray(1, o.length - 2), f2 = (0, import_iconv_lite.decode)(i, this.encoding), g2 =
|
|
43214
|
+
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);
|
|
43211
43215
|
this.dispatchEvent(new d2(this, g2)), this.resetBuffer();
|
|
43212
43216
|
}
|
|
43213
43217
|
} catch (o) {
|
|
@@ -43460,7 +43464,7 @@ var AgentDicomChannel = class extends BaseChannel {
|
|
|
43460
43464
|
});
|
|
43461
43465
|
response.setStatus(dimse.constants.Status.Success);
|
|
43462
43466
|
} catch (err) {
|
|
43463
|
-
DcmjsDimseScp.channel.log.error(`DICOM error: ${
|
|
43467
|
+
DcmjsDimseScp.channel.log.error(`DICOM error: ${Re(err)}`);
|
|
43464
43468
|
response.setStatus(dimse.constants.Status.ProcessingFailure);
|
|
43465
43469
|
}
|
|
43466
43470
|
return response;
|
|
@@ -43536,7 +43540,7 @@ var AgentHl7Channel = class extends BaseChannel {
|
|
|
43536
43540
|
sendToRemote(msg) {
|
|
43537
43541
|
const connection = this.connections.get(msg.remote);
|
|
43538
43542
|
if (connection) {
|
|
43539
|
-
connection.hl7Connection.send(
|
|
43543
|
+
connection.hl7Connection.send(Yi.parse(msg.body));
|
|
43540
43544
|
}
|
|
43541
43545
|
}
|
|
43542
43546
|
handleNewConnection(connection) {
|
|
@@ -43565,7 +43569,7 @@ var AgentHl7ChannelConnection = class {
|
|
|
43565
43569
|
callback: `Agent/${this.channel.app.agentId}-${(0, import_node_crypto2.randomUUID)()}`
|
|
43566
43570
|
});
|
|
43567
43571
|
} catch (err) {
|
|
43568
|
-
this.channel.log.error(`HL7 error: ${
|
|
43572
|
+
this.channel.log.error(`HL7 error: ${Re(err)}`);
|
|
43569
43573
|
}
|
|
43570
43574
|
}
|
|
43571
43575
|
close() {
|
|
@@ -43585,7 +43589,7 @@ var UPGRADER_LOG_PATH = (0, import_node_path2.resolve)(
|
|
|
43585
43589
|
);
|
|
43586
43590
|
var RELEASES_PATH = (0, import_node_path2.resolve)(__dirname);
|
|
43587
43591
|
async function downloadRelease(version, path) {
|
|
43588
|
-
const release = await
|
|
43592
|
+
const release = await Xr("agent-upgrader", version);
|
|
43589
43593
|
const downloadUrl = parseDownloadUrl(release, (0, import_node_os2.platform)());
|
|
43590
43594
|
const { body } = await fetch(downloadUrl);
|
|
43591
43595
|
if (!body) {
|
|
@@ -43661,7 +43665,7 @@ var App = class _App {
|
|
|
43661
43665
|
this.shutdown = false;
|
|
43662
43666
|
this.keepAlive = false;
|
|
43663
43667
|
_App.instance = this;
|
|
43664
|
-
this.log = new
|
|
43668
|
+
this.log = new Zi((msg) => console.log(msg), void 0, logLevel);
|
|
43665
43669
|
}
|
|
43666
43670
|
async start() {
|
|
43667
43671
|
this.log.info("Medplum service starting...");
|
|
@@ -43681,7 +43685,7 @@ var App = class _App {
|
|
|
43681
43685
|
if ((0, import_node_fs3.existsSync)(UPGRADE_MANIFEST_PATH)) {
|
|
43682
43686
|
const upgradeFile = (0, import_node_fs3.readFileSync)(UPGRADE_MANIFEST_PATH, { encoding: "utf-8" });
|
|
43683
43687
|
const upgradeDetails = JSON.parse(upgradeFile);
|
|
43684
|
-
if (upgradeDetails.targetVersion ===
|
|
43688
|
+
if (upgradeDetails.targetVersion === $r.split("-")[0]) {
|
|
43685
43689
|
await this.sendToWebSocket({
|
|
43686
43690
|
type: "agent:upgrade:response",
|
|
43687
43691
|
statusCode: 200,
|
|
@@ -43689,7 +43693,7 @@ var App = class _App {
|
|
|
43689
43693
|
});
|
|
43690
43694
|
this.log.info(`Successfully upgraded to version ${upgradeDetails.targetVersion}`);
|
|
43691
43695
|
} else {
|
|
43692
|
-
const errMsg = `Failed to upgrade to version ${upgradeDetails.targetVersion}. Agent still running with version ${
|
|
43696
|
+
const errMsg = `Failed to upgrade to version ${upgradeDetails.targetVersion}. Agent still running with version ${$r}`;
|
|
43693
43697
|
await this.sendToWebSocket({
|
|
43694
43698
|
type: "agent:error",
|
|
43695
43699
|
body: errMsg,
|
|
@@ -43764,7 +43768,7 @@ var App = class _App {
|
|
|
43764
43768
|
break;
|
|
43765
43769
|
case "agent:heartbeat:request":
|
|
43766
43770
|
this.outstandingHeartbeats = 0;
|
|
43767
|
-
await this.sendToWebSocket({ type: "agent:heartbeat:response", version:
|
|
43771
|
+
await this.sendToWebSocket({ type: "agent:heartbeat:response", version: $r });
|
|
43768
43772
|
break;
|
|
43769
43773
|
case "agent:heartbeat:response":
|
|
43770
43774
|
this.outstandingHeartbeats = 0;
|
|
@@ -43807,7 +43811,7 @@ var App = class _App {
|
|
|
43807
43811
|
} catch (err) {
|
|
43808
43812
|
await this.sendToWebSocket({
|
|
43809
43813
|
type: "agent:error",
|
|
43810
|
-
body:
|
|
43814
|
+
body: Re(err),
|
|
43811
43815
|
callback: command.callback
|
|
43812
43816
|
});
|
|
43813
43817
|
}
|
|
@@ -43822,7 +43826,7 @@ var App = class _App {
|
|
|
43822
43826
|
this.log.error(`Unknown message type: ${command.type}`);
|
|
43823
43827
|
}
|
|
43824
43828
|
} catch (err) {
|
|
43825
|
-
this.log.error(`WebSocket error on incoming message: ${
|
|
43829
|
+
this.log.error(`WebSocket error on incoming message: ${Re(err)}`);
|
|
43826
43830
|
}
|
|
43827
43831
|
});
|
|
43828
43832
|
return new Promise((resolve2, reject) => {
|
|
@@ -43897,7 +43901,7 @@ var App = class _App {
|
|
|
43897
43901
|
try {
|
|
43898
43902
|
await this.startOrReloadChannel(definition, endpoint);
|
|
43899
43903
|
} catch (err) {
|
|
43900
|
-
this.log.error(
|
|
43904
|
+
this.log.error(Re(err));
|
|
43901
43905
|
}
|
|
43902
43906
|
}
|
|
43903
43907
|
}
|
|
@@ -43923,7 +43927,7 @@ var App = class _App {
|
|
|
43923
43927
|
parsedEndpoint = new URL(endpoint.address);
|
|
43924
43928
|
} catch (err) {
|
|
43925
43929
|
throw new Error(
|
|
43926
|
-
`Error while validating endpoint address for channel '${channel.name}': ${
|
|
43930
|
+
`Error while validating endpoint address for channel '${channel.name}': ${Re(err)}`
|
|
43927
43931
|
);
|
|
43928
43932
|
}
|
|
43929
43933
|
if (seenPorts.has(parsedEndpoint.port)) {
|
|
@@ -44002,7 +44006,7 @@ var App = class _App {
|
|
|
44002
44006
|
try {
|
|
44003
44007
|
await this.sendToWebSocket(msg);
|
|
44004
44008
|
} catch (err) {
|
|
44005
|
-
this.log.error(`WebSocket error while attempting to send message: ${
|
|
44009
|
+
this.log.error(`WebSocket error while attempting to send message: ${Re(err)}`);
|
|
44006
44010
|
this.webSocketQueue.unshift(msg);
|
|
44007
44011
|
throw err;
|
|
44008
44012
|
}
|
|
@@ -44039,7 +44043,7 @@ IPv6 is currently unsupported.`;
|
|
|
44039
44043
|
this.log.error(errMsg);
|
|
44040
44044
|
throw new Error(errMsg);
|
|
44041
44045
|
}
|
|
44042
|
-
if (!((0, import_node_net3.isIPv4)(message.remote) ||
|
|
44046
|
+
if (!((0, import_node_net3.isIPv4)(message.remote) || ul(message.remote))) {
|
|
44043
44047
|
const errMsg = `Attempted to ping an invalid host.
|
|
44044
44048
|
|
|
44045
44049
|
"${message.remote}" is not a valid IPv4 address or a resolvable hostname.`;
|
|
@@ -44078,7 +44082,7 @@ ${result}`);
|
|
|
44078
44082
|
body: result
|
|
44079
44083
|
});
|
|
44080
44084
|
} catch (err) {
|
|
44081
|
-
this.log.error(`Error during ping attempt to ${message.remote ?? "NO_HOST_GIVEN"}: ${
|
|
44085
|
+
this.log.error(`Error during ping attempt to ${message.remote ?? "NO_HOST_GIVEN"}: ${Re(err)}`);
|
|
44082
44086
|
this.addToWebSocketQueue({
|
|
44083
44087
|
type: "agent:transmit:response",
|
|
44084
44088
|
channel: message.channel,
|
|
@@ -44086,7 +44090,7 @@ ${result}`);
|
|
|
44086
44090
|
remote: message.remote,
|
|
44087
44091
|
callback: message.callback,
|
|
44088
44092
|
statusCode: 400,
|
|
44089
|
-
body:
|
|
44093
|
+
body: Re(err)
|
|
44090
44094
|
});
|
|
44091
44095
|
}
|
|
44092
44096
|
}
|
|
@@ -44102,7 +44106,7 @@ ${result}`);
|
|
|
44102
44106
|
return;
|
|
44103
44107
|
}
|
|
44104
44108
|
let child;
|
|
44105
|
-
if (message.version && !await
|
|
44109
|
+
if (message.version && !await Mm("agent-upgrader", message.version)) {
|
|
44106
44110
|
const versionTag = message.version ? `v${message.version}` : "latest";
|
|
44107
44111
|
const errMsg = `Error during upgrading to version '${versionTag}'. '${message.version}' is not a valid version`;
|
|
44108
44112
|
this.log.error(errMsg);
|
|
@@ -44133,11 +44137,11 @@ ${result}`);
|
|
|
44133
44137
|
});
|
|
44134
44138
|
});
|
|
44135
44139
|
child.on("error", (err) => {
|
|
44136
|
-
this.log.error(
|
|
44140
|
+
this.log.error(Re(err));
|
|
44137
44141
|
});
|
|
44138
44142
|
} catch (err) {
|
|
44139
44143
|
const versionTag = message.version ? `v${message.version}` : "latest";
|
|
44140
|
-
const errMsg = `Error during upgrading to version '${versionTag}': ${
|
|
44144
|
+
const errMsg = `Error during upgrading to version '${versionTag}': ${Re(err)}`;
|
|
44141
44145
|
this.log.error(errMsg);
|
|
44142
44146
|
await this.sendToWebSocket({
|
|
44143
44147
|
type: "agent:error",
|
|
@@ -44149,12 +44153,12 @@ ${result}`);
|
|
|
44149
44153
|
try {
|
|
44150
44154
|
await this.stop();
|
|
44151
44155
|
this.log.info("Successfully stopped agent network services");
|
|
44152
|
-
const targetVersion = message.version ?? await
|
|
44153
|
-
this.log.info("Writing upgrade manifest...", { previousVersion:
|
|
44156
|
+
const targetVersion = message.version ?? await _m("agent-upgrader");
|
|
44157
|
+
this.log.info("Writing upgrade manifest...", { previousVersion: $r, targetVersion });
|
|
44154
44158
|
(0, import_node_fs3.writeFileSync)(
|
|
44155
44159
|
UPGRADE_MANIFEST_PATH,
|
|
44156
44160
|
JSON.stringify({
|
|
44157
|
-
previousVersion:
|
|
44161
|
+
previousVersion: $r,
|
|
44158
44162
|
targetVersion,
|
|
44159
44163
|
callback: message.callback ?? null
|
|
44160
44164
|
}),
|
|
@@ -44164,7 +44168,7 @@ ${result}`);
|
|
|
44164
44168
|
child.disconnect();
|
|
44165
44169
|
} catch (err) {
|
|
44166
44170
|
this.log.error(
|
|
44167
|
-
`Error while stopping agent or messaging child process as part of upgrade: ${
|
|
44171
|
+
`Error while stopping agent or messaging child process as part of upgrade: ${Re(err)}`
|
|
44168
44172
|
);
|
|
44169
44173
|
import_node_process.default.exit(1);
|
|
44170
44174
|
}
|
|
@@ -44222,7 +44226,7 @@ ${result}`);
|
|
|
44222
44226
|
});
|
|
44223
44227
|
}
|
|
44224
44228
|
}
|
|
44225
|
-
client.sendAndWait(
|
|
44229
|
+
client.sendAndWait(Yi.parse(message.body)).then((response) => {
|
|
44226
44230
|
this.log.info(`Response: ${response.toString().replaceAll("\r", "\n")}`);
|
|
44227
44231
|
this.addToWebSocketQueue({
|
|
44228
44232
|
type: "agent:transmit:response",
|
|
@@ -44234,7 +44238,7 @@ ${result}`);
|
|
|
44234
44238
|
body: response.toString()
|
|
44235
44239
|
});
|
|
44236
44240
|
}).catch((err) => {
|
|
44237
|
-
this.log.error(`HL7 error: ${
|
|
44241
|
+
this.log.error(`HL7 error: ${Re(err)}`);
|
|
44238
44242
|
this.addToWebSocketQueue({
|
|
44239
44243
|
type: "agent:transmit:response",
|
|
44240
44244
|
channel: message.channel,
|
|
@@ -44242,7 +44246,7 @@ ${result}`);
|
|
|
44242
44246
|
callback: message.callback,
|
|
44243
44247
|
contentType: D.TEXT,
|
|
44244
44248
|
statusCode: 400,
|
|
44245
|
-
body:
|
|
44249
|
+
body: Re(err)
|
|
44246
44250
|
});
|
|
44247
44251
|
if (client.keepAlive) {
|
|
44248
44252
|
this.hl7Clients.delete(message.remote);
|
|
@@ -44319,7 +44323,7 @@ async function upgraderMain(argv) {
|
|
|
44319
44323
|
if ((0, import_node_os4.platform)() !== "win32") {
|
|
44320
44324
|
throw new Error(`Unsupported platform: ${(0, import_node_os4.platform)()}. Agent upgrader currently only supports Windows`);
|
|
44321
44325
|
}
|
|
44322
|
-
const globalLogger = new
|
|
44326
|
+
const globalLogger = new Zi((msg) => console.log(msg));
|
|
44323
44327
|
if (!import_node_process2.default.send) {
|
|
44324
44328
|
globalLogger.error("Upgrader not started as a child process with Node IPC enabled. Aborting...");
|
|
44325
44329
|
import_node_process2.default.exit(1);
|
|
@@ -44332,10 +44336,10 @@ async function upgraderMain(argv) {
|
|
|
44332
44336
|
});
|
|
44333
44337
|
});
|
|
44334
44338
|
import_node_process2.default.send({ type: "STARTED" });
|
|
44335
|
-
if (argv[3] && !
|
|
44339
|
+
if (argv[3] && !mc(argv[3])) {
|
|
44336
44340
|
throw new Error("Invalid version specified");
|
|
44337
44341
|
}
|
|
44338
|
-
const version = argv[3] ?? await
|
|
44342
|
+
const version = argv[3] ?? await _m("agent-upgrader");
|
|
44339
44343
|
const binPath = getReleaseBinPath(version);
|
|
44340
44344
|
if (!(0, import_node_fs5.existsSync)(binPath)) {
|
|
44341
44345
|
globalLogger.info(`Could not find binary at "${binPath}". Downloading release from GitHub...`);
|
|
@@ -44358,7 +44362,7 @@ async function upgraderMain(argv) {
|
|
|
44358
44362
|
(0, import_node_child_process2.spawnSync)(binPath, ["/S"]);
|
|
44359
44363
|
globalLogger.info(`Agent version ${version} successfully installed`);
|
|
44360
44364
|
} catch (err) {
|
|
44361
|
-
globalLogger.error(`Error while attempting to run installer: ${
|
|
44365
|
+
globalLogger.error(`Error while attempting to run installer: ${Re(err)}`);
|
|
44362
44366
|
globalLogger.error("Failed to run installer, attempting to restart agent service...");
|
|
44363
44367
|
try {
|
|
44364
44368
|
(0, import_node_child_process2.execSync)('net start "Medplum Agent"');
|