source: ccr2ccd-xslt/trunk/templates/cdavocablookup.xsl@ 1132

Last change on this file since 1132 was 765, checked in by Richard Braman, 15 years ago

newest versions

File size: 2.2 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3 <xsl:template name="CDAVocabularyLookup">
4 <xsl:param name="domain"/>
5 <xsl:param name="ccrtext"/>
6
7 <xsl:variable name="map" select="document('cdavocabmap.xml')"/>
8 <xsl:variable name="ccrtext_uc" select="translate($ccrtext, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
9 <xsl:variable name="cdaCodeMatch" select="$map/domains/domain[@name=$domain]/item[translate(cdacode,'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')=$ccrtext_uc]/cdacode"/>
10 <xsl:choose>
11 <xsl:when test="$cdaCodeMatch">
12 <xsl:value-of select="$cdaCodeMatch"/>
13 </xsl:when>
14 <xsl:otherwise>
15 <xsl:value-of select="$map/domains/domain[@name=$domain]/item[translate(ccrtext,'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')=$ccrtext_uc]/cdacode"/>
16 </xsl:otherwise>
17 </xsl:choose>
18 </xsl:template>
19
20 <xsl:template name="CDADisplayNameLookup">
21 <xsl:param name="domain"/>
22 <xsl:param name="cdacode"/>
23 <xsl:variable name="map" select="document('cdavocabmap.xml')"/>
24 <xsl:choose>
25 <xsl:when test="$map/domains/domain[@name=$domain]/item[cdacode=$cdacode]/cdadisplayname">
26 <xsl:value-of select="$map/domains/domain[@name=$domain]/item[cdacode=$cdacode]/cdadisplayname"/>
27 </xsl:when>
28 <xsl:otherwise>
29 <xsl:value-of select="$map/domains/domain[@name=$domain]/item[cdacode=$cdacode]/ccrtext"/>
30 </xsl:otherwise>
31 </xsl:choose>
32 </xsl:template>
33
34 <xsl:template name="CDAVocabularyCodeSystemNameLookup">
35 <xsl:param name="domain"/>
36
37 <xsl:value-of select="document('cdavocabmap.xml')/domains/domain[@name=$domain]/@codeSystemName"/>
38 </xsl:template>
39
40 <xsl:template name="CDAVocabularyCodeSystemLookup">
41 <xsl:param name="domain"/>
42
43 <xsl:value-of select="document('cdavocabmap.xml')/domains/domain[@name=$domain]/@codeSystem"/>
44 </xsl:template>
45
46</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.