The problem
An adverse event case starts life as whatever a vendor or business partner happened to submit — a typed PDF, a scanned and handwritten intake form, a different regional template entirely, sometimes just free text in an email. Today, a person reads that document and manually re-keys every field — patient details, suspect drug, reaction, seriousness, dates — into a Veeva Safety inbox item by hand.
That's slow precisely because the input refuses to be standardized. A rules-based form parser only works if the form matches the template it was built for; the moment a vendor sends something handwritten, scanned at an angle, or laid out differently, it breaks — which is why this had stayed a manual job.
Why this needs a model, not a template parser
The form itself isn't one fixed thing. The same case type shows up as a typed digital form, a handwritten scan, or a locally-adapted layout — the globally standard CIOMS suspect adverse reaction report is one shape it can take, but far from the only one. A coordinate-based parser breaks the moment the layout shifts; a model reading the page like a person would doesn't care which shape it's looking at.
The workflow
Upload → extract with confidence → map to schema → reviewer edits → submit to Veeva.
Step 1: extraction
The extraction prompt pulls every field label and value off the page — typed or handwritten — plus every checkbox and which option is selected, each with its own confidence score rather than one score for the whole document. Text fields and checkboxes fail differently, so each gets its own confidence rubric: a smudged signature and an ambiguous tick mark aren't the same kind of uncertain.
Step 2: mapping to schema
A second, separate prompt takes that extracted JSON and maps it onto the safety schema's exact field names and controlled vocabulary — matching on both label and field description, inferring a field from context when it isn't constrained to a single section, but only ever from evidence actually present in the extraction. Every mapped value carries three confidence numbers, not one.
Getting it into Veeva
Once a case clears review, the app authenticates against Veeva Vault Safety, transforms the mapped output into the structure Veeva expects, and calls an intake endpoint that creates a single inbox item with the original document attached — so a case arrives ready for review instead of needing to be retyped in by hand.