<?xml version="1.0" encoding="UTF-8"?>
<!--

Stylesheet for epicrisis templates
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:urn="urn:hl7-org:v3" xmlns:ext="urn:hl7-EE-DL-Ext:v1">
	<!--

	Main epicrisis template which includes content rows
	-->
	<xsl:template name="structuredBody.pregnancyVisit" match="urn:structuredBody" mode="pregnancyVisit">
		<!-- patsient-->
		<xsl:if test="../../urn:recordTarget">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="../../urn:recordTarget" mode="epicrises"/>
				</td>
			</tr>
		</xsl:if>
		<!--Antud raseduse arvelevõtmise andmed-->
		<xsl:if test="urn:component/urn:section[urn:code/@code='PRGN']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='PRGN']" mode="currentPregnancy"/>
				</td>
			</tr>
		</xsl:if>	
		<!--Kestva raseduse vastuvõtud-->
		<xsl:if test="urn:component/urn:section[urn:code/@code='ENC']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='ENC']" mode="currentPregnancyEncounter"/>
				</td>
			</tr>
		</xsl:if>	
		<!--Kestva raseduse vastuvõtud-->
		<xsl:if test="urn:component/urn:section[urn:code/@code='ENC']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='ENC']" mode="pregnancyTable"/>
				</td>
			</tr>
		</xsl:if>				
		<!--Analüüsid-->
				<xsl:if test="urn:component/urn:section[urn:code/@code='ANA']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='ANA']" mode="tests"/>
				</td>
			</tr>
		</xsl:if>
		<!--Uuringud-->
		<xsl:if test="urn:component/urn:section[urn:code/@code='PROC']">		
		<tr>
			<td class="tableBlock">
				<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='PROC']" mode="statProcedures"/>
			</td>
		</tr>
		</xsl:if>
		<!--allegria-->
		<xsl:if test="urn:component/urn:section[urn:code/@code='ALL']">
		<tr>
			<td class="tableBlock">
				<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='ALL']" mode="diagnoses"/>
			</td>
		</tr>
	</xsl:if>
		<!--ERIARSTIDE KONSULTATSIOONID (Digilugu)-->
		<xsl:if test="urn:component/urn:section[urn:code/@code='CONSULT']">		
		<tr>
			<td class="tableBlock">
				<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='CONSULT']" mode="consult"/>
			</td>
		</tr>
		</xsl:if>
		<!--VAGINAALNE VAATLUS-->
		<xsl:if test="urn:component/urn:section[urn:code/@code='PELVIS_PROC']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='PELVIS_PROC']" mode="pelvis"/>
				</td>
			</tr>
		</xsl:if>
		<!--väljastatud dokumendid-->
		<xsl:if test="urn:component/urn:section[urn:code/@code='DOC']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='DOC']" mode="documents"/>
				</td>
			</tr>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>

