@medplum/core 3.1.10 → 3.1.11
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 +4 -4
- package/dist/cjs/index.d.ts +57 -5
- package/dist/esm/index.d.ts +57 -5
- package/dist/esm/index.mjs +5 -5
- package/dist/esm/index.mjs.map +4 -4
- package/package.json +3 -3
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
|
|
3
1
|
import { AccessPolicy } from '@medplum/fhirtypes';
|
|
4
2
|
import { AccessPolicyResource } from '@medplum/fhirtypes';
|
|
5
3
|
import { Address } from '@medplum/fhirtypes';
|
|
@@ -55,6 +53,8 @@ import type { TFontDictionary } from 'pdfmake/interfaces';
|
|
|
55
53
|
import { Timing } from '@medplum/fhirtypes';
|
|
56
54
|
import { UserConfiguration } from '@medplum/fhirtypes';
|
|
57
55
|
import { ValueSet } from '@medplum/fhirtypes';
|
|
56
|
+
import { ViewDefinition } from '@medplum/fhirtypes';
|
|
57
|
+
import { ViewDefinitionSelect } from '@medplum/fhirtypes';
|
|
58
58
|
|
|
59
59
|
export declare function accepted(location: string): OperationOutcome;
|
|
60
60
|
|
|
@@ -801,6 +801,14 @@ export declare function evalFhirPath(expression: string, input: unknown): unknow
|
|
|
801
801
|
*/
|
|
802
802
|
export declare function evalFhirPathTyped(expression: string, input: TypedValue[], variables?: Record<string, TypedValue>): TypedValue[];
|
|
803
803
|
|
|
804
|
+
/**
|
|
805
|
+
* Evaluates a SQL-on-FHIR view on a set of FHIR resources.
|
|
806
|
+
* @param view - The view definition.
|
|
807
|
+
* @param resources - The array of FHIR resources.
|
|
808
|
+
* @returns The output rows.
|
|
809
|
+
*/
|
|
810
|
+
export declare function evalSqlOnFhir(view: ViewDefinition, resources: Resource[]): OutputRow[];
|
|
811
|
+
|
|
804
812
|
declare interface Event_2 {
|
|
805
813
|
readonly type: string;
|
|
806
814
|
readonly defaultPrevented?: boolean;
|
|
@@ -2579,7 +2587,7 @@ export declare const MEDPLUM_VERSION: string;
|
|
|
2579
2587
|
* <meta name="algolia:pageRank" content="100" />
|
|
2580
2588
|
* </head>
|
|
2581
2589
|
*/
|
|
2582
|
-
export declare class MedplumClient extends
|
|
2590
|
+
export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMap> {
|
|
2583
2591
|
private readonly options;
|
|
2584
2592
|
private readonly fetch;
|
|
2585
2593
|
private readonly createPdfImpl?;
|
|
@@ -2855,7 +2863,7 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
2855
2863
|
getExternalAuthRedirectUri(authorizeUrl: string, clientId: string, redirectUri: string, loginRequest: BaseLoginRequest, pkceEnabled?: boolean): string;
|
|
2856
2864
|
/**
|
|
2857
2865
|
* Builds a FHIR URL from a collection of URL path components.
|
|
2858
|
-
* For example, `
|
|
2866
|
+
* For example, `fhirUrl('Patient', '123')` returns `fhir/R4/Patient/123`.
|
|
2859
2867
|
* @category HTTP
|
|
2860
2868
|
* @param path - The path component of the URL.
|
|
2861
2869
|
* @returns The well-formed FHIR URL.
|
|
@@ -3987,7 +3995,6 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
3987
3995
|
* This synchronizes state across browser windows and browser tabs.
|
|
3988
3996
|
*/
|
|
3989
3997
|
private setupStorageListener;
|
|
3990
|
-
private retryCatch;
|
|
3991
3998
|
/**
|
|
3992
3999
|
* Gets the `SubscriptionManager` for WebSocket subscriptions.
|
|
3993
4000
|
*
|
|
@@ -4056,6 +4063,27 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
4056
4063
|
getMasterSubscriptionEmitter(): SubscriptionEmitter;
|
|
4057
4064
|
}
|
|
4058
4065
|
|
|
4066
|
+
/**
|
|
4067
|
+
* This map enumerates all the lifecycle events that `MedplumClient` emits and what the shape of the `Event` is.
|
|
4068
|
+
*/
|
|
4069
|
+
export declare type MedplumClientEventMap = {
|
|
4070
|
+
change: {
|
|
4071
|
+
type: 'change';
|
|
4072
|
+
};
|
|
4073
|
+
offline: {
|
|
4074
|
+
type: 'offline';
|
|
4075
|
+
};
|
|
4076
|
+
profileRefreshing: {
|
|
4077
|
+
type: 'profileRefreshing';
|
|
4078
|
+
};
|
|
4079
|
+
profileRefreshed: {
|
|
4080
|
+
type: 'profileRefreshed';
|
|
4081
|
+
};
|
|
4082
|
+
storageInitialized: {
|
|
4083
|
+
type: 'storageInitialized';
|
|
4084
|
+
};
|
|
4085
|
+
};
|
|
4086
|
+
|
|
4059
4087
|
/**
|
|
4060
4088
|
* The MedplumClientOptions interface defines configuration options for MedplumClient.
|
|
4061
4089
|
*
|
|
@@ -4346,6 +4374,10 @@ export declare interface MedplumRequestOptions extends RequestInit {
|
|
|
4346
4374
|
* Default value is 1000 (1 second).
|
|
4347
4375
|
*/
|
|
4348
4376
|
pollStatusPeriod?: number;
|
|
4377
|
+
/**
|
|
4378
|
+
* Optional max number of retries that should be made in the case of a failed request. Default is `2`.
|
|
4379
|
+
*/
|
|
4380
|
+
maxRetries?: number;
|
|
4349
4381
|
}
|
|
4350
4382
|
|
|
4351
4383
|
export declare interface MedplumSourceInfraConfig {
|
|
@@ -4680,6 +4712,11 @@ export declare class OrAtom extends BooleanInfixOperatorAtom {
|
|
|
4680
4712
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
4681
4713
|
}
|
|
4682
4714
|
|
|
4715
|
+
/**
|
|
4716
|
+
* SQL on FHIR output row.
|
|
4717
|
+
*/
|
|
4718
|
+
export declare type OutputRow = Record<string, any>;
|
|
4719
|
+
|
|
4683
4720
|
/**
|
|
4684
4721
|
* Parses a FHIR criteria string into a SearchRequest.
|
|
4685
4722
|
* FHIR criteria strings are found on resources such as Subscription.
|
|
@@ -5188,6 +5225,21 @@ export declare interface SearchRequest<T extends Resource = Resource> {
|
|
|
5188
5225
|
types?: T['resourceType'][];
|
|
5189
5226
|
}
|
|
5190
5227
|
|
|
5228
|
+
/**
|
|
5229
|
+
* Represents a "selection structure" in the SQL-on-FHIR specification.
|
|
5230
|
+
*
|
|
5231
|
+
* In practice, this can be a ViewDefinition or ViewDefinitionSelect.
|
|
5232
|
+
*
|
|
5233
|
+
* TypeScript does not like checks for properties that are not part of the type, so we use this interface instead.
|
|
5234
|
+
*/
|
|
5235
|
+
export declare interface SelectionStructure {
|
|
5236
|
+
forEach?: string;
|
|
5237
|
+
forEachOrNull?: string;
|
|
5238
|
+
column?: ViewDefinitionSelect['column'];
|
|
5239
|
+
select?: SelectionStructure[];
|
|
5240
|
+
unionAll?: SelectionStructure[];
|
|
5241
|
+
}
|
|
5242
|
+
|
|
5191
5243
|
/**
|
|
5192
5244
|
* Creates a serialized url-encoded payload for a `FHIRcast` subscription from a `SubscriptionRequest` object that can be directly used in an HTTP request to the Hub.
|
|
5193
5245
|
*
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
|
|
3
1
|
import { AccessPolicy } from '@medplum/fhirtypes';
|
|
4
2
|
import { AccessPolicyResource } from '@medplum/fhirtypes';
|
|
5
3
|
import { Address } from '@medplum/fhirtypes';
|
|
@@ -55,6 +53,8 @@ import type { TFontDictionary } from 'pdfmake/interfaces';
|
|
|
55
53
|
import { Timing } from '@medplum/fhirtypes';
|
|
56
54
|
import { UserConfiguration } from '@medplum/fhirtypes';
|
|
57
55
|
import { ValueSet } from '@medplum/fhirtypes';
|
|
56
|
+
import { ViewDefinition } from '@medplum/fhirtypes';
|
|
57
|
+
import { ViewDefinitionSelect } from '@medplum/fhirtypes';
|
|
58
58
|
|
|
59
59
|
export declare function accepted(location: string): OperationOutcome;
|
|
60
60
|
|
|
@@ -801,6 +801,14 @@ export declare function evalFhirPath(expression: string, input: unknown): unknow
|
|
|
801
801
|
*/
|
|
802
802
|
export declare function evalFhirPathTyped(expression: string, input: TypedValue[], variables?: Record<string, TypedValue>): TypedValue[];
|
|
803
803
|
|
|
804
|
+
/**
|
|
805
|
+
* Evaluates a SQL-on-FHIR view on a set of FHIR resources.
|
|
806
|
+
* @param view - The view definition.
|
|
807
|
+
* @param resources - The array of FHIR resources.
|
|
808
|
+
* @returns The output rows.
|
|
809
|
+
*/
|
|
810
|
+
export declare function evalSqlOnFhir(view: ViewDefinition, resources: Resource[]): OutputRow[];
|
|
811
|
+
|
|
804
812
|
declare interface Event_2 {
|
|
805
813
|
readonly type: string;
|
|
806
814
|
readonly defaultPrevented?: boolean;
|
|
@@ -2579,7 +2587,7 @@ export declare const MEDPLUM_VERSION: string;
|
|
|
2579
2587
|
* <meta name="algolia:pageRank" content="100" />
|
|
2580
2588
|
* </head>
|
|
2581
2589
|
*/
|
|
2582
|
-
export declare class MedplumClient extends
|
|
2590
|
+
export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMap> {
|
|
2583
2591
|
private readonly options;
|
|
2584
2592
|
private readonly fetch;
|
|
2585
2593
|
private readonly createPdfImpl?;
|
|
@@ -2855,7 +2863,7 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
2855
2863
|
getExternalAuthRedirectUri(authorizeUrl: string, clientId: string, redirectUri: string, loginRequest: BaseLoginRequest, pkceEnabled?: boolean): string;
|
|
2856
2864
|
/**
|
|
2857
2865
|
* Builds a FHIR URL from a collection of URL path components.
|
|
2858
|
-
* For example, `
|
|
2866
|
+
* For example, `fhirUrl('Patient', '123')` returns `fhir/R4/Patient/123`.
|
|
2859
2867
|
* @category HTTP
|
|
2860
2868
|
* @param path - The path component of the URL.
|
|
2861
2869
|
* @returns The well-formed FHIR URL.
|
|
@@ -3987,7 +3995,6 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
3987
3995
|
* This synchronizes state across browser windows and browser tabs.
|
|
3988
3996
|
*/
|
|
3989
3997
|
private setupStorageListener;
|
|
3990
|
-
private retryCatch;
|
|
3991
3998
|
/**
|
|
3992
3999
|
* Gets the `SubscriptionManager` for WebSocket subscriptions.
|
|
3993
4000
|
*
|
|
@@ -4056,6 +4063,27 @@ export declare class MedplumClient extends EventTarget_2 {
|
|
|
4056
4063
|
getMasterSubscriptionEmitter(): SubscriptionEmitter;
|
|
4057
4064
|
}
|
|
4058
4065
|
|
|
4066
|
+
/**
|
|
4067
|
+
* This map enumerates all the lifecycle events that `MedplumClient` emits and what the shape of the `Event` is.
|
|
4068
|
+
*/
|
|
4069
|
+
export declare type MedplumClientEventMap = {
|
|
4070
|
+
change: {
|
|
4071
|
+
type: 'change';
|
|
4072
|
+
};
|
|
4073
|
+
offline: {
|
|
4074
|
+
type: 'offline';
|
|
4075
|
+
};
|
|
4076
|
+
profileRefreshing: {
|
|
4077
|
+
type: 'profileRefreshing';
|
|
4078
|
+
};
|
|
4079
|
+
profileRefreshed: {
|
|
4080
|
+
type: 'profileRefreshed';
|
|
4081
|
+
};
|
|
4082
|
+
storageInitialized: {
|
|
4083
|
+
type: 'storageInitialized';
|
|
4084
|
+
};
|
|
4085
|
+
};
|
|
4086
|
+
|
|
4059
4087
|
/**
|
|
4060
4088
|
* The MedplumClientOptions interface defines configuration options for MedplumClient.
|
|
4061
4089
|
*
|
|
@@ -4346,6 +4374,10 @@ export declare interface MedplumRequestOptions extends RequestInit {
|
|
|
4346
4374
|
* Default value is 1000 (1 second).
|
|
4347
4375
|
*/
|
|
4348
4376
|
pollStatusPeriod?: number;
|
|
4377
|
+
/**
|
|
4378
|
+
* Optional max number of retries that should be made in the case of a failed request. Default is `2`.
|
|
4379
|
+
*/
|
|
4380
|
+
maxRetries?: number;
|
|
4349
4381
|
}
|
|
4350
4382
|
|
|
4351
4383
|
export declare interface MedplumSourceInfraConfig {
|
|
@@ -4680,6 +4712,11 @@ export declare class OrAtom extends BooleanInfixOperatorAtom {
|
|
|
4680
4712
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
4681
4713
|
}
|
|
4682
4714
|
|
|
4715
|
+
/**
|
|
4716
|
+
* SQL on FHIR output row.
|
|
4717
|
+
*/
|
|
4718
|
+
export declare type OutputRow = Record<string, any>;
|
|
4719
|
+
|
|
4683
4720
|
/**
|
|
4684
4721
|
* Parses a FHIR criteria string into a SearchRequest.
|
|
4685
4722
|
* FHIR criteria strings are found on resources such as Subscription.
|
|
@@ -5188,6 +5225,21 @@ export declare interface SearchRequest<T extends Resource = Resource> {
|
|
|
5188
5225
|
types?: T['resourceType'][];
|
|
5189
5226
|
}
|
|
5190
5227
|
|
|
5228
|
+
/**
|
|
5229
|
+
* Represents a "selection structure" in the SQL-on-FHIR specification.
|
|
5230
|
+
*
|
|
5231
|
+
* In practice, this can be a ViewDefinition or ViewDefinitionSelect.
|
|
5232
|
+
*
|
|
5233
|
+
* TypeScript does not like checks for properties that are not part of the type, so we use this interface instead.
|
|
5234
|
+
*/
|
|
5235
|
+
export declare interface SelectionStructure {
|
|
5236
|
+
forEach?: string;
|
|
5237
|
+
forEachOrNull?: string;
|
|
5238
|
+
column?: ViewDefinitionSelect['column'];
|
|
5239
|
+
select?: SelectionStructure[];
|
|
5240
|
+
unionAll?: SelectionStructure[];
|
|
5241
|
+
}
|
|
5242
|
+
|
|
5191
5243
|
/**
|
|
5192
5244
|
* Creates a serialized url-encoded payload for a `FHIRcast` subscription from a `SubscriptionRequest` object that can be directly used in an HTTP request to the Hub.
|
|
5193
5245
|
*
|