@medplum/core 2.0.26 → 2.0.28
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/esm/index.mjs +4 -4
- package/dist/esm/index.mjs.map +4 -4
- package/dist/types/client.d.ts +36 -5
- package/dist/types/config.d.ts +1 -0
- package/dist/types/fhirpath/atoms.d.ts +6 -1
- package/dist/types/fhirpath/utils.d.ts +1 -0
- package/dist/types/hl7.d.ts +76 -1
- package/package.json +1 -1
- package/dist/types/eventtarget.d.ts +0 -13
package/dist/types/client.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { AccessPolicy, Binary, BulkDataExport, Bundle, Communication, ExtractResource, Identifier, Media, OperationOutcome, Project, ProjectMembership, ProjectSecret, Reference, Resource, ResourceType, UserConfiguration, ValueSet } from '@medplum/fhirtypes';
|
|
1
|
+
import { AccessPolicy, Attachment, Binary, BulkDataExport, Bundle, Communication, ExtractResource, Identifier, Media, OperationOutcome, Project, ProjectMembership, ProjectMembershipAccess, ProjectSecret, Reference, Resource, ResourceType, UserConfiguration, ValueSet } from '@medplum/fhirtypes';
|
|
2
2
|
/** @ts-ignore */
|
|
3
3
|
import type { CustomTableLayout, TDocumentDefinitions, TFontDictionary } from 'pdfmake/interfaces';
|
|
4
|
-
import { EventTarget } from './eventtarget';
|
|
5
4
|
import { Hl7Message } from './hl7';
|
|
6
5
|
import { ReadablePromise } from './readablepromise';
|
|
7
6
|
import { ClientStorage } from './storage';
|
|
@@ -268,13 +267,20 @@ export interface BotEvent<T = Resource | Hl7Message | string | Record<string, an
|
|
|
268
267
|
readonly input: T;
|
|
269
268
|
readonly secrets: Record<string, ProjectSecret>;
|
|
270
269
|
}
|
|
271
|
-
export interface
|
|
270
|
+
export interface InviteRequest {
|
|
272
271
|
resourceType: 'Patient' | 'Practitioner' | 'RelatedPerson';
|
|
273
272
|
firstName: string;
|
|
274
273
|
lastName: string;
|
|
275
274
|
email?: string;
|
|
275
|
+
externalId?: string;
|
|
276
|
+
password?: string;
|
|
276
277
|
sendEmail?: boolean;
|
|
278
|
+
membership?: Partial<ProjectMembership>;
|
|
279
|
+
/** @deprecated Use membership.accessPolicy instead. */
|
|
277
280
|
accessPolicy?: Reference<AccessPolicy>;
|
|
281
|
+
/** @deprecated Use membership.access instead. */
|
|
282
|
+
access?: ProjectMembershipAccess[];
|
|
283
|
+
/** @deprecated Use membership.admin instead. */
|
|
278
284
|
admin?: boolean;
|
|
279
285
|
}
|
|
280
286
|
/**
|
|
@@ -990,6 +996,31 @@ export declare class MedplumClient extends EventTarget {
|
|
|
990
996
|
* @returns The result of the create operation.
|
|
991
997
|
*/
|
|
992
998
|
createResourceIfNoneExist<T extends Resource>(resource: T, query: string, options?: RequestInit): Promise<T>;
|
|
999
|
+
/**
|
|
1000
|
+
* Creates a FHIR `Attachment` with the provided data content.
|
|
1001
|
+
*
|
|
1002
|
+
* This is a convenience method for creating a `Binary` resource and then creating an `Attachment` element.
|
|
1003
|
+
*
|
|
1004
|
+
* The `data` parameter can be a string or a `File` object.
|
|
1005
|
+
*
|
|
1006
|
+
* A `File` object often comes from a `<input type="file">` element.
|
|
1007
|
+
*
|
|
1008
|
+
* Example:
|
|
1009
|
+
*
|
|
1010
|
+
* ```typescript
|
|
1011
|
+
* const result = await medplum.createAttachment(myFile, 'test.jpg', 'image/jpeg');
|
|
1012
|
+
* console.log(result);
|
|
1013
|
+
* ```
|
|
1014
|
+
*
|
|
1015
|
+
* See the FHIR "create" operation for full details: https://www.hl7.org/fhir/http.html#create
|
|
1016
|
+
* @category Create
|
|
1017
|
+
* @param data The binary data to upload.
|
|
1018
|
+
* @param filename Optional filename for the binary.
|
|
1019
|
+
* @param contentType Content type for the binary.
|
|
1020
|
+
* @param onProgress Optional callback for progress events.
|
|
1021
|
+
* @returns The result of the create operation.
|
|
1022
|
+
*/
|
|
1023
|
+
createAttachment(data: string | File | Blob | Uint8Array, filename: string | undefined, contentType: string, onProgress?: (e: ProgressEvent) => void): Promise<Attachment>;
|
|
993
1024
|
/**
|
|
994
1025
|
* Creates a FHIR `Binary` resource with the provided data content.
|
|
995
1026
|
*
|
|
@@ -1565,10 +1596,10 @@ export declare class MedplumClient extends EventTarget {
|
|
|
1565
1596
|
/**
|
|
1566
1597
|
* Invite a user to a project.
|
|
1567
1598
|
* @param projectId The project ID.
|
|
1568
|
-
* @param body The
|
|
1599
|
+
* @param body The InviteRequest.
|
|
1569
1600
|
* @returns Promise that returns a project membership or an operation outcome.
|
|
1570
1601
|
*/
|
|
1571
|
-
invite(projectId: string, body:
|
|
1602
|
+
invite(projectId: string, body: InviteRequest): Promise<ProjectMembership | OperationOutcome>;
|
|
1572
1603
|
/**
|
|
1573
1604
|
* Makes a POST request to the tokens endpoint.
|
|
1574
1605
|
* See: https://openid.net/specs/openid-connect-core-1_0.html#TokenEndpoint
|
package/dist/types/config.d.ts
CHANGED
|
@@ -93,6 +93,12 @@ export declare class AndAtom extends BooleanInfixOperatorAtom {
|
|
|
93
93
|
constructor(left: Atom, right: Atom);
|
|
94
94
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
95
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* 6.5.2. or
|
|
98
|
+
* Returns false if both operands evaluate to false,
|
|
99
|
+
* true if either operand evaluates to true,
|
|
100
|
+
* and empty ({ }) otherwise:
|
|
101
|
+
*/
|
|
96
102
|
export declare class OrAtom extends BooleanInfixOperatorAtom {
|
|
97
103
|
constructor(left: Atom, right: Atom);
|
|
98
104
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
@@ -116,7 +122,6 @@ export declare class XorAtom extends BooleanInfixOperatorAtom {
|
|
|
116
122
|
export declare class ImpliesAtom extends BooleanInfixOperatorAtom {
|
|
117
123
|
constructor(left: Atom, right: Atom);
|
|
118
124
|
eval(context: AtomContext, input: TypedValue[]): TypedValue[];
|
|
119
|
-
private isValidCollectionLength;
|
|
120
125
|
}
|
|
121
126
|
export declare class FunctionAtom implements Atom {
|
|
122
127
|
readonly name: string;
|
|
@@ -20,6 +20,7 @@ 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
|
+
export declare function singleton(collection: TypedValue[], type?: string): TypedValue | undefined;
|
|
23
24
|
/**
|
|
24
25
|
* Returns the value of the property and the property type.
|
|
25
26
|
* Some property definitions support multiple types.
|
package/dist/types/hl7.d.ts
CHANGED
|
@@ -37,18 +37,42 @@ export declare class Hl7Message {
|
|
|
37
37
|
* @param context Optional HL7 parsing context.
|
|
38
38
|
*/
|
|
39
39
|
constructor(segments: Hl7Segment[], context?: Hl7Context);
|
|
40
|
+
/**
|
|
41
|
+
* Returns the HL7 message header.
|
|
42
|
+
* @returns The HL7 message header.
|
|
43
|
+
*/
|
|
44
|
+
get header(): Hl7Segment;
|
|
40
45
|
/**
|
|
41
46
|
* Returns an HL7 segment by index or by name.
|
|
42
47
|
* @param index The HL7 segment index or name.
|
|
43
48
|
* @returns The HL7 segment if found; otherwise, undefined.
|
|
49
|
+
* @deprecated Use getSegment() instead. This method will be removed in a future release.
|
|
44
50
|
*/
|
|
45
51
|
get(index: number | string): Hl7Segment | undefined;
|
|
46
52
|
/**
|
|
47
53
|
* Returns all HL7 segments of a given name.
|
|
48
54
|
* @param name The HL7 segment name.
|
|
49
55
|
* @returns An array of HL7 segments with the specified name.
|
|
56
|
+
* @deprecated Use getAllSegments() instead. This method will be removed in a future release.
|
|
50
57
|
*/
|
|
51
58
|
getAll(name: string): Hl7Segment[];
|
|
59
|
+
/**
|
|
60
|
+
* Returns an HL7 segment by index or by name.
|
|
61
|
+
*
|
|
62
|
+
* When using a numeric index, the first segment (usually the MSH header segment) is at index 0.
|
|
63
|
+
*
|
|
64
|
+
* When using a string index, this method returns the first segment with the specified name.
|
|
65
|
+
*
|
|
66
|
+
* @param index The HL7 segment index or name.
|
|
67
|
+
* @returns The HL7 segment if found; otherwise, undefined.
|
|
68
|
+
*/
|
|
69
|
+
getSegment(index: number | string): Hl7Segment | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Returns all HL7 segments of a given name.
|
|
72
|
+
* @param name The HL7 segment name.
|
|
73
|
+
* @returns An array of HL7 segments with the specified name.
|
|
74
|
+
*/
|
|
75
|
+
getAllSegments(name: string): Hl7Segment[];
|
|
52
76
|
/**
|
|
53
77
|
* Returns the HL7 message as a string.
|
|
54
78
|
* @returns The HL7 message as a string.
|
|
@@ -59,6 +83,7 @@ export declare class Hl7Message {
|
|
|
59
83
|
* @returns The HL7 "ACK" message.
|
|
60
84
|
*/
|
|
61
85
|
buildAck(): Hl7Message;
|
|
86
|
+
private buildAckMessageType;
|
|
62
87
|
/**
|
|
63
88
|
* Parses an HL7 message string into an Hl7Message object.
|
|
64
89
|
* @param text The HL7 message text.
|
|
@@ -77,7 +102,7 @@ export declare class Hl7Segment {
|
|
|
77
102
|
readonly fields: Hl7Field[];
|
|
78
103
|
/**
|
|
79
104
|
* Creates a new HL7 segment.
|
|
80
|
-
* @param fields The HL7 fields.
|
|
105
|
+
* @param fields The HL7 fields. The first field is the segment name.
|
|
81
106
|
* @param context Optional HL7 parsing context.
|
|
82
107
|
*/
|
|
83
108
|
constructor(fields: Hl7Field[] | string[], context?: Hl7Context);
|
|
@@ -85,8 +110,42 @@ export declare class Hl7Segment {
|
|
|
85
110
|
* Returns an HL7 field by index.
|
|
86
111
|
* @param index The HL7 field index.
|
|
87
112
|
* @returns The HL7 field.
|
|
113
|
+
* @deprecated Use getSegment() instead. This method includes the segment name in the index, which leads to confusing behavior. This method will be removed in a future release.
|
|
88
114
|
*/
|
|
89
115
|
get(index: number): Hl7Field;
|
|
116
|
+
/**
|
|
117
|
+
* Returns an HL7 field by index.
|
|
118
|
+
*
|
|
119
|
+
* Note that the index is 1-based, not 0-based.
|
|
120
|
+
*
|
|
121
|
+
* For example, to get the first field, use `getField(1)`.
|
|
122
|
+
*
|
|
123
|
+
* This aligns with HL7 field names such as PID.1, PID.2, etc.
|
|
124
|
+
*
|
|
125
|
+
* Field zero is the segment name.
|
|
126
|
+
*
|
|
127
|
+
* @param index The HL7 field index.
|
|
128
|
+
* @returns The HL7 field.
|
|
129
|
+
*/
|
|
130
|
+
getField(index: number): Hl7Field;
|
|
131
|
+
/**
|
|
132
|
+
* Returns an HL7 component by field index and component index.
|
|
133
|
+
*
|
|
134
|
+
* This is a shortcut for `getField(field).getComponent(component)`.
|
|
135
|
+
*
|
|
136
|
+
* Note that both indexex are 1-based, not 0-based.
|
|
137
|
+
*
|
|
138
|
+
* For example, to get the first component, use `getComponent(1, 1)`.
|
|
139
|
+
*
|
|
140
|
+
* This aligns with HL7 component names such as MSH.9.2.
|
|
141
|
+
*
|
|
142
|
+
* @param fieldIndex The HL7 field index.
|
|
143
|
+
* @param component The component index.
|
|
144
|
+
* @param subcomponent Optional subcomponent index.
|
|
145
|
+
* @param repetition Optional repetition index.
|
|
146
|
+
* @returns The string value of the specified component.
|
|
147
|
+
*/
|
|
148
|
+
getComponent(fieldIndex: number, component: number, subcomponent?: number, repetition?: number): string;
|
|
90
149
|
/**
|
|
91
150
|
* Returns the HL7 segment as a string.
|
|
92
151
|
* @returns The HL7 segment as a string.
|
|
@@ -119,8 +178,24 @@ export declare class Hl7Field {
|
|
|
119
178
|
* @param subcomponent Optional subcomponent index.
|
|
120
179
|
* @param repetition Optional repetition index.
|
|
121
180
|
* @returns The string value of the specified component.
|
|
181
|
+
* @deprecated Use getComponent() instead. This method will be removed in a future release.
|
|
122
182
|
*/
|
|
123
183
|
get(component: number, subcomponent?: number, repetition?: number): string;
|
|
184
|
+
/**
|
|
185
|
+
* Returns an HL7 component by index.
|
|
186
|
+
*
|
|
187
|
+
* Note that the index is 1-based, not 0-based.
|
|
188
|
+
*
|
|
189
|
+
* For example, to get the first component, use `getComponent(1)`.
|
|
190
|
+
*
|
|
191
|
+
* This aligns with HL7 component names such as MSH.9.2.
|
|
192
|
+
*
|
|
193
|
+
* @param component The component index.
|
|
194
|
+
* @param subcomponent Optional subcomponent index.
|
|
195
|
+
* @param repetition Optional repetition index.
|
|
196
|
+
* @returns The string value of the specified component.
|
|
197
|
+
*/
|
|
198
|
+
getComponent(component: number, subcomponent?: number, repetition?: number): string;
|
|
124
199
|
/**
|
|
125
200
|
* Returns the HL7 field as a string.
|
|
126
201
|
* @returns The HL7 field as a string.
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
interface Event {
|
|
2
|
-
readonly type: string;
|
|
3
|
-
readonly defaultPrevented?: boolean;
|
|
4
|
-
}
|
|
5
|
-
type EventListener = (e: Event) => void;
|
|
6
|
-
export declare class EventTarget {
|
|
7
|
-
private readonly listeners;
|
|
8
|
-
constructor();
|
|
9
|
-
addEventListener(type: string, callback: EventListener): void;
|
|
10
|
-
removeEventListeneer(type: string, callback: EventListener): void;
|
|
11
|
-
dispatchEvent(event: Event): boolean;
|
|
12
|
-
}
|
|
13
|
-
export {};
|