--- type: "fhir-fhirpath-function" title: "FHIR FHIRPath Function: ofType" source: "source/fhirpath.html" --- # FHIR FHIRPath Function: ofType This page is part of **FHIR FHIRPath** (FHIR-specific extensions). Base spec lives at [FHIRPath](/fhirpath). `ofType(type : type specifier) : collection` Returns a collection that contains all items in the input collection that are of the given `type` or a subclass thereof. This is as defined as in the base FHIRPath specification, but implementers should be aware that in FHIR, only concrete core types are allowed as an argument. All primitives are considered to be independent types (so `markdown` is **not** a subclass of `string`). Profiled types are not allowed, so to select `SimpleQuantity` one would pass `Quantity` as an argument. Observation.value.ofType(canonical) Observation.value.ofType(dateTime) | Observation.value.ofType(Period).start // selects either dateTime or Period starts (both of type dateTime) * * * [Back to FHIR FHIRPath](/fhir-fhirpath)