{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/elation-health/main/json-schema/elation-health-reference-medication-schema.json",
  "title": "ReferenceMedication",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elation-health-reference-medication-beta-api-openapi.yml#/components/schemas/ReferenceMedication",
  "properties": {
    "active_ndcs": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "brand_name": {
      "readOnly": true,
      "type": "string"
    },
    "created_date": {
      "format": "date-time",
      "readOnly": true,
      "type": [
        "string",
        "null"
      ]
    },
    "creation_type": {
      "allOf": [
        {
          "$ref": "#/$defs/MedicationDrugType"
        }
      ],
      "default": "user",
      "readOnly": true
    },
    "form": {
      "readOnly": true,
      "type": "string"
    },
    "generic_name": {
      "readOnly": true,
      "type": "string"
    },
    "id": {
      "description": "The id of the medication.",
      "format": "int64",
      "type": "integer"
    },
    "is_controlled": {
      "default": false,
      "description": "Whether the drug is a controlled substance or not.",
      "type": "boolean"
    },
    "market_end_date": {
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "name": {
      "description": "The name that will display for the medication in the search and when referenced by the prescription or documented med.",
      "type": "string"
    },
    "ndcs": {
      "description": "The NDCs of the medication (must contain only one ndc code when creating).",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "obsolete_date": {
      "description": "The date at which this practice medication became obsolete.",
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "practice": {
      "description": "The practice that created the medication. `null` for medications from the standard formulary.",
      "format": "int64",
      "type": "integer"
    },
    "route": {
      "readOnly": true,
      "type": "string"
    },
    "rxnorm_cuis": {
      "description": "The Rxnorm.cui code of the medication (must contain only one cui code when creating).",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "strength": {
      "description": "The strength of the drug, e.g. 40mg.",
      "maxLength": 255,
      "type": [
        "string",
        "null"
      ]
    },
    "type": {
      "allOf": [
        {
          "$ref": "#/$defs/MedicationType"
        }
      ],
      "default": "prescription",
      "description": "Whether the practice medication is an OTC or Prescription drug.\n\n* `otc` - otc\n* `prescription` - prescription\n* `discontinued` - discontinued"
    }
  },
  "type": "object",
  "$defs": {
    "MedicationDrugType": {
      "description": "* `user` - user\n* `medispan` - medispan\n* `ss` - surescripts\n* `disp` - dispensary",
      "enum": [
        "user",
        "medispan",
        "ss",
        "disp"
      ],
      "type": "string"
    },
    "MedicationType": {
      "description": "* `otc` - otc\n* `prescription` - prescription\n* `discontinued` - discontinued",
      "enum": [
        "otc",
        "prescription",
        "discontinued"
      ],
      "type": "string"
    }
  }
}