<?xml version="1.0" encoding="UTF-8"?>
<!--

Stylesheet for healthcare data 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 healthcard data template which includes content rows
	-->
	<xsl:template name="structuredBody.healthcard" match="urn:structuredBody" mode="healthcard">
		
		<!-- patsient-->
		<xsl:if test="../../urn:recordTarget">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="../../urn:recordTarget" mode="epicrises"/>
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='AGE']" mode="age"/>
				</td>
			</tr>
		</xsl:if>
		<xsl:if test="urn:component/urn:section[urn:code/@code='ANAM']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='ANAM']" mode="anamnesisAll"/>
				</td>
			</tr>
		</xsl:if>
		<xsl:if test="urn:component/urn:section[urn:code/@code='GROWTH']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='GROWTH']" mode="growthAll"/>
				</td>
			</tr>
		</xsl:if>
		<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="processAll"/>
				</td>
			</tr>
		</xsl:if>
		<xsl:if test="urn:component/urn:section[urn:code/@code='PHYS']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='PHYS']" mode="physAll"/>
				</td>
			</tr>
		</xsl:if>
		<xsl:if test="urn:component/urn:section[urn:code/@code='PROG']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='PROG']" mode="progressAll"/>
				</td>
			</tr>
		</xsl:if>
		<xsl:if test="urn:component/urn:section[urn:code/@code='GUID']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='GUID']" mode="guidanceAll"/>
				</td>
			</tr>
		</xsl:if>
		<xsl:if test="urn:component/urn:section[urn:code/@code='FAMILY']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='FAMILY']" mode="familyAll"/>
				</td>
			</tr>
		</xsl:if>
		<xsl:if test="urn:component/urn:section[urn:code/@code='CUSTOM']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='CUSTOM']" mode="customAll"/>
				</td>
			</tr>
		</xsl:if>
		<xsl:if test="urn:component/urn:section[urn:code/@code='PSYHSOC']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='PSYHSOC']" mode="psyhsocAll"/>
				</td>
			</tr>
		</xsl:if>
		<xsl:if test="urn:component/urn:section[urn:code/@code='MENTAL']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='MENTAL']" mode="mentalAll"/>
				</td>
			</tr>
		</xsl:if>
		<xsl:if test="urn:component/urn:section[urn:code/@code='MANTOUX']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='MANTOUX']" mode="mantouxAll"/>
				</td>
			</tr>
		</xsl:if>
		<xsl:if test="urn:component/urn:section[urn:code/@code='IMM']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='IMM']" mode="immunization">
						<xsl:with-param name="ageGroup" select="'All'"/>
					</xsl:apply-templates>
				</td>
			</tr>
		</xsl:if>
		<xsl:if test="urn:component/urn:section[urn:code/@code='CIND']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='CIND']" mode="contraindication"/>
				</td>
			</tr>
		</xsl:if>	
	</xsl:template>
</xsl:stylesheet>

