{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "DrugCostsByActiveSubstanceData",
  "type": "object",
  "description": "Obiekt reprezentujący szczegóły kosztów leków w programach lekowych w podziale na substancje czynne",
  "additionalProperties": false,
  "properties": {
    "sums": {
      "description": "Obiekt podsumowania",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/definitions/Sums"
        }
      ]
    },
    "data": {
      "type": [
        "array",
        "null"
      ],
      "description": "Lista substancji czynnych stosowanych w programach lekowych",
      "items": {
        "$ref": "#/definitions/DrugCostsByActiveSubstance"
      }
    }
  },
  "definitions": {
    "Sums": {
      "type": "object",
      "description": "Obiekt reprezentujący podsumowanie poszczególnych wartości",
      "additionalProperties": false,
      "properties": {
        "refund": {
          "type": "number",
          "description": "Suma kosztów refundacji programów lekowych",
          "format": "decimal"
        }
      }
    },
    "DrugCostsByActiveSubstance": {
      "type": "object",
      "description": "Koszty leków w podziale na substancje czynną\nSchema: https://api.nfz.gov.pl/app-itl-api-pl/schema/drug-costs-by-active-substance",
      "additionalProperties": false,
      "properties": {
        "active-substance-code": {
          "type": [
            "null",
            "string"
          ],
          "description": "Kod substancji czynnej"
        },
        "active-substance-name": {
          "type": [
            "null",
            "string"
          ],
          "description": "Nazwa substancji czynnej"
        },
        "number-of-patients": {
          "type": "integer",
          "description": "Liczba pacjentów",
          "format": "int32"
        },
        "refund": {
          "type": "number",
          "description": "Refundacja NFZ",
          "format": "decimal"
        }
      }
    }
  }
}