<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<!-- COVID19_TYRIMAI xsd byla -->

<xs:element name="COVID19_TYRIMAI">
  <xs:annotation><xs:documentation>COVID19 tyrimų duomenys</xs:documentation></xs:annotation>
  <xs:complexType>
    <xs:sequence>
      <xs:element ref="TYRIMAS" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

<xs:element name="TYRIMAS">
  <xs:annotation><xs:documentation/></xs:annotation>
    <xs:complexType>
      <xs:sequence>
      <xs:element minOccurs="1" maxOccurs="1" ref="CT_ID"/>
      <xs:element minOccurs="1" maxOccurs="1" ref="CT_IRASO_DATA"/>
      <xs:element minOccurs="1" maxOccurs="1" ref="CT_E200_FC_ID"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200ATS_FC_ID"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200_FORMA"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200_ISTG_ESPBI_ID"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200_ISTG_SVEIDRA_ID"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200_ISTAIGA"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200_ISTG_TLK_ID"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200_ISTG_SAV_ID"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200_SAV_PAV"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200_SUKURIMO_DATA"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200_DUOMENU_BUKLE"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200_DOK_PASIRASYMAS"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200ATS_DUOM_SUKURTI"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200ATS_DUOMENU_BUKLE"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200ATS_FORMA"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200ATS_ISTAIGA"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200ATS_DOK_PASIRASYMAS"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_PACIENTO_AMZIUS"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_PACIENTO_AK"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_PACIENTO_VARDAS"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_PACIENTO_PAVARDE"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_PACIENTO_SPI_SVEIDRA_ID"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_PACIENTO_ESI"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_PACIENTO_APSKR_ID"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_PACIENTO_SAV_ID"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_PACIENTO_SAVIVALDYBE"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_PACIENTO_SPI"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_PACIENTO_GYDYTOJO_VARDAS"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_PACIENTO_GYDYTOJO_PAVARDE"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_PACIENTO_GYDYTOJO_SPAUDAS"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200ATS_TYRIMO_METODAS"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200ATS_TYRIMO_REZULTATAS"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_E200ATS_REZULTATAS"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_TYRIMO_TRUKME"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_CTD_TYRIMAS_UZSAKYTAS"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_CTD_EMINYS_PAIMTAS"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_CTD_EMINIO_REG_KODAS"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_CTD_EMINYS_GAUTAS"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_CTD_TYRIMAS_ATLIKTAS"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_SVEIKATOS_SPECIALISTAS"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_EV_KODAS"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_TELEFONO_NR"/>
      <xs:element minOccurs="0" maxOccurs="1" ref="CT_TYRIMO_TIPO_ID"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

<xs:element name="CT_ID" type="xs:long">
  <xs:annotation><xs:documentation>Lentelės įrašų identifikatorius, pirminis raktas</xs:documentation></xs:annotation>
</xs:element>

<xs:element name="CT_IRASO_DATA" type="data_laikas">
  <xs:annotation><xs:documentation>Įrašo sukūrimo šioje lentelėje data</xs:documentation></xs:annotation>
</xs:element>

<xs:element name="CT_E200_FC_ID" type="xs:long">
  <xs:annotation><xs:documentation>E200 duomenų kompozicijos unikalus identifikatorius</xs:documentation></xs:annotation>
</xs:element>

<xs:element name="CT_E200ATS_FC_ID" type="xs:long">
  <xs:annotation><xs:documentation>E200-ats duomenų kompozicijos unikalus identifikatorius</xs:documentation></xs:annotation>
</xs:element>

<xs:element name="CT_E200_FORMA">
  <xs:annotation><xs:documentation>E200 medicininės formos pavadinimas</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="4"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_E200_ISTG_ESPBI_ID" type="xs:string">
  <xs:annotation><xs:documentation>Įstaigos, suformavusios tyrimą (E200), ESPBI identifikatorius (resurso ID)</xs:documentation></xs:annotation>
</xs:element>

<xs:element name="CT_E200_ISTG_SVEIDRA_ID" type="xs:string">
  <xs:annotation><xs:documentation>Įstaigos, suformavusios tyrimą (E200), SVEIDRA identifikatorius</xs:documentation></xs:annotation>
</xs:element>

<xs:element name="CT_E200_ISTAIGA">
  <xs:annotation><xs:documentation>Įstaiga, suformavusi tyrimo (E200) paėmimo duomenis</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="1024"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_E200_ISTG_TLK_ID">
  <xs:annotation><xs:documentation>Įstaigos, suformavusios tyrimą (E200), apskrities identifikatorius</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:int">
      <xs:totalDigits value="5"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_E200_ISTG_SAV_ID">
  <xs:annotation><xs:documentation>Įstaigos, suformavusios tyrimą (E200) savivaldybės identifikatorius (ne iš Adresų registro)</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:int">
      <xs:totalDigits value="10"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_E200_SAV_PAV">
  <xs:annotation><xs:documentation>Įstaigos, suformavusios tyrimą (E200) savivaldybės pavadinimas</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="250"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_E200_SUKURIMO_DATA" type="data_laikas">
  <xs:annotation><xs:documentation>E200 duomenų sukūrimo data ir laikas</xs:documentation></xs:annotation>
</xs:element>

<xs:element name="CT_E200_DUOMENU_BUKLE">
  <xs:annotation><xs:documentation>E200  duomenų įvedimo užbaigtumas</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="30"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_E200_DOK_PASIRASYMAS">
  <xs:annotation><xs:documentation>E200  dokumento pasirašymas. final - suformuotas, bet nepasirašytas, signed - suformuotas ir pasirašytas</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="30"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_E200ATS_DUOM_SUKURTI" type="data_laikas">
  <xs:annotation><xs:documentation>E200-ats duomenų sukūrimo data ir laikas</xs:documentation></xs:annotation>
</xs:element>

<xs:element name="CT_E200ATS_DUOMENU_BUKLE">
  <xs:annotation><xs:documentation>E200-ats  duomenų įvedimo užbaigtumas</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="30"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_E200ATS_FORMA">
  <xs:annotation><xs:documentation>E200-ats medicininės formos pavadinimas</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="8"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_E200ATS_ISTAIGA">
  <xs:annotation><xs:documentation>Įstaiga, suformavusi tyrimo (E200-ats) atsakymo duomenis</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="1024"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_E200ATS_DOK_PASIRASYMAS">
  <xs:annotation><xs:documentation>E200-ats dokumento pasirašymas. final - suformuotas, bet nepasirašytas, signed -  suformuotas ir pasirašytas</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="30"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_PACIENTO_AMZIUS">
  <xs:annotation><xs:documentation>Neredaguojamas laukas. Išskaičiuojamas dinamiškai</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:int">
      <xs:totalDigits value="5"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_PACIENTO_AK">
  <xs:annotation><xs:documentation>Paciento asmens kodas</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="30"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_PACIENTO_VARDAS">
  <xs:annotation><xs:documentation>Paciento vardas</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="93"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_PACIENTO_PAVARDE">
  <xs:annotation><xs:documentation>Paciento pavardė</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="93"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_PACIENTO_SPI_SVEIDRA_ID">
  <xs:annotation><xs:documentation>Paciento prisirašymo įstaigos SVEIDRA identifikatorius</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:int">
      <xs:totalDigits value="10"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_PACIENTO_ESI">
  <xs:annotation><xs:documentation>Paciento ESI numeris</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string"><xs:maxLength value="1024"/></xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_PACIENTO_APSKR_ID">
  <xs:annotation><xs:documentation>Paciento prisirašymo įstaigos apskrities identifikatorius</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:int">
      <xs:totalDigits value="5"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_PACIENTO_SAV_ID">
  <xs:annotation><xs:documentation>Paciento prisirašymo įstaigos savivaldybės identifikatorius (ne iš Adresų registro)</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:int">
      <xs:totalDigits value="10"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_PACIENTO_SAVIVALDYBE">
  <xs:annotation><xs:documentation>Paciento prisirašymo įstaigos savivaldybės pavadinimas</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="250"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_PACIENTO_SPI">
  <xs:annotation><xs:documentation>Paciento prisirašymo įstaigos pavadinimas</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="300"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_PACIENTO_GYDYTOJO_VARDAS">
  <xs:annotation><xs:documentation>Paciento prisirašymo įstaigoje šeimos gydytojo vardas</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="45"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_PACIENTO_GYDYTOJO_PAVARDE">
  <xs:annotation><xs:documentation>Paciento prisirašymo įstaigoje šeimos gydytojo pavardė</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="45"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_PACIENTO_GYDYTOJO_SPAUDAS">
  <xs:annotation><xs:documentation>Paciento prisirašymo įstaigoje šeimos gydytojo spaudo numeris</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="12"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_E200ATS_TYRIMO_METODAS">
  <xs:annotation><xs:documentation>Laboratorijos naudoto metodo tyrimui pavadinimas</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="200"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_E200ATS_TYRIMO_REZULTATAS">
  <xs:annotation><xs:documentation>Laboratorijos tyrimo rezultato duomuo E200-ats dokumente</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="1000"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_E200ATS_REZULTATAS">
  <xs:annotation><xs:documentation>Neredaguojamas laukas. Jame priklausomai nuo reikšmės lauke CT_E200ATS_TYRIMO_REZULTATAS rodomas 0 jei tyrimo rezultatas neigiamas, 1 - jei teigiamas</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:int">
      <xs:totalDigits value="2"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_TYRIMO_TRUKME" type="xs:decimal">
  <xs:annotation><xs:documentation>Tyrimo trukmė valandomis, skaičiuojama tarp E200 ir E200-ats duomenų įvedimo datų</xs:documentation></xs:annotation>
</xs:element>

<xs:element name="CT_CTD_TYRIMAS_UZSAKYTAS" type="data_laikas">
  <xs:annotation><xs:documentation>Tyrimo užsakymo data</xs:documentation></xs:annotation>
</xs:element>

<xs:element name="CT_CTD_EMINYS_PAIMTAS" type="data_laikas">
  <xs:annotation><xs:documentation>Ėminio paėmimo data</xs:documentation></xs:annotation>
</xs:element>

<xs:element name="CT_CTD_EMINIO_REG_KODAS">
  <xs:annotation><xs:documentation>Ėminio registravimo kodas</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="1024"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_CTD_EMINYS_GAUTAS" type="data_laikas">
  <xs:annotation><xs:documentation>Ėminio gavimo data</xs:documentation></xs:annotation>
</xs:element>

<xs:element name="CT_CTD_TYRIMAS_ATLIKTAS" type="data_laikas">
  <xs:annotation><xs:documentation>Tyrimo atlikimo data</xs:documentation></xs:annotation>
</xs:element>

<xs:element name="CT_SVEIKATOS_SPECIALISTAS" type="xs:int">
  <xs:annotation><xs:documentation>Požymis ar asmuo yra sveikatos specialistas</xs:documentation></xs:annotation>
</xs:element>

<xs:element name="CT_EV_KODAS">
  <xs:annotation><xs:documentation>Paciento darboviečių ekonominės veiklos kodai</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="2000"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_TELEFONO_NR">
  <xs:annotation><xs:documentation>Paciento telefono numeris(-ai)</xs:documentation></xs:annotation>
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:maxLength value="2000"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

<xs:element name="CT_TYRIMO_TIPO_ID" type="xs:long">
  <xs:annotation><xs:documentation>Tyrimo tipo identifikatorius</xs:documentation></xs:annotation>
</xs:element>


<xs:simpleType name="data_laikas">
  <xs:annotation><xs:documentation>Data ir laikas</xs:documentation></xs:annotation>
  <xs:restriction base="xs:string">
    <xs:pattern value="\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}"/>
  </xs:restriction>
</xs:simpleType>


</xs:schema>
