FHIR Extensions Pack
5.1.0 - 5.1.0 (April 2024) International flag

This page is part of the FHIR Core Extensions Registry (v5.1.0: Release 5.1) based on FHIR (HL7® FHIR® Standard) v5.0.0. This is the current published version in its permanent home (it will always be available at this URL). For a full list of available versions, see the Directory of published versions

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

Page standards status: Trial-use Maturity Level: 1

Raw json | Download


{
  "resourceType" : "StructureMap",
  "id" : "MedicationStatement5to4",
  "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/MedicationStatement5to4'</span>\r\n<span style=\"color: #cc00cc\">/// <b>name</b> = </span><span style=\"color: blue\">'MedicationStatement5to4'</span>\r\n<span style=\"color: #cc00cc\">/// <b>title</b> = </span><span style=\"color: blue\">'FML Conversion for MedicationStatement: R5 to R4'</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>MedicationStatementStatus<span style=\"color: navy\">&quot; {\r\n</span><b>  prefix </b>s<span style=\"color: navy\"> = &quot;</span><a href=\"http://hl7.org/fhir/R5/codesystem-medication-statement-status.html\" title=\"MedicationStatement Status Codes\">http://hl7.org/fhir/CodeSystem/medication-statement-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/R4/codesystem-medication-statement-status.html\" title=\"Medication  status  codes\">http://hl7.org/fhir/4.0/CodeSystem/medication-statement-status</a><span style=\"color: navy\">&quot;\r\n</span>\r\n  s<span style=\"color: navy\">:</span>recorded <b>-</b> t<span style=\"color: navy\">:</span>completed\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  s<span style=\"color: navy\">:</span>draft <b>-</b> t<span style=\"color: navy\">:</span>intended\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/R5/medicationstatement.html\" title=\"MedicationStatement\">http://hl7.org/fhir/StructureDefinition/MedicationStatement</a><span style=\"color: navy\">&quot; </span><b>alias </b>MedicationStatementR5 <b>as </b><b>source</b>\r\n<b>uses</b><span style=\"color: navy\"> &quot;</span><a href=\"http://hl7.org/fhir/R4/medicationstatement.html\" title=\"MedicationStatement\">http://hl7.org/fhir/4.0/StructureDefinition/MedicationStatement</a><span style=\"color: navy\">&quot; </span><b>alias </b>MedicationStatementR4 <b>as </b><b>target</b>\r\n\r\n<b>imports</b><span style=\"color: navy\"> &quot;</span>http://hl7.org/fhir/StructureMap/*5to4<span style=\"color: navy\">&quot;\r\n</span>\r\n<b>group </b>MedicationStatement<span style=\"color: navy\">(</span><b>source</b> <span style=\"color: maroon\">src</span><span style=\"color: navy\"> : </span>MedicationStatementR5, <b>target</b> <span style=\"color: maroon\">tgt</span><span style=\"color: navy\"> : </span>MedicationStatementR4<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.partOf<span style=\"color: navy\"><b> -&gt; </b></span>tgt.partOf<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\">'#MedicationStatementStatus'</span><span style=\"color: navy\">, </span><span style=\"color: blue\">'code'</span><span style=\"color: navy\">)</span><span style=\"color: navy\">;</span>\r\n  src.category<span style=\"color: navy\"><b> -&gt; </b></span>tgt.category<span style=\"color: navy\">;</span>\r\n  src.medication<span style=\"color: navy\"><b> -&gt; </b></span>tgt.medication<span style=\"color: navy\">;</span>\r\n  src.subject<span style=\"color: navy\"><b> -&gt; </b></span>tgt.subject<span style=\"color: navy\">;</span>\r\n  src.encounter<span style=\"color: navy\"><b> -&gt; </b></span>tgt.context<span style=\"color: navy\">;</span>\r\n  src.effective<span style=\"color: navy\"> : </span>dateTime<span style=\"color: navy\"><b> -&gt; </b></span>tgt.effective<span style=\"color: navy\">;</span>\r\n  src.effective<span style=\"color: navy\"> : </span>Period<span style=\"color: navy\"><b> -&gt; </b></span>tgt.effective<span style=\"color: navy\">;</span>\r\n  src.dateAsserted<span style=\"color: navy\"><b> -&gt; </b></span>tgt.dateAsserted<span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">src.effective : Timing -&gt; tgt.effective;</span>\r\n  src.informationSource<span style=\"color: navy\"><b> -&gt; </b></span>tgt.informationSource<span style=\"color: navy\">;</span>\r\n  src.derivedFrom<span style=\"color: navy\"><b> -&gt; </b></span>tgt.derivedFrom<span style=\"color: navy\">;</span>\r\n  src.reason<span style=\"color: navy\"><b> -&gt; </b></span>tgt.reasonCode<span style=\"color: navy\">;</span>\r\n  src.reason<span style=\"color: navy\"><b> -&gt; </b></span>tgt.reasonReference<span style=\"color: navy\">;</span>\r\n  src.note<span style=\"color: navy\"><b> -&gt; </b></span>tgt.note<span style=\"color: navy\">;</span>\r\n  src.dosage<span style=\"color: navy\"><b> -&gt; </b></span>tgt.dosage<span style=\"color: navy\">;</span> <span style=\"color: navy\">// </span><span style=\"color: green\">src.relatedClinicalInformation -&gt; tgt.relatedClinicalInformation;</span>\r\n<span style=\"color: navy\">}\r\n\r\n</span></pre></div>"
  },
  "contained" : [
    {
      "resourceType" : "ConceptMap",
      "id" : "MedicationStatementStatus",
      "status" : "active",
      "group" : [
        {
          "source" : "http://hl7.org/fhir/CodeSystem/medication-statement-status",
          "target" : "http://hl7.org/fhir/4.0/CodeSystem/medication-statement-status",
          "element" : [
            {
              "code" : "recorded",
              "target" : [
                {
                  "code" : "completed",
                  "relationship" : "related-to"
                }
              ]
            },
            {
              "code" : "entered-in-error",
              "target" : [
                {
                  "code" : "entered-in-error",
                  "relationship" : "related-to"
                }
              ]
            },
            {
              "code" : "draft",
              "target" : [
                {
                  "code" : "intended",
                  "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/MedicationStatement5to4",
  "version" : "5.1.0",
  "name" : "MedicationStatement5to4",
  "title" : "FML Conversion for MedicationStatement: R5 to R4",
  "status" : "active",
  "date" : "2024-04-27T18:40:24+10:00",
  "publisher" : "HL7 International / FHIR Infrastructure",
  "contact" : [
    {
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://www.hl7.org/Special/committees/fiwg"
        }
      ]
    }
  ],
  "description" : "FMLConversionforMedicationStatementR5toR4",
  "jurisdiction" : [
    {
      "coding" : [
        {
          "system" : "http://unstats.un.org/unsd/methods/m49/m49.htm",
          "code" : "001"
        }
      ]
    }
  ],
  "structure" : [
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/MedicationStatement",
      "mode" : "source",
      "alias" : "MedicationStatementR5"
    },
    {
      "url" : "http://hl7.org/fhir/4.0/StructureDefinition/MedicationStatement",
      "mode" : "target",
      "alias" : "MedicationStatementR4"
    }
  ],
  "import" : [
    "http://hl7.org/fhir/StructureMap/*5to4"
  ],
  "group" : [
    {
      "name" : "MedicationStatement",
      "extends" : "DomainResource",
      "typeMode" : "type-and-types",
      "input" : [
        {
          "name" : "src",
          "type" : "MedicationStatementR5",
          "mode" : "source"
        },
        {
          "name" : "tgt",
          "type" : "MedicationStatementR4",
          "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" : "partOf",
          "source" : [
            {
              "context" : "src",
              "element" : "partOf",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "partOf",
              "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" : "#MedicationStatementStatus"
                },
                {
                  "valueString" : "code"
                }
              ]
            }
          ]
        },
        {
          "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" : "medication",
          "source" : [
            {
              "context" : "src",
              "element" : "medication",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "medication",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "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" : "encounter",
          "source" : [
            {
              "context" : "src",
              "element" : "encounter",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "context",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "effectiveDateTime",
          "source" : [
            {
              "context" : "src",
              "type" : "dateTime",
              "element" : "effective",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "effective",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "effectivePeriod",
          "source" : [
            {
              "context" : "src",
              "type" : "Period",
              "element" : "effective",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "effective",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "dateAsserted",
          "source" : [
            {
              "context" : "src",
              "element" : "dateAsserted",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "dateAsserted",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ],
          "documentation" : "src.effective : Timing -> tgt.effective;"
        },
        {
          "name" : "informationSource",
          "source" : [
            {
              "context" : "src",
              "element" : "informationSource",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "informationSource",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "derivedFrom",
          "source" : [
            {
              "context" : "src",
              "element" : "derivedFrom",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "derivedFrom",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "reason",
          "source" : [
            {
              "context" : "src",
              "element" : "reason",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "reasonCode",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "reason",
          "source" : [
            {
              "context" : "src",
              "element" : "reason",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "reasonReference",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "note",
          "source" : [
            {
              "context" : "src",
              "element" : "note",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "note",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ]
        },
        {
          "name" : "dosage",
          "source" : [
            {
              "context" : "src",
              "element" : "dosage",
              "variable" : "vvv"
            }
          ],
          "target" : [
            {
              "context" : "tgt",
              "element" : "dosage",
              "variable" : "vvv",
              "transform" : "create"
            }
          ],
          "dependent" : [
            {
              "name" : "DefaultMappingGroupAnonymousAlias",
              "parameter" : [
                {
                  "valueId" : "vvv"
                },
                {
                  "valueId" : "vvv"
                }
              ]
            }
          ],
          "documentation" : "src.relatedClinicalInformation -> tgt.relatedClinicalInformation;"
        }
      ]
    }
  ]
}