Bulk Data Client
    Preparing search index...

    Interface NormalizedOptions

    interface NormalizedOptions {
        _elements?: string;
        _outputFormat?: string;
        _since?: string;
        _type?: string;
        _typeFilter?: string;
        accessTokenLifetime: number;
        addDestinationToManifest: boolean;
        allowPartialManifests: boolean;
        awsAccessKeyId: string;
        awsEndpoint: string;
        awsRegion: string;
        awsSecretAccessKey: string;
        clientId: string;
        custom?: string[];
        destination: string;
        downloadAttachments: boolean | string[];
        fhirUrl: string;
        fileDownloadRetry: {
            limit?: number;
            maxRetryAfter?: number;
            methods?: Method[];
            statusCodes?: number[];
        };
        forceStandardFileNames: boolean;
        global: boolean;
        group: string;
        ignoreAttachmentDownloadErrors?: boolean;
        includeAssociatedData?: string;
        inlineDocRefAttachmentsSmallerThan: number;
        inlineDocRefAttachmentTypes: string[];
        lenient: boolean;
        log: LoggingOptions;
        logResponseHeaders: string
        | RegExp
        | (string | RegExp)[];
        ndjsonMaxLineLength: number;
        ndjsonValidateFHIRResourceCount: boolean;
        ndjsonValidateFHIRResourceType: boolean;
        organizeOutputBy: string;
        parallelDownloads: number;
        patient?: string;
        pdfToText: boolean;
        post: boolean;
        privateKey: Key;
        reporter: "text" | "cli";
        requests: OptionsOfUnknownResponseBody;
        retryAfterMSec: number;
        saveManifest: boolean;
        scope?: string;
        tokenUrl: string;
    }
    Index
    _elements?: string
    _outputFormat?: string
    _since?: string
    _type?: string
    _typeFilter?: string
    accessTokenLifetime: number
    addDestinationToManifest: boolean

    The original export manifest will have an url property for each file, containing the source location. It his is set to true, add a destination property to each file containing the path (relative to the manifest file) to the saved file.

    This is ONLY useful if saveManifest is set to true.

    Defaults to false

    allowPartialManifests: boolean
    awsAccessKeyId: string

    Only needed if destination points to S3

    awsEndpoint: string

    A URL, example: http://localhost:9000. Custom S3-compatible endpoint storage providers). Only used if destination points to S3. If not set, the real AWS S3 endpoint is used.

    awsRegion: string

    Example: us-east-1

    awsSecretAccessKey: string

    Only needed if destination points to S3

    clientId: string
    custom?: string[]
    destination: string

    Examples:

    • s3://bucket-name/optional-subfolder/ - Upload to S3
    • ./downloads - Save to local folder (relative to the config file)
    • downloads - Save to local folder (relative to the config file)
    • /path/to/downloads - Save to local folder (absolute path)
    • file:///path/to/downloads - Save to local folder (file url)
    • http://destination.dev - POST to http
    • http://username:password@destination.dev - POST to http with basic auth
    • "" - do nothing
    • "none" - do nothing

    Defaults to ./downloads

    downloadAttachments: boolean | string[]

    If this is set to false, external attachments found in DocumentReference resources will not be downloaded. The DocumentReference resources will still be downloaded but no further processing will be done. Can also be an array of white-listed mime types.

    fhirUrl: string

    FHIR server base URL

    fileDownloadRetry: {
        limit?: number;
        maxRetryAfter?: number;
        methods?: Method[];
        statusCodes?: number[];
    }

    A subset of got retry configuration object, determining retry behavior when downloading files. For most scenarios, an object with only a limit: number property will be sufficient. This determines how many times a file download will be retried before failing. Each subsequent attempt will delay using an exponential backoff. For more details on options, see https://github.com/sindresorhus/got/blob/main/documentation/7-retry.md.

    forceStandardFileNames: boolean

    Sometimes a server may use weird names for the exported files. For example, a HAPI server will use random numbers as file names. If this is set to true files will be renamed to match the standard naming convention - {fileNumber}.{ResourceType}.ndjson.

    Defaults to true

    global: boolean
    group: string
    ignoreAttachmentDownloadErrors?: boolean

    If true the client will try to download the attachments but it will ignore download errors (although those errors will still be logged).

    includeAssociatedData?: string
    inlineDocRefAttachmentsSmallerThan: number

    In DocumentReference resources, any attachment elements having an url (instead of inline data) and a size below this number will be downloaded and put inline as base64 data. Then the size property will be updated and the url will be removed.

    • To always disable this, set it to 0
    • To always enable this, set it to Infinity (bad idea!)
    • To inline files smaller than 5 MB set it to 5 * 1024 * 1024

    Defaults to 0

    Ignored if downloadAttachments is set to false

    inlineDocRefAttachmentTypes: string[]

    If an attachment can be inlined (based on its size and the value of the inlineDocRefAttachmentsSmallerThan option), then its mime type will be compared with this list. Only files of listed types will be inlined and the rest will be downloaded into "attachment" subfolder.

    Defaults to ["text/plain", "application/pdf"]

    Ignored if downloadAttachments is set to false

    lenient: boolean

    If true, adds handling=lenient to the prefer request header. This may enable a "retry" option after certain errors. It can also be used to signal the server to silently ignore unsupported parameters.

    Can be overridden from terminal parameter --lenient

    logResponseHeaders: string | RegExp | (string | RegExp)[]

    ResponseHeaders to include in error logs for debugging purposes When 'all' is specified, all responseHeaders are returned When 'none' is specified, no responseHeaders are returned Otherwise, log any responseHeaders matches against 1...* strings/regexp NOTE: When an empty array is specified, an empty object of responseHeaders will be returned

    ndjsonMaxLineLength: number

    While parsing NDJSON files every single (non-empty) line is parsed as JSON. It is recommended to set a reasonable limit for the line length so that a huge line does not consume the entire memory.

    Defaults to 1000000

    ndjsonValidateFHIRResourceCount: boolean

    If the server reports the file count in the export manifest, verify that the number of resources found in the file matches the count reported by the server.

    Defaults to true

    ndjsonValidateFHIRResourceType: boolean

    If true, verifies that every single JSON object extracted for the NDJSON file has a resourceType property, and that this property equals the expected type reported in the export manifest.

    Defaults to true

    organizeOutputBy: string
    parallelDownloads: number

    How many downloads to run in parallel. This will speed up the download but can also overload the server. Don't be too greedy and don't set this to more than 10!

    Defaults to 5

    patient?: string
    pdfToText: boolean

    If this is true, attachments of type PDF that are being inlined will first be converted to text and then inlined as base64

    Defaults to false

    Ignored if downloadAttachments is set to false

    post

    post: boolean
    privateKey: Key

    The private key used to sign authentication tokens

    reporter: "text" | "cli"
    requests: OptionsOfUnknownResponseBody
    retryAfterMSec: number

    If the server does not provide Retry-after header use this number of milliseconds before checking the status again

    saveManifest: boolean

    In some cases it might be useful to also save the export manifest file along with the downloaded NDJSON files.

    Defaults to false

    scope?: string
    tokenUrl: string

    The Bulk Data server token URL ("none" for open servers)