<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http: version="1.0">
<xsl:output method="xml"/>
<!--
Output format:
<wado-prefetches>
<prefetch wadourl="" [exportPath=""] />
...
</wado-prefetches>
wadourl: WADO URL without objectUID.(will be added for every image of the series)
exportPath: optional path for export. {0} will be replaced with SOP Instance UID.
The following parameters are made available by the application:
source-aet - AET of the Storage SCU from which the series was received
retrieve-aet - AET of the Query Retrieve SCP from which the series can be retrieved
wado-baseurl - BASE URL for WADO request (Format: http: export-path - Base directory path to wich images are exported
These parameters may be to define rules that depend on the source or retrieve AET.
<xsl:param name="source-aet">DCMSND</xsl:param>
<xsl:param name="retrieve-aet">DCM4CHEE</xsl:param>
-->
<xsl:param name="source-aet"/>
<xsl:param name="retrieve-aet"/>
<xsl:param name="wado-baseurl">http: <xsl:param name="export-path">exported</xsl:param>
<xsl:template match="/dataset">
<xsl:param name="patient-id" select="attr[@tag='00100020']"/>
<xsl:param name="study-uid" select="attr[@tag='0020000D']"/>
<xsl:param name="series-uid" select="attr[@tag='0020000E']"/>
<xsl:param name="study-date" select="attr[@tag='00080020']"/>
<xsl:param name="study-time" select="substring(attr[@tag='00080030'],0,7)"/>
<xsl:param name="content-date" select="attr[@tag='00080023']"/>
<xsl:param name="content-time" select="substring(attr[@tag='00080033'],0,7)"/>
<xsl:param name="series-number" select="attr[@tag='00200011']"/>
<xsl:param name="sop-instance-id" select="attr[@tag='00080018']"/>
<wado-prefetches>
<!-- Prefetch images with special width and height of Series with specified Referring Phyisican
<xsl:if test="attr[@tag='00080090']='Doe^John'">
<prefetch>
<xsl:attribute name="wadourl">
<xsl:value-of select="$wado-baseurl"/>
<xsl:text>&studyUID=</xsl:text><xsl:value-of select="$study-uid"/>
<xsl:text>&seriesUID=</xsl:text><xsl:value-of select="$series-uid"/>
<xsl:text>&rows=64</xsl:text>
<xsl:text>&columns=64</xsl:text>
<xsl:text>&imageQuality=70</xsl:text>
</xsl:attribute>
</prefetch>
</xsl:if>
-->
<!-- Prefetch and export images witch are received from modality 'DCMSND' -->
<!--<xsl:if test="$source-aet='DCMSND'">-->
<prefetch>
<xsl:attribute name="wadourl">
<xsl:value-of select="$wado-baseurl"/>
<xsl:text>&studyUID=</xsl:text><xsl:value-of select="$study-uid"/>
<xsl:text>&seriesUID=</xsl:text><xsl:value-of select="$series-uid"/>
<xsl:text>&imageQuality=100</xsl:text>
</xsl:attribute>
<xsl:attribute name="exportPath">
<!--<xsl:value-of select="$export-path"/>-->
<xsl:text>/home/dcm4chee/shared/<%= rails_env %>/exported/images</xsl:text>
<xsl:text>/</xsl:text><xsl:value-of select="normalize-space($source-aet)"/>
<xsl:text>/</xsl:text><xsl:value-of select="normalize-space($patient-id)"/>
<xsl:text>/</xsl:text>
<!--<xsl:value-of select="normalize-space($study-date)"/>-->
<!--<xsl:value-of select="normalize-space($study-time)"/>-->
<xsl:value-of select="normalize-space($content-date)"/>
<xsl:value-of select="normalize-space($content-time)"/>
<xsl:text>.{0}.jpg</xsl:text>
</xsl:attribute>
</prefetch>
<!--</xsl:if>-->
</wado-prefetches>
</xsl:template>
</xsl:stylesheet>