{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/optum/json-schema/optum-coverage-discovery-task-schema.json",
  "title": "CoverageDiscoveryTask",
  "description": "The base object model for the `/coverage-discovery` endpoints",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/optum-coverage-discovery-api-openapi.yml#/components/schemas/CoverageDiscoveryTask",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique ID of the task"
    },
    "status": {
      "type": "string",
      "enum": [
        "success",
        "failure",
        "pending"
      ],
      "description": "The current state of the discovery task. `pending` means at least one path has not completed. `success` means at least one path produced eligible coverage and no paths remain pending. `failure` means no path produced eligible coverage and no paths remain pending."
    },
    "tenantName": {
      "type": "string"
    },
    "traceId": {
      "type": "string"
    },
    "correlationId": {
      "type": "string"
    },
    "name": {
      "type": "string",
      "description": "Customer-configured task name assigned during enrollment to identify the overall discovery workflow. This root name identifies the configured task, not an individual path. Examples include `Medicaid + HMO` for a chained task or `Commercial + HMO + RTCOB` for a serial task."
    },
    "type": {
      "type": "string",
      "enum": [
        "serial",
        "chained"
      ]
    },
    "startDateTime": {
      "type": "string",
      "format": "date-time",
      "description": "The time that the discovery task was initiated"
    },
    "endDateTime": {
      "type": "string",
      "format": "date-time",
      "description": "The time the discovery task finished. Omitted while the task status is `pending`."
    },
    "realTime": {
      "type": "object",
      "description": "The abbreviated parent Real-Time transaction response that triggered or accompanied the Coverage Discovery workflow. This object is populated only when a customer is enrolled in Integrated Coverage Discovery and selects the `Include RealTime Response` capability. Use this object for parent RTE context. Use `discoveryPaths.*[].transaction` for the child transactions produced by discovery path execution.",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "The date-time the parent transaction was executed"
        },
        "transaction": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "The unique ID of the parent transaction response from the Real Time Flow."
            },
            "status": {
              "type": "string",
              "enum": [
                "eligible",
                "ineligible",
                "payer_unavailable",
                "payer_not_in_system",
                "processing_error",
                "patient_unknown"
              ],
              "description": "The normalized outcome of the parent transaction."
            },
            "chcPayerId": {
              "type": "string",
              "description": "The CHC PayerID used in the submission of the transaction"
            },
            "x12-271": {
              "type": "string",
              "description": "The raw x12-271 response from the parent Real-Time transaction."
            }
          },
          "description": "Abbreviated parent real-time transaction details."
        }
      }
    },
    "discoveryPaths": {
      "type": "object",
      "description": "A list of routes that are automatically generated based on customer configuration and supplied input data to attempt to find positive patient coverage.",
      "properties": {
        "successful": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string",
                "description": "The name of the discovery path that ran for this record. Typical values include `Medicare`, `Commercial`, `RTCOB`, `CoverageInsight`, `Medicaid`, and `HMO`."
              },
              "description": {
                "type": "string",
                "description": "A brief description of the path"
              },
              "timestamp": {
                "type": "string",
                "format": "date-time",
                "description": "The date-time the path was executed"
              },
              "transaction": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The unique ID of the transaction"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "eligible",
                      "ineligible",
                      "payer_unavailable",
                      "payer_not_in_system",
                      "processing_error",
                      "patient_unknown"
                    ],
                    "description": "The normalized outcome of the discovery-path transaction."
                  },
                  "chcPayerId": {
                    "type": "string",
                    "description": "The CHC PayerID used in the submission of the transaction"
                  },
                  "x12-271": {
                    "type": "string",
                    "description": "The x12-271 response from the submitted transaction"
                  }
                }
              }
            }
          },
          "description": "A list of successful discovery paths. A path is deemed \"successful\" when the nested child `transaction.status` is `eligible`.\n"
        },
        "unsuccessful": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string",
                "description": "The name of the discovery path that ran for this record. Typical values include `Medicare`, `Commercial`, `RTCOB`, `CoverageInsight`, `Medicaid`, and `HMO`."
              },
              "description": {
                "type": "string",
                "description": "A brief description of the path"
              },
              "timestamp": {
                "type": "string",
                "format": "date-time",
                "description": "The date-time the path was executed"
              },
              "transaction": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The unique ID of the transaction"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "eligible",
                      "ineligible",
                      "payer_unavailable",
                      "payer_not_in_system",
                      "processing_error",
                      "patient_unknown"
                    ],
                    "description": "The normalized outcome of the discovery-path transaction."
                  },
                  "chcPayerId": {
                    "type": "string",
                    "description": "The CHC PayerID used in the submission of the transaction"
                  },
                  "x12-271": {
                    "type": "string",
                    "description": "The raw x12-271 response from the child discovery-produced transaction."
                  }
                }
              }
            }
          },
          "description": "A list of unsuccessful discovery paths. A path is deemed \"unsuccessful\" when the nested child `transaction.status` is anything other than `eligible`, including `ineligible`, `patient_unknown`, `payer_unavailable`, `payer_not_in_system`, and `processing_error`. These child transaction statuses are often the main operational signal for retry or resubmission decisions.\n"
        },
        "pending": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string",
                "description": "The name of the discovery path"
              },
              "description": {
                "type": "string",
                "description": "A brief description of the path"
              },
              "timestamp": {
                "type": "string",
                "format": "date-time",
                "description": "The date-time the path entered the pending state."
              },
              "transaction": {
                "type": "object",
                "description": "Empty while the discovery path has not executed."
              }
            }
          },
          "description": "A list of discovery paths that have yet to be executed."
        },
        "skipped": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string",
                "description": "The name of the discovery path"
              },
              "description": {
                "type": "string",
                "description": "A brief description of the path"
              },
              "timestamp": {
                "type": "string",
                "format": "date-time",
                "description": "The date-time the path was evaluated and marked as skipped."
              },
              "reason": {
                "type": "string",
                "description": "The reason why the path was skipped"
              }
            }
          },
          "description": "A list of skipped discovery paths. A path is considered \"skipped\" if there was an error building the path's requests, if another path resulted in found coverage before the skipped path executed, or if an RTCOB or Coverage Insight request matched the fixed 72-hour request cache and therefore did not create a new downstream submission. Cached requests are represented as skipped because the downstream response is not replayed from that cache layer.\n"
        }
      }
    }
  }
}