{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$ref": "#/definitions/ClaimFinancials",
  "definitions": {
    "ClaimFinancials": {
      "type": "object",
      "properties": {
        "totalIncurred": {
          "$ref": "#/definitions/Money",
          "description": "Total incurred (paid + outstanding reserves)"
        },
        "totalPaid": {
          "$ref": "#/definitions/Money",
          "description": "Total amount paid to date"
        },
        "totalReserves": {
          "$ref": "#/definitions/Money",
          "description": "Outstanding reserves"
        },
        "subrogationRecovery": {
          "$ref": "#/definitions/Money",
          "description": "Amount recovered through subrogation"
        },
        "deductibleApplied": {
          "$ref": "#/definitions/Money",
          "description": "Deductible amount applicable to this claim"
        },
        "payments": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ClaimPayment"
          },
          "description": "Individual payment transactions"
        }
      },
      "additionalProperties": false,
      "description": "Financial summary of a claim, including reserves and payments.",
      "examples": [
        {
          "totalIncurred": {
            "value": 150000,
            "currency": "USD"
          },
          "totalPaid": {
            "value": 75000,
            "currency": "USD"
          },
          "totalReserves": {
            "value": 75000,
            "currency": "USD"
          }
        }
      ]
    },
    "Money": {
      "type": "object",
      "properties": {
        "value": {
          "type": "number",
          "description": "Numeric amount. Represented as a number; precision should be maintained by the consuming system."
        },
        "currency": {
          "type": "string",
          "description": "ISO 4217 currency code.",
          "default": "USD"
        }
      },
      "required": [
        "value"
      ],
      "additionalProperties": false,
      "description": "A monetary amount with currency.",
      "examples": [
        {
          "value": 1000000,
          "currency": "USD"
        }
      ]
    },
    "ClaimPayment": {
      "type": "object",
      "properties": {
        "paymentDate": {
          "type": "string",
          "description": "Date the payment was made.",
          "format": "date"
        },
        "amount": {
          "$ref": "#/definitions/Money",
          "description": "Amount of the payment"
        },
        "paymentType": {
          "$ref": "#/definitions/CodeableConcept",
          "description": "Type of payment."
        },
        "payee": {
          "type": "string",
          "description": "Payee — who received the payment"
        },
        "description": {
          "type": "string",
          "description": "Description of what the payment covers"
        }
      },
      "required": [
        "paymentDate",
        "amount",
        "paymentType"
      ],
      "additionalProperties": false,
      "description": "An individual payment made on a claim."
    },
    "CodeableConcept": {
      "type": "object",
      "properties": {
        "coding": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Coding"
          },
          "description": "Code(s) from formal code systems"
        },
        "text": {
          "type": "string",
          "description": "Plain text representation of the concept"
        }
      },
      "additionalProperties": false,
      "description": "A concept with a coding and optional text. Wraps one or more Coding values with a human-readable summary."
    },
    "Coding": {
      "type": "object",
      "properties": {
        "system": {
          "type": "string",
          "description": "The code system URI that defines the code.",
          "format": "uri"
        },
        "code": {
          "type": "string",
          "description": "The code value from the code system"
        },
        "display": {
          "type": "string",
          "description": "Human-readable display text for the code"
        }
      },
      "required": [
        "code"
      ],
      "additionalProperties": false,
      "description": "A coded value from a defined code system. Used throughout BIND for standardized enumerations.",
      "examples": [
        {
          "system": "https://bind.codes/line-of-business",
          "code": "GL",
          "display": "General Liability"
        }
      ]
    }
  },
  "$id": "https://bind-standard.org/schema/ClaimFinancials",
  "title": "ClaimFinancials"
}
