{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/system/main/json-schema/system-statistical-finding-schema.json",
  "title": "StatisticalFinding",
  "description": "Statistical finding.",
  "x-generated": "2026-10-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/system-api-openapi.json#/components/schemas/StatisticalFinding",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id",
      "description": "Unique identifier",
      "filterable": true
    },
    "flagged": {
      "type": "boolean",
      "title": "Flagged",
      "description": "Whether finding is flagged",
      "default": false,
      "filterable": true
    },
    "finding_type": {
      "type": "string",
      "enum": [
        "statistical"
      ],
      "const": "statistical",
      "title": "Finding Type",
      "description": "Type of finding",
      "default": "statistical"
    },
    "summary": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Summary",
      "description": "Summary of the finding"
    },
    "topic_1": {
      "anyOf": [
        {
          "$ref": "#/$defs/Topic"
        },
        {
          "type": "null"
        }
      ],
      "description": "Source topic of the finding",
      "filterable": true,
      "searchable": true
    },
    "topic_2": {
      "anyOf": [
        {
          "$ref": "#/$defs/Topic"
        },
        {
          "type": "null"
        }
      ],
      "description": "Target topic of the finding",
      "filterable": true,
      "searchable": true
    },
    "variable_1": {
      "allOf": [
        {
          "$ref": "#/$defs/Variable"
        }
      ],
      "description": "Source variable of the finding",
      "filterable": true,
      "searchable": true
    },
    "variable_2": {
      "allOf": [
        {
          "$ref": "#/$defs/Variable"
        }
      ],
      "description": "Target variable of the finding",
      "filterable": true,
      "searchable": true
    },
    "study": {
      "allOf": [
        {
          "$ref": "#/$defs/Study"
        }
      ],
      "description": "Study supporting the finding",
      "filterable": true
    },
    "statistic_type": {
      "anyOf": [
        {
          "$ref": "#/$defs/StatisticType"
        },
        {
          "type": "null"
        }
      ],
      "description": "Type of statistic",
      "filterable": true
    },
    "statistic_value": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Statistic Value",
      "description": "Value of statistic"
    },
    "effect_size": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Effect Size",
      "description": "Effect size"
    },
    "ci_upper": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Ci Upper",
      "description": "Upper bound of confidence interval"
    },
    "ci_lower": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Ci Lower",
      "description": "Lower bound of confidence interval"
    },
    "p_value": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "P Value",
      "description": "P-value"
    }
  },
  "type": "object",
  "required": [
    "id"
  ],
  "$defs": {
    "Author": {
      "properties": {
        "full_name": {
          "type": "string",
          "title": "Full Name",
          "description": "Full name of author"
        },
        "orcid": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Orcid",
          "description": "ORCID of author"
        },
        "openalex_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Openalex Id",
          "description": "OpenAlex ID of author"
        }
      },
      "type": "object",
      "required": [
        "full_name"
      ],
      "title": "Author",
      "description": "Author."
    },
    "StatisticType": {
      "type": "string",
      "enum": [
        "odds_ratio",
        "adjusted_odds_ratio",
        "hazard_ratio",
        "adjusted_hazard_ratio",
        "relative_risk_ratio",
        "coefficient",
        "pearson_r",
        "incident_rate_ratio",
        "prevalence_ratio",
        "spearman_correlation",
        "mean_difference_standardized",
        "mean_difference_unstandardized",
        "risk_difference",
        "coefficient_of_determination",
        "t_test",
        "elasticity",
        "gini_coefficient"
      ],
      "title": "StatisticType",
      "description": "Statistic type."
    },
    "Study": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id",
          "description": "Unique identifier",
          "filterable": true
        },
        "doi": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Doi",
          "description": "Digital Object Identifier (DOI)",
          "filterable": true
        },
        "pmid": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pmid",
          "description": "PubMed Identifier (PMID)",
          "filterable": true
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Title",
          "description": "Title of the study"
        },
        "authors": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/Author"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Authors",
          "description": "Authors of the study"
        },
        "journal": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Journal",
          "description": "Journal the study was published in"
        },
        "publish_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Publish Date",
          "description": "Year of publication",
          "filterable": true,
          "sortable": true
        },
        "population": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Population",
          "description": "Population studied"
        },
        "sample_size": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sample Size",
          "description": "Sample size of the study",
          "sortable": true
        },
        "summary": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Summary",
          "description": "Summary of the study"
        },
        "cited_by": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cited By",
          "description": "Number of times study was cited by another study",
          "filterable": true,
          "sortable": true
        },
        "study_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Study Type",
          "description": "Type of study",
          "filterable": true
        },
        "retraction_reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Retraction Reason",
          "description": "Reason for retraction of study"
        }
      },
      "type": "object",
      "required": [
        "id"
      ],
      "title": "Study",
      "description": "Study."
    },
    "Topic": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id",
          "description": "Unique identifier",
          "filterable": true
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Name of the topic",
          "searchable": true
        },
        "wikidata_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Wikidata Id",
          "description": "Wikidata identifier for the topic",
          "filterable": true
        },
        "umls_cuis": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Umls Cuis",
          "description": "UMLS Concept Unique Identifiers (CUIs) for the topic",
          "filterable": true
        },
        "category": {
          "anyOf": [
            {
              "$ref": "#/$defs/TopicCategory"
            },
            {
              "type": "null"
            }
          ],
          "description": "Category of the topic",
          "filterable": true
        },
        "roles": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/TopicRole"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Roles",
          "description": "Roles associated with the topic",
          "filterable": true
        }
      },
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "title": "Topic",
      "description": "Topic."
    },
    "TopicCategory": {
      "type": "string",
      "enum": [
        "Biomedical - Diseases & disorders",
        "Biomedical - Hospitalization",
        "Biomedical - Mortality/survival",
        "Biomedical - Pathogen",
        "Biomedical - Ethnicity",
        "Biomedical - Other biological factors",
        "Biomedical - Anthropometry",
        "Biomedical - Age",
        "Biomedical - Sex",
        "Biomedical - Carcinogen",
        "Biomedical - Genetics",
        "Behavioral - Personal hygiene",
        "Behavioral - Other dietary factors",
        "Behavioral - Stress",
        "Behavioral - Substance use",
        "Behavioral - Eating behaviors",
        "Behavioral - Sleep",
        "Behavioral - Physical activity",
        "Behavioral - Other behavioral factors",
        "Behavioral - Sexual behavior",
        "Environmental - Air quality",
        "Environmental - Water quality",
        "Environmental - Weather and climate change",
        "Environmental - Other environmental factors",
        "Social - Education",
        "Social - Economic context",
        "Social - Other social factors",
        "Social - Physical infrastructure",
        "Social - Social context",
        "Social - Healthcare context",
        "Social - Occupation",
        "Social - Geography",
        "Social - Occupational context",
        "Healing",
        "Preventative",
        "Diagnostic",
        "Preservative",
        "Managing",
        "Therapeutic",
        "Other"
      ],
      "title": "TopicCategory",
      "description": "Topic category."
    },
    "TopicRole": {
      "type": "string",
      "enum": [
        "Determinant",
        "Intervention",
        "Outcome",
        "Agent"
      ],
      "title": "TopicRole",
      "description": "Topic role."
    },
    "Variable": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id",
          "description": "Unique identifier",
          "filterable": true
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name",
          "description": "Name of the variable",
          "searchable": true
        },
        "num_studies": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Num Studies",
          "description": "Number of studies the variable appears in",
          "filterable": true,
          "sortable": true
        },
        "topic": {
          "anyOf": [
            {
              "$ref": "#/$defs/Topic"
            },
            {
              "type": "null"
            }
          ],
          "description": "Topic that the variable is matched to",
          "filterable": true
        }
      },
      "type": "object",
      "required": [
        "id"
      ],
      "title": "Variable",
      "description": "Variable."
    }
  }
}