<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:iszi="http://nczisk.sk/iszi">
  <!--Ciselniky-->
  <xs:simpleType name="enum_CISV_TYP_ZDR_PRODUKT">
    <xs:restriction base="xs:string">
      <xs:enumeration value="DP">
        <xs:annotation>
          <xs:documentation>Dietetické potraviny</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="L">
        <xs:annotation>
          <xs:documentation>Lieky</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="ZP">
        <xs:annotation>
          <xs:documentation>Zdravotnícke pomôcky</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="enum_CIS_ANO_NIE_NEZ_CISV_VYKAZY_HLAS_L02_DIM_VYK_HL_ANO_NIE">
    <xs:restriction base="xs:string">
      <xs:enumeration value="1">
        <xs:annotation>
          <xs:documentation>áno</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
      <xs:enumeration value="2">
        <xs:annotation>
          <xs:documentation>nie</xs:documentation>
        </xs:annotation>
      </xs:enumeration>
    </xs:restriction>
  </xs:simpleType>
  <!--Datove prvky-->
  <xs:simpleType name="CISV_TYP_ZDR_PRODUKT">
    <xs:annotation>
      <xs:documentation>Typ zdravotníckeho produktu</xs:documentation>
    </xs:annotation>
    <xs:restriction base="enum_CISV_TYP_ZDR_PRODUKT"/>
  </xs:simpleType>
  <xs:simpleType name="CIS_ANO_NIE_NEZ_CISV_VYKAZY_HLAS_L02_DIM_VYK_HL_ANO_NIE">
    <xs:annotation>
      <xs:documentation>Dátový typ s hodnotami Áno/Nie/Neznámy</xs:documentation>
    </xs:annotation>
    <xs:restriction base="enum_CIS_ANO_NIE_NEZ_CISV_VYKAZY_HLAS_L02_DIM_VYK_HL_ANO_NIE"/>
  </xs:simpleType>
  <xs:simpleType name="EMAIL">
    <xs:annotation>
      <xs:documentation>E-mail</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:maxLength value="128"/>
      <xs:pattern value="^((([^&lt;&gt;()\[\]\\.,;:\s@\u0022\u00c0-ž]+(\.[^&lt;&gt;()\[\]\\.,;:\s@\u0022\u00c0-ž]+)*)|(\u0022.+\u0022))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,})))(,(([^&lt;&gt;()\[\]\\.,;:\s@\u0022\u00c0-ž]+(\.[^&lt;&gt;()\[\]\\.,;:\s@\u0022\u00c0-ž]+)*)|(\u0022.+\u0022))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,})))*$"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ICO">
    <xs:annotation>
      <xs:documentation>IČO</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:minLength value="8"/>
      <xs:maxLength value="8"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="MESIAC_SPRAC">
    <xs:annotation>
      <xs:documentation>Mesiac spracovania</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:maxLength value="2"/>
      <xs:pattern value="0[1-9]|1[012]"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="MNOZSTVO_DES">
    <xs:annotation>
      <xs:documentation>Množstvo - desatinné číslo</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:decimal">
      <xs:fractionDigits value="3"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="NAZOV">
    <xs:annotation>
      <xs:documentation>Obchodné meno</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:maxLength value="150"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="POZNAMKA">
    <xs:annotation>
      <xs:documentation>Poznámka</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:maxLength value="256"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="POZNAMKA_KR">
    <xs:annotation>
      <xs:documentation>Poznámka na 50 znakov</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:maxLength value="50"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="PRIEZVISKO">
    <xs:annotation>
      <xs:documentation>Priezvisko</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:maxLength value="100"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="PRODUKT">
    <xs:annotation>
      <xs:documentation>Produkt </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:minLength value="5"/>
      <xs:maxLength value="6"/>
      <xs:pattern value="[A-Z][A-Z0-9]{4,5}"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ROK">
    <xs:annotation>
      <xs:documentation>Rok</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:maxLength value="4"/>
      <xs:pattern value="(19|20|99)\d\d"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ROK_SPRAC">
    <xs:annotation>
      <xs:documentation>Rok spracovania</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:maxLength value="4"/>
      <xs:pattern value="2021"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="TEL">
    <xs:annotation>
      <xs:documentation>Telefónne číslo</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:maxLength value="35"/>
      <xs:pattern value="[0-9.+\-/, ]*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="UHRADA">
    <xs:annotation>
      <xs:documentation>Úhrada</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:decimal">
      <xs:fractionDigits value="2"/>
    </xs:restriction>
  </xs:simpleType>
  <!--Riadky otvorenych modulov-->
  <xs:complexType name="OL02_4401">
    <xs:sequence>
      <xs:element name="KOD_PRODUKT" type="PRODUKT">
        <xs:annotation>
          <xs:documentation>Kód produktu</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="MNOZSTVO" type="MNOZSTVO_DES">
        <xs:annotation>
          <xs:documentation>Množstvo lieku v baleniach</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="UHRADA_ZP" type="UHRADA">
        <xs:annotation>
          <xs:documentation>Úhrada poisťovne za uvedené množstvo produktu</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="DOPLATOK_PAC" type="UHRADA">
        <xs:annotation>
          <xs:documentation>Doplatok pacientov </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="SP_OBSTAR_PROD_CENTR" type="CIS_ANO_NIE_NEZ_CISV_VYKAZY_HLAS_L02_DIM_VYK_HL_ANO_NIE">
        <xs:annotation>
          <xs:documentation>Centrálny spôsob obstarania produktu </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="DOHODA_UHRADA" type="CIS_ANO_NIE_NEZ_CISV_VYKAZY_HLAS_L02_DIM_VYK_HL_ANO_NIE">
        <xs:annotation>
          <xs:documentation>Dohoda o úhrade </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="VYNIMKA" type="CIS_ANO_NIE_NEZ_CISV_VYKAZY_HLAS_L02_DIM_VYK_HL_ANO_NIE">
        <xs:annotation>
          <xs:documentation>Výnimka</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="OL02_4402">
    <xs:sequence>
      <xs:element name="KOD_PRODUKT_2" type="PRODUKT">
        <xs:annotation>
          <xs:documentation>Kód produktu_2</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ROK" type="ROK">
        <xs:annotation>
          <xs:documentation>Rok vyrovnávajúceho doplatku</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ROZDIEL_VYROVNAV" type="UHRADA" minOccurs="0" nillable="true">
        <xs:annotation>
          <xs:documentation>Suma vyrovnacieho rozdielu</xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <!--Vykaz ako sekvencia elementov a otvorenych modulov-->
  <xs:complexType name="L02">
    <xs:sequence>
      <!--Elementy vykazu mimo otvorenych modulov-->
      <xs:element name="ROK_SPRAC" type="ROK_SPRAC" id="ID1">
        <xs:annotation>
          <xs:documentation>Rok spracovania</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="MESIAC_SPRAC" type="MESIAC_SPRAC" id="ID2">
        <xs:annotation>
          <xs:documentation>Mesiac spracovania</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="ICO" type="ICO" id="ID3">
        <xs:annotation>
          <xs:documentation>Identifikačné číslo organizácie</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="NAZPOIST" type="NAZOV">
        <xs:annotation>
          <xs:documentation>Názov poisťovne</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="PRIEZVISKO_ZOST" type="PRIEZVISKO" minOccurs="0" nillable="true">
        <xs:annotation>
          <xs:documentation>Priezvisko zostavovateľa výkazu</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TEL" type="TEL" minOccurs="0" nillable="true">
        <xs:annotation>
          <xs:documentation>Telefónne číslo zostavovateľa (vrátane klapky)</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="EMAIL" type="EMAIL" minOccurs="0" nillable="true">
        <xs:annotation>
          <xs:documentation>e-mail zostavovateľa</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="POZNAMKA" type="POZNAMKA" minOccurs="0" nillable="true">
        <xs:annotation>
          <xs:documentation>Poznámka</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="AUTOR_XML" type="POZNAMKA_KR" minOccurs="0" nillable="true">
        <xs:annotation>
          <xs:documentation>Autor xml</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="PRODUKT" type="CISV_TYP_ZDR_PRODUKT">
        <xs:annotation>
          <xs:documentation>Typ produktu</xs:documentation>
        </xs:annotation>
      </xs:element>
      <!--Otvorene moduly vykazu-->
      <xs:element name="OM_OL02_4401" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="OL02_4401" type="OL02_4401"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="OM_OL02_4402" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="unbounded" name="OL02_4402" type="OL02_4402"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <!--Korenovy element vykazy ako sekvencia vykazov-->
  <xs:element name="vykazy">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="vykaz" minOccurs="1" maxOccurs="unbounded" type="L02"/>
      </xs:sequence>
      <xs:attribute name="identifikatorZberu" type="xs:string" use="required" fixed="L02-2021"/>
    </xs:complexType>
  </xs:element>
</xs:schema>