<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.ucr.uu.se/spor/xml/registrations"
            xmlns:spor="http://www.ucr.uu.se/spor/xml/registrations"
            xmlns:spor-common="http://www.ucr.uu.se/spor/xml/common"
            elementFormDefault="qualified" attributeFormDefault="qualified" version="4.0">

    <xsd:import namespace="http://www.ucr.uu.se/spor/xml/common"
                schemaLocation="spor-common.xsd"/>
    <!--
    Schema för registrering i SPOR 4.0
    -->
    <xsd:element name="registrations">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="registration" type="spor:registrering" minOccurs="1" maxOccurs="unbounded"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>

    <xsd:element name="registrering" type="spor:registrering">
        <xsd:annotation>
            <xsd:documentation xml:lang="sv">
                Registrering av operativ process
            </xsd:documentation>
        </xsd:annotation>
    </xsd:element>

    <xsd:complexType name="registrering">
        <xsd:sequence>
            <xsd:element name="recipientMessageSplit" type="spor:messageSplit" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="behandlingsnummer" type="spor:behandlingsnummer" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="registrerandeOperationsenhet" type="spor-common:hsaId" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="uppgiftslamnare" type="spor-common:hsaId" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="patientinformation" type="spor:patientinformation" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="operationsAnmalan" type="spor:operationsAnmalan" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="planeringar" type="spor:planeringar" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="operation" type="spor:operation" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="postop" type="spor:postop" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="qr15s" type="spor:qr15s" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="pawis" type="spor:pawis" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="messageSplit">
        <xsd:sequence>
            <xsd:element name="registryId" type="spor:registryId" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>


    <xsd:complexType name="patientinformation">
        <xsd:sequence>
            <xsd:choice minOccurs="1" maxOccurs="1">
                <xsd:element name="personnummer" type="spor:personnummer"/>
                <xsd:element name="samordningsnummer" type="spor:samordningsnummer"/>
                <xsd:element name="reservnummer" type="spor:reservnummer"/>
            </xsd:choice>
            <xsd:element name="lan" type="spor:lan" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="kommun" type="spor:kommun" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="mobiltelefon" type="spor:mobiltelefon" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="operationsAnmalan">
        <xsd:sequence>
            <xsd:element name="tidpunktForOpanmalan" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="ursprungligTidpunktOpanmalan" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="akutElektiv" type="spor:akutElektiv" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="elektivPlanering" type="spor:elektivPlanering" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="opererasSenast" type="spor:dateOptionalTime" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="akutPlanering" type="spor:akutPlanering" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="planeradOperationsklinik" type="spor-common:organisationsId" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="planeradVardform" type="spor:vardform" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="planeradEftervardsniva" type="spor:eftervardsniva" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="planeradHuvudoperationskod" type="spor:kvakod" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="anmalareAvOperation" type="spor-common:hsaId" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="konsulteradOperator" type="spor-common:hsaId" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="viktPatient" type="spor:vikt" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="langdPatient" type="spor:langd" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="funktionsbedomningAsa" type="spor:asa" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="antibiotikaprofylaxOrdinerad" type="spor:jaNejOkant" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="rokare" type="spor:jaNejOkant" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="rokavvanjningHarErbjudits" type="spor:jaNejOkant" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="planering">
        <xsd:sequence>
            <xsd:element name="tidpunktOperationsplanering" type="xsd:dateTime" minOccurs="0"/>
            <xsd:element name="planeradPatienttidStart" type="xsd:dateTime" minOccurs="0"/>
            <xsd:element name="planeradOperationstidStart" type="xsd:dateTime" minOccurs="0"/>
            <xsd:element name="planeradOperationstidSlut" type="xsd:dateTime" minOccurs="0"/>
            <xsd:element name="planeradPatienttidSlut" type="xsd:dateTime" minOccurs="0"/>
            <xsd:element name="planeradOperationssal" type="spor-common:organisationsId" minOccurs="0"/>
            <xsd:element name="tidpunktPatientKallasTillOperation" type="xsd:dateTime" minOccurs="0"/>
            <xsd:element name="anestesiBedomningAnsvarig" type="spor-common:hsaId" minOccurs="0"/>
            <xsd:element name="anestesiSpecialistKonsulterad" type="spor-common:hsaId" minOccurs="0"/>
            <xsd:element name="strykning" type="spor:strykning" minOccurs="0"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="planeringar">
        <xsd:sequence>
            <xsd:element name="planering" type="spor:planering" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="strykning">
        <xsd:sequence>
            <xsd:element name="strykningstidpunkt" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="strykningsorsak" type="spor:strykningsorsak" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="avforsFranVantelistan" type="spor-common:jaNej" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>


    <xsd:complexType name="operation">
        <xsd:sequence>
            <xsd:element name="inskrivningSjukhus" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="utskrivningSjukhus" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="uppdukningStart" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="uppdukningSlut" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="uppdukningslokal" type="spor:uppdukningslokal" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="antibiotiksprofylaxStart" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="ankomsttidPreopenhet" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="anestesimedverkan" type="spor-common:jaNej" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="patienttidStart" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="patientInPaOpsal" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="anestesitidStart" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="anestesiKlar" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="operationsforeberedelseKlar" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="forseningsOrsak" type="spor:forseningsOrsak" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="operationStart" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="operationSlut" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="anestesitidSlut" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="patientUtFranOpsal" type="xsd:dateTime" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="patienttidSlut" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="operationssal" type="spor-common:organisationsId" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="operationsklinik" type="spor-common:organisationsId" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="huvudoperationskod" type="spor:kvakod" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="bioperationskoder" type="spor:bioperationskoder" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="huvudanestesikod" type="spor:kvakod" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="bianestesikoder" type="spor:anestesikoder" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="huvuddiagnos" type="spor:icd10kod" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="bidiagnoser" type="spor:bidiagnoser" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="chklForberedelseGenomford" type="spor:jaNejOkant" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="chklTimeOutGenomford" type="spor:jaNejOkant" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="chklSignOutGenomford" type="spor:jaNejOkant" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="urinkateter" type="spor:urinkateter" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="bladderscanOpsal" type="spor:bladderscan" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="totalBlodning" type="spor:totalBlodning" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="givnaMilliliterBlod" type="spor:givnaMilliliterBlod" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="givnaMilliliterPlasma" type="spor:givnaMilliliterPlasma" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="lagstaJournalfordaPuls" type="spor:puls" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="lagstaJournalfordaSystoliskaBlodtryck" type="spor:systolisktBlodtryck" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="lagstaJournalfordaSpO2" type="spor:sp02" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="lagstaJournalfordaHb" type="spor:hb" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="peroperativaKomplikationer" type="spor:peroperativaKomplikationer" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="verkligEftervardsniva" type="spor:eftervardsniva" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="anestesiKlinikId" type="spor-common:organisationsId" minOccurs="0" maxOccurs="1">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Anestesiologens organisatoriska hemvist enligt lokal definition. </xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="preoperativAnestesiStart" type="xsd:dateTime" minOccurs="0" maxOccurs="1">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Tidpunkt när preoperativa anestesiologiska ingrepp startas, exempelvis blockad börjar anläggas, om detta sker innan patient tid start har börjat registreras</xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="huvudoperator" type="spor-common:hsaId" minOccurs="0" maxOccurs="1">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Den operatör som anses vara huvudopertör för ingreppet. Om flera olika ingrepp gjorts, och flera huvudoperatörer därmed angivits i operationsplaneringssystemet skall den med övergripande ansvar för operationen anges som huvudoperatör. Går detta ej att utläsa skall den huvudoperatör som angetts först i tidsordning anges. Specifik identifierare, HSAID, skall inskickas.</xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="assisterandeOperatorer" type="spor:assisterandeOperatorer" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="operationssjukskoterskor" type="spor:operationssjukskoterskor" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="anestesiologer" type="spor:anestesiologer" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="anestesisjukskoterskor" type="spor:anestesisjukskoterskor" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="givnaTrombocyter" type="spor:trombocyter" minOccurs="0" maxOccurs="1">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Givna milliliter trombocyter under perioden från operationsstart till operationsslut.</xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="temperaturVidOPStart" type="spor:kroppsTemperatur" minOccurs="0" maxOccurs="1">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Temperatur mätt med en decimal vid opstart eller under preoperativa förberedelsen på operationssalen/motsvarande</xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="temperaturVidOPSlut" type="spor:kroppsTemperatur" minOccurs="0" maxOccurs="1">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Temperatur mätt med en decimal vid slutet av det operativa ingreppet</xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="lagstaJournalfordaMAP" type="spor:map" minOccurs="0" maxOccurs="1">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Lägsta journalförda medelartär blodtryck under perioden från operations start till operations slut</xsd:appinfo>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="lateralitet" type="spor:lateralitet" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="postop">
        <xsd:sequence>
            <xsd:element name="patientUtFranPostop" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="uvaAvdelning" type="spor-common:hsaId" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="verkligEftervardsnivaEfterPostop" type="spor:eftervardsnivaPostop" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="smartaPostoperativt" type="spor:nrsskala" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="smartaInom1hEfterAnkomst" type="spor:nrsskala" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="smartaVidUtskrivning" type="spor:nrsskala" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="illamaendePostoperativt" type="spor:illamaende" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="bladderscanPostop" type="spor:bladderscan" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="temperaturLagstaUppmatta" type="spor:kroppsTemperatur" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="postoperativaKomplikationer" type="spor:postoperativeKomplikationer" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>

    <!--
    Bastyper
    -->

    <xsd:simpleType name="registryId">
        <xsd:restriction base="xsd:string">
            <xsd:pattern value="[\w\d\-]*"/>
            <xsd:minLength value="1"/>
            <xsd:maxLength value="64"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="behandlingsnummer">
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="50"/>
            <xsd:pattern value="[\w\d_,.\-\s]*"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="personnummer">
        <xsd:annotation>
            <xsd:documentation xml:lang="sv">
                Svenskt personnummer enlig SKV 704
            </xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:pattern value="(18|19|20)\d{4}(0|1|2|3)\d{5}"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="samordningsnummer">
        <xsd:annotation>
            <xsd:documentation xml:lang="sv">
                Svenskt samordningsnummer enl SKV 707
            </xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:pattern value="(18|19|20)\d{4}(6|7|8|9)\d{5}"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="reservnummer">
        <xsd:sequence>
            <xsd:element name="id">
                <xsd:annotation>
                    <xsd:documentation xml:lang="sv">
                        Reservnummer enligt vårdgivares anvisningar
                    </xsd:documentation>
                </xsd:annotation>
                <xsd:simpleType>
                    <xsd:restriction base="xsd:string">
                        <xsd:minLength value="1"/>
                        <xsd:maxLength value="60"/>
                        <xsd:whiteSpace value="preserve"/>
                        <xsd:pattern value="[\w\d_,.\-\s]*"/>
                    </xsd:restriction>
                </xsd:simpleType>
            </xsd:element>
            <xsd:element name="fodelsedatum" minOccurs="0" maxOccurs="1" type="xsd:date">
                <xsd:annotation>
                    <xsd:documentation xml:lang="sv">
                        Patientens födelsedatum
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="kon" minOccurs="0" maxOccurs="1" type="spor:kon">
                <xsd:annotation>
                    <xsd:documentation xml:lang="sv">
                        Patientens kön
                    </xsd:documentation>
                </xsd:annotation>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="kon">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="MAN">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Man</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="KVINNA">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Kvinna</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="OKANT">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Okänt</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="mobiltelefon">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Generös definition av mobiltelefonnummer</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="128"/>
            <xsd:pattern value="[+0-9 ()\-]*"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="lan">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Länskod enligt Skatteverket</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="2"/>
            <xsd:pattern value="[0-9]{2}"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="kommun">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Kommunkod enligt Skatteverket</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="4"/>
            <xsd:pattern value="[0-9]{4}"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="jaNejOkant">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="NEJ">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Nej</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="JA">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Ja</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="OKANT">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Okänt</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="urinkateter">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="IN_SITU">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">In situ</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="JA">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Ja</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="NEJ">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Nej</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="ENGANGSTAPPAD">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Engångstappad</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="akutElektiv">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="AKUT">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Akut planering</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="ELEKTIV">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Elektiv planering</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="BEVAKNING">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Bevakningspatient</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="elektivPlanering">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Den tid som patienten anses medicinskt kunna vänta utan försämring av prognos eller vara utsatt för alltför stort lidande.</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="1VECKA">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">1 vecka</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="2VECKOR">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">2 veckor</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="1MANAD">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">1 månad</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="6VECKOR">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">6 veckor</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="2MANADER">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">2 månader</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="3MANADER">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">3 månader</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="OVER_3MANADER">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">&gt; 3 månader</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="akutPlanering">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="URAKUT">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Ingrepp som på medicinska grunder måste ske omedelbart</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="AKUT_2">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Ingrepp som på medicinska grunder måste ske inom 2 timmar från det att patient anmälts till operation</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="AKUT_6">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Ingrepp som på medicinska grunder måste ske inom 6 timmar från det att patient anmälts till operation</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="AKUT_24">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Ingrepp som på medicinska grunder måste ske inom 24 timmar från det att patient anmälts till operation</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="AKUT_OVER_24">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Ingrepp som antingen kan vänta mer än 24 timmar från operationsanmälan eller ej hinner/kan hanteras av ordinarie väntelista</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="vardform">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="OPPENVARD">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Öppenvård</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="SLUTENVARD">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Slutenvård</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="eftervardsniva">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="POSTOP">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Postop/UVA</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="DAGKIRURGI">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Dagkirurgi</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="INTENSIVVARD">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Intensivvård</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="AVDELNING">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Avdelning</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="PATIENTHOTELL">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Patienthotell</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="HEM">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Hem</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="ANNAT">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Annat</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="eftervardsnivaPostop">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="DAGKIRURGI">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Dagkirurgi</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="INTENSIVVARD">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Intensivvård</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="AVDELNING">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Avdelning</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="PATIENTHOTELL">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Patienthotell</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="HEM">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Hem</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="ANNAT">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Annat</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="OPERATION">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Operation</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="vikt">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Vikt i kg med tre decimaler</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:decimal">
            <xsd:minInclusive value="0.099"/>
            <xsd:maxInclusive value="350.000"/>
            <xsd:fractionDigits value="3"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="bladderscan">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Antal ml urin i blåsan.</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="2000"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="langd">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Längd i cm med en decimal</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:decimal">
            <xsd:minInclusive value="0.5"/>
            <xsd:maxInclusive value="240.0"/>
            <xsd:fractionDigits value="1"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="asa">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="ASA_1">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">ASA klass 1: Frisk patient</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="ASA_2">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">ASA klass 2: Patient med lindrigt sjukdomstillstånd</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="ASA_3">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">ASA klass 3: Patient med allvarligt sjukdomstillstånd</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="ASA_4">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">ASA klass 4: Patient med potentiellt livshotande sjukdomstillstånd</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="ASA_5">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">ASA klass 5: Moribund patient inför ett möjligen livräddande ingrepp</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="ASA_6">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">ASA klass 6: Organdonator med total hjärninfarkt</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="OKANT">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Okänt: Funktionsbedömning enligt ASA gjord men klassificering ej möjlig</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="strykningsorsak">
        <xsd:annotation>
            <xsd:documentation xml:lang="sv">
                SPOR strykningsorsaker
            </xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="3"/>
            <xsd:pattern value="[\w\d_,.\-\s]*"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="kvakod">
        <xsd:annotation>
            <xsd:documentation xml:lang="sv">
                KVÅ kod (Klassifikation av VårdÅtgärder)
            </xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:length value="5"/>
            <xsd:pattern value="(\w\w\d\d\d)|(\w\w\w\d\d)"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="icd10kod">
        <xsd:annotation>
            <xsd:documentation xml:lang="sv">
                ICD-10 kod
            </xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="3"/>
            <xsd:maxLength value="6"/>
            <xsd:pattern value="\w\d\d\d(.+)?"/>
            <xsd:whiteSpace value="preserve"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="bidiagnoser">
        <xsd:sequence>
            <xsd:element name="bidiagnos" type="spor:icd10kod" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="uppdukningslokal">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="SAMMA_OPSAL">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Samma operationssal som operationen utförs i</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="ANNAN_OPSAL">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Annan operationssal än den som operationen utförs i</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>
            <xsd:enumeration value="UPPDUKNINGSRUM">
                <xsd:annotation>
                    <xsd:appinfo xml:lang="sv">Separat uppdukningsrum</xsd:appinfo>
                </xsd:annotation>
            </xsd:enumeration>

        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="anestesikoder">
        <xsd:sequence>
            <xsd:element name="anestesikod" type="spor:kvakod" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="bioperationskoder">
        <xsd:sequence>
            <xsd:element name="bioperationskod" type="spor:kvakod" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="totalBlodning">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Total blödning (ml)</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="100000"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="givnaMilliliterBlod">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Givna milliliter blod (ml)</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="100000"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="givnaMilliliterPlasma">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Givna milliliter plasma (ml)</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="100000"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="puls">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Puls (bpm)</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="300"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="systolisktBlodtryck">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Systoliskt blodtryck (mmHg)</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="300"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="sp02">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Syremättnad (%)</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="100"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="hb">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Hemoglobinvärde (g/l)</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="300"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="trombocyter">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Trombocyter i milliliter</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="100000"/>
        </xsd:restriction>
    </xsd:simpleType>


    <xsd:simpleType name="map">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Lägsta journalförda medelartär blodtryck under perioden från operations start till operations slut</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="0"/>
            <xsd:maxInclusive value="300"/>
        </xsd:restriction>
    </xsd:simpleType>


    <xsd:simpleType name="lateralitet">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Anger vilken sida vid pariga organ som operationen har utförts. EJ AKTUELLT kan anges där parighet ej finnes</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="HOGER_SIDA"/>
            <xsd:enumeration value="VANSTER_SIDA"/>
            <xsd:enumeration value="BILATERALT"/>
            <xsd:enumeration value="EJ_AKTUELLT"/>
        </xsd:restriction>
    </xsd:simpleType>


    <xsd:complexType name="peroperativaKomplikationer">
        <xsd:sequence>
            <xsd:element name="peroperativKomplikation" type="spor:peroperativKomplikation" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="peroperativKomplikation">
        <xsd:sequence>
            <xsd:element name="peroperativKomplikationskod" type="spor:sfaiPeroperativKomplikationskod" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="komplikationsSvarighetsgrad" type="spor:sfaiKomplikationssvarighetsgrad" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="sfaiPeroperativKomplikationskod">
        <xsd:restriction base="xsd:string">
            <xsd:pattern value="A\d+"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="postoperativeKomplikationer">
        <xsd:sequence>
            <xsd:element name="postoperativKomplikation" type="spor:postoperativKomplikation" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="postoperativKomplikation">
        <xsd:sequence>
            <xsd:element name="postoperativKomplikationskod" type="spor:sfaiPostoperativKomplikationskod" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="komplikationsSvarighetsgrad" type="spor:sfaiKomplikationssvarighetsgrad" minOccurs="1" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="sfaiPostoperativKomplikationskod">
        <xsd:restriction base="xsd:string">
            <xsd:pattern value="U\d+"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="sfaiKomplikationssvarighetsgrad">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="GRAD_0"/>
            <xsd:enumeration value="GRAD_1"/>
            <xsd:enumeration value="GRAD_2"/>
            <xsd:enumeration value="GRAD_3"/>
            <xsd:enumeration value="GRAD_4"/>
            <xsd:enumeration value="GRAD_5"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="nrsskala">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="NRS_0"/>
            <xsd:enumeration value="NRS_1"/>
            <xsd:enumeration value="NRS_2"/>
            <xsd:enumeration value="NRS_3"/>
            <xsd:enumeration value="NRS_4"/>
            <xsd:enumeration value="NRS_5"/>
            <xsd:enumeration value="NRS_6"/>
            <xsd:enumeration value="NRS_7"/>
            <xsd:enumeration value="NRS_8"/>
            <xsd:enumeration value="NRS_9"/>
            <xsd:enumeration value="NRS_10"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="forseningsOrsak">
        <xsd:annotation>
            <xsd:documentation xml:lang="sv">
                SPOR förseningsorsaker
            </xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="3"/>
            <xsd:pattern value="[\w\d_,.\-\s]*"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="illamaende">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="INGET_ILLAMAENDE"/>
            <xsd:enumeration value="ILLAMAENDE"/>
            <xsd:enumeration value="KRAKNINGAR"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="kroppsTemperatur">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Temperatur i grader med en decimal</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:decimal">
            <xsd:minInclusive value="10.0"/>
            <xsd:maxInclusive value="45.0"/>
            <xsd:fractionDigits value="1"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="assisterandeOperatorer">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Övriga operatörer angivna i tidsordning de registrerats. Specifik identifierare, HSAID, skall inskickas.</xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="assisterandeOperator" type="spor-common:hsaId" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="operationssjukskoterskor">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Samtliga operationssjuksköterskor. Specifik identifierare, HSAID, skall inskickas.</xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="operationssjukskoterska" type="spor-common:hsaId" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="anestesiologer">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Specifik identifierare, HSAID, skall inskickas.</xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="anestesiolog" type="spor-common:hsaId" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="anestesisjukskoterskor">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">Samtliga anestesisjuksköterskor. Specifik identifierare, HSAID, skall inskickas.</xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="anestesisjukskoterska" type="spor-common:hsaId" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="qr15s">
        <xsd:sequence>
            <xsd:element name="qr15" type="spor:qr15" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="qr15">
        <xsd:sequence>
            <xsd:element name="datumIfyllan" type="xsd:date" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="fraga1" type="spor:qr15Type" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="fraga2" type="spor:qr15Type" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="fraga3" type="spor:qr15Type" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="fraga4" type="spor:qr15Type" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="fraga5" type="spor:qr15Type" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="fraga6" type="spor:qr15Type" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="fraga7" type="spor:qr15Type" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="fraga8" type="spor:qr15Type" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="fraga9" type="spor:qr15Type" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="fraga10" type="spor:qr15Type" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="fraga11" type="spor:qr15Type" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="fraga12" type="spor:qr15Type" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="fraga13" type="spor:qr15Type" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="fraga14" type="spor:qr15Type" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="fraga15" type="spor:qr15Type" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="qr15Type">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">QR15 svar 1-10</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="10"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="pawis">
        <xsd:sequence>
            <xsd:element name="pawi" type="spor:pawi" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="pawi">
        <xsd:sequence>
            <xsd:element name="datumRegistrering" type="xsd:date" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="respiration" type="spor:pawiType" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="cirkulationBlodning" type="spor:pawiType" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="elimination" type="spor:pawiType" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="giNutritionPONV" type="spor:pawiType" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="cns" type="spor:pawiType" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="smarta" type="spor:pawiType" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="medicinering" type="spor:pawiType" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="proverUndersokningar" type="spor:pawiType" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="omvardnadAktivitetHudVavnad" type="spor:pawiType" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="kommunikationKontakter" type="spor:pawiType" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="administrationDokumentation" type="spor:pawiType" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="pawiType">
        <xsd:annotation>
            <xsd:appinfo xml:lang="sv">PAWI svar 1-5</xsd:appinfo>
        </xsd:annotation>
        <xsd:restriction base="xsd:integer">
            <xsd:minInclusive value="1"/>
            <xsd:maxInclusive value="5"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="dateOptionalTime">
        <xsd:restriction base="xsd:string">
            <xsd:pattern value="\d{4}-\d{2}-\d{2}(Z|[+-]\d{2}:\d{2}|T\d{2}:\d{2}:\d{2}(\.[0-9]+)?(Z|[+-]\d{2}:\d{2})?)?"/>
        </xsd:restriction>
    </xsd:simpleType>
</xsd:schema>