--- type: "fhirpath-function" title: "FHIRPath Function: intersect" function: "intersect" category: "Subsetting" section: "5.3.8" source: "fhirpath/functions.json" --- # FHIRPath Function: intersect Returns the set of items that are in both collections. Duplicate items will be eliminated by this function. Order of items is not guaranteed to be preserved in the result of this function. ## Summary - **Category**: Subsetting - **Section**: `5.3.8` - **Return Type**: `collection` - **Empty Input Result**: `empty` - **Errors on Multiple Input**: `false` ## Description Returns the set of elements that are in both collections. Duplicate items will be eliminated by this function. Order of items is not guaranteed to be preserved in the result of this function. ## Arguments - `other`: `collection` - Collection to intersect with ## Type Mapping - `Any-Any` ## Example ```fhirpath Patient.name.given.intersect(Patient.name.family) // returns elements that are both given and family names ```