> ## Documentation Index
> Fetch the complete documentation index at: https://docs.connectivehealth.io/llms.txt
> Use this file to discover all available pages before exploring further.

# OperationOutcome

> The FHIR OperationOutcome resource as produced by Connective Health

[FHIR R4 OperationOutcome](https://www.hl7.org/fhir/R4/operationoutcome.html)

<Info>
  `OperationOutcome` has no US Core profile -- it is used here as a plain base FHIR resource. It is produced **only**
  for the [Bulk Medication History](/fhir/bulk-medication-history-bundle) bundle, where it represents two distinct
  situations rather than a single consistent concept. The [Patient Everything](/fhir/patient-everything-bundle) and
  [Patient Summary](/fhir/patient-summary-bundle) bundles do not produce it -- records that cannot be converted are
  simply omitted from those bundles.
</Info>

# Stable ID

No stable `id` is assigned to either usage below. Each occurrence should be treated as a standalone informational or
error entry for that processing run, not as a resource to track or deduplicate over time.

# Usage 1: Incomplete medication record

If a medication record from the source system is missing its history source qualifier, it does not contain enough
information to build a `MedicationRequest`/`MedicationDispense`, and an `OperationOutcome` is emitted in their place
for that record.

| Field               | Cardinality | Notes                                                                                                                                       |
| ------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `issue.severity`    | 1..1        | Currently, always `information`.                                                                                                            |
| `issue.code`        | 1..1        | Currently, always `informational`.                                                                                                          |
| `issue.diagnostics` | 1..1        | Free text in the form `"Patient {providerPatientIdentifierValue} issue: {note}"`, where `note` is a free-text value from the source system. |

# Usage 2: Patient-level error

If the original patient population request encountered an error while trying to locate or process a specific
patient, that error is surfaced as its own `OperationOutcome`, unrelated to any specific medication.

| Field               | Cardinality | Notes                                                                                                                                                               |
| ------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `issue.severity`    | 1..1        | Mapped from a single-letter source error type: `W` → `warning`, `E` → `error`, `F` → `fatal`. Any other or missing value defaults to `error`.                       |
| `issue.code`        | 1..1        | Currently, always `processing`.                                                                                                                                     |
| `issue.diagnostics` | 1..1        | Free text in the form `"Patient {providerPatientIdentifierValue} issue: {errorDescription}"`, where `errorDescription` is a free-text value from the source system. |
