An open source reference implementation for organ procurement and transplantation.
2020 was a weird year for a lot of people. I never thought I would be advising on organ transplantation at HRSA for the federal government. I was one of a few tasked with exploring the feasibility of building a new system for organ transplantation. In an effort to remedy my lack of knowledge about the space, I decided to try and domain model based on public OPTN policy in my private time. Could it be done? What would the hard parts be?
I discovered through reading and researching that indeed it could be done in a practical application of a reference implementation. To my great relief, it didn’t require any sophisticated artificial intelligence or probability distributions to create matching and patient waitlist algorithms. That entire category of solution terrified me from an auditing, ethics, and maintainability perspective. All that was required was very high availability (like a 911 system), auditability, maintainability, and good, old-fashioned constraint programming.
Immediately, I thought to use OCaml to model the logic for matching. OCaml would give me maintainability (functors, or parameterized modules, are heavily used throughout the main library, e.g. transplants are parameterized by the organs and donors they refer to instead of classes with instances) and trust (formal verification & high level domain logic).
Largely, the most pressing factor in organ transplantation is time. OpenTransplant could best be described as a dating app meets a high frequency trading platform — but for matchmaking between patients and donors’ organs.
A heart decays in four to six hours. A pancreas is even more tricky because it is highly immune sensitive and decays faster (can tolerate less “cold-time” or ischemic time) than the kidneys do. For rural organ procurement facilities this means they must fetch blood from the donor and run human lymphocyte antigen (HLA) typing tests to allow surgeons to receive match offers which could take hours of precious time if they don’t have their own in-house histocompatibility lab. HLA compatibility is nuanced and can need to be updated depending on immune system changes in a waiting patient.
Decisions are being made within a very short window similar to how air traffic control must land a plane every minute in the London-Heathrow airspace. To avoid decision fatigue from landing planes, ATCS in London do work in thirty minute shifts. Organ procurement coordinators do not have such luxury and work long shifts shouldering the majority of effort. Transplant surgeons are busy specialists who have little free time and a volatile schedule.
Imagine the possibilities for surgeons if we could use cutting edge integrations with labs to automatically calculate virtual HLA crossmatch information for every potential match, regardless of organ type. We could provide software that aides and facilitates decision making while also leaving physicians and care-coordinators at the helm. There is abundant low hanging fruit in this space and easy feature victories like HIPAA compliant video chat that leave me thinking the space is ripe for an OSS solution.
I have decided to keep working on this in my spare time. I’d like to open the project up to others who are interested in collaborating with me. It takes a village to write something this complicated. Thank you to the people (past & present) who have helped this project get to where it is today.
One day the laws may change and an open source reference implementation could be used to good purpose. Other countries and communities outside the United States could also benefit from such a transplant network reference. I’m looking for experts or beginners interested in:
- Writing test senarios in Cucumber & Gherkin
- Helping build FHIR APIs for EHR integrations
- Experience with the Elixir Phoneix Web Framework
- Designers & Front-end Developers interested in implementing: https://designsystem.digital.gov/components/overview/
- Working on the backend scheduling & matching CLI in OCaml
- Experience with event sourcing and/or postgreSQL & redis
- Docker or any DevOps experience building or maintaining CI/CD flows
I’d also like to ask for the help of:
- Clinical experts or SRTR experts
- Policy makers or OPTN board members
- Nurses and transplant surgeons
- Transplant coordinators & organ procurement coordinators
- Patients, families, & living donors
I never thought I’d be interested in organ transplant or that I would have a career in government marked by public health policy, but I fell in love with the hard working doctors I spoke with trying to manage a very complex and burdensome workflow. I think an open source solution could empower the government to move forward into the future.