@medplum/mock 0.5.2 → 0.9.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/README.md +32 -0
- package/dist/cjs/index.js +978 -270
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.min.js +1 -30
- package/dist/cjs/index.min.js.map +1 -1
- package/dist/esm/index.js +978 -271
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +1 -30
- package/dist/esm/index.min.js.map +1 -1
- package/dist/types/mocks/simpsons.d.ts +2 -1
- package/package.json +6 -7
package/README.md
CHANGED
|
@@ -8,6 +8,38 @@ For example:
|
|
|
8
8
|
- `GET fhir/R4/Practitioner/123` returns Dr. Alice Smith
|
|
9
9
|
- `GET fhir/R4/Organization/123` returns Test Organization
|
|
10
10
|
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
Add as a dependency:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @medplum/mock
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Note the following peer dependencies:
|
|
20
|
+
- [@medplum/core](https://www.npmjs.com/package/@medplum/core)
|
|
21
|
+
- [@medplum/fhirpath](https://www.npmjs.com/package/@medplum/fhirpath)
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
Create a new mock client:
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
const client = new MockClient();
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Read a `Patient` resource:
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
const patient = await client.readResource('Patient', '123');
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`MockClient` is API compatible with `MedplumClient` in [@medplum/core](https://www.npmjs.com/package/@medplum/core). Please refer to `MedplumClient` for full documentation on client capabilities.
|
|
38
|
+
|
|
39
|
+
## About Medplum
|
|
40
|
+
|
|
41
|
+
Medplum is a healthcare platform that helps you quickly develop high-quality compliant applications. Medplum includes a FHIR server, React component library, and developer app.
|
|
42
|
+
|
|
11
43
|
## License
|
|
12
44
|
|
|
13
45
|
Apache 2.0. Copyright © Medplum 2022
|