<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://schema.omg.org/spec/CTS2/1.0/CodeSystemVersion" xmlns:core="http://schema.omg.org/spec/CTS2/1.0/Core"
	targetNamespace="http://schema.omg.org/spec/CTS2/1.0/CodeSystemVersion" elementFormDefault="qualified">
	<xs:import namespace="http://schema.omg.org/spec/CTS2/1.0/Core" schemaLocation="Core.xsd"/>
	<!-- ====================================================
		CodeSystemVersionCatalogEntry
		======================================================-->
	<xs:element name="CodeSystemVersionCatalogEntry" type="CodeSystemVersionCatalogEntry">
		<xs:annotation>
			<xs:documentation><i>CodeSystemVersion</i> is a collection of assertions about one or more entities. If the <i>state</i> of a <i>CodeSystemVersion</i> is <i>Final, </i>the set of assertions made the resource is fixed, meaning
				that if one knows the <i>documentURI</i> assigned to the version and the specific <i>sourceAndNotation</i> from which the version instance was derived, the set of assertions is known as well.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:complexType name="CodeSystemVersionCatalogEntry">
		<xs:annotation>
			<xs:documentation><i>CodeSystemVersion</i> is a collection of assertions about one or more entities. If the <i>state</i> of a <i>CodeSystemVersion</i> is <i>Final, </i>the set of assertions made the resource is fixed, meaning
				that if one knows the <i>documentURI</i> assigned to the version and the specific <i>sourceAndNotation</i> from which the version instance was derived, the set of assertions is known as well.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="core:ResourceVersionDescription">
				<xs:sequence>
					<xs:element name="versionOf" type="core:CodeSystemReference" minOccurs="1">
						<xs:annotation>
							<xs:documentation>The name, URI and, if supported by the service, link to the code system that this version represents.</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="imports" type="core:CodeSystemVersionReference" minOccurs="0" maxOccurs="unbounded">
						<xs:annotation>
							<xs:documentation>A reference to a code system version whose assertions are included as part this code system version. </xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="defaultLanguage" type="core:LanguageReference" minOccurs="0">
						<xs:annotation>
							<xs:documentation>the default spoken or written language used in this version</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="entityDescriptions" type="core:EntityDirectoryURI" minOccurs="0">
						<xs:annotation>
							<xs:documentation>A directory that, if resolved, will result in the complete list of all entities and their descriptions asserted by this code system version. This attribute will only be present if and only if
								the service implementation supports the <b>EntityQuery</b> service profile.</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="associations" type="core:AssociationDirectoryURI" minOccurs="0">
						<xs:annotation>
							<xs:documentation>A <i>DirectoryURI</i> that, when resolved by an instance of an <i>AssociationQueryService</i> will return a list of all associations asserted by this particular code system
								version</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="classes" type="core:EntityDirectoryURI" minOccurs="0">
						<xs:annotation>
							<xs:documentation>A <i>DirectoryURI</i> that represents the set of EntityDescriptions that are of type owl:Class within this code system. Will only be present in code systems that represent
								ontologies.</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="roles" type="core:EntityDirectoryURI" minOccurs="0">
						<xs:annotation>
							<xs:documentation>A <i>DirectoryURI</i> that represents the set of EntityDescriptions that are of type owl:ObjectProperty or owl:DataProperty within this code system. Will only be present in code systems that
								represent ontologies.</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="individuals" type="core:EntityDirectoryURI" minOccurs="0">
						<xs:annotation>
							<xs:documentation>A <i>DirectoryURI</i> that represents the set of EntityDescriptions that are of type owl:Individual within this code system. Will only be present in code systems that represent
								ontologies.</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
				<xs:attribute name="codeSystemVersionName" type="core:CodeSystemVersionName" use="required">
					<xs:annotation>
						<xs:documentation>An identifier that uniquely names this particular code system version within the context of the CTS<sub>2</sub> service instance.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- ====================================================
		CodeSystemVersionCatalogEntry PSM
		======================================================-->
	<xs:element name="CodeSystemVersionCatalogEntryMsg">
		<xs:annotation>
			<xs:documentation>A <i>CodeSystemVersionCatalogEntry</i> read from a service instance.</xs:documentation>
			<xs:appinfo>PSM</xs:appinfo>
		</xs:annotation>
		<xs:complexType>
			<xs:complexContent>
				<xs:extension base="core:Message">
					<xs:sequence>
						<xs:element name="codeSystemVersionCatalogEntry" type="CodeSystemVersionCatalogEntry"/>
					</xs:sequence>
				</xs:extension>
			</xs:complexContent>
		</xs:complexType>
	</xs:element>

	<!-- ====================================================
		CodeSystemVersionCatalog
		======================================================-->
	<xs:element name="CodeSystemVersionCatalog">
		<xs:annotation>
			<xs:documentation>A directory of <i>CodeSystemVersion</i> resources that meet a specified criteria.</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:complexContent>
				<xs:extension base="core:Directory">
					<xs:sequence>
						<xs:element name="entry" type="CodeSystemVersionCatalogEntrySummary" minOccurs="0" maxOccurs="unbounded"/>
					</xs:sequence>
				</xs:extension>
			</xs:complexContent>
		</xs:complexType>
	</xs:element>

	<xs:complexType name="CodeSystemVersionCatalogEntrySummary">
		<xs:annotation>
			<xs:documentation>A synopsis of a <i>CodeSystemVersion</i> along with information about how to access the complete resource.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="core:ResourceVersionDescriptionDirectoryEntry">
				<xs:sequence>
					<xs:element name="versionOf" type="core:CodeSystemReference" minOccurs="1">
						<xs:annotation>
							<xs:documentation>The name, URI and, if supported by the service, link to the code system that this version represents.</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="codeSystemVersionTag" type="core:VersionTagReference" minOccurs="0" maxOccurs="unbounded">
						<xs:annotation>
							<xs:documentation>The tag(s) that assigned to this version by the service provider. <i>codeSystemVersionTag</i> identifies any roles that this version plays within the workflow of the current provider. As an
								example, a provider might assign the tags of "production" and "current" to a given code system version. With the exception of <i>CURRENT</i> the semantics of VersionTag are determined by the service
								provider.</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
				<xs:attribute name="codeSystemVersionName" type="core:CodeSystemVersionName" use="required">
					<xs:annotation>
						<xs:documentation>An identifier that uniquely names this particular code system version within the context of the CTS<sub>2</sub> service instance.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

	<xs:element name="CodeSystemVersionCatalogList">
		<xs:annotation>
			<xs:documentation>A collection of complete <i>CodeSystemVersion</i> resources that meet a specified criteria.</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:complexContent>
				<xs:extension base="core:Directory">
					<xs:sequence>
						<xs:element name="entry" type="CodeSystemVersionListCatalogEntry" minOccurs="0" maxOccurs="unbounded"/>
					</xs:sequence>
				</xs:extension>
			</xs:complexContent>
		</xs:complexType>
	</xs:element>

	<xs:complexType name="CodeSystemVersionListCatalogEntry">
		<xs:annotation>
			<xs:documentation>An instance of <i>CodeSystemVersion</i> that meets a specified filter criteria.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="core:DirectoryEntry">
				<xs:sequence>
					<xs:element name="entry" type="CodeSystemVersionCatalogEntry"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
</xs:schema>
