type: fhir-fhirpath-functionsource: source/fhirpath.html
FHIR FHIRPath Function: %factory.withExtension
This page is part of FHIR FHIRPath (FHIR-specific extensions). Base spec lives at FHIRPath.
%factory.withExtension(instance : T, url : string, value) : T
Add an extension, and return the new type: %factory.withExtension(%factory.create(Money), 'http:/acme.com/extension/example', %factory.code('test'))
Parameters:
- instance: The instance to add the URL to
- url: a string value that goes in Extension.url
- value: the value of the extension
Return Value: A copy of the instance of the type with the extension added. Extensions that already exist with the same url are not removed.