<CodeSystem xmlns="http://hl7.org/fhir">
  <id value="NHSDigital-ErrorOrWarningCode" />
  <url value="https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode" />
  <version value="2.1.0" />
  <name value="SpineErrorOrWarningCode" />
  <status value="active" />
  <date value="2020-08-27T00:00:00+00:00" />
  <publisher value="NHS Digital" />
  <contact>
    <name value="Interoperability Team" />
    <telecom>
      <system value="email" />
      <value value="interoperabilityteam@nhs.net" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="A CodeSystem that identifies the Spine error or warning code in response to a request." />
  <copyright value="Copyright © 2020 NHS Digital" />
  <caseSensitive value="true" />
  <content value="complete" />
  <!-- General Outcomes -->
  <concept>
    <code value="ACCESS_DENIED" />
    <display value="Access has been denied to process this request" />
    <definition value="Used when the user does not have permission for a particular request. e.g. when their ASID does not have the correct interactions attached to it." />
  </concept>
  <concept>
    <code value="FAILURE_TO_PROCESS_MESSAGE" />
    <display value="Failure to process message" />
    <definition value="A default message when something really bad has happened that the system could not handle." />
  </concept>
  <concept>
    <code value="UNABLE_TO_CALL_SERVICE" />
    <display value="Unable to call service" />
    <definition value="For a synchronous request, the downstream domain processing has not completed within the configured timeout period." />
  </concept>
  <concept>
    <code value="UNSUPPORTED_SERVICE" />
    <display value="Unsupported service" />
    <definition value="The service the user requested is an endpoint that does not exist - so is unsupported. e.g. /Patient/9999999999/Pets" />
  </concept>
  <concept>
    <code value="RESOURCE_NOT_FOUND" />
    <display value="Resource not found" />
    <definition value="The resource was not found." />
  </concept>
  <concept>
    <code value="INVALID_RESOURCE_ID" />
    <display value="Invalid resource ID" />
    <definition value="The resource ID was not valid. For example a NHS Number is presented which is not a valid NHS Number." />
  </concept>
  <concept>
    <code value="INVALIDATED_RESOURCE" />
    <display value="Invalidated resource" />
    <definition value="The resource has been invalidated so could not be returned." />
  </concept>
  <!-- Search Outcomes -->
  <concept>
    <code value="INVALID_SEARCH_DATA" />
    <display value="Invalid search data" />
    <definition value="The search parameters are invalid. A description of what exactly is at fault will be added to the display." />
  </concept>
  <concept>
    <code value="TOO_MANY_MATCHES" />
    <display value="Too many matches" />
    <definition value="Too many matches were found - user should refine their search parameters." />
  </concept>
  <!-- Update Outcomes -->
  <concept>
    <code value="PRECONDITION_FAILED" />
    <display value="Precondition failed" />
    <definition value="Request missing basic requirements such as If-Match header (or invalid headers)." />
  </concept>
  <concept>
    <code value="RESOURCE_VERSION_MISMATCH" />
    <display value="Resource version mismatch" />
    <definition value="The resource version has changed since your last read, so the update has been rejected." />
  </concept>
  <concept>
    <code value="FORBIDDEN_UPDATE" />
    <display value="Forbidden update" />
    <definition value="The user is not permitted to update certain resources or elements - a detailed description will be added to the display. For example - updating a sensitive patient or adding a formal death notification is only permitted from certain systems." />
  </concept>
  <concept>
    <code value="VALIDATION_ERROR" />
    <display value="Validation error" />
    <definition value="This it the 'default' error thrown when no others are applicable." />
  </concept>
  <concept>
    <code value="INVALID_UPDATE" />
    <display value="Invalid update" />
    <definition value="The update was invalid - a detailed description will be added to the display." />
  </concept>
  <concept>
    <code value="MISSING_VALUE" />
    <display value="Missing value" />
    <definition value="There was a missing value in the request. For example - a name update that is missing the surname. The missing value will be presented in the display." />
  </concept>
  <concept>
    <code value="INVALID_VALUE" />
    <display value="Invalid value" />
    <definition value="There was an invalid value in the request. For example - a name update where the surname is too long. The invalid value and field will be presented in the display." />
  </concept>
  <concept>
    <code value="UNSUPPORTED_VALUE" />
    <display value="Unsupported value" />
    <definition value="There was an unsupported value in the request. The value may be valid in the schema - however it could be a legacy value that we do not allow to be set anymore. For example - setting the death notification status to 'removed'. The invalid value and field will be presented in the display." />
  </concept>
  <concept>
    <code value="TOO_FEW_VALUES_SUBMITTED" />
    <display value="Too few values submitted" />
    <definition value="The field in question has a minimum number of items and the user sent too few." />
  </concept>
  <concept>
    <code value="TOO_MANY_VALUES_SUBMITTED" />
    <display value="Too many values submitted" />
    <definition value="The field in question has a maximum number of items and the user sent too many." />
  </concept>
  <concept>
    <code value="ADDITIONAL_PROPERTIES" />
    <display value="Additional properties" />
    <definition value="The user sent additional properties within the dictionary. For example sending a patient patch and attempting to add 'pets', which is not an allowed field within the patient resource." />
  </concept>
  <!--Polling outcomes -->
  <concept>
    <code value="POLLING_ID_NOT_FOUND" />
    <display value="Polling ID not found" />
    <definition value="When polling the ID was not found - or it was not applicable such as a non polling ID." />
  </concept>
  <concept>
    <code value="POLLING_MESSAGE_FAILURE" />
    <display value="Polling message failure" />
    <definition value="When polling an ID, a message was found to be in a failed state, so there is nothing else to be done and should be considered a failure." />
  </concept>
  <concept>
    <code value="INVALID_METHOD" />
    <display value="Invalid method" />
    <definition value="The request method is not permitted." />
  </concept>
</CodeSystem>