{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/backworkhealth-com/json-schema/backworkhealth-com-code-spending-data-schema.json",
  "title": "CodeSpendingData",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/backworkhealth-com-spending-api-openapi.yml#/components/schemas/CodeSpendingData",
  "type": "object",
  "properties": {
    "total_paid": {
      "type": "string",
      "description": "Total paid, as a decimal string"
    },
    "total_claims": {
      "type": "integer"
    },
    "reported_patient_count_sum": {
      "type": "integer"
    },
    "patient_count_semantics": {
      "type": "string",
      "const": "sum_of_source_row_counts_not_distinct_people",
      "description": "Patient counts are summed at publisher row grain and are not deduplicated people"
    },
    "unique_providers": {
      "type": "integer"
    },
    "date_range": {
      "type": "object",
      "properties": {
        "min": {
          "type": [
            "string",
            "null"
          ]
        },
        "max": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "min",
        "max"
      ]
    },
    "by_year": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer"
          },
          "total_paid": {
            "type": "string"
          },
          "total_claims": {
            "type": "integer"
          },
          "reported_patient_count_sum": {
            "type": "integer"
          }
        },
        "required": [
          "year",
          "total_paid",
          "total_claims",
          "reported_patient_count_sum"
        ]
      }
    }
  },
  "required": [
    "total_paid",
    "total_claims",
    "reported_patient_count_sum",
    "patient_count_semantics",
    "unique_providers",
    "date_range",
    "by_year"
  ]
}