{
  "id": "SAFETY-EVENT-CHANGES",
  "title": "What changed in FDA recalls and shortages",
  "shortTitle": "Changes feed",
  "method": "GET",
  "path": "/v1/safety-events/changes",
  "queryPath": null,
  "group": "safety",
  "unsupportedFields": [],
  "availability": "preview",
  "request": {
    "additionalProperties": false,
    "properties": {
      "since": {
        "maxLength": 40,
        "minLength": 10,
        "type": "string",
        "title": "Since"
      },
      "family": {
        "anyOf": [
          {
            "enum": [
              "recalls",
              "shortages"
            ],
            "type": "string"
          },
          {
            "items": {
              "enum": [
                "recalls",
                "shortages"
              ],
              "type": "string"
            },
            "type": "array"
          }
        ],
        "title": "Family"
      },
      "record_id": {
        "maxLength": 100,
        "minLength": 1,
        "type": "string",
        "title": "Record Id"
      },
      "limit": {
        "default": 20,
        "maximum": 100,
        "minimum": 1,
        "title": "Limit",
        "type": "integer"
      },
      "cursor": {
        "type": "string",
        "title": "Cursor"
      }
    },
    "title": "SafetyEventChangesRequest",
    "type": "object"
  },
  "response": {
    "$defs": {
      "ChangeFamily": {
        "additionalProperties": false,
        "properties": {
          "family": {
            "enum": [
              "recalls",
              "shortages"
            ],
            "title": "Family",
            "type": "string"
          },
          "status": {
            "enum": [
              "behind",
              "complete",
              "not_started"
            ],
            "title": "Status",
            "type": "string"
          },
          "history_starts_at": {
            "type": "string",
            "title": "History Starts At"
          },
          "covered_through": {
            "type": "string",
            "title": "Covered Through"
          }
        },
        "required": [
          "family",
          "status"
        ],
        "title": "ChangeFamily",
        "type": "object"
      },
      "ChangeGap": {
        "additionalProperties": false,
        "properties": {
          "from_first_seen_at": {
            "type": "string",
            "title": "From First Seen At"
          },
          "reason": {
            "enum": [
              "history_unavailable",
              "releases_not_recorded",
              "source_release_unavailable",
              "source_sequence_changed"
            ],
            "title": "Reason",
            "type": "string"
          }
        },
        "required": [
          "reason"
        ],
        "title": "ChangeGap",
        "type": "object"
      },
      "FieldChange": {
        "additionalProperties": false,
        "properties": {
          "field": {
            "title": "Field",
            "type": "string"
          },
          "from": {
            "type": "string",
            "title": "From"
          },
          "to": {
            "type": "string",
            "title": "To"
          }
        },
        "required": [
          "field"
        ],
        "title": "FieldChange",
        "type": "object"
      },
      "RecallChange": {
        "additionalProperties": false,
        "properties": {
          "recall_number": {
            "type": "string",
            "title": "Recall Number"
          },
          "product_description": {
            "type": "string",
            "title": "Product Description"
          },
          "classification": {
            "type": "string",
            "title": "Classification"
          },
          "enforcement_status_as_published": {
            "type": "string",
            "title": "Enforcement Status As Published"
          },
          "report_date": {
            "type": "string",
            "title": "Report Date"
          },
          "initiated_date": {
            "type": "string",
            "title": "Initiated Date"
          },
          "termination_date": {
            "type": "string",
            "title": "Termination Date"
          },
          "reason": {
            "type": "string",
            "title": "Reason"
          },
          "recalling_firm": {
            "type": "string",
            "title": "Recalling Firm"
          },
          "product_quantity": {
            "type": "string",
            "title": "Product Quantity"
          },
          "code_information": {
            "type": "string",
            "title": "Code Information"
          },
          "distribution": {
            "type": "string",
            "title": "Distribution"
          },
          "affected_ndcs": {
            "items": {
              "type": "string"
            },
            "title": "Affected Ndcs",
            "type": "array"
          },
          "recall_id": {
            "title": "Recall Id",
            "type": "string"
          },
          "source_url": {
            "type": "string",
            "title": "Source Url"
          }
        },
        "required": [
          "recall_id"
        ],
        "title": "RecallChange",
        "type": "object"
      },
      "ShortageDateWindow": {
        "additionalProperties": false,
        "properties": {
          "text": {
            "title": "Text",
            "type": "string"
          },
          "earliest": {
            "type": "string",
            "title": "Earliest"
          },
          "latest": {
            "type": "string",
            "title": "Latest"
          }
        },
        "required": [
          "text"
        ],
        "title": "ShortageDateWindow",
        "type": "object"
      },
      "ShortageDiscontinuation": {
        "additionalProperties": false,
        "properties": {
          "text": {
            "type": "string",
            "title": "Text"
          },
          "discontinued_date": {
            "type": "string",
            "title": "Discontinued Date"
          },
          "supply_end": {
            "$ref": "#/$defs/ShortageDateWindow"
          }
        },
        "title": "ShortageDiscontinuation",
        "type": "object"
      },
      "WirePublicDrugShortagePresentation": {
        "additionalProperties": false,
        "properties": {
          "shortage_id": {
            "title": "Shortage Id",
            "type": "string"
          },
          "generic_name": {
            "title": "Generic Name",
            "type": "string"
          },
          "proprietary_name": {
            "type": "string",
            "title": "Proprietary Name"
          },
          "presentation": {
            "title": "Presentation",
            "type": "string"
          },
          "dosage_form": {
            "type": "string",
            "title": "Dosage Form"
          },
          "strengths": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Strengths"
          },
          "package_ndc": {
            "type": "string",
            "title": "Package Ndc"
          },
          "company": {
            "title": "Company",
            "type": "string"
          },
          "national_shortage_status": {
            "title": "National Shortage Status",
            "type": "string"
          },
          "manufacturer_availability_text": {
            "type": "string",
            "title": "Manufacturer Availability Text"
          },
          "shortage_reason": {
            "type": "string",
            "title": "Shortage Reason"
          },
          "related_information": {
            "type": "string",
            "title": "Related Information"
          },
          "estimated_recovery": {
            "$ref": "#/$defs/ShortageDateWindow"
          },
          "next_delivery": {
            "$ref": "#/$defs/ShortageDateWindow"
          },
          "allocation": {
            "type": "string",
            "title": "Allocation"
          },
          "discontinuation": {
            "$ref": "#/$defs/ShortageDiscontinuation"
          },
          "resolved_note": {
            "type": "string",
            "title": "Resolved Note"
          },
          "update_type": {
            "type": "string",
            "title": "Update Type"
          },
          "first_posted_date": {
            "type": "string",
            "title": "First Posted Date"
          },
          "updated_date": {
            "type": "string",
            "title": "Updated Date"
          },
          "therapeutic_categories": {
            "items": {
              "type": "string"
            },
            "title": "Therapeutic Categories",
            "type": "array"
          },
          "contact_information": {
            "type": "string",
            "title": "Contact Information"
          }
        },
        "required": [
          "company",
          "generic_name",
          "national_shortage_status",
          "presentation",
          "shortage_id"
        ],
        "title": "WirePublicDrugShortagePresentation",
        "type": "object"
      },
      "WireSafetyEventChange": {
        "additionalProperties": false,
        "properties": {
          "family": {
            "enum": [
              "recalls",
              "shortages"
            ],
            "title": "Family",
            "type": "string"
          },
          "event": {
            "enum": [
              "changed",
              "gap",
              "new",
              "removed"
            ],
            "title": "Event",
            "type": "string"
          },
          "event_id": {
            "title": "Event Id",
            "type": "string"
          },
          "record_id": {
            "type": "string",
            "title": "Record Id"
          },
          "first_seen_at": {
            "title": "First Seen At",
            "type": "string"
          },
          "source_as_of": {
            "type": "string",
            "title": "Source As Of"
          },
          "changes": {
            "items": {
              "$ref": "#/$defs/FieldChange"
            },
            "type": "array",
            "title": "Changes"
          },
          "recall": {
            "$ref": "#/$defs/RecallChange"
          },
          "shortage": {
            "$ref": "#/$defs/WirePublicDrugShortagePresentation"
          },
          "gap": {
            "$ref": "#/$defs/ChangeGap"
          }
        },
        "required": [
          "event",
          "event_id",
          "family",
          "first_seen_at"
        ],
        "title": "WireSafetyEventChange",
        "type": "object"
      }
    },
    "additionalProperties": false,
    "properties": {
      "families": {
        "items": {
          "$ref": "#/$defs/ChangeFamily"
        },
        "title": "Families",
        "type": "array"
      },
      "changes": {
        "items": {
          "$ref": "#/$defs/WireSafetyEventChange"
        },
        "title": "Changes",
        "type": "array"
      }
    },
    "required": [
      "changes",
      "families"
    ],
    "title": "WireSafetyEventChanges",
    "type": "object"
  }
}
