[Alpha] Extract medical codes with phenocr
/construe/phenocrAlpha: phenocr is an alpha feature. The API contract — request parameters and response shape — may change as its internals evolve, and results may vary between releases. Do not depend on it for production workloads yet.
Extracts medical codes from natural language clinical text using phenocr.
Supported code systems: HPO, ICD-10-CM, and SNOMED_CT_US. The code system name and version are both required.
Body parameters
textstringrequiredNatural language text to extract codes from
systemobjectrequirednamestringrequiredCode system name. Supported by phenocr: HPO, ICD-10-CM, SNOMED_CT_US.
versionstringrequiredCode system version to run against.
Successfully extracted codes
Response fields
systemobjectrequirednamestringoptionalCode system name. Can be a built-in system or a custom system name.
Built-in systems:
- CPT
- HCPCS
- HPO
- ICD-10
- ICD-10-CM
- ICD-10-PCS
- LOINC
- RXNORM
- SNOMED_CT_US
- SNOMED_CT_US_LITE
Custom systems:
- Any valid system name uploaded via /construe/upload. Requires a paid plan.
Usage of CPT is subject to AMA requirements: see PhenoML Terms of Service.
versionstringoptionalSpecific code system version.
codesobject[]requiredcodestringrequiredThe extracted code
descriptionstringrequiredShort description of the code
validbooleanrequiredWhether the code passed validation. Always true unless include_invalid is set to true, in which case invalid codes will have this set to false.
reasonstringoptionalExplanation for why this code was extracted (if include_rationale is true)
is_ancestorbooleanoptionalWhether this code is an ancestor (parent) of an extracted code rather than directly extracted. Only present when include_ancestors is true.
citationsobject[]optionalSource text references showing where this code was found in the input. Only present when include_citations is true and chunking method supports it. Ancestor codes do not receive citations.
textstringrequiredThe exact text span containing evidence for the code
begin_offsetintegerrequiredStarting byte offset in the original input text (0-indexed)
end_offsetintegerrequiredEnding byte offset (exclusive), such that input[begin_offset:end_offset] == text
categoriesobject[]optionalHigher-level groupings the extracted code belongs to (e.g. HPO category terms). Only populated by full-extraction chunking methods such as "fasthpocr".
uristringrequiredIdentifier for the category term (e.g. an HPO URI).
labelstringrequiredHuman-readable label for the category term.