Skip to main content
For example, limit predictions to diabetes codes and their descendants:
The optional filters field accepts a list of system-scoped filter objects, one per coding system:
The final prediction set is the include set minus the exclude set.

Condition groups

The condition groups used in include and exclude combine conditions with AND or OR logic. A ConditionGroup has two fields:

Conditions

Each condition has the following fields: op supports:
  • is-a and descendent-of only apply to the code property. Using them on any other property returns a 400 error.
  • is-a and in accept arrays, so use value: ["E11", "E13"] instead of match: "any" with multiple conditions on the same property.

Filterable properties

Additional properties exist on some systems’ code models but are not officially supported and may change. If you need to filter on a property not listed here, contact us.

Examples

AND: match all

Predict diabetes mellitus SNOMED-CT codes AND limit results to codes with semantic tag “disorder”

OR: match any

Predict SNOMED-CT codes for diabetes OR any procedure codes

Nested groups: mixed AND/OR

Predict SNOMED-CT codes for diabetes disorders OR hypertension findings

Specific inclusion/exclusion criteria

Limit code predict results to type 2 diabetes mellitus (E11) and its descendants, but never the specific code for diabetes with hyperosmolarity (E11.00) or diabetes with hyperosmolarity with coma (E11.01)

Hierarchy filtering

Predict ICD-10 codes for diabetes mellitus (E11), but do not include results that are descendants of diabetes with hyperosmolarity (E11.0)
Filter SNOMED-CT concepts by semantic_tag, the clinical category a concept belongs to. Use op: "in" to restrict predictions to one or more categories:
See SNOMED CT for the full list of supported semantic_tag values.

Multi-system requests

When requesting multiple coding systems in a single request, provide one filter object per system. Each system only applies its own filter:
The SNOMED-CT system only applies the semantic_tag filter, and the ICD-10-CM system only applies the is-a E11 filter. Each system ignores filters scoped to other systems.

Empty filter

Omit the filters field entirely for open-ended prediction. The API predicts across the full coding system.

Filter validation

Filter conditions are validated before prediction runs. A request is rejected with a 400 error if:
  • property isn’t a supported attribute for the coding system (code, or a system-specific attribute like semantic_tag).
  • value doesn’t match the type op expects: a string or list of strings for is-a/descendent-of, a boolean for exists, a list for in.
  • is-a or descendent-of is used on a property other than code.
  • A code referenced in a condition (directly, or as the ancestor in an is-a/descendent-of condition) doesn’t exist in the coding system.
  • An attribute value doesn’t match any known value for that property (e.g. semantic_tag set to an unsupported value).
  • A ConditionGroup has an empty conditions array.
  • ConditionGroup nesting exceeds depth 3.
When requesting multiple coding systems, each system validates only its own filter. A filter for a system that isn’t in the system field is ignored. If a system has no corresponding filter object, no filtering is applied to it.

Error response

This error is returned when a condition references a property the requested coding system does not support. For example, filtering by semantic_tag on ICD-10-CM or CPT fails validation because those systems do not define a semantic_tag attribute. See Errors for the full error response shape.
Please contact us if you need help configuring your requests or have questions about advanced usage.