{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ticexplorer-com/json-schema/ticexplorer-com-codes-result-schema.json",
  "title": "CodesResult",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ticexplorer-com-codes-api-openapi.yml#/components/schemas/CodesResult",
  "properties": {
    "data": {
      "items": {
        "$ref": "#/$defs/Code"
      },
      "type": "array",
      "title": "Data"
    },
    "next_cursor": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Next Cursor"
    },
    "setting": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Setting",
      "description": "Where care happens, when the words name it (urgent care, ER, telehealth, hospital outpatient, ASC, home, office): id, name, CMS place of service `pos` (+ `pos_options`), `note` on how that setting bills, `visit_codes`."
    },
    "clarify": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Clarify",
      "default": []
    },
    "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": [
    "data"
  ],
  "$defs": {
    "Code": {
      "properties": {
        "code_type": {
          "type": "string",
          "title": "Code Type"
        },
        "code": {
          "type": "string",
          "title": "Code"
        },
        "plain_name": {
          "type": "string",
          "title": "Plain Name"
        },
        "official_description": {
          "type": "string",
          "title": "Official Description",
          "default": ""
        },
        "category": {
          "type": "string",
          "title": "Category",
          "default": ""
        },
        "facts": {
          "$ref": "#/$defs/CodeFacts"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "code_type",
        "code",
        "plain_name",
        "facts"
      ],
      "title": "Code"
    },
    "CodeFacts": {
      "properties": {
        "hospital_outpatient": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Hospital Outpatient",
          "description": "OPPS status indicator, APC, packaging rule."
        },
        "medicare_physician_fee": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Medicare Physician Fee"
        },
        "medicare_clinical_lab_fee": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Medicare Clinical Lab Fee",
          "description": "Lab tests: Medicare lab fee (ESTIMATED; the CMS CLFS file is behind the AMA license)."
        },
        "medicare_drug_payment_limit": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Medicare Drug Payment Limit",
          "description": "Part B drugs: ASP payment limit per billing unit."
        },
        "medicare_only_code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Medicare Only Code"
        },
        "timed_units": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Timed Units"
        },
        "add_on_code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Add On Code"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "title": "CodeFacts"
    },
    "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"
    }
  }
}