@medplum/core 0.9.16 → 0.9.19
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/cody-pdf-test.js +32 -0
- package/dist/cjs/index.js +5173 -77
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.min.js +1 -1
- package/dist/cjs/index.min.js.map +1 -1
- package/dist/esm/index.js +5135 -78
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +1 -1
- package/dist/esm/index.min.js.map +1 -1
- package/dist/types/client.d.ts +49 -1
- package/dist/types/fhirpath/atoms.d.ts +8 -6
- package/dist/types/fhirpath/index.d.ts +2 -0
- package/dist/types/fhirpath/parse.d.ts +9 -2
- package/dist/types/fhirpath/utils.d.ts +11 -0
- package/dist/types/readablepromise.d.ts +5 -0
- package/dist/types/search.d.ts +3 -1
- package/dist/types/types.d.ts +12 -3
- package/package.json +3 -2
- package/wget-log +6 -0
package/dist/types/client.d.ts
CHANGED
|
@@ -573,6 +573,7 @@ export declare class MedplumClient extends EventTarget {
|
|
|
573
573
|
* It is assumed that a client will call requestSchema before using this method.
|
|
574
574
|
* @param resourceType The FHIR resource type.
|
|
575
575
|
* @returns The schema if immediately available, undefined otherwise.
|
|
576
|
+
* @deprecated Use globalSchema instead.
|
|
576
577
|
*/
|
|
577
578
|
getSchema(): IndexedStructureDefinition;
|
|
578
579
|
/**
|
|
@@ -843,7 +844,54 @@ export declare class MedplumClient extends EventTarget {
|
|
|
843
844
|
* @returns Promise to the operation outcome.
|
|
844
845
|
*/
|
|
845
846
|
sendEmail(email: MailOptions): Promise<OperationOutcome>;
|
|
846
|
-
|
|
847
|
+
/**
|
|
848
|
+
* Executes a GraphQL query.
|
|
849
|
+
*
|
|
850
|
+
* Example:
|
|
851
|
+
*
|
|
852
|
+
* ```typescript
|
|
853
|
+
* const result = await medplum.graphql(`{
|
|
854
|
+
* Patient(id: "123") {
|
|
855
|
+
* resourceType
|
|
856
|
+
* id
|
|
857
|
+
* name {
|
|
858
|
+
* given
|
|
859
|
+
* family
|
|
860
|
+
* }
|
|
861
|
+
* }
|
|
862
|
+
* }`);
|
|
863
|
+
* ```
|
|
864
|
+
*
|
|
865
|
+
* Advanced queries such as named operations and variable substitution are supported:
|
|
866
|
+
*
|
|
867
|
+
* ```typescript
|
|
868
|
+
* const result = await medplum.graphql(
|
|
869
|
+
* `query GetPatientById($patientId: ID!) {
|
|
870
|
+
* Patient(id: $patientId) {
|
|
871
|
+
* resourceType
|
|
872
|
+
* id
|
|
873
|
+
* name {
|
|
874
|
+
* given
|
|
875
|
+
* family
|
|
876
|
+
* }
|
|
877
|
+
* }
|
|
878
|
+
* }`,
|
|
879
|
+
* 'GetPatientById',
|
|
880
|
+
* { patientId: '123' }
|
|
881
|
+
* );
|
|
882
|
+
* ```
|
|
883
|
+
*
|
|
884
|
+
* See the GraphQL documentation for more details: https://graphql.org/learn/
|
|
885
|
+
*
|
|
886
|
+
* See the FHIR GraphQL documentation for FHIR specific details: https://www.hl7.org/fhir/graphql.html
|
|
887
|
+
*
|
|
888
|
+
* @param query The GraphQL query.
|
|
889
|
+
* @param operationName Optional GraphQL operation name.
|
|
890
|
+
* @param variables Optional GraphQL variables.
|
|
891
|
+
* @param options Optional fetch options.
|
|
892
|
+
* @returns The GraphQL result.
|
|
893
|
+
*/
|
|
894
|
+
graphql(query: string, operationName?: string | null, variables?: any, options?: RequestInit): Promise<any>;
|
|
847
895
|
getActiveLogin(): LoginState | undefined;
|
|
848
896
|
setActiveLogin(login: LoginState): Promise<void>;
|
|
849
897
|
getAccessToken(): string | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FhirPathFunction } from './functions';
|
|
2
2
|
export interface TypedValue {
|
|
3
|
-
readonly type:
|
|
3
|
+
readonly type: string;
|
|
4
4
|
readonly value: any;
|
|
5
5
|
}
|
|
6
6
|
export interface Atom {
|
|
@@ -107,7 +107,9 @@ export declare class IsAtom implements Atom {
|
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* 6.5.1. and
|
|
110
|
-
* Returns true if both operands evaluate to true,
|
|
110
|
+
* Returns true if both operands evaluate to true,
|
|
111
|
+
* false if either operand evaluates to false,
|
|
112
|
+
* and the empty collection otherwise.
|
|
111
113
|
*/
|
|
112
114
|
export declare class AndAtom implements Atom {
|
|
113
115
|
readonly left: Atom;
|
|
@@ -125,7 +127,7 @@ export declare class OrAtom implements Atom {
|
|
|
125
127
|
* 6.5.4. xor
|
|
126
128
|
* Returns true if exactly one of the operands evaluates to true,
|
|
127
129
|
* false if either both operands evaluate to true or both operands evaluate to false,
|
|
128
|
-
* and the empty collection
|
|
130
|
+
* and the empty collection otherwise.
|
|
129
131
|
*/
|
|
130
132
|
export declare class XorAtom implements Atom {
|
|
131
133
|
readonly left: Atom;
|
|
@@ -136,8 +138,8 @@ export declare class XorAtom implements Atom {
|
|
|
136
138
|
export declare class FunctionAtom implements Atom {
|
|
137
139
|
readonly name: string;
|
|
138
140
|
readonly args: Atom[];
|
|
139
|
-
readonly impl:
|
|
140
|
-
constructor(name: string, args: Atom[], impl:
|
|
141
|
+
readonly impl: FhirPathFunction;
|
|
142
|
+
constructor(name: string, args: Atom[], impl: FhirPathFunction);
|
|
141
143
|
eval(context: TypedValue[]): TypedValue[];
|
|
142
144
|
}
|
|
143
145
|
export declare class IndexerAtom implements Atom {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FhirPathAtom } from './atoms';
|
|
1
|
+
import { FhirPathAtom, TypedValue } from './atoms';
|
|
2
2
|
/**
|
|
3
3
|
* Parses a FHIRPath expression into an AST.
|
|
4
4
|
* The result can be used to evaluate the expression against a resource or other object.
|
|
@@ -14,4 +14,11 @@ export declare function parseFhirPath(input: string): FhirPathAtom;
|
|
|
14
14
|
* @param context The resource or object to evaluate the expression against.
|
|
15
15
|
* @returns The result of the FHIRPath expression against the resource or object.
|
|
16
16
|
*/
|
|
17
|
-
export declare function evalFhirPath(
|
|
17
|
+
export declare function evalFhirPath(expression: string, input: unknown): unknown[];
|
|
18
|
+
/**
|
|
19
|
+
* Evaluates a FHIRPath expression against a resource or other object.
|
|
20
|
+
* @param input The FHIRPath expression to parse.
|
|
21
|
+
* @param context The resource or object to evaluate the expression against.
|
|
22
|
+
* @returns The result of the FHIRPath expression against the resource or object.
|
|
23
|
+
*/
|
|
24
|
+
export declare function evalFhirPathTyped(expression: string, input: TypedValue[]): TypedValue[];
|
|
@@ -20,6 +20,17 @@ export declare function toTypedValue(value: unknown): TypedValue;
|
|
|
20
20
|
* @returns The converted boolean value according to FHIRPath rules.
|
|
21
21
|
*/
|
|
22
22
|
export declare function toJsBoolean(obj: TypedValue[]): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the value of the property and the property type.
|
|
25
|
+
* Some property definitions support multiple types.
|
|
26
|
+
* For example, "Observation.value[x]" can be "valueString", "valueInteger", "valueQuantity", etc.
|
|
27
|
+
* According to the spec, there can only be one property for a given element definition.
|
|
28
|
+
* This function returns the value and the type.
|
|
29
|
+
* @param input The base context (FHIR resource or backbone element).
|
|
30
|
+
* @param path The property path.
|
|
31
|
+
* @returns The value of the property and the property type.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getTypedPropertyValue(input: TypedValue, path: string): TypedValue[] | TypedValue | undefined;
|
|
23
34
|
/**
|
|
24
35
|
* Removes duplicates in array using FHIRPath equality rules.
|
|
25
36
|
* @param arr The input array.
|
|
@@ -12,6 +12,11 @@ export declare class ReadablePromise<T> implements Promise<T> {
|
|
|
12
12
|
* @returns True if the Promise is pending.
|
|
13
13
|
*/
|
|
14
14
|
isPending(): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Returns true if the promise resolved successfully.
|
|
17
|
+
* @returns True if the Promise resolved successfully.
|
|
18
|
+
*/
|
|
19
|
+
isOk(): boolean;
|
|
15
20
|
/**
|
|
16
21
|
* Attempts to read the value of the promise.
|
|
17
22
|
* If the promise is pending, this method will throw a promise.
|
package/dist/types/search.d.ts
CHANGED
|
@@ -38,11 +38,13 @@ export declare enum Operator {
|
|
|
38
38
|
CONTAINS = "contains",
|
|
39
39
|
EXACT = "exact",
|
|
40
40
|
TEXT = "text",
|
|
41
|
+
NOT = "not",
|
|
41
42
|
ABOVE = "above",
|
|
42
43
|
BELOW = "below",
|
|
43
44
|
IN = "in",
|
|
44
45
|
NOT_IN = "not-in",
|
|
45
|
-
OF_TYPE = "of-type"
|
|
46
|
+
OF_TYPE = "of-type",
|
|
47
|
+
MISSING = "missing"
|
|
46
48
|
}
|
|
47
49
|
/**
|
|
48
50
|
* Parses a URL into a SearchRequest.
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementDefinition, SearchParameter, StructureDefinition } from '@medplum/fhirtypes';
|
|
1
|
+
import { Bundle, ElementDefinition, SearchParameter, StructureDefinition } from '@medplum/fhirtypes';
|
|
2
2
|
/**
|
|
3
3
|
* List of property types.
|
|
4
4
|
* http://www.hl7.org/fhir/valueset-defined-types.html
|
|
@@ -38,7 +38,6 @@ export declare enum PropertyType {
|
|
|
38
38
|
Ratio = "Ratio",
|
|
39
39
|
Reference = "Reference",
|
|
40
40
|
RelatedArtifact = "RelatedArtifact",
|
|
41
|
-
Resource = "Resource",
|
|
42
41
|
SampledData = "SampledData",
|
|
43
42
|
Signature = "Signature",
|
|
44
43
|
SubstanceAmount = "SubstanceAmount",
|
|
@@ -118,9 +117,15 @@ export interface TypeSchema {
|
|
|
118
117
|
/**
|
|
119
118
|
* Creates a new empty IndexedStructureDefinition.
|
|
120
119
|
* @returns The empty IndexedStructureDefinition.
|
|
120
|
+
* @deprecated Use globalSchema
|
|
121
121
|
*/
|
|
122
122
|
export declare function createSchema(): IndexedStructureDefinition;
|
|
123
123
|
export declare function createTypeSchema(typeName: string, description: string | undefined): TypeSchema;
|
|
124
|
+
/**
|
|
125
|
+
* Indexes a bundle of StructureDefinitions for faster lookup.
|
|
126
|
+
* @param bundle A FHIR bundle StructureDefinition resources.
|
|
127
|
+
*/
|
|
128
|
+
export declare function indexStructureDefinitionBundle(bundle: Bundle): void;
|
|
124
129
|
/**
|
|
125
130
|
* Indexes a StructureDefinition for fast lookup.
|
|
126
131
|
* See comments on IndexedStructureDefinition for more details.
|
|
@@ -136,4 +141,8 @@ export declare function indexStructureDefinition(schema: IndexedStructureDefinit
|
|
|
136
141
|
*/
|
|
137
142
|
export declare function indexSearchParameter(schema: IndexedStructureDefinition, searchParam: SearchParameter): void;
|
|
138
143
|
export declare function buildTypeName(components: string[]): string;
|
|
139
|
-
export declare function getPropertyDisplayName(
|
|
144
|
+
export declare function getPropertyDisplayName(path: string): string;
|
|
145
|
+
/**
|
|
146
|
+
* Global schema singleton.
|
|
147
|
+
*/
|
|
148
|
+
export declare const globalSchema: IndexedStructureDefinition;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medplum/core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.19",
|
|
4
4
|
"description": "Medplum TS/JS Library",
|
|
5
5
|
"author": "Medplum <hello@medplum.com>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"test": "jest"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@medplum/
|
|
20
|
+
"@medplum/definitions": "0.9.19",
|
|
21
|
+
"@medplum/fhirtypes": "0.9.19"
|
|
21
22
|
},
|
|
22
23
|
"peerDependencies": {
|
|
23
24
|
"pdfmake": "0.2.5"
|
package/wget-log
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
--2022-06-07 14:46:15-- https://storage.medplum.com/binary/1edc2089-033f-4178-a829-ba8d28cc510b/09f34af8-9e37-4960-9c1c-6213706131f4?Expires=1654641902
|
|
2
|
+
Resolving storage.medplum.com (storage.medplum.com)... 52.84.162.127, 52.84.162.94, 52.84.162.128, ...
|
|
3
|
+
Connecting to storage.medplum.com (storage.medplum.com)|52.84.162.127|:443... connected.
|
|
4
|
+
HTTP request sent, awaiting response... 403 Forbidden
|
|
5
|
+
2022-06-07 14:46:15 ERROR 403: Forbidden.
|
|
6
|
+
|