source: ccr2ccd-xslt/trunk/make/M1-ccr_qrda.xsl@ 995

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

updates

File size: 74.3 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<?xml-stylesheet type="text/xsl" href="cda.xsl"?>
3
4<!--
5Conversion of CCR to Level 3 CCD
6
7Orginal Author: Ken Miller
8Solventus LLC
9ken.miller@solventus.coms
10
11Contributors:
12Richard Braman, EHR Doctors, Inc rbraman@ehrdoctors.com
13George Lilly (WorldVistA glilly@glilly.net)
14Nancy Antracite, WorldVistA
15xxxx - Oroville Hospital
16
17Date: 2010-05-5
18Version: 0.1
19
20License :
21
22 This program is free software: you can redistribute it and/or modify
23 it under the terms of the GNU General Public License as published by
24 the Free Software Foundation, either version 3 of the License, or
25 (at your option) any later version.
26
27 This program is distributed in the hope that it will be useful,
28 but WITHOUT ANY WARRANTY; without even the implied warranty of
29 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 GNU General Public License for more details.
31
32 You should have received a copy of the GNU General Public License
33 along with this program. If not, see http://www.gnu.org/licenses.
34
35-->
36<xsl:stylesheet version="1.0" xmlns="urn:hl7-org:v3" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="urn:astm-org:CCR" xmlns:date="http://exslt.org/dates-and-times"
37xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes="a date">
38 <xsl:import href="./templates/cdavocablookup.xsl"/>
39 <xsl:import href="./templates/hl7oidlookup.xsl"/>
40 <xsl:import href="./templates/code.xsl"/>
41 <xsl:import href="./templates/actor.xsl"/>
42 <xsl:import href="./templates/datetime.xsl"/>
43 <xsl:import href="./templates/problemDescription.xsl"/>
44
45 <xsl:output method="xml" encoding="utf-8" version="1.0" indent="yes"/>
46 <xsl:template match="/">
47<!--WV Added new munltiple documentation of added have to do with encounter times, etc.-->
48
49<!--
50********************************************************
51CDA Header
52********************************************************
53-->
54
55<!--
56******************
57Document Information
58**********************
59-->
60<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:voc="urn:hl7-org:v3/voc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
61 <!-- Created with XML Copy Editor Open Source Sourceforge project. -->
62<!--WVP This is the clinical document type ID-->
63 <realmCode code="US"/>
64 <typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/>
65 <!-- QRDA Category I generic template ID. -->
66 <!--WVP these next two lines are fixed-->
67 <templateId root="2.16.840.1.113883.10.20.12" />
68 <!--only in the july spec so not sure if it should be here-->
69 <templateId root="2.16.840.1.113883.3.249.11.100.1"/>
70 <!--WVV 2.16.840.1.113883.3.543 is fixed and is the beginninng of WorldVistAs OID, change the extension for a new document and the version for changes to this one-->
71
72
73 <!--Script replaces UUID each time if the version number is 1-->
74 <id root="2.16.840.1.113883.3.543" extension="@@@UUID-DOC@@@"/>
75
76 <!-- <xsl:attribute name="root">
77 <xsl:value-of select="/a:ContinuityOfCareRecord/a:CCRDocumentObjectID"></xsl:value-of>
78 </xsl:attribute>
79 </id>-->
80 <!--WVP next two lines fixed-->
81 <code code="55182-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Quality Measure Report"/>
82 <title>QRDA Incidence Report</title>
83 <!--WVV time-->
84 <effectiveTime value="20100703"/>
85 <!--WVP for next two lines-->
86 <confidentialityCode codeSystem="2.16.840.1.113883.5.25" code="N"/>
87 <languageCode code="en-US"/>
88 <!--WV? Don't change this in the document set we are working on-->
89 <setId root="2.16.840.1.113883.3.543" extension="@@@UUID-SET@@@"/>
90 <versionNumber value="1"/>
91 <!--WVP I made one up but we will have to have an OID for the Clincal Document SET which we will make up for ourselves eventually-->
92
93 <!--
94 *******************
95 Patient Information
96 ****************
97 -->
98 <!-- This is the patient for which the report is describing. -->
99 <recordTarget>
100<patientRole>
101 <xsl:call-template name="ccdPatientRole">
102 <xsl:with-param name="ccrActorObjectID" select="/a:ContinuityOfCareRecord/a:Patient[1]/a:ActorID"/>
103 </xsl:call-template>
104 </patientRole>
105 </recordTarget>
106
107<!--
108*****************************
109Author
110**************
111-->
112 <!-- This example assumes the doctor is creating the report and it is Required. -->
113 <author>
114 <!--WVV Edit time has to be precise at least to the day-->
115 <time value="20100703" />
116 <assignedAuthor>
117 <!--WVP eventually id this is required, the root is fixed -->
118 <!--andn the extension is the SOFTWARE version number assigned by CMS to WV EHR-->
119 <id root="2.16.840.1.113883.3.249.6" extension="100001" />
120 <!--WVVassignedPerson not required-->
121 <assignedPerson>
122 <name>
123 <!--WV Edit-->
124 <given>Nancy</given>
125 <family>Anthracite</family>
126 <suffix>MD</suffix>
127 </name>
128 </assignedPerson>
129 <representedOrganization>
130 <!--WV? id root is OID for the organization so I made one up for this document set-->
131 <id root="2.16.840.1.113883.3.543" extension="1558574526" />
132 <name>WorldVistA Test Clinic</name>
133 </representedOrganization>
134 </assignedAuthor>
135 </author>
136 <!-- The reporting healthcare facility is represented using the CCD "Source of Information" construct, via the Informant participant. -->
137 <informant>
138 <assignedEntity>
139 <!--WV this null flavor is required as is-->
140 <id nullFlavor="NA"/>
141 <representedOrganization>
142 <!--WV root is the OID of the organization. ID is required but name is not and id is OID stated earlier-->
143 <id root="2.16.840.1.113883.3.543" extension="1558574526" />
144 <name>World VistA Test Clinic</name>
145 </representedOrganization>
146 </assignedEntity>
147 </informant>
148
149 <!-- This example assumes that the institution responsible for the data is serving as custodian. -->
150 <!--WV This element is required as is the sSD which is not stated if it is an OID but assumed it is-->
151 <!--WV Name is not required, only ID is required.-->
152 <custodian>
153 <assignedCustodian>
154 <representedCustodianOrganization>
155 <id root="2.16.840.1.113883.3.543" extension="1558574526" />
156 <name>WorldVistA Test Clinic</name>
157 </representedCustodianOrganization>
158 </assignedCustodian>
159 </custodian>
160
161 <!-- In this example, the author is also serving as legal authenticator. -->
162 <!--WV section is this is not required-->
163<legalAuthenticator>
164 <time value="20100703" />
165 <!--WV the signature code of S is required-->
166 <signatureCode code="S" />
167 <assignedEntity>
168 <!--WV document does not specify the requirements of the id but it is required-->
169 <!--WVP and the sample suggests it is the number below and extension is ???-->
170 <id root="2.16.840.1.113883.3.543" extension="111111" />
171 <assignedPerson>
172 <name>
173 <given>Nancy</given>
174 <family>Anthracite</family>
175 <suffix>MD</suffix>
176 </name>
177 </assignedPerson>
178 <representedOrganization>
179 <!--WV? and is fixed for the WorldVistA Test Clinic in this submitted document series-->
180 <id root="2.16.840.1.113883.3.543" extension="1558574526" />
181 <name>WorldVistA Test Clinic</name>
182 </representedOrganization>
183 </assignedEntity>
184 </legalAuthenticator>
185
186
187
188 <!--Added to sample as it is new since 2008-->
189 <!--WVP permanent for participant in the primary care provider participant-->
190<!--WVP performer type codes are numerous but PRF is performer or the person who did it-->
191 <participant typeCode="PRF">
192 <!--WVP required as is for function-->
193 <!-- WVP I believe PCP is primary care provider but not sure-->
194 <functionCode code="PCP" codeSystem="2.16.840.1.113883.5.88"/>
195 <!--WVP Associated Entity is required ti be there with this PROV-->
196 <associatedEntity classCode="PROV">
197 <!--WV? OID of the provider fixed for this series of documents-->
198 <id root="2.16.840.1.113883.3.249.6" extension="111111" />
199 <!--WV associated person is not required so presumabley the code will suffice not sure??-->
200 <associatedPerson>
201 <name>
202 <prefix>Dr.</prefix>
203 <given>Nancy</given>
204 <family>Anthracite</family>
205 </name>
206 </associatedPerson>
207 </associatedEntity>
208 </participant>
209
210 <!--The service event is the encounter that describes tehe encunter as well as the provider, location and time-->
211 <!--!There can be one or more documentation elements depending on the number of encounters during the reporting period-->
212 <!--WVV IMPORTANT!! The encounter codeds are recorded here-->
213 <!-- They are in appendix B of the downloadable resource document-->
214 <!-- Each documentation of is a single service event-->
215
216<!--Occurence of Measures episode documention-->
217<!--Like an encounter section only for QRDA-->
218<!--Same doctor, same clinic, different date and different enconter code-->
219
220
221 <!--First Visit documentationOf section-->
222<!--DOCUMENTATIONOFSECTION-->
223
224 <!--
225********************************************************
226CDA Body
227********************************************************
228-->
229 <component>
230 <structuredBody>
231 <!--
232 ********************************************************
233 Measure Set Section
234 ********************************************************
235 -->
236 <component>
237 <section>
238 <!-- WVP QRDA Category I measure-specific template ID for 2010 #1. -->
239 <!--WP Next 3 lines do not change during the reporting period, for the measures section-->
240 <templateId root="2.16.840.1.113883.3.249.11.50" />
241 <code code="55185-3" codeSystem="2.16.840.1.113883.6.1" />
242 <title>Measure set: CMS EHR Measure Set</title>
243 <text>2010 Measures Set Measures</text>
244 <!--
245 ***************************************************
246 Measure Section
247 ***************************************************
248 -->
249 <component>
250 <section>
251 <!--template ID for each measure being reported-->
252 <templateId root="2.16.840.1.113883.3.249.11.2" />
253 <!-- <templateId root="2.16.840.1.113883.3.249.11.3" />
254 <templateId root="2.16.840.1.113883.3.249.11.4" />
255 <templateId root="2.16.840.1.113883.3.249.11.5" />
256 <templateId root="2.16.840.1.113883.3.249.11.6" />
257 <templateId root="2.16.840.1.113883.3.249.11.7"/>
258 <templateId root="2.16.840.1.113883.3.249.11.8" />
259 <templateId root="2.16.840.1.113883.3.249.11.9" />
260 <templateId root="2.16.840.1.113883.3.249.11.10" />
261 <templateId root="2.16.840.1.113883.3.249.11.11" />
262 <templateId root="eRx/2.16.840.1.113883.3.249.11.15" />-->
263 <!--New for 2011-->
264 <!-- <templateId root="2.16.840.1.113883.3.249.11.51" />
265 <templateId root="2.16.840.1.113883.3.249.11.52" />
266 <templateId root="2.16.840.1.113883.3.249.11.53" />
267 <templateId root="2.16.840.1.113883.3.249.11.54" />
268 <templateId root="2.16.840.1.113883.3.249.11.55" />
269 <templateId root="2.16.840.1.113883.3.249.11.56" />
270 <templateId root="2.16.840.1.113883.3.249.11.57" />
271 <templateId root="2.16.840.1.113883.3.249.11.58" />
272 <templateId root="2.16.840.1.113883.3.249.11.59" />
273 <templateId root="2.16.840.1.113883.3.249.11.60" />-->
274 <code code="55186-1" codeSystem="2.16.840.1.113883.6.1" />
275
276 <title>Measure Section</title>
277 <!--Here is where the HTML begins for the above and it is optional-->
278 <text>
279 <list>
280 <item>CMS Measure #1: Diabetes Mellitus: Hemoglobin A1c Poor Control in Diabetes Mellitus</item>
281 <!-- <item>CMS Measure #2: Diabetes Mellitus: Low Density Lipoprotein (LDL-C) Control in Diabetes Mellitus</item>
282 <item>CMS Measure #3: Diabetes Mellitus: High Blood Pressure Control in Diabetes Mellitus</item>
283 <item>CMS Measure #5: Heart Failure: Angiotensin-Converting Enzyme (ACE) Inhibitor or Angiotensin Receptor Blocker (ARB) Therapy for Left Ventricular Systolic Dysfunction (LVSD)</item>
284 <item>CMS Measure #7: Coronary Artery Disease (CAD): Beta-Blocker Therapy for CAD Patients with Prior Myocardial Infarction (MI)</item>
285 <item>CMS Measure #110: Preventive Care and Screening: Influenza Immunization for Patients >= 50 Years</item>
286 <item>CMS Measure #111: Preventive Care and Screening: Pneumonia Vaccination for Patients 65 Years and Older</item>
287 <item>CMS Measure #112: Preventive Care and Screening: Screening Mammography</item>
288 <item>CMS Measure #113: Preventive Care and Screening: Colorectal Cancer Screening</item>
289 <item>CMS Measure #124: Health Information Technology (HIT): Adoption/Use of Electronic Health Records (EHR)</item>
290 <item>CMS Measure eRx:Adoption/Use of Medication Electronic Prescribing Measure</item>-->
291 <!--added 2011 measures-->
292 <!--<item>CMS Measure #39: Screening or Therapy for Osteoporosis for Women Aged 65 Years and Older</item>
293 <item>CMS Measure #47: Advance Care Plan </item>
294 <item>CMS Measure #48: Urinary Incontinence: Assessment of Presence or Absence of Urinary Incontinence in Women Aged 65 Years and Older</item>
295 <item>CMS Measure #128: Preventive Care and Screening: Body Mass Index (BMI) Screening and Follow-Up </item>
296 <item>CMS Measure #173: Preventive Care and Screening: Unhealthy Alcohol Use - Screening</item>
297 <item>CMS Measure #0013: Hypertension (HTN): Blood Pressure Measurement - QRDA Cat I template </item>
298 <item>CMS Measure #0022: Drugs to be avoided in the Elderly </item>
299 <item>CMS Measure #0024: Body Mass Index (BMI) 2 through 18 years of age </item>
300 <item>CMS Measure #0028: Preventive Care and Screening: Tobacco Use: Screening and Cessation Intervention</item>
301 <item>CMS Measure #0038: Childhood Immunization Status - QRDA Cat I template</item>-->
302 </list>
303 </text>
304 <!--Begin listing of acts-->
305 <entry typeCode="DRIV">
306 <act classCode="ACT" moodCode="DEF">
307 <id root="2.16.840.1.113883.3.249.11.2" />
308 <code code="PQRI-1" codeSystem="2.16.840.1.113883.3.249.12" displayName="Hemoglobin A1c Poor Control in Diabetes Mellitus"/>
309 <text>Percentage of patients 18 through 75 years with diabetes mellitus who had most recent hemoglobin A1C greater than 9.0%</text>
310 <statusCode code="completed"/>
311 </act>
312 </entry>
313 <!--<entry typeCode="DRIV">
314 <act classCode="ACT" moodCode="DEF">
315 <id root="2.16.840.1.113883.3.249.11.3" />
316 <code code="PQRI-2" codeSystem="2.16.840.1.113883.3.249.12" displayName="Low Density Lipoprotein (LDL-C) Control in Diabetes Mellitus"/>
317 <text>Percentage of patients 18 through 75 years with diabetes mellitus who had most recent LDL-C level in control (less than 100 mg./dL)</text>
318 <statusCode code="completed"/>
319 </act>
320 </entry>
321 <entry typeCode="DRIV">
322 <act classCode="ACT" moodCode="DEF">
323 <id root="2.16.840.1.113883.3.249.11.4" />
324 <code code="PQRI-3" codeSystem="2.16.840.1.113883.3.249.12" displayName="Hemoglobin A1c Poor Control in Diabetes Mellitus"/>
325 <text>Percentage of patients 18 through 75 years with diabetes mellitus who had most recent blood pressure in control (less than 140/80 mmHg)</text>
326 <statusCode code="completed"/>
327 </act>
328 </entry>
329 <entry typeCode="DRIV">
330 <act classCode="ACT" moodCode="DEF">
331 <id root="2.16.840.1.113883.3.249.11.5" />
332 <code code="PQRI-5" codeSystem="2.16.840.1.113883.3.249.12" displayName="Heart Failure: Angiotensin-Converting Enzyme (ACE) Inhibitor or Angiotensin Receptor Blocker (ARB) Therapy for Left Ventricular Systolic Dysfunction (LVSD)"/>
333 <text>Percentage of patients 18 years and older with a diagnosis of heart frilure and LVSD who were prescribed ACE inhibitor or ARB therapy</text>
334 <statusCode code="completed"/>
335 </act>
336 </entry>
337 <entry typeCode="DRIV">
338 <act classCode="ACT" moodCode="DEF">
339 <id root="2.16.840.1.113883.3.249.11.6" />
340 <code code="PQRI-7" codeSystem="2.16.840.1.113883.3.249.12" displayName="Beta-Blocker Therapy for CAD Patients with Prior Myocardial Infarction"/>
341 <text>Percentage of patients 18 aged 18 years and older wit a diagnosis of CAD and prior MI who were prescribed beta-blocker therapy</text>
342 <statusCode code="completed"/>
343 </act>
344 </entry>
345 <entry typeCode="DRIV">
346 <act classCode="ACT" moodCode="DEF">
347 <id root="2.16.840.1.113883.3.249.11.7"/>
348 <code code="PQRI-110" codeSystem="2.16.840.1.113883.3.249.12" displayName="Influenza Immunization for Patients >= 50 Years"/>
349 <text>Percentage of patients aged 50 years and older who received an influenza immunization during the flu season (September through February)</text>
350 <statusCode code="completed"/>
351 </act>
352 </entry>
353 <entry typeCode="DRIV">
354 <act classCode="ACT" moodCode="DEF">
355 <id root="2.16.840.1.113883.3.249.11.8" />
356 <code code="PQRI-111" codeSystem="2.16.840.1.113883.3.249.12" displayName="Pneumonia Vaccination for Patients 65 Years and Older"/>
357 <text>Percentage of patients afed 65 years and older who have ever received a pneumoccal vaccine</text>
358 <statusCode code="completed"/>
359 </act>
360 </entry>
361 <entry typeCode="DRIV">
362 <act classCode="ACT" moodCode="DEF">
363 <id root="2.16.840.1.113883.3.249.11.9" />
364 <code code="PQRI-112" codeSystem="2.16.840.1.113883.3.249.12" displayName="Screening Mammography"/>
365 <text>Percentage of womaen aged 40 through 69 years who had a mammogram to screen for breast cancer within 24 months</text>
366 <statusCode code="completed"/>
367 </act>
368 </entry>
369 <entry typeCode="DRIV">
370 <act classCode="ACT" moodCode="DEF">
371 <id root="2.16.840.1.113883.3.249.11.10" />
372 <code code="PQRI-113" codeSystem="2.16.840.1.113883.3.249.12" displayName="Colorectal Cancer Screening"/>
373 <text>Percentage of patients aged 50 through 80 who received the appropriate colorectal cancer screening</text>
374 <statusCode code="completed"/>
375 </act>
376 </entry>
377 <entry typeCode="DRIV">
378 <act classCode="ACT" moodCode="DEF">
379 <id root="2.16.840.1.113883.3.249.11.14" />
380 <code code="PQRI-124" codeSystem="2.16.840.1.113883.3.249.12" displayName="Adoption/Use of Electronic Health Records (EHR)"/>
381 <text>Documents whether provider has adopted and is using health information technology. To qualify, the provider must havea adopted and be using a certified/qualified electronic health record (EHR)</text>
382 <statusCode code="completed"/>
383 </act>
384 </entry>
385 <entry typeCode="DRIV">
386 <act classCode="ACT" moodCode="DEF">
387 <id root="2.16.840.1.113883.3.249.11.14" />
388 <code code="eRx" codeSystem="2.16.840.1.113883.3.249.12" displayName="Adoption/Use of Medication Electronic Prescribing Measure"/>
389 <text>Documents whether provider has adopted and is using ePrescribing</text>
390 <statusCode code="completed"/>
391 </act>
392 </entry>-->
393
394 <!--******************************************
395 Begin 2011 measures
396 ********************************************-->
397 <!--<entry typeCode="DRIV">
398 <act classCode="ACT" moodCode="DEF">
399 <id root="2.16.840.1.113883.3.249.11.51" />
400 <code code="PQRI-39" codeSystem="2.16.840.1.113883.3.249.12" displayName="Screening or Therapy for Osteoporosis for Women Aged 65 Years and Older"/>
401 <text>Percentage of patients who had a DXA measurement ordered or performed at least once since age 60 or pharmacologic therapy prescribed within 12 months before the end of the measurement period</text>
402 <statusCode code="completed"/>
403 </act>
404 </entry>
405 <entry typeCode="DRIV">
406 <act classCode="ACT" moodCode="DEF">
407 <id root="2.16.840.1.113883.3.249.11.52" />
408 <code code="PQRI-47" codeSystem="2.16.840.1.113883.3.249.12" displayName="Advance Care Plan"/>
409 <text>Percentage of patients age 65 and older who have an advanced care plan or surrogate decision maker documented in the medical record or documented in the medical record that an advance care plan was discussed but the patient did not wish or was not able to name a surrogate decision maker or provide an advance care plan.</text>
410 <statusCode code="completed"/>
411 </act>
412 </entry>
413 <entry typeCode="DRIV">
414 <act classCode="ACT" moodCode="DEF">
415 <id root="2.16.840.1.113883.3.249.11.53" />
416 <code code="PQRI-48" codeSystem="2.16.840.1.113883.3.249.12" displayName="Urinary Incontinence: Assessment of Presence or Absence of Urinary Incontinence in Women Aged 65 Years and Older"/>
417 <text>Percentage of patients equal to or older than 65 years of age at the beginning of the measurement perion who were assesed for the presence or absence of urinary incontinence within 12 months.</text>
418 <statusCode code="completed"/>
419 </act>
420 </entry>
421 <entry typeCode="DRIV">
422 <act classCode="ACT" moodCode="DEF">
423 <id root="2.16.840.1.113883.3.249.11.54" />
424 <code code="PQRI-128" codeSystem="2.16.840.1.113883.3.249.12" displayName="Preventive Care and Screening: Body Mass Index (BMI) Screening and Follow-Up"/>
425 <text>Percentage of patients aged 18 yesrs and older with a calculate BMI in the past 6 months or during the current visit documented in the medical record and if the most recent BMI is ourtide parameters, a follow-up plan is documented. Ages 65 and older BMI equal to or greater than 30 or less than 22 and ages 18-64, BMI greater than or equal to 25 or less than 18.5</text>
426 <statusCode code="completed"/>
427 </act>
428 </entry>
429 <entry typeCode="DRIV">
430 <act classCode="ACT" moodCode="DEF">
431 <id root="2.16.840.1.113883.3.249.11.55" />
432 <id root="2.16.840.1.113883.3.249.11.56" />
433 <code code="PQRI-173" codeSystem="2.16.840.1.113883.3.249.12" displayName="Preventive Care and Screening: Unhealthy Alcohol Use - Screening"/>
434 <text>Percentage of patients aged 18 years and older who were screened for unhealthy alcohol use using a systematic method within 24 months</text>
435 <statusCode code="completed"/>
436 </act>
437 </entry>
438 <entry typeCode="DRIV">
439 <act classCode="ACT" moodCode="DEF">
440 <id root="2.16.840.1.113883.3.249.11.56" />
441 <id root="2.16.840.1.113883.3.249.11.57" />
442
443 <code code="PQRI-13" codeSystem="2.16.840.1.113883.3.249.12" displayName="Hypertension (HTN): Blood Pressure Measurement"/>
444 <text>Percentage of patients aged 18 years and older with a diagnosis of hypertension in the beginning of the measurement period with a blood pressure recoreded.</text>
445 <statusCode code="completed"/>
446 </act>
447 </entry>
448 <entry typeCode="DRIV">
449 <act classCode="ACT" moodCode="DEF">
450 <id root="2.16.840.1.113883.3.249.11.57" />
451 <code code="PQRI-22" codeSystem="2.16.840.1.113883.3.249.12" displayName="Drugs to be avoided in the elderly"/>
452 <text>Percentage of patients aged 65 years and older who received at least one drug to be acoided in the elderly and/or two different drugs to be avoided in the elderly in the measurement period</text>
453 <statusCode code="completed"/>
454 </act>
455 </entry>
456 <entry typeCode="DRIV">
457 <act classCode="ACT" moodCode="DEF">
458 <id root="2.16.840.1.113883.3.249.11.58" />
459 <code code="PQRI-24" codeSystem="2.16.840.1.113883.3.249.12" displayName="BMI age 2-18 years of age"/>
460 <text>Percentage of children 2-18 years of age at the beginning of the measurement period whose weight is classified based on BMI percentile for age and gender.</text>
461 <statusCode code="completed"/>
462 </act>
463 </entry>
464 <entry typeCode="DRIV">
465 <act classCode="ACT" moodCode="DEF">
466 <id root="2.16.840.1.113883.3.249.11.59"/>
467 <code code="PQRI-28" codeSystem="2.16.840.1.113883.3.249.12" displayName="Preventive care and Screening: Tobacco Use: Screening and Cessation Intervention"/>
468 <text>Percentage of patients aged 18 years of older who were screened about tobacco use at least once during the two year measurement preoid AND who received cessation counseling if identified as a tobacco user.</text>
469 <statusCode code="completed"/>
470 </act>
471 </entry>
472 <entry typeCode="DRIV">
473 <act classCode="ACT" moodCode="DEF">
474 <id root="2.16.840.1.113883.3.249.11.60" />
475 <code code="PQRI-38" codeSystem="2.16.840.1.113883.3.249.12" displayName="Childhood immumnization status"/>
476 <text>Percentage of children who turn two years of age during the measurement period who have had four DTaP/DT, three IPV, one MMR and three H influenza type B, three hepatitis B, one chicken pox vaccine (VZV) and four pneumococcal conjugate vaccines by their second birthday</text>
477 <statusCode code="completed"/>
478 </act>
479 </entry>
480 <entry typeCode="DRIV">
481 <act classCode="ACT" moodCode="DEF">
482
483 <code code="" codeSystem="2.16.840.1.113883.3.249.12" displayName=""/>
484 <text>Documents whether provider has adopted and is using ePrescribing</text>
485 <statusCode code="completed"/>
486 </act>
487 </entry>-->
488 <!--
489 *******************************
490 Reporting Parameters Section
491 *****************************
492 -->
493 <component>
494 <section>
495 <code code="55187-9" codeSystem="2.16.840.1.113883.6.1"/>
496 <title>Reporting Parameters</title>
497 <text>
498 <list>
499 <item>Reporting Period Jan 1, 2010 to Dec 31, 2010</item>
500 </list>
501 </text>
502 <entry>
503 <act classCode="ACT" moodCode="EVN">
504 <code code="252116004" codeSystem="2.16.840.1.113883.6.96" displayName="Observation Parameters"/>
505 <effectiveTime>
506 <low value="20100101"/>
507 <high value="20101231"/>
508 </effectiveTime>
509 </act>
510 </entry>
511 </section>
512 </component>
513
514
515 <!--
516 ********************************************************
517 Patient Data
518 ********************************************************
519 -->
520 <component>
521 <section>
522 <code code="55188-7" codeSystem="2.16.840.1.113883.6.1"/>
523 <title>Patient Data</title>
524 </section>
525 </component>
526 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Procedures">
527 <component>
528 <section>
529 <templateId root="2.16.840.1.113883.10.20.1.12"/>
530 <code code="47519-4" codeSystem="2.16.840.1.113883.6.1"/>
531 <title>Procedures</title>
532 <text>
533 <table>
534 <tbody>
535 <tr>
536 <th>Type</th>
537 <th>Date</th>
538 <th>Code</th>
539 <th>Description</th>
540 <th>Location</th>
541 <th>Substance</th>
542 <th>Method</th>
543 <th>Position</th>
544 <th>Site</th>
545 <th>Status</th>
546 <th>Source</th>
547 </tr>
548 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
549 <tr>
550 <xsl:attribute name="id">
551 <xsl:value-of select="a:CCRDataObjectID"/>
552 </xsl:attribute>
553
554 <td>
555 <xsl:value-of select="a:Type/a:Text"/>
556 </td>
557 <table>
558 <tbody>
559 <xsl:apply-templates select="a:DateTime"/>
560 </tbody>
561 </table>
562 <td>
563 <xsl:apply-templates select="a:Description/a:Code"/>
564 </td>
565 <td>
566 <xsl:value-of select="a:Description/a:Text"/>
567 </td>
568 <td>
569 <xsl:for-each select="a:Locations/a:Location">
570 <xsl:value-of select="a:Description/a:Text"/>
571 <xsl:if test="a:Actor">
572 (<xsl:call-template name="actorName">
573 <xsl:with-param name="objID" select="a:Actor/a:ActorID"/>
574 </xsl:call-template>
575 <xsl:if test="a:Actor/a:ActorRole/a:Text">
576 <xsl:text xml:space="preserve"> - </xsl:text><xsl:value-of select="a:ActorRole/a:Text"/>)
577 </xsl:if>
578 </xsl:if>)
579 <xsl:if test="position() != last()">
580 <br/>
581 </xsl:if>
582 </xsl:for-each>
583 </td>
584 <td>
585 <xsl:for-each select="a:Substance">
586 <xsl:value-of select="a:Text"/>
587 </xsl:for-each>
588 </td>
589 <td>
590 <xsl:value-of select="a:Method/a:Text"/>
591 </td>
592 <td>
593 <xsl:value-of select="a:Position/a:Text"/>
594 </td>
595 <td>
596 <xsl:value-of select="a:Site/a:Text"/>
597 </td>
598 <td>
599 <xsl:value-of select="a:Status/a:Text"/>
600 </td>
601 <td>
602 <xsl:call-template name="actorName">
603 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
604 </xsl:call-template>
605 </td>
606 </tr>
607 </xsl:for-each>
608 </tbody>
609 </table>
610 </text>
611
612 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">
613 <entry typeCode="DRIV">
614 <procedure classCode="PROC" moodCode="EVN">
615 <templateId root="2.16.840.1.113883.3.88.11.83.17" assigningAuthorityName="HITSP C83"/>
616 <templateId root="2.16.840.1.113883.10.20.1.29" assigningAuthorityName="CCD"/>
617 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.19" assigningAuthorityName="IHE PCC"/>
618
619 <!-- <id> -->
620 <xsl:call-template name="ccdID">
621 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
622 </xsl:call-template>
623
624 <!-- <code> -->
625 <xsl:call-template name="ccdCodedValue">
626 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
627 <xsl:with-param name="nodeName" select="'code'"/>
628 </xsl:call-template>
629
630 <text>
631 <reference>
632 <xsl:attribute name="value">
633 <xsl:text>#</xsl:text>
634 <xsl:value-of select="a:CCRDataObjectID"/>
635 </xsl:attribute>
636 </reference>
637 </text>
638
639 <xsl:call-template name="ccdStatusProcedure">
640 <xsl:with-param name="status" select="a:Status"/>
641 </xsl:call-template>
642
643 <xsl:call-template name="ccdDateTime">
644 <xsl:with-param name="dt" select="a:DateTime"/>
645 </xsl:call-template>
646
647 <xsl:if test="a:Method">
648 <xsl:call-template name="ccdCodedValue">
649 <xsl:with-param name="ccrCodedDescription" select="a:Method"/>
650 <xsl:with-param name="nodeName" select="'approachSiteCode'"/>
651 </xsl:call-template>
652 </xsl:if>
653
654 <xsl:if test="a:Site">
655 <xsl:call-template name="ccdCodedValue">
656 <xsl:with-param name="ccrCodedDescription" select="a:Site"/>
657 <xsl:with-param name="nodeName" select="'targetSiteCode'"/>
658 </xsl:call-template>
659 </xsl:if>
660
661 <xsl:if test="a:Practitioners/a:Practitioner">
662 <xsl:call-template name="ccdPerformer">
663 <xsl:with-param name="ccrActorReference" select="a:Practitioners/a:Practitioner[1]"/>
664 </xsl:call-template>
665 </xsl:if>
666 </procedure>
667 </entry>
668 </xsl:for-each>
669 </section>
670 </component>
671 </xsl:if>
672<component>
673<section>
674<!--We are including only a coverage activity for Medicare here. There is also policy activity and and authorization activity that I don't think we need to report for QRDA, at least not for most reports-->
675<templateId root="2.16.840.1.113883.10.20.1.9"/>
676<!-- 48768-6 is payment sources and is fixed CQ-188,189,190-->
677<code code="48768-6" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Payment Sources"/>
678<!--CQ-191,192-->
679<title>Payers</title>
680<text>
681</text>
682<!--medicare-->
683<entry typeCode="DRIV">
684<!--WVP moodCode is DEF is definition to describe the characteristics of who must be involved in an act CQ-194,195-->
685<act classCode="ACT" moodCode="DEF">
686<!--WVP coverage activity template is the 10.20.1.20 CQ-193-->
687<templateId root="2.16.840.1.113883.10.20.1.20"/>
688<!--Coverage Shall Include and Act ID CQ-196-->
689<!--looks like a UUID to me-->
690<id root="2.16.840.1.113883.3.543" extension="@@@UUID-PAYER@@@"/><!--FIX!!!???-->
691<!--CQ-197-198 It appears that statusCode="completed" need to follow the code code ... here and below-->
692
693<!--CQ199,200-->
694<code code="48768-6" codeSystem="2.16.840.1.113883.6.1" displayName="Payment sources"/>
695<statusCode code="completed"/>
696
697<!--A coverage activity shall contain on or more act/entryRelationship. The value for act/entryRelationship/@typeCode shall be COMP which SHALL be the CMS QRDA Policy Activity CQ-201, 203-->
698<!--It MAY contain an entryRelationship/sequenceNumber CQ-202-->
699<entryRelationship typeCode="COMP">
700<!-- for the act is event with moodCode EVN CQ-205,206,207-->
701<act classCode="ACT" moodCode="EVN">
702<!--Policy activity is the 10.20.1.26 template CQ-205-->
703<templateId root="2.16.840.1.113883.10.20.1.26"/>
704<templateId root="2.16.840.1.113883.3.249.11.100.7"/>
705
706<!-- act/id which is the group or contract number related to the insurance policy or program CQ-208-->
707<id root="dbbb6311-8a4d-11df-a4ee-0800200c9c66"/><!--!!!FIX-->
708<!--Act statusCode must be completed CQ-210-->
709<!--This SHOULD be present and comes from the downloadable resource S display name is in quotes AUTOPOL - "automobile" policy;EHCPOL additional insurance in addition to Medicare in this case
710HSAPOL "Health Spending Account";PUBLICPOL "public healthcare" which is NOT Medicare - maybe a state program for example
711WBCPOL is "workers compensation" CQ-211,212-->
712<!--<code code="PUBLICPOL" codeSystem="2.16.840.1.113883.5.4" displayName="Public Healthcare"/>-->
713<code code="PUBLICPOL" codeSystem="2.16.840.1.113883.5.4" displayName="Public Healthcare"/>
714<!--WVP performer type codes are numerous but PRF is performer representing the Payer CQ-213-->
715<statusCode code="completed"/>
716<performer typeCode="PRF">
717
718<!--performer/assignedEntity id is the payer identification and the extension comes from the downloadable resource section I insurance plan TYPE CQ-214-->
719<assignedEntity>
720<id root="2.16.840.1.113883.12.86" extension="MC"/>
721<!--<representedOrganization>
722<name>CMS</name>
723</representedOrganization>-->
724</assignedEntity>
725</performer>
726<!-- Act/participant @typeCode this represents the covered party CQ-215-->
727<participant typeCode="COV">
728<participantRole>
729<!--A covered party in a policy activity SHOULD contain one or more participant/participantRole/id to represent the patien's member of subscriber identifier with respect to the payer
730For participant/paricipantRole/id either the Social Security Number or HIC Number SHALL be submitted for Medicare patients. for SSN the ID @root SHALL be 2.16.840.1.113883.4.1 where
731the HIC id/@root shall be 2.16.840.1.113883.3.249.13 CQ-216"RoleCode" in the downloadable resource-->
732<!-- in this case theextension is the patients SSN for a medicare patient so it is the same each time for one patient-->
733<id root="2.16.840.1.113883.4.1" extension="@@SSN@@"/>
734<!--The covered party in tha policy activity SHOULD contain exactly one particpant/participantRole/code for self, family etc from the valuse set PolicyOrPrograCoverageRoleType 2.16.840.1.113883.1.11.19809 CQ-217,218-->
735<code code="SELF" codeSystem="2.16.840.1.113883.5.111" displayName="Self"/>
736</participantRole>
737</participant>
738</act>
739</entryRelationship>
740</act>
741</entry>
742</section>
743</component>
744</section>
745</component>
746</section>
747</component>
748</structuredBody>
749</component>
750</ClinicalDocument>
751 </xsl:template>
752 <xsl:template name="ccdAssignedEntity">
753 <xsl:param name="ccrActorObjectID"/>
754
755 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
756
757 <assignedEntity>
758 <xsl:call-template name="ccdEntityID">
759 <xsl:with-param name="CCRActor" select="$CCRActor"/>
760 </xsl:call-template>
761
762 <xsl:call-template name="ccdAddress">
763 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address"/>
764 </xsl:call-template>
765
766 <xsl:call-template name="ccdTelecom">
767 <xsl:with-param name="CCRActor" select="$CCRActor"/>
768 </xsl:call-template>
769
770 <xsl:if test="$CCRActor/a:Person">
771 <xsl:call-template name="ccdPerson">
772 <xsl:with-param name="CCRActorPerson" select="$CCRActor/a:Person"/>
773 <xsl:with-param name="personNodeName" select="'assignedPerson'"/>
774 </xsl:call-template>
775 </xsl:if>
776
777 <xsl:if test="$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']">
778 <xsl:call-template name="ccdOrganization">
779 <xsl:with-param name="ccrActorObjectID" select="$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']/a:LinkID"/>
780 <xsl:with-param name="organizationNodeName" select="'representedOrganization'"/>
781 </xsl:call-template>
782 </xsl:if>
783
784 </assignedEntity>
785 </xsl:template>
786
787 <xsl:template name="ccdPatient">
788 <xsl:param name="CCRActorPerson"/>
789 <patient>
790 <xsl:call-template name="ccdPersonName">
791 <xsl:with-param name="CCRActorName" select="$CCRActorPerson/a:Name"/>
792 </xsl:call-template>
793
794 <xsl:if test="$CCRActorPerson/a:Gender">
795 <xsl:call-template name="ccdCodedValue">
796 <xsl:with-param name="ccrCodedDescription" select="$CCRActorPerson/a:Gender"/>
797 <xsl:with-param name="domain" select="'AdministrativeGender'"/>
798 <xsl:with-param name="nodeName" select="'administrativeGenderCode'"/>
799 </xsl:call-template>
800 </xsl:if>
801
802 <xsl:if test="$CCRActorPerson/a:DateOfBirth">
803 <birthTime>
804 <xsl:attribute name="value">
805 <xsl:call-template name="date:format-date">
806 <xsl:with-param name="date-time" select="$CCRActorPerson/a:DateOfBirth/a:ExactDateTime"/>
807 <xsl:with-param name="pattern">yyyyMMddhhmmss</xsl:with-param>
808 </xsl:call-template>
809 </xsl:attribute>
810 </birthTime>
811 </xsl:if>
812
813 <xsl:if test="/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Marital Status']">
814 <xsl:call-template name="ccdCodedValue">
815 <xsl:with-param name="ccrCodedDescription" select="/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Marital Status']/a:Description"/>
816 <xsl:with-param name="domain" select="'MaritalStatus'"/>
817 <xsl:with-param name="nodeName" select="'maritalStatusCode'"/>
818 </xsl:call-template>
819 </xsl:if>
820
821 <xsl:if test="/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Language']">
822 <languageCommunication>
823 <templateId root="2.16.840.1.113883.3.88.11.83.2" assigningAuthorityName="HITSP/C83"/>
824 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.2.1" assigningAuthorityName="IHE/PCC"/>
825 <xsl:call-template name="ccdCodedValue">
826 <xsl:with-param name="ccrCodedDescription" select="/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Language']/a:Description"></xsl:with-param>
827 <xsl:with-param name="domain" select="'HumanLanguage'"/>
828 <xsl:with-param name="nodeName" select="'languageCode'"/>
829 </xsl:call-template>
830 </languageCommunication>
831 </xsl:if>
832 </patient>
833 </xsl:template>
834
835 <xsl:template name="ccdPerformer">
836 <xsl:param name="ccrActorReference"/>
837 <performer typeCode="PRF">
838 <xsl:if test="$ccrActorReference/a:ActorRole">
839 <xsl:call-template name="ccdCodedValue">
840 <xsl:with-param name="ccrCodedDescription" select="$ccrActorReference/a:ActorRole"/>
841 <xsl:with-param name="nodeName" select="'functionCode'"/>
842 </xsl:call-template>
843 </xsl:if>
844 <xsl:call-template name="ccdAssignedEntity">
845 <xsl:with-param name="ccrActorObjectID" select="$ccrActorReference/a:ActorID"/>
846 </xsl:call-template>
847 </performer>
848 </xsl:template>
849
850 <xsl:template name="ccdPerson">
851 <xsl:param name="CCRActorPerson"/>
852 <xsl:param name="personNodeName">assignedPerson</xsl:param>
853 <xsl:element name="{$personNodeName}">
854 <xsl:call-template name="ccdPersonName">
855 <xsl:with-param name="CCRActorName" select="$CCRActorPerson/a:Name"/>
856 </xsl:call-template>
857 </xsl:element>
858 </xsl:template>
859
860 <xsl:template name="ccdPersonName">
861 <xsl:param name="CCRActorName"/>
862 <name>
863 <xsl:if test="$CCRActorName/a:CurrentName/a:Title">
864 <prefix>
865 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Title"/>
866 </prefix>
867 </xsl:if>
868 <xsl:if test="$CCRActorName/a:CurrentName/a:Given">
869 <given>
870 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Given"/>
871 </given>
872 </xsl:if>
873 <xsl:if test="$CCRActorName/a:CurrentName/a:Middle">
874 <given>
875 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Middle"/>
876 </given>
877 </xsl:if>
878 <xsl:if test="$CCRActorName/a:CurrentName/a:Family">
879 <family>
880 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Family"/>
881 </family>
882 </xsl:if>
883 <xsl:if test="$CCRActorName/a:CurrentName/a:Suffix">
884 <suffix>
885 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Suffix"/>
886 </suffix>
887 </xsl:if>
888 </name>
889 </xsl:template>
890
891 <xsl:template name="ccdOrganization">
892 <xsl:param name="ccrActorObjectID"/>
893 <xsl:param name="organizationNodeName"/>
894
895 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
896
897 <xsl:element name="{$organizationNodeName}">
898 <xsl:call-template name="ccdEntityID">
899 <xsl:with-param name="CCRActor" select="$CCRActor"/>
900 </xsl:call-template>
901 <xsl:call-template name="ccdTelecom">
902 <xsl:with-param name="CCRActor" select="$CCRActor"/>
903 </xsl:call-template>
904
905 <xsl:call-template name="ccdAddress">
906 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address[1]"/>
907 </xsl:call-template>
908 </xsl:element>
909 </xsl:template>
910
911 <xsl:template name="ccdPatientRole">
912 <xsl:param name="ccrActorObjectID"/>
913
914 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
915
916 <xsl:call-template name="ccdEntityID">
917 <xsl:with-param name="CCRActor" select="$CCRActor"/>
918 </xsl:call-template>
919
920 <xsl:call-template name="ccdAddress">
921 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address[1]"/>
922 </xsl:call-template>
923
924 <xsl:call-template name="ccdTelecom">
925 <xsl:with-param name="CCRActor" select="$CCRActor"/>
926 </xsl:call-template>
927
928 <xsl:call-template name="ccdPatient">
929 <xsl:with-param name="CCRActorPerson" select="$CCRActor/a:Person"/>
930 </xsl:call-template>
931 </xsl:template>
932
933 <xsl:template name="ccdAssignedAuthor">
934 <xsl:param name="ccrActorObjectID"/>
935 <assignedAuthor>
936 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
937
938 <xsl:call-template name="ccdEntityID">
939 <xsl:with-param name="CCRActor" select="$CCRActor"/>
940 </xsl:call-template>
941
942 <xsl:call-template name="ccdAddress">
943 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address[1]"/>
944 </xsl:call-template>
945
946 <xsl:call-template name="ccdTelecom">
947 <xsl:with-param name="CCRActor" select="$CCRActor"/>
948 </xsl:call-template>
949
950 <xsl:call-template name="ccdPerson">
951 <xsl:with-param name="CCRActorPerson" select="$CCRActor/a:Person"/>
952 </xsl:call-template>
953
954 <xsl:if test="$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']">
955 <representedOrganization>
956 <xsl:call-template name="ccdOrganization">
957 <xsl:with-param name="ccrActorObjectID" select="$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']/a:LinkID"/>
958 </xsl:call-template>
959 </representedOrganization>
960 </xsl:if>
961 </assignedAuthor>
962 </xsl:template>
963
964 <xsl:template name="ccdParticipantRoleActor">
965 <xsl:param name="ccrActorObjectID"/>
966
967 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
968
969 <xsl:call-template name="ccdEntityID">
970 <xsl:with-param name="CCRActor" select="$CCRActor"/>
971 </xsl:call-template>
972
973 <xsl:call-template name="ccdAddress">
974 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address[1]"/>
975 </xsl:call-template>
976
977 <xsl:call-template name="ccdTelecom">
978 <xsl:with-param name="CCRActor" select="$CCRActor"/>
979 </xsl:call-template>
980
981 <xsl:if test="$CCRActor/a:Organization/a:Name">
982 <playingEntity classCode="PLC">
983 <name>
984 <xsl:value-of select="$CCRActor/a:Organization/a:Name"/>
985 </name>
986 </playingEntity>
987 </xsl:if>
988 </xsl:template>
989
990 <xsl:template name="ccdParticipantRoleCodedDescription">
991 <xsl:param name="ccrCodedDescription"/>
992 <participantRole classCode="MANU">
993 <!--Product Detail-->
994 <playingEntity classCode="MMAT">
995 <xsl:if test="$ccrCodedDescription/a:Code">
996 <xsl:call-template name="ccdCodedValue">
997 <xsl:with-param name="ccrCodedDescription" select="$ccrCodedDescription"/>
998 <xsl:with-param name="nodeName" select="'code'"/>
999 </xsl:call-template>
1000 </xsl:if>
1001 <name>
1002 <xsl:value-of select="$ccrCodedDescription/a:Text"/>
1003 </name>
1004 </playingEntity>
1005 </participantRole>
1006 </xsl:template>
1007
1008 <xsl:template name="ccdEntityID">
1009 <xsl:param name="CCRActor"/>
1010 <id>
1011 <xsl:choose>
1012 <xsl:when test="$CCRActor/a:IDs">
1013 <xsl:attribute name="extension">
1014 <xsl:value-of select="$CCRActor/a:IDs[1]/a:ID"/>
1015 </xsl:attribute>
1016 <xsl:attribute name="root">
1017 <xsl:value-of select="$CCRActor/a:IDs[1]/a:Type/a:Text"/>
1018 </xsl:attribute>
1019 </xsl:when>
1020 <xsl:otherwise>
1021 <xsl:attribute name="extension">
1022 <xsl:value-of select="$CCRActor/a:ActorObjectID"/>
1023 </xsl:attribute>
1024 <xsl:attribute name="root">
1025 <xsl:text>CCRActorID</xsl:text>
1026 </xsl:attribute>
1027 </xsl:otherwise>
1028 </xsl:choose>
1029 </id>
1030 <xsl:if test="$CCRActor/a:Organization">
1031 <name><xsl:value-of select="$CCRActor/a:Organization/a:Name"></xsl:value-of></name>
1032 </xsl:if>
1033 </xsl:template>
1034 <xsl:template name="ccdAddress">
1035 <xsl:param name="CCRActorAddress"/>
1036 <addr>
1037 <xsl:choose>
1038 <xsl:when test="$CCRActorAddress">
1039 <xsl:attribute name="use">
1040 <xsl:call-template name="CDAVocabularyLookup">
1041 <xsl:with-param name="domain" select="'telecommunicationsAddressUse'"/>
1042 <xsl:with-param name="ccrtext" select="$CCRActorAddress/a:Type/a:Text"/>
1043 </xsl:call-template>
1044 </xsl:attribute>
1045 <streetAddressLine>
1046 <xsl:value-of select="$CCRActorAddress/a:Line1"/>
1047 </streetAddressLine>
1048 <city>
1049 <xsl:value-of select="$CCRActorAddress/a:City"/>
1050 </city>
1051 <state>
1052 <xsl:value-of select="$CCRActorAddress/a:State"/>
1053 </state>
1054 <postalCode>
1055 <xsl:value-of select="$CCRActorAddress/a:PostalCode"/>
1056 </postalCode>
1057 </xsl:when>
1058 <xsl:otherwise>
1059 <streetAddressLine/>
1060 </xsl:otherwise>
1061 </xsl:choose>
1062 </addr>
1063 </xsl:template>
1064
1065 <xsl:template name="ccdTelecom">
1066 <xsl:param name="CCRActor"/>
1067 <telecom>
1068 <xsl:if test="$CCRActor/a:Telephone">
1069 <xsl:attribute name="use">
1070 <xsl:call-template name="CDAVocabularyLookup">
1071 <xsl:with-param name="domain" select="'telecommunicationsAddressUse'"/>
1072 <xsl:with-param name="ccrtext" select="$CCRActor/a:Telephone/a:Type/a:Text"/>
1073 </xsl:call-template>
1074 </xsl:attribute>
1075 <xsl:attribute name="value">
1076 <xsl:text>tel:+1-</xsl:text>
1077 <xsl:value-of select="$CCRActor/a:Telephone[1]/a:Value"/>
1078 </xsl:attribute>
1079 </xsl:if>
1080 </telecom>
1081
1082 <xsl:if test="$CCRActor/a:Email">
1083 <telecom>
1084 <xsl:choose>
1085 <xsl:when test="$CCRActor/a:Telephone">
1086 <xsl:attribute name="use">
1087 <xsl:call-template name="CDAVocabularyLookup">
1088 <xsl:with-param name="domain" select="'telecommunicationsAddressUse'"/>
1089 <xsl:with-param name="ccrtext" select="$CCRActor/a:Telephone/a:Type/a:Text"/>
1090 </xsl:call-template>
1091 </xsl:attribute>
1092 <xsl:attribute name="value">
1093 <xsl:text>mailto:</xsl:text>
1094 <xsl:value-of select="$CCRActor/a:Email[1]/a:Value"/>
1095 </xsl:attribute>
1096 </xsl:when>
1097 <xsl:otherwise>
1098 <xsl:attribute name="value">
1099 <xsl:text>Unknown</xsl:text>
1100 </xsl:attribute>
1101 </xsl:otherwise>
1102 </xsl:choose>
1103 </telecom>
1104 </xsl:if>
1105 </xsl:template>
1106
1107 <xsl:template name="ccdID">
1108 <xsl:param name="ccrObjectID"/>
1109 <xsl:param name="suffix"/>
1110 <id>
1111 <xsl:attribute name="root">
1112 <xsl:value-of select="$ccrObjectID"></xsl:value-of>
1113 </xsl:attribute>
1114 <xsl:attribute name="extension">CCRObjectID</xsl:attribute>
1115 </id>
1116 </xsl:template>
1117
1118 <xsl:template name="ccdCodedValue">
1119 <xsl:param name="ccrCodedDescription"/>
1120 <xsl:param name="type"/>
1121 <xsl:param name="domain"/>
1122 <xsl:param name="nodeName">value</xsl:param>
1123 <xsl:param name="originalTextReference"/>
1124
1125 <xsl:element name="{$nodeName}">
1126 <xsl:if test="$type">
1127 <xsl:attribute name="xsi:type">
1128 <xsl:value-of select="$type"/>
1129 </xsl:attribute>
1130 </xsl:if>
1131 <xsl:choose>
1132 <xsl:when test="$ccrCodedDescription/a:Code">
1133 <xsl:attribute name="displayName">
1134 <xsl:value-of select="$ccrCodedDescription/a:Text"/>
1135 </xsl:attribute>
1136 <xsl:attribute name="code">
1137 <xsl:value-of select="$ccrCodedDescription/a:Code/a:Value"/>
1138 </xsl:attribute>
1139 <xsl:attribute name="codeSystemName">
1140 <xsl:value-of select="$ccrCodedDescription/a:Code/a:CodingSystem"/>
1141 </xsl:attribute>
1142 <xsl:attribute name="codeSystem">
1143 <xsl:call-template name="HL7OIDLookup">
1144 <xsl:with-param name="name" select="$ccrCodedDescription/a:Code/a:CodingSystem"/>
1145 </xsl:call-template>
1146 </xsl:attribute>
1147 </xsl:when>
1148 <xsl:when test="$domain">
1149 <xsl:variable name="cdaCode">
1150 <xsl:call-template name="CDAVocabularyLookup">
1151 <xsl:with-param name="domain" select="$domain"/>
1152 <xsl:with-param name="ccrtext" select="$ccrCodedDescription/a:Text"/>
1153 </xsl:call-template>
1154 </xsl:variable>
1155 <xsl:attribute name="displayName">
1156 <xsl:call-template name="CDADisplayNameLookup">
1157 <xsl:with-param name="domain" select="$domain"/>
1158 <xsl:with-param name="cdacode" select="$cdaCode"/>
1159 </xsl:call-template>
1160 </xsl:attribute>
1161 <xsl:attribute name="code">
1162 <xsl:value-of select="$cdaCode"></xsl:value-of>
1163 </xsl:attribute>
1164 <xsl:attribute name="codeSystemName">
1165 <xsl:call-template name="CDAVocabularyCodeSystemNameLookup">
1166 <xsl:with-param name="domain" select="$domain"/>
1167 </xsl:call-template>
1168 </xsl:attribute>
1169 <xsl:attribute name="codeSystemName">
1170 <xsl:call-template name="CDAVocabularyCodeSystemLookup">
1171 <xsl:with-param name="domain" select="$domain"/>
1172 </xsl:call-template>
1173 </xsl:attribute>
1174 </xsl:when>
1175 <xsl:otherwise>
1176 <originalText>
1177 <xsl:value-of select="$ccrCodedDescription/a:Text"/>
1178 <xsl:if test="$originalTextReference">
1179 <reference>
1180 <xsl:attribute name="value">
1181 <xsl:value-of select="$originalTextReference"/>
1182 </xsl:attribute>
1183 </reference>
1184 </xsl:if>
1185 </originalText>
1186 </xsl:otherwise>
1187 </xsl:choose>
1188 </xsl:element>
1189 </xsl:template>
1190
1191 <xsl:template name="ccdDateTime">
1192 <xsl:param name="dt"/>
1193 <xsl:param name="type"/>
1194 <xsl:if test="$dt">
1195 <xsl:if test="$dt[1]/a:ExactDateTime">
1196 <effectiveTime>
1197 <xsl:if test="$type">
1198 <xsl:attribute name="xsi:type">
1199 <xsl:value-of select="$type"></xsl:value-of>
1200 </xsl:attribute>
1201 </xsl:if>
1202 <low>
1203 <xsl:attribute name="value">
1204 <xsl:call-template name="date:format-date">
1205 <xsl:with-param name="date-time" select="$dt[1]/a:ExactDateTime"/>
1206 <xsl:with-param name="pattern">yyyyMMdd</xsl:with-param>
1207 </xsl:call-template>
1208 </xsl:attribute>
1209 </low>
1210 <high nullFlavor="UNK"/>
1211 </effectiveTime>
1212 </xsl:if>
1213 <xsl:if test="$dt[1]/a:DateTimeRange">
1214 <effectiveTime>
1215 <low>
1216 <xsl:attribute name="value">
1217 <xsl:call-template name="date:format-date">
1218 <xsl:with-param name="date-time" select="$dt[1]/a:DateTimeRange/a:BeginRange/a:ExactDateTime"/>
1219 <xsl:with-param name="pattern">yyyyMMdd</xsl:with-param>
1220 </xsl:call-template>
1221 </xsl:attribute>
1222 </low>
1223 <high>
1224 <xsl:attribute name="value">
1225 <xsl:call-template name="date:format-date">
1226 <xsl:with-param name="date-time" select="$dt[1]/a:DateTimeRange/a:EndRange/a:ExactDateTime"/>
1227 <xsl:with-param name="pattern">yyyyMMdd</xsl:with-param>
1228 </xsl:call-template>
1229 </xsl:attribute>
1230 </high>
1231 </effectiveTime>
1232 </xsl:if>
1233 </xsl:if>
1234 </xsl:template>
1235
1236 <xsl:template name="ccdMedicationFrequency">
1237 <xsl:param name="frequency"/>
1238 <xsl:if test="$frequency">
1239 <xsl:choose>
1240 <xsl:when test="$frequency/a:Value='qd'">
1241 <effectiveTime xsi:type="PIVL_TS" operator="A">
1242 <xsl:attribute name="institutionSpecified">true</xsl:attribute>
1243 <period>
1244 <xsl:attribute name="value">24</xsl:attribute>
1245 <xsl:attribute name="unit">h</xsl:attribute>
1246 </period>
1247 </effectiveTime>
1248 </xsl:when>
1249 <xsl:when test="$frequency/a:Value='bid'">
1250 <effectiveTime xsi:type="PIVL_TS" operator="A">
1251 <xsl:attribute name="institutionSpecified">true</xsl:attribute>
1252 <period>
1253 <xsl:attribute name="value">12</xsl:attribute>
1254 <xsl:attribute name="unit">h</xsl:attribute>
1255 </period>
1256 </effectiveTime>
1257 </xsl:when>
1258 <xsl:when test="$frequency/a:Value='tid'">
1259 <effectiveTime xsi:type="PIVL_TS" operator="A">
1260 <xsl:attribute name="institutionSpecified">true</xsl:attribute>
1261 <period>
1262 <xsl:attribute name="value">8</xsl:attribute>
1263 <xsl:attribute name="unit">h</xsl:attribute>
1264 </period>
1265 </effectiveTime>
1266 </xsl:when>
1267 <xsl:when test="$frequency/a:Value='qid'">
1268 <effectiveTime xsi:type="PIVL_TS" operator="A">
1269 <xsl:attribute name="institutionSpecified">true</xsl:attribute>
1270 <period>
1271 <xsl:attribute name="value">6</xsl:attribute>
1272 <xsl:attribute name="unit">h</xsl:attribute>
1273 </period>
1274 </effectiveTime>
1275 </xsl:when>
1276 <xsl:when test="$frequency/a:Value='qam'">
1277 <effectiveTime xsi:type='EIVL' operator='A'>
1278 <event code='ACM'/>
1279 </effectiveTime>
1280 </xsl:when>
1281 <xsl:when test="$frequency/a:Value='qpm'">
1282 <effectiveTime xsi:type='EIVL' operator='A'>
1283 <event code='PCV'/>
1284 </effectiveTime>
1285 </xsl:when>
1286 </xsl:choose>
1287 </xsl:if>
1288 </xsl:template>
1289
1290 <xsl:template name="ccdStatus">
1291 <xsl:param name="ccrStatus"/>
1292
1293 <entryRelationship typeCode="REFR">
1294 <observation classCode="OBS" moodCode="EVN">
1295 <templateId root="2.16.840.1.113883.10.20.1.50"/>
1296 <!-- Problem status observation template -->
1297 <code code="33999-4" codeSystem="2.16.840.1.113883.6.1" displayName="Status"/>
1298 <statusCode code="completed"/>
1299 <xsl:call-template name="ccdCodedValue">
1300 <xsl:with-param name="ccrCodedDescription" select="$ccrStatus"/>
1301 </xsl:call-template>
1302 </observation>
1303 </entryRelationship>
1304 </xsl:template>
1305
1306 <xsl:template name="ccdStatusObservation">
1307 <xsl:param name="status"/>
1308 <xsl:variable name="statusText" select="$status/a:Text"></xsl:variable>
1309 <xsl:choose>
1310 <xsl:when test="$statusText='Active'">
1311 <xsl:call-template name="ccdStatusElement">
1312 <xsl:with-param name="statusCode" select="'55561003'"/>
1313 <xsl:with-param name="statusDisplayName" select="$statusText"/>
1314 </xsl:call-template>
1315 </xsl:when>
1316 <xsl:when test="$statusText='Inactive'">
1317 <xsl:call-template name="ccdStatusElement">
1318 <xsl:with-param name="statusCode" select="'73425007'"/>
1319 <xsl:with-param name="statusDisplayName" select="$statusText"/>
1320 </xsl:call-template>
1321 </xsl:when>
1322 <xsl:when test="$statusText='Chronic'">
1323 <xsl:call-template name="ccdStatusElement">
1324 <xsl:with-param name="statusCode" select="'90734009'"/>
1325 <xsl:with-param name="statusDisplayName" select="$statusText"/>
1326 </xsl:call-template>
1327 </xsl:when>
1328 </xsl:choose>
1329 </xsl:template>
1330
1331 <xsl:template name="ccdStatusProcedure">
1332 <xsl:param name="status"/>
1333 <xsl:variable name="statusText" select="$status/a:Text"></xsl:variable>
1334 <xsl:choose>
1335 <xsl:when test="$statusText='Completed'">
1336 <statusCode code="completed"/>
1337 </xsl:when>
1338 <xsl:when test="$statusText='Active'">
1339 <statusCode code="active"/>
1340 </xsl:when>
1341 <xsl:when test="$statusText='Aborted'">
1342 <statusCode code="aborted"/>
1343 </xsl:when>
1344 <xsl:when test="$statusText='Cancelled' or $statusText='Canceled'">
1345 <statusCode code="cancelled"/>
1346 </xsl:when>
1347 <xsl:otherwise>
1348 <statusCode>
1349 <xsl:attribute name="code">
1350 <xsl:value-of select="$statusText"></xsl:value-of>
1351 </xsl:attribute>
1352 </statusCode>
1353 </xsl:otherwise>
1354 </xsl:choose>
1355 </xsl:template>
1356
1357 <xsl:template name="ccdStatusElement">
1358 <xsl:param name="statusCode"/>
1359 <xsl:param name="statusDisplayName"/>
1360 <value>
1361 <xsl:attribute name="xsi:type">CE</xsl:attribute>
1362 <xsl:attribute name="code">
1363 <xsl:value-of select="$statusCode"></xsl:value-of>
1364 </xsl:attribute>
1365 <xsl:attribute name="codeSystem">2.16.840.1.113883.6.96</xsl:attribute>
1366 <xsl:attribute name="displayName">
1367 <xsl:value-of select="$statusDisplayName"></xsl:value-of>
1368 </xsl:attribute>
1369 </value>
1370 </xsl:template>
1371
1372 <xsl:template name="ccdObservation">
1373 <xsl:param name="ccrTestNode"/>
1374 <xsl:param name="testDate"/>
1375
1376 <component>
1377 <observation classCode="OBS" moodCode="EVN">
1378 <templateId root="2.16.840.1.113883.3.88.11.83.15" assigningAuthorityName="HITSP C83"/>
1379 <templateId root="2.16.840.1.113883.10.20.1.31" assigningAuthorityName="CCD"/>
1380 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13" assigningAuthorityName="IHE PCC"/>
1381
1382 <!-- Result observation template -->
1383
1384 <xsl:call-template name="ccdID">
1385 <xsl:with-param name="ccrObjectID" select="$ccrTestNode/a:CCRDataObjectID"/>
1386 </xsl:call-template>
1387
1388 <!-- <code> -->
1389 <xsl:call-template name="ccdCodedValue">
1390 <xsl:with-param name="ccrCodedDescription" select="$ccrTestNode/a:Description"/>
1391 <xsl:with-param name="nodeName" select="'code'"/>
1392 </xsl:call-template>
1393
1394 <text>
1395 <reference>
1396 <xsl:attribute name="value">
1397 <xsl:text>#</xsl:text>
1398 <xsl:value-of select="$ccrTestNode/a:CCRDataObjectID"/>
1399 </xsl:attribute>
1400 </reference>
1401 </text>
1402
1403 <statusCode code="completed"/>
1404
1405 <!-- <effectiveTime> -->
1406 <xsl:choose>
1407 <xsl:when test="$ccrTestNode/a:DateTime">
1408 <xsl:call-template name="ccdDateTime">
1409 <xsl:with-param name="dt" select="$ccrTestNode/a:DateTime"/>
1410 </xsl:call-template>
1411 </xsl:when>
1412 <xsl:otherwise>
1413 <xsl:call-template name="ccdDateTime">
1414 <xsl:with-param name="dt" select="$testDate"/>
1415 </xsl:call-template>
1416 </xsl:otherwise>
1417 </xsl:choose>
1418
1419 <xsl:choose>
1420 <xsl:when test="$ccrTestNode/a:TestResult[a:Value!='']">
1421 <value xsi:type="PQ">
1422 <xsl:attribute name="value">
1423 <xsl:value-of select="$ccrTestNode/a:TestResult/a:Value"/>
1424 </xsl:attribute>
1425 <xsl:attribute name="unit">
1426 <xsl:value-of select="$ccrTestNode/a:TestResult/a:Units/a:Unit"/>
1427 </xsl:attribute>
1428 </value>
1429 </xsl:when>
1430 <xsl:when test="$ccrTestNode/a:TestResult[a:Description/a:Text!='']">
1431 <value xsi:type="TX">
1432 <xsl:attribute name="value">
1433 <xsl:value-of select="$ccrTestNode/a:TestResult/a:Description/a:Text"/>
1434 </xsl:attribute>
1435 </value>
1436 </xsl:when>
1437 </xsl:choose>
1438
1439 <xsl:if test="$ccrTestNode/a:Flag">
1440 <xsl:call-template name="ccdCodedValue">
1441 <xsl:with-param name="ccrCodedDescription" select="$ccrTestNode/a:Flag"/>
1442 <xsl:with-param name="nodeName" select="'interpretationCode'"/>
1443 <xsl:with-param name="domain" select="'ObservationInterpretation'"/>
1444 </xsl:call-template>
1445 </xsl:if>
1446
1447 <xsl:if test="$ccrTestNode/a:NormalResult">
1448 <referenceRange>
1449 <xsl:if test="$ccrTestNode/a:NormalResult/a:Normal/a:Description/a:Text">
1450 <observationRange>
1451 <text>
1452 <xsl:value-of select="$ccrTestNode/a:NormalResult/a:Normal/a:Description/a:Text"/>
1453 </text>
1454 </observationRange>
1455 </xsl:if>
1456 </referenceRange>
1457 </xsl:if>
1458
1459 </observation>
1460 </component>
1461
1462 </xsl:template>
1463</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.