1 | <?xml version="1.0" encoding="utf-8"?>
|
---|
2 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="urn:hl7-org:v3" xmlns:a="urn:astm-org:CCR" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes="a">
|
---|
3 |
|
---|
4 | <xsl:import href="ccdcodedvalue.xsl"/>
|
---|
5 |
|
---|
6 | <xsl:template name="ccdStatus">
|
---|
7 | <xsl:param name="ccrStatus"/>
|
---|
8 |
|
---|
9 | <entryRelationship typeCode="REFR">
|
---|
10 | <observation classCode="OBS" moodCode="EVN">
|
---|
11 | <templateId root="2.16.840.1.113883.10.20.1.50"/>
|
---|
12 | <!-- Problem status observation template -->
|
---|
13 | <code code="33999-4" codeSystem="2.16.840.1.113883.6.1" displayName="Status"/>
|
---|
14 | <statusCode code="completed"/>
|
---|
15 | <xsl:call-template name="ccdCodedValue">
|
---|
16 | <xsl:with-param name="ccrCodedDescription" select="$ccrStatus"/>
|
---|
17 | </xsl:call-template>
|
---|
18 | </observation>
|
---|
19 | </entryRelationship>
|
---|
20 | </xsl:template>
|
---|
21 |
|
---|
22 | <xsl:template name="ccdStatusObservation">
|
---|
23 | <xsl:param name="status"/>
|
---|
24 | <xsl:variable name="statusText" select="$status/a:Text"></xsl:variable>
|
---|
25 | <xsl:choose>
|
---|
26 | <xsl:when test="$statusText='Active'">
|
---|
27 | <xsl:call-template name="ccdStatusElement">
|
---|
28 | <xsl:with-param name="statusCode" select="'55561003'"></xsl:with-param>
|
---|
29 | <xsl:with-param name="statusDisplayName" select="$statusText"></xsl:with-param>
|
---|
30 | </xsl:call-template>
|
---|
31 | </xsl:when>
|
---|
32 | <xsl:when test="$statusText='Inactive'">
|
---|
33 | <xsl:call-template name="ccdStatusElement">
|
---|
34 | <xsl:with-param name="statusCode" select="'73425007'"></xsl:with-param>
|
---|
35 | <xsl:with-param name="statusDisplayName" select="$statusText"></xsl:with-param>
|
---|
36 | </xsl:call-template>
|
---|
37 | </xsl:when>
|
---|
38 | <xsl:when test="$statusText='Chronic'">
|
---|
39 | <xsl:call-template name="ccdStatusElement">
|
---|
40 | <xsl:with-param name="statusCode" select="'90734009'"></xsl:with-param>
|
---|
41 | <xsl:with-param name="statusDisplayName" select="$statusText"></xsl:with-param>
|
---|
42 | </xsl:call-template>
|
---|
43 | </xsl:when>
|
---|
44 | </xsl:choose>
|
---|
45 | </xsl:template>
|
---|
46 |
|
---|
47 | <xsl:template name="ccdStatusElement">
|
---|
48 | <xsl:param name="statusCode"/>
|
---|
49 | <xsl:param name="statusDisplayName"/>
|
---|
50 | <value>
|
---|
51 | <xsl:attribute name="xsi:type">CE</xsl:attribute>
|
---|
52 | <xsl:attribute name="code">
|
---|
53 | <xsl:value-of select="$statusCode"></xsl:value-of>
|
---|
54 | </xsl:attribute>
|
---|
55 | <xsl:attribute name="codeSystem">2.16.840.1.113883.6.96</xsl:attribute>
|
---|
56 | <xsl:attribute name="displayName">
|
---|
57 | <xsl:value-of select="$statusDisplayName"></xsl:value-of>
|
---|
58 | </xsl:attribute>
|
---|
59 | </value>
|
---|
60 | </xsl:template>
|
---|
61 |
|
---|
62 | </xsl:stylesheet>
|
---|
63 |
|
---|