{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ticexplorer-com/json-schema/ticexplorer-com-claim-result-schema.json",
  "title": "ClaimResult",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ticexplorer-com-openapi.json#/components/schemas/ClaimResult",
  "properties": {
    "lines": {
      "items": {
        "$ref": "#/$defs/ClaimLineResult"
      },
      "type": "array",
      "title": "Lines"
    },
    "billing_entities": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "Billing Entities"
    },
    "per_entity_totals": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "Per Entity Totals"
    },
    "expected_total_range": {
      "items": {
        "type": "number"
      },
      "type": "array",
      "title": "Expected Total Range"
    },
    "reconciliation": {
      "anyOf": [
        {
          "$ref": "#/$defs/Reconciliation"
        },
        {
          "type": "null"
        }
      ]
    },
    "needs": {
      "items": {
        "$ref": "#/$defs/Need"
      },
      "type": "array",
      "title": "Needs",
      "default": []
    },
    "next_steps": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Next Steps",
      "default": []
    }
  },
  "additionalProperties": true,
  "type": "object",
  "required": [
    "lines",
    "billing_entities",
    "per_entity_totals",
    "expected_total_range"
  ],
  "$defs": {
    "ClaimLineResult": {
      "properties": {
        "code": {
          "type": "string",
          "title": "Code"
        },
        "units": {
          "type": "number",
          "title": "Units"
        },
        "status_indicator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Status Indicator"
        },
        "options": {
          "items": {
            "$ref": "#/$defs/ClaimOption"
          },
          "type": "array",
          "title": "Options",
          "description": "The rule-based rate each candidate billing entity would be paid."
        },
        "expected_range": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Expected Range"
        },
        "notes": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Notes",
          "default": []
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "code",
        "units",
        "options"
      ],
      "title": "ClaimLineResult"
    },
    "ClaimOption": {
      "properties": {
        "tin": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tin"
        },
        "entity": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Entity"
        },
        "amount": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Amount"
        },
        "method": {
          "type": "string",
          "title": "Method"
        },
        "confidence": {
          "type": "string",
          "title": "Confidence"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "method",
        "confidence"
      ],
      "title": "ClaimOption"
    },
    "Need": {
      "properties": {
        "field": {
          "type": "string",
          "title": "Field",
          "description": "The missing input or condition, e.g. which_insurer, place_of_service, wait."
        },
        "why": {
          "type": "string",
          "title": "Why",
          "description": "Why it changes the answer and what to do."
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "field",
        "why"
      ],
      "title": "Need"
    },
    "Reconciliation": {
      "properties": {
        "actual_allowed_total": {
          "type": "number",
          "title": "Actual Allowed Total"
        },
        "best_match_total": {
          "type": "number",
          "title": "Best Match Total"
        },
        "difference": {
          "type": "number",
          "title": "Difference"
        },
        "difference_percent": {
          "type": "number",
          "title": "Difference Percent"
        },
        "verdict": {
          "type": "string",
          "enum": [
            "explained",
            "plausible",
            "unexplained"
          ],
          "title": "Verdict"
        },
        "best_match": {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array",
          "title": "Best Match"
        },
        "explanation": {
          "type": "string",
          "title": "Explanation"
        },
        "interpretation": {
          "type": "string",
          "title": "Interpretation"
        },
        "caveat": {
          "type": "string",
          "title": "Caveat"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "actual_allowed_total",
        "best_match_total",
        "difference",
        "difference_percent",
        "verdict",
        "best_match",
        "explanation",
        "interpretation",
        "caveat"
      ],
      "title": "Reconciliation"
    }
  }
}