Skip to content

Tool for importing ndjson files from object storage buckets to a Pathling server

License

Notifications You must be signed in to change notification settings

miracum/pathling-s3-import

Repository files navigation

pathling-s3-import

OpenSSF Scorecard SLSA 3

Tool for automatically $import'ing lists of ndjson FHIR resources from an S3-compatible bucket into a Pathling server.

Usage

See the help text of the command by simply running:

docker run --rm -it ghcr.io/miracum/pathling-s3-import:v2.1.3

Development

Launch development fixtures:

docker compose up

Install dependencies

dotnet restore
dotnet tool restore

Start the tool

import

dotnet run --project src/PathlingS3Import/ -- import \
    --s3-endpoint=http://localhost:9000 \
    --pathling-server-base-url=http://localhost:8082/fhir \
    --s3-access-key=admin \
    --s3-secret-key=miniopass \
    --s3-bucket-name=fhir \
    --s3-object-name-prefix=staging/ \
    --enable-metrics=true \
    --pushgateway-endpoint=http://localhost:9091/ \
    --dry-run=false

Or to test importing from a checkpoint:

dotnet run --project src/PathlingS3Import/ -- import \
    --s3-endpoint=http://localhost:9000 \
    --pathling-server-base-url=http://localhost:8082/fhir \
    --s3-access-key=admin \
    --s3-secret-key=miniopass \
    --s3-bucket-name=fhir \
    --s3-object-name-prefix=staging-with-checkpoint/ \
    --continue-from-last-checkpoint=true \
    --dry-run=false

merge

dotnet run --project src/PathlingS3Import/ -- merge \
    --s3-endpoint=http://localhost:9000 \
    --s3-access-key=admin \
    --s3-secret-key=miniopass \
    --s3-bucket-name=fhir \
    --s3-object-name-prefix=staging/ \
    --max-merged-bundle-size=10 \
    --dry-run=true

Run E2E Tests

docker build -t ghcr.io/miracum/pathling-s3-import:test .

dotnet test