<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="http://electronichealth.se/fhir/StructureDefinition/NLLOperationOutcome" />
  <version value="1.0.0" />
  <name value="NLLOperationOutcome" />
  <status value="active" />
  <date value="2022-02-02" />
  <publisher value="Swedish eHealth Agency" />
  <fhirVersion value="4.0.1" />
  <mapping>
    <identity value="EHM" />
    <name value="E-hälsomyndigheten concept" />
  </mapping>
  <kind value="resource" />
  <abstract value="false" />
  <type value="OperationOutcome" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/OperationOutcome" />
  <derivation value="constraint" />
  <differential>
    <element id="OperationOutcome.issue">
      <path value="OperationOutcome.issue" />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Resultat" />
      </mapping>
    </element>
    <element id="OperationOutcome.issue.extension">
      <path value="OperationOutcome.issue.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="OperationOutcome.issue.extension:nllDetectedIssue">
      <path value="OperationOutcome.issue.extension" />
      <sliceName value="nllDetectedIssue" />
      <short value="Automatic Format and Constitution Control (AFF) error or warning" />
      <definition value="Automatic Format and Constitution Control (AFF) error or warning generated in the transaction. &#xD;&#xA;A MedicationRequest can be saved with warnings. &#xD;&#xA;For a MedicationDispense the warnings must be accepted by the pharmacist.&#xD;&#xA;Errors must be amended before the resource can be saved.&#xD;&#xA;NB! The DetectedIssues are never saved by the Swedish eHealth Agency. They are a always generated according to the current conditions." />
      <comment value="The referenced DetectedIssue is based on the profile NLLDetectedIssue" />
      <min value="0" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/operationoutcome-detectedIssue" />
      </type>
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="AFF-resultat" />
      </mapping>
    </element>
    <element id="OperationOutcome.issue.extension:nllDetectedIssue.value[x]">
      <path value="OperationOutcome.issue.extension.value[x]" />
      <short value="A contained Detected Issue" />
      <definition value="Contained Detected Issue accoring to Automatic Format and Constitution Control (AFF).&#xD;&#xA;Error or warning generated in the transaction. &#xD;&#xA;A MedicationRequest can be saved with warnings. &#xD;&#xA;For a MedicationDispense the warnings must be accepted by the pharmacist.&#xD;&#xA;Errors must be amended before the resource can be saved.&#xD;&#xA;NB! The Detected Issues are never saved by the Swedish eHealth Agency. They are a always generated according to the current conditions." />
      <type>
        <code value="Reference" />
        <aggregation value="contained" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="OperationOutcome.issue.severity">
      <path value="OperationOutcome.issue.severity" />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Allvarlighetsgrad" />
      </mapping>
    </element>
    <element id="OperationOutcome.issue.code">
      <path value="OperationOutcome.issue.code" />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Typ av resultat" />
      </mapping>
    </element>
    <element id="OperationOutcome.issue.details">
      <path value="OperationOutcome.issue.details" />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Felorsak" />
      </mapping>
    </element>
    <element id="OperationOutcome.issue.details.coding">
      <path value="OperationOutcome.issue.details.coding" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
      <binding>
        <strength value="extensible" />
        <valueSet value="http://ehalsomyndigheten.se/fhir/ValueSet/fhir-error-codes" />
      </binding>
      <mapping>
        <identity value="EHM" />
        <map value="Fel" />
      </mapping>
    </element>
    <element id="OperationOutcome.issue.details.coding.system">
      <path value="OperationOutcome.issue.details.coding.system" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="OperationOutcome.issue.details.coding.version">
      <path value="OperationOutcome.issue.details.coding.version" />
      <mustSupport value="true" />
    </element>
    <element id="OperationOutcome.issue.details.coding.code">
      <path value="OperationOutcome.issue.details.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Felkod" />
      </mapping>
    </element>
    <element id="OperationOutcome.issue.details.coding.display">
      <path value="OperationOutcome.issue.details.coding.display" />
      <min value="1" />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Felmeddelande" />
      </mapping>
    </element>
    <element id="OperationOutcome.issue.diagnostics">
      <path value="OperationOutcome.issue.diagnostics" />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Feldiagnostik" />
      </mapping>
    </element>
    <element id="OperationOutcome.issue.expression">
      <path value="OperationOutcome.issue.expression" />
      <mustSupport value="true" />
      <mapping>
        <identity value="EHM" />
        <map value="Felkälla" />
      </mapping>
    </element>
  </differential>
</StructureDefinition>