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

: EpisodeOfCare Transforms: R3 to R2 - JSON Representation

Page standards status: Draft Maturity Level: 1

Raw json | Download


{
  "resourceType" : "StructureMap",
  "id" : "EpisodeOfCare3to2",
  "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/EpisodeOfCare3to2'</span>\r\n<span style=\"color: #cc00cc\">/// <b>name</b> = </span><span style=\"color: blue\">'EpisodeOfCare3to2'</span>\r\n<span style=\"color: #cc00cc\">/// <b>title</b> = </span><span style=\"color: blue\">'EpisodeOfCare 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/EpisodeOfCare<span style=\"color: navy\">&quot; </span><b>alias </b>EpisodeOfCare <b>as </b><b>source</b>\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span>http://hl7.org/fhir/1.0/EpisodeOfCare<span style=\"color: navy\">&quot; </span><b>alias </b>EpisodeOfCareR2 <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>EpisodeOfCare<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>EpisodeOfCare, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\"> : </span>EpisodeOfCareR2<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;EpisodeOfCare-identifier&quot;</i><span style=\"color: navy\">;</span>\r\n  src.status<span style=\"color: navy\"><b> -&gt; </b></span>tgt.status <i>&quot;EpisodeOfCare-status&quot;</i><span style=\"color: navy\">;</span>\r\n  src.statusHistory<b> as </b><span style=\"color: maroon\">vs0</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.statusHistory<b> as </b><span style=\"color: maroon\">vt0</span><b> then </b>epcStatusHistory<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;EpisodeOfCare-statusHistory&quot;</i><span style=\"color: navy\">;</span>\r\n  src.type<span style=\"color: navy\"><b> -&gt; </b></span>tgt.type <i>&quot;EpisodeOfCare-type&quot;</i><span style=\"color: navy\">;</span>\r\n  src.diagnosis<b> as </b><span style=\"color: maroon\">d</span><b> then </b>epcDiagnosis<span style=\"color: navy\">(</span><span style=\"color: maroon\">d</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">tgt</span><span style=\"color: navy\">)</span> <i>&quot;EpisodeOfCare-condition&quot;</i><span style=\"color: navy\">;</span>\r\n  src.patient<span style=\"color: navy\"><b> -&gt; </b></span>tgt.patient <i>&quot;EpisodeOfCare-patient&quot;</i><span style=\"color: navy\">;</span>\r\n  src.managingOrganization<span style=\"color: navy\"><b> -&gt; </b></span>tgt.managingOrganization <i>&quot;EpisodeOfCare-managingOrganization&quot;</i><span style=\"color: navy\">;</span>\r\n  src.period<span style=\"color: navy\"><b> -&gt; </b></span>tgt.period <i>&quot;EpisodeOfCare-period&quot;</i><span style=\"color: navy\">;</span>\r\n  src.referralRequest<span style=\"color: navy\"><b> -&gt; </b></span>tgt.referralRequest <i>&quot;EpisodeOfCare-referralRequest&quot;</i><span style=\"color: navy\">;</span>\r\n  src.careManager<span style=\"color: navy\"><b> -&gt; </b></span>tgt.careManager <i>&quot;EpisodeOfCare-careManager&quot;</i><span style=\"color: navy\">;</span>\r\n  src.team<b> as </b><span style=\"color: maroon\">vs</span><b> where </b>reference.resolve().exists()<span style=\"color: navy\"><b> -&gt; </b></span><span style=\"color: navy\">(</span>src.team.reference.resolve()<span style=\"color: navy\">)</span><b> as </b><span style=\"color: maroon\">ct</span><b> then </b>epiCareTeam<span style=\"color: navy\">(</span><span style=\"color: maroon\">ct</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">tgt</span><span style=\"color: navy\">)</span> <i>&quot;EpisodeOfCare-careTeam&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>group </b>epcDiagnosis<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.condition<b> as </b><span style=\"color: maroon\">v</span><b> where </b>src.role.coding.code.contains('AD').not() and role.coding.code.contains('DD').not()<span style=\"color: navy\"><b> -&gt; </b></span>tgt.condition = <span style=\"color: maroon\">v</span> <i>&quot;indication-condition1&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>group </b>epcStatusHistory<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.status<span style=\"color: navy\"><b> -&gt; </b></span>tgt.status <i>&quot;statusHistory-status&quot;</i><span style=\"color: navy\">;</span>\r\n  src.period<span style=\"color: navy\"><b> -&gt; </b></span>tgt.period <i>&quot;statusHistory-period&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>group </b>epiCareTeam<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><span style=\"color: navy\"> {\r\n</span>  src.participant<b> as </b><span style=\"color: maroon\">vs</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.careTeam<b> as </b><span style=\"color: maroon\">vt</span><b> then </b>epiCareTeamMember<span style=\"color: navy\">(</span><span style=\"color: maroon\">vs</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">vt</span><span style=\"color: navy\">)</span> <i>&quot;careteam-member&quot;</i><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>group </b>epiCareTeamMember<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.role<span style=\"color: navy\"><b> -&gt; </b></span>tgt.role <i>&quot;careteam-role&quot;</i><span style=\"color: navy\">;</span>\r\n  src.period<span style=\"color: navy\"><b> -&gt; </b></span>tgt.period <i>&quot;careteam-period&quot;</i><span style=\"color: navy\">;</span>\r\n  src.member<span style=\"color: navy\"><b> -&gt; </b></span>tgt.member <i>&quot;careteam-member&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/EpisodeOfCare3to2",
  "version" : "0.1.0",
  "name" : "EpisodeOfCare3to2",
  "title" : "EpisodeOfCare 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" : "EpisodeOfCareTransformsR3toR2",
  "jurisdiction" : [
    {
      "coding" : [
        {
          "system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
          "code" : "001"
        }
      ]
    }
  ],
  "structure" : [
    {
      "url" : "http://hl7.org/fhir/3.0/EpisodeOfCare",
      "mode" : "source",
      "alias" : "EpisodeOfCare"
    },
    {
      "url" : "http://hl7.org/fhir/1.0/EpisodeOfCare",
      "mode" : "target",
      "alias" : "EpisodeOfCareR2"
    }
  ],
  "import" : [
    "http://hl7.org/fhir/StructureMap/*3to2"
  ],
  "group" : [
    {
      "name" : "EpisodeOfCare",
      "extends" : "DomainResource",
      "typeMode" : "type-and-types",
      "input" : [
        {
          "name" : "src",
          "type" : "EpisodeOfCare",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "type" : "EpisodeOfCareR2",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "EpisodeOfCare-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" : "EpisodeOfCare-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" : "EpisodeOfCare-statusHistory",
          "source" : [
            {
              "context" : "src",
              "element" : "statusHistory",
              "variable" : "vs0"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "statusHistory",
              "variable" : "vt0"
            }
          ],
          "dependent" : [
            {
              "name" : "epcStatusHistory",
              "parameter" : [
                {
                  "valueId" : "vs0"
                },
                {
                  "valueId" : "vt0"
                }
              ]
            }
          ]
        },
        {
          "name" : "EpisodeOfCare-type",
          "source" : [
            {
              "context" : "src",
              "element" : "type",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "type",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "EpisodeOfCare-condition",
          "source" : [
            {
              "context" : "src",
              "element" : "diagnosis",
              "variable" : "d"
            }
          ],
          "dependent" : [
            {
              "name" : "epcDiagnosis",
              "parameter" : [
                {
                  "valueId" : "d"
                },
                {
                  "valueId" : "tgt"
                }
              ]
            }
          ]
        },
        {
          "name" : "EpisodeOfCare-patient",
          "source" : [
            {
              "context" : "src",
              "element" : "patient",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "patient",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "EpisodeOfCare-managingOrganization",
          "source" : [
            {
              "context" : "src",
              "element" : "managingOrganization",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "managingOrganization",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "EpisodeOfCare-period",
          "source" : [
            {
              "context" : "src",
              "element" : "period",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "period",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "EpisodeOfCare-referralRequest",
          "source" : [
            {
              "context" : "src",
              "element" : "referralRequest",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "referralRequest",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "EpisodeOfCare-careManager",
          "source" : [
            {
              "context" : "src",
              "element" : "careManager",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "careManager",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "EpisodeOfCare-careTeam",
          "source" : [
            {
              "context" : "src",
              "element" : "team",
              "variable" : "vs",
              "condition" : "reference.resolve().exists()"
            }
          ],
          "target" : [
            {
              "variable" : "ct",
              "transform" : "evaluate",
              "parameter" : [
                {
                  "valueString" : "src.team.reference.resolve()"
                }
              ]
            }
          ],
          "dependent" : [
            {
              "name" : "epiCareTeam",
              "parameter" : [
                {
                  "valueId" : "ct"
                },
                {
                  "valueId" : "tgt"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "epcDiagnosis",
      "extends" : "BackboneElement",
      "input" : [
        {
          "name" : "src",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "indication-condition1",
          "source" : [
            {
              "context" : "src",
              "element" : "condition",
              "variable" : "v",
              "condition" : "src.role.coding.code.contains('AD').not() and role.coding.code.contains('DD').not()"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "condition",
              "transform" : "copy",
              "parameter" : [
                {
                  "valueId" : "v"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "epcStatusHistory",
      "extends" : "BackboneElement",
      "input" : [
        {
          "name" : "src",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "statusHistory-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" : "statusHistory-period",
          "source" : [
            {
              "context" : "src",
              "element" : "period",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "period",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "epiCareTeam",
      "input" : [
        {
          "name" : "src",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "careteam-member",
          "source" : [
            {
              "context" : "src",
              "element" : "participant",
              "variable" : "vs"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "careTeam",
              "variable" : "vt"
            }
          ],
          "dependent" : [
            {
              "name" : "epiCareTeamMember",
              "parameter" : [
                {
                  "valueId" : "vs"
                },
                {
                  "valueId" : "vt"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "epiCareTeamMember",
      "extends" : "BackboneElement",
      "input" : [
        {
          "name" : "src",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "careteam-role",
          "source" : [
            {
              "context" : "src",
              "element" : "role",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "role",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "careteam-period",
          "source" : [
            {
              "context" : "src",
              "element" : "period",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "period",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "careteam-member",
          "source" : [
            {
              "context" : "src",
              "element" : "member",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "member",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}