Skip to main content

Provide a pipeline for medical encounter empowered by AI

Project description

hiperhealth

Core Python library for HiperHealth clinical AI workflows.

This repository is the library/SDK package (hiperhealth) and not the web application.

What this library provides

  • LLM-powered clinical assistance utilities:
    • Differential diagnosis suggestions
    • Exam/procedure suggestions
  • Data extraction utilities:
    • Medical reports (PDF/image) to structured FHIR-like resources
    • Wearable data (CSV/JSON) parsing and normalization
  • Privacy utilities:
    • PII detection and de-identification
  • Domain schemas and models:
    • Pydantic schemas
    • SQLAlchemy FHIR model definitions

Installation

Stable release

pip install hiperhealth

From source (development)

git clone https://github.com/hiperhealth/hiperhealth.git
cd hiperhealth
./scripts/install-dev.sh

System requirements

Some extraction features depend on system packages:

  • tesseract (OCR for image-based reports)
  • libmagic (MIME type detection)

They are included in the conda dev environment (conda/dev.yaml).

Configuration

Set these environment variables before using LLM-dependent features:

  • OPENAI_API_KEY (required)
  • OPENAI_MODEL (optional, defaults to o4-mini)

Example:

export OPENAI_API_KEY="your-key"
export OPENAI_MODEL="o4-mini"

Quickstart

1. Differential diagnosis and exam suggestions

from hiperhealth.agents.diagnostics import core as diag

patient = {
    "age": 45,
    "gender": "M",
    "symptoms": "chest pain, shortness of breath",
    "previous_tests": "ECG normal"
}

dx = diag.differential(patient, language="en", session_id="demo-1")
print(dx.summary)
print(dx.options)

exams = diag.exams(["Acute coronary syndrome"], language="en", session_id="demo-1")
print(exams.summary)
print(exams.options)

2. Wearable data extraction (CSV/JSON)

from hiperhealth.agents.extraction.wearable import WearableDataFileExtractor

extractor = WearableDataFileExtractor()
data = extractor.extract_wearable_data("tests/data/wearable/wearable_data.csv")
print(data[:2])

3. Medical report extraction (PDF/image -> structured output)

from hiperhealth.agents.extraction.medical_reports import MedicalReportFileExtractor

extractor = MedicalReportFileExtractor()
report = extractor.extract_report_data("tests/data/reports/pdf_reports/report-1.pdf")
print(report.keys())

4. De-identification

from hiperhealth.privacy.deidentifier import Deidentifier, deidentify_patient_record

engine = Deidentifier()
record = {
    "symptoms": "Patient John Doe reports severe headache.",
    "mental_health": "Lives at 123 Main St"
}
clean = deidentify_patient_record(record, engine)
print(clean)

Repository layout

  • src/hiperhealth/agents: AI interaction and extraction modules
  • src/hiperhealth/privacy: de-identification tools
  • src/hiperhealth/schema: Pydantic schemas
  • src/hiperhealth/models: SQLAlchemy models
  • tests: unit and integration tests
  • docs: MkDocs documentation source

Development

Create development environment

conda env create -f conda/dev.yaml -n hiperhealth
conda activate hiperhealth
./scripts/install-dev.sh

Run tests

pytest -vv

Run quality checks

pre-commit run --all-files
ruff check .
mypy .

Build docs locally

mkdocs serve --watch docs --config-file mkdocs.yaml

License

BSD 3-Clause. See LICENSE.

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

hiperhealth-0.4.0.tar.gz (29.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hiperhealth-0.4.0-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file hiperhealth-0.4.0.tar.gz.

File metadata

  • Download URL: hiperhealth-0.4.0.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for hiperhealth-0.4.0.tar.gz
Algorithm Hash digest
SHA256 a6a149334f8bcd7f7938fd9f4f649fb7f30e5ebd41939922135ddd2c58449ce9
MD5 08e7893fe3ae825f75072989643ccd18
BLAKE2b-256 49af9a6991f37d7704e1c6dfda5bb8ea9d3aa1472f5951f04a46b30ccd807aaf

See more details on using hashes here.

File details

Details for the file hiperhealth-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: hiperhealth-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for hiperhealth-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7bed449dfa60d1eed564d47b535b18ce51721a39a1e8a57ad9c9bf2c715f8554
MD5 a25d832b69891d0e3a317553696880a1
BLAKE2b-256 d00c1f0f66f327a47df7b8c60f0a7887a8d23eab6533545dc7419fbce7c870ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page