<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="http://electronichealth.se/fhir/StructureDefinition/NLLOperationOutcome" />
  <name value="NLLOperationOutcome" />
  <status value="draft" />
  <fhirVersion value="4.0.0" />
  <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="false" />
    </element>
    <element id="OperationOutcome.issue.extension">
      <path value="OperationOutcome.issue.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
    </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." />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org/fhir/StructureDefinition/operationoutcome-detectedIssue" />
      </type>
    </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" />
        <targetProfile value="http://electronichealth.se/fhir/StructureDefinition/NLLDetectedIssue" />
        <aggregation value="contained" />
      </type>
    </element>
    <element id="OperationOutcome.issue.severity">
      <path value="OperationOutcome.issue.severity" />
      <short value="error | information" />
      <mustSupport value="true" />
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="IssueSeverity" />
        </extension>
        <strength value="required" />
        <valueSet value="http://electronichealth.se/fhir/ValueSet/operationoutcome-severity" />
      </binding>
    </element>
    <element id="OperationOutcome.issue.code">
      <path value="OperationOutcome.issue.code" />
      <mustSupport value="true" />
    </element>
    <element id="OperationOutcome.issue.details">
      <path value="OperationOutcome.issue.details" />
      <mustSupport value="true" />
    </element>
    <element id="OperationOutcome.issue.details.coding">
      <path value="OperationOutcome.issue.details.coding" />
      <binding>
        <strength value="required" />
        <valueSet value="http://ehalsomyndigheten.se/fhir/error-codes-tbd" />
      </binding>
    </element>
    <element id="OperationOutcome.issue.details.coding.code">
      <path value="OperationOutcome.issue.details.coding.code" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>