Protocol Decompiler

Role: Solo Developer Timeline: Ongoing (2025–Present) Platform: Web

A clinical protocol intelligence platform that transforms complex trial protocol PDFs into structured, traceable, and reviewable study-build artifacts. It reconstructs Schedule of Assessments tables, extracts visits, procedures, forms, fields, eligibility criteria, laboratories, dosing events, and constraints, then presents a ClinSpark-oriented blueprint with evidence, confidence, diagnostics, validation, and export controls.

The Problem

Building an electronic data-capture or eSource system starts with a protocol PDF that was written for human interpretation, while the study system requires exact relationships between visits, timepoints, procedures, forms, fields, labs, dosing events, eligibility criteria, and edit checks. Manual translation is slow and fragile:

Solution Overview

Protocol Ingestion

  • Validates uploads, streams large PDFs to storage, calculates checksums, and rejects invalid or duplicate inputs
  • Classifies pages and prepares cleaned AI payloads while preserving original page text for auditability
  • Identifies schedule, visit, procedure, eligibility, treatment, safety, laboratory, PK, and specimen sections using semantic and structural signals

Schedule Reconstruction

  • Rebuilds Schedule of Assessments matrices instead of flattening them into paragraphs
  • Preserves periods, cohorts, visits, intra-visit timepoints, procedures, notes, and continuation-page relationships
  • Prevents common mistakes such as merging Screening with Admission/Day -1 or collapsing timed Day 1 procedures

Evidence-First Model

  • Builds deterministic study entities for metadata, visits, procedures, forms, fields, criteria, interventions, labs, ranges, code lists, and edit checks
  • Stores source wording, page references, confidence, diagnostics, and build gaps for important results
  • Uses explicit unresolved states instead of fabricating missing values

AI-Assisted Extraction

  • Runs focused passes for visits, procedures, forms, item groups, fields, code lists, criteria, and edit checks
  • Supports OpenRouter, OpenAI, Groq, Gemini, Ollama, and mock-provider paths
  • Uses structured output handling, rate limiting, retries, caching, fallback routing, and confidence scoring

ClinSpark Blueprint

  • Presents Study to Period/Visit to Timepoint to Procedure to Form to Field relationships
  • Highlights laboratory panels, eligibility criteria, evidence, readiness, unresolved fields, and build gaps
  • Generates builder-oriented packages for ClinSpark, EDC, eSource, and CDISC-oriented workflows

Validation & Export

  • Validates referential integrity, semantic consistency, evidence coverage, duplicates, orphaned records, and export readiness
  • Gates unsafe exports until review-required or unresolved artifacts are corrected
  • Exports JSON, CSV, XLSX, ODM-XML, annotated CRF HTML, raw text, and ClinSpark-oriented packages

Architecture

The backend is a Python/FastAPI application with SQLAlchemy persistence, background job processing, structured logging, authentication, authorization, storage controls, and REST APIs. The frontend is a React, TypeScript, and Vite application with study navigation, upload status, review panels, blueprint views, diagnostics, exports, and accessible UI components.

Tech Stack

Python FastAPI SQLAlchemy 2.0 Alembic PostgreSQL Celery Redis React 18 TypeScript Vite TailwindCSS Zustand LLM Orchestration ODM-XML CDISC

Screenshots

Challenges & Solutions

Outcomes & Impact

Lessons Learned

Future Improvements