{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/meta-council-com/json-schema/meta-council-com-locus-score-input-schema.json",
  "title": "LocusScoreInput",
  "description": "LOCUS dimension ratings (1-5) or per-reviewer scores.\n\nProvide EITHER the seven flat D* fields OR an agent_scores map — not both.\nSupplying both is refused with a 422 by ``locus_determine_api`` rather than\nresolved in favour of either one; the discarded ratings carry the override\nfloors, so silently dropping them can under-place a patient.\nUnknown fields are rejected (extra='forbid') so a typo like\n'D3_Comorbidity' instead of 'D3_CoMorbidity' fails fast with 422 instead\nof silently dropping a clinical score and producing a lower-than-intended\ncomposite.",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/meta-council-com-openapi.json#/components/schemas/LocusScoreInput",
  "properties": {
    "D1_RiskOfHarm": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 5.0,
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "D1 Riskofharm",
      "description": "Risk of Harm (1-5). Suicidal ideation, self-injury, aggression, accident risk."
    },
    "D2_FunctionalStatus": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 5.0,
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "D2 Functionalstatus",
      "description": "Functional Status (1-5). ADLs, occupational/educational role, self-care."
    },
    "D3_CoMorbidity": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 5.0,
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "D3 Comorbidity",
      "description": "Medical / Addictive / Psychiatric Co-Morbidity (1-5). Note: capital M in CoMorbidity."
    },
    "D4A_Stress": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 5.0,
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "D4A Stress",
      "description": "Recovery Environment — Stress (1-5). D4 splits into D4A (stress) and D4B (support)."
    },
    "D4B_Support": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 5.0,
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "D4B Support",
      "description": "Recovery Environment — Support (1-5). Family/social/community recovery support."
    },
    "D5_TreatmentHistory": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 5.0,
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "D5 Treatmenthistory",
      "description": "Treatment & Recovery History (1-5). Prior engagement, response to care."
    },
    "D6_Engagement": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 5.0,
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "D6 Engagement",
      "description": "Engagement & Recovery Status (1-5). Insight, motivation, current treatment alliance."
    },
    "agent_scores": {
      "anyOf": [
        {
          "additionalProperties": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Agent Scores",
      "description": "Per-reviewer scores keyed by reviewer name, aggregated by median. Shape: {\"<reviewer_name>\": {\"D1_RiskOfHarm\": 4, \"D2_FunctionalStatus\": 3, ...}}. Mutually exclusive with the flat D* fields — supplying both is refused with a 422, not merged. An empty map counts as not supplied."
    }
  },
  "additionalProperties": false,
  "type": "object"
}