RCMbox Docs

athena/sync-to-aidbox

Syncs clinical data from Athena Health into Aidbox via bulk FHIR export. Pulls patient, encounter, procedure, practitioner, and coverage data from Athena's FHIR API, normalizes it, stages it in Azure Blob Storage, and triggers an Aidbox $import to load it.

Script path: @aidbox-billing/athena/sync-to-aidbox

Input

ParameterTypeDescription
tenantOrganizationIdstringAidbox Organization ID scoping the sync
sincestring (optional)ISO date string — only sync resources updated since this date

Output

FieldTypeDescription
importedCountnumberTotal number of FHIR resources imported
resourceCountsobjectPer-resource-type counts
errorsobject[]Any errors encountered during sync

Prerequisites

Configure the Athena credentials via environment variables:

VariableDescription
ATHENA_CLIENT_IDAthena API client ID
ATHENA_SECRETAthena API client secret
AZURE_STORAGE_ACCOUNTAzure Storage account name
AZURE_CONTAINERAzure Blob container name
AZURE_SAS_TOKENAzure Shared Access Signature token

Usage in workflow YAML

- id: sync-athena
  script: "@aidbox-billing/athena/sync-to-aidbox"
  timeout: "30m"
  params:
    tenantOrganizationId: $input.tenantOrganizationId
    since: $input.since

Use a long timeout — bulk exports can take several minutes depending on data volume.

See also

Last updated: