<?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.periodontalPlan" match="urn:structuredBody" mode="periodontalPlan">
		<!-- patsient-->
		<xsl:if test="../../urn:recordTarget">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="../../urn:recordTarget" mode="epicrises"/>
				</td>
			</tr>
		</xsl:if>
		<!-- muu osaleja /eestkostja-->
		<xsl:if test="../../urn:recordTarget/urn:patientRole/urn:patient/urn:guardian">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="../../urn:recordTarget/urn:patientRole/urn:patient" mode="guardian"/>
				</td>
			</tr>
		</xsl:if>
		<!-- suunaja-->
		<xsl:if test="../../urn:componentOf/urn:encompassingEncounter/urn:encounterParticipant[@typeCode='REF']/urn:assignedEntity">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="../../urn:componentOf/urn:encompassingEncounter/urn:encounterParticipant[@typeCode='REF']/urn:assignedEntity" mode="refattender"/>
				</td>
			</tr>
		</xsl:if>
		<!-- saatekiri/tellimus-->
		<xsl:if test="../../urn:inFulfillmentOf/urn:order">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="../../urn:inFulfillmentOf/urn:order" mode="reference"/>
				</td>
			</tr>
		</xsl:if>
		<!-- ravijuhtum-->
		<xsl:if test="../../urn:componentOf/urn:encompassingEncounter">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="../../urn:componentOf/urn:encompassingEncounter" mode="careEncounter"/>
				</td>
			</tr>
		</xsl:if>
		<!--RAVIVÕIMALUSED-->
		<xsl:if test="urn:component/urn:section[urn:code/@code='182890002']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='182890002']" mode="anomaly"/>
				</td>
			</tr>
		</xsl:if>
		<!--ORTODONTILISE RAVI AJAL SOOVITATUD PROTSEDUURID-->
		<xsl:if test="urn:component/urn:section[urn:code/@code='38592005']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='38592005']" mode="info"/>
				</td>
			</tr>
		</xsl:if>
		<!--RAVI EESMÄRK-->
		<xsl:if test="urn:component/urn:section[urn:code/@code='397688009']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='397688009']" mode="info"/>
				</td>
			</tr>
		</xsl:if>
		<!--AKTSEPTEERITUD RAVIPLAAN-->
		<xsl:if test="urn:component/urn:section[urn:code/@code='314846003']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='314846003']" mode="info"/>
				</td>
			</tr>
		</xsl:if>
		<!--PLANEERITUD RAVIETAPPIDE AJAKAVA-->
		<xsl:if test="urn:component/urn:section[urn:code/@code='261774000']">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section[urn:code/@code='261774000']" mode="treatmentPlan"/>
				</td>
			</tr>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>

