{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pillwise-dev/json-schema/pillwise-dev-cabinet-item-write-schema.json",
  "title": "CabinetItemWrite",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pillwise-dev-openapi.json#/components/schemas/CabinetItemWrite",
  "type": "object",
  "required": [
    "answers"
  ],
  "properties": {
    "answers": {
      "type": "object",
      "required": [
        "confirmed_name"
      ],
      "properties": {
        "confirmed_name": {
          "type": "string"
        },
        "form": {
          "type": "string"
        },
        "strength": {
          "type": "string"
        },
        "strength_unit": {
          "type": "string"
        },
        "route": {
          "type": "string"
        },
        "frequency": {
          "type": "string"
        },
        "prn": {
          "type": "boolean"
        },
        "quantity": {
          "type": "string"
        },
        "days_supply": {
          "type": "integer"
        },
        "start_on": {
          "type": "string",
          "format": "date"
        },
        "end_on": {
          "type": "string",
          "format": "date"
        },
        "instructions": {
          "type": "string"
        },
        "entered_by": {
          "type": "string",
          "enum": [
            "self",
            "caregiver",
            "clinician",
            "claim",
            "barcode"
          ]
        }
      }
    },
    "codes": {
      "type": "object",
      "properties": {
        "rxcui": {
          "type": "string"
        },
        "rxcui_ingredient": {
          "type": "string"
        },
        "ndc11": {
          "type": "string"
        },
        "ndc_basis": {
          "type": "string",
          "enum": [
            "asserted",
            "representative"
          ]
        },
        "ndc_candidates": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "ndc11": {
                "type": "string"
              },
              "ndc_display": {
                "type": "string"
              },
              "description": {
                "type": "string"
              }
            }
          }
        },
        "ndc_fda": {
          "type": "string"
        },
        "ndc_display": {
          "type": "string"
        },
        "unii": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "spl_set_id": {
          "type": "string"
        },
        "application_number": {
          "type": "string"
        },
        "te_code": {
          "type": "string"
        },
        "pillwise_id": {
          "type": "string"
        }
      }
    },
    "resolved": {
      "type": "object",
      "properties": {
        "pick_level": {
          "type": "string"
        },
        "search_hit_id": {
          "type": "string"
        },
        "confidence": {
          "type": "string"
        },
        "jurisdiction": {
          "type": "string"
        }
      }
    }
  }
}