FHIR Mapping Language (FML)
0.1.0 - STU 1 International flag

FHIR Mapping Language (FML), 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/mapping-language-ig/ and changes regularly. See the Directory of published versions

: FhirPathSourceAsVar - JSON Representation

Page standards status: Informative

Raw json | Download

{
  "resourceType" : "StructureMap",
  "resourceDefinition" : "http://hl7.org/fhir/StructureDefinition/StructureMap|0.1.0",
  "text" : {
    "status" : "generated",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: StructureMap FhirPathSourceAsVar</b></p><a name=\"FhirPathSourceAsVar\"> </a><a name=\"hcFhirPathSourceAsVar\"> </a><p><b>url</b>: <a href=\"http://hl7.org/fhir/uv/fml/StructureMap/FhirPathSourceAsVar\">http://hl7.org/fhir/uv/fml/StructureMap/FhirPathSourceAsVar</a></p><p><b>name</b>: FhirPathSourceAsVar</p><p><b>status</b>: Active</p><p><b>description</b>: </p><div><p>Example demonstrating the where clause for filtering source elements with FHIRPath</p>\n</div><blockquote><p><b>structure</b></p><p><b>url</b>: <a href=\"http://hl7.org/fhir/R5/patient.html\">Patient</a></p><p><b>mode</b>: Source Structure Definition</p></blockquote><blockquote><p><b>structure</b></p><p><b>url</b>: <a href=\"http://hl7.org/fhir/R5/patient.html\">Patient</a></p><p><b>mode</b>: Target Structure Definition</p></blockquote><blockquote><p><b>group</b></p><p><b>name</b>: FhirPathSourceAsVar</p><blockquote><p><b>input</b></p><p><b>mode</b>: Source Instance</p><p><b>name</b>: src</p><p><b>type</b>: Patient</p></blockquote><blockquote><p><b>input</b></p><p><b>mode</b>: Target Instance</p><p><b>name</b>: tgt</p><p><b>type</b>: Patient</p></blockquote><blockquote><p><b>rule</b></p><h3>Sources</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Context</b></td></tr><tr><td style=\"display: none\">*</td><td>src</td></tr></table><blockquote><p><b>target</b></p><p><b>transform</b>: evaluate</p><h3>Parameters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Value[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>'http://example.org/'</td></tr></table><p><b>variable</b>: extBase</p></blockquote><blockquote><p><b>rule</b></p><h3>Sources</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Context</b></td><td><b>Element</b></td><td><b>Variable</b></td></tr><tr><td style=\"display: none\">*</td><td>src</td><td>name</td><td>sn</td></tr></table><h3>Targets</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Context</b></td><td><b>Element</b></td><td><b>Variable</b></td></tr><tr><td style=\"display: none\">*</td><td>tgt</td><td>name</td><td>tn</td></tr></table><blockquote><p><b>rule</b></p><h3>Sources</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Context</b></td><td><b>Element</b></td><td><b>Variable</b></td></tr><tr><td style=\"display: none\">*</td><td>sn</td><td>family</td><td>f</td></tr></table><blockquote><p><b>target</b></p><p><b>context</b>: tn</p><p><b>element</b>: family</p><p><b>transform</b>: copy</p><h3>Parameters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Value[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>f</td></tr></table></blockquote><blockquote><p><b>target</b></p><p><b>context</b>: tn</p><p><b>element</b>: extension</p><p><b>variable</b>: e</p></blockquote><blockquote><p><b>target</b></p><p><b>context</b>: e</p><p><b>element</b>: url</p><p><b>transform</b>: evaluate</p><h3>Parameters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Value[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>extBase &amp; 'family'</td></tr></table></blockquote><blockquote><p><b>target</b></p><p><b>context</b>: e</p><p><b>element</b>: value</p><p><b>transform</b>: copy</p><h3>Parameters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Value[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>f</td></tr></table></blockquote><p><b>name</b>: r1</p></blockquote><blockquote><p><b>rule</b></p><h3>Sources</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Context</b></td><td><b>Element</b></td><td><b>Variable</b></td></tr><tr><td style=\"display: none\">*</td><td>sn</td><td>suffix</td><td>f</td></tr></table><blockquote><p><b>target</b></p><p><b>context</b>: tn</p><p><b>element</b>: suffix</p><p><b>transform</b>: copy</p><h3>Parameters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Value[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>f</td></tr></table></blockquote><blockquote><p><b>target</b></p><p><b>context</b>: tn</p><p><b>element</b>: extension</p><p><b>variable</b>: e</p></blockquote><blockquote><p><b>target</b></p><p><b>context</b>: e</p><p><b>element</b>: url</p><p><b>transform</b>: evaluate</p><h3>Parameters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Value[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>extBase &amp; 'suffix'</td></tr></table></blockquote><blockquote><p><b>target</b></p><p><b>context</b>: e</p><p><b>element</b>: value</p><p><b>transform</b>: copy</p><h3>Parameters</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Value[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>f</td></tr></table></blockquote><p><b>name</b>: r1</p></blockquote><p><b>documentation</b>: use the stashed constant as a variable in a where clause to filter source elements</p><p><b>name</b>: r2</p></blockquote><p><b>documentation</b>: trigger on src, and stash a constant</p><p><b>name</b>: r3</p></blockquote></blockquote></div>"
  },
  "url" : "http://hl7.org/fhir/uv/fml/StructureMap/FhirPathSourceAsVar",
  "name" : "FhirPathSourceAsVar",
  "status" : "active",
  "description" : "Example demonstrating the where clause for filtering source elements with FHIRPath",
  "structure" : [
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/Patient",
      "mode" : "source"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/Patient",
      "mode" : "target"
    }
  ],
  "group" : [
    {
      "name" : "FhirPathSourceAsVar",
      "input" : [
        {
          "mode" : "source",
          "name" : "src",
          "type" : "Patient"
        },
        {
          "mode" : "target",
          "name" : "tgt",
          "type" : "Patient"
        }
      ],
      "rule" : [
        {
          "source" : [
            {
              "context" : "src"
            }
          ],
          "target" : [
            {
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "'http://example.org/'"
                }
              ],
              "variable" : "extBase"
            }
          ],
          "rule" : [
            {
              "source" : [
                {
                  "context" : "src",
                  "element" : [
                    "name"
                  ],
                  "variable" : "sn"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : [
                    "name"
                  ],
                  "variable" : "tn"
                }
              ],
              "rule" : [
                {
                  "source" : [
                    {
                      "context" : "sn",
                      "element" : [
                        "family"
                      ],
                      "variable" : "f"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tn",
                      "element" : [
                        "family"
                      ],
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "f"
                        }
                      ]
                    },
                    {
                      "context" : "tn",
                      "element" : [
                        "extension"
                      ],
                      "variable" : "e"
                    },
                    {
                      "context" : "e",
                      "element" : [
                        "url"
                      ],
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "extBase & 'family'"
                        }
                      ]
                    },
                    {
                      "context" : "e",
                      "element" : [
                        "value"
                      ],
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "f"
                        }
                      ]
                    }
                  ],
                  "name" : "r1"
                },
                {
                  "source" : [
                    {
                      "context" : "sn",
                      "element" : [
                        "suffix"
                      ],
                      "variable" : "f"
                    }
                  ],
                  "target" : [
                    {
                      "context" : "tn",
                      "element" : [
                        "suffix"
                      ],
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "f"
                        }
                      ]
                    },
                    {
                      "context" : "tn",
                      "element" : [
                        "extension"
                      ],
                      "variable" : "e"
                    },
                    {
                      "context" : "e",
                      "element" : [
                        "url"
                      ],
                      "transform" : "evaluate",
                      "parameter" : [
                        {
                          "valueString" : "extBase & 'suffix'"
                        }
                      ]
                    },
                    {
                      "context" : "e",
                      "element" : [
                        "value"
                      ],
                      "transform" : "copy",
                      "parameter" : [
                        {
                          "valueId" : "f"
                        }
                      ]
                    }
                  ],
                  "name" : "r1"
                }
              ],
              "documentation" : "use the stashed constant as a variable in a where clause to filter source elements",
              "name" : "r2"
            }
          ],
          "documentation" : "trigger on src, and stash a constant",
          "name" : "r3"
        }
      ]
    }
  ],
  "id" : "FhirPathSourceAsVar"
}