FHIR Cross-Version Mapping Pack
0.1.0 - Ballot for Release 5.1.0 International flag

FHIR Cross-Version Mapping Pack, 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/fhir-cross-version/ and changes regularly. See the Directory of published versions

: QuestionnaireResponse Transforms: R3 to R2 - JSON Representation

Page standards status: Draft Maturity Level: 1

Raw json | Download


{
  "resourceType" : "StructureMap",
  "id" : "QuestionnaireResponse3to2",
  "text" : {
    "status" : "generated",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><pre class=\"fml\">\r\n<span style=\"color: #cc00cc\">/// <b>url</b> = </span><span style=\"color: blue\">'http://hl7.org/fhir/StructureMap/QuestionnaireResponse3to2'</span>\r\n<span style=\"color: #cc00cc\">/// <b>name</b> = </span><span style=\"color: blue\">'QuestionnaireResponse3to2'</span>\r\n<span style=\"color: #cc00cc\">/// <b>title</b> = </span><span style=\"color: blue\">'QuestionnaireResponse Transforms: R3 to R2'</span>\r\n<span style=\"color: #cc00cc\">/// <b>status</b> = </span><span style=\"color: blue\">'active'</span>\r\n\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span>http://hl7.org/fhir/3.0/QuestionnaireResponse<span style=\"color: navy\">&quot; </span><b>alias </b>QuestionnaireResponse <b>as </b><b>source</b>\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span>http://hl7.org/fhir/1.0/QuestionnaireResponse<span style=\"color: navy\">&quot; </span><b>alias </b>QuestionnaireResponseR2 <b>as </b><b>target</b>\r\n\r\n<b>imports</b><span style=\"color: navy\"> &quot;</span>http://hl7.org/fhir/StructureMap/*3to2<span style=\"color: navy\">&quot;\r\n</span>\r\n<b>group </b>QuestionnaireResponse<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>QuestionnaireResponse, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\"> : </span>QuestionnaireResponseR2<span style=\"color: navy\">)</span><b> extends </b>DomainResource<b> &lt;&lt;type+&gt;&gt;</b><span style=\"color: navy\"> {\r\n</span>  src.identifier<span style=\"color: navy\"><b> -&gt; </b></span>tgt.identifier <i>&quot;QuestionnaireResponse-identifier&quot;</i><span style=\"color: navy\">;</span>\r\n  src.questionnaire<span style=\"color: navy\"><b> -&gt; </b></span>tgt.questionnaire <i>&quot;QuestionnaireResponse-questionnaire&quot;</i><span style=\"color: navy\">;</span>\r\n  src.status<span style=\"color: navy\"><b> -&gt; </b></span>tgt.status <i>&quot;QuestionnaireResponse-status&quot;</i><span style=\"color: navy\">;</span>\r\n  src.subject<span style=\"color: navy\"><b> -&gt; </b></span>tgt.subject <i>&quot;QuestionnaireResponse-subject&quot;</i><span style=\"color: navy\">;</span>\r\n  src.author<span style=\"color: navy\"><b> -&gt; </b></span>tgt.author <i>&quot;QuestionnaireResponse-author&quot;</i><span style=\"color: navy\">;</span>\r\n  src.authored<span style=\"color: navy\"><b> -&gt; </b></span>tgt.authored <i>&quot;QuestionnaireResponse-authored&quot;</i><span style=\"color: navy\">;</span>\r\n  src.source<span style=\"color: navy\"><b> -&gt; </b></span>tgt.source <i>&quot;QuestionnaireResponse-source&quot;</i><span style=\"color: navy\">;</span>\r\n  src.context<span style=\"color: navy\"><b> -&gt; </b></span>tgt.encounter <i>&quot;QuestionnaireResponse-encounter&quot;</i><span style=\"color: navy\">;</span>\r\n  src.item<b> as </b><span style=\"color: maroon\">vs0</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.group<b> as </b><span style=\"color: maroon\">vt0</span><b> then </b>qrGroup<span style=\"color: navy\">(</span><span style=\"color: maroon\">vs0</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">vt0</span><span style=\"color: navy\">)</span> <i>&quot;QuestionnaireResponse-item&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>group </b>qrGroup<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span>, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\">)</span><b> extends </b>BackboneElement<span style=\"color: navy\"> {\r\n</span>  src.linkId<span style=\"color: navy\"><b> -&gt; </b></span>tgt.linkId <i>&quot;group-linkId&quot;</i><span style=\"color: navy\">;</span>\r\n  src.text<b> where </b>item.answer.empty()<span style=\"color: navy\"><b> -&gt; </b></span>tgt.title <i>&quot;group-text&quot;</i><span style=\"color: navy\">;</span>\r\n  src.text<b> where </b>item.answer.exists()<span style=\"color: navy\"><b> -&gt; </b></span>tgt.text <i>&quot;group-text&quot;</i><span style=\"color: navy\">;</span>\r\n  src.subject<span style=\"color: navy\"><b> -&gt; </b></span>tgt.subject <i>&quot;group-subject&quot;</i><span style=\"color: navy\">;</span>\r\n  src.item<b> as </b><span style=\"color: maroon\">vs0</span><b> where </b>answer.empty()<span style=\"color: navy\"><b> -&gt; </b></span>tgt.group<b> as </b><span style=\"color: maroon\">vt0</span><b> then </b>qrGroup<span style=\"color: navy\">(</span><span style=\"color: maroon\">vs0</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">vt0</span><span style=\"color: navy\">)</span> <i>&quot;group-group&quot;</i><span style=\"color: navy\">;</span>\r\n  src.item<b> as </b><span style=\"color: maroon\">vs0</span><b> where </b>answer.exists()<span style=\"color: navy\"><b> -&gt; </b></span>tgt.question<b> as </b><span style=\"color: maroon\">vt0</span><b> then </b>qrQuestion<span style=\"color: navy\">(</span><span style=\"color: maroon\">vs0</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">vt0</span><span style=\"color: navy\">)</span> <i>&quot;group-question&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>group </b>qrQuestion<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span>, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\">)</span><b> extends </b>BackboneElement<span style=\"color: navy\"> {\r\n</span>  src.linkId<span style=\"color: navy\"><b> -&gt; </b></span>tgt.linkId <i>&quot;question-linkId&quot;</i><span style=\"color: navy\">;</span>\r\n  src.text<span style=\"color: navy\"><b> -&gt; </b></span>tgt.text <i>&quot;question-text&quot;</i><span style=\"color: navy\">;</span>\r\n  src.answer<b> as </b><span style=\"color: maroon\">vs0</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.answer<b> as </b><span style=\"color: maroon\">vt0</span><b> then </b>qrAnswer<span style=\"color: navy\">(</span><span style=\"color: maroon\">vs0</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">vt0</span><span style=\"color: navy\">)</span> <i>&quot;question-answer&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>group </b>qrAnswer<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span>, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\">)</span><b> extends </b>BackboneElement<span style=\"color: navy\"> {\r\n</span>  src.value<span style=\"color: navy\"><b> -&gt; </b></span>tgt.value <i>&quot;answer-value&quot;</i><span style=\"color: navy\">;</span>\r\n  src.item<b> as </b><span style=\"color: maroon\">vs0</span><b> check </b>answer.empty()<span style=\"color: navy\"><b> -&gt; </b></span>tgt.group<b> as </b><span style=\"color: maroon\">vt0</span><b> then </b>qrGroup<span style=\"color: navy\">(</span><span style=\"color: maroon\">vs0</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">vt0</span><span style=\"color: navy\">)</span> <i>&quot;answer-group&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span></pre></div>"
  },
  "extension" : [
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
      "valueCode" : "fhir"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
      "valueInteger" : 1,
      "_valueInteger" : {
        "extension" : [
          {
            "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom",
            "valueCanonical" : "http://hl7.org/fhir/extensions/ImplementationGuide/hl7.fhir.uv.xver"
          }
        ]
      }
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
      "valueCode" : "draft",
      "_valueCode" : {
        "extension" : [
          {
            "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom",
            "valueCanonical" : "http://hl7.org/fhir/extensions/ImplementationGuide/hl7.fhir.uv.xver"
          }
        ]
      }
    }
  ],
  "url" : "http://hl7.org/fhir/StructureMap/QuestionnaireResponse3to2",
  "version" : "0.1.0",
  "name" : "QuestionnaireResponse3to2",
  "title" : "QuestionnaireResponse Transforms: R3 to R2",
  "status" : "active",
  "date" : "2024-02-22T03:16:50+00:00",
  "publisher" : "HL7 International / FHIR Infrastructure",
  "contact" : [
    {
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://www.hl7.org/Special/committees/fiwg"
        }
      ]
    }
  ],
  "description" : "QuestionnaireResponseTransformsR3toR2",
  "jurisdiction" : [
    {
      "coding" : [
        {
          "system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
          "code" : "001"
        }
      ]
    }
  ],
  "structure" : [
    {
      "url" : "http://hl7.org/fhir/3.0/QuestionnaireResponse",
      "mode" : "source",
      "alias" : "QuestionnaireResponse"
    },
    {
      "url" : "http://hl7.org/fhir/1.0/QuestionnaireResponse",
      "mode" : "target",
      "alias" : "QuestionnaireResponseR2"
    }
  ],
  "import" : [
    "http://hl7.org/fhir/StructureMap/*3to2"
  ],
  "group" : [
    {
      "name" : "QuestionnaireResponse",
      "extends" : "DomainResource",
      "typeMode" : "type-and-types",
      "input" : [
        {
          "name" : "src",
          "type" : "QuestionnaireResponse",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "type" : "QuestionnaireResponseR2",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "QuestionnaireResponse-identifier",
          "source" : [
            {
              "context" : "src",
              "element" : "identifier",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "identifier",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "QuestionnaireResponse-questionnaire",
          "source" : [
            {
              "context" : "src",
              "element" : "questionnaire",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "questionnaire",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "QuestionnaireResponse-status",
          "source" : [
            {
              "context" : "src",
              "element" : "status",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "status",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "QuestionnaireResponse-subject",
          "source" : [
            {
              "context" : "src",
              "element" : "subject",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "subject",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "QuestionnaireResponse-author",
          "source" : [
            {
              "context" : "src",
              "element" : "author",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "author",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "QuestionnaireResponse-authored",
          "source" : [
            {
              "context" : "src",
              "element" : "authored",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "authored",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "QuestionnaireResponse-source",
          "source" : [
            {
              "context" : "src",
              "element" : "source",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "source",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "QuestionnaireResponse-encounter",
          "source" : [
            {
              "context" : "src",
              "element" : "context",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "encounter",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "QuestionnaireResponse-item",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "vs0"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "group",
              "variable" : "vt0"
            }
          ],
          "dependent" : [
            {
              "name" : "qrGroup",
              "parameter" : [
                {
                  "valueId" : "vs0"
                },
                {
                  "valueId" : "vt0"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "qrGroup",
      "extends" : "BackboneElement",
      "input" : [
        {
          "name" : "src",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "group-linkId",
          "source" : [
            {
              "context" : "src",
              "element" : "linkId",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "linkId",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "group-text",
          "source" : [
            {
              "context" : "src",
              "element" : "text",
              "variable" : "vvv",
              "condition" : "item.answer.empty()"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "title",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "group-text",
          "source" : [
            {
              "context" : "src",
              "element" : "text",
              "variable" : "vvv",
              "condition" : "item.answer.exists()"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "text",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "group-subject",
          "source" : [
            {
              "context" : "src",
              "element" : "subject",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "subject",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "group-group",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "vs0",
              "condition" : "answer.empty()"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "group",
              "variable" : "vt0"
            }
          ],
          "dependent" : [
            {
              "name" : "qrGroup",
              "parameter" : [
                {
                  "valueId" : "vs0"
                },
                {
                  "valueId" : "vt0"
                }
              ]
            }
          ]
        },
        {
          "name" : "group-question",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "vs0",
              "condition" : "answer.exists()"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "question",
              "variable" : "vt0"
            }
          ],
          "dependent" : [
            {
              "name" : "qrQuestion",
              "parameter" : [
                {
                  "valueId" : "vs0"
                },
                {
                  "valueId" : "vt0"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "qrQuestion",
      "extends" : "BackboneElement",
      "input" : [
        {
          "name" : "src",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "question-linkId",
          "source" : [
            {
              "context" : "src",
              "element" : "linkId",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "linkId",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "question-text",
          "source" : [
            {
              "context" : "src",
              "element" : "text",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "text",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "question-answer",
          "source" : [
            {
              "context" : "src",
              "element" : "answer",
              "variable" : "vs0"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "answer",
              "variable" : "vt0"
            }
          ],
          "dependent" : [
            {
              "name" : "qrAnswer",
              "parameter" : [
                {
                  "valueId" : "vs0"
                },
                {
                  "valueId" : "vt0"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "qrAnswer",
      "extends" : "BackboneElement",
      "input" : [
        {
          "name" : "src",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "answer-value",
          "source" : [
            {
              "context" : "src",
              "element" : "value",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "value",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "answer-group",
          "source" : [
            {
              "context" : "src",
              "element" : "item",
              "variable" : "vs0",
              "check" : "answer.empty()"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "group",
              "variable" : "vt0"
            }
          ],
          "dependent" : [
            {
              "name" : "qrGroup",
              "parameter" : [
                {
                  "valueId" : "vs0"
                },
                {
                  "valueId" : "vt0"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}