This page is part of the FHIR Specification (v4.2.0: R5 Preview #1). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4
FHIR Infrastructure Work Group | Maturity Level: 2 | Trial Use | Compartments: N/A |
The transform operation takes input content, applies a structure map transform, and then returns the output.
The official URL for this operation definition is
http://hl7.org/fhir/OperationDefinition/StructureMap-transform
Formal Definition (as a OperationDefinition).
URL: [base]/StructureMap/$transform
URL: [base]/StructureMap/[id]/$transform
This is an idempotent operation
In Parameters: | |||||
Name | Cardinality | Type | Binding | Profile | Documentation |
source | 0..1 | uri | The structure map to apply. This is only needed if the operation is invoked at the resource level. If the $transform operation is invoked on a particular structure map, this will be ignored by the server | ||
content | 1..1 | Resource | The logical content to transform | ||
Out Parameters: | |||||
Name | Cardinality | Type | Binding | Profile | Documentation |
return | 1..1 | Resource | The result of the transform Note: as this is the only out parameter, it is a resource, and it has the name 'return', the result of this operation is returned directly as a resource |
The input and return are specified as 'Resources'. In most usage of the $transform operation, either the input or return content is not a valid FHIR resource. In these cases, the return type is actually a Binary resource. For this operation, the Binary resources may be encoded directly, using a mime-type, as shown in the example. Note: this specification does not yet address the means by which the servers may know the correct mime types for the various content involved
Request: Transform input model
POST [base]/StructureMap/example/$tansform Content-Type: text/xml <classA xmlns="http://example.org"> <test>value</test> </class>
Response:
HTTP/1.1 200 OK Content-Type: application/xml [other headers] <message xmlns="http://example.org/other"> <testValue value="value"/> </message>
For more information about operations, including how they are invoked, see Operations.