type: fhirpath-functionfunction: distinctcategory: Existencesection: 5.1.11source: fhirpath/functions.json
FHIRPath Function: distinct
Returns a collection containing only the unique items in the input collection. To determine whether two items are the same, the equals (=) operator is used, as defined below.
If the input collection is empty ({ }), the result is empty.
Note that the order of items in the input collection is not guaranteed to be preserved in the result.
The following example returns the distinct list of tags on the given Patient:
Patient.meta.tag.distinct()
Summary
- Category: Existence
- Section:
5.1.11 - Return Type:
collection - Empty Input Result:
empty - Errors on Multiple Input:
false
Description
Returns a collection containing only the unique items in the input collection. To determine whether two items are the same, the equals (=) operator is used.
Arguments
Type Mapping
Example
Patient.meta.tag.distinct()