{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/backworkhealth-com/json-schema/backworkhealth-com-certified-decision-schema.json",
  "title": "CertifiedDecision",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/backworkhealth-com-certified-releases-api-openapi.yml#/components/schemas/CertifiedDecision",
  "type": "object",
  "properties": {
    "decision_id": {
      "type": "string",
      "pattern": "^bwd_[0-9a-f]{64}$",
      "description": "Content-addressed decision ID; equal to `bwd_` plus `record_sha256`"
    },
    "record_sha256": {
      "description": "Digest of the canonical released decision record",
      "$ref": "#/$defs/Sha256Digest"
    },
    "policy_id": {
      "type": "string",
      "minLength": 1,
      "description": "Source policy identifier"
    },
    "policy_version": {
      "type": "integer",
      "minimum": 1,
      "description": "Pinned source policy version"
    },
    "policy_fingerprint_sha256": {
      "description": "Digest binding the decision to the exact source policy version",
      "$ref": "#/$defs/Sha256Digest"
    },
    "source_document_sha256": {
      "description": "Digest of the immutable source document used for the decision",
      "$ref": "#/$defs/Sha256Digest"
    },
    "payer_code": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "pattern": "^[A-Z0-9][A-Z0-9_.-]{0,99}$",
      "description": "Canonical uppercase payer code"
    },
    "line_of_business": {
      "type": "string",
      "enum": [
        "commercial",
        "medicare",
        "medicaid",
        "exchange"
      ]
    },
    "code_system": {
      "type": "string",
      "enum": [
        "CPT",
        "HCPCS",
        "ICD10CM",
        "ICD10PCS"
      ]
    },
    "code": {
      "type": "string",
      "minLength": 1,
      "maxLength": 20,
      "pattern": "^[A-Z0-9.]+$",
      "description": "Canonical uppercase code valid for `code_system`"
    },
    "disposition": {
      "type": "string",
      "enum": [
        "covered",
        "not_covered",
        "requires_pa",
        "conditional"
      ]
    },
    "effective_date": {
      "type": "string",
      "format": "date"
    },
    "retire_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "decision_id",
    "record_sha256",
    "policy_id",
    "policy_version",
    "policy_fingerprint_sha256",
    "source_document_sha256",
    "payer_code",
    "line_of_business",
    "code_system",
    "code",
    "disposition",
    "effective_date",
    "retire_date"
  ],
  "$defs": {
    "Sha256Digest": {
      "type": "string",
      "minLength": 64,
      "maxLength": 64,
      "pattern": "^[0-9a-f]{64}$",
      "description": "Lowercase hexadecimal SHA-256 digest"
    }
  }
}