claimseed

v0.9.0
io.github.claimseed/claimseed Checked 6 hours ago Published 18 hours ago

Synthetic US medical-billing documents (PDF and ground truth) for testing extractors and agents

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_document_types List document types

List the document types claimseed can render, each with a short description and its scenario slugs.

describe_document_type Describe a document type

Describe one document type: every scenario with its description, period (none for a notice type, or for commercial-eob, whose dates come from the seed), number of claims (null for a notice type), its expected findings (kind, severity, rule), its decoys (lines that look wrong but follow the rules) and its public sources. The expected findings are the errors it plants and the correct denials a reviewer should surface (kind coverage-denial, severity info), so a scenario can have expected findings and no planted error. It also lists the type's layout variant ids, which layout_variant accepts besid…

ParameterTypeDescription
type *stringdocument type: msn, itemized-bill, ppo-eob, hmo-eob, commercial-eob, commercial-denial, ma-denial, abn, gfe, part-d-eob

generate_data Generate document data

Generate the data and ground truth of one document without rendering it (no file is saved). The same type, scenario and seed always give the same result. Every value is synthetic.

ParameterTypeDescription
scenario *stringscenario slug, e.g. baseline-clean (see describe_document_type)
type *stringdocument type: msn, itemized-bill, ppo-eob, hmo-eob, commercial-eob, commercial-denial, ma-denial, abn, gfe, part-d-eob
insurerstringFictional insurer that administers the plan: a (portrait, one claim per page) or b (landscape, one table of all claims); commercial-eob only, not for a blind render, drawn from the seed if omitted.
layout_variantstringOptional. A layout variant id from this document type's published list, or seeded to pick one from the seed. Applies only to itemized-bill, ppo-eob and hmo-eob. Leave it out for the standard layout, u…
seedstringany short string (letters, digits, . _ -); the same seed always gives the same document

render_document Render a document to PDF

Render one document and return it in the result: its pages as images (as many as fit; from_page shows the rest), the ground truth, the PDF's SHA-256 and page count, and the PDF itself when include_pdf is set and it fits within the size limit. No file is saved. Every page carries specimen markers.

ParameterTypeDescription
scenario *stringscenario slug, e.g. baseline-clean (see describe_document_type)
type *stringdocument type: msn, itemized-bill, ppo-eob, hmo-eob, commercial-eob, commercial-denial, ma-denial, abn, gfe, part-d-eob
alsoOther documents to render with this one: "835" for an X12 835 of the same claims (msn, ppo-eob, hmo-eob, commercial-eob), "bill" for the provider's statement for one claim of the EOB (ppo-eob, hmo-eob…
billstringProvider's statement variant when also includes bill, default clean: clean (no error of its own), over-owed (the contractual adjustment is too small, so the balance due is more than the EOB's member s…
from_pageintegerfirst page to return as an image (default 1)
include_pdfbooleanalso return the PDF itself, embedded in the result; it counts toward the same size limit as the page images and is left out, with a note, when it alone is over it
insurerstringFictional insurer that administers the plan: a (portrait, one claim per page) or b (landscape, one table of all claims); commercial-eob only, not for a blind render, drawn from the seed if omitted.
layout_variantstringOptional. A layout variant id from this document type's published list, or seeded to pick one from the seed. Applies only to itemized-bill, ppo-eob and hmo-eob. Leave it out for the standard layout, u…
previewstringpages returned as images: none, the first (from from_page), or all from from_page on, as many as fit in one result (default all)
seedstringany short string (letters, digits, . _ -); the same seed always gives the same document

degrade_document Render a scanned-looking copy of a document

Render a degraded copy of one document and return it: a flatbed scan, a fax, a phone photo or a low-resolution copy (preset), as an image-only PDF with the specimen band and watermark drawn on top of the degraded pages. The settings come from the seed and are recorded in the ground truth (degradation, degradationParams); the fields are those of the clean document. Returns page images (as many as fit), the ground truth, and the PDF itself when include_pdf is set and it fits. No file is saved.

ParameterTypeDescription
preset *stringscan (flatbed scan), fax (black and white, standard or fine), photo (phone photo of the page on a table) or low-res
scenario *stringscenario slug, e.g. baseline-clean (see describe_document_type)
type *stringdocument type: msn, itemized-bill, ppo-eob, hmo-eob, commercial-eob, commercial-denial, ma-denial, abn, gfe, part-d-eob
from_pageintegerfirst page to return as an image (default 1)
include_pdfbooleanalso return the degraded PDF itself; it counts toward the same size limit as the page images and is left out, with a note, when it alone is over it
insurerstringFictional insurer that administers the plan: a (portrait, one claim per page) or b (landscape, one table of all claims); commercial-eob only, not for a blind render, drawn from the seed if omitted.
layout_variantstringOptional. A layout variant id from this document type's published list, or seeded to pick one from the seed. Applies only to itemized-bill, ppo-eob and hmo-eob. Leave it out for the standard layout, u…
previewstringpages returned as images: none, the first (from from_page), or all from from_page on, as many as fit in one result (default all)
seedstringany short string (letters, digits, . _ -); the same seed always gives the same document

render_blind Render blind document

Renders a blind document: a synthetic medical-billing PDF whose footer, title and file names carry only an opaque id, so nothing in it tells a reader which errors were planted. Nothing is saved: the page images, the 835 remittance when asked for and, with include_pdf, the PDF itself come back in the result. The result also returns the id and the PDF's SHA-256, but never the answer key, the scenario or the seed. Call `get_answer_key` with the id to get the key.

ParameterTypeDescription
scenario *stringscenario slug, e.g. baseline-clean (see describe_document_type)
type *stringdocument type: msn, itemized-bill, ppo-eob, hmo-eob, commercial-eob, commercial-denial, ma-denial, abn, gfe, part-d-eob
alsoOther documents to render blind with this one: "835" for an X12 835 of the same claims (msn, ppo-eob, hmo-eob, commercial-eob), "bill" for the provider's statement for one claim of the EOB (ppo-eob, h…
billstringProvider's statement variant when also includes bill, default clean: clean (no error of its own), over-owed (the contractual adjustment is too small, so the balance due is more than the EOB's member s…
from_pageintegerfirst page to return as an image (default 1)
include_pdfbooleanalso return the PDF itself, embedded in the result; it counts toward the same size limit as the page images and is left out, with a note, when it alone is over it
layout_variantstringOptional. A layout variant id from this document type's published list, or seeded to pick one from the seed. Applies only to itemized-bill, ppo-eob and hmo-eob. Leave it out for the standard layout, u…
presetstringOptional preset for a degraded copy (scan, fax, photo or low-res), which has its own id.
previewstringpages returned as images: none, the first (from from_page), or all from from_page on, as many as fit in one result (default all)
seedstringany short string (letters, digits, . _ -); the same seed always gives the same document

get_answer_key Get blind document answer key

Returns the answer key of a blind document this server rendered, found by its id. Keys live only in the running server's memory, which holds the most recent 1,000, so save each key you need.

ParameterTypeDescription
id *stringThe id that `render_blind` returned for the document.

verify_document Score an extractor against a document

Score what an extractor or bill auditor reported about one document against its answer key, rebuilt from the type, scenario and seed with this version of claimseed. The report uses the answer key's vocabulary (schema://extractor-output): `fields` maps field paths of documents[0].fields to the values read; `errors` lists flagged errors as { kind, fieldRef or lineRef }. Returns field accuracy with the paths read wrong or missed, error recall and precision, false alarms, which decoys were flagged, and excludingInfo: error figures without severity info entries, for billing and notice errors alone.…

ParameterTypeDescription
output *objectthe extractor's report (schema://extractor-output). What an extractor or bill auditor reports about one claimseed document, for scoring with `claimseed-core verify` or the MCP tool verify_document. It…
scenario *stringscenario slug, e.g. baseline-clean (see describe_document_type)
type *stringdocument type: msn, itemized-bill, ppo-eob, hmo-eob, commercial-eob, commercial-denial, ma-denial, abn, gfe, part-d-eob
billstringWhen document is bill, the variant the provider's statement was rendered with (default clean).
documentstringWhich document the report is on, by default the type's own. On a notice type: notice for the notice itself, or a companion's role (eob for the EOB beside a denial letter or notice, msn for the MSN bes…
insurerstringFictional insurer that administers the plan: a (portrait, one claim per page) or b (landscape, one table of all claims); commercial-eob only, not for a blind render, drawn from the seed if omitted.
layout_variantstringOptional. A layout variant id from this document type's published list, or seeded to pick one from the seed. Applies only to itemized-bill, ppo-eob and hmo-eob. Leave it out for the standard layout, u…
seedstringany short string (letters, digits, . _ -); the same seed always gives the same document