Skip to content
/ serie Public

Specific Endpoints for Research Integration Events

Notifications You must be signed in to change notification settings

FNNDSC/serie

Repository files navigation

SERIE -- ChRIS

Version Tests codecov

The Specific Endpoints for Research Integration Events, or SERIE, is a FastAPI application which defines the business logic of event-driven ChRIS use cases. E.g. it handles use cases such as "for every DICOM series received with the description 'Hips to Ankles' create a new feed and run the leg length discrepancy (LLD) analysis pipeline."

How It Works

SERIE should be called on by an instance of Hasura listening to the PostgreSQL database of the ChRIS backend (CUBE).

Architecture Diagram

The LLD pipeline works like this:

  1. PACS --[DICOM image data]--> oxidicom
  2. oxidicom --[registers file to]--> PostgreSQL
  3. PostgreSQL --[event detected by]--> Hasura
  4. Hasura --[HTTP request: handle event]--> SERIE
  5. SERIE --[HTTP request: run workflow]--> CUBE

Development

Install rye and run

rye sync

For local testing, run ChRIS locally with Hasura.

cd
git clone https://github.com/FNNDSC/miniChRIS-docker.git
cd miniChRIS-docker
./minichris.sh
docker compose --profile hasura up -d

Testing

Run unit tests on-the-metal:

rye run pytest

Integration and end-to-end tests require SERIE to run in the same docker network as CUBE and Hasura. First, run miniChRIS-docker to get CUBE and Hasura up, then run pytest and SERIE using Docker Compose:

docker compose run --use-aliases test

Deployment Notes

  • The only environment variable needed by SERIE is CHRIS_URL, which should be set to the API URL of CUBE e.g. https://cube.chrisproject.org/api/v1/
  • The configuration of SERIE happens in Hasura. You can use the Hasura console to edit the configuration, or use hasura-cli configure SERIE via Hasura metadata YAML files. See the example in hasura/.../public_pacsfiles_pacsfile.yaml.