$import & /fhir/$import
$import
is an implementation of the upcoming FHIR Bulk Import API. This is an asynchronous Operation, which returns url to monitor progress. There are two versions of this operation - /fhir/$import
accepts data in FHIR format, /$import
works with Aidbox format.
Resource requirements for all import operations:
Operation | id | resourceType |
---|---|---|
| Required | Not required |
| Required | Not required |
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
Parameters
Parameter | Description |
---|---|
| Identifier of the import |
| Supports |
| Resources to import |
| Update history for updated resources (false by default) |
You can monitor progress by using id
you provided in request body.
If you didn't provide id
in request body, you can use content-location
in response header.
Result
Parameter | Type | Description |
---|---|---|
| string | Identifier of the import |
| string | Type of resource where the progress of import operation is recorded.
Possible value: |
| object | |
| string | Timestamp string at which the resource was created |
| string | Timestamp string at which the resource was updated last time |
| string | Version id of this resource |
| string |
|
| object | |
| string | Timestamp string at which the operation started in ISO format |
| string | Timestamp string at which the operation was completed in ISO format. Only present after the entire import operation has been completed |
| string | Data format type to be loaded. Possible values: |
| object[] | |
| string | URL from which load resources |
| string | Resource type to be loaded |
| string | Load status for each input. Only present after the operation for this input has been completed. Possible values: |
| integer | The number of loaded resources. Only present after the operation for this input has been completed successfully |
| string | Timestamp string at which the loading was completed in ISO format. Only present after the operation for this input has been completed |
| integer | Duration of loading in milliseconds. Only present after the operation for this input has been completed successfully |
| string | Load status for all inputs. Only present after the entire import operation has been completed.
After completed, this value is always Possible value: |
Note
For performance reasons $import
does raw upsert into the 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 the history for updated resources. For each resource:
if the resource was not present in DB before the import, the import time will be the same.
if the resource was present in DB before and it's updated during the import, it will double the time importing this resource because of the additional insert operation into the
_history
table.
/v2/$import on top of the Workflow Engine
Improved version of the $import operation, to enhance its reliability and performance. By implementing this operation on top of the Workflow Engine, it allows the $import operation to be more reliable, continue work after restarts, and handle errors correctly. The Task API also enables the operation to accept multiple requests and execute them from a queue while simultaneously processing multiple items from the "inputs" field (with a default of two items processed simultaneously). Users can monitor the status of the operation through the Monitoring.
In the future, the ability to list and cancel $import operations will be added, as well as detailed progress info on the operation.
Changes in the new $import API:
Executing more than one import with the same
id
is not possible. Users can omit the `id` field from the request, allowing Aidbox to generate the ID.The status of the workflow can be accessed with a GET request to
/v2/$import/<id>
instead of/BulkImportStatus/<id>
. The URL for the import status is returned in thecontent-location
header of the $import request.
This feature is not available in Multibox
To start import make a POST request to /v2[/fhir]/$import
:
Parameters
Parameter | Description |
---|---|
| Identifier of the import.
If you don't provide this, the id will be auto-generated. You can check it on |
| Supports |
| Resources to import
|
| Update history for updated resources (false by default) |
| Set the maximum number of import retries for each input (2 by default) |
To check the status of the import make a GET request to /v2/$import/<id>
:
Import local file
Sometimes you want to import local file into local Aidbox. Possible solutions for local development:
Add volume to the aidboxone
container (not aidboxdb
):
aidboxone
container (not aidboxdb
):Use tunneling e.g. ngrok:
Last updated