@medplum/core 0.9.2 → 0.9.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.js +2608 -2644
- 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 +2606 -2644
- 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/cache.d.ts +12 -11
- package/dist/types/client.d.ts +713 -644
- package/dist/types/crypto.d.ts +9 -9
- package/dist/types/eventtarget.d.ts +13 -13
- package/dist/types/format.d.ts +15 -15
- package/dist/types/hl7.d.ts +43 -43
- package/dist/types/index.d.ts +10 -9
- package/dist/types/jwt.d.ts +5 -5
- package/dist/types/outcomes.d.ts +22 -22
- package/dist/types/readablepromise.d.ts +43 -0
- package/dist/types/search.d.ts +62 -62
- package/dist/types/searchparams.d.ts +35 -35
- package/dist/types/storage.d.ts +47 -47
- package/dist/types/types.d.ts +139 -139
- package/dist/types/utils.d.ts +131 -125
- package/package.json +2 -2
- package/dist/types/repo.d.ts +0 -116
package/dist/types/crypto.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns a cryptographically secure random string.
|
|
3
|
-
*/
|
|
4
|
-
export declare function getRandomString(): string;
|
|
5
|
-
/**
|
|
6
|
-
* Encrypts a string with SHA256 encryption.
|
|
7
|
-
* @param str
|
|
8
|
-
*/
|
|
9
|
-
export declare function encryptSHA256(str: string): Promise<ArrayBuffer>;
|
|
1
|
+
/**
|
|
2
|
+
* Returns a cryptographically secure random string.
|
|
3
|
+
*/
|
|
4
|
+
export declare function getRandomString(): string;
|
|
5
|
+
/**
|
|
6
|
+
* Encrypts a string with SHA256 encryption.
|
|
7
|
+
* @param str
|
|
8
|
+
*/
|
|
9
|
+
export declare function encryptSHA256(str: string): Promise<ArrayBuffer>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
interface Event {
|
|
2
|
-
readonly type: string;
|
|
3
|
-
readonly defaultPrevented?: boolean;
|
|
4
|
-
}
|
|
5
|
-
declare type EventListener = (e: Event) => void;
|
|
6
|
-
export declare class EventTarget {
|
|
7
|
-
#private;
|
|
8
|
-
constructor();
|
|
9
|
-
addEventListener(type: string, callback: EventListener): void;
|
|
10
|
-
removeEventListeneer(type: string, callback: EventListener): void;
|
|
11
|
-
dispatchEvent(event: Event): boolean;
|
|
12
|
-
}
|
|
13
|
-
export {};
|
|
1
|
+
interface Event {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
readonly defaultPrevented?: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare type EventListener = (e: Event) => void;
|
|
6
|
+
export declare class EventTarget {
|
|
7
|
+
#private;
|
|
8
|
+
constructor();
|
|
9
|
+
addEventListener(type: string, callback: EventListener): void;
|
|
10
|
+
removeEventListeneer(type: string, callback: EventListener): void;
|
|
11
|
+
dispatchEvent(event: Event): boolean;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
package/dist/types/format.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Address, HumanName } from '@medplum/fhirtypes';
|
|
2
|
-
export interface AddressFormatOptions {
|
|
3
|
-
all?: boolean;
|
|
4
|
-
use?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export interface HumanNameFormatOptions {
|
|
7
|
-
all?: boolean;
|
|
8
|
-
prefix?: boolean;
|
|
9
|
-
suffix?: boolean;
|
|
10
|
-
use?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare function formatAddress(address: Address, options?: AddressFormatOptions): string;
|
|
13
|
-
export declare function formatHumanName(name: HumanName, options?: HumanNameFormatOptions): string;
|
|
14
|
-
export declare function formatGivenName(name: HumanName): string;
|
|
15
|
-
export declare function formatFamilyName(name: HumanName): string;
|
|
1
|
+
import { Address, HumanName } from '@medplum/fhirtypes';
|
|
2
|
+
export interface AddressFormatOptions {
|
|
3
|
+
all?: boolean;
|
|
4
|
+
use?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface HumanNameFormatOptions {
|
|
7
|
+
all?: boolean;
|
|
8
|
+
prefix?: boolean;
|
|
9
|
+
suffix?: boolean;
|
|
10
|
+
use?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function formatAddress(address: Address, options?: AddressFormatOptions): string;
|
|
13
|
+
export declare function formatHumanName(name: HumanName, options?: HumanNameFormatOptions): string;
|
|
14
|
+
export declare function formatGivenName(name: HumanName): string;
|
|
15
|
+
export declare function formatFamilyName(name: HumanName): string;
|
package/dist/types/hl7.d.ts
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
export declare const SEGMENT_SEPARATOR = "\r";
|
|
2
|
-
export declare const FIELD_SEPARATOR = "|";
|
|
3
|
-
export declare const COMPONENT_SEPARATOR = "^";
|
|
4
|
-
/**
|
|
5
|
-
* The Hl7Message class represents one HL7 message.
|
|
6
|
-
* A message is a collection of segments.
|
|
7
|
-
* Note that we do not strictly parse messages, and only use default delimeters.
|
|
8
|
-
*/
|
|
9
|
-
export declare class Hl7Message {
|
|
10
|
-
readonly segments: Hl7Segment[];
|
|
11
|
-
constructor(segments: Hl7Segment[]);
|
|
12
|
-
get(index: number | string): Hl7Segment | undefined;
|
|
13
|
-
getAll(name: string): Hl7Segment[];
|
|
14
|
-
toString(): string;
|
|
15
|
-
buildAck(): Hl7Message;
|
|
16
|
-
static parse(text: string): Hl7Message;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* The Hl7Segment class represents one HL7 segment.
|
|
20
|
-
* A segment is a collection of fields.
|
|
21
|
-
* The name field is the first field.
|
|
22
|
-
* Note that we do not strictly parse messages, and only use default delimeters.
|
|
23
|
-
*/
|
|
24
|
-
export declare class Hl7Segment {
|
|
25
|
-
readonly name: string;
|
|
26
|
-
readonly fields: Hl7Field[];
|
|
27
|
-
constructor(fields: Hl7Field[] | string[]);
|
|
28
|
-
get(index: number): Hl7Field;
|
|
29
|
-
toString(): string;
|
|
30
|
-
static parse(text: string): Hl7Segment;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* The Hl7Field class represents one HL7 field.
|
|
34
|
-
* A field is a collection of components.
|
|
35
|
-
* Note that we do not strictly parse messages, and only use default delimeters.
|
|
36
|
-
*/
|
|
37
|
-
export declare class Hl7Field {
|
|
38
|
-
readonly components: string[];
|
|
39
|
-
constructor(components: string[]);
|
|
40
|
-
get(index: number): string;
|
|
41
|
-
toString(): string;
|
|
42
|
-
static parse(text: string): Hl7Field;
|
|
43
|
-
}
|
|
1
|
+
export declare const SEGMENT_SEPARATOR = "\r";
|
|
2
|
+
export declare const FIELD_SEPARATOR = "|";
|
|
3
|
+
export declare const COMPONENT_SEPARATOR = "^";
|
|
4
|
+
/**
|
|
5
|
+
* The Hl7Message class represents one HL7 message.
|
|
6
|
+
* A message is a collection of segments.
|
|
7
|
+
* Note that we do not strictly parse messages, and only use default delimeters.
|
|
8
|
+
*/
|
|
9
|
+
export declare class Hl7Message {
|
|
10
|
+
readonly segments: Hl7Segment[];
|
|
11
|
+
constructor(segments: Hl7Segment[]);
|
|
12
|
+
get(index: number | string): Hl7Segment | undefined;
|
|
13
|
+
getAll(name: string): Hl7Segment[];
|
|
14
|
+
toString(): string;
|
|
15
|
+
buildAck(): Hl7Message;
|
|
16
|
+
static parse(text: string): Hl7Message;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The Hl7Segment class represents one HL7 segment.
|
|
20
|
+
* A segment is a collection of fields.
|
|
21
|
+
* The name field is the first field.
|
|
22
|
+
* Note that we do not strictly parse messages, and only use default delimeters.
|
|
23
|
+
*/
|
|
24
|
+
export declare class Hl7Segment {
|
|
25
|
+
readonly name: string;
|
|
26
|
+
readonly fields: Hl7Field[];
|
|
27
|
+
constructor(fields: Hl7Field[] | string[]);
|
|
28
|
+
get(index: number): Hl7Field;
|
|
29
|
+
toString(): string;
|
|
30
|
+
static parse(text: string): Hl7Segment;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The Hl7Field class represents one HL7 field.
|
|
34
|
+
* A field is a collection of components.
|
|
35
|
+
* Note that we do not strictly parse messages, and only use default delimeters.
|
|
36
|
+
*/
|
|
37
|
+
export declare class Hl7Field {
|
|
38
|
+
readonly components: string[];
|
|
39
|
+
constructor(components: string[]);
|
|
40
|
+
get(index: number): string;
|
|
41
|
+
toString(): string;
|
|
42
|
+
static parse(text: string): Hl7Field;
|
|
43
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
1
|
+
export * from './cache';
|
|
2
|
+
export * from './client';
|
|
3
|
+
export * from './format';
|
|
4
|
+
export * from './hl7';
|
|
5
|
+
export * from './outcomes';
|
|
6
|
+
export * from './readablepromise';
|
|
7
|
+
export * from './search';
|
|
8
|
+
export * from './searchparams';
|
|
9
|
+
export * from './types';
|
|
10
|
+
export * from './utils';
|
package/dist/types/jwt.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parses the JWT payload.
|
|
3
|
-
* @param token JWT token
|
|
4
|
-
*/
|
|
5
|
-
export declare function parseJWTPayload(token: string): Record<string, number | string>;
|
|
1
|
+
/**
|
|
2
|
+
* Parses the JWT payload.
|
|
3
|
+
* @param token JWT token
|
|
4
|
+
*/
|
|
5
|
+
export declare function parseJWTPayload(token: string): Record<string, number | string>;
|
package/dist/types/outcomes.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { OperationOutcome } from '@medplum/fhirtypes';
|
|
2
|
-
export declare const allOk: OperationOutcome;
|
|
3
|
-
export declare const created: OperationOutcome;
|
|
4
|
-
export declare const notModified: OperationOutcome;
|
|
5
|
-
export declare const notFound: OperationOutcome;
|
|
6
|
-
export declare const gone: OperationOutcome;
|
|
7
|
-
export declare const accessDenied: OperationOutcome;
|
|
8
|
-
export declare function badRequest(details: string, expression?: string): OperationOutcome;
|
|
9
|
-
export declare function isOk(outcome: OperationOutcome): boolean;
|
|
10
|
-
export declare function isNotFound(outcome: OperationOutcome): boolean;
|
|
11
|
-
export declare function isGone(outcome: OperationOutcome): boolean;
|
|
12
|
-
export declare function getStatus(outcome: OperationOutcome): number;
|
|
13
|
-
/**
|
|
14
|
-
* Asserts that the operation completed successfully and that the resource is defined.
|
|
15
|
-
* @param outcome The operation outcome.
|
|
16
|
-
* @param resource The resource that may or may not have been returned.
|
|
17
|
-
*/
|
|
18
|
-
export declare function assertOk<T>(outcome: OperationOutcome, resource: T | undefined): asserts resource is T;
|
|
19
|
-
export declare class OperationOutcomeError extends Error {
|
|
20
|
-
readonly outcome: OperationOutcome;
|
|
21
|
-
constructor(outcome: OperationOutcome);
|
|
22
|
-
}
|
|
1
|
+
import { OperationOutcome } from '@medplum/fhirtypes';
|
|
2
|
+
export declare const allOk: OperationOutcome;
|
|
3
|
+
export declare const created: OperationOutcome;
|
|
4
|
+
export declare const notModified: OperationOutcome;
|
|
5
|
+
export declare const notFound: OperationOutcome;
|
|
6
|
+
export declare const gone: OperationOutcome;
|
|
7
|
+
export declare const accessDenied: OperationOutcome;
|
|
8
|
+
export declare function badRequest(details: string, expression?: string): OperationOutcome;
|
|
9
|
+
export declare function isOk(outcome: OperationOutcome): boolean;
|
|
10
|
+
export declare function isNotFound(outcome: OperationOutcome): boolean;
|
|
11
|
+
export declare function isGone(outcome: OperationOutcome): boolean;
|
|
12
|
+
export declare function getStatus(outcome: OperationOutcome): number;
|
|
13
|
+
/**
|
|
14
|
+
* Asserts that the operation completed successfully and that the resource is defined.
|
|
15
|
+
* @param outcome The operation outcome.
|
|
16
|
+
* @param resource The resource that may or may not have been returned.
|
|
17
|
+
*/
|
|
18
|
+
export declare function assertOk<T>(outcome: OperationOutcome, resource: T | undefined): asserts resource is T;
|
|
19
|
+
export declare class OperationOutcomeError extends Error {
|
|
20
|
+
readonly outcome: OperationOutcome;
|
|
21
|
+
constructor(outcome: OperationOutcome);
|
|
22
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ReadablePromise class wraps a request promise suitable for React Suspense.
|
|
3
|
+
* See: https://blog.logrocket.com/react-suspense-data-fetching/#wrappromise-js
|
|
4
|
+
* See: https://github.com/ovieokeh/suspense-data-fetching/blob/master/lib/api/wrapPromise.js
|
|
5
|
+
*/
|
|
6
|
+
export declare class ReadablePromise<T> implements Promise<T> {
|
|
7
|
+
#private;
|
|
8
|
+
readonly [Symbol.toStringTag]: string;
|
|
9
|
+
constructor(requestPromise: Promise<T>);
|
|
10
|
+
/**
|
|
11
|
+
* Returns true if the promise is pending.
|
|
12
|
+
* @returns True if the Promise is pending.
|
|
13
|
+
*/
|
|
14
|
+
isPending(): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Attempts to read the value of the promise.
|
|
17
|
+
* If the promise is pending, this method will throw a promise.
|
|
18
|
+
* If the promise rejected, this method will throw the rejection reason.
|
|
19
|
+
* If the promise resolved, this method will return the resolved value.
|
|
20
|
+
* @returns The resolved value of the Promise.
|
|
21
|
+
*/
|
|
22
|
+
read(): T;
|
|
23
|
+
/**
|
|
24
|
+
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
|
25
|
+
* @param onfulfilled The callback to execute when the Promise is resolved.
|
|
26
|
+
* @param onrejected The callback to execute when the Promise is rejected.
|
|
27
|
+
* @returns A Promise for the completion of which ever callback is executed.
|
|
28
|
+
*/
|
|
29
|
+
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
|
|
30
|
+
/**
|
|
31
|
+
* Attaches a callback for only the rejection of the Promise.
|
|
32
|
+
* @param onrejected The callback to execute when the Promise is rejected.
|
|
33
|
+
* @returns A Promise for the completion of the callback.
|
|
34
|
+
*/
|
|
35
|
+
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
|
|
38
|
+
* resolved value cannot be modified from the callback.
|
|
39
|
+
* @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected).
|
|
40
|
+
* @returns A Promise for the completion of the callback.
|
|
41
|
+
*/
|
|
42
|
+
finally(onfinally?: (() => void) | undefined | null): Promise<T>;
|
|
43
|
+
}
|
package/dist/types/search.d.ts
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
export declare const DEFAULT_SEARCH_COUNT = 20;
|
|
2
|
-
export interface SearchRequest {
|
|
3
|
-
readonly resourceType: string;
|
|
4
|
-
filters?: Filter[];
|
|
5
|
-
sortRules?: SortRule[];
|
|
6
|
-
offset?: number;
|
|
7
|
-
count?: number;
|
|
8
|
-
fields?: string[];
|
|
9
|
-
name?: string;
|
|
10
|
-
total?: 'none' | 'estimate' | 'accurate';
|
|
11
|
-
}
|
|
12
|
-
export interface Filter {
|
|
13
|
-
code: string;
|
|
14
|
-
operator: Operator;
|
|
15
|
-
value: string;
|
|
16
|
-
unitSystem?: string;
|
|
17
|
-
unitCode?: string;
|
|
18
|
-
}
|
|
19
|
-
export interface SortRule {
|
|
20
|
-
code: string;
|
|
21
|
-
descending?: boolean;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Search operators.
|
|
25
|
-
* These operators represent "modifiers" and "prefixes" in FHIR search.
|
|
26
|
-
* See: https://www.hl7.org/fhir/search.html
|
|
27
|
-
*/
|
|
28
|
-
export declare enum Operator {
|
|
29
|
-
EQUALS = "eq",
|
|
30
|
-
NOT_EQUALS = "ne",
|
|
31
|
-
GREATER_THAN = "gt",
|
|
32
|
-
LESS_THAN = "lt",
|
|
33
|
-
GREATER_THAN_OR_EQUALS = "ge",
|
|
34
|
-
LESS_THAN_OR_EQUALS = "le",
|
|
35
|
-
STARTS_AFTER = "sa",
|
|
36
|
-
ENDS_BEFORE = "eb",
|
|
37
|
-
APPROXIMATELY = "ap",
|
|
38
|
-
CONTAINS = "contains",
|
|
39
|
-
EXACT = "exact",
|
|
40
|
-
TEXT = "text",
|
|
41
|
-
ABOVE = "above",
|
|
42
|
-
BELOW = "below",
|
|
43
|
-
IN = "in",
|
|
44
|
-
NOT_IN = "not-in",
|
|
45
|
-
OF_TYPE = "of-type"
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Parses a URL into a SearchRequest.
|
|
49
|
-
*
|
|
50
|
-
* See the FHIR search spec: http://hl7.org/fhir/r4/search.html
|
|
51
|
-
*
|
|
52
|
-
* @param url The URL to parse.
|
|
53
|
-
* @returns Parsed search definition.
|
|
54
|
-
*/
|
|
55
|
-
export declare function parseSearchDefinition(url: string): SearchRequest;
|
|
56
|
-
/**
|
|
57
|
-
* Formats a search definition object into a query string.
|
|
58
|
-
* Note: The return value does not include the resource type.
|
|
59
|
-
* @param {!SearchRequest} definition The search definition.
|
|
60
|
-
* @returns Formatted URL.
|
|
61
|
-
*/
|
|
62
|
-
export declare function formatSearchQuery(definition: SearchRequest): string;
|
|
1
|
+
export declare const DEFAULT_SEARCH_COUNT = 20;
|
|
2
|
+
export interface SearchRequest {
|
|
3
|
+
readonly resourceType: string;
|
|
4
|
+
filters?: Filter[];
|
|
5
|
+
sortRules?: SortRule[];
|
|
6
|
+
offset?: number;
|
|
7
|
+
count?: number;
|
|
8
|
+
fields?: string[];
|
|
9
|
+
name?: string;
|
|
10
|
+
total?: 'none' | 'estimate' | 'accurate';
|
|
11
|
+
}
|
|
12
|
+
export interface Filter {
|
|
13
|
+
code: string;
|
|
14
|
+
operator: Operator;
|
|
15
|
+
value: string;
|
|
16
|
+
unitSystem?: string;
|
|
17
|
+
unitCode?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface SortRule {
|
|
20
|
+
code: string;
|
|
21
|
+
descending?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Search operators.
|
|
25
|
+
* These operators represent "modifiers" and "prefixes" in FHIR search.
|
|
26
|
+
* See: https://www.hl7.org/fhir/search.html
|
|
27
|
+
*/
|
|
28
|
+
export declare enum Operator {
|
|
29
|
+
EQUALS = "eq",
|
|
30
|
+
NOT_EQUALS = "ne",
|
|
31
|
+
GREATER_THAN = "gt",
|
|
32
|
+
LESS_THAN = "lt",
|
|
33
|
+
GREATER_THAN_OR_EQUALS = "ge",
|
|
34
|
+
LESS_THAN_OR_EQUALS = "le",
|
|
35
|
+
STARTS_AFTER = "sa",
|
|
36
|
+
ENDS_BEFORE = "eb",
|
|
37
|
+
APPROXIMATELY = "ap",
|
|
38
|
+
CONTAINS = "contains",
|
|
39
|
+
EXACT = "exact",
|
|
40
|
+
TEXT = "text",
|
|
41
|
+
ABOVE = "above",
|
|
42
|
+
BELOW = "below",
|
|
43
|
+
IN = "in",
|
|
44
|
+
NOT_IN = "not-in",
|
|
45
|
+
OF_TYPE = "of-type"
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Parses a URL into a SearchRequest.
|
|
49
|
+
*
|
|
50
|
+
* See the FHIR search spec: http://hl7.org/fhir/r4/search.html
|
|
51
|
+
*
|
|
52
|
+
* @param url The URL to parse.
|
|
53
|
+
* @returns Parsed search definition.
|
|
54
|
+
*/
|
|
55
|
+
export declare function parseSearchDefinition(url: string): SearchRequest;
|
|
56
|
+
/**
|
|
57
|
+
* Formats a search definition object into a query string.
|
|
58
|
+
* Note: The return value does not include the resource type.
|
|
59
|
+
* @param {!SearchRequest} definition The search definition.
|
|
60
|
+
* @returns Formatted URL.
|
|
61
|
+
*/
|
|
62
|
+
export declare function formatSearchQuery(definition: SearchRequest): string;
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { ElementDefinition, SearchParameter } from '@medplum/fhirtypes';
|
|
2
|
-
import { IndexedStructureDefinition } from './types';
|
|
3
|
-
export declare enum SearchParameterType {
|
|
4
|
-
BOOLEAN = "BOOLEAN",
|
|
5
|
-
NUMBER = "NUMBER",
|
|
6
|
-
QUANTITY = "QUANTITY",
|
|
7
|
-
TEXT = "TEXT",
|
|
8
|
-
REFERENCE = "REFERENCE",
|
|
9
|
-
DATE = "DATE",
|
|
10
|
-
DATETIME = "DATETIME",
|
|
11
|
-
PERIOD = "PERIOD"
|
|
12
|
-
}
|
|
13
|
-
export interface SearchParameterDetails {
|
|
14
|
-
readonly columnName: string;
|
|
15
|
-
readonly type: SearchParameterType;
|
|
16
|
-
readonly elementDefinition?: ElementDefinition;
|
|
17
|
-
readonly array?: boolean;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Returns the type details of a SearchParameter.
|
|
21
|
-
*
|
|
22
|
-
* The SearchParameter resource has a "type" parameter, but that is missing some critical information.
|
|
23
|
-
*
|
|
24
|
-
* For example:
|
|
25
|
-
* 1) The "date" type includes "date", "datetime", and "period".
|
|
26
|
-
* 2) The "token" type includes enums and booleans.
|
|
27
|
-
* 3) Arrays/multiple values are not reflected at all.
|
|
28
|
-
*
|
|
29
|
-
* @param structureDefinitions Collection of StructureDefinition resources indexed by name.
|
|
30
|
-
* @param resourceType The root resource type.
|
|
31
|
-
* @param searchParam The search parameter.
|
|
32
|
-
* @returns The search parameter type details.
|
|
33
|
-
*/
|
|
34
|
-
export declare function getSearchParameterDetails(structureDefinitions: IndexedStructureDefinition, resourceType: string, searchParam: SearchParameter): SearchParameterDetails;
|
|
35
|
-
export declare function getExpressionForResourceType(resourceType: string, expression: string): string | undefined;
|
|
1
|
+
import { ElementDefinition, SearchParameter } from '@medplum/fhirtypes';
|
|
2
|
+
import { IndexedStructureDefinition } from './types';
|
|
3
|
+
export declare enum SearchParameterType {
|
|
4
|
+
BOOLEAN = "BOOLEAN",
|
|
5
|
+
NUMBER = "NUMBER",
|
|
6
|
+
QUANTITY = "QUANTITY",
|
|
7
|
+
TEXT = "TEXT",
|
|
8
|
+
REFERENCE = "REFERENCE",
|
|
9
|
+
DATE = "DATE",
|
|
10
|
+
DATETIME = "DATETIME",
|
|
11
|
+
PERIOD = "PERIOD"
|
|
12
|
+
}
|
|
13
|
+
export interface SearchParameterDetails {
|
|
14
|
+
readonly columnName: string;
|
|
15
|
+
readonly type: SearchParameterType;
|
|
16
|
+
readonly elementDefinition?: ElementDefinition;
|
|
17
|
+
readonly array?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns the type details of a SearchParameter.
|
|
21
|
+
*
|
|
22
|
+
* The SearchParameter resource has a "type" parameter, but that is missing some critical information.
|
|
23
|
+
*
|
|
24
|
+
* For example:
|
|
25
|
+
* 1) The "date" type includes "date", "datetime", and "period".
|
|
26
|
+
* 2) The "token" type includes enums and booleans.
|
|
27
|
+
* 3) Arrays/multiple values are not reflected at all.
|
|
28
|
+
*
|
|
29
|
+
* @param structureDefinitions Collection of StructureDefinition resources indexed by name.
|
|
30
|
+
* @param resourceType The root resource type.
|
|
31
|
+
* @param searchParam The search parameter.
|
|
32
|
+
* @returns The search parameter type details.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getSearchParameterDetails(structureDefinitions: IndexedStructureDefinition, resourceType: string, searchParam: SearchParameter): SearchParameterDetails;
|
|
35
|
+
export declare function getExpressionForResourceType(resourceType: string, expression: string): string | undefined;
|
package/dist/types/storage.d.ts
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The ClientStorage class is a utility class for storing strings and objects.
|
|
3
|
-
*
|
|
4
|
-
* When using MedplumClient in the browser, it will be backed by browser localStorage.
|
|
5
|
-
*
|
|
6
|
-
* When Using MedplumClient in the server, it will be backed by the MemoryStorage class.
|
|
7
|
-
*/
|
|
8
|
-
export declare class ClientStorage {
|
|
9
|
-
#private;
|
|
10
|
-
constructor();
|
|
11
|
-
clear(): void;
|
|
12
|
-
getString(key: string): string | undefined;
|
|
13
|
-
setString(key: string, value: string | undefined): void;
|
|
14
|
-
getObject<T>(key: string): T | undefined;
|
|
15
|
-
setObject<T>(key: string, value: T): void;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* The MemoryStorage class is a minimal in-memory implementation of the Storage interface.
|
|
19
|
-
*/
|
|
20
|
-
export declare class MemoryStorage implements Storage {
|
|
21
|
-
#private;
|
|
22
|
-
constructor();
|
|
23
|
-
/**
|
|
24
|
-
* Returns the number of key/value pairs.
|
|
25
|
-
*/
|
|
26
|
-
get length(): number;
|
|
27
|
-
/**
|
|
28
|
-
* Removes all key/value pairs, if there are any.
|
|
29
|
-
*/
|
|
30
|
-
clear(): void;
|
|
31
|
-
/**
|
|
32
|
-
* Returns the current value associated with the given key, or null if the given key does not exist.
|
|
33
|
-
*/
|
|
34
|
-
getItem(key: string): string | null;
|
|
35
|
-
/**
|
|
36
|
-
* Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
|
|
37
|
-
*/
|
|
38
|
-
setItem(key: string, value: string | null): void;
|
|
39
|
-
/**
|
|
40
|
-
* Removes the key/value pair with the given key, if a key/value pair with the given key exists.
|
|
41
|
-
*/
|
|
42
|
-
removeItem(key: string): void;
|
|
43
|
-
/**
|
|
44
|
-
* Returns the name of the nth key, or null if n is greater than or equal to the number of key/value pairs.
|
|
45
|
-
*/
|
|
46
|
-
key(index: number): string | null;
|
|
47
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* The ClientStorage class is a utility class for storing strings and objects.
|
|
3
|
+
*
|
|
4
|
+
* When using MedplumClient in the browser, it will be backed by browser localStorage.
|
|
5
|
+
*
|
|
6
|
+
* When Using MedplumClient in the server, it will be backed by the MemoryStorage class.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ClientStorage {
|
|
9
|
+
#private;
|
|
10
|
+
constructor();
|
|
11
|
+
clear(): void;
|
|
12
|
+
getString(key: string): string | undefined;
|
|
13
|
+
setString(key: string, value: string | undefined): void;
|
|
14
|
+
getObject<T>(key: string): T | undefined;
|
|
15
|
+
setObject<T>(key: string, value: T): void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The MemoryStorage class is a minimal in-memory implementation of the Storage interface.
|
|
19
|
+
*/
|
|
20
|
+
export declare class MemoryStorage implements Storage {
|
|
21
|
+
#private;
|
|
22
|
+
constructor();
|
|
23
|
+
/**
|
|
24
|
+
* Returns the number of key/value pairs.
|
|
25
|
+
*/
|
|
26
|
+
get length(): number;
|
|
27
|
+
/**
|
|
28
|
+
* Removes all key/value pairs, if there are any.
|
|
29
|
+
*/
|
|
30
|
+
clear(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Returns the current value associated with the given key, or null if the given key does not exist.
|
|
33
|
+
*/
|
|
34
|
+
getItem(key: string): string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
|
|
37
|
+
*/
|
|
38
|
+
setItem(key: string, value: string | null): void;
|
|
39
|
+
/**
|
|
40
|
+
* Removes the key/value pair with the given key, if a key/value pair with the given key exists.
|
|
41
|
+
*/
|
|
42
|
+
removeItem(key: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Returns the name of the nth key, or null if n is greater than or equal to the number of key/value pairs.
|
|
45
|
+
*/
|
|
46
|
+
key(index: number): string | null;
|
|
47
|
+
}
|