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

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

latest

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