FHIRPath: where() Requires Exactly One Argument
The where() function filters a collection using a single boolean criteria expression. It was called with no arguments or more than one.
FHIRPath · Error
The error
where() requires exactly one argumentWhy it happens
Passing multiple comma-separated conditions to where() instead of combining them with and, or leaving the parentheses empty.
How to fix it
Supply one boolean expression. Combine multiple conditions inside it with the and / or operators: where(system = 'phone' and use = 'work'). Do not separate conditions with commas.
Example
The snippet below triggers the error:
Patient.telecom.where(system = 'phone', use = 'work')The corrected version:
Patient.telecom.where(system = 'phone' and use = 'work')Frequently asked questions
How do I combine conditions in where()?
Use the boolean operators and / or inside the single criteria argument. where(a = 1 and b = 2). Commas are reserved for functions that genuinely take multiple parameters, like substring(start, length).