Filter code prediction output
Use the optionalfilter field to restrict which codes the model may predict. The include and exclude objects take a list of conditions used to constrain prediction output:
include: codes matching all of these conditions are eligible. Empty or omitted means every code in the system is eligible.exclude: codes matching all of these conditions are removed from the eligible set. Empty or omitted means nothing is removed.
op supports:
Examples
ICD-10
ICD-10
Limit code predict results to type 2 diabetes mellitus (
E11) and its descendants, but never the specific code for diabetes with hyperosmolarity (E11.00):SNOMED-CT
SNOMED-CT
Filter SNOMED-CT concepts by See SNOMED CT for the full list of supported
semantic_tag, the clinical category a concept belongs to:semantic_tag values.Filter validation
Filter conditions are validated before prediction runs. A request is rejected with a 400 error if:propertyisn’t a supported attribute for the coding system (code, or a system-specific attribute likesemantic_tag).valuedoesn’t match the typeopexpects — a string or list of strings foris-a/descendent-of, a boolean forexists, a list forin.is-aordescendent-ofis used on a property other thancode.- A code referenced in a condition (directly, or as the ancestor in an
is-a/descendent-ofcondition) doesn’t exist in the coding system.
When requesting multiple coding systems, the same
filter applies to all of them.If a condition doesn’t apply to one of the requested systems (e.g., a semantic_tag condition when requesting both SNOMED-CT and CPT), then that system fails validation and the entire request is rejected.Please contact us if you need help configuring your requests or have questions about advanced usage.