--- type: "fhirpath-function" title: "FHIRPath Function: toLong" function: "toLong" category: "Conversion" section: "5.5.3.3" source: "fhirpath/functions.json" --- # FHIRPath Function: toLong _No canonical section match found in index.md._ ## Summary - **Category**: Conversion - **Section**: `5.5.3.3` - **Return Type**: `Long` - **Empty Input Result**: `empty` - **Errors on Multiple Input**: `true` ## Description If the input collection contains a single item, this function will return a single Long if the item is an Integer or Long, a String convertible to a 64 bit integer, or a Boolean. ## Arguments - none ## Type Mapping - `Boolean-Long` - `Integer-Long` - `Long-Long` - `String-Long` ## Example ```fhirpath '123'.toLong() // returns 123L true.toLong() // returns 1L ```