{
  "id": "SHORTAGE-SEARCH",
  "title": "Search drug shortage presentations",
  "shortTitle": "Search shortages",
  "method": "GET",
  "path": "/v1/shortages/search",
  "queryPath": null,
  "group": "safety",
  "unsupportedFields": [],
  "availability": "preview",
  "request": {
    "additionalProperties": false,
    "properties": {
      "q": {
        "maxLength": 500,
        "minLength": 1,
        "type": "string",
        "title": "Q"
      },
      "shortage_id": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        ],
        "title": "Shortage Id"
      },
      "company": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        ],
        "title": "Company"
      },
      "national_shortage_status": {
        "anyOf": [
          {
            "enum": [
              "all",
              "current",
              "resolved",
              "to_be_discontinued"
            ],
            "type": "string"
          },
          {
            "items": {
              "enum": [
                "all",
                "current",
                "resolved",
                "to_be_discontinued"
              ],
              "type": "string"
            },
            "type": "array"
          }
        ],
        "default": [
          "current",
          "to_be_discontinued"
        ],
        "title": "National Shortage Status"
      },
      "therapeutic_category": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        ],
        "title": "Therapeutic Category"
      },
      "updated_from": {
        "type": "string",
        "title": "Updated From"
      },
      "updated_to": {
        "type": "string",
        "title": "Updated To"
      },
      "package_ndc": {
        "anyOf": [
          {
            "type": "string"
          },
          {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        ],
        "title": "Package Ndc"
      },
      "limit": {
        "default": 20,
        "maximum": 100,
        "minimum": 1,
        "title": "Limit",
        "type": "integer"
      },
      "cursor": {
        "type": "string",
        "title": "Cursor"
      }
    },
    "title": "ShortageSearchRequest",
    "type": "object"
  },
  "response": {
    "$defs": {
      "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"
      },
      "WirePublicShortageSearchHit": {
        "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": "WirePublicShortageSearchHit",
        "type": "object"
      }
    },
    "items": {
      "$ref": "#/$defs/WirePublicShortageSearchHit"
    },
    "type": "array"
  }
}
