@medplum/core 2.2.3 → 2.2.5
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 +6 -4
- package/dist/cjs/index.cjs.map +4 -4
- package/dist/cjs/index.d.ts +102 -19
- package/dist/esm/index.d.ts +102 -19
- package/dist/esm/index.mjs +6 -4
- package/dist/esm/index.mjs.map +4 -4
- package/package.json +2 -2
package/dist/cjs/index.d.ts
CHANGED
|
@@ -100,7 +100,15 @@ export declare interface AgentError extends BaseAgentMessage {
|
|
|
100
100
|
body: string;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
export declare
|
|
103
|
+
export declare interface AgentHeartbeatRequest extends BaseAgentRequestMessage {
|
|
104
|
+
type: 'agent:heartbeat:request';
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export declare interface AgentHeartbeatResponse extends BaseAgentMessage {
|
|
108
|
+
type: 'agent:heartbeat:response';
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export declare type AgentMessage = AgentError | AgentConnectRequest | AgentConnectResponse | AgentHeartbeatRequest | AgentHeartbeatResponse | AgentTransmitRequest | AgentTransmitResponse;
|
|
104
112
|
|
|
105
113
|
export declare interface AgentTransmitRequest extends BaseAgentRequestMessage {
|
|
106
114
|
type: 'agent:transmit:request';
|
|
@@ -253,6 +261,10 @@ export declare function calculateAge(birthDateStr: string, endDateStr?: string):
|
|
|
253
261
|
*/
|
|
254
262
|
export declare function calculateAgeString(birthDateStr: string, endDateStr?: string): string | undefined;
|
|
255
263
|
|
|
264
|
+
declare type CanBePopulated = {
|
|
265
|
+
length: number;
|
|
266
|
+
} | object;
|
|
267
|
+
|
|
256
268
|
/**
|
|
257
269
|
* Determines if the current user can read the specified resource type.
|
|
258
270
|
* @param accessPolicy - The access policy.
|
|
@@ -389,8 +401,6 @@ export declare function createConstraintIssue(expression: string, constraint: Co
|
|
|
389
401
|
|
|
390
402
|
export declare const created: OperationOutcome;
|
|
391
403
|
|
|
392
|
-
export declare function createDeferredPromise(): DeferredPromise;
|
|
393
|
-
|
|
394
404
|
/**
|
|
395
405
|
* Creates a serializable JSON payload for the `FHIRcast` protocol
|
|
396
406
|
*
|
|
@@ -425,6 +435,10 @@ export declare type CurrentContext<EventName extends FhircastResourceEventName =
|
|
|
425
435
|
context: FhircastEventContext<EventName>[];
|
|
426
436
|
};
|
|
427
437
|
|
|
438
|
+
export declare type DataTypesMap = {
|
|
439
|
+
[type: string]: InternalTypeSchema;
|
|
440
|
+
};
|
|
441
|
+
|
|
428
442
|
/**
|
|
429
443
|
* Decodes a base64 string.
|
|
430
444
|
* Handles both browser and Node environments.
|
|
@@ -471,12 +485,6 @@ export declare const DEFAULT_ACCEPT: string;
|
|
|
471
485
|
|
|
472
486
|
export declare const DEFAULT_SEARCH_COUNT = 20;
|
|
473
487
|
|
|
474
|
-
export declare type DeferredPromise = {
|
|
475
|
-
promise: Promise<void>;
|
|
476
|
-
resolve: () => void;
|
|
477
|
-
reject: (err: Error) => void;
|
|
478
|
-
};
|
|
479
|
-
|
|
480
488
|
export declare class DotAtom extends InfixOperatorAtom {
|
|
481
489
|
constructor(left: Atom, right: Atom);
|
|
482
490
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
@@ -486,6 +494,7 @@ export declare class DotAtom extends InfixOperatorAtom {
|
|
|
486
494
|
export declare interface ElementType {
|
|
487
495
|
code: string;
|
|
488
496
|
targetProfile?: string[];
|
|
497
|
+
profile?: string[];
|
|
489
498
|
}
|
|
490
499
|
|
|
491
500
|
export declare interface EmailPasswordLoginRequest extends BaseLoginRequest {
|
|
@@ -1121,7 +1130,7 @@ export declare class FunctionAtom implements Atom {
|
|
|
1121
1130
|
*/
|
|
1122
1131
|
export declare function generateId(): string;
|
|
1123
1132
|
|
|
1124
|
-
export declare function getAllDataTypes():
|
|
1133
|
+
export declare function getAllDataTypes(): DataTypesMap;
|
|
1125
1134
|
|
|
1126
1135
|
/**
|
|
1127
1136
|
* Returns an array of questionnaire answers as a map by link ID.
|
|
@@ -1138,7 +1147,7 @@ export declare function getAllQuestionnaireAnswers(response: QuestionnaireRespon
|
|
|
1138
1147
|
*/
|
|
1139
1148
|
export declare function getCodeBySystem(concept: CodeableConcept, system: string): string | undefined;
|
|
1140
1149
|
|
|
1141
|
-
export declare function getDataType(type: string): InternalTypeSchema;
|
|
1150
|
+
export declare function getDataType(type: string, profileUrl?: string): InternalTypeSchema;
|
|
1142
1151
|
|
|
1143
1152
|
/**
|
|
1144
1153
|
* Returns a Date property as a Date.
|
|
@@ -1158,13 +1167,20 @@ export declare function getDisplayString(resource: Resource): string;
|
|
|
1158
1167
|
|
|
1159
1168
|
/**
|
|
1160
1169
|
* Returns an element definition by type and property name.
|
|
1161
|
-
* Handles content references.
|
|
1162
1170
|
* @param typeName - The type name.
|
|
1163
1171
|
* @param propertyName - The property name.
|
|
1164
1172
|
* @returns The element definition if found.
|
|
1165
1173
|
*/
|
|
1166
1174
|
export declare function getElementDefinition(typeName: string, propertyName: string): InternalSchemaElement | undefined;
|
|
1167
1175
|
|
|
1176
|
+
/**
|
|
1177
|
+
* Returns an element definition from mapping of elements by property name.
|
|
1178
|
+
* @param elements - A mapping of property names to element definitions
|
|
1179
|
+
* @param propertyName - The property name of interest
|
|
1180
|
+
* @returns The element definition if found.
|
|
1181
|
+
*/
|
|
1182
|
+
export declare function getElementDefinitionFromElements(elements: InternalTypeSchema['elements'], propertyName: string): InternalSchemaElement | undefined;
|
|
1183
|
+
|
|
1168
1184
|
/**
|
|
1169
1185
|
* Returns the type name for an ElementDefinition.
|
|
1170
1186
|
* @param elementDefinition - The element definition.
|
|
@@ -1218,7 +1234,14 @@ export declare function getNestedProperty(value: TypedValue, key: string): (Type
|
|
|
1218
1234
|
* @param path - The FHIR element definition path.
|
|
1219
1235
|
* @returns The best guess of the display name.
|
|
1220
1236
|
*/
|
|
1221
|
-
export declare function
|
|
1237
|
+
export declare function getPathDisplayName(path: string): string;
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* Returns a human friendly display name for a FHIR element property or slice name
|
|
1241
|
+
* @param propertyName - The FHIR element property or slice name
|
|
1242
|
+
* @returns The best guess of the display name.
|
|
1243
|
+
*/
|
|
1244
|
+
export declare function getPropertyDisplayName(propertyName: string): string;
|
|
1222
1245
|
|
|
1223
1246
|
/**
|
|
1224
1247
|
* Returns all questionnaire answers as a map by link ID.
|
|
@@ -1291,6 +1314,15 @@ export declare function getStatus(outcome: OperationOutcome): number;
|
|
|
1291
1314
|
*/
|
|
1292
1315
|
export declare function getTypedPropertyValue(input: TypedValue, path: string): TypedValue[] | TypedValue | undefined;
|
|
1293
1316
|
|
|
1317
|
+
/**
|
|
1318
|
+
* Returns the value of the property and the property type using a type schema.
|
|
1319
|
+
* @param value - The base context (FHIR resource or backbone element).
|
|
1320
|
+
* @param path - The property path.
|
|
1321
|
+
* @param element - The property element definition.
|
|
1322
|
+
* @returns The value of the property and the property type.
|
|
1323
|
+
*/
|
|
1324
|
+
export declare function getTypedPropertyValueWithSchema(value: TypedValue['value'], path: string, element: InternalSchemaElement): TypedValue[] | TypedValue | undefined;
|
|
1325
|
+
|
|
1294
1326
|
/**
|
|
1295
1327
|
* Global schema singleton.
|
|
1296
1328
|
*/
|
|
@@ -1624,7 +1656,12 @@ export declare function indexSearchParameter(searchParam: SearchParameter): void
|
|
|
1624
1656
|
*/
|
|
1625
1657
|
export declare function indexSearchParameterBundle(bundle: Bundle<SearchParameter>): void;
|
|
1626
1658
|
|
|
1627
|
-
|
|
1659
|
+
/**
|
|
1660
|
+
* Parses and indexes structure definitions
|
|
1661
|
+
* @param bundle - Bundle or array of structure definitions to be parsed and indexed
|
|
1662
|
+
* @param profileUrl - (optional) URL of the profile the SDs are related to
|
|
1663
|
+
*/
|
|
1664
|
+
export declare function indexStructureDefinitionBundle(bundle: StructureDefinition[] | Bundle, profileUrl?: string | undefined): void;
|
|
1628
1665
|
|
|
1629
1666
|
export declare abstract class InfixOperatorAtom implements Atom {
|
|
1630
1667
|
readonly operator: string;
|
|
@@ -1640,9 +1677,9 @@ export declare interface InfixParselet {
|
|
|
1640
1677
|
parse?(parser: Parser, left: Atom, token: Token): Atom;
|
|
1641
1678
|
}
|
|
1642
1679
|
|
|
1643
|
-
export declare function inflateBaseSchema(base: BaseSchema):
|
|
1680
|
+
export declare function inflateBaseSchema(base: BaseSchema): DataTypesMap;
|
|
1644
1681
|
|
|
1645
|
-
export declare function inflateElement(partial: Partial<InternalSchemaElement>): InternalSchemaElement;
|
|
1682
|
+
export declare function inflateElement(path: string, partial: Partial<InternalSchemaElement>): InternalSchemaElement;
|
|
1646
1683
|
|
|
1647
1684
|
export declare function initFhirPathParserBuilder(): ParserBuilder;
|
|
1648
1685
|
|
|
@@ -1665,8 +1702,10 @@ export declare interface InternalSchemaElement {
|
|
|
1665
1702
|
*/
|
|
1666
1703
|
export declare interface InternalTypeSchema {
|
|
1667
1704
|
name: string;
|
|
1705
|
+
title?: string;
|
|
1668
1706
|
url?: string;
|
|
1669
1707
|
kind?: string;
|
|
1708
|
+
type?: string;
|
|
1670
1709
|
description?: string;
|
|
1671
1710
|
elements: Record<string, InternalSchemaElement>;
|
|
1672
1711
|
constraints?: Constraint[];
|
|
@@ -1685,6 +1724,7 @@ export declare interface InviteRequest {
|
|
|
1685
1724
|
password?: string;
|
|
1686
1725
|
sendEmail?: boolean;
|
|
1687
1726
|
membership?: Partial<ProjectMembership>;
|
|
1727
|
+
upsert?: boolean;
|
|
1688
1728
|
/** @deprecated Use membership.accessPolicy instead. */
|
|
1689
1729
|
accessPolicy?: Reference<AccessPolicy>;
|
|
1690
1730
|
/** @deprecated Use membership.access instead. */
|
|
@@ -1713,7 +1753,7 @@ export declare function isDataTypeLoaded(type: string): boolean;
|
|
|
1713
1753
|
* @param v - Any value.
|
|
1714
1754
|
* @returns True if the value is an empty string or an empty object.
|
|
1715
1755
|
*/
|
|
1716
|
-
export declare function isEmpty(v:
|
|
1756
|
+
export declare function isEmpty(v: unknown): boolean;
|
|
1717
1757
|
|
|
1718
1758
|
/**
|
|
1719
1759
|
* Checks if a `ResourceType` can be used in a `FHIRcast` context.
|
|
@@ -1762,6 +1802,17 @@ export declare function isOperationOutcome(value: unknown): value is OperationOu
|
|
|
1762
1802
|
*/
|
|
1763
1803
|
export declare function isPeriod(input: unknown): input is Period;
|
|
1764
1804
|
|
|
1805
|
+
/**
|
|
1806
|
+
* Returns true if the value is a non-empty string, an object with a length property greater than zero, or a non-empty object
|
|
1807
|
+
* @param arg - Any value
|
|
1808
|
+
* @returns True if the value is a non-empty string, an object with a length property greater than zero, or a non-empty object
|
|
1809
|
+
*/
|
|
1810
|
+
export declare function isPopulated<T extends {
|
|
1811
|
+
length: number;
|
|
1812
|
+
} | object>(arg: CanBePopulated | undefined | null): arg is T;
|
|
1813
|
+
|
|
1814
|
+
export declare function isProfileLoaded(profileUrl: string): boolean;
|
|
1815
|
+
|
|
1765
1816
|
/**
|
|
1766
1817
|
* Returns true if the resource is a "ProfileResource".
|
|
1767
1818
|
* @param resource - The FHIR resource.
|
|
@@ -1845,7 +1896,7 @@ export declare class LiteralAtom implements Atom {
|
|
|
1845
1896
|
toString(): string;
|
|
1846
1897
|
}
|
|
1847
1898
|
|
|
1848
|
-
export declare function loadDataType(sd: StructureDefinition): void;
|
|
1899
|
+
export declare function loadDataType(sd: StructureDefinition, profileUrl?: string | undefined): void;
|
|
1849
1900
|
|
|
1850
1901
|
export declare interface LoginAuthenticationResponse {
|
|
1851
1902
|
readonly login: string;
|
|
@@ -1972,6 +2023,8 @@ export declare interface Marker {
|
|
|
1972
2023
|
column: number;
|
|
1973
2024
|
}
|
|
1974
2025
|
|
|
2026
|
+
export declare function matchDiscriminant(value: TypedValue | TypedValue[] | undefined, discriminator: SliceDiscriminator, slice: SliceDefinition, elements?: Record<string, InternalSchemaElement>): boolean;
|
|
2027
|
+
|
|
1975
2028
|
/**
|
|
1976
2029
|
* Returns true if the resource satisfies the current access policy.
|
|
1977
2030
|
* @param accessPolicy - The access policy.
|
|
@@ -2537,6 +2590,14 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
2537
2590
|
* @returns Promise to a schema with the requested resource type.
|
|
2538
2591
|
*/
|
|
2539
2592
|
requestSchema(resourceType: string): Promise<void>;
|
|
2593
|
+
/**
|
|
2594
|
+
* Requests the schema for a profile.
|
|
2595
|
+
* If the schema is already cached, the promise is resolved immediately.
|
|
2596
|
+
* @category Schema
|
|
2597
|
+
* @param profileUrl - The FHIR URL of the profile
|
|
2598
|
+
* @returns Promise to a schema with the requested profile.
|
|
2599
|
+
*/
|
|
2600
|
+
requestProfileSchema(profileUrl: string): Promise<void>;
|
|
2540
2601
|
/**
|
|
2541
2602
|
* Reads resource history by resource type and ID.
|
|
2542
2603
|
*
|
|
@@ -3600,6 +3661,7 @@ export declare interface MedplumInfraConfig {
|
|
|
3600
3661
|
clamscanLoggingBucket: string;
|
|
3601
3662
|
clamscanLoggingPrefix: string;
|
|
3602
3663
|
skipDns?: boolean;
|
|
3664
|
+
hostedZoneName?: string;
|
|
3603
3665
|
additionalContainers?: {
|
|
3604
3666
|
name: string;
|
|
3605
3667
|
image: string;
|
|
@@ -3659,6 +3721,7 @@ export declare interface MedplumSourceInfraConfig {
|
|
|
3659
3721
|
clamscanLoggingBucket: ValueOrExternalSecret<string>;
|
|
3660
3722
|
clamscanLoggingPrefix: ValueOrExternalSecret<string>;
|
|
3661
3723
|
skipDns?: ValueOrExternalSecret<boolean>;
|
|
3724
|
+
hostedZoneName?: ValueOrExternalSecret<string>;
|
|
3662
3725
|
additionalContainers?: {
|
|
3663
3726
|
name: ValueOrExternalSecret<string>;
|
|
3664
3727
|
image: ValueOrExternalSecret<string>;
|
|
@@ -3718,6 +3781,20 @@ export declare class MemoryStorage implements Storage {
|
|
|
3718
3781
|
key(index: number): string | null;
|
|
3719
3782
|
}
|
|
3720
3783
|
|
|
3784
|
+
/**
|
|
3785
|
+
* The MockAsyncClientStorage class is a mock implementation of the ClientStorage class.
|
|
3786
|
+
* This can be used for testing async initialization of the MedplumClient.
|
|
3787
|
+
*/
|
|
3788
|
+
export declare class MockAsyncClientStorage extends ClientStorage implements IClientStorage {
|
|
3789
|
+
private initialized;
|
|
3790
|
+
private initPromise;
|
|
3791
|
+
private initResolve;
|
|
3792
|
+
constructor();
|
|
3793
|
+
setInitialized(): void;
|
|
3794
|
+
getInitPromise(): Promise<void>;
|
|
3795
|
+
get isInitialized(): boolean;
|
|
3796
|
+
}
|
|
3797
|
+
|
|
3721
3798
|
export declare interface NewPatientRequest {
|
|
3722
3799
|
readonly login: string;
|
|
3723
3800
|
readonly projectId: string;
|
|
@@ -4416,6 +4493,8 @@ export declare const sleep: (ms: number) => Promise<void>;
|
|
|
4416
4493
|
|
|
4417
4494
|
export declare interface SliceDefinition {
|
|
4418
4495
|
name: string;
|
|
4496
|
+
path: string;
|
|
4497
|
+
definition?: string;
|
|
4419
4498
|
type?: ElementType[];
|
|
4420
4499
|
elements: Record<string, InternalSchemaElement>;
|
|
4421
4500
|
min: number;
|
|
@@ -4468,6 +4547,8 @@ export declare function stringify(value: any, pretty?: boolean): string;
|
|
|
4468
4547
|
*/
|
|
4469
4548
|
export declare function stringifyTypedValue(v: TypedValue): string;
|
|
4470
4549
|
|
|
4550
|
+
export declare function structureMapTransform(structureMap: StructureMap, input: TypedValue[], loader?: (url: string) => StructureMap[]): TypedValue[];
|
|
4551
|
+
|
|
4471
4552
|
/**
|
|
4472
4553
|
* A `FHIRcast` subscription request.
|
|
4473
4554
|
*
|
|
@@ -4570,7 +4651,9 @@ export declare const tooManyRequests: OperationOutcome;
|
|
|
4570
4651
|
*/
|
|
4571
4652
|
export declare function toTypedValue(value: unknown): TypedValue;
|
|
4572
4653
|
|
|
4573
|
-
export declare function tryGetDataType(type: string): InternalTypeSchema | undefined;
|
|
4654
|
+
export declare function tryGetDataType(type: string, profileUrl?: string): InternalTypeSchema | undefined;
|
|
4655
|
+
|
|
4656
|
+
export declare function tryGetProfile(profileUrl: string): InternalTypeSchema | undefined;
|
|
4574
4657
|
|
|
4575
4658
|
export declare class TypedEventTarget<TEvents extends Record<string, Event_2>> {
|
|
4576
4659
|
private emitter;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -100,7 +100,15 @@ export declare interface AgentError extends BaseAgentMessage {
|
|
|
100
100
|
body: string;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
export declare
|
|
103
|
+
export declare interface AgentHeartbeatRequest extends BaseAgentRequestMessage {
|
|
104
|
+
type: 'agent:heartbeat:request';
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export declare interface AgentHeartbeatResponse extends BaseAgentMessage {
|
|
108
|
+
type: 'agent:heartbeat:response';
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export declare type AgentMessage = AgentError | AgentConnectRequest | AgentConnectResponse | AgentHeartbeatRequest | AgentHeartbeatResponse | AgentTransmitRequest | AgentTransmitResponse;
|
|
104
112
|
|
|
105
113
|
export declare interface AgentTransmitRequest extends BaseAgentRequestMessage {
|
|
106
114
|
type: 'agent:transmit:request';
|
|
@@ -253,6 +261,10 @@ export declare function calculateAge(birthDateStr: string, endDateStr?: string):
|
|
|
253
261
|
*/
|
|
254
262
|
export declare function calculateAgeString(birthDateStr: string, endDateStr?: string): string | undefined;
|
|
255
263
|
|
|
264
|
+
declare type CanBePopulated = {
|
|
265
|
+
length: number;
|
|
266
|
+
} | object;
|
|
267
|
+
|
|
256
268
|
/**
|
|
257
269
|
* Determines if the current user can read the specified resource type.
|
|
258
270
|
* @param accessPolicy - The access policy.
|
|
@@ -389,8 +401,6 @@ export declare function createConstraintIssue(expression: string, constraint: Co
|
|
|
389
401
|
|
|
390
402
|
export declare const created: OperationOutcome;
|
|
391
403
|
|
|
392
|
-
export declare function createDeferredPromise(): DeferredPromise;
|
|
393
|
-
|
|
394
404
|
/**
|
|
395
405
|
* Creates a serializable JSON payload for the `FHIRcast` protocol
|
|
396
406
|
*
|
|
@@ -425,6 +435,10 @@ export declare type CurrentContext<EventName extends FhircastResourceEventName =
|
|
|
425
435
|
context: FhircastEventContext<EventName>[];
|
|
426
436
|
};
|
|
427
437
|
|
|
438
|
+
export declare type DataTypesMap = {
|
|
439
|
+
[type: string]: InternalTypeSchema;
|
|
440
|
+
};
|
|
441
|
+
|
|
428
442
|
/**
|
|
429
443
|
* Decodes a base64 string.
|
|
430
444
|
* Handles both browser and Node environments.
|
|
@@ -471,12 +485,6 @@ export declare const DEFAULT_ACCEPT: string;
|
|
|
471
485
|
|
|
472
486
|
export declare const DEFAULT_SEARCH_COUNT = 20;
|
|
473
487
|
|
|
474
|
-
export declare type DeferredPromise = {
|
|
475
|
-
promise: Promise<void>;
|
|
476
|
-
resolve: () => void;
|
|
477
|
-
reject: (err: Error) => void;
|
|
478
|
-
};
|
|
479
|
-
|
|
480
488
|
export declare class DotAtom extends InfixOperatorAtom {
|
|
481
489
|
constructor(left: Atom, right: Atom);
|
|
482
490
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
@@ -486,6 +494,7 @@ export declare class DotAtom extends InfixOperatorAtom {
|
|
|
486
494
|
export declare interface ElementType {
|
|
487
495
|
code: string;
|
|
488
496
|
targetProfile?: string[];
|
|
497
|
+
profile?: string[];
|
|
489
498
|
}
|
|
490
499
|
|
|
491
500
|
export declare interface EmailPasswordLoginRequest extends BaseLoginRequest {
|
|
@@ -1121,7 +1130,7 @@ export declare class FunctionAtom implements Atom {
|
|
|
1121
1130
|
*/
|
|
1122
1131
|
export declare function generateId(): string;
|
|
1123
1132
|
|
|
1124
|
-
export declare function getAllDataTypes():
|
|
1133
|
+
export declare function getAllDataTypes(): DataTypesMap;
|
|
1125
1134
|
|
|
1126
1135
|
/**
|
|
1127
1136
|
* Returns an array of questionnaire answers as a map by link ID.
|
|
@@ -1138,7 +1147,7 @@ export declare function getAllQuestionnaireAnswers(response: QuestionnaireRespon
|
|
|
1138
1147
|
*/
|
|
1139
1148
|
export declare function getCodeBySystem(concept: CodeableConcept, system: string): string | undefined;
|
|
1140
1149
|
|
|
1141
|
-
export declare function getDataType(type: string): InternalTypeSchema;
|
|
1150
|
+
export declare function getDataType(type: string, profileUrl?: string): InternalTypeSchema;
|
|
1142
1151
|
|
|
1143
1152
|
/**
|
|
1144
1153
|
* Returns a Date property as a Date.
|
|
@@ -1158,13 +1167,20 @@ export declare function getDisplayString(resource: Resource): string;
|
|
|
1158
1167
|
|
|
1159
1168
|
/**
|
|
1160
1169
|
* Returns an element definition by type and property name.
|
|
1161
|
-
* Handles content references.
|
|
1162
1170
|
* @param typeName - The type name.
|
|
1163
1171
|
* @param propertyName - The property name.
|
|
1164
1172
|
* @returns The element definition if found.
|
|
1165
1173
|
*/
|
|
1166
1174
|
export declare function getElementDefinition(typeName: string, propertyName: string): InternalSchemaElement | undefined;
|
|
1167
1175
|
|
|
1176
|
+
/**
|
|
1177
|
+
* Returns an element definition from mapping of elements by property name.
|
|
1178
|
+
* @param elements - A mapping of property names to element definitions
|
|
1179
|
+
* @param propertyName - The property name of interest
|
|
1180
|
+
* @returns The element definition if found.
|
|
1181
|
+
*/
|
|
1182
|
+
export declare function getElementDefinitionFromElements(elements: InternalTypeSchema['elements'], propertyName: string): InternalSchemaElement | undefined;
|
|
1183
|
+
|
|
1168
1184
|
/**
|
|
1169
1185
|
* Returns the type name for an ElementDefinition.
|
|
1170
1186
|
* @param elementDefinition - The element definition.
|
|
@@ -1218,7 +1234,14 @@ export declare function getNestedProperty(value: TypedValue, key: string): (Type
|
|
|
1218
1234
|
* @param path - The FHIR element definition path.
|
|
1219
1235
|
* @returns The best guess of the display name.
|
|
1220
1236
|
*/
|
|
1221
|
-
export declare function
|
|
1237
|
+
export declare function getPathDisplayName(path: string): string;
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* Returns a human friendly display name for a FHIR element property or slice name
|
|
1241
|
+
* @param propertyName - The FHIR element property or slice name
|
|
1242
|
+
* @returns The best guess of the display name.
|
|
1243
|
+
*/
|
|
1244
|
+
export declare function getPropertyDisplayName(propertyName: string): string;
|
|
1222
1245
|
|
|
1223
1246
|
/**
|
|
1224
1247
|
* Returns all questionnaire answers as a map by link ID.
|
|
@@ -1291,6 +1314,15 @@ export declare function getStatus(outcome: OperationOutcome): number;
|
|
|
1291
1314
|
*/
|
|
1292
1315
|
export declare function getTypedPropertyValue(input: TypedValue, path: string): TypedValue[] | TypedValue | undefined;
|
|
1293
1316
|
|
|
1317
|
+
/**
|
|
1318
|
+
* Returns the value of the property and the property type using a type schema.
|
|
1319
|
+
* @param value - The base context (FHIR resource or backbone element).
|
|
1320
|
+
* @param path - The property path.
|
|
1321
|
+
* @param element - The property element definition.
|
|
1322
|
+
* @returns The value of the property and the property type.
|
|
1323
|
+
*/
|
|
1324
|
+
export declare function getTypedPropertyValueWithSchema(value: TypedValue['value'], path: string, element: InternalSchemaElement): TypedValue[] | TypedValue | undefined;
|
|
1325
|
+
|
|
1294
1326
|
/**
|
|
1295
1327
|
* Global schema singleton.
|
|
1296
1328
|
*/
|
|
@@ -1624,7 +1656,12 @@ export declare function indexSearchParameter(searchParam: SearchParameter): void
|
|
|
1624
1656
|
*/
|
|
1625
1657
|
export declare function indexSearchParameterBundle(bundle: Bundle<SearchParameter>): void;
|
|
1626
1658
|
|
|
1627
|
-
|
|
1659
|
+
/**
|
|
1660
|
+
* Parses and indexes structure definitions
|
|
1661
|
+
* @param bundle - Bundle or array of structure definitions to be parsed and indexed
|
|
1662
|
+
* @param profileUrl - (optional) URL of the profile the SDs are related to
|
|
1663
|
+
*/
|
|
1664
|
+
export declare function indexStructureDefinitionBundle(bundle: StructureDefinition[] | Bundle, profileUrl?: string | undefined): void;
|
|
1628
1665
|
|
|
1629
1666
|
export declare abstract class InfixOperatorAtom implements Atom {
|
|
1630
1667
|
readonly operator: string;
|
|
@@ -1640,9 +1677,9 @@ export declare interface InfixParselet {
|
|
|
1640
1677
|
parse?(parser: Parser, left: Atom, token: Token): Atom;
|
|
1641
1678
|
}
|
|
1642
1679
|
|
|
1643
|
-
export declare function inflateBaseSchema(base: BaseSchema):
|
|
1680
|
+
export declare function inflateBaseSchema(base: BaseSchema): DataTypesMap;
|
|
1644
1681
|
|
|
1645
|
-
export declare function inflateElement(partial: Partial<InternalSchemaElement>): InternalSchemaElement;
|
|
1682
|
+
export declare function inflateElement(path: string, partial: Partial<InternalSchemaElement>): InternalSchemaElement;
|
|
1646
1683
|
|
|
1647
1684
|
export declare function initFhirPathParserBuilder(): ParserBuilder;
|
|
1648
1685
|
|
|
@@ -1665,8 +1702,10 @@ export declare interface InternalSchemaElement {
|
|
|
1665
1702
|
*/
|
|
1666
1703
|
export declare interface InternalTypeSchema {
|
|
1667
1704
|
name: string;
|
|
1705
|
+
title?: string;
|
|
1668
1706
|
url?: string;
|
|
1669
1707
|
kind?: string;
|
|
1708
|
+
type?: string;
|
|
1670
1709
|
description?: string;
|
|
1671
1710
|
elements: Record<string, InternalSchemaElement>;
|
|
1672
1711
|
constraints?: Constraint[];
|
|
@@ -1685,6 +1724,7 @@ export declare interface InviteRequest {
|
|
|
1685
1724
|
password?: string;
|
|
1686
1725
|
sendEmail?: boolean;
|
|
1687
1726
|
membership?: Partial<ProjectMembership>;
|
|
1727
|
+
upsert?: boolean;
|
|
1688
1728
|
/** @deprecated Use membership.accessPolicy instead. */
|
|
1689
1729
|
accessPolicy?: Reference<AccessPolicy>;
|
|
1690
1730
|
/** @deprecated Use membership.access instead. */
|
|
@@ -1713,7 +1753,7 @@ export declare function isDataTypeLoaded(type: string): boolean;
|
|
|
1713
1753
|
* @param v - Any value.
|
|
1714
1754
|
* @returns True if the value is an empty string or an empty object.
|
|
1715
1755
|
*/
|
|
1716
|
-
export declare function isEmpty(v:
|
|
1756
|
+
export declare function isEmpty(v: unknown): boolean;
|
|
1717
1757
|
|
|
1718
1758
|
/**
|
|
1719
1759
|
* Checks if a `ResourceType` can be used in a `FHIRcast` context.
|
|
@@ -1762,6 +1802,17 @@ export declare function isOperationOutcome(value: unknown): value is OperationOu
|
|
|
1762
1802
|
*/
|
|
1763
1803
|
export declare function isPeriod(input: unknown): input is Period;
|
|
1764
1804
|
|
|
1805
|
+
/**
|
|
1806
|
+
* Returns true if the value is a non-empty string, an object with a length property greater than zero, or a non-empty object
|
|
1807
|
+
* @param arg - Any value
|
|
1808
|
+
* @returns True if the value is a non-empty string, an object with a length property greater than zero, or a non-empty object
|
|
1809
|
+
*/
|
|
1810
|
+
export declare function isPopulated<T extends {
|
|
1811
|
+
length: number;
|
|
1812
|
+
} | object>(arg: CanBePopulated | undefined | null): arg is T;
|
|
1813
|
+
|
|
1814
|
+
export declare function isProfileLoaded(profileUrl: string): boolean;
|
|
1815
|
+
|
|
1765
1816
|
/**
|
|
1766
1817
|
* Returns true if the resource is a "ProfileResource".
|
|
1767
1818
|
* @param resource - The FHIR resource.
|
|
@@ -1845,7 +1896,7 @@ export declare class LiteralAtom implements Atom {
|
|
|
1845
1896
|
toString(): string;
|
|
1846
1897
|
}
|
|
1847
1898
|
|
|
1848
|
-
export declare function loadDataType(sd: StructureDefinition): void;
|
|
1899
|
+
export declare function loadDataType(sd: StructureDefinition, profileUrl?: string | undefined): void;
|
|
1849
1900
|
|
|
1850
1901
|
export declare interface LoginAuthenticationResponse {
|
|
1851
1902
|
readonly login: string;
|
|
@@ -1972,6 +2023,8 @@ export declare interface Marker {
|
|
|
1972
2023
|
column: number;
|
|
1973
2024
|
}
|
|
1974
2025
|
|
|
2026
|
+
export declare function matchDiscriminant(value: TypedValue | TypedValue[] | undefined, discriminator: SliceDiscriminator, slice: SliceDefinition, elements?: Record<string, InternalSchemaElement>): boolean;
|
|
2027
|
+
|
|
1975
2028
|
/**
|
|
1976
2029
|
* Returns true if the resource satisfies the current access policy.
|
|
1977
2030
|
* @param accessPolicy - The access policy.
|
|
@@ -2537,6 +2590,14 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
2537
2590
|
* @returns Promise to a schema with the requested resource type.
|
|
2538
2591
|
*/
|
|
2539
2592
|
requestSchema(resourceType: string): Promise<void>;
|
|
2593
|
+
/**
|
|
2594
|
+
* Requests the schema for a profile.
|
|
2595
|
+
* If the schema is already cached, the promise is resolved immediately.
|
|
2596
|
+
* @category Schema
|
|
2597
|
+
* @param profileUrl - The FHIR URL of the profile
|
|
2598
|
+
* @returns Promise to a schema with the requested profile.
|
|
2599
|
+
*/
|
|
2600
|
+
requestProfileSchema(profileUrl: string): Promise<void>;
|
|
2540
2601
|
/**
|
|
2541
2602
|
* Reads resource history by resource type and ID.
|
|
2542
2603
|
*
|
|
@@ -3600,6 +3661,7 @@ export declare interface MedplumInfraConfig {
|
|
|
3600
3661
|
clamscanLoggingBucket: string;
|
|
3601
3662
|
clamscanLoggingPrefix: string;
|
|
3602
3663
|
skipDns?: boolean;
|
|
3664
|
+
hostedZoneName?: string;
|
|
3603
3665
|
additionalContainers?: {
|
|
3604
3666
|
name: string;
|
|
3605
3667
|
image: string;
|
|
@@ -3659,6 +3721,7 @@ export declare interface MedplumSourceInfraConfig {
|
|
|
3659
3721
|
clamscanLoggingBucket: ValueOrExternalSecret<string>;
|
|
3660
3722
|
clamscanLoggingPrefix: ValueOrExternalSecret<string>;
|
|
3661
3723
|
skipDns?: ValueOrExternalSecret<boolean>;
|
|
3724
|
+
hostedZoneName?: ValueOrExternalSecret<string>;
|
|
3662
3725
|
additionalContainers?: {
|
|
3663
3726
|
name: ValueOrExternalSecret<string>;
|
|
3664
3727
|
image: ValueOrExternalSecret<string>;
|
|
@@ -3718,6 +3781,20 @@ export declare class MemoryStorage implements Storage {
|
|
|
3718
3781
|
key(index: number): string | null;
|
|
3719
3782
|
}
|
|
3720
3783
|
|
|
3784
|
+
/**
|
|
3785
|
+
* The MockAsyncClientStorage class is a mock implementation of the ClientStorage class.
|
|
3786
|
+
* This can be used for testing async initialization of the MedplumClient.
|
|
3787
|
+
*/
|
|
3788
|
+
export declare class MockAsyncClientStorage extends ClientStorage implements IClientStorage {
|
|
3789
|
+
private initialized;
|
|
3790
|
+
private initPromise;
|
|
3791
|
+
private initResolve;
|
|
3792
|
+
constructor();
|
|
3793
|
+
setInitialized(): void;
|
|
3794
|
+
getInitPromise(): Promise<void>;
|
|
3795
|
+
get isInitialized(): boolean;
|
|
3796
|
+
}
|
|
3797
|
+
|
|
3721
3798
|
export declare interface NewPatientRequest {
|
|
3722
3799
|
readonly login: string;
|
|
3723
3800
|
readonly projectId: string;
|
|
@@ -4416,6 +4493,8 @@ export declare const sleep: (ms: number) => Promise<void>;
|
|
|
4416
4493
|
|
|
4417
4494
|
export declare interface SliceDefinition {
|
|
4418
4495
|
name: string;
|
|
4496
|
+
path: string;
|
|
4497
|
+
definition?: string;
|
|
4419
4498
|
type?: ElementType[];
|
|
4420
4499
|
elements: Record<string, InternalSchemaElement>;
|
|
4421
4500
|
min: number;
|
|
@@ -4468,6 +4547,8 @@ export declare function stringify(value: any, pretty?: boolean): string;
|
|
|
4468
4547
|
*/
|
|
4469
4548
|
export declare function stringifyTypedValue(v: TypedValue): string;
|
|
4470
4549
|
|
|
4550
|
+
export declare function structureMapTransform(structureMap: StructureMap, input: TypedValue[], loader?: (url: string) => StructureMap[]): TypedValue[];
|
|
4551
|
+
|
|
4471
4552
|
/**
|
|
4472
4553
|
* A `FHIRcast` subscription request.
|
|
4473
4554
|
*
|
|
@@ -4570,7 +4651,9 @@ export declare const tooManyRequests: OperationOutcome;
|
|
|
4570
4651
|
*/
|
|
4571
4652
|
export declare function toTypedValue(value: unknown): TypedValue;
|
|
4572
4653
|
|
|
4573
|
-
export declare function tryGetDataType(type: string): InternalTypeSchema | undefined;
|
|
4654
|
+
export declare function tryGetDataType(type: string, profileUrl?: string): InternalTypeSchema | undefined;
|
|
4655
|
+
|
|
4656
|
+
export declare function tryGetProfile(profileUrl: string): InternalTypeSchema | undefined;
|
|
4574
4657
|
|
|
4575
4658
|
export declare class TypedEventTarget<TEvents extends Record<string, Event_2>> {
|
|
4576
4659
|
private emitter;
|