{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artwaste.land/data/outcome-change-history/schema.json",
  "title": "How a registered clinical trial primary outcome moved, per trial",
  "description": "One row per sampled trial from ClinicalTrials.gov. Every field is either a registry field carried through verbatim, or a quantity this project computed from the registry's dated version archive. No trial record text is included: the nct_id links to the live entry, which is always current. Sampling frame and method: https://artwaste.land/strata/added-dropped-or-just-reworded/",
  "type": "object",
  "required": [
    "nct_id",
    "study_status",
    "funder_type",
    "phases",
    "primary_completion_date_recorded",
    "primary_completion_date_resolved",
    "first_posted",
    "results_first_posted",
    "prospectively_registered",
    "versions",
    "first_version_date",
    "last_version_date",
    "admin_only_versions",
    "has_primary_outcome_field",
    "primary_outcome_changed",
    "primary_outcome_change_version",
    "primary_outcome_change_date",
    "changed_after_primary_completion",
    "days_from_primary_completion",
    "change_version_carried_results",
    "outcomes_update_count",
    "n_primary_outcomes_original",
    "n_primary_outcomes_current",
    "change_kind",
    "worst_title_dice",
    "enrollment_change_version",
    "enrollment_changed_after_primary_completion",
    "in_headline_set"
  ],
  "additionalProperties": false,
  "properties": {
    "nct_id": {
      "type": "string",
      "pattern": "^NCT\\d+$",
      "description": "The registry identifier. Resolves at https://clinicaltrials.gov/study/<nct_id>.",
      "x-origin": "redistributed",
      "x-source": "src:clinicaltrials-gov"
    },
    "study_status": {
      "type": "string",
      "description": "Overall recruitment status as the registry records it, e.g. COMPLETED, TERMINATED, UNKNOWN.",
      "x-origin": "redistributed",
      "x-source": "src:clinicaltrials-gov"
    },
    "funder_type": {
      "type": "string",
      "description": "The registry's funder class: INDUSTRY, NIH, OTHER_GOV, NETWORK, OTHER, or empty.",
      "x-origin": "redistributed",
      "x-source": "src:clinicaltrials-gov"
    },
    "phases": {
      "type": "string",
      "description": "The registry's phase string, e.g. PHASE3 or PHASE2|PHASE3, or NA where phase does not apply.",
      "x-origin": "redistributed",
      "x-source": "src:clinicaltrials-gov"
    },
    "primary_completion_date_recorded": {
      "type": "string",
      "description": "The primary completion date exactly as the registry prints it, which may be YYYY, YYYY-MM or YYYY-MM-DD.",
      "x-origin": "redistributed",
      "x-source": "src:clinicaltrials-gov"
    },
    "primary_completion_date_resolved": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "The same date resolved to the LAST day it could denote. Ours, and deliberately the conservative direction: it pushes the date later, which makes a change count as post-completion less often.",
      "x-origin": "built",
      "x-source": "src:aw-version-arithmetic"
    },
    "first_posted": {
      "type": "string",
      "description": "Date the record first appeared publicly, resolved by the same rule.",
      "x-origin": "redistributed",
      "x-source": "src:clinicaltrials-gov"
    },
    "results_first_posted": {
      "type": "string",
      "description": "Date results were first posted, or empty if never.",
      "x-origin": "redistributed",
      "x-source": "src:clinicaltrials-gov"
    },
    "prospectively_registered": {
      "type": [
        "boolean"
      ],
      "description": "True where first_posted is on or before primary_completion_date_resolved. A trial first posted after its own primary completion never pre-specified anything in public.",
      "x-origin": "built",
      "x-source": "src:aw-version-arithmetic"
    },
    "versions": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of versions in the registry's archive for this record.",
      "x-origin": "built",
      "x-source": "src:aw-version-arithmetic"
    },
    "first_version_date": {
      "type": "string",
      "description": "Date of version 0.",
      "x-origin": "redistributed",
      "x-source": "src:clinicaltrials-gov"
    },
    "last_version_date": {
      "type": "string",
      "description": "Date of the most recent version in the snapshot.",
      "x-origin": "redistributed",
      "x-source": "src:clinicaltrials-gov"
    },
    "admin_only_versions": {
      "type": "integer",
      "minimum": 0,
      "description": "Versions whose changed modules are all routine: study status, contacts and locations, identification, references, documents, sponsor, oversight.",
      "x-origin": "built",
      "x-source": "src:aw-version-arithmetic"
    },
    "has_primary_outcome_field": {
      "type": [
        "boolean"
      ],
      "description": "False where the history endpoint reports no primary-outcome version index at all, which happens for records that never registered one. Such rows are excluded from every rate.",
      "x-origin": "built",
      "x-source": "src:aw-version-arithmetic"
    },
    "primary_outcome_changed": {
      "type": [
        "boolean",
        "string"
      ],
      "description": "True where the primary outcomes differ from the ones first registered. Empty where has_primary_outcome_field is false.",
      "x-origin": "built",
      "x-source": "src:aw-version-arithmetic"
    },
    "primary_outcome_change_version": {
      "type": [
        "integer",
        "string"
      ],
      "description": "The registry's own version index at which primary outcomes were last changed.",
      "x-origin": "redistributed",
      "x-source": "src:clinicaltrials-gov"
    },
    "primary_outcome_change_date": {
      "type": "string",
      "description": "The date of that version.",
      "x-origin": "redistributed",
      "x-source": "src:clinicaltrials-gov"
    },
    "changed_after_primary_completion": {
      "type": [
        "boolean",
        "string"
      ],
      "description": "True where primary_outcome_change_date is strictly after primary_completion_date_resolved.",
      "x-origin": "built",
      "x-source": "src:aw-version-arithmetic"
    },
    "days_from_primary_completion": {
      "type": [
        "integer",
        "string"
      ],
      "description": "Signed days from primary completion to the outcome change. Negative means before.",
      "x-origin": "built",
      "x-source": "src:aw-version-arithmetic"
    },
    "change_version_carried_results": {
      "type": [
        "boolean",
        "string"
      ],
      "description": "True where the version that changed the primary outcome also carried the results section, so the pre-specification and the results were filed together.",
      "x-origin": "built",
      "x-source": "src:aw-version-arithmetic"
    },
    "outcomes_update_count": {
      "type": [
        "integer",
        "string"
      ],
      "description": "The registry's own count of outcome updates for this record.",
      "x-origin": "redistributed",
      "x-source": "src:clinicaltrials-gov"
    },
    "n_primary_outcomes_original": {
      "type": [
        "integer",
        "string"
      ],
      "description": "How many primary outcome measures the first registration named.",
      "x-origin": "built",
      "x-source": "src:aw-version-arithmetic"
    },
    "n_primary_outcomes_current": {
      "type": [
        "integer",
        "string"
      ],
      "description": "How many the record names now.",
      "x-origin": "built",
      "x-source": "src:aw-version-arithmetic"
    },
    "change_kind": {
      "type": "string",
      "description": "COUNT_CHANGED (a measure was added or dropped), MEASURE_CHANGED (same count, a named measure no longer appears), DETAIL_ONLY (every named measure survives verbatim, only description or time frame moved), UNDECIDABLE, or empty where the trial did not change. The rule is research/the-outcome-that-changed/classify.mjs.",
      "x-origin": "built",
      "x-source": "src:aw-version-arithmetic"
    },
    "worst_title_dice": {
      "type": [
        "number",
        "string"
      ],
      "description": "For MEASURE_CHANGED rows, the lowest token-set Dice similarity between an original measure title and its closest current one. 1 is identical, 0 is disjoint.",
      "x-origin": "built",
      "x-source": "src:aw-version-arithmetic"
    },
    "enrollment_change_version": {
      "type": [
        "integer",
        "string"
      ],
      "description": "Version at which the enrolment figure was last changed, where it changed.",
      "x-origin": "redistributed",
      "x-source": "src:clinicaltrials-gov"
    },
    "enrollment_changed_after_primary_completion": {
      "type": [
        "boolean",
        "string"
      ],
      "description": "The control field. Recording actual enrolment after a trial ends is normal and required, so this is what an innocent post-completion edit looks like.",
      "x-origin": "built",
      "x-source": "src:aw-version-arithmetic"
    },
    "in_headline_set": {
      "type": [
        "boolean"
      ],
      "description": "True for the completed, prospectively registered trials the published headline rate is computed on.",
      "x-origin": "built",
      "x-source": "src:aw-version-arithmetic"
    }
  }
}
