<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.omg.org/spec/CTS2/1.1/CodeSystemVersion" xmlns:core="http://www.omg.org/spec/CTS2/1.1/Core"
	targetNamespace="http://www.omg.org/spec/CTS2/1.1/CodeSystemVersion" elementFormDefault="qualified">
	<xs:import namespace="http://www.omg.org/spec/CTS2/1.1/Core" schemaLocation="../core/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="supportedLanguage" type="core:LanguageReference" minOccurs="0" maxOccurs="unbounded">
						<xs:annotation>
							<xs:documentation>all languages recognized by this particular code system version</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="entityDescriptions" type="core:EntityDirectoryURI" minOccurs="0">
						<xs:annotation>
							<xs:documentation>a DirectoryURI that resolves to the set 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,resolves to a 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 resolves to the set of <i>EntityDescriptions </i>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 resolves to the set of <i>EntityDescriptions </i>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 resolves to the set of <i>EntityDescriptions </i>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" type="CodeSystemVersionCatalogEntryMsg"/>
	<xs:complexType 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:complexContent>
			<xs:extension base="core:Message">
				<xs:sequence>
					<xs:element name="codeSystemVersionCatalogEntry" type="CodeSystemVersionCatalogEntry"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

	<!-- ====================================================
		CodeSystemVersionCatalog
		======================================================-->
	<xs:element name="CodeSystemVersionCatalogEntryDirectory" type="CodeSystemVersionCatalogEntryDirectory"/>
	<xs:complexType name="CodeSystemVersionCatalogEntryDirectory">
		<xs:annotation>
			<xs:documentation>A directory of <i>CodeSystemVersion</i> resources that meet a specified criteria.</xs:documentation>
		</xs:annotation>
		<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: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) 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="CodeSystemVersionCatalogEntryList" type="CodeSystemVersionCatalogEntryList"/>
	<xs:complexType name="CodeSystemVersionCatalogEntryList">
		<xs:annotation>
			<xs:documentation>A collection of complete <i>CodeSystemVersion</i> resources that meet a specified criteria.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="core:Directory">
				<xs:sequence>
					<xs:element name="entry" type="CodeSystemVersionCatalogEntryListEntry" minOccurs="0" maxOccurs="unbounded"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

	<xs:complexType name="CodeSystemVersionCatalogEntryListEntry">
		<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>
