Verto FHIR Facade

Exporting Digital Twin data via the FHIR Facade


Making an Export Request

The first step to accessing FHIR resources from the Digital Twin's FHIR API is to create an export request using the fhir/$export command.

The export request API has only one argument _type, which can be used to pass a list of FHIR resources to the API for retrieval. Within this parameter, users may specify as many or as few resources as they wish. Once executed, the export will return each resource in a separate set of files.

The response to the Export Request will contain a header with relevant information about the request. Most notably, take note of the content-location field, which provides a url for accessing the output of an export request.

Querying the Export Job

After the Export Request has been triggered, users may use the URL provided in the response along with the fhir/$export-poll-status endpoint to view its progress.

To speed up the export, the endpoint returns files of up to 250 resources within each requested resource type requested. If the resource has more than 250 records to return, they will be returned across multiple files.

Each file produced is included as a separate record in the output element of the fhir/$export-poll-status response. Each record in the response includes the following fields:

  • count - the number of resources included in the file
  • type - the type of resource the file contains
  • url - the relative path through which the file can be accessed

Any errors resulting from the export request will be included in the error response element. Users can also see when the request was made in the transactionTime element.

Downloading Generated Files

Now that data has been exported, the files can be downloaded for ingestion into downstream systems from the file endpoint. To download the files, a data consumer will need to iterate through the list of files provided in the Export Status query and request them individually by providing the relative path with the file's uuid to the endpoint.

For example, a file with the following Export Status output can be retrieved with this command: https://.vertoclinic.com/api/v1/connect/file/8de143f3-566c-4b70-98e5-3b625817a0cd/download

{
      "count": 250,
      "type": "Condition",
      "url": "/file/8de143f3-566c-4b70-98e5-3b625817a0cd/download"
    }

The response to a download request will be a list of individual resources from the file, which can be downloaded and saved as a text file or immediately ingested into a downstream ETL process.

Edit on GitHub