--- type: "fhirpath-function" title: "FHIRPath Function: as" function: "as" category: "Types" section: "6.3.4" source: "fhirpath/functions.json" --- # FHIRPath Function: as The `as()` function is supported for backwards compatibility with previous implementations of FHIRPath. Just as with the `as` keyword, the `type` argument is an identifier that must resolve to the name of a type in a model. For implementations with compile-time typing, this requires special-case handling when processing the argument to treat is a type specifier rather than an identifier expression: ``` fhirpath Observation.component.where(value.as(Quantity) > 30 'mg') ``` > **Note:** The `as()` function is defined for backwards compatibility only and may be deprecated in a future release. ## Summary - **Category**: Types - **Section**: `6.3.4` - **Return Type**: `collection` - **Empty Input Result**: `empty` - **Errors on Multiple Input**: `true` ## Description The as() function is supported for backwards compatibility with previous implementations of FHIRPath. Just as with the as keyword, the type argument is an identifier that must resolve to the name of a type in a model. ## Arguments - `type`: `type specifier` - Type to cast to ## Type Mapping - n/a ## Example ```fhirpath Observation.component.where(value.as(Quantity) > 30 'mg') ```