Server Home  |  XIG Home  |  XIG Stats  | 

FHIRsmith Logo FHIR IG analytics

Packagehl7.fhir.uv.mapping-language
Resource TypeStructureMap
IdStructureMap-TransformEvaluate2.json
FHIR VersionR6
Sourcehttps://build.fhir.org/ig/HL7/mapping-language-ig/StructureMap-TransformEvaluate2.html
URLhttp://hl7.org/fhir/uv/mapping-language/StructureMap/TransformEvaluate2
Version0.1.0
Statusactive
Date2026-10-15T22:52:06+00:00
NameTransformEvaluate2
Realmuv
Authorityhl7
DescriptionAdditional examples demonstrating the evaluate transform to execute a FHIRPath expression

Resources that use this resource

No resources found


Resources that this resource uses

No resources found


Narrative

Note: links and images are rebased to the (stated) source

Generated Narrative: StructureMap TransformEvaluate2

/// url = 'http://hl7.org/fhir/uv/mapping-language/StructureMap/TransformEvaluate2'
/// version = '0.1.0'
/// name = 'TransformEvaluate2'
/// status = 'active'
/// description = 'Additional examples demonstrating the evaluate transform to execute a FHIRPath expression'

uses "http://hl7.org/fhir/StructureDefinition/Patient" as source
uses "http://hl7.org/fhir/StructureDefinition/Patient" as target

group TransformEvaluate2(source src : Patient, target tgt : Patient) {
  // concatenate all given names using FHIRPath
  src.name as v -> tgt.name as tn then {
    // Although this looks like a fhirpath expression, it is just a string
    // and will put the literal text "v.given.join(' ')" in the `text` target element.
    v -> tn.text = evaluate(v, 'given.join(\' \')') "r2";
    v -> tn.period.start = evaluate(v, @2024-12-01T09:00:00) "dateValue";
  } "r1";
}


Source1

{
  "resourceType": "StructureMap",
  "resourceDefinition": "http://hl7.org/fhir/StructureDefinition/StructureMap|0.1.0",
  "id": "TransformEvaluate2",
  "text": {
    "status": "generated",
    "div": "<!-- snip (see above) -->"
  },
  "url": "http://hl7.org/fhir/uv/mapping-language/StructureMap/TransformEvaluate2",
  "identifier": [
    {
      "system": "urn:ietf:rfc:3986",
      "value": "urn:oid:2.16.840.1.113883.4.642.40.89.43.47"
    }
  ],
  "version": "0.1.0",
  "name": "TransformEvaluate2",
  "status": "active",
  "date": "2026-10-15T22:52:06+00:00",
  "publisher": "HL7 International / FHIR Infrastructure",
  "contact": [
    {
      "name": "HL7 International / FHIR Infrastructure",
      "telecom": [
        {
          "system": "url",
          "value": "http://www.hl7.org/Special/committees/fiwg"
        }
      ]
    },
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://www.hl7.org/Special/committees/fiwg"
        }
      ]
    }
  ],
  "description": "Additional examples demonstrating the evaluate transform to execute a FHIRPath expression",
  "jurisdiction": [
    {
      "coding": [
        {
          "system": "http://unstats.un.org/unsd/methods/m49/m49.htm",
          "code": "001",
          "display": "World"
        }
      ]
    }
  ],
  "structure": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/Patient",
      "mode": "source"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/Patient",
      "mode": "target"
    }
  ],
  "group": [
    {
      "name": "TransformEvaluate2",
      "input": [
        {
          "name": "src",
          "type": "Patient",
          "mode": "source"
        },
        {
          "name": "tgt",
          "type": "Patient",
          "mode": "target"
        }
      ],
      "rule": [
        {
          "name": "r1",
          "source": [
            {
              "context": "src",
              "element": [
                "name"
              ],
              "variable": "v"
            }
          ],
          "target": [
            {
              "context": "tgt",
              "element": [
                "name"
              ],
              "variable": "tn"
            }
          ],
          "rule": [
            {
              "name": "r2",
              "source": [
                {
                  "context": "v"
                }
              ],
              "target": [
                {
                  "context": "tn",
                  "element": [
                    "text"
                  ],
                  "transform": "evaluate",
                  "parameter": [
                    {
                      "valueId": "v"
                    },
                    {
                      "valueString": "'given.join(\\' \\')'"
                    }
                  ]
                }
              ],
              "documentation": "Although this looks like a fhirpath expression, it is just a string\r\nand will put the literal text \"v.given.join(' ')\" in the `text` target element."
            },
            {
              "name": "dateValue",
              "source": [
                {
                  "context": "v"
                }
              ],
              "target": [
                {
                  "context": "tn",
                  "element": [
                    "period",
                    "start"
                  ],
                  "transform": "evaluate",
                  "parameter": [
                    {
                      "valueId": "v"
                    },
                    {
                      "valueString": "@2024-12-01T09:00:00"
                    }
                  ]
                }
              ]
            }
          ],
          "documentation": "concatenate all given names using FHIRPath"
        }
      ]
    }
  ]
}