Automation Filters
Filters allow you to refine when automations run by specifying conditions that must be met. This creates more targeted, efficient automations that only execute when truly relevant.
Understanding Filters
Filters act as conditional gates that determine whether an automation should proceed to its actions. When a trigger event occurs, all configured filters are evaluated:
- If all filters pass (return true), the automation actions will execute
- If any filter fails (returns false), the automation stops and no actions are performed
How Filters Work
Each filter is configured as:
Resource → Field (FHIR search parameter) → Comparison → Value
- Resource: The FHIR resource type the filter evaluates (for example, Patient, Observation, or Task).
- Field: A FHIR search parameter for that resource, chosen from the dropdown.
- Comparison: The operator available for the field's data type.
- Value: The value to compare against.
The Filter Preview shows the query that will be used to evaluate the filter.
Filter Operators
The comparison operator depends on the field type. Most fields only support equals.
Code and Enum Operators
- equals: Exact match for a code or enum value
Numeric Operators
- is equal to: Value is exactly equal
- is greater than: Value exceeds threshold
- is less than: Value is below threshold
Date Operators
- is before: Date is earlier than specified
- is after: Date is later than specified
Available Filter Resources
The resources and fields available in filters are determined by the FHIR search parameters configured for each resource type. Common examples include:
Patient Filters
Patient filters can evaluate fields such as:
- Demographics (for example, gender)
- Geographic information (zip code, address)
- Instance assignment
birthdateanddeath-datedate fields
Observation Filters
The "Observation" filter type includes:
Observation Code Filter
The "Observation Code" filter specifies which clinical observations should trigger the automation. This allows you to target automations based on specific types of clinical data, such as:
- Vital signs (blood pressure, weight, temperature)
- Lab results
- Assessment scores
- Custom observations
Observation Value Filter
Observation value filters compare the actual measurement value using the operators available for the field type.
Task Filters
Task filters allow automations to execute based on task-related fields, including:
- Task status
- Task type
authored-on,modified, andperioddate fields
Best Practices for Filtering
- Start Specific: Begin with precise filters and broaden if needed
- Test Thoroughly: Verify filters work as expected with various test cases
- Use Multiple Filters: Combine filters for more precise targeting
- Consider Edge Cases: Account for null values, unusual data, and exceptions
- Document Purpose: Add comments or descriptions to explain filter logic