Convert document to FHIR resource
/lang2fhir/documentExtracts text from a document (PDF or image) and converts it into a structured FHIR resource.
Patient identifier handling. When generating a patient (or patient-canvas) resource, US Core requires Patient.identifier (a business identifier such as an MRN). When the source text contains an identifier, it is extracted with an appropriate URI system. When the source text does not contain a detectable identifier, a synthetic one is generated with system: "urn:phenoml:lang2fhir-generated-id" and a UUID value so the resource remains FHIR-valid and US Core conformant. Callers who need a tenant-specific namespace should rewrite the synthetic system after extraction.
Body parameters
versionstringrequiredFHIR version to use
resourcestringrequiredType of FHIR resource to create. Accepts any FHIR resource type or US Core profile name.
contentstringrequiredBase64 encoded file content. Supported file types: PDF (application/pdf), PNG (image/png), JPEG (image/jpeg). File type is auto-detected from content magic bytes.
configobjectoptionalOptional processing configuration shared across document endpoints.
page_filterobjectoptionalConfigures per-page pre-extraction filtering. When set, each page of text extracted from the document is classified by an LLM, and pages classified as irrelevant to the supplied context are dropped before FHIR extraction.
contextstringrequiredNatural-language description of what IS relevant to the extraction goal. Pages that do not match are dropped from downstream FHIR extraction.
Successfully created FHIR resource from document