The challenge
Much clinical trial data still starts on paper. Site staff fill in case report forms by hand, and someone then has to retype every value into the electronic data capture system. It’s slow and repetitive, and every typo is a data quality problem in a setting where each value has to be accurate and traceable.
Four things made automating this hard:
- Paper is messy. Forms come in as scans with handwriting, checkboxes, stamps and varying layouts.
- Every study is different. Each study has its own fields, units and coding conventions in Castor’s platform.
- Every value needs an audit trail. Under GCP and 21 CFR Part 11, it must be clear where each value came from.
- Patient data is highly sensitive. Records fall under HIPAA and GDPR, so data handling has to be tightly controlled.
What we built
We built an AI pipeline that reads paper clinical trial forms and maps their data into Castor’s platform, with automated checks and human review before anything is saved.
How it works:
- OCR on paper forms. Scanned forms are processed with OCR to extract the values in each field, including handwritten entries.
- AI agents map the fields. Agents match each extracted value to the right field in Castor’s platform for that study, with the correct type, units and format.
- LLM-as-a-judge validation. A separate LLM reviews every mapping and checks whether it makes sense: right field, plausible value, consistent with the rest of the form. Questionable mappings are flagged instead of passed through.
- Linked to the source. Each mapped value keeps a link back to where it appeared on the original form.
- Human review. A reviewer checks the flagged and proposed values and approves them. Nothing enters the record without approval.
Key design decisions
A judge on every mapping. OCR and mapping each introduce their own errors. Adding an LLM judge as an independent check catches bad mappings before a person ever sees them, so reviewers spend their time on real edge cases instead of obvious mistakes.
AI proposes, people decide. In a regulated setting, the goal isn’t full automation. It’s trustworthy data. The AI handles the slow work of reading and mapping, and a person stays accountable for every value.
Traceability built in. Linking each value to its place on the original form lets a reviewer verify it in seconds and gives auditors the trail they need.
Results
- 99.8% submission success rate
- 0.8% of AI-proposed values changed by reviewers
A 0.8% edit rate means reviewers accept more than 99 out of 100 proposals as-is, which turns manual retyping into a quick verification step.
About Castor
Castor is an AI-native clinical trial platform combining EDC, eCOA/ePRO, eConsent and data management. It supports 19,000+ studies for 900+ customers worldwide, across MedTech, biotech, pharma, CROs and academia.
Stack: OCR, LLMs, Claude, LangChain, AI agents, LLM-as-a-judge, Python, AWS, React
Want to cut manual data entry in a regulated workflow? Book a call
