@medplum/core 3.1.5 → 3.1.7
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 +5 -5
- package/dist/cjs/index.cjs.map +3 -3
- package/dist/cjs/index.d.ts +124 -15
- package/dist/esm/index.d.ts +124 -15
- package/dist/esm/index.mjs +5 -5
- package/dist/esm/index.mjs.map +3 -3
- package/package.json +3 -3
package/dist/cjs/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { Device } from '@medplum/fhirtypes';
|
|
|
18
18
|
import { ElementDefinition } from '@medplum/fhirtypes';
|
|
19
19
|
import { ElementDefinitionBinding } from '@medplum/fhirtypes';
|
|
20
20
|
import { Extension } from '@medplum/fhirtypes';
|
|
21
|
+
import { ExtensionValue } from '@medplum/fhirtypes';
|
|
21
22
|
import { ExtractResource } from '@medplum/fhirtypes';
|
|
22
23
|
import { HumanName } from '@medplum/fhirtypes';
|
|
23
24
|
import { Identifier } from '@medplum/fhirtypes';
|
|
@@ -48,6 +49,7 @@ import { ResourceType } from '@medplum/fhirtypes';
|
|
|
48
49
|
import { SearchParameter } from '@medplum/fhirtypes';
|
|
49
50
|
import { StructureDefinition } from '@medplum/fhirtypes';
|
|
50
51
|
import { StructureMap } from '@medplum/fhirtypes';
|
|
52
|
+
import { Subscription } from '@medplum/fhirtypes';
|
|
51
53
|
import type { TDocumentDefinitions } from 'pdfmake/interfaces';
|
|
52
54
|
import type { TFontDictionary } from 'pdfmake/interfaces';
|
|
53
55
|
import { Timing } from '@medplum/fhirtypes';
|
|
@@ -82,6 +84,15 @@ export declare enum AccessPolicyInteraction {
|
|
|
82
84
|
OPERATION = "operation"
|
|
83
85
|
}
|
|
84
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Adds the supplied profileUrl to the resource.meta.profile if it is not already
|
|
89
|
+
* specified
|
|
90
|
+
* @param resource - A FHIR resource
|
|
91
|
+
* @param profileUrl - The profile URL to add
|
|
92
|
+
* @returns The resource
|
|
93
|
+
*/
|
|
94
|
+
export declare function addProfileToResource<T extends Resource = Resource>(resource: T, profileUrl: string): T;
|
|
95
|
+
|
|
85
96
|
export declare interface AddressFormatOptions {
|
|
86
97
|
all?: boolean;
|
|
87
98
|
use?: boolean;
|
|
@@ -111,7 +122,20 @@ export declare interface AgentHeartbeatResponse extends BaseAgentMessage {
|
|
|
111
122
|
version: string;
|
|
112
123
|
}
|
|
113
124
|
|
|
114
|
-
export declare type AgentMessage =
|
|
125
|
+
export declare type AgentMessage = AgentRequestMessage | AgentResponseMessage;
|
|
126
|
+
|
|
127
|
+
export declare interface AgentReloadConfigRequest extends BaseAgentMessage {
|
|
128
|
+
type: 'agent:reloadconfig:request';
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export declare interface AgentReloadConfigResponse extends BaseAgentMessage {
|
|
132
|
+
type: 'agent:reloadconfig:response';
|
|
133
|
+
statusCode: number;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export declare type AgentRequestMessage = AgentConnectRequest | AgentHeartbeatRequest | AgentTransmitRequest | AgentReloadConfigRequest;
|
|
137
|
+
|
|
138
|
+
export declare type AgentResponseMessage = AgentConnectResponse | AgentHeartbeatResponse | AgentTransmitResponse | AgentReloadConfigResponse | AgentError;
|
|
115
139
|
|
|
116
140
|
export declare interface AgentTransmitRequest extends BaseAgentRequestMessage {
|
|
117
141
|
type: 'agent:transmit:request';
|
|
@@ -219,6 +243,12 @@ export declare interface AtomContext {
|
|
|
219
243
|
variables: Record<string, TypedValue>;
|
|
220
244
|
}
|
|
221
245
|
|
|
246
|
+
export declare interface BackgroundJobContext {
|
|
247
|
+
interaction: BackgroundJobInteraction;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export declare type BackgroundJobInteraction = 'create' | 'update' | 'delete';
|
|
251
|
+
|
|
222
252
|
export declare function badRequest(details: string, expression?: string): OperationOutcome;
|
|
223
253
|
|
|
224
254
|
export declare interface BaseAgentMessage {
|
|
@@ -271,7 +301,7 @@ export declare interface BotEvent<T = Resource | Hl7Message | string | Record<st
|
|
|
271
301
|
readonly traceId?: string;
|
|
272
302
|
}
|
|
273
303
|
|
|
274
|
-
export declare function buildElementsContext({ parentContext, path, elements, profileUrl, debugMode, }: {
|
|
304
|
+
export declare function buildElementsContext({ parentContext, path, elements, profileUrl, debugMode, accessPolicyResource, }: {
|
|
275
305
|
/** The most recent `ElementsContextType` in which this context is being built. */
|
|
276
306
|
parentContext: ElementsContextType | undefined;
|
|
277
307
|
/** The FHIR path from the root resource to which the keys of `elements` are relative. */
|
|
@@ -285,6 +315,7 @@ export declare function buildElementsContext({ parentContext, path, elements, pr
|
|
|
285
315
|
profileUrl?: string;
|
|
286
316
|
/** Whether debug logging is enabled */
|
|
287
317
|
debugMode?: boolean;
|
|
318
|
+
accessPolicyResource?: AccessPolicyResource;
|
|
288
319
|
}): ElementsContextType | undefined;
|
|
289
320
|
|
|
290
321
|
export declare function buildTypeName(components: string[]): string;
|
|
@@ -564,7 +595,7 @@ export declare function createProcessingIssue(expression: string, message: strin
|
|
|
564
595
|
|
|
565
596
|
/**
|
|
566
597
|
* Creates a reference resource.
|
|
567
|
-
* @param resource - The FHIR
|
|
598
|
+
* @param resource - The FHIR resource.
|
|
568
599
|
* @returns A reference resource.
|
|
569
600
|
*/
|
|
570
601
|
export declare function createReference<T extends Resource>(resource: T): Reference<T>;
|
|
@@ -641,20 +672,39 @@ export declare type ElementsContextType = {
|
|
|
641
672
|
/** The FHIR path from the root resource to which the keys of `elements` are relative. */
|
|
642
673
|
path: string;
|
|
643
674
|
/**
|
|
644
|
-
* The mapping of keys to `
|
|
675
|
+
* The mapping of keys to `ExtendedInternalSchemaElement` at the current `path` relative to the
|
|
645
676
|
* root resource. `elements` originate from either `InternalTypeSchema.elements` or
|
|
646
677
|
* `SliceDefinition.elements` when the elements context is created within a slice.
|
|
647
678
|
*/
|
|
648
|
-
elements: Record<string,
|
|
679
|
+
elements: Record<string, ExtendedInternalSchemaElement>;
|
|
649
680
|
/**
|
|
650
681
|
* Similar mapping as `elements`, but with keys being the full path from the root resource rather
|
|
651
682
|
* than relative to `path`, in other words, the keys of the Record are `${path}.${key}`.
|
|
652
683
|
*/
|
|
653
|
-
elementsByPath: Record<string,
|
|
684
|
+
elementsByPath: Record<string, ExtendedInternalSchemaElement>;
|
|
654
685
|
/** The URL, if any, of the resource profile or extension from which the `elements` collection originated. */
|
|
655
686
|
profileUrl: string | undefined;
|
|
656
687
|
/** Whether debug logging is enabled */
|
|
657
688
|
debugMode: boolean;
|
|
689
|
+
/** The `AccessPolicyResource` provided, if any, used to determine hidden and readonly elements. */
|
|
690
|
+
accessPolicyResource?: AccessPolicyResource;
|
|
691
|
+
/**
|
|
692
|
+
* Used to get an `ExtendedElementProperties` object for an element at a given path. This
|
|
693
|
+
* is primarily useful when working with elements not included in `InternalTypeSchema.elements`
|
|
694
|
+
* as is the case for nested elements that have not been modified by a profile or extension,
|
|
695
|
+
* e.g. Patient.name.family.
|
|
696
|
+
*
|
|
697
|
+
* This function does not attempt to determine if the input `path` is actually an element in the
|
|
698
|
+
* resource. When a syntactically correct path to a nonexistent element, e.g. Patient.foobar, is provided,
|
|
699
|
+
* a `ExtendedElementProperties` object with default values is returned.
|
|
700
|
+
*
|
|
701
|
+
* @param path - The full path to an element in the resource, e.g. Patient.name.family
|
|
702
|
+
* @returns An `ExtendedElementProperties` object with `readonly` and `hidden` properties for the
|
|
703
|
+
* element at `path`, or `undefined` if the input path is malformed.
|
|
704
|
+
*/
|
|
705
|
+
getExtendedProps(path: string): ExtendedElementProperties | undefined;
|
|
706
|
+
/** `true` if this is a default/placeholder `ElementsContextType` */
|
|
707
|
+
isDefaultContext?: boolean;
|
|
658
708
|
};
|
|
659
709
|
|
|
660
710
|
export declare interface ElementType {
|
|
@@ -750,6 +800,15 @@ declare class EventTarget_2 {
|
|
|
750
800
|
}
|
|
751
801
|
export { EventTarget_2 as EventTarget }
|
|
752
802
|
|
|
803
|
+
export declare type ExtendedElementProperties = {
|
|
804
|
+
readonly: boolean;
|
|
805
|
+
hidden: boolean;
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
export declare interface ExtendedInternalSchemaElement extends InternalSchemaElement {
|
|
809
|
+
readonly?: boolean;
|
|
810
|
+
}
|
|
811
|
+
|
|
753
812
|
export declare type ExternalSecret<T extends ExternalSecretPrimitive = ExternalSecretPrimitive> = {
|
|
754
813
|
system: ExternalSecretSystem;
|
|
755
814
|
key: string;
|
|
@@ -1390,7 +1449,7 @@ export declare function getExtension(resource: any, ...urls: string[]): Extensio
|
|
|
1390
1449
|
* @param urls - Array of extension URLs. Each entry represents a nested extension.
|
|
1391
1450
|
* @returns The extension value if found; undefined otherwise.
|
|
1392
1451
|
*/
|
|
1393
|
-
export declare function getExtensionValue(resource: any, ...urls: string[]):
|
|
1452
|
+
export declare function getExtensionValue(resource: any, ...urls: string[]): ExtensionValue | undefined;
|
|
1394
1453
|
|
|
1395
1454
|
/**
|
|
1396
1455
|
* Returns the resource identifier for the given system.
|
|
@@ -1791,6 +1850,8 @@ export declare class Hl7Segment {
|
|
|
1791
1850
|
|
|
1792
1851
|
export declare const HTTP_HL7_ORG = "http://hl7.org";
|
|
1793
1852
|
|
|
1853
|
+
export declare const HTTP_TERMINOLOGY_HL7_ORG = "http://terminology.hl7.org";
|
|
1854
|
+
|
|
1794
1855
|
export declare interface HumanNameFormatOptions {
|
|
1795
1856
|
all?: boolean;
|
|
1796
1857
|
prefix?: boolean;
|
|
@@ -1829,7 +1890,7 @@ export declare interface IncludeTarget {
|
|
|
1829
1890
|
resourceType: string;
|
|
1830
1891
|
searchParam: string;
|
|
1831
1892
|
targetType?: string;
|
|
1832
|
-
modifier?:
|
|
1893
|
+
modifier?: 'iterate';
|
|
1833
1894
|
}
|
|
1834
1895
|
|
|
1835
1896
|
/**
|
|
@@ -2036,6 +2097,8 @@ export declare function isEmpty(v: unknown): boolean;
|
|
|
2036
2097
|
*/
|
|
2037
2098
|
export declare function isFhircastResourceType(resourceType: FhircastResourceType): boolean;
|
|
2038
2099
|
|
|
2100
|
+
export declare function isFhirCriteriaMet(subscription: Subscription, currentResource: Resource, getPreviousResource: (currentResource: Resource) => Promise<Resource | undefined>): Promise<boolean>;
|
|
2101
|
+
|
|
2039
2102
|
export declare function isGone(outcome: OperationOutcome): boolean;
|
|
2040
2103
|
|
|
2041
2104
|
/**
|
|
@@ -2233,7 +2296,11 @@ export declare class Logger {
|
|
|
2233
2296
|
readonly write: (msg: string) => void;
|
|
2234
2297
|
readonly metadata: Record<string, any>;
|
|
2235
2298
|
level: LogLevel;
|
|
2236
|
-
|
|
2299
|
+
readonly options?: LoggerOptions | undefined;
|
|
2300
|
+
readonly prefix?: string;
|
|
2301
|
+
constructor(write: (msg: string) => void, metadata?: Record<string, any>, level?: LogLevel, options?: LoggerOptions | undefined);
|
|
2302
|
+
clone(override?: LoggerConfigOverride): Logger;
|
|
2303
|
+
private getLoggerConfig;
|
|
2237
2304
|
error(msg: string, data?: Record<string, any>): void;
|
|
2238
2305
|
warn(msg: string, data?: Record<string, any>): void;
|
|
2239
2306
|
info(msg: string, data?: Record<string, any>): void;
|
|
@@ -2241,6 +2308,19 @@ export declare class Logger {
|
|
|
2241
2308
|
log(level: LogLevel, msg: string, data?: Record<string, any>): void;
|
|
2242
2309
|
}
|
|
2243
2310
|
|
|
2311
|
+
export declare interface LoggerConfig {
|
|
2312
|
+
write: (msg: string) => void;
|
|
2313
|
+
metadata: Record<string, any>;
|
|
2314
|
+
level: LogLevel;
|
|
2315
|
+
options?: LoggerOptions;
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
export declare type LoggerConfigOverride = Partial<LoggerConfig>;
|
|
2319
|
+
|
|
2320
|
+
export declare interface LoggerOptions {
|
|
2321
|
+
prefix?: string;
|
|
2322
|
+
}
|
|
2323
|
+
|
|
2244
2324
|
export declare interface LoginAuthenticationResponse {
|
|
2245
2325
|
readonly login: string;
|
|
2246
2326
|
readonly mfaRequired?: boolean;
|
|
@@ -4154,10 +4234,12 @@ export declare interface MedplumInfraConfig {
|
|
|
4154
4234
|
rdsReaderInstanceType?: string;
|
|
4155
4235
|
rdsProxyEnabled?: boolean;
|
|
4156
4236
|
cacheNodeType?: string;
|
|
4237
|
+
cacheSecurityGroupId?: string;
|
|
4157
4238
|
desiredServerCount: number;
|
|
4158
4239
|
serverImage: string;
|
|
4159
4240
|
serverMemory: number;
|
|
4160
4241
|
serverCpu: number;
|
|
4242
|
+
loadBalancerSecurityGroupId?: string;
|
|
4161
4243
|
loadBalancerLoggingBucket?: string;
|
|
4162
4244
|
loadBalancerLoggingPrefix?: string;
|
|
4163
4245
|
clamscanEnabled: boolean;
|
|
@@ -4266,10 +4348,12 @@ export declare interface MedplumSourceInfraConfig {
|
|
|
4266
4348
|
rdsReaderInstanceType?: ValueOrExternalSecret<string>;
|
|
4267
4349
|
rdsProxyEnabled?: ValueOrExternalSecret<boolean>;
|
|
4268
4350
|
cacheNodeType?: ValueOrExternalSecret<string>;
|
|
4351
|
+
cacheSecurityGroupId?: ValueOrExternalSecret<string>;
|
|
4269
4352
|
desiredServerCount: ValueOrExternalSecret<number>;
|
|
4270
4353
|
serverImage: ValueOrExternalSecret<string>;
|
|
4271
4354
|
serverMemory: ValueOrExternalSecret<number>;
|
|
4272
4355
|
serverCpu: ValueOrExternalSecret<number>;
|
|
4356
|
+
loadBalancerSecurityGroupId?: ValueOrExternalSecret<string>;
|
|
4273
4357
|
loadBalancerLoggingBucket?: ValueOrExternalSecret<string>;
|
|
4274
4358
|
loadBalancerLoggingPrefix?: ValueOrExternalSecret<string>;
|
|
4275
4359
|
clamscanEnabled: ValueOrExternalSecret<boolean>;
|
|
@@ -4510,6 +4594,7 @@ export declare enum Operator {
|
|
|
4510
4594
|
NOT_IN = "not-in",
|
|
4511
4595
|
OF_TYPE = "of-type",
|
|
4512
4596
|
MISSING = "missing",
|
|
4597
|
+
PRESENT = "present",
|
|
4513
4598
|
IDENTIFIER = "identifier",
|
|
4514
4599
|
ITERATE = "iterate"
|
|
4515
4600
|
}
|
|
@@ -4936,6 +5021,14 @@ export declare class ReadablePromise<T> implements Promise<T> {
|
|
|
4936
5021
|
*/
|
|
4937
5022
|
export declare function removeDuplicates(arr: TypedValue[]): TypedValue[];
|
|
4938
5023
|
|
|
5024
|
+
/**
|
|
5025
|
+
* Removes the supplied profileUrl from the resource.meta.profile if it is present
|
|
5026
|
+
* @param resource - A FHIR resource
|
|
5027
|
+
* @param profileUrl - The profile URL to remove
|
|
5028
|
+
* @returns The resource
|
|
5029
|
+
*/
|
|
5030
|
+
export declare function removeProfileFromResource<T extends Resource = Resource>(resource: T, profileUrl: string): T;
|
|
5031
|
+
|
|
4939
5032
|
/**
|
|
4940
5033
|
* Topologically sorts a `batch` or `transaction` bundle to improve reference resolution.
|
|
4941
5034
|
* The bundle is sorted such that a resource is created _before_ references to that resource appear in the bundle.
|
|
@@ -4969,6 +5062,16 @@ export declare type ResourceArray<T extends Resource = Resource> = T[] & {
|
|
|
4969
5062
|
bundle: Bundle<T>;
|
|
4970
5063
|
};
|
|
4971
5064
|
|
|
5065
|
+
export declare type ResourceMatchesSubscriptionCriteria = {
|
|
5066
|
+
resource: Resource;
|
|
5067
|
+
subscription: Subscription;
|
|
5068
|
+
context: BackgroundJobContext;
|
|
5069
|
+
logger?: Logger;
|
|
5070
|
+
getPreviousResource: (currentResource: Resource) => Promise<Resource | undefined>;
|
|
5071
|
+
};
|
|
5072
|
+
|
|
5073
|
+
export declare function resourceMatchesSubscriptionCriteria({ resource, subscription, context, getPreviousResource, logger, }: ResourceMatchesSubscriptionCriteria): Promise<boolean>;
|
|
5074
|
+
|
|
4972
5075
|
export declare interface ResourceVisitor {
|
|
4973
5076
|
onEnterObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
|
|
4974
5077
|
onExitObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
|
|
@@ -5093,15 +5196,10 @@ export declare function singleton(collection: TypedValue[], type?: string): Type
|
|
|
5093
5196
|
*/
|
|
5094
5197
|
export declare const sleep: (ms: number) => Promise<void>;
|
|
5095
5198
|
|
|
5096
|
-
export declare interface SliceDefinition {
|
|
5199
|
+
export declare interface SliceDefinition extends Omit<InternalSchemaElement, 'slicing'> {
|
|
5097
5200
|
name: string;
|
|
5098
|
-
path: string;
|
|
5099
5201
|
definition?: string;
|
|
5100
|
-
type?: ElementType[];
|
|
5101
5202
|
elements: Record<string, InternalSchemaElement>;
|
|
5102
|
-
min: number;
|
|
5103
|
-
max: number;
|
|
5104
|
-
binding?: ElementDefinitionBinding;
|
|
5105
5203
|
}
|
|
5106
5204
|
|
|
5107
5205
|
export declare type SliceDefinitionWithTypes = SliceDefinition & {
|
|
@@ -5149,6 +5247,17 @@ export declare function sortStringArray(array: string[]): string[];
|
|
|
5149
5247
|
*/
|
|
5150
5248
|
export declare function splitN(str: string, delim: string, n: number): string[];
|
|
5151
5249
|
|
|
5250
|
+
/**
|
|
5251
|
+
* Splits a FHIR search value on commas.
|
|
5252
|
+
* Respects backslash escape.
|
|
5253
|
+
*
|
|
5254
|
+
* See: https://hl7.org/fhir/r4/search.html#escaping
|
|
5255
|
+
*
|
|
5256
|
+
* @param input - The FHIR search value to split.
|
|
5257
|
+
* @returns The individual search values.
|
|
5258
|
+
*/
|
|
5259
|
+
export declare function splitSearchOnComma(input: string): string[];
|
|
5260
|
+
|
|
5152
5261
|
/**
|
|
5153
5262
|
* Reads data from a Readable stream and returns a Promise that resolves with a Buffer containing all the data.
|
|
5154
5263
|
* @param stream - The Readable stream to read from.
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { Device } from '@medplum/fhirtypes';
|
|
|
18
18
|
import { ElementDefinition } from '@medplum/fhirtypes';
|
|
19
19
|
import { ElementDefinitionBinding } from '@medplum/fhirtypes';
|
|
20
20
|
import { Extension } from '@medplum/fhirtypes';
|
|
21
|
+
import { ExtensionValue } from '@medplum/fhirtypes';
|
|
21
22
|
import { ExtractResource } from '@medplum/fhirtypes';
|
|
22
23
|
import { HumanName } from '@medplum/fhirtypes';
|
|
23
24
|
import { Identifier } from '@medplum/fhirtypes';
|
|
@@ -48,6 +49,7 @@ import { ResourceType } from '@medplum/fhirtypes';
|
|
|
48
49
|
import { SearchParameter } from '@medplum/fhirtypes';
|
|
49
50
|
import { StructureDefinition } from '@medplum/fhirtypes';
|
|
50
51
|
import { StructureMap } from '@medplum/fhirtypes';
|
|
52
|
+
import { Subscription } from '@medplum/fhirtypes';
|
|
51
53
|
import type { TDocumentDefinitions } from 'pdfmake/interfaces';
|
|
52
54
|
import type { TFontDictionary } from 'pdfmake/interfaces';
|
|
53
55
|
import { Timing } from '@medplum/fhirtypes';
|
|
@@ -82,6 +84,15 @@ export declare enum AccessPolicyInteraction {
|
|
|
82
84
|
OPERATION = "operation"
|
|
83
85
|
}
|
|
84
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Adds the supplied profileUrl to the resource.meta.profile if it is not already
|
|
89
|
+
* specified
|
|
90
|
+
* @param resource - A FHIR resource
|
|
91
|
+
* @param profileUrl - The profile URL to add
|
|
92
|
+
* @returns The resource
|
|
93
|
+
*/
|
|
94
|
+
export declare function addProfileToResource<T extends Resource = Resource>(resource: T, profileUrl: string): T;
|
|
95
|
+
|
|
85
96
|
export declare interface AddressFormatOptions {
|
|
86
97
|
all?: boolean;
|
|
87
98
|
use?: boolean;
|
|
@@ -111,7 +122,20 @@ export declare interface AgentHeartbeatResponse extends BaseAgentMessage {
|
|
|
111
122
|
version: string;
|
|
112
123
|
}
|
|
113
124
|
|
|
114
|
-
export declare type AgentMessage =
|
|
125
|
+
export declare type AgentMessage = AgentRequestMessage | AgentResponseMessage;
|
|
126
|
+
|
|
127
|
+
export declare interface AgentReloadConfigRequest extends BaseAgentMessage {
|
|
128
|
+
type: 'agent:reloadconfig:request';
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export declare interface AgentReloadConfigResponse extends BaseAgentMessage {
|
|
132
|
+
type: 'agent:reloadconfig:response';
|
|
133
|
+
statusCode: number;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export declare type AgentRequestMessage = AgentConnectRequest | AgentHeartbeatRequest | AgentTransmitRequest | AgentReloadConfigRequest;
|
|
137
|
+
|
|
138
|
+
export declare type AgentResponseMessage = AgentConnectResponse | AgentHeartbeatResponse | AgentTransmitResponse | AgentReloadConfigResponse | AgentError;
|
|
115
139
|
|
|
116
140
|
export declare interface AgentTransmitRequest extends BaseAgentRequestMessage {
|
|
117
141
|
type: 'agent:transmit:request';
|
|
@@ -219,6 +243,12 @@ export declare interface AtomContext {
|
|
|
219
243
|
variables: Record<string, TypedValue>;
|
|
220
244
|
}
|
|
221
245
|
|
|
246
|
+
export declare interface BackgroundJobContext {
|
|
247
|
+
interaction: BackgroundJobInteraction;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export declare type BackgroundJobInteraction = 'create' | 'update' | 'delete';
|
|
251
|
+
|
|
222
252
|
export declare function badRequest(details: string, expression?: string): OperationOutcome;
|
|
223
253
|
|
|
224
254
|
export declare interface BaseAgentMessage {
|
|
@@ -271,7 +301,7 @@ export declare interface BotEvent<T = Resource | Hl7Message | string | Record<st
|
|
|
271
301
|
readonly traceId?: string;
|
|
272
302
|
}
|
|
273
303
|
|
|
274
|
-
export declare function buildElementsContext({ parentContext, path, elements, profileUrl, debugMode, }: {
|
|
304
|
+
export declare function buildElementsContext({ parentContext, path, elements, profileUrl, debugMode, accessPolicyResource, }: {
|
|
275
305
|
/** The most recent `ElementsContextType` in which this context is being built. */
|
|
276
306
|
parentContext: ElementsContextType | undefined;
|
|
277
307
|
/** The FHIR path from the root resource to which the keys of `elements` are relative. */
|
|
@@ -285,6 +315,7 @@ export declare function buildElementsContext({ parentContext, path, elements, pr
|
|
|
285
315
|
profileUrl?: string;
|
|
286
316
|
/** Whether debug logging is enabled */
|
|
287
317
|
debugMode?: boolean;
|
|
318
|
+
accessPolicyResource?: AccessPolicyResource;
|
|
288
319
|
}): ElementsContextType | undefined;
|
|
289
320
|
|
|
290
321
|
export declare function buildTypeName(components: string[]): string;
|
|
@@ -564,7 +595,7 @@ export declare function createProcessingIssue(expression: string, message: strin
|
|
|
564
595
|
|
|
565
596
|
/**
|
|
566
597
|
* Creates a reference resource.
|
|
567
|
-
* @param resource - The FHIR
|
|
598
|
+
* @param resource - The FHIR resource.
|
|
568
599
|
* @returns A reference resource.
|
|
569
600
|
*/
|
|
570
601
|
export declare function createReference<T extends Resource>(resource: T): Reference<T>;
|
|
@@ -641,20 +672,39 @@ export declare type ElementsContextType = {
|
|
|
641
672
|
/** The FHIR path from the root resource to which the keys of `elements` are relative. */
|
|
642
673
|
path: string;
|
|
643
674
|
/**
|
|
644
|
-
* The mapping of keys to `
|
|
675
|
+
* The mapping of keys to `ExtendedInternalSchemaElement` at the current `path` relative to the
|
|
645
676
|
* root resource. `elements` originate from either `InternalTypeSchema.elements` or
|
|
646
677
|
* `SliceDefinition.elements` when the elements context is created within a slice.
|
|
647
678
|
*/
|
|
648
|
-
elements: Record<string,
|
|
679
|
+
elements: Record<string, ExtendedInternalSchemaElement>;
|
|
649
680
|
/**
|
|
650
681
|
* Similar mapping as `elements`, but with keys being the full path from the root resource rather
|
|
651
682
|
* than relative to `path`, in other words, the keys of the Record are `${path}.${key}`.
|
|
652
683
|
*/
|
|
653
|
-
elementsByPath: Record<string,
|
|
684
|
+
elementsByPath: Record<string, ExtendedInternalSchemaElement>;
|
|
654
685
|
/** The URL, if any, of the resource profile or extension from which the `elements` collection originated. */
|
|
655
686
|
profileUrl: string | undefined;
|
|
656
687
|
/** Whether debug logging is enabled */
|
|
657
688
|
debugMode: boolean;
|
|
689
|
+
/** The `AccessPolicyResource` provided, if any, used to determine hidden and readonly elements. */
|
|
690
|
+
accessPolicyResource?: AccessPolicyResource;
|
|
691
|
+
/**
|
|
692
|
+
* Used to get an `ExtendedElementProperties` object for an element at a given path. This
|
|
693
|
+
* is primarily useful when working with elements not included in `InternalTypeSchema.elements`
|
|
694
|
+
* as is the case for nested elements that have not been modified by a profile or extension,
|
|
695
|
+
* e.g. Patient.name.family.
|
|
696
|
+
*
|
|
697
|
+
* This function does not attempt to determine if the input `path` is actually an element in the
|
|
698
|
+
* resource. When a syntactically correct path to a nonexistent element, e.g. Patient.foobar, is provided,
|
|
699
|
+
* a `ExtendedElementProperties` object with default values is returned.
|
|
700
|
+
*
|
|
701
|
+
* @param path - The full path to an element in the resource, e.g. Patient.name.family
|
|
702
|
+
* @returns An `ExtendedElementProperties` object with `readonly` and `hidden` properties for the
|
|
703
|
+
* element at `path`, or `undefined` if the input path is malformed.
|
|
704
|
+
*/
|
|
705
|
+
getExtendedProps(path: string): ExtendedElementProperties | undefined;
|
|
706
|
+
/** `true` if this is a default/placeholder `ElementsContextType` */
|
|
707
|
+
isDefaultContext?: boolean;
|
|
658
708
|
};
|
|
659
709
|
|
|
660
710
|
export declare interface ElementType {
|
|
@@ -750,6 +800,15 @@ declare class EventTarget_2 {
|
|
|
750
800
|
}
|
|
751
801
|
export { EventTarget_2 as EventTarget }
|
|
752
802
|
|
|
803
|
+
export declare type ExtendedElementProperties = {
|
|
804
|
+
readonly: boolean;
|
|
805
|
+
hidden: boolean;
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
export declare interface ExtendedInternalSchemaElement extends InternalSchemaElement {
|
|
809
|
+
readonly?: boolean;
|
|
810
|
+
}
|
|
811
|
+
|
|
753
812
|
export declare type ExternalSecret<T extends ExternalSecretPrimitive = ExternalSecretPrimitive> = {
|
|
754
813
|
system: ExternalSecretSystem;
|
|
755
814
|
key: string;
|
|
@@ -1390,7 +1449,7 @@ export declare function getExtension(resource: any, ...urls: string[]): Extensio
|
|
|
1390
1449
|
* @param urls - Array of extension URLs. Each entry represents a nested extension.
|
|
1391
1450
|
* @returns The extension value if found; undefined otherwise.
|
|
1392
1451
|
*/
|
|
1393
|
-
export declare function getExtensionValue(resource: any, ...urls: string[]):
|
|
1452
|
+
export declare function getExtensionValue(resource: any, ...urls: string[]): ExtensionValue | undefined;
|
|
1394
1453
|
|
|
1395
1454
|
/**
|
|
1396
1455
|
* Returns the resource identifier for the given system.
|
|
@@ -1791,6 +1850,8 @@ export declare class Hl7Segment {
|
|
|
1791
1850
|
|
|
1792
1851
|
export declare const HTTP_HL7_ORG = "http://hl7.org";
|
|
1793
1852
|
|
|
1853
|
+
export declare const HTTP_TERMINOLOGY_HL7_ORG = "http://terminology.hl7.org";
|
|
1854
|
+
|
|
1794
1855
|
export declare interface HumanNameFormatOptions {
|
|
1795
1856
|
all?: boolean;
|
|
1796
1857
|
prefix?: boolean;
|
|
@@ -1829,7 +1890,7 @@ export declare interface IncludeTarget {
|
|
|
1829
1890
|
resourceType: string;
|
|
1830
1891
|
searchParam: string;
|
|
1831
1892
|
targetType?: string;
|
|
1832
|
-
modifier?:
|
|
1893
|
+
modifier?: 'iterate';
|
|
1833
1894
|
}
|
|
1834
1895
|
|
|
1835
1896
|
/**
|
|
@@ -2036,6 +2097,8 @@ export declare function isEmpty(v: unknown): boolean;
|
|
|
2036
2097
|
*/
|
|
2037
2098
|
export declare function isFhircastResourceType(resourceType: FhircastResourceType): boolean;
|
|
2038
2099
|
|
|
2100
|
+
export declare function isFhirCriteriaMet(subscription: Subscription, currentResource: Resource, getPreviousResource: (currentResource: Resource) => Promise<Resource | undefined>): Promise<boolean>;
|
|
2101
|
+
|
|
2039
2102
|
export declare function isGone(outcome: OperationOutcome): boolean;
|
|
2040
2103
|
|
|
2041
2104
|
/**
|
|
@@ -2233,7 +2296,11 @@ export declare class Logger {
|
|
|
2233
2296
|
readonly write: (msg: string) => void;
|
|
2234
2297
|
readonly metadata: Record<string, any>;
|
|
2235
2298
|
level: LogLevel;
|
|
2236
|
-
|
|
2299
|
+
readonly options?: LoggerOptions | undefined;
|
|
2300
|
+
readonly prefix?: string;
|
|
2301
|
+
constructor(write: (msg: string) => void, metadata?: Record<string, any>, level?: LogLevel, options?: LoggerOptions | undefined);
|
|
2302
|
+
clone(override?: LoggerConfigOverride): Logger;
|
|
2303
|
+
private getLoggerConfig;
|
|
2237
2304
|
error(msg: string, data?: Record<string, any>): void;
|
|
2238
2305
|
warn(msg: string, data?: Record<string, any>): void;
|
|
2239
2306
|
info(msg: string, data?: Record<string, any>): void;
|
|
@@ -2241,6 +2308,19 @@ export declare class Logger {
|
|
|
2241
2308
|
log(level: LogLevel, msg: string, data?: Record<string, any>): void;
|
|
2242
2309
|
}
|
|
2243
2310
|
|
|
2311
|
+
export declare interface LoggerConfig {
|
|
2312
|
+
write: (msg: string) => void;
|
|
2313
|
+
metadata: Record<string, any>;
|
|
2314
|
+
level: LogLevel;
|
|
2315
|
+
options?: LoggerOptions;
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
export declare type LoggerConfigOverride = Partial<LoggerConfig>;
|
|
2319
|
+
|
|
2320
|
+
export declare interface LoggerOptions {
|
|
2321
|
+
prefix?: string;
|
|
2322
|
+
}
|
|
2323
|
+
|
|
2244
2324
|
export declare interface LoginAuthenticationResponse {
|
|
2245
2325
|
readonly login: string;
|
|
2246
2326
|
readonly mfaRequired?: boolean;
|
|
@@ -4154,10 +4234,12 @@ export declare interface MedplumInfraConfig {
|
|
|
4154
4234
|
rdsReaderInstanceType?: string;
|
|
4155
4235
|
rdsProxyEnabled?: boolean;
|
|
4156
4236
|
cacheNodeType?: string;
|
|
4237
|
+
cacheSecurityGroupId?: string;
|
|
4157
4238
|
desiredServerCount: number;
|
|
4158
4239
|
serverImage: string;
|
|
4159
4240
|
serverMemory: number;
|
|
4160
4241
|
serverCpu: number;
|
|
4242
|
+
loadBalancerSecurityGroupId?: string;
|
|
4161
4243
|
loadBalancerLoggingBucket?: string;
|
|
4162
4244
|
loadBalancerLoggingPrefix?: string;
|
|
4163
4245
|
clamscanEnabled: boolean;
|
|
@@ -4266,10 +4348,12 @@ export declare interface MedplumSourceInfraConfig {
|
|
|
4266
4348
|
rdsReaderInstanceType?: ValueOrExternalSecret<string>;
|
|
4267
4349
|
rdsProxyEnabled?: ValueOrExternalSecret<boolean>;
|
|
4268
4350
|
cacheNodeType?: ValueOrExternalSecret<string>;
|
|
4351
|
+
cacheSecurityGroupId?: ValueOrExternalSecret<string>;
|
|
4269
4352
|
desiredServerCount: ValueOrExternalSecret<number>;
|
|
4270
4353
|
serverImage: ValueOrExternalSecret<string>;
|
|
4271
4354
|
serverMemory: ValueOrExternalSecret<number>;
|
|
4272
4355
|
serverCpu: ValueOrExternalSecret<number>;
|
|
4356
|
+
loadBalancerSecurityGroupId?: ValueOrExternalSecret<string>;
|
|
4273
4357
|
loadBalancerLoggingBucket?: ValueOrExternalSecret<string>;
|
|
4274
4358
|
loadBalancerLoggingPrefix?: ValueOrExternalSecret<string>;
|
|
4275
4359
|
clamscanEnabled: ValueOrExternalSecret<boolean>;
|
|
@@ -4510,6 +4594,7 @@ export declare enum Operator {
|
|
|
4510
4594
|
NOT_IN = "not-in",
|
|
4511
4595
|
OF_TYPE = "of-type",
|
|
4512
4596
|
MISSING = "missing",
|
|
4597
|
+
PRESENT = "present",
|
|
4513
4598
|
IDENTIFIER = "identifier",
|
|
4514
4599
|
ITERATE = "iterate"
|
|
4515
4600
|
}
|
|
@@ -4936,6 +5021,14 @@ export declare class ReadablePromise<T> implements Promise<T> {
|
|
|
4936
5021
|
*/
|
|
4937
5022
|
export declare function removeDuplicates(arr: TypedValue[]): TypedValue[];
|
|
4938
5023
|
|
|
5024
|
+
/**
|
|
5025
|
+
* Removes the supplied profileUrl from the resource.meta.profile if it is present
|
|
5026
|
+
* @param resource - A FHIR resource
|
|
5027
|
+
* @param profileUrl - The profile URL to remove
|
|
5028
|
+
* @returns The resource
|
|
5029
|
+
*/
|
|
5030
|
+
export declare function removeProfileFromResource<T extends Resource = Resource>(resource: T, profileUrl: string): T;
|
|
5031
|
+
|
|
4939
5032
|
/**
|
|
4940
5033
|
* Topologically sorts a `batch` or `transaction` bundle to improve reference resolution.
|
|
4941
5034
|
* The bundle is sorted such that a resource is created _before_ references to that resource appear in the bundle.
|
|
@@ -4969,6 +5062,16 @@ export declare type ResourceArray<T extends Resource = Resource> = T[] & {
|
|
|
4969
5062
|
bundle: Bundle<T>;
|
|
4970
5063
|
};
|
|
4971
5064
|
|
|
5065
|
+
export declare type ResourceMatchesSubscriptionCriteria = {
|
|
5066
|
+
resource: Resource;
|
|
5067
|
+
subscription: Subscription;
|
|
5068
|
+
context: BackgroundJobContext;
|
|
5069
|
+
logger?: Logger;
|
|
5070
|
+
getPreviousResource: (currentResource: Resource) => Promise<Resource | undefined>;
|
|
5071
|
+
};
|
|
5072
|
+
|
|
5073
|
+
export declare function resourceMatchesSubscriptionCriteria({ resource, subscription, context, getPreviousResource, logger, }: ResourceMatchesSubscriptionCriteria): Promise<boolean>;
|
|
5074
|
+
|
|
4972
5075
|
export declare interface ResourceVisitor {
|
|
4973
5076
|
onEnterObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
|
|
4974
5077
|
onExitObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => void;
|
|
@@ -5093,15 +5196,10 @@ export declare function singleton(collection: TypedValue[], type?: string): Type
|
|
|
5093
5196
|
*/
|
|
5094
5197
|
export declare const sleep: (ms: number) => Promise<void>;
|
|
5095
5198
|
|
|
5096
|
-
export declare interface SliceDefinition {
|
|
5199
|
+
export declare interface SliceDefinition extends Omit<InternalSchemaElement, 'slicing'> {
|
|
5097
5200
|
name: string;
|
|
5098
|
-
path: string;
|
|
5099
5201
|
definition?: string;
|
|
5100
|
-
type?: ElementType[];
|
|
5101
5202
|
elements: Record<string, InternalSchemaElement>;
|
|
5102
|
-
min: number;
|
|
5103
|
-
max: number;
|
|
5104
|
-
binding?: ElementDefinitionBinding;
|
|
5105
5203
|
}
|
|
5106
5204
|
|
|
5107
5205
|
export declare type SliceDefinitionWithTypes = SliceDefinition & {
|
|
@@ -5149,6 +5247,17 @@ export declare function sortStringArray(array: string[]): string[];
|
|
|
5149
5247
|
*/
|
|
5150
5248
|
export declare function splitN(str: string, delim: string, n: number): string[];
|
|
5151
5249
|
|
|
5250
|
+
/**
|
|
5251
|
+
* Splits a FHIR search value on commas.
|
|
5252
|
+
* Respects backslash escape.
|
|
5253
|
+
*
|
|
5254
|
+
* See: https://hl7.org/fhir/r4/search.html#escaping
|
|
5255
|
+
*
|
|
5256
|
+
* @param input - The FHIR search value to split.
|
|
5257
|
+
* @returns The individual search values.
|
|
5258
|
+
*/
|
|
5259
|
+
export declare function splitSearchOnComma(input: string): string[];
|
|
5260
|
+
|
|
5152
5261
|
/**
|
|
5153
5262
|
* Reads data from a Readable stream and returns a Promise that resolves with a Buffer containing all the data.
|
|
5154
5263
|
* @param stream - The Readable stream to read from.
|