FHIRConnect RESTful Implementation Guide
0.1.0 - ci-build

FHIRConnect RESTful Implementation Guide - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

: $toopenehr — Convert FHIR Bundle to openEHR Composition - XML Representation

Draft as of 2026-05-27

Raw xml | Download


<OperationDefinition xmlns="http://hl7.org/fhir">
  <id value="ToOpenEhr"/>
  <text>
    <status value="generated"/>
    <div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: OperationDefinition ToOpenEhr</b></p><a name="ToOpenEhr"> </a><a name="hcToOpenEhr"> </a><p>URL: [base]/$toopenehr</p><h3>Parameters</h3><table class="grid"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Scope</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>bundle</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R4/bundle.html">Bundle</a></td><td/><td><div><p>The FHIR Bundle containing the resources to be converted to an openEHR Composition.</p>
</div></td></tr><tr><td>OUT</td><td>composition</td><td/><td>1..1</td><td><a href="http://hl7.org/fhir/R4/datatypes.html#string">string</a></td><td/><td><div><p>The resulting openEHR Composition serialized as a JSON string.</p>
</div></td></tr><tr><td>OUT</td><td>outcome</td><td/><td>0..*</td><td><a href="http://hl7.org/fhir/R4/operationoutcome.html">OperationOutcome</a></td><td/><td><div><p>An OperationOutcome conveying warnings or partial mapping failures.</p>
</div></td></tr></table></div>
  </text>
  <url value="http://fhirconnect.org/fhir/OperationDefinition/ToOpenEhr"/>
  <version value="0.1.0"/>
  <name value="ToOpenEhr"/>
  <title value="$toopenehr — Convert FHIR Bundle to openEHR Composition"/>
  <status value="draft"/>
  <kind value="operation"/>
  <date value="2026-05-27T11:19:57+02:00"/>
  <publisher value="FHIRConnect"/>
  <contact>
    <name value="FHIRConnect"/>
    <telecom>
      <system value="url"/>
      <value value="https://github.com/SevKohler/FHIRconnect-spec"/>
    </telecom>
  </contact>
  <description
               value="Converts a FHIR Bundle to an openEHR Composition using a FHIRConnect mapping.

The operation accepts a FHIR Bundle as input and returns a FHIR Parameters resource
containing the serialized openEHR Composition as a JSON string.

When the mapping is fully successful the response contains only the `composition` parameter.
When mapping issues occur (e.g. a source element could not be mapped, a required field was
absent, or a partial result was produced), an additional `outcome` parameter carrying an
`OperationOutcome` resource SHOULD be included alongside the `composition`. The presence of
an `OperationOutcome` does not necessarily mean the composition is absent — a partial result
MAY be returned together with issues describing what could not be mapped.

Example response with OperationOutcome:

```json
{
  &quot;resourceType&quot;: &quot;Parameters&quot;,
  &quot;parameter&quot;: [
    {
      &quot;name&quot;: &quot;composition&quot;,
      &quot;valueString&quot;: &quot;{\&quot;_type\&quot;: \&quot;COMPOSITION\&quot;, \&quot;name\&quot;: {\&quot;_type\&quot;: \&quot;DV_TEXT\&quot;, \&quot;value\&quot;: \&quot;International Patient Summary\&quot;}, ...}&quot;
    },
    {
      &quot;name&quot;: &quot;outcome&quot;,
      &quot;resource&quot;: {
        &quot;resourceType&quot;: &quot;OperationOutcome&quot;,
        &quot;issue&quot;: [
          {
            &quot;severity&quot;: &quot;warning&quot;,
            &quot;code&quot;: &quot;incomplete&quot;,
            &quot;details&quot;: {
              &quot;text&quot;: &quot;Element Observation.effectivePeriod could not be mapped; no corresponding openEHR archetype path found.&quot;
            }
          }
        ]
      }
    }
  ]
}
```"/>
  <affectsState value="false"/>
  <code value="toopenehr"/>
  <system value="true"/>
  <type value="false"/>
  <instance value="false"/>
  <parameter>
    <name value="bundle"/>
    <use value="in"/>
    <min value="1"/>
    <max value="1"/>
    <documentation
                   value="The FHIR Bundle containing the resources to be converted to an openEHR Composition."/>
    <type value="Bundle"/>
  </parameter>
  <parameter>
    <name value="composition"/>
    <use value="out"/>
    <min value="1"/>
    <max value="1"/>
    <documentation
                   value="The resulting openEHR Composition serialized as a JSON string."/>
    <type value="string"/>
  </parameter>
  <parameter>
    <name value="outcome"/>
    <use value="out"/>
    <min value="0"/>
    <max value="*"/>
    <documentation
                   value="An OperationOutcome conveying warnings or partial mapping failures."/>
    <type value="OperationOutcome"/>
  </parameter>
</OperationDefinition>