{
  "id": "PILL-SEARCH",
  "title": "Identify pills by imprint and appearance",
  "shortTitle": "Identify pills",
  "method": "POST",
  "path": "/v1/pills/search",
  "queryPath": null,
  "group": "drugs",
  "unsupportedFields": [],
  "availability": "preview",
  "request": {
    "additionalProperties": false,
    "properties": {
      "imprint": {
        "maxLength": 200,
        "minLength": 1,
        "title": "Imprint",
        "type": "string"
      },
      "colors": {
        "items": {
          "type": "string"
        },
        "maxItems": 3,
        "title": "Colors",
        "type": "array"
      },
      "shape": {
        "maxLength": 60,
        "minLength": 1,
        "type": "string",
        "title": "Shape"
      },
      "dosage_form": {
        "maxLength": 60,
        "minLength": 1,
        "type": "string",
        "title": "Dosage Form"
      },
      "scored": {
        "type": "boolean",
        "title": "Scored"
      },
      "limit": {
        "default": 20,
        "maximum": 100,
        "minimum": 1,
        "title": "Limit",
        "type": "integer"
      },
      "cursor": {
        "maxLength": 4096,
        "type": "string",
        "title": "Cursor"
      }
    },
    "required": [
      "imprint"
    ],
    "title": "PillSearchRequest",
    "type": "object"
  },
  "response": {
    "$defs": {
      "PillCompany": {
        "additionalProperties": false,
        "properties": {
          "name": {
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "role": {
            "enum": [
              "imprint_brand",
              "labeler",
              "manufacturer"
            ],
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "name",
          "role"
        ],
        "title": "PillCompany",
        "type": "object"
      },
      "PillLabel": {
        "additionalProperties": false,
        "properties": {
          "set_id": {
            "minLength": 1,
            "title": "Set Id",
            "type": "string"
          },
          "labeler": {
            "type": "string",
            "title": "Labeler"
          },
          "dailymed_url": {
            "title": "Dailymed Url",
            "type": "string"
          },
          "discontinued": {
            "type": "boolean",
            "title": "Discontinued"
          },
          "product_ndcs": {
            "items": {
              "type": "string"
            },
            "title": "Product Ndcs",
            "type": "array"
          },
          "rxnorm": {
            "$ref": "#/$defs/RxNormConcept"
          }
        },
        "required": [
          "dailymed_url",
          "product_ndcs",
          "set_id"
        ],
        "title": "PillLabel",
        "type": "object"
      },
      "PillMatch": {
        "additionalProperties": false,
        "properties": {
          "drug": {
            "minLength": 1,
            "title": "Drug",
            "type": "string"
          },
          "strength": {
            "type": "string",
            "title": "Strength"
          },
          "dosage_form": {
            "type": "string",
            "title": "Dosage Form"
          },
          "imprint": {
            "title": "Imprint",
            "type": "string"
          },
          "colors": {
            "items": {
              "type": "string"
            },
            "title": "Colors",
            "type": "array"
          },
          "shape": {
            "type": "string",
            "title": "Shape"
          },
          "scored": {
            "type": "boolean",
            "title": "Scored"
          },
          "discontinued": {
            "type": "boolean",
            "title": "Discontinued"
          },
          "companies": {
            "items": {
              "$ref": "#/$defs/PillCompany"
            },
            "title": "Companies",
            "type": "array"
          },
          "labels": {
            "items": {
              "$ref": "#/$defs/PillLabel"
            },
            "title": "Labels",
            "type": "array"
          }
        },
        "required": [
          "colors",
          "companies",
          "drug",
          "imprint",
          "labels"
        ],
        "title": "PillMatch",
        "type": "object"
      },
      "RxNormConcept": {
        "additionalProperties": false,
        "properties": {
          "rxcui": {
            "pattern": "^[1-9][0-9]{0,15}$",
            "title": "Rxcui",
            "type": "string"
          },
          "concept_type": {
            "title": "Concept Type",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "concept_type",
          "name",
          "rxcui"
        ],
        "title": "RxNormConcept",
        "type": "object"
      }
    },
    "items": {
      "$ref": "#/$defs/PillMatch"
    },
    "type": "array"
  }
}
