FHIR R6 API Incubator, published by HL7 International / FHIR Infrastructure. This guide is not an authorized publication; it is the continuous build for version 0.1.0 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/api-incubator-ig/ and changes regularly. See the Directory of published versions
| Page standards status: Trial-use |
Implementation Note: This is not the complete set of FHIRPath extensions for FHIR. Most extensions remain defined in the core R6 specification, only a subset was extracted for potential further refinement.
The Terminology Service API is more mature and has some implementation support.
The Type Factory has seen minor/partial implementation. The base FHIRPath specification, published in STU3, supports native structure creation in a more natural way, and we are seeking implementer feedback on whether some of these functions should be removed.
The General Service API has not seen any implemenation as yet.
In order to support terminological reasoning in FHIRPath statements, FHIR defines a general %terminologies object that FHIRPath implementations should make available. Calls to this object are passed through a standard FHIR terminology service.
Summary:
%terminologies : TerminologyServer // default terminology server (application controls context) %terminologies.at(url) : TerminologyServer // terminology server at specified address %terminologies.expand(valueSet, params) : ValueSet %terminologies.lookup(coded, params) : Parameters %terminologies.validateVS(valueSet, coded, params) : Parameters %terminologies.validateCS(codeSystem, coded, params) : Parameters %terminologies.subsumes(system, coded1, coded2, params) : code %terminologies.translate(conceptMap, code, params) : Parameters
For all these functions, if any of the parameters are empty, or a collection with more than one value, or one or more of the parameters are not valid, the return value is empty.
Get a terminology server object pointing at a particular server. Note: The %terminologies object points to the default terminology server as specified by the application evaluating the FHIRPath.
Parameters:
Return Value: A terminology server that points at the specified URL. No errors - they will come when/if the terminology server object is used.
This calls the Terminology Service $expand operation (formal definition).
Parameters:
Return Value: a ValueSet with an expansion. If an error occurs, the return value is empty.
This calls the Terminology Service $lookup operation (formal definition).
Parameters:
Return Value:
This calls the Terminology Service $validate-code operation on a value set (formal definition).
Parameters:
Return Value: A Parameters resource with the results of the validation operation.
This calls the Terminology Service $validate-code operation on a code system (formal definition).
Parameters:
Return Value: A Parameters resource with the results of the validation operation.
This calls the Terminology Service $subsumes operation (formal definition).
Parameters:
Return Value: a code as specified for the subsumes operation.
This calls the Terminology Service $translate operation (formal definition).
Parameters:
Return Value: A Parameters resource with the results of the translation operation.
The variable %factory is a reference to a class factory that provides the following type methods. Note that a future version of FHIRPath may provide a factory framework directly, in which case this factory API may be withdrawn or deprecated.
This API provides specific methods for constructing common types, and some general methods for constructing any type.
For the specific type constructors, all the parameters are optional. Note that since all
variables / outputs in FHIRPath are collections, all the parameters are inherently collections,
but when the underlying element referred to is a singleton element, the collection cannot
contain more than one item. Use the value {} if there is no value to provide.
Create an instance of the type with the value and possibly one or more extensions. e.g., %factory.code('final').
Parameters:
Return Value: the primitive type, or an error.
Creates an extension with the given url and value: %factory.extension('http://hl7.org/fhir/StructureDefinition/artifact-copyrightLabel', 'CC0-1.0').
Parameters:
Return Value: An extension with the specified properties.
Creates an identifier with the given properties: %factory.Identifier('urn:ietf:rfc:3986', 'urn:oid:1.2.3.4.5', 'official').
Parameters:
Return Value: An identifier with the specified properties .
Create a human name with the given properties: %factory.HumanName('Smith', 'Julia', {}, {}, 'Julia Smith').
Parameters:
Return Value: a HumanName.
Creates a ContactPoint: %factory.ContactPoint('email', 'coyote@acme.com', 'work')
Parameters:
Return Value: a ContactPoint.
Creates an Address: %factory.Address('5 Nowhere Road', 'coyote@acme.com', 'EW', '0000', {}, 'home', 'physical')
Parameters:
Return Value: An address.
Creates a Quantity: %factory.Quantity('http://unitsofmeasure.org', 'mg/dL', '5.03', 'mg/dL')
Parameters:
Return Value: a Quantity.
Creates a Coding: %factory.Coding('http://loinc.org', '1234-5, 'An example test', '1.02')
Parameters:
Return Value: A coding.
Creates a CodeableConcept: %factory.CodeableConcept(%factory.Coding(...), "Example Test")
Parameters:
Return Value: a CodeableConcept.
For the general type constructors, all the parameters are mandatory. Note that since all
variables / outputs in FHIRPath are collections, all the parameters are inherently collections,
but when the underlying property referred to is a singleton element, the collection cannot
contain more than one item. Use the value {} if there is no value to provide.
Create an instance of the named type: %factory.create(SampledData)
Parameters:
Return Value: an instance of the named type.
Add an extension, and return the new type: %factory.withExtension(%factory.create(Money), 'http:/acme.com/extension/example', %factory.code('test'))
Parameters:
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.
Set a property value, and return the new type: %factory.withProperty(%factory.create(Address), 'http:/acme.com/extension/example', %factory.create(Period))
Parameters:
Return Value: A copy of the instance of the type with the named property set. Any existing value(s) for the named property will be deleted.
In order to support interaction with a server in FHIRPath statements, FHIR defines a general %server object that FHIRPath implementations should make available. Calls to this object are passed through a FHIR RESTful framework.
Summary:
%server : Server // default server (application controls context) %server.at(url) : Server // server at specified address %server.read(type, id) : Resource %server.create(resource) : Resource %server.update(resource) : Resource %server.delete(resource) : boolean %server.patch(parameters) : Resource %server.search(doPost, parameters) : Bundle %server.capabilities(mode) : Resource %server.validate(resource, mode, parameters) : OperationOutcome %server.transform(source, content) : Resource %server.everything(type, id, parameters) : Bundle %server.apply(resource, subject, parameters) : Bundle
Get a server object pointing at a particular server. Note: The %server object points to the default server as specified by the application evaluating the FHIRPath.
Parameters:
Return Value: A server that points at the specified URL. No errors - they will come when/if the server object is used.
Get a resource from the server.
Parameters:
Return Value: The resource at type/id. If not found, the return value is empty.
Create a resource on the server.
Parameters:
Return Value: The resource after it was stored. If the create operation failed, the return value is empty.
Store a resource on the server.
Parameters:
Return Value: The resource after it was stored. If the create operation failed, the return value is empty.
Delete a resource on the server.
Parameters:
Return Value: true if the resource was deleted, or false.
Perform a search on the server.
Parameters:
Return Value: A bundle with the search results. If the search fails, the return value is empty.
Perform a patch operation on the server.
Parameters:
Return Value: The resource after the patch. If the patch fails, the return value is empty.
Get the capabilities from the server
Parameters:
Return Value: The resource returned (CapabilitiesStatement or TerminologyCapabilities resource). If not available, the return value is empty.
Validate a resource on the server.
Parameters:
Return Value: An operation outcome with issues. If the validation couldn't be performed, the return value is empty.
Run the $transform operation on the server.
Parameters:
Return Value: The resource returned from the transform. If the transform fails, the return value is empty.
Get a resource from the server.
Parameters:
Return Value: The Bundle for type/id. If not available, the return value is empty.
Get a resource from the server.
Parameters:
Return Value: The bundle from $apply. If the operation fails, the return value is empty.