<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:core="http://schema.omg.org/spec/CTS2/1.0/Core" xmlns="http://schema.omg.org/spec/CTS2/1.0/CodeSystem" targetNamespace="http://schema.omg.org/spec/CTS2/1.0/CodeSystem"
	elementFormDefault="qualified">
	<xs:import namespace="http://schema.omg.org/spec/CTS2/1.0/Core" schemaLocation="../core/Core.xsd"/>
	<!-- ====================================================
      CodeSystemCatalogEntry
      ======================================================-->
	<xs:element name="CodeSystemCatalogEntry" type="CodeSystemCatalogEntry">
		<xs:annotation>
			<xs:documentation>Metadata and access information about a code system.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:complexType name="CodeSystemCatalogEntry">
		<xs:annotation>
			<xs:documentation>Metadata and access information about a code system.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="core:AbstractResourceDescription">
				<xs:sequence>
					<xs:element name="codeSystemCategory" type="core:CodeSystemCategoryReference" minOccurs="0">
						<xs:annotation>
							<xs:documentation>the category or type of resource that the code system represents.</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="ontologyDomain" type="core:OntologyDomainReference" minOccurs="0">
						<xs:annotation>
							<xs:documentation>the subject domain of the ontology</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="ontologyType" type="core:OntologyTypeReference" minOccurs="0">
						<xs:annotation>
							<xs:documentation>the nature of the content of the ontology</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="designedForOntologyTask" type="core:OntologyTaskReference" minOccurs="0" maxOccurs="unbounded">
						<xs:annotation>
							<xs:documentation>the purpose for which the ontology was originally designed</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="versions" type="core:CodeSystemVersionCatalogEntryDirectoryURI" minOccurs="0">
						<xs:annotation>
							<xs:documentation>a <i>DirectoryURI</i> that references the known versions of this code system. </xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="currentVersion" type="core:CodeSystemVersionReference" minOccurs="0" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>a reference to the code system version marked as <i>CURRENT</i> in the service instance.</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="usedOntologyEngineeringTool" type="core:OntologyEngineeringToolReference" minOccurs="0" maxOccurs="unbounded">
						<xs:annotation>
							<xs:documentation>information about a tool used to create the ontology</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
				<xs:attribute name="codeSystemName" type="core:CodeSystemName" use="required">
					<xs:annotation>
						<xs:documentation>the local identifier that uniquely identifies the code system within the context of the implementing service. Note that the <i>about</i> URI is the globally unique identifier.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

	<!-- ====================================================
      CodeSystemCatalogEntry PSM
      ======================================================-->
	<xs:element name="CodeSystemCatalogEntryMsg" type="CodeSystemCatalogEntryMsg"/>
	<xs:complexType name="CodeSystemCatalogEntryMsg">
		<xs:annotation>
			<xs:documentation>A <i>CodeSystemCatalogEntry</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="codeSystemCatalogEntry" type="CodeSystemCatalogEntry"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>


	<!-- ====================================================
      CodeSystemCatalog
      ======================================================-->
	<xs:element name="CodeSystemCatalogEntryDirectory" type="CodeSystemCatalogEntryDirectory"/>
	<xs:complexType name="CodeSystemCatalogEntryDirectory">
		<xs:annotation>
			<xs:documentation>A directory that summarizes a set of catalog entries.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="core:Directory">
				<xs:sequence>
					<xs:element name="entry" type="CodeSystemCatalogEntrySummary" minOccurs="0" maxOccurs="unbounded"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

	<xs:complexType name="CodeSystemCatalogEntrySummary">
		<xs:annotation>
			<xs:documentation>A synopsis of a CodeSystem along with information about how to access the complete resource.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="core:AbstractResourceDescriptionDirectoryEntry">
				<xs:sequence>
					<xs:element name="versions" type="core:CodeSystemVersionCatalogEntryDirectoryURI" minOccurs="0">
						<xs:annotation>
							<xs:documentation>a directory URI that resolves to an ordered list of code system versions associated with this code system. <i>versions</i> may only be present if the service supports the <b>CodeSystemVersion
									Query</b> profile.</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="currentVersion" type="core:CodeSystemVersionReference" minOccurs="0" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>a reference to the code system version marked as <i>CURRENT</i> in the service instance.</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
				<xs:attribute name="codeSystemName" type="core:CodeSystemName" use="required">
					<xs:annotation>
						<xs:documentation>the local identifier that uniquely identifies the code system within the context of the implementing service. Note that the <i>about</i> URI is the globally unique identifier.</xs:documentation>
					</xs:annotation>
				</xs:attribute>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

	<xs:element name="CodeSystemCatalogEntryList" type="CodeSystemCatalogEntryList"/>
	<xs:complexType name="CodeSystemCatalogEntryList">
		<xs:annotation>
			<xs:documentation>A set of code system catalog entries.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="core:Directory">
				<xs:sequence>
					<xs:element name="entry" type="CodeSystemCatalogEntryListEntry" minOccurs="0" maxOccurs="unbounded"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>		
	</xs:complexType>

	<xs:complexType name="CodeSystemCatalogEntryListEntry">
		<xs:annotation>
			<xs:documentation>An instance of <i>CodeSystem</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="CodeSystemCatalogEntry"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

</xs:schema>
