@medplum/core 2.2.4 → 2.2.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.
- package/dist/cjs/index.cjs +4 -4
- package/dist/cjs/index.cjs.map +4 -4
- package/dist/cjs/index.d.ts +77 -11
- package/dist/esm/index.d.ts +77 -11
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/index.mjs.map +4 -4
- package/package.json +2 -2
package/dist/cjs/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { Bundle } from '@medplum/fhirtypes';
|
|
|
11
11
|
import { CodeableConcept } from '@medplum/fhirtypes';
|
|
12
12
|
import { Coding } from '@medplum/fhirtypes';
|
|
13
13
|
import { Communication } from '@medplum/fhirtypes';
|
|
14
|
+
import { ConceptMap } from '@medplum/fhirtypes';
|
|
14
15
|
import type { CustomTableLayout } from 'pdfmake/interfaces';
|
|
15
16
|
import { Device } from '@medplum/fhirtypes';
|
|
16
17
|
import { ElementDefinition } from '@medplum/fhirtypes';
|
|
@@ -100,7 +101,15 @@ export declare interface AgentError extends BaseAgentMessage {
|
|
|
100
101
|
body: string;
|
|
101
102
|
}
|
|
102
103
|
|
|
103
|
-
export declare
|
|
104
|
+
export declare interface AgentHeartbeatRequest extends BaseAgentRequestMessage {
|
|
105
|
+
type: 'agent:heartbeat:request';
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export declare interface AgentHeartbeatResponse extends BaseAgentMessage {
|
|
109
|
+
type: 'agent:heartbeat:response';
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export declare type AgentMessage = AgentError | AgentConnectRequest | AgentConnectResponse | AgentHeartbeatRequest | AgentHeartbeatResponse | AgentTransmitRequest | AgentTransmitResponse;
|
|
104
113
|
|
|
105
114
|
export declare interface AgentTransmitRequest extends BaseAgentRequestMessage {
|
|
106
115
|
type: 'agent:transmit:request';
|
|
@@ -253,6 +262,10 @@ export declare function calculateAge(birthDateStr: string, endDateStr?: string):
|
|
|
253
262
|
*/
|
|
254
263
|
export declare function calculateAgeString(birthDateStr: string, endDateStr?: string): string | undefined;
|
|
255
264
|
|
|
265
|
+
export declare type CanBePopulated = {
|
|
266
|
+
length: number;
|
|
267
|
+
} | object;
|
|
268
|
+
|
|
256
269
|
/**
|
|
257
270
|
* Determines if the current user can read the specified resource type.
|
|
258
271
|
* @param accessPolicy - The access policy.
|
|
@@ -325,6 +338,29 @@ export declare class ConcatAtom extends InfixOperatorAtom {
|
|
|
325
338
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
326
339
|
}
|
|
327
340
|
|
|
341
|
+
export declare function conceptMapTranslate(map: ConceptMap, params: ConceptMapTranslateParameters): ConceptMapTranslateOutput;
|
|
342
|
+
|
|
343
|
+
export declare interface ConceptMapTranslateMatch {
|
|
344
|
+
equivalence?: string;
|
|
345
|
+
concept?: Coding;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export declare interface ConceptMapTranslateOutput {
|
|
349
|
+
result: boolean;
|
|
350
|
+
message?: string;
|
|
351
|
+
match?: ConceptMapTranslateMatch[];
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export declare interface ConceptMapTranslateParameters {
|
|
355
|
+
url?: string;
|
|
356
|
+
source?: string;
|
|
357
|
+
code?: string;
|
|
358
|
+
system?: string;
|
|
359
|
+
coding?: Coding;
|
|
360
|
+
codeableConcept?: CodeableConcept;
|
|
361
|
+
targetsystem?: string;
|
|
362
|
+
}
|
|
363
|
+
|
|
328
364
|
export declare interface Constraint {
|
|
329
365
|
key: string;
|
|
330
366
|
severity: 'error' | 'warning';
|
|
@@ -389,8 +425,6 @@ export declare function createConstraintIssue(expression: string, constraint: Co
|
|
|
389
425
|
|
|
390
426
|
export declare const created: OperationOutcome;
|
|
391
427
|
|
|
392
|
-
export declare function createDeferredPromise(): DeferredPromise;
|
|
393
|
-
|
|
394
428
|
/**
|
|
395
429
|
* Creates a serializable JSON payload for the `FHIRcast` protocol
|
|
396
430
|
*
|
|
@@ -475,12 +509,6 @@ export declare const DEFAULT_ACCEPT: string;
|
|
|
475
509
|
|
|
476
510
|
export declare const DEFAULT_SEARCH_COUNT = 20;
|
|
477
511
|
|
|
478
|
-
export declare type DeferredPromise = {
|
|
479
|
-
promise: Promise<void>;
|
|
480
|
-
resolve: () => void;
|
|
481
|
-
reject: (err: Error) => void;
|
|
482
|
-
};
|
|
483
|
-
|
|
484
512
|
export declare class DotAtom extends InfixOperatorAtom {
|
|
485
513
|
constructor(left: Atom, right: Atom);
|
|
486
514
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
@@ -1233,7 +1261,7 @@ export declare function getNestedProperty(value: TypedValue, key: string): (Type
|
|
|
1233
1261
|
export declare function getPathDisplayName(path: string): string;
|
|
1234
1262
|
|
|
1235
1263
|
/**
|
|
1236
|
-
*
|
|
1264
|
+
* Returns a human friendly display name for a FHIR element property or slice name
|
|
1237
1265
|
* @param propertyName - The FHIR element property or slice name
|
|
1238
1266
|
* @returns The best guess of the display name.
|
|
1239
1267
|
*/
|
|
@@ -1560,6 +1588,8 @@ export declare class Hl7Segment {
|
|
|
1560
1588
|
static parse(text: string, context?: Hl7Context): Hl7Segment;
|
|
1561
1589
|
}
|
|
1562
1590
|
|
|
1591
|
+
export declare const HTTP_HL7_ORG = "http://hl7.org";
|
|
1592
|
+
|
|
1563
1593
|
export declare interface HumanNameFormatOptions {
|
|
1564
1594
|
all?: boolean;
|
|
1565
1595
|
prefix?: boolean;
|
|
@@ -1720,6 +1750,7 @@ export declare interface InviteRequest {
|
|
|
1720
1750
|
password?: string;
|
|
1721
1751
|
sendEmail?: boolean;
|
|
1722
1752
|
membership?: Partial<ProjectMembership>;
|
|
1753
|
+
upsert?: boolean;
|
|
1723
1754
|
/** @deprecated Use membership.accessPolicy instead. */
|
|
1724
1755
|
accessPolicy?: Reference<AccessPolicy>;
|
|
1725
1756
|
/** @deprecated Use membership.access instead. */
|
|
@@ -1748,7 +1779,7 @@ export declare function isDataTypeLoaded(type: string): boolean;
|
|
|
1748
1779
|
* @param v - Any value.
|
|
1749
1780
|
* @returns True if the value is an empty string or an empty object.
|
|
1750
1781
|
*/
|
|
1751
|
-
export declare function isEmpty(v:
|
|
1782
|
+
export declare function isEmpty(v: unknown): boolean;
|
|
1752
1783
|
|
|
1753
1784
|
/**
|
|
1754
1785
|
* Checks if a `ResourceType` can be used in a `FHIRcast` context.
|
|
@@ -1797,6 +1828,15 @@ export declare function isOperationOutcome(value: unknown): value is OperationOu
|
|
|
1797
1828
|
*/
|
|
1798
1829
|
export declare function isPeriod(input: unknown): input is Period;
|
|
1799
1830
|
|
|
1831
|
+
/**
|
|
1832
|
+
* Returns true if the value is a non-empty string, an object with a length property greater than zero, or a non-empty object
|
|
1833
|
+
* @param arg - Any value
|
|
1834
|
+
* @returns True if the value is a non-empty string, an object with a length property greater than zero, or a non-empty object
|
|
1835
|
+
*/
|
|
1836
|
+
export declare function isPopulated<T extends {
|
|
1837
|
+
length: number;
|
|
1838
|
+
} | object>(arg: CanBePopulated | undefined | null): arg is T;
|
|
1839
|
+
|
|
1800
1840
|
export declare function isProfileLoaded(profileUrl: string): boolean;
|
|
1801
1841
|
|
|
1802
1842
|
/**
|
|
@@ -3767,6 +3807,20 @@ export declare class MemoryStorage implements Storage {
|
|
|
3767
3807
|
key(index: number): string | null;
|
|
3768
3808
|
}
|
|
3769
3809
|
|
|
3810
|
+
/**
|
|
3811
|
+
* The MockAsyncClientStorage class is a mock implementation of the ClientStorage class.
|
|
3812
|
+
* This can be used for testing async initialization of the MedplumClient.
|
|
3813
|
+
*/
|
|
3814
|
+
export declare class MockAsyncClientStorage extends ClientStorage implements IClientStorage {
|
|
3815
|
+
private initialized;
|
|
3816
|
+
private initPromise;
|
|
3817
|
+
private initResolve;
|
|
3818
|
+
constructor();
|
|
3819
|
+
setInitialized(): void;
|
|
3820
|
+
getInitPromise(): Promise<void>;
|
|
3821
|
+
get isInitialized(): boolean;
|
|
3822
|
+
}
|
|
3823
|
+
|
|
3770
3824
|
export declare interface NewPatientRequest {
|
|
3771
3825
|
readonly login: string;
|
|
3772
3826
|
readonly projectId: string;
|
|
@@ -4519,6 +4573,18 @@ export declare function stringify(value: any, pretty?: boolean): string;
|
|
|
4519
4573
|
*/
|
|
4520
4574
|
export declare function stringifyTypedValue(v: TypedValue): string;
|
|
4521
4575
|
|
|
4576
|
+
/**
|
|
4577
|
+
* Transforms input values using a FHIR StructureMap.
|
|
4578
|
+
*
|
|
4579
|
+
* See: https://www.hl7.org/fhir/mapping-language.html
|
|
4580
|
+
*
|
|
4581
|
+
* @param structureMap - The StructureMap to transform.
|
|
4582
|
+
* @param input - The input values.
|
|
4583
|
+
* @param loader - Optional loader function for loading imported StructureMaps.
|
|
4584
|
+
* @returns The transformed values.
|
|
4585
|
+
*/
|
|
4586
|
+
export declare function structureMapTransform(structureMap: StructureMap, input: TypedValue[], loader?: (url: string) => StructureMap[]): TypedValue[];
|
|
4587
|
+
|
|
4522
4588
|
/**
|
|
4523
4589
|
* A `FHIRcast` subscription request.
|
|
4524
4590
|
*
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { Bundle } from '@medplum/fhirtypes';
|
|
|
11
11
|
import { CodeableConcept } from '@medplum/fhirtypes';
|
|
12
12
|
import { Coding } from '@medplum/fhirtypes';
|
|
13
13
|
import { Communication } from '@medplum/fhirtypes';
|
|
14
|
+
import { ConceptMap } from '@medplum/fhirtypes';
|
|
14
15
|
import type { CustomTableLayout } from 'pdfmake/interfaces';
|
|
15
16
|
import { Device } from '@medplum/fhirtypes';
|
|
16
17
|
import { ElementDefinition } from '@medplum/fhirtypes';
|
|
@@ -100,7 +101,15 @@ export declare interface AgentError extends BaseAgentMessage {
|
|
|
100
101
|
body: string;
|
|
101
102
|
}
|
|
102
103
|
|
|
103
|
-
export declare
|
|
104
|
+
export declare interface AgentHeartbeatRequest extends BaseAgentRequestMessage {
|
|
105
|
+
type: 'agent:heartbeat:request';
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export declare interface AgentHeartbeatResponse extends BaseAgentMessage {
|
|
109
|
+
type: 'agent:heartbeat:response';
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export declare type AgentMessage = AgentError | AgentConnectRequest | AgentConnectResponse | AgentHeartbeatRequest | AgentHeartbeatResponse | AgentTransmitRequest | AgentTransmitResponse;
|
|
104
113
|
|
|
105
114
|
export declare interface AgentTransmitRequest extends BaseAgentRequestMessage {
|
|
106
115
|
type: 'agent:transmit:request';
|
|
@@ -253,6 +262,10 @@ export declare function calculateAge(birthDateStr: string, endDateStr?: string):
|
|
|
253
262
|
*/
|
|
254
263
|
export declare function calculateAgeString(birthDateStr: string, endDateStr?: string): string | undefined;
|
|
255
264
|
|
|
265
|
+
export declare type CanBePopulated = {
|
|
266
|
+
length: number;
|
|
267
|
+
} | object;
|
|
268
|
+
|
|
256
269
|
/**
|
|
257
270
|
* Determines if the current user can read the specified resource type.
|
|
258
271
|
* @param accessPolicy - The access policy.
|
|
@@ -325,6 +338,29 @@ export declare class ConcatAtom extends InfixOperatorAtom {
|
|
|
325
338
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
326
339
|
}
|
|
327
340
|
|
|
341
|
+
export declare function conceptMapTranslate(map: ConceptMap, params: ConceptMapTranslateParameters): ConceptMapTranslateOutput;
|
|
342
|
+
|
|
343
|
+
export declare interface ConceptMapTranslateMatch {
|
|
344
|
+
equivalence?: string;
|
|
345
|
+
concept?: Coding;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export declare interface ConceptMapTranslateOutput {
|
|
349
|
+
result: boolean;
|
|
350
|
+
message?: string;
|
|
351
|
+
match?: ConceptMapTranslateMatch[];
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export declare interface ConceptMapTranslateParameters {
|
|
355
|
+
url?: string;
|
|
356
|
+
source?: string;
|
|
357
|
+
code?: string;
|
|
358
|
+
system?: string;
|
|
359
|
+
coding?: Coding;
|
|
360
|
+
codeableConcept?: CodeableConcept;
|
|
361
|
+
targetsystem?: string;
|
|
362
|
+
}
|
|
363
|
+
|
|
328
364
|
export declare interface Constraint {
|
|
329
365
|
key: string;
|
|
330
366
|
severity: 'error' | 'warning';
|
|
@@ -389,8 +425,6 @@ export declare function createConstraintIssue(expression: string, constraint: Co
|
|
|
389
425
|
|
|
390
426
|
export declare const created: OperationOutcome;
|
|
391
427
|
|
|
392
|
-
export declare function createDeferredPromise(): DeferredPromise;
|
|
393
|
-
|
|
394
428
|
/**
|
|
395
429
|
* Creates a serializable JSON payload for the `FHIRcast` protocol
|
|
396
430
|
*
|
|
@@ -475,12 +509,6 @@ export declare const DEFAULT_ACCEPT: string;
|
|
|
475
509
|
|
|
476
510
|
export declare const DEFAULT_SEARCH_COUNT = 20;
|
|
477
511
|
|
|
478
|
-
export declare type DeferredPromise = {
|
|
479
|
-
promise: Promise<void>;
|
|
480
|
-
resolve: () => void;
|
|
481
|
-
reject: (err: Error) => void;
|
|
482
|
-
};
|
|
483
|
-
|
|
484
512
|
export declare class DotAtom extends InfixOperatorAtom {
|
|
485
513
|
constructor(left: Atom, right: Atom);
|
|
486
514
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
@@ -1233,7 +1261,7 @@ export declare function getNestedProperty(value: TypedValue, key: string): (Type
|
|
|
1233
1261
|
export declare function getPathDisplayName(path: string): string;
|
|
1234
1262
|
|
|
1235
1263
|
/**
|
|
1236
|
-
*
|
|
1264
|
+
* Returns a human friendly display name for a FHIR element property or slice name
|
|
1237
1265
|
* @param propertyName - The FHIR element property or slice name
|
|
1238
1266
|
* @returns The best guess of the display name.
|
|
1239
1267
|
*/
|
|
@@ -1560,6 +1588,8 @@ export declare class Hl7Segment {
|
|
|
1560
1588
|
static parse(text: string, context?: Hl7Context): Hl7Segment;
|
|
1561
1589
|
}
|
|
1562
1590
|
|
|
1591
|
+
export declare const HTTP_HL7_ORG = "http://hl7.org";
|
|
1592
|
+
|
|
1563
1593
|
export declare interface HumanNameFormatOptions {
|
|
1564
1594
|
all?: boolean;
|
|
1565
1595
|
prefix?: boolean;
|
|
@@ -1720,6 +1750,7 @@ export declare interface InviteRequest {
|
|
|
1720
1750
|
password?: string;
|
|
1721
1751
|
sendEmail?: boolean;
|
|
1722
1752
|
membership?: Partial<ProjectMembership>;
|
|
1753
|
+
upsert?: boolean;
|
|
1723
1754
|
/** @deprecated Use membership.accessPolicy instead. */
|
|
1724
1755
|
accessPolicy?: Reference<AccessPolicy>;
|
|
1725
1756
|
/** @deprecated Use membership.access instead. */
|
|
@@ -1748,7 +1779,7 @@ export declare function isDataTypeLoaded(type: string): boolean;
|
|
|
1748
1779
|
* @param v - Any value.
|
|
1749
1780
|
* @returns True if the value is an empty string or an empty object.
|
|
1750
1781
|
*/
|
|
1751
|
-
export declare function isEmpty(v:
|
|
1782
|
+
export declare function isEmpty(v: unknown): boolean;
|
|
1752
1783
|
|
|
1753
1784
|
/**
|
|
1754
1785
|
* Checks if a `ResourceType` can be used in a `FHIRcast` context.
|
|
@@ -1797,6 +1828,15 @@ export declare function isOperationOutcome(value: unknown): value is OperationOu
|
|
|
1797
1828
|
*/
|
|
1798
1829
|
export declare function isPeriod(input: unknown): input is Period;
|
|
1799
1830
|
|
|
1831
|
+
/**
|
|
1832
|
+
* Returns true if the value is a non-empty string, an object with a length property greater than zero, or a non-empty object
|
|
1833
|
+
* @param arg - Any value
|
|
1834
|
+
* @returns True if the value is a non-empty string, an object with a length property greater than zero, or a non-empty object
|
|
1835
|
+
*/
|
|
1836
|
+
export declare function isPopulated<T extends {
|
|
1837
|
+
length: number;
|
|
1838
|
+
} | object>(arg: CanBePopulated | undefined | null): arg is T;
|
|
1839
|
+
|
|
1800
1840
|
export declare function isProfileLoaded(profileUrl: string): boolean;
|
|
1801
1841
|
|
|
1802
1842
|
/**
|
|
@@ -3767,6 +3807,20 @@ export declare class MemoryStorage implements Storage {
|
|
|
3767
3807
|
key(index: number): string | null;
|
|
3768
3808
|
}
|
|
3769
3809
|
|
|
3810
|
+
/**
|
|
3811
|
+
* The MockAsyncClientStorage class is a mock implementation of the ClientStorage class.
|
|
3812
|
+
* This can be used for testing async initialization of the MedplumClient.
|
|
3813
|
+
*/
|
|
3814
|
+
export declare class MockAsyncClientStorage extends ClientStorage implements IClientStorage {
|
|
3815
|
+
private initialized;
|
|
3816
|
+
private initPromise;
|
|
3817
|
+
private initResolve;
|
|
3818
|
+
constructor();
|
|
3819
|
+
setInitialized(): void;
|
|
3820
|
+
getInitPromise(): Promise<void>;
|
|
3821
|
+
get isInitialized(): boolean;
|
|
3822
|
+
}
|
|
3823
|
+
|
|
3770
3824
|
export declare interface NewPatientRequest {
|
|
3771
3825
|
readonly login: string;
|
|
3772
3826
|
readonly projectId: string;
|
|
@@ -4519,6 +4573,18 @@ export declare function stringify(value: any, pretty?: boolean): string;
|
|
|
4519
4573
|
*/
|
|
4520
4574
|
export declare function stringifyTypedValue(v: TypedValue): string;
|
|
4521
4575
|
|
|
4576
|
+
/**
|
|
4577
|
+
* Transforms input values using a FHIR StructureMap.
|
|
4578
|
+
*
|
|
4579
|
+
* See: https://www.hl7.org/fhir/mapping-language.html
|
|
4580
|
+
*
|
|
4581
|
+
* @param structureMap - The StructureMap to transform.
|
|
4582
|
+
* @param input - The input values.
|
|
4583
|
+
* @param loader - Optional loader function for loading imported StructureMaps.
|
|
4584
|
+
* @returns The transformed values.
|
|
4585
|
+
*/
|
|
4586
|
+
export declare function structureMapTransform(structureMap: StructureMap, input: TypedValue[], loader?: (url: string) => StructureMap[]): TypedValue[];
|
|
4587
|
+
|
|
4522
4588
|
/**
|
|
4523
4589
|
* A `FHIRcast` subscription request.
|
|
4524
4590
|
*
|