--- type: "fhirpath-function" title: "FHIRPath Function: subsetOf" function: "subsetOf" category: "Existence" section: "5.1.8" source: "fhirpath/functions.json" --- # FHIRPath Function: subsetOf Returns `true` if all items in the input collection are members of the collection passed as the `other` argument. Membership is determined using the [equals](#equals) (`=`) operation. Conceptually, this function is evaluated by testing each item in the input collection for membership in the `other` collection, with a default of `true`. This means that if the input collection is empty (`{ }`), the result is `true`, otherwise if the `other` collection is empty (`{ }`), the result is `false`. The following example returns `true` if the tags defined in any contained resource are a subset of the tags defined in the MedicationRequest resource: ``` fhirpath MedicationRequest.contained.meta.tag.subsetOf(MedicationRequest.meta.tag) ``` ## Summary - **Category**: Existence - **Section**: `5.1.8` - **Return Type**: `Boolean` - **Empty Input Result**: `true` - **Errors on Multiple Input**: `false` ## Description Returns `true` if all items in the input collection are members of the collection passed as the `other` argument. Membership is determined using the equals (`=`) operation. ## Arguments - `other`: `collection` - Collection to check membership against ## Type Mapping - `Any-Boolean` ## Example ```fhirpath MedicationRequest.contained.meta.tag.subsetOf(MedicationRequest.meta.tag) ```