init
This commit is contained in:
69
dcm4chee/default/conf/dcm4chee-wado/dicom_html.xsl
Normal file
69
dcm4chee/default/conf/dcm4chee-wado/dicom_html.xsl
Normal file
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output method="html"
|
||||
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
|
||||
encoding="UTF-8"/>
|
||||
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
<head>
|
||||
<title>DICOM dataset</title>
|
||||
<link rel="stylesheet" type="text/css" href="dcm-style.css"/>
|
||||
</head>
|
||||
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#FF0000" alink="#FF0000" vlink="#FF0000">
|
||||
<table class="dcmds">
|
||||
<xsl:apply-templates select="dataset"/>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dataset">
|
||||
<table class="dcmds">
|
||||
<tr class="head"><td>Group</td><td>Element</td><td>Name</td><td>VR</td>
|
||||
<td>Length</td><td>VM</td><td>Value</td></tr>
|
||||
<xsl:apply-templates select="attr"/>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item">
|
||||
<tr>
|
||||
<td class="itemno"><xsl:value-of select="position()"/></td>
|
||||
<td>
|
||||
<table class="dcmds">
|
||||
<tr class="head"><td>Group</td><td>Element</td><td>Name</td><td>VR</td>
|
||||
<td>Length</td><td>VM</td><td>Value</td></tr>
|
||||
<xsl:apply-templates select="attr"/>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="attr">
|
||||
<xsl:variable name="pos" select="(position() mod 2)"/>
|
||||
<tr class="row{$pos}">
|
||||
<td><xsl:value-of select="substring(@tag,1,4)"/></td><td><xsl:value-of select="substring(@tag,5,4)"/></td>
|
||||
<td><xsl:value-of select="@name"/></td><td><xsl:value-of select="@vr"/></td>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@vr='SQ'">
|
||||
<td>--</td>
|
||||
<td><xsl:value-of select="@vm"/></td>
|
||||
<td>
|
||||
<table class="dcmds">
|
||||
<tr class="head"><td><i>Items</i></td></tr>
|
||||
<xsl:apply-templates select="item"/>
|
||||
</table>
|
||||
</td>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<td><xsl:value-of select="@len"/></td>
|
||||
<td><xsl:value-of select="@vm"/></td>
|
||||
<td><xsl:value-of select="."/></td>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
151
dcm4chee/default/conf/dcm4chee-wado/sr_html.xsl
Normal file
151
dcm4chee/default/conf/dcm4chee-wado/sr_html.xsl
Normal file
@@ -0,0 +1,151 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
|
||||
<xsl:output method="html" indent="yes" media-type="text/html" encoding="UTF-8"/>
|
||||
<xsl:param name="wadoURL" select="'wado'"/>
|
||||
<xsl:param name="srImageRows" />
|
||||
|
||||
<!-- the stylesheet processing entry point -->
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates select="dataset"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="dataset">
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
<xsl:value-of select="attr[@tag='0040A043']/item/attr[@tag='00080104']"/>
|
||||
</title>
|
||||
</head>
|
||||
<body>
|
||||
<font size="-1">
|
||||
By <xsl:value-of select="attr[@tag='00080080']"/>, Ref. Phys. <xsl:value-of select="attr[@tag='00080090']"/>
|
||||
</font>
|
||||
<br/>
|
||||
<table border="0">
|
||||
<tr><td>Patient Name:</td><td><xsl:value-of select="attr[@tag='00100010']"/>
|
||||
</td></tr>
|
||||
<tr><td>Patient ID:</td><td><xsl:value-of select="attr[@tag='00100020']"/>
|
||||
</td></tr>
|
||||
<tr><td>Patient Birthdate:</td><td><xsl:value-of select="attr[@tag='00100030']"/>
|
||||
</td></tr>
|
||||
<tr><td>Patient Sex:</td><td><xsl:value-of select="attr[@tag='00100040']"/>
|
||||
</td></tr>
|
||||
</table>
|
||||
<hr/>
|
||||
|
||||
<xsl:apply-templates select="attr[@tag='0040A730']/item" mode="content"/>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<!--
|
||||
Contentsequence output starts here
|
||||
-->
|
||||
|
||||
<xsl:template match="item" mode="content">
|
||||
<font size="+2"><xsl:value-of select="attr[@tag='0040A043']/item/attr[@tag='00080104']"/></font>
|
||||
<xsl:apply-templates select="." mode="contentItem" />
|
||||
<br />
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- Displays the content in the context of a list -->
|
||||
<xsl:template match="item" mode="contentLI">
|
||||
<li><font size="+1"><xsl:value-of select="attr[@tag='0040A043']/item/attr[@tag='00080104']"/></font>
|
||||
<xsl:apply-templates select="." mode="contentItem" />
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template mode="contentItem" match="item">
|
||||
<xsl:choose>
|
||||
<xsl:when test="attr[@tag='0040A040']='TEXT'">
|
||||
<p><xsl:call-template name="escape_crlf">
|
||||
<xsl:with-param name="string" select="attr[@tag='0040A160']"/>
|
||||
</xsl:call-template></p>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:when test="attr[@tag='0040A040']='IMAGE ' or attr[@tag='0040A040']='IMAGE'">
|
||||
<xsl:apply-templates select="attr[@tag='00081199']/item" mode="imageref"/>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:when test="attr[@tag='0040A040']='CODE'">
|
||||
<xsl:call-template name="escape_crlf">
|
||||
<xsl:with-param name="string" select="concat(': ',attr[@tag='0040A168']/item/attr[@tag='00080104'])"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:when test="attr[@tag='0040A040']='PNAME ' or attr[@tag='0040A040']='PNAME'">
|
||||
:<xsl:value-of select="attr[@tag='0040A123']"/>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:when test="attr[@tag='0040A040']='NUM ' or attr[@tag='0040A040']='NUM'">
|
||||
<xsl:value-of select="concat(': ',attr[@tag='0040A300']/item/attr[@tag='0040A30A'])" />
|
||||
<xsl:if test="attr[@tag='0040A300']/item/attr[@tag='004008EA']/item/attr[@tag='00080100'] != 1" > <!-- No unit (UCUM) -->
|
||||
<xsl:value-of select="concat(' ',attr[@tag='0040A300']/item/attr[@tag='004008EA']/item/attr[@tag='00080100'])"/>
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
|
||||
|
||||
<xsl:when test="attr[@tag='0040A040']='CONTAINER ' or attr[@tag='0040A040']='CONTAINER'">
|
||||
<ul><xsl:apply-templates select="attr[@tag='0040A730']/item" mode="contentLI"/></ul>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:otherwise>
|
||||
<i>[<xsl:value-of select="attr[@tag='0040A040']"/>] (This Value Type is not supported yet)</i>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="item" mode="imageref">
|
||||
Image
|
||||
<img align="top">
|
||||
<xsl:attribute name="src"><xsl:value-of select="$wadoURL"/>?requestType=WADO&studyUID=1&seriesUID=1&objectUID=<xsl:value-of select="attr[@tag='00081155']"/>
|
||||
<xsl:if test="$srImageRows">&rows=<xsl:value-of select="$srImageRows" /></xsl:if>
|
||||
</xsl:attribute>
|
||||
</img>
|
||||
<br/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="escape_crlf">
|
||||
<xsl:param name="string"/>
|
||||
<xsl:variable name="CR" select="'
'"/>
|
||||
<xsl:variable name="LF" select="'
'"/>
|
||||
<xsl:variable name="CRLF" select="concat($CR, $LF)"/>
|
||||
|
||||
<xsl:choose>
|
||||
<!-- crlf -->
|
||||
<xsl:when test="contains($string,$CRLF)">
|
||||
<xsl:value-of select="substring-before($string,$CRLF)"/><br/>
|
||||
<xsl:call-template name="escape_crlf">
|
||||
<xsl:with-param name="string" select="substring-after($string,$CRLF)"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<!-- carriage return -->
|
||||
<xsl:when test="contains($string,$CR)">
|
||||
<xsl:value-of select="substring-before($string,$CR)"/><br/>
|
||||
<xsl:call-template name="escape_crlf">
|
||||
<xsl:with-param name="string" select="substring-after($string,$CR)"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<!-- line feed -->
|
||||
<xsl:when test="contains($string,$LF)">
|
||||
<xsl:value-of select="substring-before($string,$LF)"/><br/>
|
||||
<xsl:call-template name="escape_crlf">
|
||||
<xsl:with-param name="string" select="substring-after($string,$LF)"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$string"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
|
||||
17
dcm4chee/default/conf/dcm4chee-wado/sr_xml_style.xsl
Normal file
17
dcm4chee/default/conf/dcm4chee-wado/sr_xml_style.xsl
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<xsl:output method="xml" indent="yes" media-type="text/xml"
|
||||
omit-xml-declaration="no" encoding="UTF-8"/>
|
||||
|
||||
<!-- the stylesheet processing entry point -->
|
||||
<xsl:template match="/">
|
||||
<xsl:processing-instruction name="xml-stylesheet">
|
||||
<xsl:text>href="xsl/sr_html.xsl" type="text/xsl"</xsl:text>
|
||||
</xsl:processing-instruction><xsl:copy-of select="dataset"/>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user