Skip to content

Makataui/PathWay

Repository files navigation

PathWay [WIP]

A bridge for your digital pathology files
Built loving with help a starting template from: FastAPI-Boilerplate

Python FastAPI Pydantic PostgreSQL Redis Docker NGINX

PyDicom OpenSlide

What is PathWay?

PathWay is many things but at it's heart, it has the following idea: to help build a bridge for pathology reporting of the future, combining WSI(Whole Slide Imaging/Images) with Synoptic Reporting.

Currently it's just being set up but I thought I'd document the journey publicly here rather than building it and then just releasing 0.1.0.

To be clear, we are very far from even a PoC at this stage so if you want to follow, please do so but please note that most features that I plan to include aren't even listed, let alone started.

Elevator Pitch

It's an easily deployable containerised solution that can take synoptic reports in FHIR and attach them to DICOM images, standardise to a custom ruleset, or take synoptic reports and attach them to other WSI types (please see below for supported types) and convert them to DICOM.

It can then send these onwards or store them for you.

How?

Well, it's a combination of an API, several other open sources tools which this would not be possible without and a lot of other inputs.

How is the Synoptic Report defined?

What is Structured Data Capture (SDC)?

DICOM SR (Structured Reporting) vs SDC vs XML datasets vs FHIR/FHIR SDC/Questionnaires

What is Unstructured Data?

What It Is Not:

It is not designed to be a universal viewer or converter - the viewer provided is just for demonstration purposes of the capabilities of the software and to help visualise it for users - which is why things like Postgres are provided as part of the Docker Compose but ideally you will map these to your own databases, softwares, APIs and middlewares.

Quick Note About File Security and File Validation:

This setup uses a basic AV to validate files against. Security of uploaded and mapped files is not guaranteed and is the end users responsibility - there is only a basic check here.

0. Features

  • XML Importer and Mapper For Datasets/SDC
  • Docker Startup for easy, cloud agnostic cloud deployment in any stack
  • FHIR Server and REST API, following latest standardise
  • Support for SNOMED

0.1 Inspiration

0.2 International Profiles

0.3 Radiologists

0.4 IMR - Interactive Multimedia Report Presentation

0.5 Saving And Embedding IMRs

0.6 FHIR Structure

0.7 HL7 Conversion / Mapping

0.8 Mapping Other Clinical Data And Imaging

0.9 Dealing With Challenges of IMR, specifically in Digital Pathology

1. About - Tech Stack and Open Source Libraries

FastAPI boilerplate creates an extendable async API using FastAPI, Pydantic V2, SQLAlchemy 2.0 and PostgreSQL:

  • FastAPI: modern Python web framework for building APIs
  • Pydantic V2: the most widely used data Python validation library, rewritten in Rust (5x-50x faster)
  • SQLAlchemy 2.0: Python SQL toolkit and Object Relational Mapper
  • PostgreSQL: The World's Most Advanced Open Source Relational Database
  • Redis: Open source, in-memory data store used by millions as a cache, message broker and more.
  • ARQ Job queues and RPC in python with asyncio and redis.
  • Docker Compose With a single command, create and start all the services from your configuration.
  • NGINX High-performance low resource consumption web server used for Reverse Proxy and Load Balancing.

Tip

If you want the SQLModel version instead, head to SQLModel-boilerplate.

2. Tech Features

  • โšก๏ธ Fully async
  • ๐Ÿš€ Pydantic V2 and SQLAlchemy 2.0
  • ๐Ÿ” User authentication with JWT
  • ๐Ÿช Cookie based refresh token
  • ๐Ÿฌ Easy redis caching
  • ๐Ÿ‘œ Easy client-side caching
  • ๐Ÿšฆ ARQ integration for task queue
  • โš™๏ธ Efficient and robust queries with fastcrud
  • โŽ˜ Out of the box offset and cursor pagination support with fastcrud
  • ๐Ÿ›‘ Rate Limiter dependency
  • ๐Ÿ‘ฎ FastAPI docs behind authentication and hidden based on the environment
  • ๐Ÿฆพ Easily extendable
  • ๐Ÿคธโ€โ™‚๏ธ Flexible
  • ๐Ÿšš Easy running with docker compose
  • โš–๏ธ NGINX Reverse Proxy and Load Balancing

3. Contents

  1. PathWay
  2. Pathway's Features
    1. PathWay's Inspiration
    2. International Profiles
    3. Radiologists
    4. IMR
    5. Saving And Embedding IMRs
    6. FHIR Structure
    7. HL7 Conversion / Mapping
  3. About The Tech
  4. Tech Features
  5. Contents
  6. Prerequisites
    1. Environment Variables (.env)
    2. Docker Compose
    3. From Scratch
  7. Terminology
    1. Term Definition
  8. Imaging
    1. Other Clinical Imaging
    2. Grossing / Specimen Macro Imaging
  9. Data Control And Privacy
    1. Data Pipelines
    2. Data Anonymisation
    3. WSI Labels
  10. Testing
  11. Contributing
  12. References
  13. License
  14. Contact

4. Prerequisites

4.0 Start

4.1 Environment Variables

4.2 Docker Compose (Preferred)

4.3 From Scratch Setup

5. Terminology

5.1 Term Definition

6. Other Imaging

6.1 Clinical Imaging

6.2 Grossing/Cut-up/Specimen Macro Imaging

7. Data Control And Privacy

7.1 Data Pipelines

7.2 Anonymisation - Data Identifier

7.3 Label

8. Testing

9. Contributing

10. References

11. License

MIT

12. Contact

Ferenc Igali โ€“ [@Makataui] github.com/Makataui

About

PathWay - a bridge for digital pathology and synoptic reporting

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages