<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by Naef (OFIT) -->
<!--  TQN (ELCA): added reason 2 to almostAccepted and refused -->
<!--  TQN (ELCA): 05.06.2009: changed type of fields related to  recordId (i.e. recordId , processedRecordId , refusedRecordId ) from xs:long to xs:string -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:eCH-0011="http://www.ech.ch/xmlns/eCH-0011/3" xmlns:eCH-0044="http://www.ech.ch/xmlns/eCH-0044/1" xmlns:eCH-0072="http://www.ech.ch/xmlns/eCH-0072/1" xmlns:eCH-0084="http://www.ech.ch/xmlns/eCH-0084/1" xmlns:eCH-0090="http://www.ech.ch/xmlns/eCH-0090/1" xmlns:ns1="http://www.ech.ch/xmlns/regularCluster/1" targetNamespace="http://www.ech.ch/xmlns/eCH-0084/1" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
	<xs:annotation>
		<xs:documentation xml:lang="en">Envoi des informations à l'UPI d'un cluster régularisé</xs:documentation>
	</xs:annotation>
	<xs:include schemaLocation="eCH-0084-1-0.xsd"/>
	<xs:import namespace="http://www.ech.ch/xmlns/eCH-0011/3" schemaLocation="eCH-0011-3-0.xsd"/>
	<xs:import namespace="http://www.ech.ch/xmlns/eCH-0044/1" schemaLocation="eCH-0044-1-0.xsd"/>
	<xs:import namespace="http://www.ech.ch/xmlns/eCH-0072/1" schemaLocation="eCH-0072-1-0.xsd"/>
	<!-- <xs:import namespace="http://www.ech.ch/xmlns/eCH-0084/1" schemaLocation="eCH-0084-1-0.xsd"/> -->
	<xs:import namespace="http://www.ech.ch/xmlns/eCH-0090/1" schemaLocation="eCH-0090-1-0.xsd"/>
	<xs:element name="updateUPIRequest">
		<xs:annotation>
			<xs:documentation>Regular cluster</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="clusterId" type="xs:long"/>
				<xs:element name="record" maxOccurs="unbounded">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="recordId" type="xs:string"/>
							<xs:element name="sedexId" type="eCH-0090:participantIdType">
								<xs:annotation>
									<xs:documentation>Identifier of the institution which is sending the request (data of the declaration. In other words, a constant for each institution which can be source of data. The source ID format is compliant to the sedex participant ID. See the 'sedex Handbuch', ch. 4.9. Special cases: 6-970000-1 any municipality, 6-800000-1 Santésuisse, 3-CH-3 NRA</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="alreadyProcessed" type="xs:boolean" minOccurs="0">
								<xs:annotation>
									<xs:documentation>Indicates that the record has allready benn processed by the UPI, and therefore it has not be processed again. By default the value is false. If the value is true, the there must exaclty one record with sedexId = 3-CH-3</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="ahvvn" type="eCH-0044:vnType" minOccurs="0"/>
							<xs:element name="localPersonId" type="eCH-0044:namedPersonIdType" minOccurs="0">
								<xs:annotation>
									<xs:documentation xml:lang="en">Represents the person
              identifier in the information system of the institution sending the
              declaration.    </xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="firstNames" type="eCH-0084:baseNameUPI_Type" nillable="true"/>
							<xs:element name="officialName" type="eCH-0084:baseNameUPI_Type"/>
							<xs:element name="originalName" type="eCH-0084:baseNameUPI_Type" nillable="true" minOccurs="0">
								<xs:annotation>
									<xs:documentation xml:lang="en">The maiden name. Present only, if the maiden name is relevant.</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="sex" type="eCH-0044:sexType"/>
							<xs:element name="dateOfBirth" type="eCH-0044:datePartiallyKnownType" nillable="false"/>
							<xs:element name="placeOfBirth" type="eCH-0084:placeOfBirthType" minOccurs="0"/>
							<xs:element name="mothersName" type="eCH-0084:fullName_Type" nillable="true" minOccurs="0"/>
							<xs:element name="fathersName" type="eCH-0084:fullName_Type" nillable="true" minOccurs="0">
								<xs:annotation>
									<xs:documentation xml:lang="en">
</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="nationality">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="nationalityStatus" type="eCH-0011:nationalityStatusType"/>
										<xs:element name="countryId" type="eCH-0072:countryIdType" minOccurs="0"/>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="updateUPIResponse">
		<xs:annotation>
			<xs:documentation xml:lang="en">Response to updateUPIRequest</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="clusterId" type="xs:long"/>
				<xs:choice>
					<xs:element name="accepted">
						<xs:complexType>
							<xs:sequence>
								<xs:element name="ahvvn" type="eCH-0044:vnType"/>
							</xs:sequence>
						</xs:complexType>
					</xs:element>
					<xs:element name="almostAccepted">
						<xs:complexType>
							<xs:sequence>
								<xs:element name="ahvvn" type="eCH-0044:vnType"/>
								<xs:element name="processedRecordId" type="xs:string" minOccurs="0" maxOccurs="unbounded">
									<xs:annotation>
										<xs:documentation>list of the processed records</xs:documentation>
									</xs:annotation>
								</xs:element>
								<xs:element name="refusedRecordId" type="xs:string">
									<xs:annotation>
										<xs:documentation>record wich interrupted further processing</xs:documentation>
									</xs:annotation>
								</xs:element>
								<xs:element name="reason">
									<xs:annotation>
										<xs:documentation xml:lang="en">
                      The reason is for refusing is: 1 = not valid against XSD or an other formal reason (wrong control 
                      number of ahvn for instance), or 2 = manual processing, or 3 = not valid against UPI data, or 4 = refused by the clearing 
                      service, or 10 = service (database) not available.
                    </xs:documentation>
									</xs:annotation>
									<xs:simpleType>
										<xs:restriction base="xs:short">
											<xs:enumeration value="1"/>
											<xs:enumeration value="2"/>
											<xs:enumeration value="3"/>
											<xs:enumeration value="4"/>
											<xs:enumeration value="10"/>
										</xs:restriction>
									</xs:simpleType>
								</xs:element>
								<xs:element name="detailedReason" minOccurs="0">
									<xs:annotation>
										<xs:documentation xml:lang="en">Starts with the detailed error code followed by a short standard text.</xs:documentation>
									</xs:annotation>
									<xs:simpleType>
										<xs:restriction base="xs:string">
											<xs:maxLength value="50"/>
										</xs:restriction>
									</xs:simpleType>
								</xs:element>
								<xs:element name="comment" minOccurs="0">
									<xs:annotation>
										<xs:documentation xml:lang="en">Manually added free form comment.</xs:documentation>
									</xs:annotation>
									<xs:simpleType>
										<xs:restriction base="xs:string">
											<xs:maxLength value="100"/>
										</xs:restriction>
									</xs:simpleType>
								</xs:element>
							</xs:sequence>
						</xs:complexType>
					</xs:element>
					<xs:element name="refused">
						<xs:complexType>
							<xs:sequence>
								<xs:element name="recordId" type="xs:string"/>
								<xs:element name="reason">
									<xs:annotation>
										<xs:documentation xml:lang="en">
                      The reason is for refusing is: 1 = not valid against XSD or an other formal reason (wrong control 
                      number of ahvn for instance), or 2 = manual processing, or 3 = not valid against UPI data, or 4 = refused by the clearing 
                      service, or 10 = service (database) not available.
                    </xs:documentation>
									</xs:annotation>
									<xs:simpleType>
										<xs:restriction base="xs:short">
											<xs:enumeration value="1"/>
											<xs:enumeration value="2"/>
											<xs:enumeration value="3"/>
											<xs:enumeration value="4"/>
											<xs:enumeration value="10"/>
										</xs:restriction>
									</xs:simpleType>
								</xs:element>
								<xs:element name="detailedReason" minOccurs="0">
									<xs:annotation>
										<xs:documentation xml:lang="en">Starts with the detailed error code followed by a short standard text.</xs:documentation>
									</xs:annotation>
									<xs:simpleType>
										<xs:restriction base="xs:string">
											<xs:maxLength value="50"/>
										</xs:restriction>
									</xs:simpleType>
								</xs:element>
								<xs:element name="comment" minOccurs="0">
									<xs:annotation>
										<xs:documentation xml:lang="en">Manually added free form comment.</xs:documentation>
									</xs:annotation>
									<xs:simpleType>
										<xs:restriction base="xs:string">
											<xs:maxLength value="100"/>
										</xs:restriction>
									</xs:simpleType>
								</xs:element>
							</xs:sequence>
						</xs:complexType>
					</xs:element>
				</xs:choice>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>
