<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="http://ivis.eps.gov.lv/XMLSchemas/100010/PopulationRegister/v1-0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:pers="http://ivis.eps.gov.lv/XMLSchemas/100001/Person/v1-0" xmlns:pr="http://ivis.eps.gov.lv/XMLSchemas/100010/PopulationRegister/v1-0" xmlns:ivis="http://ivis.eps.gov.lv/XMLSchemas/100001/IVIS/v1-0" targetNamespace="http://ivis.eps.gov.lv/XMLSchemas/100010/PopulationRegister/v1-0" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0" id="IRDocument.xsd">
    <xs:annotation>
        <xs:appinfo>
            <ivis:Metadata xmlns:pers="http://ivis.eps.gov.lv/XMLSchemas/100001/Person/v1-0" xmlns:ivis="http://ivis.eps.gov.lv/XMLSchemas/100001/IVIS/v1-0">
                <ivis:Contributor Href="http://www.rixtech.lv" CodeListCodeValue="100002">A/S "RIX Technologies"</ivis:Contributor>
                <ivis:Creator CodeListID="Authority" CodeListAgencyID="100001" CodeListAgencyName="VRAA" CodeListLanguageID="lv" CodeListCodeValue="100010">Pilsonības un migrācijas lietu pārvalde</ivis:Creator>
                <ivis:Date>
                    <ivis:Created>2011-05-26</ivis:Created>
                    <ivis:Modified>2011-05-26</ivis:Modified>
                </ivis:Date>
                <ivis:Description>
                    <ivis:Default>Shēma Personas iesnieguma lietvedības datu nodošanai Iedzīvotāju reģistram</ivis:Default>
                </ivis:Description>
                <ivis:Format>
                    <ivis:Default>text/xml</ivis:Default>
                </ivis:Format>
                <ivis:Identifier Scheme="URN">URN:IVIS:100001:XSD-PopulationRegister-IRDocument-v1-0</ivis:Identifier>
                <ivis:Language>LV</ivis:Language>
                <ivis:Relation />
                <ivis:Status>
                    <ivis:Default>CANDIDATE</ivis:Default>
                    <ivis:Version>v1.0</ivis:Version>
                </ivis:Status>
                <ivis:Subject>
                    <ivis:Category CodeListID="XMLSchemaType" CodeListAgencyID="100001" CodeListAgencyName="VRAA" CodeListLanguageID="lv" CodeListCodeValue="2">E-pakalpojumu XML shēma</ivis:Category>
                    <ivis:Project>PopulationRegister</ivis:Project>
                </ivis:Subject>
                <ivis:Title>
                    <ivis:Default>Personas iesnieguma lietvedības dati Iedzīvotāju reģistram</ivis:Default>
                </ivis:Title>
            </ivis:Metadata>
        </xs:appinfo>
    </xs:annotation>
    <xs:include schemaLocation="http://ivis.eps.gov.lv/XMLSchemas/100010/PopulationRegister/v1-0/LegalRepresentation.xsd" />
    <xs:import namespace="http://ivis.eps.gov.lv/XMLSchemas/100001/Person/v1-0" schemaLocation="http://ivis.eps.gov.lv/XMLSchemas/100001/Person/v1-0/Person.xsd" />
    <xs:import namespace="http://ivis.eps.gov.lv/XMLSchemas/100001/IVIS/v1-0" schemaLocation="http://ivis.eps.gov.lv/XMLSchemas/100001/IVIS/v1-0/Attachment.xsd" />
    <xs:import namespace="http://ivis.eps.gov.lv/XMLSchemas/100001/IVIS/v1-0" schemaLocation="http://ivis.eps.gov.lv/XMLSchemas/100001/IVIS/v1-0/Identification.xsd" />
    <!--Shēma Personas iesnieguma lietvedības datu nodošanai Iedzīvotāju reģistram-->
    <xs:complexType name="IRDocumentStructure">
        <xs:annotation>
            <xs:documentation xml:lang="lv">Iedzīvotāju reģistrim nosūtāmā datu struktūra</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="UpdateEventCode">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Notikuma veida kods</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="xs:string">
                            <xs:attributeGroup ref="ivis:CodeListDescriptionGroup" />
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
            <xs:element name="UpdateReasonCode">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Aktualizēšanas iemesla kods</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="xs:string">
                            <xs:attributeGroup ref="ivis:CodeListDescriptionGroup" />
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
            <xs:element name="PersonCode" type="pers:PersonCodeType">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Personas, kurai tiek aktualizētas ziņas, personas kods</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="ServiceInstanceID" type="ivis:URNType">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Ārējās sistēmas instances identifikators</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="Declarant" type="DeclarantStructure">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Personas, kurai tiek aktualizētas ziņas</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="RegistrationDate" type="xs:date" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Notikuma aktualizēšanas datums IR</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="IncomingDocument" type="IncomingDocumentStructure" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Dati par saņemto lietvedības dokumentu</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="AdditionalData" type="AdditionalDataStructure" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Deklarācijas papilddati</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="Attachment" type="ivis:AttachmentStructure" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Iesniegtā datne</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:element name="IRDocument" type="IRDocumentStructure">
        <xs:annotation>
            <xs:documentation xml:lang="lv">Iedzīvotāju reģistrim nosūtāmais dokuments</xs:documentation>
        </xs:annotation>
    </xs:element>
    <xs:complexType name="IncomingDocumentStructure">
        <xs:annotation>
            <xs:documentation xml:lang="lv">Saņemtā lietvedības dokumneta struktūra</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="SubmissionPlace" type="SubmissionPlaceStructure">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Dati par lietvedības dokumenta iesniegšanas vietu</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="Submitter" type="SubmitterStructure">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Dati par lietvedības dokumenta iesniedzēju</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="RegistrationDate" type="xs:date" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Reģistrāciajs datums</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="RegistrationNumberIndex" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Reģistrācijas numura indekss</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="RegistrationNumber" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Reģistrācijas numurs</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="DepartmentCode" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Reģistrācijas nodaļas kods</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="DepartmentName" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Reģistrācijas nodaļas nosaukums</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="Notes" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Piezīmes par lietvedības dokumentu</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="SubmissionPlaceStructure">
        <xs:annotation>
            <xs:documentation xml:lang="lv">Iesniegšanas vietas datu struktūra</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="PlaceCode" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Iesniegšanas vietas kods</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="xs:string">
                            <xs:attributeGroup ref="ivis:CodeListDescriptionGroup" />
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
            <xs:element name="PlaceName" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Iesniegšanas vieta nosaukums</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="DepartmentCode" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Iesniegšanas iestādes kods</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="xs:string">
                            <xs:attributeGroup ref="ivis:CodeListDescriptionGroup" />
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
            <xs:element name="DepartmentName" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Iesniegšanas iestādes nosaukums</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="CoveringLetterDate" type="xs:date" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Pavadvēstules datums</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="CoveringLetterRegNumber" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Pavadvēstules reģistrācijas numurs</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="SubmitterStructure">
        <xs:annotation>
            <xs:documentation xml:lang="lv">Iesniedzēja/nosūtītāja datu struktūra</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="SubmitterTypeCode" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Iesniedzēja veida kods</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                    <xs:simpleContent>
                        <xs:extension base="xs:string">
                            <xs:attributeGroup ref="ivis:CodeListDescriptionGroup" />
                        </xs:extension>
                    </xs:simpleContent>
                </xs:complexType>
            </xs:element>
            <xs:element name="SubmitterTypeName" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Iesniedzēja veida nosaukums</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="PersonCode" type="pers:PersonCodeType" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Iesniedzēja personas kods</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="Name" type="pers:PersonFullNameStructure" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Iesniedzēja pilns vārds</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="SubmissionDate" type="xs:date">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Iesniedzēja dokumenta datums</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="AdditionalDataStructure">
        <xs:annotation>
            <xs:documentation xml:lang="lv">Ienieguma papilddatu struktūra</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="LegalBasis" type="LegalBasisStructure" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Tiesiskais pamats</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="RepresentationCode" type="LegalRepresentationKindType" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Pārstāvības veids</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="RepresentationName" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Pārstāvības nosaukums</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="LegalBasisStructure">
        <xs:annotation>
            <xs:documentation xml:lang="lv">Tiesiskā pamata dzīvesvietas deklarācijai dotajā adresē struktūra</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="Code" type="LegalBasisCodeType">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Tiesiskā pamata kods</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="Name" type="xs:string">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Tiesiskais pamata nosaukums</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="Details" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Papildus informācija par norādīto tiesisko pamatu </xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    <xs:simpleType name="LegalBasisCodeType">
        <xs:annotation>
            <xs:documentation xml:lang="lv">Tiesiskais pamatojums, viens no: IT(Īpašuma tiesības), LTIL(Lietošanas tiesības, kuru iegūšanas pamats ir īres līgums), LTNL(Lietošanas tiesības, kuru iegūšanas pamats ir nomas līgums), LTL(Lietošanas tiesības, kuru iegūšanas pamats ir laulības), LTR(Lietošanas tiesības, kuru iegūšanas pamats ir radniecība), LTVI(Lietošanas tiesības, kuru iegūšanas pamats ir vienošanās ar īpašnieku),  LTCITP(Lietošanas tiesības, kurām ir cits iegūšanas tiesiskais pamats)</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:pattern value="IT" />
            <xs:pattern value="LTIL" />
            <xs:pattern value="LTNL" />
            <xs:pattern value="LTL" />
            <xs:pattern value="LTR" />
            <xs:pattern value="LTVI" />
            <xs:pattern value="LTCITP" />
        </xs:restriction>
    </xs:simpleType>
    <xs:complexType name="DeclarantStructure">
        <xs:annotation>
            <xs:documentation xml:lang="lv">Dati par deklarējamo personu</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element name="PersonCode" type="pers:PersonCodeType">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Personas kods personai, kurai tiek aktualizētas ziņas</xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="Name" type="pers:PersonFullNameStructure" minOccurs="0">
                <xs:annotation>
                    <xs:documentation xml:lang="lv">Personaspilns vārds, kurai tiek aktualizētas ziņas</xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
</xs:schema>