$import & /fhir/$import
$import is an implementation of the upcoming FHIR Bulk Import API. This is an async Operation, which returns url to monitor progress.
Keep in mind that $import does not validate inserted resources for the sake of performance. Pay attention to the structure of data you insert and use the correct URL for your data format, i.e.: use /fhir prefix for FHIR data.
Please consider using Asynchronous validation API to validate data after $import

Example

Request
Response
1
POST /fhir/$import
2
Accept: text/yaml
3
Content-Type: text/yaml
4
5
id: synthea
6
inputFormat: application/fhir+ndjson
7
contentEncoding: gzip
8
mode: bulk
9
inputs:
10
- resourceType: Encounter
11
url: https://storage.googleapis.com/aidbox-public/synthea/100/Encounter.ndjson.gz
12
- resourceType: Organization
13
url: https://storage.googleapis.com/aidbox-public/synthea/100/Organization.ndjson.gz
14
- resourceType: Patient
15
url: https://storage.googleapis.com/aidbox-public/synthea/100/Patient.ndjson.gz
Copied!
1
200
2
content-location: /BulkImportStatus/synthea
Copied!
You can monitor progress using:
1
GET /BulkImportStatus/[id]
Copied!

update: true

For performance reasons $import does raw upsert into resource table without history update. If you want to store the previous version of resources in history, please set update = true
With this flag Aidbox will update history for updated resources.
1
POST /fhir/$import
2
Accept: text/yaml
3
Content-Type: text/yaml
4
5
id: synthea
6
update: true
7
inputFormat: application/fhir+ndjson
8
contentEncoding: gzip
9
mode: bulk
10
inputs:
11
- resourceType: Encounter
12
url: https://storage.googleapis.com/aidbox-public/synthea/100/Encounter.ndjson.gz
13
- resourceType: Organization
14
url: https://storage.googleapis.com/aidbox-public/synthea/100/Organization.ndjson.gz
15
- resourceType: Patient
16
url: https://storage.googleapis.com/aidbox-public/synthea/100/Patient.ndjson.gz
Copied!

Copy link