<?xml version="1.0" encoding="UTF-8"?>
<!-- Schema module simple Address and Personal Details (APD) specific types -->
<!-- 
From: http://www.govtalk.gov.uk/documents/APD-v1-2.zip  2003-06-18
See:  http://xml.coverpages.org/namesAndAddresses.html#APD-v1-2 -->
<!--	Changes 1.1 to 1.2:
		Metadata brought up to latest version of standard
		Pattern added for DrivingLicenceNumberType -->
<xsd:schema targetNamespace="http://www.govtalk.gov.uk/people/AddressAndPersonalDetails" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.govtalk.gov.uk/people/AddressAndPersonalDetails" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.2" id="CitizenIdentificationTypes">
	<xsd:annotation>
		<xsd:appinfo xmlns:gms="http://www.govtalk.gov.uk/CM/gms">
			<Metadata xmlns="http://www.govtalk.gov.uk/CM/gms-xs">
				<Audience>e-service developers</Audience>
				<Contributor>e-champions,Government Schema Group, IDeA</Contributor>
				<Contributor>Paul Spencer, Boynings Consulting (mailto:paul.spencer@boynings.co.uk)</Contributor>
				<Creator>Technology Policy Team, Office of the e-Envoy, Cabinet Office (mailto:ukgovtalk@citu.gsi.gov.uk)</Creator>
				<Date>
					<Created>2001-12-19</Created>
				</Date>
				<Date>
					<Modified>2002-01-30</Modified>
				</Date>
				<Date>
					<Modified>2003-02-25</Modified>
				</Date>
				<Description>Schema for various citizen reference type definitions</Description>
				<Format>
					<MediaType>text/xml</MediaType>
					<Syntax>http://www.w3.org/2001/XMLSchema</Syntax>
					<Description>XML schema, W3C Recommendation 2001</Description>
				</Format>
				<Identifier>CitizenIdentificationTypes-v1-2</Identifier>
				<Language>[ISO 639-2/B] ENG</Language>
				<Publisher>Office of the e-Envoy, Stockley House,130 Wilton Road, London SW1V 1LQ</Publisher>
				<Relation>
					<Requires>CommonSimpleTypes-v1-2</Requires>
				</Relation>
				<Relation>
					<IsPartOf>PersonalDetailsTypes-v1-2</IsPartOf>
				</Relation>
				<Rights>Unclassified
					<Copyright>Crown Copyright 2002,2003</Copyright>
				</Rights>
				<Subject>
					<Category>People, communities and living</Category>
				</Subject>
				<Subject>
					<Project>UK GovTalk</Project>
				</Subject>
				<Title>Citizen Identifaction Types architectural schema</Title>
				<Type>Architectural</Type>
			</Metadata>
		</xsd:appinfo>
	</xsd:annotation>
	<xsd:include schemaLocation="CommonSimpleTypes-v1-2.xsd"/>
	<xsd:simpleType name="NationalInsuranceNumberType">
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[A-CEGHJ-NPR-TW-Z]{2}[0-9]{6}[ABCD\S]{1}"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="UniqueTaxReferenceType">
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="[0-9]{1,10}"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="PassportNumber_OldType">
		<xsd:restriction base="PopulatedStringType">
			<xsd:pattern value="[A-Z,0-9]{1}[0-9]{4}[A-Z,0-9]{1}"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="PassportNumber_NewType">
		<xsd:restriction base="xsd:int">
			<xsd:pattern value="[0-9]{9}"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="DrivingLicenceNumberType">
		<xsd:restriction base="PopulatedStringType">
			<xsd:pattern value="[A-Z,0-9]{5}[0-9][0,1,5,6][0-9]([0][1-9]|[1-2][0-9]|[3][0,1])[0-9][A-Z,0-9]{3}[A-Z]{2}"/>
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:complexType name="NHSnumberStructure">
		<xsd:sequence>
			<xsd:choice>
				<xsd:element name="EWregNHSnumber" type="DigNHSnumberType"/>
				<xsd:element name="SregNHSnumber" type="CharNHSnumberType"/>
				<xsd:element name="NIregNHSnumber" type="CharNHSnumberType"/>
			</xsd:choice>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:simpleType name="DigNHSnumberType">
		<xsd:restriction base="PopulatedStringType">
			<xsd:pattern value="[0-9]{10}"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="CharNHSnumberType">
		<xsd:restriction base="PopulatedStringType">
			<xsd:maxLength value="18"/>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:simpleType name="ElectoralRollNumberType">
		<xsd:annotation>
			<xsd:documentation>No Pattern yet for Electoral roll number</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="PopulatedStringType"/>
	</xsd:simpleType>
</xsd:schema>
