<?xml version="1.0"?>
<schema targetNamespace="http://ws.infotorg.no/xml/ErgoGroup/AjourDSF/2013-02-04/AjourDSF.xsd"
    xmlns:tns="http://ws.infotorg.no/xml/ErgoGroup/AjourDSF/2013-02-04/AjourDSF.xsd"
    xmlns="http://www.w3.org/2001/XMLSchema">
    
    <annotation>
        <documentation xml:lang="no">
            © 2012 EVRY ASA
        </documentation>
    </annotation>
    
    <simpleType name="KUNDENR">
        <annotation>
            <documentation>Verdi 'KUNDENR'</documentation>
            <documentation>Value 'KUNDENR'</documentation>
            <documentation>Lengde 6</documentation>
        </annotation>
        <restriction base="string"/>
    </simpleType>
    
    <simpleType name="AVDELING">
        <annotation>
            <documentation>Verdi 'AVDELING'</documentation>
            <documentation>Value 'AVDELING'</documentation>
        </annotation>
        <restriction base="string">
            <maxLength value="6" />
        </restriction>
    </simpleType>
    
    <simpleType name="KUNDEID">
        <annotation>
            <documentation>Verdi 'KUNDEID'</documentation>
            <documentation>Value 'KUNDEID'</documentation>
        </annotation>
        <restriction base="string">
            <maxLength value="36" />
        </restriction>
    </simpleType>
    
    <simpleType name="FODSNR">
        <annotation>
            <documentation>Verdi 'FODSNR'. Gyldig fødselsnr eller et idnr tildelt fra EVRY.</documentation>
            <documentation>Value 'FODSNR'. Valid birthnumber or an IDnumber assigned by EVRY.</documentation>
        </annotation>
        <restriction base="string">
            <maxLength value="11" />
        </restriction>
    </simpleType>
    
    <simpleType name="TYPEID">
        <annotation>
            <documentation>Verdi 'TYPEID'. Verdi 'F', blank: Fødselsnr. Verdi 'K': Kryptert fødselsnr(EDB fiktivt personnr).</documentation>
            <documentation>Value 'TYPEID'. Value 'F', blank: Birthnumber. Value 'K': Encrypted birthnumber (EDB fictitious personnumber).</documentation>
        </annotation>
        <restriction base="string">
            <maxLength value="1" />
        </restriction>
    </simpleType>
    
    <simpleType name="AJOURHKD">
        <annotation>
            <documentation>Verdi 'AJOURHKD'. Verdi 'I', blank: Innmelding. Verdi 'S': Sletting.</documentation>
            <documentation>Value 'AJOURHKD'. Value 'I', blank: Reported in. Value 'S': Deleting.</documentation>
        </annotation>
        <restriction base="string">
            <maxLength value="1" />
        </restriction>
    </simpleType>

    <simpleType name="SAKSREF">
        <annotation>
            <documentation>Verdi 'SAKSREF'</documentation>
            <documentation>Value 'SAKSREF'</documentation>
        </annotation>
        <restriction base="string" />
    </simpleType>

    <simpleType name="OPPDRAGSID">
        <annotation>
            <documentation>Verdi 'OPPDRAGSID' : Identifisering av kundens portefølje</documentation>
            <documentation>Value 'OPPDRAGSID' : Identification of customer portfolio</documentation>
        </annotation>
        <restriction base="string">
            <minLength value="1" />
            <maxLength value="10" />
        </restriction>
    </simpleType>

    <simpleType name="EGENID">
        <annotation>
            <documentation>Verdi 'EGENID' : Kundens uniqe identifisering av personen</documentation>
            <documentation>Value 'EGENID' : Customer uniqe identification of the person</documentation>
        </annotation>
        <restriction base="string">
            <maxLength value="36" />
        </restriction>
    </simpleType>

    <simpleType name="EVRYID">
        <annotation>
            <documentation>Verdi 'EVRYID' : Evrys uniqe identifisering av personen</documentation>
            <documentation>Value 'EVRYID' : Evry uniqe identification of the person</documentation>
        </annotation>
        <restriction base="string">
            <maxLength value="36" />
        </restriction>
    </simpleType>

   <simpleType name="KILDEID">
        <annotation>
            <documentation>Verdi 'KILDEID' : Uniqe identifisering av personen avhengig av verdien i TYPEID</documentation>
            <documentation>Value 'KILDEID' : Uniqe identification of the person depending on the value of TYPEID</documentation>
        </annotation>
        <restriction base="string">
            <minLength value="1" />
            <maxLength value="36" />
        </restriction>
    </simpleType>

   <simpleType name="ANTALL">
        <annotation>
            <documentation>Verdi 'ANTALL' : Antall personer funnet</documentation>
            <documentation>Value 'ANTALL' : Number of persons found</documentation>
        </annotation>
        <restriction base="int">
        </restriction>
    </simpleType>

     <simpleType name="TYPEID2">
        <restriction base="string">
            <maxLength value="1" />
            <enumeration value="F">
                <annotation>
                    <documentation>Fødselsnr</documentation>
                    <documentation>Birthnumber</documentation>
                </annotation>
            </enumeration>
           <enumeration value="K">
                <annotation>
                    <documentation>Kryptert fødselsnr(EDB fiktivt personnr)</documentation>
                    <documentation>Encrypted birthnumber (EDB fictitious personnumber)</documentation>
                </annotation>
            </enumeration>
           <enumeration value="E">
                <annotation>
                    <documentation>Egenid (kundens id)</documentation>
                    <documentation>Egenid (customer id)</documentation>
                </annotation>
            </enumeration>
           <enumeration value="U">
                <annotation>
                    <documentation>Evryid (Evrys unike identifikasjon)</documentation>
                    <documentation>Evryid (Evrys unique identification)</documentation>
                </annotation>
            </enumeration>
        </restriction>
    </simpleType>

  <simpleType name="DATOENDR">
        <annotation>
            <documentation>Verdi 'DATOENDR' : ÅÅÅÅMMDD Dato for siste endring</documentation>
            <documentation>Value 'DATOENDR' : YYYYMMDD Date of last change</documentation>
        </annotation>
        <restriction base="string">
           <maxLength value="8" />
        </restriction>
    </simpleType>

  <simpleType name="STATUSKODE">
        <annotation>
            <documentation>Verdi 'STATUSKODE' : 1=Bosatt 2=Utflyttet (ikke i bruk) 3=Utvandret 4=Forsvunnet 5=Død 6=Utgått fødsnr 7=Fødselsreg. 8=Annulert tilg. 9=Uregistrert person</documentation>
            <documentation>Value 'STATUSKODE' : 1=Resident 2=Relocated (not in use) 3=Emigrated 4=Disappeared 5=Dead 6=Emanated birthnumber 7=Birthregistered 8=Canceled access 9=Not registered person</documentation>
        </annotation>
        <restriction base="string">
            <maxLength value="1" />
        </restriction>
    </simpleType>

  <simpleType name="STATUSTEKST">
        <annotation>
            <documentation>Verdi 'STATUSTEKST' : Status i klartekst</documentation>
            <documentation>Value 'STATUSTEKST' : Status in plain text</documentation>
        </annotation>
        <restriction base="string">
           <maxLength value="40" />
        </restriction>
    </simpleType>

    <element name="hentPortefoeljeOppdaterPerson">
        <complexType>
            <sequence>
                <element minOccurs="0" maxOccurs="1" name="request" type="tns:REQUEST"/>      
            </sequence>
        </complexType>
    </element>

    <element name="hentPortefoeljeLesPerson">
        <complexType>
            <sequence>
                <element minOccurs="0" maxOccurs="1" name="request" type="tns:LESREQUEST"/>      
            </sequence>
        </complexType>
    </element>

    <complexType name="REQUEST">
        <sequence>
            <element name="kundenr" type="tns:KUNDENR" minOccurs="0"  maxOccurs="1"/>
            <element name="avdeling" type="tns:AVDELING" minOccurs="0"  maxOccurs="1"/>
            <element name="kundeid" type="tns:KUNDEID" minOccurs="1"  maxOccurs="1"/>
            <element name="fodsnr" type="tns:FODSNR" minOccurs="1"  maxOccurs="1"/>
            <element name="typeid" type="tns:TYPEID" minOccurs="0"  maxOccurs="1"/>
            <element name="ajourhkd" type="tns:AJOURHKD" minOccurs="0"  maxOccurs="1"/>
            <element name="saksref" type="tns:SAKSREF" minOccurs="0"  maxOccurs="1"/>
        </sequence>
    </complexType>

    <complexType name="LESREQUEST">
        <sequence>
            <element name="oppdragsid" type="tns:OPPDRAGSID" minOccurs="1"  maxOccurs="1"/>           
            <element name="typeid" type="tns:TYPEID2" minOccurs="1"  maxOccurs="1"/>
            <element name="kildeid" type="tns:KILDEID" minOccurs="1"  maxOccurs="1"/>
        </sequence>
    </complexType>

    <element name="PortefoeljeOppdaterPerson">
        <complexType>	
            <sequence>
                <element minOccurs="0" maxOccurs="1" name="RESPONSE" type="tns:RESPONSE"/>      
            </sequence>
        </complexType>
    </element>

    <element name="PortefoeljeLesPerson">
        <complexType>	
            <sequence>
                <element minOccurs="0" name="RESPONSE" type="tns:LESRESPONSE"/>      
            </sequence>
        </complexType>
    </element>

    <complexType name="RESPONSE">
        <sequence>
            <element minOccurs="0" maxOccurs="1" name="KUNDENR" type="tns:KUNDENR"/>             
            <element minOccurs="0" maxOccurs="1" name="AVDELING" type="tns:AVDELING"/>
            <element minOccurs="0" maxOccurs="1" name="KUNDEID" type="tns:KUNDEID"/>
            <element minOccurs="0" maxOccurs="1" name="FODSNR" type="tns:FODSNR"/>
            <element minOccurs="0" maxOccurs="1" name="TYPEID" type="tns:TYPEID"/>
            <element minOccurs="0" maxOccurs="1" name="AJOURHKD" type="tns:AJOURHKD"/>
	        <element minOccurs="0" maxOccurs="1" name="SAKSREF" type="tns:SAKSREF"/>
        </sequence>
    </complexType>

    <complexType name="LESRESPONSE">
        <sequence>           
            <element minOccurs="0" maxOccurs="unbounded" name="PERSON">
                <complexType>	
                    <sequence>  
                        <element minOccurs="1" maxOccurs="1" name="EGENID" type="tns:EGENID"/>
                        <element minOccurs="1" maxOccurs="1" name="EVRYID" type="tns:EVRYID"/>
                        <element minOccurs="1"  maxOccurs="1" name="TYPEID" type="tns:TYPEID2"/>
                        <element minOccurs="1"  maxOccurs="1" name="KILDEID" type="tns:KILDEID"/>
                        <element minOccurs="1"  maxOccurs="1" name="DATOENDR" type="tns:DATOENDR"/>
                        <element minOccurs="1"  maxOccurs="1" name="STATUSKODE" type="tns:STATUSKODE"/>
                        <element minOccurs="1"  maxOccurs="1" name="STATUSTEKST" type="tns:STATUSTEKST"/>
                    </sequence>
                </complexType>
            </element>
            <element minOccurs="1" maxOccurs="1" name="OPPDRAGSID" type="tns:OPPDRAGSID"/>  
            <element minOccurs="1" maxOccurs="1" name="ANTALL" type="tns:ANTALL"/>
        </sequence>
    </complexType>       
</schema>
