Search code examples
azurehl7-fhirfhir-server-for-azure

Querying copy status after export call - fhir azure


Using the export api, i am able to export the data out to the container inside storage account.

import requests

url = "https://<fhir-server>.azurehealthcareapis.com/$export"

payload = {}
headers = {
  'Accept': 'application/fhir+json',
  'Prefer': 'respond-async',
  'Authorization': 'Bearer <token>'
}

response = requests.request("GET", url, headers=headers, data = payload)

print(response.text.encode('utf8'))

In my case, the Observation.ndjson is around 700 MB in size and it takes a while to get exported to storage account.

Using rest api or by querying storage account is there any way check if the export has been completed or not ? I need to perform series of tasks once the data is copied completely to the storage container.


Solution

  • As indicated in the spec (https://hl7.org/fhir/uv/bulkdata/export/index.html#bulk-data-status-request) you should store the Content-Location return header of the $export request. That is the location where you can check status of the export and see the URLs of the resulting files.