@medplum/core 4.4.1 → 4.4.2
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/LICENSE.txt +176 -0
- package/dist/cjs/index.cjs +8 -8
- package/dist/cjs/index.cjs.map +4 -4
- package/dist/cjs/index.d.ts +114 -61
- package/dist/esm/index.d.ts +114 -61
- package/dist/esm/index.mjs +8 -8
- package/dist/esm/index.mjs.map +4 -4
- package/package.json +3 -3
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { AccessPolicy } from '@medplum/fhirtypes';
|
|
2
|
-
import { AccessPolicyResource } from '@medplum/fhirtypes';
|
|
3
|
-
import { Address } from '@medplum/fhirtypes';
|
|
4
|
-
import { Agent } from '@medplum/fhirtypes';
|
|
5
|
-
import { Attachment } from '@medplum/fhirtypes';
|
|
6
|
-
import { Binary } from '@medplum/fhirtypes';
|
|
7
|
-
import { Bot } from '@medplum/fhirtypes';
|
|
8
|
-
import { BulkDataExport } from '@medplum/fhirtypes';
|
|
9
|
-
import { Bundle } from '@medplum/fhirtypes';
|
|
10
|
-
import { ClientApplication } from '@medplum/fhirtypes';
|
|
11
|
-
import { CodeableConcept } from '@medplum/fhirtypes';
|
|
12
|
-
import { Coding } from '@medplum/fhirtypes';
|
|
13
|
-
import { Communication } from '@medplum/fhirtypes';
|
|
14
|
-
import { ConceptMap } from '@medplum/fhirtypes';
|
|
1
|
+
import type { AccessPolicy } from '@medplum/fhirtypes';
|
|
2
|
+
import type { AccessPolicyResource } from '@medplum/fhirtypes';
|
|
3
|
+
import type { Address } from '@medplum/fhirtypes';
|
|
4
|
+
import type { Agent } from '@medplum/fhirtypes';
|
|
5
|
+
import type { Attachment } from '@medplum/fhirtypes';
|
|
6
|
+
import type { Binary } from '@medplum/fhirtypes';
|
|
7
|
+
import type { Bot } from '@medplum/fhirtypes';
|
|
8
|
+
import type { BulkDataExport } from '@medplum/fhirtypes';
|
|
9
|
+
import type { Bundle } from '@medplum/fhirtypes';
|
|
10
|
+
import type { ClientApplication } from '@medplum/fhirtypes';
|
|
11
|
+
import type { CodeableConcept } from '@medplum/fhirtypes';
|
|
12
|
+
import type { Coding } from '@medplum/fhirtypes';
|
|
13
|
+
import type { Communication } from '@medplum/fhirtypes';
|
|
14
|
+
import type { ConceptMap } from '@medplum/fhirtypes';
|
|
15
15
|
import type { CustomTableLayout } from 'pdfmake/interfaces';
|
|
16
|
-
import { Device } from '@medplum/fhirtypes';
|
|
17
|
-
import { DiagnosticReport } from '@medplum/fhirtypes';
|
|
18
|
-
import { DocumentReference } from '@medplum/fhirtypes';
|
|
19
|
-
import { ElementDefinition } from '@medplum/fhirtypes';
|
|
20
|
-
import { ElementDefinitionBinding } from '@medplum/fhirtypes';
|
|
21
|
-
import { Encounter } from '@medplum/fhirtypes';
|
|
22
|
-
import { Extension } from '@medplum/fhirtypes';
|
|
23
|
-
import { ExtensionValue } from '@medplum/fhirtypes';
|
|
24
|
-
import { ExtractResource } from '@medplum/fhirtypes';
|
|
25
|
-
import { HumanName } from '@medplum/fhirtypes';
|
|
26
|
-
import { Identifier } from '@medplum/fhirtypes';
|
|
27
|
-
import { ImagingStudy } from '@medplum/fhirtypes';
|
|
28
|
-
import { Media } from '@medplum/fhirtypes';
|
|
29
|
-
import { Money } from '@medplum/fhirtypes';
|
|
30
|
-
import { Observation } from '@medplum/fhirtypes';
|
|
31
|
-
import { ObservationComponent } from '@medplum/fhirtypes';
|
|
32
|
-
import { ObservationDefinition } from '@medplum/fhirtypes';
|
|
33
|
-
import { ObservationDefinitionQualifiedInterval } from '@medplum/fhirtypes';
|
|
34
|
-
import { OperationOutcome } from '@medplum/fhirtypes';
|
|
35
|
-
import { OperationOutcomeIssue } from '@medplum/fhirtypes';
|
|
36
|
-
import { Patient } from '@medplum/fhirtypes';
|
|
37
|
-
import { Period } from '@medplum/fhirtypes';
|
|
38
|
-
import { Practitioner } from '@medplum/fhirtypes';
|
|
39
|
-
import { Project } from '@medplum/fhirtypes';
|
|
40
|
-
import { ProjectMembership } from '@medplum/fhirtypes';
|
|
41
|
-
import { ProjectMembershipAccess } from '@medplum/fhirtypes';
|
|
42
|
-
import { ProjectSetting } from '@medplum/fhirtypes';
|
|
43
|
-
import { Quantity } from '@medplum/fhirtypes';
|
|
44
|
-
import { QuestionnaireResponse } from '@medplum/fhirtypes';
|
|
45
|
-
import { QuestionnaireResponseItemAnswer } from '@medplum/fhirtypes';
|
|
46
|
-
import { Range as Range_2 } from '@medplum/fhirtypes';
|
|
47
|
-
import { Readable } from 'stream';
|
|
48
|
-
import { Reference } from '@medplum/fhirtypes';
|
|
49
|
-
import { RelatedPerson } from '@medplum/fhirtypes';
|
|
50
|
-
import { Resource } from '@medplum/fhirtypes';
|
|
51
|
-
import { ResourceType } from '@medplum/fhirtypes';
|
|
52
|
-
import { SampledData } from '@medplum/fhirtypes';
|
|
53
|
-
import { SearchParameter } from '@medplum/fhirtypes';
|
|
54
|
-
import { StructureDefinition } from '@medplum/fhirtypes';
|
|
55
|
-
import { StructureMap } from '@medplum/fhirtypes';
|
|
56
|
-
import { Subscription } from '@medplum/fhirtypes';
|
|
16
|
+
import type { Device } from '@medplum/fhirtypes';
|
|
17
|
+
import type { DiagnosticReport } from '@medplum/fhirtypes';
|
|
18
|
+
import type { DocumentReference } from '@medplum/fhirtypes';
|
|
19
|
+
import type { ElementDefinition } from '@medplum/fhirtypes';
|
|
20
|
+
import type { ElementDefinitionBinding } from '@medplum/fhirtypes';
|
|
21
|
+
import type { Encounter } from '@medplum/fhirtypes';
|
|
22
|
+
import type { Extension } from '@medplum/fhirtypes';
|
|
23
|
+
import type { ExtensionValue } from '@medplum/fhirtypes';
|
|
24
|
+
import type { ExtractResource } from '@medplum/fhirtypes';
|
|
25
|
+
import type { HumanName } from '@medplum/fhirtypes';
|
|
26
|
+
import type { Identifier } from '@medplum/fhirtypes';
|
|
27
|
+
import type { ImagingStudy } from '@medplum/fhirtypes';
|
|
28
|
+
import type { Media } from '@medplum/fhirtypes';
|
|
29
|
+
import type { Money } from '@medplum/fhirtypes';
|
|
30
|
+
import type { Observation } from '@medplum/fhirtypes';
|
|
31
|
+
import type { ObservationComponent } from '@medplum/fhirtypes';
|
|
32
|
+
import type { ObservationDefinition } from '@medplum/fhirtypes';
|
|
33
|
+
import type { ObservationDefinitionQualifiedInterval } from '@medplum/fhirtypes';
|
|
34
|
+
import type { OperationOutcome } from '@medplum/fhirtypes';
|
|
35
|
+
import type { OperationOutcomeIssue } from '@medplum/fhirtypes';
|
|
36
|
+
import type { Patient } from '@medplum/fhirtypes';
|
|
37
|
+
import type { Period } from '@medplum/fhirtypes';
|
|
38
|
+
import type { Practitioner } from '@medplum/fhirtypes';
|
|
39
|
+
import type { Project } from '@medplum/fhirtypes';
|
|
40
|
+
import type { ProjectMembership } from '@medplum/fhirtypes';
|
|
41
|
+
import type { ProjectMembershipAccess } from '@medplum/fhirtypes';
|
|
42
|
+
import type { ProjectSetting } from '@medplum/fhirtypes';
|
|
43
|
+
import type { Quantity } from '@medplum/fhirtypes';
|
|
44
|
+
import type { QuestionnaireResponse } from '@medplum/fhirtypes';
|
|
45
|
+
import type { QuestionnaireResponseItemAnswer } from '@medplum/fhirtypes';
|
|
46
|
+
import type { Range as Range_2 } from '@medplum/fhirtypes';
|
|
47
|
+
import type { Readable } from 'stream';
|
|
48
|
+
import type { Reference } from '@medplum/fhirtypes';
|
|
49
|
+
import type { RelatedPerson } from '@medplum/fhirtypes';
|
|
50
|
+
import type { Resource } from '@medplum/fhirtypes';
|
|
51
|
+
import type { ResourceType } from '@medplum/fhirtypes';
|
|
52
|
+
import type { SampledData } from '@medplum/fhirtypes';
|
|
53
|
+
import type { SearchParameter } from '@medplum/fhirtypes';
|
|
54
|
+
import type { StructureDefinition } from '@medplum/fhirtypes';
|
|
55
|
+
import type { StructureMap } from '@medplum/fhirtypes';
|
|
56
|
+
import type { Subscription } from '@medplum/fhirtypes';
|
|
57
57
|
import type { TDocumentDefinitions } from 'pdfmake/interfaces';
|
|
58
58
|
import type { TFontDictionary } from 'pdfmake/interfaces';
|
|
59
|
-
import { Timing } from '@medplum/fhirtypes';
|
|
60
|
-
import { UserConfiguration } from '@medplum/fhirtypes';
|
|
61
|
-
import { ValueSet } from '@medplum/fhirtypes';
|
|
62
|
-
import { ViewDefinition } from '@medplum/fhirtypes';
|
|
63
|
-
import { ViewDefinitionSelect } from '@medplum/fhirtypes';
|
|
59
|
+
import type { Timing } from '@medplum/fhirtypes';
|
|
60
|
+
import type { UserConfiguration } from '@medplum/fhirtypes';
|
|
61
|
+
import type { ValueSet } from '@medplum/fhirtypes';
|
|
62
|
+
import type { ViewDefinition } from '@medplum/fhirtypes';
|
|
63
|
+
import type { ViewDefinitionSelect } from '@medplum/fhirtypes';
|
|
64
64
|
|
|
65
65
|
export declare function accepted(location: string): OperationOutcome;
|
|
66
66
|
|
|
@@ -1730,6 +1730,12 @@ export declare function getAllDataTypes(): DataTypesMap;
|
|
|
1730
1730
|
*/
|
|
1731
1731
|
export declare function getAllQuestionnaireAnswers(response: QuestionnaireResponse): Record<string, QuestionnaireResponseItemAnswer[]>;
|
|
1732
1732
|
|
|
1733
|
+
/**
|
|
1734
|
+
* Returns the global Buffer constructor if available.
|
|
1735
|
+
* @returns The Buffer constructor or undefined.
|
|
1736
|
+
*/
|
|
1737
|
+
export declare function getBuffer(): typeof Buffer | undefined;
|
|
1738
|
+
|
|
1733
1739
|
/**
|
|
1734
1740
|
* Tries to find a code string for a given system within a given codeable concept.
|
|
1735
1741
|
* @param concept - The codeable concept.
|
|
@@ -1976,6 +1982,12 @@ export declare function getValueSliceName(value: any, slices: SliceDefinitionWit
|
|
|
1976
1982
|
*/
|
|
1977
1983
|
export declare function getWebSocketUrl(baseUrl: URL | string, path: string): string;
|
|
1978
1984
|
|
|
1985
|
+
/**
|
|
1986
|
+
* Returns the global window object if available.
|
|
1987
|
+
* @returns The window object or undefined.
|
|
1988
|
+
*/
|
|
1989
|
+
export declare function getWindow(): Window | undefined;
|
|
1990
|
+
|
|
1979
1991
|
/**
|
|
1980
1992
|
* Global schema singleton.
|
|
1981
1993
|
*/
|
|
@@ -2475,6 +2487,17 @@ export declare class IsAtom extends BooleanInfixOperatorAtom {
|
|
|
2475
2487
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
2476
2488
|
}
|
|
2477
2489
|
|
|
2490
|
+
/**
|
|
2491
|
+
* Environment detection utilities that can be mocked in tests.
|
|
2492
|
+
* These functions replace direct checks of global objects to avoid
|
|
2493
|
+
* the need to manipulate non-configurable globalThis.window in Jest/JSDOM 23+.
|
|
2494
|
+
*/
|
|
2495
|
+
/**
|
|
2496
|
+
* Returns true if running in a browser environment with window available.
|
|
2497
|
+
* @returns True if in browser environment.
|
|
2498
|
+
*/
|
|
2499
|
+
export declare function isBrowserEnvironment(): boolean;
|
|
2500
|
+
|
|
2478
2501
|
/**
|
|
2479
2502
|
* Returns true if the input value is a CodeableConcept object.
|
|
2480
2503
|
* This is a heuristic check based on the presence of the "coding" property.
|
|
@@ -2565,6 +2588,12 @@ export declare function isLowerCase(c: string): boolean;
|
|
|
2565
2588
|
*/
|
|
2566
2589
|
export declare function isMedplumAccessToken(accessToken: string): boolean;
|
|
2567
2590
|
|
|
2591
|
+
/**
|
|
2592
|
+
* Returns true if running in Node.js environment with Buffer available.
|
|
2593
|
+
* @returns True if in Node.js environment.
|
|
2594
|
+
*/
|
|
2595
|
+
export declare function isNodeEnvironment(): boolean;
|
|
2596
|
+
|
|
2568
2597
|
export declare function isNotFound(outcome: OperationOutcome): boolean;
|
|
2569
2598
|
|
|
2570
2599
|
/**
|
|
@@ -2626,9 +2655,10 @@ export declare function isRedirect(outcome: OperationOutcome): boolean;
|
|
|
2626
2655
|
/**
|
|
2627
2656
|
* Type guard to validate that an object is a FHIR reference
|
|
2628
2657
|
* @param value - The object to check
|
|
2658
|
+
* @param resourceType - Checks that the reference is of the given type
|
|
2629
2659
|
* @returns True if the input is of type 'object' and contains property 'reference'
|
|
2630
2660
|
*/
|
|
2631
|
-
export declare function isReference(value: unknown): value is Reference & {
|
|
2661
|
+
export declare function isReference<T extends Resource = Resource>(value: unknown, resourceType?: T['resourceType']): value is Reference<T> & {
|
|
2632
2662
|
reference: string;
|
|
2633
2663
|
};
|
|
2634
2664
|
|
|
@@ -2855,6 +2885,19 @@ export declare class LiteralAtom implements Atom {
|
|
|
2855
2885
|
|
|
2856
2886
|
export declare function loadDataType(sd: StructureDefinition): void;
|
|
2857
2887
|
|
|
2888
|
+
/**
|
|
2889
|
+
* Location utilities that can be mocked in tests.
|
|
2890
|
+
* These functions wrap location calls to avoid JSDOM 23+ restrictions.
|
|
2891
|
+
*/
|
|
2892
|
+
export declare const locationUtils: {
|
|
2893
|
+
assign(url: string): void;
|
|
2894
|
+
reload(): void;
|
|
2895
|
+
getSearch(): string;
|
|
2896
|
+
getPathname(): string;
|
|
2897
|
+
getLocation(): string;
|
|
2898
|
+
getOrigin(): string;
|
|
2899
|
+
};
|
|
2900
|
+
|
|
2858
2901
|
export declare class Logger implements ILogger {
|
|
2859
2902
|
readonly write: (msg: string) => void;
|
|
2860
2903
|
readonly metadata: Record<string, any>;
|
|
@@ -6503,6 +6546,16 @@ export declare class TransformMapCollection {
|
|
|
6503
6546
|
private matchesUrl;
|
|
6504
6547
|
}
|
|
6505
6548
|
|
|
6549
|
+
/**
|
|
6550
|
+
* Returns an array with trailing empty elements removed.
|
|
6551
|
+
* For example, [1, 2, 3, null, undefined, ''] becomes [1, 2, 3].
|
|
6552
|
+
* This is useful for FHIR arrays, which by default must maintain the same length,
|
|
6553
|
+
* but while editing we may want to trim trailing empty elements.
|
|
6554
|
+
* @param arr - The input array.
|
|
6555
|
+
* @returns The array with trailing empty elements removed.
|
|
6556
|
+
*/
|
|
6557
|
+
export declare function trimTrailingEmptyElements<T>(arr: T[] | undefined): T[] | undefined;
|
|
6558
|
+
|
|
6506
6559
|
export declare function tryGetDataType(type: string, profileUrl?: string): InternalTypeSchema | undefined;
|
|
6507
6560
|
|
|
6508
6561
|
/**
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { AccessPolicy } from '@medplum/fhirtypes';
|
|
2
|
-
import { AccessPolicyResource } from '@medplum/fhirtypes';
|
|
3
|
-
import { Address } from '@medplum/fhirtypes';
|
|
4
|
-
import { Agent } from '@medplum/fhirtypes';
|
|
5
|
-
import { Attachment } from '@medplum/fhirtypes';
|
|
6
|
-
import { Binary } from '@medplum/fhirtypes';
|
|
7
|
-
import { Bot } from '@medplum/fhirtypes';
|
|
8
|
-
import { BulkDataExport } from '@medplum/fhirtypes';
|
|
9
|
-
import { Bundle } from '@medplum/fhirtypes';
|
|
10
|
-
import { ClientApplication } from '@medplum/fhirtypes';
|
|
11
|
-
import { CodeableConcept } from '@medplum/fhirtypes';
|
|
12
|
-
import { Coding } from '@medplum/fhirtypes';
|
|
13
|
-
import { Communication } from '@medplum/fhirtypes';
|
|
14
|
-
import { ConceptMap } from '@medplum/fhirtypes';
|
|
1
|
+
import type { AccessPolicy } from '@medplum/fhirtypes';
|
|
2
|
+
import type { AccessPolicyResource } from '@medplum/fhirtypes';
|
|
3
|
+
import type { Address } from '@medplum/fhirtypes';
|
|
4
|
+
import type { Agent } from '@medplum/fhirtypes';
|
|
5
|
+
import type { Attachment } from '@medplum/fhirtypes';
|
|
6
|
+
import type { Binary } from '@medplum/fhirtypes';
|
|
7
|
+
import type { Bot } from '@medplum/fhirtypes';
|
|
8
|
+
import type { BulkDataExport } from '@medplum/fhirtypes';
|
|
9
|
+
import type { Bundle } from '@medplum/fhirtypes';
|
|
10
|
+
import type { ClientApplication } from '@medplum/fhirtypes';
|
|
11
|
+
import type { CodeableConcept } from '@medplum/fhirtypes';
|
|
12
|
+
import type { Coding } from '@medplum/fhirtypes';
|
|
13
|
+
import type { Communication } from '@medplum/fhirtypes';
|
|
14
|
+
import type { ConceptMap } from '@medplum/fhirtypes';
|
|
15
15
|
import type { CustomTableLayout } from 'pdfmake/interfaces';
|
|
16
|
-
import { Device } from '@medplum/fhirtypes';
|
|
17
|
-
import { DiagnosticReport } from '@medplum/fhirtypes';
|
|
18
|
-
import { DocumentReference } from '@medplum/fhirtypes';
|
|
19
|
-
import { ElementDefinition } from '@medplum/fhirtypes';
|
|
20
|
-
import { ElementDefinitionBinding } from '@medplum/fhirtypes';
|
|
21
|
-
import { Encounter } from '@medplum/fhirtypes';
|
|
22
|
-
import { Extension } from '@medplum/fhirtypes';
|
|
23
|
-
import { ExtensionValue } from '@medplum/fhirtypes';
|
|
24
|
-
import { ExtractResource } from '@medplum/fhirtypes';
|
|
25
|
-
import { HumanName } from '@medplum/fhirtypes';
|
|
26
|
-
import { Identifier } from '@medplum/fhirtypes';
|
|
27
|
-
import { ImagingStudy } from '@medplum/fhirtypes';
|
|
28
|
-
import { Media } from '@medplum/fhirtypes';
|
|
29
|
-
import { Money } from '@medplum/fhirtypes';
|
|
30
|
-
import { Observation } from '@medplum/fhirtypes';
|
|
31
|
-
import { ObservationComponent } from '@medplum/fhirtypes';
|
|
32
|
-
import { ObservationDefinition } from '@medplum/fhirtypes';
|
|
33
|
-
import { ObservationDefinitionQualifiedInterval } from '@medplum/fhirtypes';
|
|
34
|
-
import { OperationOutcome } from '@medplum/fhirtypes';
|
|
35
|
-
import { OperationOutcomeIssue } from '@medplum/fhirtypes';
|
|
36
|
-
import { Patient } from '@medplum/fhirtypes';
|
|
37
|
-
import { Period } from '@medplum/fhirtypes';
|
|
38
|
-
import { Practitioner } from '@medplum/fhirtypes';
|
|
39
|
-
import { Project } from '@medplum/fhirtypes';
|
|
40
|
-
import { ProjectMembership } from '@medplum/fhirtypes';
|
|
41
|
-
import { ProjectMembershipAccess } from '@medplum/fhirtypes';
|
|
42
|
-
import { ProjectSetting } from '@medplum/fhirtypes';
|
|
43
|
-
import { Quantity } from '@medplum/fhirtypes';
|
|
44
|
-
import { QuestionnaireResponse } from '@medplum/fhirtypes';
|
|
45
|
-
import { QuestionnaireResponseItemAnswer } from '@medplum/fhirtypes';
|
|
46
|
-
import { Range as Range_2 } from '@medplum/fhirtypes';
|
|
47
|
-
import { Readable } from 'stream';
|
|
48
|
-
import { Reference } from '@medplum/fhirtypes';
|
|
49
|
-
import { RelatedPerson } from '@medplum/fhirtypes';
|
|
50
|
-
import { Resource } from '@medplum/fhirtypes';
|
|
51
|
-
import { ResourceType } from '@medplum/fhirtypes';
|
|
52
|
-
import { SampledData } from '@medplum/fhirtypes';
|
|
53
|
-
import { SearchParameter } from '@medplum/fhirtypes';
|
|
54
|
-
import { StructureDefinition } from '@medplum/fhirtypes';
|
|
55
|
-
import { StructureMap } from '@medplum/fhirtypes';
|
|
56
|
-
import { Subscription } from '@medplum/fhirtypes';
|
|
16
|
+
import type { Device } from '@medplum/fhirtypes';
|
|
17
|
+
import type { DiagnosticReport } from '@medplum/fhirtypes';
|
|
18
|
+
import type { DocumentReference } from '@medplum/fhirtypes';
|
|
19
|
+
import type { ElementDefinition } from '@medplum/fhirtypes';
|
|
20
|
+
import type { ElementDefinitionBinding } from '@medplum/fhirtypes';
|
|
21
|
+
import type { Encounter } from '@medplum/fhirtypes';
|
|
22
|
+
import type { Extension } from '@medplum/fhirtypes';
|
|
23
|
+
import type { ExtensionValue } from '@medplum/fhirtypes';
|
|
24
|
+
import type { ExtractResource } from '@medplum/fhirtypes';
|
|
25
|
+
import type { HumanName } from '@medplum/fhirtypes';
|
|
26
|
+
import type { Identifier } from '@medplum/fhirtypes';
|
|
27
|
+
import type { ImagingStudy } from '@medplum/fhirtypes';
|
|
28
|
+
import type { Media } from '@medplum/fhirtypes';
|
|
29
|
+
import type { Money } from '@medplum/fhirtypes';
|
|
30
|
+
import type { Observation } from '@medplum/fhirtypes';
|
|
31
|
+
import type { ObservationComponent } from '@medplum/fhirtypes';
|
|
32
|
+
import type { ObservationDefinition } from '@medplum/fhirtypes';
|
|
33
|
+
import type { ObservationDefinitionQualifiedInterval } from '@medplum/fhirtypes';
|
|
34
|
+
import type { OperationOutcome } from '@medplum/fhirtypes';
|
|
35
|
+
import type { OperationOutcomeIssue } from '@medplum/fhirtypes';
|
|
36
|
+
import type { Patient } from '@medplum/fhirtypes';
|
|
37
|
+
import type { Period } from '@medplum/fhirtypes';
|
|
38
|
+
import type { Practitioner } from '@medplum/fhirtypes';
|
|
39
|
+
import type { Project } from '@medplum/fhirtypes';
|
|
40
|
+
import type { ProjectMembership } from '@medplum/fhirtypes';
|
|
41
|
+
import type { ProjectMembershipAccess } from '@medplum/fhirtypes';
|
|
42
|
+
import type { ProjectSetting } from '@medplum/fhirtypes';
|
|
43
|
+
import type { Quantity } from '@medplum/fhirtypes';
|
|
44
|
+
import type { QuestionnaireResponse } from '@medplum/fhirtypes';
|
|
45
|
+
import type { QuestionnaireResponseItemAnswer } from '@medplum/fhirtypes';
|
|
46
|
+
import type { Range as Range_2 } from '@medplum/fhirtypes';
|
|
47
|
+
import type { Readable } from 'stream';
|
|
48
|
+
import type { Reference } from '@medplum/fhirtypes';
|
|
49
|
+
import type { RelatedPerson } from '@medplum/fhirtypes';
|
|
50
|
+
import type { Resource } from '@medplum/fhirtypes';
|
|
51
|
+
import type { ResourceType } from '@medplum/fhirtypes';
|
|
52
|
+
import type { SampledData } from '@medplum/fhirtypes';
|
|
53
|
+
import type { SearchParameter } from '@medplum/fhirtypes';
|
|
54
|
+
import type { StructureDefinition } from '@medplum/fhirtypes';
|
|
55
|
+
import type { StructureMap } from '@medplum/fhirtypes';
|
|
56
|
+
import type { Subscription } from '@medplum/fhirtypes';
|
|
57
57
|
import type { TDocumentDefinitions } from 'pdfmake/interfaces';
|
|
58
58
|
import type { TFontDictionary } from 'pdfmake/interfaces';
|
|
59
|
-
import { Timing } from '@medplum/fhirtypes';
|
|
60
|
-
import { UserConfiguration } from '@medplum/fhirtypes';
|
|
61
|
-
import { ValueSet } from '@medplum/fhirtypes';
|
|
62
|
-
import { ViewDefinition } from '@medplum/fhirtypes';
|
|
63
|
-
import { ViewDefinitionSelect } from '@medplum/fhirtypes';
|
|
59
|
+
import type { Timing } from '@medplum/fhirtypes';
|
|
60
|
+
import type { UserConfiguration } from '@medplum/fhirtypes';
|
|
61
|
+
import type { ValueSet } from '@medplum/fhirtypes';
|
|
62
|
+
import type { ViewDefinition } from '@medplum/fhirtypes';
|
|
63
|
+
import type { ViewDefinitionSelect } from '@medplum/fhirtypes';
|
|
64
64
|
|
|
65
65
|
export declare function accepted(location: string): OperationOutcome;
|
|
66
66
|
|
|
@@ -1730,6 +1730,12 @@ export declare function getAllDataTypes(): DataTypesMap;
|
|
|
1730
1730
|
*/
|
|
1731
1731
|
export declare function getAllQuestionnaireAnswers(response: QuestionnaireResponse): Record<string, QuestionnaireResponseItemAnswer[]>;
|
|
1732
1732
|
|
|
1733
|
+
/**
|
|
1734
|
+
* Returns the global Buffer constructor if available.
|
|
1735
|
+
* @returns The Buffer constructor or undefined.
|
|
1736
|
+
*/
|
|
1737
|
+
export declare function getBuffer(): typeof Buffer | undefined;
|
|
1738
|
+
|
|
1733
1739
|
/**
|
|
1734
1740
|
* Tries to find a code string for a given system within a given codeable concept.
|
|
1735
1741
|
* @param concept - The codeable concept.
|
|
@@ -1976,6 +1982,12 @@ export declare function getValueSliceName(value: any, slices: SliceDefinitionWit
|
|
|
1976
1982
|
*/
|
|
1977
1983
|
export declare function getWebSocketUrl(baseUrl: URL | string, path: string): string;
|
|
1978
1984
|
|
|
1985
|
+
/**
|
|
1986
|
+
* Returns the global window object if available.
|
|
1987
|
+
* @returns The window object or undefined.
|
|
1988
|
+
*/
|
|
1989
|
+
export declare function getWindow(): Window | undefined;
|
|
1990
|
+
|
|
1979
1991
|
/**
|
|
1980
1992
|
* Global schema singleton.
|
|
1981
1993
|
*/
|
|
@@ -2475,6 +2487,17 @@ export declare class IsAtom extends BooleanInfixOperatorAtom {
|
|
|
2475
2487
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
2476
2488
|
}
|
|
2477
2489
|
|
|
2490
|
+
/**
|
|
2491
|
+
* Environment detection utilities that can be mocked in tests.
|
|
2492
|
+
* These functions replace direct checks of global objects to avoid
|
|
2493
|
+
* the need to manipulate non-configurable globalThis.window in Jest/JSDOM 23+.
|
|
2494
|
+
*/
|
|
2495
|
+
/**
|
|
2496
|
+
* Returns true if running in a browser environment with window available.
|
|
2497
|
+
* @returns True if in browser environment.
|
|
2498
|
+
*/
|
|
2499
|
+
export declare function isBrowserEnvironment(): boolean;
|
|
2500
|
+
|
|
2478
2501
|
/**
|
|
2479
2502
|
* Returns true if the input value is a CodeableConcept object.
|
|
2480
2503
|
* This is a heuristic check based on the presence of the "coding" property.
|
|
@@ -2565,6 +2588,12 @@ export declare function isLowerCase(c: string): boolean;
|
|
|
2565
2588
|
*/
|
|
2566
2589
|
export declare function isMedplumAccessToken(accessToken: string): boolean;
|
|
2567
2590
|
|
|
2591
|
+
/**
|
|
2592
|
+
* Returns true if running in Node.js environment with Buffer available.
|
|
2593
|
+
* @returns True if in Node.js environment.
|
|
2594
|
+
*/
|
|
2595
|
+
export declare function isNodeEnvironment(): boolean;
|
|
2596
|
+
|
|
2568
2597
|
export declare function isNotFound(outcome: OperationOutcome): boolean;
|
|
2569
2598
|
|
|
2570
2599
|
/**
|
|
@@ -2626,9 +2655,10 @@ export declare function isRedirect(outcome: OperationOutcome): boolean;
|
|
|
2626
2655
|
/**
|
|
2627
2656
|
* Type guard to validate that an object is a FHIR reference
|
|
2628
2657
|
* @param value - The object to check
|
|
2658
|
+
* @param resourceType - Checks that the reference is of the given type
|
|
2629
2659
|
* @returns True if the input is of type 'object' and contains property 'reference'
|
|
2630
2660
|
*/
|
|
2631
|
-
export declare function isReference(value: unknown): value is Reference & {
|
|
2661
|
+
export declare function isReference<T extends Resource = Resource>(value: unknown, resourceType?: T['resourceType']): value is Reference<T> & {
|
|
2632
2662
|
reference: string;
|
|
2633
2663
|
};
|
|
2634
2664
|
|
|
@@ -2855,6 +2885,19 @@ export declare class LiteralAtom implements Atom {
|
|
|
2855
2885
|
|
|
2856
2886
|
export declare function loadDataType(sd: StructureDefinition): void;
|
|
2857
2887
|
|
|
2888
|
+
/**
|
|
2889
|
+
* Location utilities that can be mocked in tests.
|
|
2890
|
+
* These functions wrap location calls to avoid JSDOM 23+ restrictions.
|
|
2891
|
+
*/
|
|
2892
|
+
export declare const locationUtils: {
|
|
2893
|
+
assign(url: string): void;
|
|
2894
|
+
reload(): void;
|
|
2895
|
+
getSearch(): string;
|
|
2896
|
+
getPathname(): string;
|
|
2897
|
+
getLocation(): string;
|
|
2898
|
+
getOrigin(): string;
|
|
2899
|
+
};
|
|
2900
|
+
|
|
2858
2901
|
export declare class Logger implements ILogger {
|
|
2859
2902
|
readonly write: (msg: string) => void;
|
|
2860
2903
|
readonly metadata: Record<string, any>;
|
|
@@ -6503,6 +6546,16 @@ export declare class TransformMapCollection {
|
|
|
6503
6546
|
private matchesUrl;
|
|
6504
6547
|
}
|
|
6505
6548
|
|
|
6549
|
+
/**
|
|
6550
|
+
* Returns an array with trailing empty elements removed.
|
|
6551
|
+
* For example, [1, 2, 3, null, undefined, ''] becomes [1, 2, 3].
|
|
6552
|
+
* This is useful for FHIR arrays, which by default must maintain the same length,
|
|
6553
|
+
* but while editing we may want to trim trailing empty elements.
|
|
6554
|
+
* @param arr - The input array.
|
|
6555
|
+
* @returns The array with trailing empty elements removed.
|
|
6556
|
+
*/
|
|
6557
|
+
export declare function trimTrailingEmptyElements<T>(arr: T[] | undefined): T[] | undefined;
|
|
6558
|
+
|
|
6506
6559
|
export declare function tryGetDataType(type: string, profileUrl?: string): InternalTypeSchema | undefined;
|
|
6507
6560
|
|
|
6508
6561
|
/**
|