<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
<xsl:param name="calling" select="'SAMPLE_MOD'"/>
<xsl:template match="/dataset">
<permissions>
<xsl:variable name="studyUID" select="attr[@tag='0020000D']" />
<xsl:variable name="seriesMOD" select="attr[@tag='00080060']" />
<xsl:variable name="patIssuer" select="attr[@tag='00100021']" />
<xsl:choose>
<!--
Configuration for CT stored in client2 - Neurosurgery
-->
<xsl:when test="$seriesMOD='CT' and not(contains(@patIssuer,'DCM4CHEE'))">
<grant role="client2" action="Q,R,A" suid="{attr[@tag='0020000D']}"/>
</xsl:when>
<!--
Configuration for CT stored in client1 - Radiology (having ISSUER set to DCM4CHEE)
-->
<xsl:when test="$seriesMOD='CT' and contains(@patIssuer,'DCM4CHEE')">
<grant role="client1" action="Q,R,A" suid="{attr[@tag='0020000D']}"/>
</xsl:when>
<!--
all other Modalities stored client1 - Radiology (having ISSUER set to DCM4CHEE)
-->
<xsl:otherwise>
<grant role="client1" action="Q,R,A" suid="{attr[@tag='0020000D']}"/>
</xsl:otherwise>
</xsl:choose>