Exporting files from your data store with the HealthLake console or AWS SDKs - AWS HealthLake

Exporting files from your data store with the HealthLake console or AWS SDKs

After you complete Setting up permissions for export jobs, you can export files from your data store to an Amazon Simple Storage Service (Amazon S3) bucket. To export files from a data store, you start a export job in HealthLake. An export job exports files from your data store in newline delimited JSON (.ndjson) format, where each line consists of a valid FHIR resource. When you start an export job, you must specify a AWS KMS key for encryption. To learn more about creating a KMS key, see Creating keys in the AWS Key Management Service Developer Guide.

The following topics cover how to start an export job with the AWS HealthLake console and the AWS SDKs with the start-fhir-export-job API operation.

Exporting files from your data store (console)

To export files (console), use the following steps.
  1. Create an output S3 bucket in the same Region as HealthLake.

  2. To start a new export job, identify the output Amazon S3 bucket and either create or identify the IAM role that you want to use. To learn more about IAM roles and trust policies, see IAM roles. Also use a KMS key encryption. To learn more about using KMS keys, see Amazon Key Management Service.

  3. To see the status of your export job, use ListFHIRExportJobs API operation.

Exporting files from your data store (AWS SDKs)

To export files from your data store with the AWS SDKs, use the start-fhir-export-job operation. The following code shows how to start an export job with the SDK for Python (Boto3).

import boto3 client = boto3.client('healthlake') response = client.start_fhir_export_job( JobName='job name', OutputDataConfig={ 'S3Configuration': { 'S3Uri': 's3://amzn-s3-demo-bucket/output-folder', 'KmsKeyId': 'arn:aws:kms:us-west-2:account-number:key/AWS KMS key ID' } }, DatastoreId='data store ID', DataAccessRoleArn='role ARN', ) print(response['JobStatus'])

To get the ID, ARN, name, start time, end time, and current status of a FHIR export job, use describe-fhir-export-job. Use list-fhir-export-jobs to list all export jobs and their statuses.

The following code shows how to get the properties of a specific export job with the SDK for Python (Boto3).

import boto3 client = boto3.client('healthlake') describe_response = client.describe_fhir_export_job( DatastoreId=datastoreId, JobId=jobId ) print(describe_response['ExportJobProperties'])