<?xml version=“1.0” encoding=“UTF-8”?>

<xs:schema targetNamespace=“urn:hl7-org:sdtc” xmlns:xs=“www.w3.org/2001/XMLSchema” xmlns=“urn:hl7-org:sdtc”

elementFormDefault="qualified" xmlns:hl7="urn:hl7-org:v3" xmlns:sch="http://www.ascc.net/xml/schematron">
<xs:annotation>
  <xs:documentation>XML schema for message type POCD_MT000040.</xs:documentation>
  <xs:documentation>
    Copyright (c) 2015 Health Level Seven.
    All rights reserved.
    Redistribution and use in source and binary forms, with or
    without modification, are permitted provided that the following
    conditions are met:
    1. Redistributions of source code must retain the above
    copyright notice, this list of conditions and the following
    disclaimer.
    2. Redistributions in binary form must reproduce the above
    copyright notice, this list of conditions and the following
    disclaimer in the documentation and/or other materials
    provided with the distribution.
    3. All advertising materials mentioning features or use of this
    software must display the following acknowledgement:
    This product includes software developed by Health Level Seven.
    THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS
    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
    NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
    FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT
    SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
    GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
    DAMAGE.
  </xs:documentation>
  <xs:documentation>See http://wiki.hl7.org/index.php?title=CDA_R2_Extensions for more details of extensions</xs:documentation>
  <xs:documentation>
    2012-07-06 Created SDTC.xsd (this file) this file holds all extensions in the SDTC namespace. 
               It contains elements, attributes and datatypes
  </xs:documentation>
  <xs:documentation>
    2012-07-06 Added extensions approved by SDWG prior to 2012-07-06: 
                  id, 
                  deceasedInd, 
                  deceasedTime, 
                  valueSet, 
                  valuesetVersion, 
                  dischargeDispositionCode,
                  raceCode,
                  birthTime
  </xs:documentation>
  <xs:documentation>
    2014-07-14 Added extension approved by SDWG on xxxx date:
                  signatureText
  </xs:documentation>
  <xs:documentation>
    2015-04-01 Added extensions approved by SDWG on 2014-11-xx:
                  multipleBirthInd, 
                  multipleBirthOrderNumber
  </xs:documentation>
  <xs:documentation>
      2015-04-01 
               Added extension approved by SDWG on 2014-12-18:
                  ethnicGroupCode
  </xs:documentation>
  <xs:documentation>
        2015-04-01 
               Added extension approved by SDWG on 2014-01-xx:
                  statusCode
  </xs:documentation>
  <xs:documentation>
        2015-04-01 
               Added extension approved by SDWG on 2015-03-05
                  desc
  </xs:documentation>
  <xs:documentation>
          2015-04-01 
                Added extension approved by SDWG on 2015-03-05
                   patient
  </xs:documentation>
  <xs:documentation>
              2015-04-01 
              Added extension approved by SDWG on 2015-03-19
                 inFulfillmentOf1
  </xs:documentation>
  <xs:documentation>
              2015-04-06 
              Added extension approved by SDWG on 2015-03-05
                 asPatientRelationship
  </xs:documentation>
</xs:annotation>
<xs:import namespace="urn:hl7-org:v3" schemaLocation="POCD_MT000040_SDTC.xsd" />
<!-- == Start Data types ===================================================================== -->
<!-- Datatype INT_POS (restricts integers to 1 or greater) -->
<xs:simpleType name="int_pos">
  <xs:annotation>
    <xs:documentation>Positive integer numbers</xs:documentation>
  </xs:annotation>
  <xs:restriction base="hl7:int">
    <xs:minInclusive value="1" />
  </xs:restriction>
</xs:simpleType>
<xs:complexType name="INT_POS">
  <xs:annotation>
    <xs:documentation>Positive integer numbers</xs:documentation>
    <xs:appinfo>
      <diff>INT</diff>
      <sch:pattern name="validate SDTC_INT">
        <sch:rule abstract="true" id="rule-SDTC_INT">
          <sch:report test="(@value or @nullFlavor) and not(@value and @nullFlavor)" />
        </sch:rule>
      </sch:pattern>
    </xs:appinfo>
  </xs:annotation>
  <xs:complexContent>
    <xs:extension base="hl7:QTY">
      <xs:attribute name="value" use="optional" type="int_pos" />
    </xs:extension>
  </xs:complexContent>
</xs:complexType>
<!-- ActReference (created for QRDA) -->
<xs:complexType name="ActReference">
  <xs:sequence>
    <xs:element name="realmCode" type="hl7:CS" minOccurs="0" maxOccurs="unbounded" />
    <xs:element name="typeId" type="hl7:POCD_MT000040.InfrastructureRoot.typeId" minOccurs="0" />
    <xs:element name="templateId" type="hl7:II" minOccurs="0" maxOccurs="unbounded" />
    <xs:element name="id" type="hl7:II" minOccurs="1" maxOccurs="unbounded" />
  </xs:sequence>
  <xs:attribute name="classCode" type="hl7:ActClass" use="required" />
  <xs:attribute name="moodCode" type="hl7:x_DocumentActMood" use="required" />
  <xs:attribute name="determinerCode" type="hl7:EntityDeterminer" use="optional" fixed="INSTANCE" />
</xs:complexType>
<!-- Fulfills (created for QRDA) -->
<xs:complexType name="InFulfillmentOf1">
  <xs:sequence>
    <xs:element name="realmCode" type="hl7:CS" minOccurs="0" maxOccurs="unbounded" />
    <xs:element name="typeId" type="hl7:POCD_MT000040.InfrastructureRoot.typeId" minOccurs="0" />
    <xs:element name="templateId" type="hl7:II" minOccurs="0" maxOccurs="unbounded" />
    <xs:element name="actReference" type="ActReference" />
  </xs:sequence>
  <xs:attribute name="typeCode" type="hl7:ActRelationshipFulfills" use="required" fixed="FLFS" />
  <xs:attribute name="inversionInd" type="hl7:bl" use="optional" />
  <xs:attribute name="negationInd" type="hl7:bl" use="optional" />
</xs:complexType>
<xs:complexType name="SdtcPatient">
  <xs:sequence>
    <xs:element name="id" type="hl7:II" minOccurs="1" />
  </xs:sequence>
</xs:complexType>
<xs:complexType name="AsPatientRelationship">
  <xs:sequence>
    <xs:element name="realmCode" type="hl7:CS" minOccurs="0" maxOccurs="unbounded" />
    <xs:element name="typeId" type="hl7:POCD_MT000040.InfrastructureRoot.typeId" minOccurs="0" />
    <xs:element name="templateId" type="hl7:II" minOccurs="0" maxOccurs="unbounded" />
    <xs:element name="code" type="hl7:CE" />
  </xs:sequence>
  <xs:attribute name="classCode" type="hl7:x_DocumentSubject" use="required" fixed="PRS" />
  <xs:attribute name="determinerCode" type="hl7:EntityDeterminer" use="optional" fixed="INSTANCE" />
</xs:complexType>
<!-- == End Data Types =================================================================== -->
<!-- == Start Attributes =================================================================== -->
<xs:attribute name="valueSet" type="hl7:oid" />
<xs:attribute name="valueSetVersion" type="hl7:st" />
<!-- == End Attributes =================================================================== -->
<!-- == Start Elements =================================================================== -->
<xs:element name="raceCode" type="hl7:CE" />
<xs:element name="ethnicGroupCode" type="hl7:CE" />
<xs:element name="dischargeDispositionCode" type="hl7:CE" />
<xs:element name="id" type="hl7:II" />
<xs:element name="deceasedInd" type="hl7:BL" />
<xs:element name="deceasedTime" type="hl7:TS" />
<xs:element name="multipleBirthInd" type="hl7:BL" />
<xs:element name="multipleBirthOrderNumber" type="INT_POS" />
<xs:element name="birthTime" type="hl7:TS" />
<xs:element name="signatureText" type="hl7:ED" />
<xs:element name="statusCode" type="hl7:CS" />
<xs:element name="desc" type="hl7:ED" />
<xs:element name="inFulfillmentOf1" type="InFulfillmentOf1" />
<xs:element name="patient" type="SdtcPatient" />
<xs:element name="asPatientRelationship" type="AsPatientRelationship" />
<!-- == End Elements =================================================================== -->

</xs:schema>