Extract multiple FHIR resources from text
/lang2fhir/create/multiAnalyzes natural language text and extracts multiple FHIR resources, returning them as a transaction Bundle. Automatically detects Patient, Condition, MedicationRequest, Observation, and other resource types from the text. Resources are linked with proper references (e.g., Conditions reference the Patient).
Patient identifier handling. 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 bundle remains FHIR-valid and US Core conformant. Callers who need a tenant-specific namespace should rewrite the synthetic system after extraction.
Body parameters
textstringrequiredNatural language text containing multiple clinical concepts to extract
versionstringoptionaldefault R4FHIR version to use
providerstringoptionalOptional FHIR provider name for provider-specific profiles
implementation_guidestringoptionalCustom Implementation Guide name. When specified, profiles from this IG are included alongside US Core profiles during resource detection. US Core is always the base layer; custom IG profiles are additive.
detection_effortstringoptionaldefault standardDetection effort. 'standard' runs detection once, 'deep' runs detection multiple times for higher recall.
standarddeepvalidation_methodstringoptionaldefault noneFHIR validation method to apply to the generated bundle. 'none' skips validation (default). 'check' runs the bundle through a FHIR structure validator and includes the results in the response. 'fix' runs validation and attempts to auto-correct errors using an LLM (up to 3 validation passes). The response includes results from each pass. Warning: 'fix' can significantly increase latency due to multiple LLM and validation round-trips.
nonecheckfixSuccessfully extracted FHIR resources
Response fields
successbooleanoptionalWhether extraction was successful
messagestringoptionalStatus message
bundleobjectoptionalFHIR transaction Bundle containing all extracted resources
resourceTypestringoptionaltypestringoptionalentryobject[]optionalfullUrlstringoptionalresourceobjectoptionalrequestobjectoptionalresourcesobject[]optionalSummary of extracted resources
tempIdstringoptionalTemporary UUID for the resource
resourceTypestringoptionalFHIR resource type
descriptionstringoptionalContext-enriched rewritten text excerpt for this resource
originalTextstringoptionalVerbatim text excerpt from the original clinical document
validationobjectoptionalFHIR validation results. Present when validation_method is 'check' or 'fix'. Contains results from each validation pass. For 'check', there is one pass. For 'fix', there may be up to 3 passes as the system attempts auto-correction.
passesobject[]optionalResults from each validation pass, in chronological order
issuesobject[]optionalValidation issues found in this pass
statsobjectoptionalValidation statistics for this pass
fixedbooleanoptionalWhether validation errors were successfully fixed by the LLM. Always false for 'check' mode. For 'fix' mode, true if errors were resolved and the returned bundle is the corrected version.
attemptsintegeroptionalTotal number of validation passes run (1 for check, 1-3 for fix)
summarystringoptionalHuman-readable summary of the validation outcome