--- type: "fhir-fhirpath-function" title: "FHIR FHIRPath Function: %factory.{primitive}" source: "source/fhirpath.html" --- # FHIR FHIRPath Function: %factory.{primitive} This page is part of **FHIR FHIRPath** (FHIR-specific extensions). Base spec lives at [FHIRPath](/fhirpath). `%factory.{primitive}(value, extensions) : {primitive}` Create an instance of the type with the value and possibly one or more extensions. e.g., `%factory.code('final')`. Parameters: - **value**: a primitive type (string, or will be converted to a string if necessary) that contains the value for the primitive type. - **extensions**: a collection of extensions for the primitive type **Return Value:** the primitive type, or an error. * * * [Back to FHIR FHIRPath](/fhir-fhirpath)