@medplum/mock 0.9.4 → 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 +3486 -3486
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.min.js.map +1 -1
- package/dist/esm/index.js +3486 -3486
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js.map +1 -1
- package/dist/types/client.d.ts +14 -14
- package/dist/types/index.d.ts +2 -2
- package/dist/types/mocks/accesspolicy.d.ts +4 -4
- package/dist/types/mocks/alice.d.ts +7 -7
- package/dist/types/mocks/bot.d.ts +3 -3
- package/dist/types/mocks/index.d.ts +8 -8
- package/dist/types/mocks/questionnaire.d.ts +3 -3
- package/dist/types/mocks/simpsons.d.ts +16 -16
- package/dist/types/mocks/subscription.d.ts +3 -3
- package/dist/types/mocks/types.d.ts +81 -81
- package/dist/types/mocks/valueset.d.ts +2 -2
- package/dist/types/repo.d.ts +20 -20
- package/package.json +6 -6
package/dist/types/client.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { LoginState, MedplumClient, ProfileResource } from '@medplum/core';
|
|
2
|
-
import { Binary } from '@medplum/fhirtypes';
|
|
3
|
-
export interface MockClientOptions {
|
|
4
|
-
readonly debug?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare class MockClient extends MedplumClient {
|
|
7
|
-
activeLoginOverride?: LoginState;
|
|
8
|
-
constructor(clientOptions?: MockClientOptions);
|
|
9
|
-
clear(): void;
|
|
10
|
-
getProfile(): ProfileResource;
|
|
11
|
-
setActiveLoginOverride(activeLoginOverride: LoginState): void;
|
|
12
|
-
getActiveLogin(): LoginState | undefined;
|
|
13
|
-
createBinary(_data: any, filename: string, contentType: string): Promise<Binary>;
|
|
14
|
-
}
|
|
1
|
+
import { LoginState, MedplumClient, ProfileResource } from '@medplum/core';
|
|
2
|
+
import { Binary } from '@medplum/fhirtypes';
|
|
3
|
+
export interface MockClientOptions {
|
|
4
|
+
readonly debug?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare class MockClient extends MedplumClient {
|
|
7
|
+
activeLoginOverride?: LoginState;
|
|
8
|
+
constructor(clientOptions?: MockClientOptions);
|
|
9
|
+
clear(): void;
|
|
10
|
+
getProfile(): ProfileResource;
|
|
11
|
+
setActiveLoginOverride(activeLoginOverride: LoginState): void;
|
|
12
|
+
getActiveLogin(): LoginState | undefined;
|
|
13
|
+
createBinary(_data: any, filename: string, contentType: string): Promise<Binary>;
|
|
14
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './client';
|
|
2
|
-
export * from './mocks';
|
|
1
|
+
export * from './client';
|
|
2
|
+
export * from './mocks';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccessPolicy, UserConfiguration, ValueSet } from '@medplum/fhirtypes';
|
|
2
|
-
export declare const ExampleAccessPolicy: AccessPolicy;
|
|
3
|
-
export declare const ExampleStatusValueSet: ValueSet;
|
|
4
|
-
export declare const ExampleUserConfiguration: UserConfiguration;
|
|
1
|
+
import { AccessPolicy, UserConfiguration, ValueSet } from '@medplum/fhirtypes';
|
|
2
|
+
export declare const ExampleAccessPolicy: AccessPolicy;
|
|
3
|
+
export declare const ExampleStatusValueSet: ValueSet;
|
|
4
|
+
export declare const ExampleUserConfiguration: UserConfiguration;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Organization, Practitioner, Schedule, Slot } from '@medplum/fhirtypes';
|
|
2
|
-
export declare const TestOrganization: Organization;
|
|
3
|
-
export declare const DifferentOrganization: Organization;
|
|
4
|
-
export declare const DrAliceSmith: Practitioner;
|
|
5
|
-
export declare const DrAliceSmithPreviousVersion: Practitioner;
|
|
6
|
-
export declare const DrAliceSmithSchedule: Schedule;
|
|
7
|
-
export declare const DrAliceSmithSlots: Slot[];
|
|
1
|
+
import { Organization, Practitioner, Schedule, Slot } from '@medplum/fhirtypes';
|
|
2
|
+
export declare const TestOrganization: Organization;
|
|
3
|
+
export declare const DifferentOrganization: Organization;
|
|
4
|
+
export declare const DrAliceSmith: Practitioner;
|
|
5
|
+
export declare const DrAliceSmithPreviousVersion: Practitioner;
|
|
6
|
+
export declare const DrAliceSmithSchedule: Schedule;
|
|
7
|
+
export declare const DrAliceSmithSlots: Slot[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Bot, ClientApplication } from '@medplum/fhirtypes';
|
|
2
|
-
export declare const ExampleBot: Bot;
|
|
3
|
-
export declare const ExampleClient: ClientApplication;
|
|
1
|
+
import { Bot, ClientApplication } from '@medplum/fhirtypes';
|
|
2
|
+
export declare const ExampleBot: Bot;
|
|
3
|
+
export declare const ExampleClient: ClientApplication;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './accesspolicy';
|
|
2
|
-
export * from './alice';
|
|
3
|
-
export * from './bot';
|
|
4
|
-
export * from './questionnaire';
|
|
5
|
-
export * from './simpsons';
|
|
6
|
-
export * from './subscription';
|
|
7
|
-
export * from './types';
|
|
8
|
-
export * from './valueset';
|
|
1
|
+
export * from './accesspolicy';
|
|
2
|
+
export * from './alice';
|
|
3
|
+
export * from './bot';
|
|
4
|
+
export * from './questionnaire';
|
|
5
|
+
export * from './simpsons';
|
|
6
|
+
export * from './subscription';
|
|
7
|
+
export * from './types';
|
|
8
|
+
export * from './valueset';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Questionnaire, QuestionnaireResponse } from '@medplum/fhirtypes';
|
|
2
|
-
export declare const ExampleQuestionnaire: Questionnaire;
|
|
3
|
-
export declare const ExampleQuestionnaireResponse: QuestionnaireResponse;
|
|
1
|
+
import { Questionnaire, QuestionnaireResponse } from '@medplum/fhirtypes';
|
|
2
|
+
export declare const ExampleQuestionnaire: Questionnaire;
|
|
3
|
+
export declare const ExampleQuestionnaireResponse: QuestionnaireResponse;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Communication, DiagnosticReport, Encounter, Media, Observation, Patient, ServiceRequest, Specimen } from '@medplum/fhirtypes';
|
|
2
|
-
export declare const HomerSimpson: Patient;
|
|
3
|
-
export declare const HomerSimpsonPreviousVersion: Patient;
|
|
4
|
-
export declare const HomerEncounter: Encounter;
|
|
5
|
-
export declare const HomerCommunication: Communication;
|
|
6
|
-
export declare const HomerMedia: Media;
|
|
7
|
-
export declare const HomerDiagnosticReport: DiagnosticReport;
|
|
8
|
-
export declare const HomerObservation1: Observation;
|
|
9
|
-
export declare const HomerObservation2: Observation;
|
|
10
|
-
export declare const HomerObservation3: Observation;
|
|
11
|
-
export declare const HomerObservation4: Observation;
|
|
12
|
-
export declare const HomerObservation5: Observation;
|
|
13
|
-
export declare const HomerObservation6: Observation;
|
|
14
|
-
export declare const HomerSimpsonSpecimen: Specimen;
|
|
15
|
-
export declare const HomerServiceRequest: ServiceRequest;
|
|
16
|
-
export declare const BartSimpson: Patient;
|
|
1
|
+
import { Communication, DiagnosticReport, Encounter, Media, Observation, Patient, ServiceRequest, Specimen } from '@medplum/fhirtypes';
|
|
2
|
+
export declare const HomerSimpson: Patient;
|
|
3
|
+
export declare const HomerSimpsonPreviousVersion: Patient;
|
|
4
|
+
export declare const HomerEncounter: Encounter;
|
|
5
|
+
export declare const HomerCommunication: Communication;
|
|
6
|
+
export declare const HomerMedia: Media;
|
|
7
|
+
export declare const HomerDiagnosticReport: DiagnosticReport;
|
|
8
|
+
export declare const HomerObservation1: Observation;
|
|
9
|
+
export declare const HomerObservation2: Observation;
|
|
10
|
+
export declare const HomerObservation3: Observation;
|
|
11
|
+
export declare const HomerObservation4: Observation;
|
|
12
|
+
export declare const HomerObservation5: Observation;
|
|
13
|
+
export declare const HomerObservation6: Observation;
|
|
14
|
+
export declare const HomerSimpsonSpecimen: Specimen;
|
|
15
|
+
export declare const HomerServiceRequest: ServiceRequest;
|
|
16
|
+
export declare const BartSimpson: Patient;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AuditEvent, Subscription } from '@medplum/fhirtypes';
|
|
2
|
-
export declare const ExampleSubscription: Subscription;
|
|
3
|
-
export declare const ExampleAuditEvent: AuditEvent;
|
|
1
|
+
import { AuditEvent, Subscription } from '@medplum/fhirtypes';
|
|
2
|
+
export declare const ExampleSubscription: Subscription;
|
|
3
|
+
export declare const ExampleAuditEvent: AuditEvent;
|
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import { SearchParameter } from '@medplum/fhirtypes';
|
|
2
|
-
export declare const PatientSearchParameters: SearchParameter[];
|
|
3
|
-
export declare const GraphQLSchemaResponse: {
|
|
4
|
-
data: {
|
|
5
|
-
StructureDefinitionList: ({
|
|
6
|
-
resourceType: string;
|
|
7
|
-
id: string;
|
|
8
|
-
name: string;
|
|
9
|
-
description: string;
|
|
10
|
-
type: string;
|
|
11
|
-
snapshot: {
|
|
12
|
-
element: ({
|
|
13
|
-
id: string;
|
|
14
|
-
path: string;
|
|
15
|
-
definition: string;
|
|
16
|
-
min: number;
|
|
17
|
-
max: string;
|
|
18
|
-
type?: undefined;
|
|
19
|
-
binding?: undefined;
|
|
20
|
-
} | {
|
|
21
|
-
id: string;
|
|
22
|
-
path: string;
|
|
23
|
-
definition: string;
|
|
24
|
-
min: number;
|
|
25
|
-
max: string;
|
|
26
|
-
type: {
|
|
27
|
-
code: string;
|
|
28
|
-
}[];
|
|
29
|
-
binding?: undefined;
|
|
30
|
-
} | {
|
|
31
|
-
id: string;
|
|
32
|
-
path: string;
|
|
33
|
-
definition: string;
|
|
34
|
-
min: number;
|
|
35
|
-
max: string;
|
|
36
|
-
type: {
|
|
37
|
-
code: string;
|
|
38
|
-
targetProfile: string[];
|
|
39
|
-
}[];
|
|
40
|
-
binding?: undefined;
|
|
41
|
-
} | {
|
|
42
|
-
id: string;
|
|
43
|
-
path: string;
|
|
44
|
-
definition: string;
|
|
45
|
-
min: number;
|
|
46
|
-
max: string;
|
|
47
|
-
type: ({
|
|
48
|
-
code: string;
|
|
49
|
-
targetProfile?: undefined;
|
|
50
|
-
} | {
|
|
51
|
-
code: string;
|
|
52
|
-
targetProfile: string[];
|
|
53
|
-
})[];
|
|
54
|
-
binding: {
|
|
55
|
-
description: string;
|
|
56
|
-
valueSet: string;
|
|
57
|
-
};
|
|
58
|
-
})[];
|
|
59
|
-
};
|
|
60
|
-
} | {
|
|
61
|
-
resourceType: string;
|
|
62
|
-
id: string;
|
|
63
|
-
name: string;
|
|
64
|
-
description: string;
|
|
65
|
-
snapshot: {
|
|
66
|
-
element: {
|
|
67
|
-
id: string;
|
|
68
|
-
path: string;
|
|
69
|
-
definition: string;
|
|
70
|
-
min: number;
|
|
71
|
-
max: string;
|
|
72
|
-
type: {
|
|
73
|
-
code: string;
|
|
74
|
-
}[];
|
|
75
|
-
}[];
|
|
76
|
-
};
|
|
77
|
-
type?: undefined;
|
|
78
|
-
})[];
|
|
79
|
-
SearchParameterList: SearchParameter[];
|
|
80
|
-
};
|
|
81
|
-
};
|
|
1
|
+
import { SearchParameter } from '@medplum/fhirtypes';
|
|
2
|
+
export declare const PatientSearchParameters: SearchParameter[];
|
|
3
|
+
export declare const GraphQLSchemaResponse: {
|
|
4
|
+
data: {
|
|
5
|
+
StructureDefinitionList: ({
|
|
6
|
+
resourceType: string;
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
type: string;
|
|
11
|
+
snapshot: {
|
|
12
|
+
element: ({
|
|
13
|
+
id: string;
|
|
14
|
+
path: string;
|
|
15
|
+
definition: string;
|
|
16
|
+
min: number;
|
|
17
|
+
max: string;
|
|
18
|
+
type?: undefined;
|
|
19
|
+
binding?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
id: string;
|
|
22
|
+
path: string;
|
|
23
|
+
definition: string;
|
|
24
|
+
min: number;
|
|
25
|
+
max: string;
|
|
26
|
+
type: {
|
|
27
|
+
code: string;
|
|
28
|
+
}[];
|
|
29
|
+
binding?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
id: string;
|
|
32
|
+
path: string;
|
|
33
|
+
definition: string;
|
|
34
|
+
min: number;
|
|
35
|
+
max: string;
|
|
36
|
+
type: {
|
|
37
|
+
code: string;
|
|
38
|
+
targetProfile: string[];
|
|
39
|
+
}[];
|
|
40
|
+
binding?: undefined;
|
|
41
|
+
} | {
|
|
42
|
+
id: string;
|
|
43
|
+
path: string;
|
|
44
|
+
definition: string;
|
|
45
|
+
min: number;
|
|
46
|
+
max: string;
|
|
47
|
+
type: ({
|
|
48
|
+
code: string;
|
|
49
|
+
targetProfile?: undefined;
|
|
50
|
+
} | {
|
|
51
|
+
code: string;
|
|
52
|
+
targetProfile: string[];
|
|
53
|
+
})[];
|
|
54
|
+
binding: {
|
|
55
|
+
description: string;
|
|
56
|
+
valueSet: string;
|
|
57
|
+
};
|
|
58
|
+
})[];
|
|
59
|
+
};
|
|
60
|
+
} | {
|
|
61
|
+
resourceType: string;
|
|
62
|
+
id: string;
|
|
63
|
+
name: string;
|
|
64
|
+
description: string;
|
|
65
|
+
snapshot: {
|
|
66
|
+
element: {
|
|
67
|
+
id: string;
|
|
68
|
+
path: string;
|
|
69
|
+
definition: string;
|
|
70
|
+
min: number;
|
|
71
|
+
max: string;
|
|
72
|
+
type: {
|
|
73
|
+
code: string;
|
|
74
|
+
}[];
|
|
75
|
+
}[];
|
|
76
|
+
};
|
|
77
|
+
type?: undefined;
|
|
78
|
+
})[];
|
|
79
|
+
SearchParameterList: SearchParameter[];
|
|
80
|
+
};
|
|
81
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ValueSet } from '@medplum/fhirtypes';
|
|
2
|
-
export declare const exampleValueSet: ValueSet;
|
|
1
|
+
import { ValueSet } from '@medplum/fhirtypes';
|
|
2
|
+
export declare const exampleValueSet: ValueSet;
|
package/dist/types/repo.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { SearchRequest } from '@medplum/core';
|
|
2
|
-
import { Bundle, Resource } from '@medplum/fhirtypes';
|
|
3
|
-
export declare class MemoryRepository {
|
|
4
|
-
#private;
|
|
5
|
-
constructor();
|
|
6
|
-
createResource<T extends Resource>(resource: T): T;
|
|
7
|
-
readResource<T extends Resource>(resourceType: string, id: string): T | undefined;
|
|
8
|
-
readHistory<T extends Resource>(resourceType: string, id: string): Bundle<T>;
|
|
9
|
-
readVersion<T extends Resource>(resourceType: string, id: string, versionId: string): T | undefined;
|
|
10
|
-
search<T extends Resource>(searchRequest: SearchRequest): Bundle<T>;
|
|
11
|
-
deleteResource(resourceType: string, id: string): void;
|
|
12
|
-
private generateId;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Determines if the resource matches the search request.
|
|
16
|
-
* @param resource The resource that was created or updated.
|
|
17
|
-
* @param searchRequest The subscription criteria as a search request.
|
|
18
|
-
* @returns True if the resource satisfies the search request.
|
|
19
|
-
*/
|
|
20
|
-
export declare function matchesSearchRequest(resource: Resource, searchRequest: SearchRequest): boolean;
|
|
1
|
+
import { SearchRequest } from '@medplum/core';
|
|
2
|
+
import { Bundle, Resource } from '@medplum/fhirtypes';
|
|
3
|
+
export declare class MemoryRepository {
|
|
4
|
+
#private;
|
|
5
|
+
constructor();
|
|
6
|
+
createResource<T extends Resource>(resource: T): T;
|
|
7
|
+
readResource<T extends Resource>(resourceType: string, id: string): T | undefined;
|
|
8
|
+
readHistory<T extends Resource>(resourceType: string, id: string): Bundle<T>;
|
|
9
|
+
readVersion<T extends Resource>(resourceType: string, id: string, versionId: string): T | undefined;
|
|
10
|
+
search<T extends Resource>(searchRequest: SearchRequest): Bundle<T>;
|
|
11
|
+
deleteResource(resourceType: string, id: string): void;
|
|
12
|
+
private generateId;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Determines if the resource matches the search request.
|
|
16
|
+
* @param resource The resource that was created or updated.
|
|
17
|
+
* @param searchRequest The subscription criteria as a search request.
|
|
18
|
+
* @returns True if the resource satisfies the search request.
|
|
19
|
+
*/
|
|
20
|
+
export declare function matchesSearchRequest(resource: Resource, searchRequest: SearchRequest): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medplum/mock",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.5",
|
|
4
4
|
"description": "Medplum Mock Client",
|
|
5
5
|
"author": "Medplum <hello@medplum.com>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
"test": "jest"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@medplum/core": "0.9.
|
|
21
|
-
"@medplum/fhirpath": "0.9.
|
|
22
|
-
"@medplum/fhirtypes": "0.9.
|
|
20
|
+
"@medplum/core": "0.9.5",
|
|
21
|
+
"@medplum/fhirpath": "0.9.5",
|
|
22
|
+
"@medplum/fhirtypes": "0.9.5"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@medplum/core": "0.9.
|
|
26
|
-
"@medplum/fhirpath": "0.9.
|
|
25
|
+
"@medplum/core": "0.9.5",
|
|
26
|
+
"@medplum/fhirpath": "0.9.5"
|
|
27
27
|
},
|
|
28
28
|
"main": "dist/cjs/index.js",
|
|
29
29
|
"module": "dist/esm/index.js",
|