<?xml version="1.0" encoding="UTF-8"?>
<!--

   Stylesheet for nakis infectionSuspicionMessage 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-NAKIS-Ext:v1">
	<!--

      Main template which includes content rows
   -->
	<xsl:template name="subject.infectionSuspicionMessage" match="urn:structuredBody" mode="infectionSuspicionMessage">
		<tr>
			<td class="tableBlock" width="100%">
				<table width="100%">
					<tr>
						<td class="rowTitle" width="20%">Registreerimise koht</td>
						<td class="rowValue">
							<xsl:value-of select="../../urn:documentationOf/urn:serviceEvent/urn:performer/urn:assignedEntity/urn:addr/urn:county"/>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<!-- patsient-->
		<xsl:if test="../../urn:recordTarget">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="../../urn:recordTarget" mode="epicrises"/>
				</td>
			</tr>
		</xsl:if>
		<tr>
			<td class="tableBlock" width="100%">
				<table width="100%">
					<tr>
						<td class="blockLabel" colspan="2" width="100%">
							<xsl:text>Diagnoos</xsl:text>
						</td>
					</tr>
					<tr>
						<td class="rowTitle" width="20%">Esialgne diagnoos</td>
						<td class="rowValue">
							<xsl:value-of select="urn:component/urn:section[urn:code/@code='64572001']/urn:entry/urn:observation[urn:code/@code='DGN']/urn:value/@code"/>
							<xsl:text> - </xsl:text>
							<xsl:value-of select="urn:component/urn:section[urn:code/@code='64572001']/urn:entry/urn:observation[urn:code/@code='DGN']/urn:value/@displayName"/>
						</td>
					</tr>
					<tr>
						<td class="rowTitle" width="20%">Arsti sõnaline diagnoos</td>
						<td class="rowValue">
							<xsl:value-of select="urn:component/urn:section[urn:code/@code='64572001']/urn:entry/urn:observation[urn:code/@code='DGN']/urn:value/urn:originalText"/>
						</td>
					</tr>
					<tr>
						<td class="rowTitle" width="20%">Esialgse diagnoosi püstitamise kuupäev</td>
						<td class="rowValue">
							<xsl:call-template name="dateFormat">
								<xsl:with-param name="date" select="urn:component/urn:section[urn:code/@code='64572001']/urn:entry/urn:observation[urn:code/@code='DGN']/urn:effectiveTime/@value"/>
							</xsl:call-template>
						</td>
					</tr>
					<!--Surma kuupäev-->
					<tr width="100%">
						<xsl:apply-templates select="../../urn:recordTarget" mode="deceasedTime"/>
					</tr>
				</table>
			</td>
		</tr>
		<!--Andmed haigestumise kohta-->
		<tr>
			<td class="tableBlock">
				<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='428735001']" mode="patientLocation"/>
			</td>
		</tr>
		<!--Andmed loomahammustuse ja puugiründe kohta-->
		<tr>
			<td class="tableBlock">
				<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='95898004' or urn:code/@code='31986002']" mode="animalBite"/>
			</td>
		</tr>
		<!--Haige ravimine haiglas-->
		<tr>
			<td class="tableBlock" width="100%">
				<table width="100%">
					<tr>
						<td class="blockLabel" colspan="2">
							<xsl:text>Haige ravimine haiglas</xsl:text>
						</td>
					</tr>
					<tr>
						<td class="rowTitle" width="20%">Hospitaliseerimise kuupäev</td>
						<td class="rowValue">
							<xsl:call-template name="dateFormat">
								<xsl:with-param name="date" select="urn:component/urn:section[urn:code/@code='64572001']/urn:entry/urn:encounter/urn:effectiveTime/urn:low/@value"/>
							</xsl:call-template>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<!--Lisainfo-->
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='REM']" mode="info"/>
				</td>
			</tr>
	</xsl:template>
</xsl:stylesheet>

