Copy <?xml version="1.0" encoding="utf-8"?>
<xs:schema
elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="urn:mii-termserv:xmlns:babelfsh:codesystem"
targetNamespace="urn:mii-termserv:xmlns:babelfsh:codesystem" xmlns:xd="http://www.w3.org/2001/XMLSchema">
<xs:element name="CodeSystem">
<xs:annotation>
<xs:documentation>
This element is the root node of the target schema. All output documents must feature a CodeSystem node.
No metadata other than the name of the target CodeSystem is required.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="concepts" type="concepts"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<xs:element name="code" type="xs:string"/>
<xs:element name="display" type="xs:string"/>
<xs:element name="definition" type="xs:string"/>
<xs:element name="concept" type="concept"/>
<xs:element name="concepts" type="concepts"/>
<xs:element name="designation" type="concept_designation"/>
<xs:element name="property" type="concept_property"/>
<xs:complexType name="concepts">
<xs:annotation>
<xs:documentation>
The output CodeSystem must define a list of concept nodes
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="concept"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="concept" mixed="true">
<xs:annotation>
<xs:documentation>
Every concept must have, at a minimum, have a code, but at least the display should also be present.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:annotation>
<xd:documentation>
Using xs:ref, the above primitive types are referenced
</xd:documentation>
</xs:annotation>
<xs:element ref="code"/>
<xs:element ref="display" minOccurs="0"/>
<xs:element ref="definition" minOccurs="0"/>
<xs:element name="designation" type="concept_designation" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="property" type="concept_property" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="concept_designation" mixed="true">
<xs:annotation>
<xs:documentation>
This follows the FHIR Designation datatype
</xs:documentation>
</xs:annotation>
<xs:all>
<xs:element name="language" type="xs:string" minOccurs="0"/>
<xs:element name="use" type="designation_use" minOccurs="0"/>
<xs:element name="value" type="xs:string"/>
</xs:all>
</xs:complexType>
<xs:complexType name="designation_use" mixed="true">
<xs:annotation>
<xs:documentation>
This follows the FHIR Coding datatype
</xs:documentation>
</xs:annotation>
<xs:all>
<xs:element name="system" type="xs:string"
minOccurs="0"/>
<xs:element name="version" type="xs:string"
minOccurs="0"/>
<xs:element name="code" type="xs:string" minOccurs="0"/>
<xs:element name="display" type="xs:string"
minOccurs="0"/>
<xs:element name="userSelected" type="xs:boolean"
minOccurs="0"/>
</xs:all>
</xs:complexType>
<xs:complexType mixed="true" name="concept_property">
<xs:annotation>
<xs:documentation>
The datatypes follow the allowed datatypes for FHIR CodeSystem properties within concepts.
</xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element name="valueCode" type="xs:string"/>
<xs:element name="valueCoding">
<xs:complexType mixed="true">
<xs:all>
<xs:element name="system" type="xs:string" minOccurs="0"/>
<xs:element name="version" type="xs:string" minOccurs="0"/>
<xs:element name="code" type="xs:string" minOccurs="0"/>
<xs:element name="display" type="xs:string" minOccurs="0"/>
<xs:element name="userSelected" type="xs:boolean" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
<xs:element name="valueString" type="xs:string"/>
<xs:element name="valueInteger" type="xs:int"/>
<xs:element name="valueBoolean" type="xs:boolean"/>
<xs:element name="valueDateTime" type="xs:string"/>
<xs:element name="valueDecimal" type="xs:decimal"/>
</xs:choice>
<xs:attribute name="code" type="xs:string" use="required"/>
</xs:complexType>
</xs:schema>