FHIR Extensions Pack
5.1.0-snapshot1 - Working Copy International flag

This page is part of the FHIR Core Extensions Registry (v5.1.0-snapshot1: Release 5.1) based on FHIR (HL7® FHIR® Standard) v5.0.0. The current version which supersedes this version is 1.0.0. For a full list of available versions, see the Directory of published versions

: FML Conversion for Substance: R4 to R5 - JSON Representation

Page standards status: Trial-use Maturity Level: 1

Raw json | Download


{
  "resourceType" : "StructureMap",
  "id" : "Substance4to5",
  "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/Substance4to5'</span>\r\n<span style=\"color: #cc00cc\">/// <b>name</b> = </span><span style=\"color: blue\">'Substance4to5'</span>\r\n<span style=\"color: #cc00cc\">/// <b>title</b> = </span><span style=\"color: blue\">'FML Conversion for Substance: R4 to R5'</span>\r\n<span style=\"color: #cc00cc\">/// <b>status</b> = </span><span style=\"color: blue\">'active'</span>\r\n\r\n<b>conceptmap</b><span style=\"color: navy\"> &quot;</span>FHIRSubstanceStatus<span style=\"color: navy\">&quot; {\r\n</span><b>  prefix </b>s<span style=\"color: navy\"> = &quot;</span><a href=\"http://hl7.org/fhir/R4/codesystem-substance-status.html\" title=\"FHIRSubstanceStatus\">http://hl7.org/fhir/4.0/substance-status</a><span style=\"color: navy\">&quot;\r\n</span><b>  prefix </b>t<span style=\"color: navy\"> = &quot;</span><a href=\"http://hl7.org/fhir/R5/codesystem-substance-status.html\" title=\"FHIRSubstanceStatus\">http://hl7.org/fhir/substance-status</a><span style=\"color: navy\">&quot;\r\n</span>\r\n  s<span style=\"color: navy\">:</span>active <b>-</b> t<span style=\"color: navy\">:</span>active\r\n  s<span style=\"color: navy\">:</span>inactive <b>-</b> t<span style=\"color: navy\">:</span>inactive\r\n  s<span style=\"color: navy\">:</span>&quot;entered-in-error&quot; <b>-</b> t<span style=\"color: navy\">:</span><span style=\"color: navy\">&quot;</span>entered-in-error<span style=\"color: navy\">&quot;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>uses</b><span style=\"color: navy\"> &quot;</span><a href=\"http://hl7.org/fhir/R4/substance.html\" title=\"Substance\">http://hl7.org/fhir/4.0/StructureDefinition/Substance</a><span style=\"color: navy\">&quot; </span><b>alias </b>SubstanceR4 <b>as </b><b>source</b>\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span><a href=\"http://hl7.org/fhir/R5/substance.html\" title=\"Substance\">http://hl7.org/fhir/StructureDefinition/Substance</a><span style=\"color: navy\">&quot; </span><b>alias </b>SubstanceR5 <b>as </b><b>target</b>\r\n\r\n<b>imports</b><span style=\"color: navy\"> &quot;</span>http://hl7.org/fhir/StructureMap/*4to5<span style=\"color: navy\">&quot;\r\n</span>\r\n<b>group </b>Substance<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>SubstanceR4, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\"> : </span>SubstanceR5<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<span style=\"color: navy\">;</span>\r\n  src.status<b> as </b><span style=\"color: maroon\">v</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.status = <b>translate</b><span style=\"color: navy\">(</span><span style=\"color: maroon\">v</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'#FHIRSubstanceStatus'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'code'</span><span style=\"color: navy\">)</span><span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">src.instance -&gt; tgt.instance;</span>\r\n  src.category<span style=\"color: navy\"><b> -&gt; </b></span>tgt.category<span style=\"color: navy\">;</span>\r\n  src.code<span style=\"color: navy\"><b> -&gt; </b></span>tgt.code<span style=\"color: navy\">;</span>\r\n  src.description<span style=\"color: navy\"><b> -&gt; </b></span>tgt.description<span style=\"color: navy\">;</span>\r\n  src.instance<b> as </b><span style=\"color: maroon\">s</span><span style=\"color: navy\"><b> -&gt; </b></span><span style=\"color: maroon\">tgt</span><b> then</b><span style=\"color: navy\"> {\r\n</span>    s.expiry<span style=\"color: navy\"><b> -&gt; </b></span>tgt.expiry<span style=\"color: navy\">;</span>\r\n    s.quantity<span style=\"color: navy\"><b> -&gt; </b></span>tgt.quantity<span style=\"color: navy\">;</span>\r\n  <span style=\"color: navy\">}</span><span style=\"color: navy\">;</span>\r\n  src.ingredient<b> as </b><span style=\"color: maroon\">s</span><span style=\"color: navy\"><b> -&gt; </b></span>tgt.ingredient<b> as </b><span style=\"color: maroon\">t</span><b> then </b>SubstanceIngredient<span style=\"color: navy\">(</span><span style=\"color: maroon\">s</span><span style=\"color: navy\">, </span><span style=\"color: maroon\">t</span><span style=\"color: navy\">)</span><span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span><b>group </b>SubstanceIngredient<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.quantity<span style=\"color: navy\"><b> -&gt; </b></span>tgt.quantity<span style=\"color: navy\">;</span>\r\n  src.substance<span style=\"color: navy\"> : </span>CodeableConcept<span style=\"color: navy\"><b> -&gt; </b></span>tgt.substance<span style=\"color: navy\">;</span>\r\n  src.substance<span style=\"color: navy\"> : </span>Reference<span style=\"color: navy\"><b> -&gt; </b></span>tgt.substance<span style=\"color: navy\">;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span></pre></div>"
  },
  "contained" : [
    {
      "resourceType" : "ConceptMap",
      "id" : "FHIRSubstanceStatus",
      "status" : "active",
      "group" : [
        {
          "source" : "http://hl7.org/fhir/4.0/substance-status",
          "target" : "http://hl7.org/fhir/substance-status",
          "element" : [
            {
              "code" : "active",
              "target" : [
                {
                  "code" : "active",
                  "relationship" : "related-to"
                }
              ]
            },
            {
              "code" : "inactive",
              "target" : [
                {
                  "code" : "inactive",
                  "relationship" : "related-to"
                }
              ]
            },
            {
              "code" : "entered-in-error",
              "target" : [
                {
                  "code" : "entered-in-error",
                  "relationship" : "related-to"
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "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.extensions"
          }
        ]
      }
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
      "valueCode" : "trial-use",
      "_valueCode" : {
        "extension" : [
          {
            "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-conformance-derivedFrom",
            "valueCanonical" : "http://hl7.org/fhir/extensions/ImplementationGuide/hl7.fhir.uv.extensions"
          }
        ]
      }
    }
  ],
  "url" : "http://hl7.org/fhir/StructureMap/Substance4to5",
  "version" : "5.1.0-snapshot1",
  "name" : "Substance4to5",
  "title" : "FML Conversion for Substance: R4 to R5",
  "status" : "active",
  "date" : "2024-03-12T13:30:10+11:00",
  "publisher" : "HL7 International / FHIR Infrastructure",
  "contact" : [
    {
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://www.hl7.org/Special/committees/fiwg"
        }
      ]
    }
  ],
  "description" : "FMLConversionforSubstanceR4toR5",
  "jurisdiction" : [
    {
      "coding" : [
        {
          "system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
          "code" : "001"
        }
      ]
    }
  ],
  "structure" : [
    {
      "url" : "http://hl7.org/fhir/4.0/StructureDefinition/Substance",
      "mode" : "source",
      "alias" : "SubstanceR4"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/Substance",
      "mode" : "target",
      "alias" : "SubstanceR5"
    }
  ],
  "import" : [
    "http://hl7.org/fhir/StructureMap/*4to5"
  ],
  "group" : [
    {
      "name" : "Substance",
      "extends" : "DomainResource",
      "typeMode" : "type-and-types",
      "input" : [
        {
          "name" : "src",
          "type" : "SubstanceR4",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "type" : "SubstanceR5",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "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" : "status",
          "source" : [
            {
              "context" : "src",
              "element" : "status",
              "variable" : "v"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "status",
              "transform" : "translate",
              "parameter" : [
                {
                  "valueId" : "v"
                },
                {
                  "valueString" : "#FHIRSubstanceStatus"
                },
                {
                  "valueString" : "code"
                }
              ]
            }
          ],
          "documentation" : "src.instance -> tgt.instance;"
        },
        {
          "name" : "category",
          "source" : [
            {
              "context" : "src",
              "element" : "category",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "category",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "code",
          "source" : [
            {
              "context" : "src",
              "element" : "code",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "code",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "description",
          "source" : [
            {
              "context" : "src",
              "element" : "description",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "description",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "instance",
          "source" : [
            {
              "context" : "src",
              "element" : "instance",
              "variable" : "s"
            }
          ],
          "target" : [
            {
              "transform" : "copy",
              "parameter" : [
                {
                  "valueId" : "tgt"
                }
              ]
            }
          ],
          "rule" : [
            {
              "name" : "expiry",
              "source" : [
                {
                  "context" : "s",
                  "element" : "expiry",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "expiry",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ],
              "dependent" : [
                {
                  "name" : "DefaultMappingGroupAnonymousAlias",
                  "parameter" : [
                    {
                      "valueId" : "vvv"
                    },
                    {
                      "valueId" : "vvv"
                    }
                  ]
                }
              ]
            },
            {
              "name" : "quantity",
              "source" : [
                {
                  "context" : "s",
                  "element" : "quantity",
                  "variable" : "vvv"
                }
              ],
              "target" : [
                {
                  "context" : "tgt",
                  "element" : "quantity",
                  "variable" : "vvv",
                  "transform" : "create"
                }
              ],
              "dependent" : [
                {
                  "name" : "DefaultMappingGroupAnonymousAlias",
                  "parameter" : [
                    {
                      "valueId" : "vvv"
                    },
                    {
                      "valueId" : "vvv"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "name" : "ingredient",
          "source" : [
            {
              "context" : "src",
              "element" : "ingredient",
              "variable" : "s"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "ingredient",
              "variable" : "t"
            }
          ],
          "dependent" : [
            {
              "name" : "SubstanceIngredient",
              "parameter" : [
                {
                  "valueId" : "s"
                },
                {
                  "valueId" : "t"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name" : "SubstanceIngredient",
      "extends" : "BackboneElement",
      "input" : [
        {
          "name" : "src",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "mode" : "target"
        }
      ],
      "rule" : [
        {
          "name" : "quantity",
          "source" : [
            {
              "context" : "src",
              "element" : "quantity",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "quantity",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "substanceCodeableConcept",
          "source" : [
            {
              "context" : "src",
              "type" : "CodeableConcept",
              "element" : "substance",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "substance",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "substanceReference",
          "source" : [
            {
              "context" : "src",
              "type" : "Reference",
              "element" : "substance",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "substance",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}