{
  "id": "LABEL-SEARCH",
  "title": "Search current labels",
  "shortTitle": "Search labels",
  "method": "GET",
  "path": "/v1/labels/search",
  "queryPath": null,
  "group": "labels",
  "unsupportedFields": [],
  "availability": "preview",
  "request": {
    "additionalProperties": false,
    "properties": {
      "q": {
        "maxLength": 500,
        "minLength": 2,
        "type": "string",
        "title": "Q"
      },
      "match_mode": {
        "default": "auto",
        "enum": [
          "auto",
          "exact",
          "prefix"
        ],
        "title": "Match Mode",
        "type": "string"
      },
      "drug_rxcui": {
        "anyOf": [
          {
            "pattern": "^[1-9][0-9]{0,15}$",
            "type": "string"
          },
          {
            "items": {
              "pattern": "^[1-9][0-9]{0,15}$",
              "type": "string"
            },
            "maxItems": 20,
            "minItems": 1,
            "type": "array"
          }
        ],
        "title": "Drug Rxcui"
      },
      "labeler": {
        "anyOf": [
          {
            "maxLength": 300,
            "minLength": 1,
            "type": "string"
          },
          {
            "items": {
              "maxLength": 300,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 20,
            "minItems": 1,
            "type": "array"
          }
        ],
        "title": "Labeler"
      },
      "document_type": {
        "anyOf": [
          {
            "enum": [
              "allergenic",
              "cellular_therapy",
              "otc",
              "plasma_derivative",
              "prescription",
              "vaccine"
            ],
            "type": "string"
          },
          {
            "items": {
              "enum": [
                "allergenic",
                "cellular_therapy",
                "otc",
                "plasma_derivative",
                "prescription",
                "vaccine"
              ],
              "type": "string"
            },
            "type": "array"
          }
        ],
        "title": "Document Type"
      },
      "hide_repackagers": {
        "default": false,
        "title": "Hide Repackagers",
        "type": "boolean"
      },
      "limit": {
        "default": 20,
        "maximum": 100,
        "minimum": 1,
        "title": "Limit",
        "type": "integer"
      },
      "cursor": {
        "type": "string",
        "title": "Cursor"
      }
    },
    "title": "LabelSearchRequest",
    "type": "object"
  },
  "response": {
    "$defs": {
      "LabelMatchedName": {
        "additionalProperties": false,
        "properties": {
          "field": {
            "enum": [
              "generic_name",
              "ingredient_name",
              "product_name",
              "title"
            ],
            "title": "Field",
            "type": "string"
          },
          "whole": {
            "title": "Whole",
            "type": "boolean"
          },
          "text": {
            "title": "Text",
            "type": "string"
          }
        },
        "required": [
          "field",
          "text",
          "whole"
        ],
        "title": "LabelMatchedName",
        "type": "object"
      },
      "LabelProduct": {
        "additionalProperties": false,
        "properties": {
          "product_ndc": {
            "title": "Product Ndc",
            "type": "string"
          },
          "product_name": {
            "title": "Product Name",
            "type": "string"
          }
        },
        "required": [
          "product_name",
          "product_ndc"
        ],
        "title": "LabelProduct",
        "type": "object"
      },
      "LabelSearchHit": {
        "additionalProperties": false,
        "properties": {
          "set_id": {
            "title": "Set Id",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "document_type": {
            "enum": [
              "allergenic",
              "cellular_therapy",
              "otc",
              "plasma_derivative",
              "prescription",
              "vaccine"
            ],
            "type": "string",
            "title": "Document Type"
          },
          "effective_date": {
            "format": "date",
            "type": "string",
            "title": "Effective Date"
          },
          "labeler": {
            "type": "string",
            "title": "Labeler"
          },
          "repackaged": {
            "type": "boolean",
            "title": "Repackaged"
          },
          "boxed_warning": {
            "title": "Boxed Warning",
            "type": "boolean"
          },
          "products": {
            "items": {
              "$ref": "#/$defs/LabelProduct"
            },
            "title": "Products",
            "type": "array"
          },
          "product_count": {
            "minimum": 0,
            "title": "Product Count",
            "type": "integer"
          },
          "matched_name": {
            "$ref": "#/$defs/LabelMatchedName"
          }
        },
        "required": [
          "boxed_warning",
          "product_count",
          "products",
          "set_id",
          "title",
          "version"
        ],
        "title": "LabelSearchHit",
        "type": "object"
      }
    },
    "items": {
      "$ref": "#/$defs/LabelSearchHit"
    },
    "type": "array"
  }
}
