<?xml version="1.0" encoding="UTF-8"?>
<!--

Stylesheet for imageReference 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.imageReference" match="urn:structuredBody" mode="imageReference">
		<!--patsient-->
		<xsl:if test="../../urn:recordTarget">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="../../urn:recordTarget" mode="epicrises"/>
				</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>
		
	<!-- Pildihoidla tehniline baasurl-->
		<xsl:if test="../../urn:participant/urn:associatedEntity">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="../../urn:participant/urn:associatedEntity" mode="baseURL"/>
				</td>
			</tr>
		</xsl:if>

<!--uuring (SUID)-->
		<xsl:if test="urn:component/urn:section">
			<tr>
				<td class="tableBlock">
					<xsl:apply-templates select="urn:component/urn:section" mode="SUIDobservation"/>
				</td>
			</tr>
		</xsl:if>

	</xsl:template>
</xsl:stylesheet>
