--- type: "fhirpath-function" title: "FHIRPath Function: exclude" function: "exclude" category: "Subsetting" section: "5.3.9" source: "fhirpath/functions.json" --- # FHIRPath Function: exclude Returns the set of items that are not in the `other` collection. Duplicate items will not be eliminated by this function, and order will be preserved. e.g. `(1 | 2 | 3).exclude(2)`{:.fhirpath} returns `(1 | 3)`. ## Summary - **Category**: Subsetting - **Section**: `5.3.9` - **Return Type**: `collection` - **Empty Input Result**: `empty` - **Errors on Multiple Input**: `false` ## Description Returns the set of elements that are not in the `other` collection. Duplicate items will not be eliminated by this function, and order will be preserved. ## Arguments - `other`: `collection` - Collection to exclude ## Type Mapping - `Any-Any` ## Example ```fhirpath (1 | 2 | 3).exclude(2) // returns (1 | 3) ```