<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="76b4a80a-a0af-4882-962b-9769a7910954" />
  <url value="https://fhir.nhs.uk/StructureDefinition/NHSDigital-OperationOutcome" />
  <version value="1.1.1" />
  <name value="NHSDigitalOperationOutcome" />
  <status value="draft" />
  <date value="2020-08-05" />
  <publisher value="NHS Digital" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="OperationOutcome" />
  <baseDefinition value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-OperationOutcome" />
  <derivation value="constraint" />
  <differential>
    <element id="OperationOutcome.id">
      <path value="OperationOutcome.id" />
      <short value="uniqueRequestID" />
      <definition value="Internal Apigee messageID" />
    </element>
    <element id="OperationOutcome.meta">
      <path value="OperationOutcome.meta" />
      <definition value="The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA; &quot;meta&quot; : {&#xD;&#xA;        &quot;lastUpdated&quot; : &quot;2021-04-21T16:58:00+00:00&quot;&#xD;&#xA;    }&#xD;&#xA;```" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="OperationOutcome.meta.lastUpdated">
      <path value="OperationOutcome.meta.lastUpdated" />
      <min value="1" />
    </element>
    <element id="OperationOutcome.extension">
      <path value="OperationOutcome.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="OperationOutcome.extension:supportingInfo">
      <path value="OperationOutcome.extension" />
      <sliceName value="supportingInfo" />
      <definition value="Information relevant to this OperationOutcome. For EPS release rejections this may be the pharmacy which is currently owns the prescription task/order." />
      <min value="0" />
      <type>
        <code value="Extension" />
        <profile value="https://fhir.nhs.uk/StructureDefinition/Extension-Spine-supportingInfo" />
      </type>
    </element>
    <element id="OperationOutcome.issue">
      <path value="OperationOutcome.issue" />
      <constraint>
        <key value="nhds-errrorcode" />
        <severity value="error" />
        <human value="An NHS Digital error or warning code is required" />
        <expression value="(issue.severity = 'information') or ((issue.severity != 'information') and issue.details.empty().not())" />
        <source value="https://fhir.nhs.uk/StructureDefinition/NHSDigital-OperationOutcome" />
      </constraint>
      <mustSupport value="true" />
    </element>
    <element id="OperationOutcome.issue.severity">
      <path value="OperationOutcome.issue.severity" />
      <definition value="Indicates whether the issue indicates a variation from successful processing.&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA; &quot;severity&quot;: &quot;error&quot;,&#xD;&#xA;```" />
      <mustSupport value="true" />
    </element>
    <element id="OperationOutcome.issue.code">
      <path value="OperationOutcome.issue.code" />
      <definition value="Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element.&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA; &quot;code&quot;: &quot;processing&quot;,&#xD;&#xA;```" />
      <mustSupport value="true" />
    </element>
    <element id="OperationOutcome.issue.details">
      <path value="OperationOutcome.issue.details" />
      <definition value="Additional details about the error. This may be a text description of the error or a system code that identifies the error.&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA;&quot;details&quot;: {&#xD;&#xA;                &quot;coding&quot;: [&#xD;&#xA;                    {&#xD;&#xA;                        &quot;system&quot;: &quot;https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode&quot;,&#xD;&#xA;                        &quot;code&quot;: &quot;INVALID_VALUE&quot;,&#xD;&#xA;                        &quot;display&quot;: &quot;Invalid value&quot;&#xD;&#xA;                    }&#xD;&#xA;                ]&#xD;&#xA;            }&#xD;&#xA;```" />
      <mustSupport value="true" />
      <binding>
        <strength value="preferred" />
        <valueSet value="https://fhir.nhs.uk/ValueSet/NHSDigital-OperationOutcome-Codes" />
      </binding>
    </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="https://fhir.nhs.uk/ValueSet/NHSDigital-OperationOutcome-Codes" />
      </binding>
    </element>
    <element id="OperationOutcome.issue.details.coding.system">
      <path value="OperationOutcome.issue.details.coding.system" />
      <min value="1" />
    </element>
    <element id="OperationOutcome.issue.details.coding.code">
      <path value="OperationOutcome.issue.details.coding.code" />
      <min value="1" />
    </element>
    <element id="OperationOutcome.issue.diagnostics">
      <path value="OperationOutcome.issue.diagnostics" />
      <definition value="Additional diagnostic information about the issue. User readable version of the message. Include url's for further information or other information helpful for the user to understand the error." />
      <mustSupport value="true" />
    </element>
    <element id="OperationOutcome.issue.location">
      <path value="OperationOutcome.issue.location" />
      <definition value="Use the JSON Pointer standard to describe the source of the error - e.g. parameter, or payload value.&#xD;&#xA;&#xD;&#xA;```json&#xD;&#xA;&quot;location&quot;: [&#xD;&#xA;                &quot;Patient&quot;,&#xD;&#xA;                &quot;Line 1, Col 37&quot;&#xD;&#xA;            ]```" />
      <mustSupport value="true" />
    </element>
    <element id="OperationOutcome.issue.expression">
      <path value="OperationOutcome.issue.expression" />
      <definition value="FHIRPath of element(s) related to issue" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>