<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="cmbd">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="episodio"  maxOccurs="unbounded">
          <xs:complexType>
            <xs:sequence>
              <xs:element type="xs:string" name="tip_cip"/>
              <xs:element type="xs:string" name="cip"/>
              <xs:element type="xs:string" name="historia"/>
              <xs:element type="xs:string" name="fecnac"/>
              <xs:element type="xs:string" name="sexo"/>
              <xs:element type="xs:string" name="pais_nac"/>
              <xs:element type="xs:string" name="reside_cp"/>
              <xs:element type="xs:string" name="reside_muni"/>
              <xs:element type="xs:string" name="zbs" minOccurs="0"/>
              <xs:element type="xs:string" name="regfin"/>
              <xs:element type="xs:string" name="fecinicont"/>
              <xs:element type="xs:string" name="codauto" minOccurs="0"/>
              <xs:element type="xs:string" name="fecinghosp"/>
              <xs:element type="xs:string" name="tipcont"/>
              <xs:element type="xs:string" name="tipvisita"/>
              <xs:element type="xs:string" name="procedencia"/>
              <xs:element type="xs:string" name="cenproc" minOccurs="0"/>
              <xs:element type="xs:string" name="circont"/>
              <xs:element type="xs:string" name="servicio"/>
              <xs:element type="xs:string" name="seccion" minOccurs="0"/>
              <xs:element type="xs:string" name="medico"/>
              <xs:element type="xs:string" name="fecfincont"/>
              <xs:element type="xs:string" name="tipalt"/>
              <xs:element type="xs:string" name="centras" minOccurs="0"/>
              <xs:element type="xs:string" name="dispositivo_continuidad"/>
              <xs:element type="xs:string" name="fecint" minOccurs="0"/>
              <xs:element type="xs:string" name="uci"/>
              <xs:element type="xs:string" name="dias_uci" minOccurs="0"/>
              <xs:element name="diagnostico_principal">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element type="xs:string" name="codigo"/>
                    <xs:element type="xs:string" name="poa"/>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="diagnostico_secundario" minOccurs="0" maxOccurs="19">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element type="xs:string" name="codigo"/>
                    <xs:element type="xs:string" name="poa"/>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element type="xs:string" name="procedimiento"  minOccurs="0" maxOccurs="20"/>
              <xs:element type="xs:string" name="procedimiento_ext"  minOccurs="0" maxOccurs="6"/>
              <xs:element type="xs:string" name="morf_neoplasia"  minOccurs="0" maxOccurs="6"/>
              <xs:element type="xs:string" name="cen_san"/>
			  <xs:element type="xs:string" name="num_episodio"  minOccurs="0"/>
			  <xs:element type="xs:string" name="anestesia"  minOccurs="0"/>
			  <xs:element type="xs:string" name="entquir"  minOccurs="0"/>
			  <xs:element type="xs:string" name="salquir"  minOccurs="0"/>
			  <xs:element type="xs:string" name="tipact_paec"  minOccurs="0"/>
			  <xs:element type="xs:string" name="ccaa"  minOccurs="0"/>			  
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>