Filter the prediction set
Use the optionalfilter field to restrict which codes the model may predict. include and exclude each take a list of condition objects:
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:
For example, to predict type 2 diabetes mellitus (
E11) and its descendants, but never the specific code for diabetes with hyperosmolarity (E11.00):
code. For example, SNOMED CT concepts can be filtered by 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.
filter applies to all of them. If a condition doesn’t apply to one of the requested systems — for example, a semantic_tag condition when also requesting CPT — that system fails validation and the entire request is rejected, not just that system.
No prediction is attempted when validation fails. See Errors for the general error response shape.
Please contact us if you need help configuring your requests or have questions about advanced usage.