@medplum/core 3.1.4 → 3.1.6

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.
@@ -82,6 +82,15 @@ export declare enum AccessPolicyInteraction {
82
82
  OPERATION = "operation"
83
83
  }
84
84
 
85
+ /**
86
+ * Adds the supplied profileUrl to the resource.meta.profile if it is not already
87
+ * specified
88
+ * @param resource - A FHIR resource
89
+ * @param profileUrl - The profile URL to add
90
+ * @returns The resource
91
+ */
92
+ export declare function addProfileToResource<T extends Resource = Resource>(resource: T, profileUrl: string): T;
93
+
85
94
  export declare interface AddressFormatOptions {
86
95
  all?: boolean;
87
96
  use?: boolean;
@@ -111,7 +120,20 @@ export declare interface AgentHeartbeatResponse extends BaseAgentMessage {
111
120
  version: string;
112
121
  }
113
122
 
114
- export declare type AgentMessage = AgentError | AgentConnectRequest | AgentConnectResponse | AgentHeartbeatRequest | AgentHeartbeatResponse | AgentTransmitRequest | AgentTransmitResponse;
123
+ export declare type AgentMessage = AgentRequestMessage | AgentResponseMessage;
124
+
125
+ export declare interface AgentReloadConfigRequest extends BaseAgentMessage {
126
+ type: 'agent:reloadconfig:request';
127
+ }
128
+
129
+ export declare interface AgentReloadConfigResponse extends BaseAgentMessage {
130
+ type: 'agent:reloadconfig:response';
131
+ statusCode: number;
132
+ }
133
+
134
+ export declare type AgentRequestMessage = AgentConnectRequest | AgentHeartbeatRequest | AgentTransmitRequest | AgentReloadConfigRequest;
135
+
136
+ export declare type AgentResponseMessage = AgentConnectResponse | AgentHeartbeatResponse | AgentTransmitResponse | AgentReloadConfigResponse | AgentError;
115
137
 
116
138
  export declare interface AgentTransmitRequest extends BaseAgentRequestMessage {
117
139
  type: 'agent:transmit:request';
@@ -564,7 +586,7 @@ export declare function createProcessingIssue(expression: string, message: strin
564
586
 
565
587
  /**
566
588
  * Creates a reference resource.
567
- * @param resource - The FHIR reesource.
589
+ * @param resource - The FHIR resource.
568
590
  * @returns A reference resource.
569
591
  */
570
592
  export declare function createReference<T extends Resource>(resource: T): Reference<T>;
@@ -1791,6 +1813,8 @@ export declare class Hl7Segment {
1791
1813
 
1792
1814
  export declare const HTTP_HL7_ORG = "http://hl7.org";
1793
1815
 
1816
+ export declare const HTTP_TERMINOLOGY_HL7_ORG = "http://terminology.hl7.org";
1817
+
1794
1818
  export declare interface HumanNameFormatOptions {
1795
1819
  all?: boolean;
1796
1820
  prefix?: boolean;
@@ -2233,7 +2257,11 @@ export declare class Logger {
2233
2257
  readonly write: (msg: string) => void;
2234
2258
  readonly metadata: Record<string, any>;
2235
2259
  level: LogLevel;
2236
- constructor(write: (msg: string) => void, metadata?: Record<string, any>, level?: LogLevel);
2260
+ readonly options?: LoggerOptions | undefined;
2261
+ readonly prefix?: string;
2262
+ constructor(write: (msg: string) => void, metadata?: Record<string, any>, level?: LogLevel, options?: LoggerOptions | undefined);
2263
+ clone(override?: LoggerConfigOverride): Logger;
2264
+ private getLoggerConfig;
2237
2265
  error(msg: string, data?: Record<string, any>): void;
2238
2266
  warn(msg: string, data?: Record<string, any>): void;
2239
2267
  info(msg: string, data?: Record<string, any>): void;
@@ -2241,6 +2269,19 @@ export declare class Logger {
2241
2269
  log(level: LogLevel, msg: string, data?: Record<string, any>): void;
2242
2270
  }
2243
2271
 
2272
+ export declare interface LoggerConfig {
2273
+ write: (msg: string) => void;
2274
+ metadata: Record<string, any>;
2275
+ level: LogLevel;
2276
+ options?: LoggerOptions;
2277
+ }
2278
+
2279
+ export declare type LoggerConfigOverride = Partial<LoggerConfig>;
2280
+
2281
+ export declare interface LoggerOptions {
2282
+ prefix?: string;
2283
+ }
2284
+
2244
2285
  export declare interface LoginAuthenticationResponse {
2245
2286
  readonly login: string;
2246
2287
  readonly mfaRequired?: boolean;
@@ -4510,6 +4551,7 @@ export declare enum Operator {
4510
4551
  NOT_IN = "not-in",
4511
4552
  OF_TYPE = "of-type",
4512
4553
  MISSING = "missing",
4554
+ PRESENT = "present",
4513
4555
  IDENTIFIER = "identifier",
4514
4556
  ITERATE = "iterate"
4515
4557
  }
@@ -4936,6 +4978,14 @@ export declare class ReadablePromise<T> implements Promise<T> {
4936
4978
  */
4937
4979
  export declare function removeDuplicates(arr: TypedValue[]): TypedValue[];
4938
4980
 
4981
+ /**
4982
+ * Removes the supplied profileUrl from the resource.meta.profile if it is present
4983
+ * @param resource - A FHIR resource
4984
+ * @param profileUrl - The profile URL to remove
4985
+ * @returns The resource
4986
+ */
4987
+ export declare function removeProfileFromResource<T extends Resource = Resource>(resource: T, profileUrl: string): T;
4988
+
4939
4989
  /**
4940
4990
  * Topologically sorts a `batch` or `transaction` bundle to improve reference resolution.
4941
4991
  * The bundle is sorted such that a resource is created _before_ references to that resource appear in the bundle.
@@ -5093,15 +5143,10 @@ export declare function singleton(collection: TypedValue[], type?: string): Type
5093
5143
  */
5094
5144
  export declare const sleep: (ms: number) => Promise<void>;
5095
5145
 
5096
- export declare interface SliceDefinition {
5146
+ export declare interface SliceDefinition extends Omit<InternalSchemaElement, 'slicing'> {
5097
5147
  name: string;
5098
- path: string;
5099
5148
  definition?: string;
5100
- type?: ElementType[];
5101
5149
  elements: Record<string, InternalSchemaElement>;
5102
- min: number;
5103
- max: number;
5104
- binding?: ElementDefinitionBinding;
5105
5150
  }
5106
5151
 
5107
5152
  export declare type SliceDefinitionWithTypes = SliceDefinition & {
@@ -82,6 +82,15 @@ export declare enum AccessPolicyInteraction {
82
82
  OPERATION = "operation"
83
83
  }
84
84
 
85
+ /**
86
+ * Adds the supplied profileUrl to the resource.meta.profile if it is not already
87
+ * specified
88
+ * @param resource - A FHIR resource
89
+ * @param profileUrl - The profile URL to add
90
+ * @returns The resource
91
+ */
92
+ export declare function addProfileToResource<T extends Resource = Resource>(resource: T, profileUrl: string): T;
93
+
85
94
  export declare interface AddressFormatOptions {
86
95
  all?: boolean;
87
96
  use?: boolean;
@@ -111,7 +120,20 @@ export declare interface AgentHeartbeatResponse extends BaseAgentMessage {
111
120
  version: string;
112
121
  }
113
122
 
114
- export declare type AgentMessage = AgentError | AgentConnectRequest | AgentConnectResponse | AgentHeartbeatRequest | AgentHeartbeatResponse | AgentTransmitRequest | AgentTransmitResponse;
123
+ export declare type AgentMessage = AgentRequestMessage | AgentResponseMessage;
124
+
125
+ export declare interface AgentReloadConfigRequest extends BaseAgentMessage {
126
+ type: 'agent:reloadconfig:request';
127
+ }
128
+
129
+ export declare interface AgentReloadConfigResponse extends BaseAgentMessage {
130
+ type: 'agent:reloadconfig:response';
131
+ statusCode: number;
132
+ }
133
+
134
+ export declare type AgentRequestMessage = AgentConnectRequest | AgentHeartbeatRequest | AgentTransmitRequest | AgentReloadConfigRequest;
135
+
136
+ export declare type AgentResponseMessage = AgentConnectResponse | AgentHeartbeatResponse | AgentTransmitResponse | AgentReloadConfigResponse | AgentError;
115
137
 
116
138
  export declare interface AgentTransmitRequest extends BaseAgentRequestMessage {
117
139
  type: 'agent:transmit:request';
@@ -564,7 +586,7 @@ export declare function createProcessingIssue(expression: string, message: strin
564
586
 
565
587
  /**
566
588
  * Creates a reference resource.
567
- * @param resource - The FHIR reesource.
589
+ * @param resource - The FHIR resource.
568
590
  * @returns A reference resource.
569
591
  */
570
592
  export declare function createReference<T extends Resource>(resource: T): Reference<T>;
@@ -1791,6 +1813,8 @@ export declare class Hl7Segment {
1791
1813
 
1792
1814
  export declare const HTTP_HL7_ORG = "http://hl7.org";
1793
1815
 
1816
+ export declare const HTTP_TERMINOLOGY_HL7_ORG = "http://terminology.hl7.org";
1817
+
1794
1818
  export declare interface HumanNameFormatOptions {
1795
1819
  all?: boolean;
1796
1820
  prefix?: boolean;
@@ -2233,7 +2257,11 @@ export declare class Logger {
2233
2257
  readonly write: (msg: string) => void;
2234
2258
  readonly metadata: Record<string, any>;
2235
2259
  level: LogLevel;
2236
- constructor(write: (msg: string) => void, metadata?: Record<string, any>, level?: LogLevel);
2260
+ readonly options?: LoggerOptions | undefined;
2261
+ readonly prefix?: string;
2262
+ constructor(write: (msg: string) => void, metadata?: Record<string, any>, level?: LogLevel, options?: LoggerOptions | undefined);
2263
+ clone(override?: LoggerConfigOverride): Logger;
2264
+ private getLoggerConfig;
2237
2265
  error(msg: string, data?: Record<string, any>): void;
2238
2266
  warn(msg: string, data?: Record<string, any>): void;
2239
2267
  info(msg: string, data?: Record<string, any>): void;
@@ -2241,6 +2269,19 @@ export declare class Logger {
2241
2269
  log(level: LogLevel, msg: string, data?: Record<string, any>): void;
2242
2270
  }
2243
2271
 
2272
+ export declare interface LoggerConfig {
2273
+ write: (msg: string) => void;
2274
+ metadata: Record<string, any>;
2275
+ level: LogLevel;
2276
+ options?: LoggerOptions;
2277
+ }
2278
+
2279
+ export declare type LoggerConfigOverride = Partial<LoggerConfig>;
2280
+
2281
+ export declare interface LoggerOptions {
2282
+ prefix?: string;
2283
+ }
2284
+
2244
2285
  export declare interface LoginAuthenticationResponse {
2245
2286
  readonly login: string;
2246
2287
  readonly mfaRequired?: boolean;
@@ -4510,6 +4551,7 @@ export declare enum Operator {
4510
4551
  NOT_IN = "not-in",
4511
4552
  OF_TYPE = "of-type",
4512
4553
  MISSING = "missing",
4554
+ PRESENT = "present",
4513
4555
  IDENTIFIER = "identifier",
4514
4556
  ITERATE = "iterate"
4515
4557
  }
@@ -4936,6 +4978,14 @@ export declare class ReadablePromise<T> implements Promise<T> {
4936
4978
  */
4937
4979
  export declare function removeDuplicates(arr: TypedValue[]): TypedValue[];
4938
4980
 
4981
+ /**
4982
+ * Removes the supplied profileUrl from the resource.meta.profile if it is present
4983
+ * @param resource - A FHIR resource
4984
+ * @param profileUrl - The profile URL to remove
4985
+ * @returns The resource
4986
+ */
4987
+ export declare function removeProfileFromResource<T extends Resource = Resource>(resource: T, profileUrl: string): T;
4988
+
4939
4989
  /**
4940
4990
  * Topologically sorts a `batch` or `transaction` bundle to improve reference resolution.
4941
4991
  * The bundle is sorted such that a resource is created _before_ references to that resource appear in the bundle.
@@ -5093,15 +5143,10 @@ export declare function singleton(collection: TypedValue[], type?: string): Type
5093
5143
  */
5094
5144
  export declare const sleep: (ms: number) => Promise<void>;
5095
5145
 
5096
- export declare interface SliceDefinition {
5146
+ export declare interface SliceDefinition extends Omit<InternalSchemaElement, 'slicing'> {
5097
5147
  name: string;
5098
- path: string;
5099
5148
  definition?: string;
5100
- type?: ElementType[];
5101
5149
  elements: Record<string, InternalSchemaElement>;
5102
- min: number;
5103
- max: number;
5104
- binding?: ElementDefinitionBinding;
5105
5150
  }
5106
5151
 
5107
5152
  export declare type SliceDefinitionWithTypes = SliceDefinition & {