Remarkably simple LLM prototyping and testing in healthcare context.
Project description
HealthChain
Simplify prototyping and testing AI/NLP applications in a healthcare context 💫 🏥.
Building applications that integrate in healthcare systems is complex, and so is designing reliable, reactive algorithms involving text and structured data. Let's try to change that.
pip install healthchain
🚧 This is a work in progress with a limited set of functionalities and resources implemented. Things might break. 💥 We are working towards a full release soon! 👀
Features
- 🍱 Create sandbox servers and clients that comply with real EHRs API and data standards.
- 🗃️ Generate synthetic FHIR resources or load your own data as free-text.
- 💾 Save generated request and response data for each sandbox run.
- 🎈 Streamlit dashboard to inspect generated data and responses.
- 🧪 Experiment with LLMs in a fully HL7 standard-compliant pipeline from day 1.
Clinical Decision Support (CDS)
CDS Hooks is an HL7 published specification for clinical decision support.
When is this used? CDS hooks are triggered at certain events during a clinician's workflow in an electronic health record (EHR), e.g. when a patient record is opened, when an order is elected.
What information is sent: the context of the event and FHIR resources that are requested by your service, for example, the patient ID and information on the encounter and conditions they are being seen for.
What information is returned: “cards” displaying text, actionable suggestions, or links to launch a SMART app from within the workflow.
What you need to decide: What data do I want my EHR client to send, and how will my service process this data.
import healthchain as hc
from healthchain.use_cases import ClinicalDecisionSupport
from healthchain.data_generator import DataGenerator
# Decorate class with sandbox and pass in use case
@hc.sandbox
class myCDS(ClinicalDecisionSupport):
def __init__(self) -> None:
self.data_generator = DataGenerator()
# Sets up an instance of a mock EHR client of the specified workflow
@hc.ehr(workflow="patient-view")
def load_data(self):
self.data_generator.generate()
return self.data_generator.data
# Define your application logic here
@hc.api
def service(self, request: str):
result = "Hello " + request["patient_name"]
return result
if __name__ == "__main__":
cds = myCDS()
cds.start_sandbox()
Then run:
healthchain mycds.py
This will populate your EHR client with the data generation method you have defined, send requests to your server for processing, and save the data in `./output' by default.
Streamlit dashboard
Note this is currently not meant to be a frontend to the EHR client, so you will have to run it separately from the sandbox application.
streamlit streamlit-demo/app.py
Road Map
- 📝 Adding Clinical Documentation use case: CDA data generation, NoteReader API, and structured data extraction applications
- 🎛️ Ability to test different EHR backend data configurations in client
- 📦 Versioning of configurations and model artifacts
- ✨ Improvements to synthetic data generator methods
- 👾 Add proper frontend for EHR client which renders more complex cards
- 🐳 Serve with Docker containers
- 🚀 Use LLMs to parse configuration and modify integration code
Contribute
We are always eager to hear feedback and suggestions, especially if you are a developer or researcher working with healthcare systems!
- 💡 Let's chat! Discord
- 🛠️ Contribution Guidelines
Acknowledgement
This repository makes use of CDS Hooks developed by Boston Children’s Hospital.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for healthchain-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 864e41658dc6d09eb5eb7f0c27024935c1d8bfc12f43a9386765848bf288d047 |
|
MD5 | 02106d4cda474137b8718519087237fc |
|
BLAKE2b-256 | 0a2cf8cd864f25c00e400dec8312e60359a57717d25f0038bfdebf8330f0824e |