$dump
You can dump all resources of a specified type. Aidbox will respond with Chunked Transfer Encoding ndjson stream, optionally you can get the output in FHIR format or GZIPped.
This is a memory-efficient operation. Aidbox just streams the database cursor to a socket. If your HTTP Client supports processing of Chunked Encoding, you can process resources in stream one by one without waiting for the end of the response.
Request format
Request
Response
1
GET [base]/<resourceType>/$dump
Copied!
1
GET /Patient/$dump
Copied!
1
HTTP/1.1 200 OK
2
Content-Type: application/ndjson
3
Transfer-Encoding: chunked
4
​
5
{"resourceType": "Patient", "id": .............}
6
{"resourceType": "Patient", "id": .............}
7
{"resourceType": "Patient", "id": .............}
8
{"resourceType": "Patient", "id": .............}
9
.........
Copied!

Path Parameters

Parameter
Required?
Type
Description
resourceType
true
String
name of the resource type to be exported

Query Parameters

Parameter
Required?
Type
Description
_since
false
String
Date in ISO format; if present, exported data will contain only the resources created after the date.
fhir
false
Boolean
Convert data to the FHIR format. If disabled, the data is exported in the Aidbox format.
gzip
optional
Boolean
GZIP the result. If enabled, HTTP headers for gzip encoding are also set.

Examples

Here is an example of how you can dump all patients from your box (assuming you have a client with an access policy):
Request
Response
Curl
1
curl -u bulk-client:secret $AIDBOX_BASE_URL/Patient/\$dump
Copied!
REST Console
1
GET /Patient/$dump
Copied!

Status

200 OK

Headers

Header
Value
Content-Type
application/ndjson
Transfer-Encoding
chunked

Body

1
{"id": "pt-1", "meta": {"createdAt": "2021-06-10T08:26:10.707454Z", "versionId": 481, "lastUpdated": "2021-06-10T08:26:10.707454Z"}, "name": [{"given": ["Alice"]}], "resourceType": "Patient"}
2
{"id": "pt-2", "meta": {"createdAt": "2021-06-10T08:26:10.707454Z", "versionId": 482, "lastUpdated": "2021-06-10T08:26:10.707454Z"}, "name": [{"given": ["Bob"]}], "resourceType": "Patient"}
3
{"id": "pt-3", "meta": {"createdAt": "2021-06-10T08:26:10.707454Z", "versionId": 483, "lastUpdated": "2021-06-10T08:26:10.707454Z"}, "name": [{"given": ["Charles"]}], "citizenship": [{"code": {"text": "ru"}}], "resourceType": "Patient"}
Copied!

Body (manually formatted)

1
{
2
"id": "pt-1",
3
"meta": {
4
"createdAt": "2021-06-10T08:26:10.707454Z",
5
"versionId": 481,
6
"lastUpdated": "2021-06-10T08:26:10.707454Z"
7
},
8
"name": [
9
{
10
"given": [
11
"Alice"
12
]
13
}
14
],
15
"resourceType": "Patient"
16
}
17
{
18
"id": "pt-2",
19
"meta": {
20
"createdAt": "2021-06-10T08:26:10.707454Z",
21
"versionId": 482,
22
"lastUpdated": "2021-06-10T08:26:10.707454Z"
23
},
24
"name": [
25
{
26
"given": [
27
"Bob"
28
]
29
}
30
],
31
"resourceType": "Patient"
32
}
33
{
34
"id": "pt-3",
35
"meta": {
36
"createdAt": "2021-06-10T08:26:10.707454Z",
37
"versionId": 483,
38
"lastUpdated": "2021-06-10T08:26:10.707454Z"
39
},
40
"name": [
41
{
42
"given": [
43
"Charles"
44
]
45
}
46
],
47
"citizenship": [
48
{
49
"code": {
50
"text": "ru"
51
}
52
}
53
],
54
"resourceType": "Patient"
55
}
Copied!
Dump appointments
Request
Response

REST Console

1
GET /Appointment/$dump
Copied!

Curl

1
curl -u bulk-client:secret $AIDBOX_BASE_URL/Appointment/\$dump
Copied!

Status

200 OK

Headers

Header
Value
Content-Type
application/ndjson
Transfer-Encoding
Chunked

Body

1
{"id": "ap-1", "meta": {"createdAt": "2021-06-10T08:26:10.707454Z", "versionId": 484, "lastUpdated": "2021-06-10T08:26:10.707454Z"}, "status": "fulfilled", "participant": [{"actor": {"id": "pt-1", "resourceType": "Patient"}, "status": "accepted"}], "resourceType": "Appointment"}
2
{"id": "ap-2", "meta": {"createdAt": "2021-06-10T08:26:10.707454Z", "versionId": 485, "lastUpdated": "2021-06-10T08:26:10.707454Z"}, "status": "booked", "participant": [{"actor": {"id": "pt-1", "resourceType": "Patient"}, "status": "accepted"}], "resourceType": "Appointment"}
3
{"id": "ap-3", "meta": {"createdAt": "2021-06-10T08:26:10.707454Z", "versionId": 486, "lastUpdated": "2021-06-10T08:26:10.707454Z"}, "status": "fulfilled", "participant": [{"actor": {"id": "pt-2", "resourceType": "Patient"}, "status": "accepted"}], "resourceType": "Appointment"}
Copied!

Body (manually formatted)

1
{
2
"id": "ap-1",
3
"meta": {
4
"createdAt": "2021-06-10T08:26:10.707454Z",
5
"versionId": 484,
6
"lastUpdated": "2021-06-10T08:26:10.707454Z"
7
},
8
"status": "fulfilled",
9
"participant": [
10
{
11
"actor": {
12
"id": "pt-1",
13
"resourceType": "Patient"
14
},
15
"status": "accepted"
16
}
17
],
18
"resourceType": "Appointment"
19
}
20
{
21
"id": "ap-2",
22
"meta": {
23
"createdAt": "2021-06-10T08:26:10.707454Z",
24
"versionId": 485,
25
"lastUpdated": "2021-06-10T08:26:10.707454Z"
26
},
27
"status": "booked",
28
"participant": [
29
{
30
"actor": {
31
"id": "pt-1",
32
"resourceType": "Patient"
33
},
34
"status": "accepted"
35
}
36
],
37
"resourceType": "Appointment"
38
}
39
{
40
"id": "ap-3",
41
"meta": {
42
"createdAt": "2021-06-10T08:26:10.707454Z",
43
"versionId": 486,
44
"lastUpdated": "2021-06-10T08:26:10.707454Z"
45
},
46
"status": "fulfilled",
47
"participant": [
48
{
49
"actor": {
50
"id": "pt-2",
51
"resourceType": "Patient"
52
},
53
"status": "accepted"
54
}
55
],
56
"resourceType": "Appointment"
57
}
58
​
Copied!
Dump patients in FHIR format
Request
Response

REST Console

1
GET /Patient/$dump?fhir=true
Copied!

Curl

1
curl -u bulk-client:secret $AIDBOX_BASE_URL/Patient/\$dump?fhir=true
Copied!

Status

200 OK

Headers

Header
Value
Content-Type
application/ndjson
Transfer-Encoding
chunked

Body

1
{"id":"pt-1","meta":{"versionId":481,"lastUpdated":"2021-06-10T08:26:10.707454Z","extension":[{"url":"ex:createdAt","valueInstant":"2021-06-10T08:26:10.707454Z"}]},"name":[{"given":["Alice"]}],"resourceType":"Patient"}
2
{"id":"pt-2","meta":{"versionId":482,"lastUpdated":"2021-06-10T08:26:10.707454Z","extension":[{"url":"ex:createdAt","valueInstant":"2021-06-10T08:26:10.707454Z"}]},"name":[{"given":["Bob"]}],"resourceType":"Patient"}
3
{"id":"pt-3","meta":{"versionId":483,"lastUpdated":"2021-06-10T08:26:10.707454Z","extension":[{"url":"ex:createdAt","valueInstant":"2021-06-10T08:26:10.707454Z"}]},"name":[{"given":["Charles"]}],"citizenship":[{"code":{"text":"ru"}}],"resourceType":"Patient"}
Copied!

Body (manually formatted)

1
{
2
"id": "pt-1",
3
"meta": {
4
"versionId": 481,
5
"lastUpdated": "2021-06-10T08:26:10.707454Z",
6
"extension": [
7
{
8
"url": "ex:createdAt",
9
"valueInstant": "2021-06-10T08:26:10.707454Z"
10
}
11
]
12
},
13
"name": [
14
{
15
"given": [
16
"Alice"
17
]
18
}
19
],
20
"resourceType": "Patient"
21
}
22
{
23
"id": "pt-2",
24
"meta": {
25
"versionId": 482,
26
"lastUpdated": "2021-06-10T08:26:10.707454Z",
27
"extension": [
28
{
29
"url": "ex:createdAt",
30
"valueInstant": "2021-06-10T08:26:10.707454Z"
31
}
32
]
33
},
34
"name": [
35
{
36
"given": [
37
"Bob"
38
]
39
}
40
],
41
"resourceType": "Patient"
42
}
43
{
44
"id": "pt-3",
45
"meta": {
46
"versionId": 483,
47
"lastUpdated": "2021-06-10T08:26:10.707454Z",
48
"extension": [
49
{
50
"url": "ex:createdAt",
51
"valueInstant": "2021-06-10T08:26:10.707454Z"
52
}
53
]
54
},
55
"name": [
56
{
57
"given": [
58
"Charles"
59
]
60
}
61
],
62
"citizenship": [
63
{
64
"code": {
65
"text": "ru"
66
}
67
}
68
],
69
"resourceType": "Patient"
70
}
71
​
Copied!
​
​
​
Last modified 2mo ago