{
  "id": "CODE-RESOLVE",
  "title": "Resolve a batch of codes",
  "shortTitle": "Resolve codes",
  "method": "POST",
  "path": "/v1/codes/resolve",
  "queryPath": null,
  "group": "identifiers",
  "unsupportedFields": [],
  "availability": "preview",
  "request": {
    "additionalProperties": false,
    "properties": {
      "codes": {
        "items": {
          "maxLength": 512,
          "minLength": 1,
          "type": "string"
        },
        "maxItems": 100,
        "minItems": 1,
        "title": "Codes",
        "type": "array"
      }
    },
    "required": [
      "codes"
    ],
    "title": "CodeResolveRequest",
    "type": "object"
  },
  "response": {
    "$defs": {
      "ClinicalScope": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "enum": [
              "formulation",
              "precise_ingredient",
              "product",
              "route",
              "salt"
            ],
            "title": "Kind",
            "type": "string"
          },
          "value": {
            "title": "Value",
            "type": "string"
          },
          "rxcui": {
            "pattern": "^[1-9][0-9]{0,15}$",
            "type": "string",
            "title": "Rxcui"
          }
        },
        "required": [
          "kind",
          "value"
        ],
        "title": "ClinicalScope",
        "type": "object"
      },
      "CodeDrug": {
        "additionalProperties": false,
        "properties": {
          "rxcui": {
            "pattern": "^[1-9][0-9]{0,15}$",
            "title": "Rxcui",
            "type": "string"
          },
          "preferred_name": {
            "title": "Preferred Name",
            "type": "string"
          }
        },
        "required": [
          "preferred_name",
          "rxcui"
        ],
        "title": "CodeDrug",
        "type": "object"
      },
      "CodeResolution": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          },
          "code_type": {
            "enum": [
              "application",
              "barcode",
              "ndc",
              "rxcui",
              "set_id",
              "unii"
            ],
            "type": "string",
            "title": "Code Type"
          },
          "outcome": {
            "anyOf": [
              {
                "enum": [
                  "ambiguous",
                  "drug",
                  "excipient",
                  "historical",
                  "ingredient_ndc",
                  "ingredient_of",
                  "not_found",
                  "product",
                  "products",
                  "redirected",
                  "rxnorm_ndc",
                  "unresolved",
                  "unsupported"
                ],
                "type": "string"
              },
              {
                "enum": [
                  "unavailable",
                  "unrecognized"
                ],
                "type": "string"
              }
            ],
            "title": "Outcome"
          },
          "reason": {
            "enum": [
              "package_matches_exceed_limit",
              "product_labels_exceed_limit",
              "product_list_exceeds_limit"
            ],
            "type": "string",
            "title": "Reason"
          },
          "product": {
            "$ref": "#/$defs/ProductSummary"
          },
          "package_ndc": {
            "type": "string",
            "title": "Package Ndc"
          },
          "drug": {
            "$ref": "#/$defs/CodeDrug"
          },
          "rxcui": {
            "pattern": "^[1-9][0-9]{0,15}$",
            "type": "string",
            "title": "Rxcui"
          },
          "ingredient_ndc": {
            "$ref": "#/$defs/IngredientNdc"
          },
          "product_ndcs": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Product Ndcs"
          },
          "more_products": {
            "type": "boolean",
            "title": "More Products"
          },
          "candidate_rxcuis": {
            "items": {
              "pattern": "^[1-9][0-9]{0,15}$",
              "type": "string"
            },
            "type": "array",
            "title": "Candidate Rxcuis"
          }
        },
        "required": [
          "code",
          "outcome"
        ],
        "title": "CodeResolution",
        "type": "object"
      },
      "IngredientNdc": {
        "additionalProperties": false,
        "properties": {
          "rxcui": {
            "pattern": "^[1-9][0-9]{0,15}$",
            "title": "Rxcui",
            "type": "string"
          },
          "scope": {
            "items": {
              "$ref": "#/$defs/ClinicalScope"
            },
            "type": "array",
            "title": "Scope"
          },
          "as_of": {
            "format": "date",
            "title": "As Of",
            "type": "string"
          }
        },
        "required": [
          "as_of",
          "rxcui"
        ],
        "title": "IngredientNdc",
        "type": "object"
      },
      "ProductSummary": {
        "additionalProperties": false,
        "properties": {
          "product_ndc": {
            "title": "Product Ndc",
            "type": "string"
          },
          "product_name": {
            "title": "Product Name",
            "type": "string"
          },
          "labeler": {
            "type": "string",
            "title": "Labeler"
          },
          "dosage_form": {
            "type": "string",
            "title": "Dosage Form"
          },
          "listing_status": {
            "enum": [
              "active_listing",
              "ended",
              "future",
              "not_fda_listed",
              "unknown"
            ],
            "title": "Listing Status",
            "type": "string"
          },
          "set_ids": {
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "title": "Set Ids",
            "type": "array"
          }
        },
        "required": [
          "listing_status",
          "product_name",
          "product_ndc",
          "set_ids"
        ],
        "title": "ProductSummary",
        "type": "object"
      }
    },
    "items": {
      "$ref": "#/$defs/CodeResolution"
    },
    "type": "array"
  }
}
