Uploading Sample Data

Endpoint for Bundles

Aidbox endpoint for bundles will be the base URL of your Box: / in Aidbox REST Console and [base] (https://<YOUR-BOX>.aidbox.app) in any other external client (Postman for example). Alternatively, /fhir and [base]/fhir can be used, read more about /fhir endpoints.

Bundle Example

According to the FHIR specification, a bundle is a container for a collection of resources for transport and persistence purposes. Below is an example of a request to create two patients:

POST /fhir
Accept: application/json
Content-Type: application/json

{
  "resourceType": "bundle",
  "type": "transaction",
  "entry":
  [{
      "request": {
        "method": "POST",
        "url": "/Patient"
      },
      "resource": {
        "name": [{
            "given": ["Bob"]
          }
        ]
      }
    }, {
      "request": {
        "method": "POST",
        "url": "/Patient"
      },
      "resource": {
        "name": [{
            "given": ["Peter"]
          }
        ]
      }
    }
  ]
}

FHIR specification says that a bundle should look like this:

{
  "resourceType": "bundle",
  "type": "transaction",
  "entry": [{
      "request": {
        "method": "GET",
        "url": "/Patient"
      }
    }
  ]
}

Every transaction bundle MUST have the type field where value can be a transaction or batch, each element ofentry field MUST have a method and an url fields in the request.

Bundles must be sent via POST method to BASE_URL which is the URL of your Box for external clients and / or /fhir for REST Console (actually hostname exists in REST Console, but it is hidden).

Aidbox REST Console

  1. Access your Box in Aidbox.Cloud.

  2. Open REST Console.

  3. Type in POST / or POST /fhir. (read about the difference between Aidbox and FHIR)

  4. Leave next line empty.

  5. Paste your bundle.

  6. Press Ctrl+Enter or click the Send button.

This is a brief description of how to work with transactions and batches in Aidbox. More interesting information coming soon, stay tuned!

Generating transaction bundle with Synthea (advanced topic)

Here's how we can install Synthea — Synthetic Patient Population Simulator.

git clone https://github.com/synthetichealth/synthea.git
cd synthea
./gradlew build check test

Generating the population one at a time...

./run_synthea -s 1000
ls output/fhir

...you should see few files with names similar to those:

hospitalInformation1537450368636.json 
Mckinley734_Johnston597_f25b9177-3c01-4d76-a48f-0a83affa5a56.json

Make sure that you usePOST /fhirfor synthea bundles, not just POST /

Copy the content of the first file to REST Console, use POST /fhir to upload the FHIR transaction bundle. Everything else is the same as in the previous step. After that, upload the content of the second file into Aidbox. That's all, you are awesome!

Read more about Synthea generator - https://github.com/synthetichealth/synthea.

Last updated

#2416:

Change request updated