type: fhirpath-functionfunction: ascategory: Typessection: 6.3.4source: 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:
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 Mapping
Example
Observation.component.where(value.as(Quantity) > 30 'mg')