source: ccr2ccd-xslt/trunk/make/ccd-medications.xsl@ 1144

Last change on this file since 1144 was 875, checked in by George Lilly, 14 years ago

broke the stylesheet into pieces with a script to reassemble

File size: 15.1 KB
Line 
1 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Medications">
2 <component>
3 <section>
4 <templateId root="2.16.840.1.113883.3.88.11.83.112" assigningAuthorityName="HITSP/C83"/>
5 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.19" assigningAuthorityName="IHE PCC"/>
6 <templateId root="2.16.840.1.113883.10.20.1.8" assigningAuthorityName="HL7 CCD"/>
7 <!--Medications section template-->
8 <code code="10160-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of medication use"/>
9 <title>Medications</title>
10 <text>
11 <table>
12 <tbody>
13 <tr>
14 <th>Medication</th>
15 <th>Date</th>
16 <th>Status</th>
17 <th>Form</th>
18 <th>Strength</th>
19 <th>Quantity</th>
20 <th>SIG</th>
21 <th>Indications</th>
22 <th>Instruction</th>
23 <th>Refills</th>
24 <th>Source</th>
25 </tr>
26 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Medications/a:Medication">
27 <tr>
28 <td>
29 <xsl:value-of select="a:Product/a:ProductName/a:Text"/>
30 <xsl:if test="a:Product/a:BrandName">
31 <xsl:text xml:space="preserve"> </xsl:text>(<xsl:value-of select="a:Product/a:BrandName/a:Text"/>)
32 </xsl:if>
33 </td>
34 <td>
35 <xsl:call-template name="date:format-date">
36 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
37 </xsl:call-template>
38 </td>
39 <td>
40 <xsl:value-of select="a:Status/a:Text"/>
41 </td>
42 <td>
43 <xsl:value-of select="a:Product/a:Form/a:Text"/>
44 </td>
45 <td>
46 <xsl:for-each select="a:Product/a:Strength">
47 <xsl:if test="position() > 1">
48 <xsl:text>/</xsl:text>
49 </xsl:if>
50 <xsl:value-of select="a:Value"/>
51 <xsl:text xml:space="preserve"> </xsl:text>
52 <xsl:value-of select="a:Units/a:Unit"/>
53 </xsl:for-each>
54 </td>
55 <td>
56 <xsl:value-of select="a:Quantity/a:Value"/>
57 <xsl:text xml:space="preserve"> </xsl:text>
58 <xsl:value-of select="a:Quantity/a:Units/a:Unit"/>
59 </td>
60 <td>
61 <xsl:for-each select="a:Directions/a:Direction">
62 <xsl:choose>
63 <xsl:when test="a:Description/a:Text">
64 <xsl:value-of select="a:Description/a:Text"/>
65 </xsl:when>
66 <xsl:otherwise>
67 <xsl:value-of select="a:Dose/a:Value"/>
68 <xsl:text xml:space="preserve"> </xsl:text>
69 <xsl:value-of select="a:Dose/a:Units/a:Unit"/>
70 <xsl:text xml:space="preserve"> </xsl:text>
71 <xsl:value-of select="a:Route/a:Text"/>
72 <xsl:text xml:space="preserve"> </xsl:text>
73 <xsl:value-of select="a:Frequency/a:Value"/>
74 <xsl:if test="a:Duration">
75 <xsl:text xml:space="preserve">( </xsl:text>for <xsl:value-of select="a:Duration/a:Value"/><xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:Duration/a:Units/a:Unit"/><xsl:text xml:space="preserve"> )</xsl:text>
76 </xsl:if>
77 <xsl:if test="a:MultipleDirectionModifier/a:ObjectAttribute">
78 <xsl:for-each select="a:MultipleDirectionModifier/a:ObjectAttribute">
79 <xsl:value-of select="a:Attribute"/>
80 <br/>
81 <xsl:value-of select="a:AttributeValue/a:Value"/>
82 </xsl:for-each>
83 </xsl:if>
84 </xsl:otherwise>
85 </xsl:choose>
86 </xsl:for-each>
87 </td>
88 <td>
89 <xsl:for-each select="a:Directions/a:Direction[1]/a:Indication">
90 <xsl:call-template name="problemDescription">
91 <xsl:with-param name="objID" select="a:InternalCCRLink/a:LinkID"/>
92 </xsl:call-template>
93 <br/>
94 </xsl:for-each>
95 </td>
96 <td>
97 <xsl:for-each select="a:PatientInstructions/a:Instruction">
98 <xsl:value-of select="a:Text"/>
99 <br/>
100 </xsl:for-each>
101 </td>
102 <td>
103 <xsl:for-each select="a:Refills/a:Refill">
104 <xsl:value-of select="a:Number"/>
105 <xsl:text xml:space="preserve"> </xsl:text>
106 </xsl:for-each>
107 </td>
108 <td>
109 <xsl:call-template name="actorName">
110 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
111 </xsl:call-template>
112 </td>
113 </tr>
114 </xsl:for-each>
115 </tbody>
116 </table>
117 </text>
118 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Medications/a:Medication">
119 <entry typeCode="DRIV">
120 <substanceAdministration classCode="SBADM" moodCode="EVN">
121 <templateId root="2.16.840.1.113883.10.20.1.24" assigningAuthorityName="CCD"/>
122 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1" assigningAuthorityName="IHE PCC"/>
123
124 <!--Medication activity template -->
125
126 <!-- <id> -->
127 <xsl:call-template name="ccdID">
128 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
129 </xsl:call-template>
130
131 <statusCode code='completed'/>
132
133 <xsl:call-template name="ccdDateTime">
134 <xsl:with-param name="dt" select="a:DateTime"/>
135 <xsl:with-param name="type" select="'IVL_TS'"/>
136 </xsl:call-template>
137
138 <xsl:call-template name="ccdMedicationFrequency">
139 <xsl:with-param name="frequency" select="a:Directions/a:Direction/a:Frequency"/>
140 </xsl:call-template>
141
142 <xsl:call-template name="ccdCodedValue">
143 <xsl:with-param name="ccrCodedDescription" select="a:Directions/a:Direction/a:Route"/>
144 <xsl:with-param name="nodeName" select="'routeCode'"/>
145 <xsl:with-param name="domain" select="'RouteOfAdministration'"/>
146 </xsl:call-template>
147
148 <xsl:if test="a:Directions/a:Direction/a:Dose">
149 <doseQuantity>
150 <low>
151 <xsl:attribute name="value">
152 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Value"></xsl:value-of>
153 </xsl:attribute>
154 <xsl:attribute name="unit">
155 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Unit"></xsl:value-of>
156 </xsl:attribute>
157 </low>
158 <high>
159 <xsl:attribute name="value">
160 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Value"></xsl:value-of>
161 </xsl:attribute>
162 <xsl:attribute name="unit">
163 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Unit"></xsl:value-of>
164 </xsl:attribute>
165 </high>
166 </doseQuantity>
167 </xsl:if>
168 <consumable>
169 <manufacturedProduct>
170 <templateId root="2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName="HITSP C83"/>
171 <templateId root="2.16.840.1.113883.10.20.1.53" assigningAuthorityName="CCD"/>
172 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName="IHE PCC"/>
173
174 <!-- Product template -->
175
176 <manufacturedMaterial>
177 <xsl:call-template name="ccdCodedValue">
178 <xsl:with-param name="ccrCodedDescription" select="a:Product/a:ProductName"/>
179 <xsl:with-param name="nodeName" select="'code'"/>
180 </xsl:call-template>
181 <name>
182 <xsl:value-of select="a:Product/a:BrandName/a:Text"/>
183 </name>
184 </manufacturedMaterial>
185 </manufacturedProduct>
186 </consumable>
187 </substanceAdministration>
188 </entry>
189 </xsl:for-each>
190 </section>
191 </component>
192 </xsl:if>
Note: See TracBrowser for help on using the repository browser.