{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pillwise-dev/json-schema/pillwise-dev-form-options-schema.json",
  "title": "FormOptions",
  "description": "Each choice has a `value` to send back (`?form=`, Cabinet `answers.form` / `answers.strength`) and a `label` to show. Only products on the US market are listed (a package or a current label). Forms come most sold first, with vials, packs and clinic-only forms last; strengths follow their form, then read by amount, and name the forms they come in.",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pillwise-dev-openapi.json#/components/schemas/FormOptions",
  "type": "object",
  "properties": {
    "forms": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FormChoice"
      }
    },
    "strengths": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/StrengthChoice"
      }
    },
    "routes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Choice"
      }
    },
    "packages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "ndc_raw": {
            "type": "string"
          },
          "ndc11": {
            "type": "string"
          },
          "display": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        }
      }
    }
  },
  "$defs": {
    "Choice": {
      "type": "object",
      "required": [
        "value",
        "label"
      ],
      "properties": {
        "value": {
          "type": "string"
        },
        "label": {
          "type": "string"
        }
      }
    },
    "FormChoice": {
      "type": "object",
      "required": [
        "value",
        "label",
        "group",
        "dose_unit"
      ],
      "properties": {
        "value": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "group": {
          "type": "string",
          "description": "What kind of thing it is, for tailoring the next questions.",
          "enum": [
            "tablet",
            "capsule",
            "oral_liquid",
            "oral_other",
            "mouth",
            "skin",
            "eye",
            "ear",
            "nose",
            "inhaled",
            "patch",
            "injection",
            "rectal",
            "vaginal",
            "implant",
            "clinic",
            "pack",
            "other"
          ]
        },
        "dose_unit": {
          "type": "string",
          "description": "What one dose is counted in."
        },
        "route": {
          "type": "string"
        }
      }
    },
    "StrengthChoice": {
      "type": "object",
      "required": [
        "value",
        "label"
      ],
      "properties": {
        "value": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "forms": {
          "type": "array",
          "description": "The form values this strength comes in, so a client holding every form's strengths can narrow them without another call.",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}