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

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

latest

File size: 66.7 KB
Line 
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:Payers">
518 <component>
519 <section>
520 <templateId root="2.16.840.1.113883.10.20.1.9"/>
521 <code code="48768-6" codeSystem="2.16.840.1.113883.6.1"/>
522 <title>Insurance</title>
523 <text>
524 <table>
525 <tbody>
526 <tr>
527 <th>Type</th>
528 <th>Date</th>
529 <th>Identification Numbers</th>
530 <th>Payment Provider</th>
531 <th>Subscriber</th>
532 <th>Source</th>
533 </tr>
534 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Payers/a:Payer">
535 <tr>
536 <td>
537 <xsl:value-of select="a:Type/a:Text"/>
538 </td>
539 <td>
540 <xsl:call-template name="date:format-date">
541 <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/>
542 </xsl:call-template>
543 </td>
544 <td>
545 <xsl:for-each select="a:IDs">
546 <xsl:value-of select="a:Type/a:Text"/>:<xsl:text xml:space="preserve"> </xsl:text><xsl:value-of select="a:ID"/><br/>
547 </xsl:for-each>
548 </td>
549 <td>
550 <xsl:call-template name="actorName">
551 <xsl:with-param name="objID" select="a:PaymentProvider/a:ActorID"/>
552 </xsl:call-template>
553 </td>
554 <td>
555 <xsl:call-template name="actorName">
556 <xsl:with-param name="objID" select="a:Subscriber/a:ActorID"/>
557 </xsl:call-template>
558 </td>
559 <td>
560 <xsl:call-template name="actorName">
561 <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/>
562 </xsl:call-template>
563 </td>
564 </tr>
565 </xsl:for-each>
566 </tbody>
567 </table>
568 </text>
569 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Payers/a:Payer">
570 <entry typeCode="DRIV">
571 <act classCode="ACT" moodCode="DEF">
572 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.17" assigningAuthorityName="IHE PCC"/>
573 <templateId root="2.16.840.1.113883.10.20.1.20" assigningAuthorityName="CCD"/>
574 <!-- Coverage entry template -->
575 <!-- <id> -->
576 <xsl:call-template name="ccdID">
577 <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/>
578 </xsl:call-template>
579 <code code="48768-6" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Payment sources"/>
580 <statusCode code="completed"/>
581 <entryRelationship typeCode="COMP">
582 <act classCode="ACT" moodCode="EVN">
583 <templateId root="2.16.840.1.113883.3.88.11.83.5" assigningAuthorityName="HITSP C83"/>
584 <templateId root="2.16.840.1.113883.10.20.1.26" assigningAuthorityName="CCD"/>
585 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.18" assigningAuthorityName="IHE PCC"/>
586 <!--Insurance provider template -->
587 <id>
588 <xsl:attribute name="root">
589 <xsl:value-of select="a:IDs[1]/a:ID"/>
590 </xsl:attribute>
591 <xsl:attribute name="extension">
592 <xsl:value-of select="a:IDs[1]/a:Type/a:Text"/>
593 </xsl:attribute>
594 </id>
595
596 <!-- <code> -->
597 <xsl:call-template name="ccdCodedValue">
598 <xsl:with-param name="ccrCodedDescription" select="a:Description"/>
599 <xsl:with-param name="nodeName" select="'code'"/>
600 </xsl:call-template>
601
602 <statusCode code="completed"/>
603
604 <xsl:call-template name="ccdPerformer">
605 <xsl:with-param name="ccrActorReference" select="a:PaymentProvider"/>
606 </xsl:call-template>
607
608 <participant typeCode="HLD">
609 <xsl:call-template name="ccdParticipantRoleActor">
610 <xsl:with-param name="ccrActorReference" select="a:Subscriber"/>
611 </xsl:call-template>
612 </participant>
613 </act>
614 </entryRelationship>
615 </act>
616 </entry>
617 </xsl:for-each>
618 </section>
619 </component>
620 </xsl:if>
621</section>
622</component>
623</section>
624</component>
625</structuredBody>
626</component>
627</ClinicalDocument>
628 </xsl:template>
629 <xsl:template name="ccdAssignedEntity">
630 <xsl:param name="ccrActorObjectID"/>
631
632 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
633
634 <assignedEntity>
635 <xsl:call-template name="ccdEntityID">
636 <xsl:with-param name="CCRActor" select="$CCRActor"/>
637 </xsl:call-template>
638
639 <xsl:call-template name="ccdAddress">
640 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address"/>
641 </xsl:call-template>
642
643 <xsl:call-template name="ccdTelecom">
644 <xsl:with-param name="CCRActor" select="$CCRActor"/>
645 </xsl:call-template>
646
647 <xsl:if test="$CCRActor/a:Person">
648 <xsl:call-template name="ccdPerson">
649 <xsl:with-param name="CCRActorPerson" select="$CCRActor/a:Person"/>
650 <xsl:with-param name="personNodeName" select="'assignedPerson'"/>
651 </xsl:call-template>
652 </xsl:if>
653
654 <xsl:if test="$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']">
655 <xsl:call-template name="ccdOrganization">
656 <xsl:with-param name="ccrActorObjectID" select="$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']/a:LinkID"/>
657 <xsl:with-param name="organizationNodeName" select="'representedOrganization'"/>
658 </xsl:call-template>
659 </xsl:if>
660
661 </assignedEntity>
662 </xsl:template>
663
664 <xsl:template name="ccdPatient">
665 <xsl:param name="CCRActorPerson"/>
666 <patient>
667 <xsl:call-template name="ccdPersonName">
668 <xsl:with-param name="CCRActorName" select="$CCRActorPerson/a:Name"/>
669 </xsl:call-template>
670
671 <xsl:if test="$CCRActorPerson/a:Gender">
672 <xsl:call-template name="ccdCodedValue">
673 <xsl:with-param name="ccrCodedDescription" select="$CCRActorPerson/a:Gender"/>
674 <xsl:with-param name="domain" select="'AdministrativeGender'"/>
675 <xsl:with-param name="nodeName" select="'administrativeGenderCode'"/>
676 </xsl:call-template>
677 </xsl:if>
678
679 <xsl:if test="$CCRActorPerson/a:DateOfBirth">
680 <birthTime>
681 <xsl:attribute name="value">
682 <xsl:call-template name="date:format-date">
683 <xsl:with-param name="date-time" select="$CCRActorPerson/a:DateOfBirth/a:ExactDateTime"/>
684 <xsl:with-param name="pattern">yyyyMMddhhmmss</xsl:with-param>
685 </xsl:call-template>
686 </xsl:attribute>
687 </birthTime>
688 </xsl:if>
689
690 <xsl:if test="/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Marital Status']">
691 <xsl:call-template name="ccdCodedValue">
692 <xsl:with-param name="ccrCodedDescription" select="/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Marital Status']/a:Description"/>
693 <xsl:with-param name="domain" select="'MaritalStatus'"/>
694 <xsl:with-param name="nodeName" select="'maritalStatusCode'"/>
695 </xsl:call-template>
696 </xsl:if>
697
698 <xsl:if test="/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Language']">
699 <languageCommunication>
700 <templateId root="2.16.840.1.113883.3.88.11.83.2" assigningAuthorityName="HITSP/C83"/>
701 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.2.1" assigningAuthorityName="IHE/PCC"/>
702 <xsl:call-template name="ccdCodedValue">
703 <xsl:with-param name="ccrCodedDescription" select="/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement[a:Type/a:Text='Language']/a:Description"></xsl:with-param>
704 <xsl:with-param name="domain" select="'HumanLanguage'"/>
705 <xsl:with-param name="nodeName" select="'languageCode'"/>
706 </xsl:call-template>
707 </languageCommunication>
708 </xsl:if>
709 </patient>
710 </xsl:template>
711
712 <xsl:template name="ccdPerformer">
713 <xsl:param name="ccrActorReference"/>
714 <performer typeCode="PRF">
715 <xsl:if test="$ccrActorReference/a:ActorRole">
716 <xsl:call-template name="ccdCodedValue">
717 <xsl:with-param name="ccrCodedDescription" select="$ccrActorReference/a:ActorRole"/>
718 <xsl:with-param name="nodeName" select="'functionCode'"/>
719 </xsl:call-template>
720 </xsl:if>
721 <xsl:call-template name="ccdAssignedEntity">
722 <xsl:with-param name="ccrActorObjectID" select="$ccrActorReference/a:ActorID"/>
723 </xsl:call-template>
724 </performer>
725 </xsl:template>
726
727 <xsl:template name="ccdPerson">
728 <xsl:param name="CCRActorPerson"/>
729 <xsl:param name="personNodeName">assignedPerson</xsl:param>
730 <xsl:element name="{$personNodeName}">
731 <xsl:call-template name="ccdPersonName">
732 <xsl:with-param name="CCRActorName" select="$CCRActorPerson/a:Name"/>
733 </xsl:call-template>
734 </xsl:element>
735 </xsl:template>
736
737 <xsl:template name="ccdPersonName">
738 <xsl:param name="CCRActorName"/>
739 <name>
740 <xsl:if test="$CCRActorName/a:CurrentName/a:Title">
741 <prefix>
742 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Title"/>
743 </prefix>
744 </xsl:if>
745 <xsl:if test="$CCRActorName/a:CurrentName/a:Given">
746 <given>
747 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Given"/>
748 </given>
749 </xsl:if>
750 <xsl:if test="$CCRActorName/a:CurrentName/a:Middle">
751 <given>
752 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Middle"/>
753 </given>
754 </xsl:if>
755 <xsl:if test="$CCRActorName/a:CurrentName/a:Family">
756 <family>
757 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Family"/>
758 </family>
759 </xsl:if>
760 <xsl:if test="$CCRActorName/a:CurrentName/a:Suffix">
761 <suffix>
762 <xsl:value-of select="$CCRActorName/a:CurrentName/a:Suffix"/>
763 </suffix>
764 </xsl:if>
765 </name>
766 </xsl:template>
767
768 <xsl:template name="ccdOrganization">
769 <xsl:param name="ccrActorObjectID"/>
770 <xsl:param name="organizationNodeName"/>
771
772 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
773
774 <xsl:element name="{$organizationNodeName}">
775 <xsl:call-template name="ccdEntityID">
776 <xsl:with-param name="CCRActor" select="$CCRActor"/>
777 </xsl:call-template>
778 <xsl:call-template name="ccdTelecom">
779 <xsl:with-param name="CCRActor" select="$CCRActor"/>
780 </xsl:call-template>
781
782 <xsl:call-template name="ccdAddress">
783 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address[1]"/>
784 </xsl:call-template>
785 </xsl:element>
786 </xsl:template>
787
788 <xsl:template name="ccdPatientRole">
789 <xsl:param name="ccrActorObjectID"/>
790
791 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
792
793 <xsl:call-template name="ccdEntityID">
794 <xsl:with-param name="CCRActor" select="$CCRActor"/>
795 </xsl:call-template>
796
797 <xsl:call-template name="ccdAddress">
798 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address[1]"/>
799 </xsl:call-template>
800
801 <xsl:call-template name="ccdTelecom">
802 <xsl:with-param name="CCRActor" select="$CCRActor"/>
803 </xsl:call-template>
804
805 <xsl:call-template name="ccdPatient">
806 <xsl:with-param name="CCRActorPerson" select="$CCRActor/a:Person"/>
807 </xsl:call-template>
808 </xsl:template>
809
810 <xsl:template name="ccdAssignedAuthor">
811 <xsl:param name="ccrActorObjectID"/>
812 <assignedAuthor>
813 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
814
815 <xsl:call-template name="ccdEntityID">
816 <xsl:with-param name="CCRActor" select="$CCRActor"/>
817 </xsl:call-template>
818
819 <xsl:call-template name="ccdAddress">
820 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address[1]"/>
821 </xsl:call-template>
822
823 <xsl:call-template name="ccdTelecom">
824 <xsl:with-param name="CCRActor" select="$CCRActor"/>
825 </xsl:call-template>
826
827 <xsl:call-template name="ccdPerson">
828 <xsl:with-param name="CCRActorPerson" select="$CCRActor/a:Person"/>
829 </xsl:call-template>
830
831 <xsl:if test="$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']">
832 <representedOrganization>
833 <xsl:call-template name="ccdOrganization">
834 <xsl:with-param name="ccrActorObjectID" select="$CCRActor/a:InternalCCRLink[a:LinkRelationship='Organization']/a:LinkID"/>
835 </xsl:call-template>
836 </representedOrganization>
837 </xsl:if>
838 </assignedAuthor>
839 </xsl:template>
840
841 <xsl:template name="ccdParticipantRoleActor">
842 <xsl:param name="ccrActorObjectID"/>
843
844 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$ccrActorObjectID]"/>
845
846 <xsl:call-template name="ccdEntityID">
847 <xsl:with-param name="CCRActor" select="$CCRActor"/>
848 </xsl:call-template>
849
850 <xsl:call-template name="ccdAddress">
851 <xsl:with-param name="CCRActorAddress" select="$CCRActor/a:Address[1]"/>
852 </xsl:call-template>
853
854 <xsl:call-template name="ccdTelecom">
855 <xsl:with-param name="CCRActor" select="$CCRActor"/>
856 </xsl:call-template>
857
858 <xsl:if test="$CCRActor/a:Organization/a:Name">
859 <playingEntity classCode="PLC">
860 <name>
861 <xsl:value-of select="$CCRActor/a:Organization/a:Name"/>
862 </name>
863 </playingEntity>
864 </xsl:if>
865 </xsl:template>
866
867 <xsl:template name="ccdParticipantRoleCodedDescription">
868 <xsl:param name="ccrCodedDescription"/>
869 <participantRole classCode="MANU">
870 <!--Product Detail-->
871 <playingEntity classCode="MMAT">
872 <xsl:if test="$ccrCodedDescription/a:Code">
873 <xsl:call-template name="ccdCodedValue">
874 <xsl:with-param name="ccrCodedDescription" select="$ccrCodedDescription"/>
875 <xsl:with-param name="nodeName" select="'code'"/>
876 </xsl:call-template>
877 </xsl:if>
878 <name>
879 <xsl:value-of select="$ccrCodedDescription/a:Text"/>
880 </name>
881 </playingEntity>
882 </participantRole>
883 </xsl:template>
884
885 <xsl:template name="ccdEntityID">
886 <xsl:param name="CCRActor"/>
887 <id>
888 <xsl:choose>
889 <xsl:when test="$CCRActor/a:IDs">
890 <xsl:attribute name="extension">
891 <xsl:value-of select="$CCRActor/a:IDs[1]/a:ID"/>
892 </xsl:attribute>
893 <xsl:attribute name="root">
894 <xsl:value-of select="$CCRActor/a:IDs[1]/a:Type/a:Text"/>
895 </xsl:attribute>
896 </xsl:when>
897 <xsl:otherwise>
898 <xsl:attribute name="extension">
899 <xsl:value-of select="$CCRActor/a:ActorObjectID"/>
900 </xsl:attribute>
901 <xsl:attribute name="root">
902 <xsl:text>CCRActorID</xsl:text>
903 </xsl:attribute>
904 </xsl:otherwise>
905 </xsl:choose>
906 </id>
907 <xsl:if test="$CCRActor/a:Organization">
908 <name><xsl:value-of select="$CCRActor/a:Organization/a:Name"></xsl:value-of></name>
909 </xsl:if>
910 </xsl:template>
911 <xsl:template name="ccdAddress">
912 <xsl:param name="CCRActorAddress"/>
913 <addr>
914 <xsl:choose>
915 <xsl:when test="$CCRActorAddress">
916 <xsl:attribute name="use">
917 <xsl:call-template name="CDAVocabularyLookup">
918 <xsl:with-param name="domain" select="'telecommunicationsAddressUse'"/>
919 <xsl:with-param name="ccrtext" select="$CCRActorAddress/a:Type/a:Text"/>
920 </xsl:call-template>
921 </xsl:attribute>
922 <streetAddressLine>
923 <xsl:value-of select="$CCRActorAddress/a:Line1"/>
924 </streetAddressLine>
925 <city>
926 <xsl:value-of select="$CCRActorAddress/a:City"/>
927 </city>
928 <state>
929 <xsl:value-of select="$CCRActorAddress/a:State"/>
930 </state>
931 <postalCode>
932 <xsl:value-of select="$CCRActorAddress/a:PostalCode"/>
933 </postalCode>
934 </xsl:when>
935 <xsl:otherwise>
936 <streetAddressLine/>
937 </xsl:otherwise>
938 </xsl:choose>
939 </addr>
940 </xsl:template>
941
942 <xsl:template name="ccdTelecom">
943 <xsl:param name="CCRActor"/>
944 <telecom>
945 <xsl:if test="$CCRActor/a:Telephone">
946 <xsl:attribute name="use">
947 <xsl:call-template name="CDAVocabularyLookup">
948 <xsl:with-param name="domain" select="'telecommunicationsAddressUse'"/>
949 <xsl:with-param name="ccrtext" select="$CCRActor/a:Telephone/a:Type/a:Text"/>
950 </xsl:call-template>
951 </xsl:attribute>
952 <xsl:attribute name="value">
953 <xsl:text>tel:+1-</xsl:text>
954 <xsl:value-of select="$CCRActor/a:Telephone[1]/a:Value"/>
955 </xsl:attribute>
956 </xsl:if>
957 </telecom>
958
959 <xsl:if test="$CCRActor/a:Email">
960 <telecom>
961 <xsl:choose>
962 <xsl:when test="$CCRActor/a:Telephone">
963 <xsl:attribute name="use">
964 <xsl:call-template name="CDAVocabularyLookup">
965 <xsl:with-param name="domain" select="'telecommunicationsAddressUse'"/>
966 <xsl:with-param name="ccrtext" select="$CCRActor/a:Telephone/a:Type/a:Text"/>
967 </xsl:call-template>
968 </xsl:attribute>
969 <xsl:attribute name="value">
970 <xsl:text>mailto:</xsl:text>
971 <xsl:value-of select="$CCRActor/a:Email[1]/a:Value"/>
972 </xsl:attribute>
973 </xsl:when>
974 <xsl:otherwise>
975 <xsl:attribute name="value">
976 <xsl:text>Unknown</xsl:text>
977 </xsl:attribute>
978 </xsl:otherwise>
979 </xsl:choose>
980 </telecom>
981 </xsl:if>
982 </xsl:template>
983
984 <xsl:template name="ccdID">
985 <xsl:param name="ccrObjectID"/>
986 <xsl:param name="suffix"/>
987 <id>
988 <xsl:attribute name="root">
989 <xsl:value-of select="$ccrObjectID"></xsl:value-of>
990 </xsl:attribute>
991 <xsl:attribute name="extension">CCRObjectID</xsl:attribute>
992 </id>
993 </xsl:template>
994
995 <xsl:template name="ccdCodedValue">
996 <xsl:param name="ccrCodedDescription"/>
997 <xsl:param name="type"/>
998 <xsl:param name="domain"/>
999 <xsl:param name="nodeName">value</xsl:param>
1000 <xsl:param name="originalTextReference"/>
1001
1002 <xsl:element name="{$nodeName}">
1003 <xsl:if test="$type">
1004 <xsl:attribute name="xsi:type">
1005 <xsl:value-of select="$type"/>
1006 </xsl:attribute>
1007 </xsl:if>
1008 <xsl:choose>
1009 <xsl:when test="$ccrCodedDescription/a:Code">
1010 <xsl:attribute name="displayName">
1011 <xsl:value-of select="$ccrCodedDescription/a:Text"/>
1012 </xsl:attribute>
1013 <xsl:attribute name="code">
1014 <xsl:value-of select="$ccrCodedDescription/a:Code/a:Value"/>
1015 </xsl:attribute>
1016 <xsl:attribute name="codeSystemName">
1017 <xsl:value-of select="$ccrCodedDescription/a:Code/a:CodingSystem"/>
1018 </xsl:attribute>
1019 <xsl:attribute name="codeSystem">
1020 <xsl:call-template name="HL7OIDLookup">
1021 <xsl:with-param name="name" select="$ccrCodedDescription/a:Code/a:CodingSystem"/>
1022 </xsl:call-template>
1023 </xsl:attribute>
1024 </xsl:when>
1025 <xsl:when test="$domain">
1026 <xsl:variable name="cdaCode">
1027 <xsl:call-template name="CDAVocabularyLookup">
1028 <xsl:with-param name="domain" select="$domain"/>
1029 <xsl:with-param name="ccrtext" select="$ccrCodedDescription/a:Text"/>
1030 </xsl:call-template>
1031 </xsl:variable>
1032 <xsl:attribute name="displayName">
1033 <xsl:call-template name="CDADisplayNameLookup">
1034 <xsl:with-param name="domain" select="$domain"/>
1035 <xsl:with-param name="cdacode" select="$cdaCode"/>
1036 </xsl:call-template>
1037 </xsl:attribute>
1038 <xsl:attribute name="code">
1039 <xsl:value-of select="$cdaCode"></xsl:value-of>
1040 </xsl:attribute>
1041 <xsl:attribute name="codeSystemName">
1042 <xsl:call-template name="CDAVocabularyCodeSystemNameLookup">
1043 <xsl:with-param name="domain" select="$domain"/>
1044 </xsl:call-template>
1045 </xsl:attribute>
1046 <xsl:attribute name="codeSystemName">
1047 <xsl:call-template name="CDAVocabularyCodeSystemLookup">
1048 <xsl:with-param name="domain" select="$domain"/>
1049 </xsl:call-template>
1050 </xsl:attribute>
1051 </xsl:when>
1052 <xsl:otherwise>
1053 <originalText>
1054 <xsl:value-of select="$ccrCodedDescription/a:Text"/>
1055 <xsl:if test="$originalTextReference">
1056 <reference>
1057 <xsl:attribute name="value">
1058 <xsl:value-of select="$originalTextReference"/>
1059 </xsl:attribute>
1060 </reference>
1061 </xsl:if>
1062 </originalText>
1063 </xsl:otherwise>
1064 </xsl:choose>
1065 </xsl:element>
1066 </xsl:template>
1067
1068 <xsl:template name="ccdDateTime">
1069 <xsl:param name="dt"/>
1070 <xsl:param name="type"/>
1071 <xsl:if test="$dt">
1072 <xsl:if test="$dt[1]/a:ExactDateTime">
1073 <effectiveTime>
1074 <xsl:if test="$type">
1075 <xsl:attribute name="xsi:type">
1076 <xsl:value-of select="$type"></xsl:value-of>
1077 </xsl:attribute>
1078 </xsl:if>
1079 <low>
1080 <xsl:attribute name="value">
1081 <xsl:call-template name="date:format-date">
1082 <xsl:with-param name="date-time" select="$dt[1]/a:ExactDateTime"/>
1083 <xsl:with-param name="pattern">yyyyMMdd</xsl:with-param>
1084 </xsl:call-template>
1085 </xsl:attribute>
1086 </low>
1087 <high nullFlavor="UNK"/>
1088 </effectiveTime>
1089 </xsl:if>
1090 <xsl:if test="$dt[1]/a:DateTimeRange">
1091 <effectiveTime>
1092 <low>
1093 <xsl:attribute name="value">
1094 <xsl:call-template name="date:format-date">
1095 <xsl:with-param name="date-time" select="$dt[1]/a:DateTimeRange/a:BeginRange/a:ExactDateTime"/>
1096 <xsl:with-param name="pattern">yyyyMMdd</xsl:with-param>
1097 </xsl:call-template>
1098 </xsl:attribute>
1099 </low>
1100 <high>
1101 <xsl:attribute name="value">
1102 <xsl:call-template name="date:format-date">
1103 <xsl:with-param name="date-time" select="$dt[1]/a:DateTimeRange/a:EndRange/a:ExactDateTime"/>
1104 <xsl:with-param name="pattern">yyyyMMdd</xsl:with-param>
1105 </xsl:call-template>
1106 </xsl:attribute>
1107 </high>
1108 </effectiveTime>
1109 </xsl:if>
1110 </xsl:if>
1111 </xsl:template>
1112
1113 <xsl:template name="ccdMedicationFrequency">
1114 <xsl:param name="frequency"/>
1115 <xsl:if test="$frequency">
1116 <xsl:choose>
1117 <xsl:when test="$frequency/a:Value='qd'">
1118 <effectiveTime xsi:type="PIVL_TS" operator="A">
1119 <xsl:attribute name="institutionSpecified">true</xsl:attribute>
1120 <period>
1121 <xsl:attribute name="value">24</xsl:attribute>
1122 <xsl:attribute name="unit">h</xsl:attribute>
1123 </period>
1124 </effectiveTime>
1125 </xsl:when>
1126 <xsl:when test="$frequency/a:Value='bid'">
1127 <effectiveTime xsi:type="PIVL_TS" operator="A">
1128 <xsl:attribute name="institutionSpecified">true</xsl:attribute>
1129 <period>
1130 <xsl:attribute name="value">12</xsl:attribute>
1131 <xsl:attribute name="unit">h</xsl:attribute>
1132 </period>
1133 </effectiveTime>
1134 </xsl:when>
1135 <xsl:when test="$frequency/a:Value='tid'">
1136 <effectiveTime xsi:type="PIVL_TS" operator="A">
1137 <xsl:attribute name="institutionSpecified">true</xsl:attribute>
1138 <period>
1139 <xsl:attribute name="value">8</xsl:attribute>
1140 <xsl:attribute name="unit">h</xsl:attribute>
1141 </period>
1142 </effectiveTime>
1143 </xsl:when>
1144 <xsl:when test="$frequency/a:Value='qid'">
1145 <effectiveTime xsi:type="PIVL_TS" operator="A">
1146 <xsl:attribute name="institutionSpecified">true</xsl:attribute>
1147 <period>
1148 <xsl:attribute name="value">6</xsl:attribute>
1149 <xsl:attribute name="unit">h</xsl:attribute>
1150 </period>
1151 </effectiveTime>
1152 </xsl:when>
1153 <xsl:when test="$frequency/a:Value='qam'">
1154 <effectiveTime xsi:type='EIVL' operator='A'>
1155 <event code='ACM'/>
1156 </effectiveTime>
1157 </xsl:when>
1158 <xsl:when test="$frequency/a:Value='qpm'">
1159 <effectiveTime xsi:type='EIVL' operator='A'>
1160 <event code='PCV'/>
1161 </effectiveTime>
1162 </xsl:when>
1163 </xsl:choose>
1164 </xsl:if>
1165 </xsl:template>
1166
1167 <xsl:template name="ccdStatus">
1168 <xsl:param name="ccrStatus"/>
1169
1170 <entryRelationship typeCode="REFR">
1171 <observation classCode="OBS" moodCode="EVN">
1172 <templateId root="2.16.840.1.113883.10.20.1.50"/>
1173 <!-- Problem status observation template -->
1174 <code code="33999-4" codeSystem="2.16.840.1.113883.6.1" displayName="Status"/>
1175 <statusCode code="completed"/>
1176 <xsl:call-template name="ccdCodedValue">
1177 <xsl:with-param name="ccrCodedDescription" select="$ccrStatus"/>
1178 </xsl:call-template>
1179 </observation>
1180 </entryRelationship>
1181 </xsl:template>
1182
1183 <xsl:template name="ccdStatusObservation">
1184 <xsl:param name="status"/>
1185 <xsl:variable name="statusText" select="$status/a:Text"></xsl:variable>
1186 <xsl:choose>
1187 <xsl:when test="$statusText='Active'">
1188 <xsl:call-template name="ccdStatusElement">
1189 <xsl:with-param name="statusCode" select="'55561003'"/>
1190 <xsl:with-param name="statusDisplayName" select="$statusText"/>
1191 </xsl:call-template>
1192 </xsl:when>
1193 <xsl:when test="$statusText='Inactive'">
1194 <xsl:call-template name="ccdStatusElement">
1195 <xsl:with-param name="statusCode" select="'73425007'"/>
1196 <xsl:with-param name="statusDisplayName" select="$statusText"/>
1197 </xsl:call-template>
1198 </xsl:when>
1199 <xsl:when test="$statusText='Chronic'">
1200 <xsl:call-template name="ccdStatusElement">
1201 <xsl:with-param name="statusCode" select="'90734009'"/>
1202 <xsl:with-param name="statusDisplayName" select="$statusText"/>
1203 </xsl:call-template>
1204 </xsl:when>
1205 </xsl:choose>
1206 </xsl:template>
1207
1208 <xsl:template name="ccdStatusProcedure">
1209 <xsl:param name="status"/>
1210 <xsl:variable name="statusText" select="$status/a:Text"></xsl:variable>
1211 <xsl:choose>
1212 <xsl:when test="$statusText='Completed'">
1213 <statusCode code="completed"/>
1214 </xsl:when>
1215 <xsl:when test="$statusText='Active'">
1216 <statusCode code="active"/>
1217 </xsl:when>
1218 <xsl:when test="$statusText='Aborted'">
1219 <statusCode code="aborted"/>
1220 </xsl:when>
1221 <xsl:when test="$statusText='Cancelled' or $statusText='Canceled'">
1222 <statusCode code="cancelled"/>
1223 </xsl:when>
1224 <xsl:otherwise>
1225 <statusCode>
1226 <xsl:attribute name="code">
1227 <xsl:value-of select="$statusText"></xsl:value-of>
1228 </xsl:attribute>
1229 </statusCode>
1230 </xsl:otherwise>
1231 </xsl:choose>
1232 </xsl:template>
1233
1234 <xsl:template name="ccdStatusElement">
1235 <xsl:param name="statusCode"/>
1236 <xsl:param name="statusDisplayName"/>
1237 <value>
1238 <xsl:attribute name="xsi:type">CE</xsl:attribute>
1239 <xsl:attribute name="code">
1240 <xsl:value-of select="$statusCode"></xsl:value-of>
1241 </xsl:attribute>
1242 <xsl:attribute name="codeSystem">2.16.840.1.113883.6.96</xsl:attribute>
1243 <xsl:attribute name="displayName">
1244 <xsl:value-of select="$statusDisplayName"></xsl:value-of>
1245 </xsl:attribute>
1246 </value>
1247 </xsl:template>
1248
1249 <xsl:template name="ccdObservation">
1250 <xsl:param name="ccrTestNode"/>
1251 <xsl:param name="testDate"/>
1252
1253 <component>
1254 <observation classCode="OBS" moodCode="EVN">
1255 <templateId root="2.16.840.1.113883.3.88.11.83.15" assigningAuthorityName="HITSP C83"/>
1256 <templateId root="2.16.840.1.113883.10.20.1.31" assigningAuthorityName="CCD"/>
1257 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13" assigningAuthorityName="IHE PCC"/>
1258
1259 <!-- Result observation template -->
1260
1261 <xsl:call-template name="ccdID">
1262 <xsl:with-param name="ccrObjectID" select="$ccrTestNode/a:CCRDataObjectID"/>
1263 </xsl:call-template>
1264
1265 <!-- <code> -->
1266 <xsl:call-template name="ccdCodedValue">
1267 <xsl:with-param name="ccrCodedDescription" select="$ccrTestNode/a:Description"/>
1268 <xsl:with-param name="nodeName" select="'code'"/>
1269 </xsl:call-template>
1270
1271 <text>
1272 <reference>
1273 <xsl:attribute name="value">
1274 <xsl:text>#</xsl:text>
1275 <xsl:value-of select="$ccrTestNode/a:CCRDataObjectID"/>
1276 </xsl:attribute>
1277 </reference>
1278 </text>
1279
1280 <statusCode code="completed"/>
1281
1282 <!-- <effectiveTime> -->
1283 <xsl:choose>
1284 <xsl:when test="$ccrTestNode/a:DateTime">
1285 <xsl:call-template name="ccdDateTime">
1286 <xsl:with-param name="dt" select="$ccrTestNode/a:DateTime"/>
1287 </xsl:call-template>
1288 </xsl:when>
1289 <xsl:otherwise>
1290 <xsl:call-template name="ccdDateTime">
1291 <xsl:with-param name="dt" select="$testDate"/>
1292 </xsl:call-template>
1293 </xsl:otherwise>
1294 </xsl:choose>
1295
1296 <xsl:choose>
1297 <xsl:when test="$ccrTestNode/a:TestResult[a:Value!='']">
1298 <value xsi:type="PQ">
1299 <xsl:attribute name="value">
1300 <xsl:value-of select="$ccrTestNode/a:TestResult/a:Value"/>
1301 </xsl:attribute>
1302 <xsl:attribute name="unit">
1303 <xsl:value-of select="$ccrTestNode/a:TestResult/a:Units/a:Unit"/>
1304 </xsl:attribute>
1305 </value>
1306 </xsl:when>
1307 <xsl:when test="$ccrTestNode/a:TestResult[a:Description/a:Text!='']">
1308 <value xsi:type="TX">
1309 <xsl:attribute name="value">
1310 <xsl:value-of select="$ccrTestNode/a:TestResult/a:Description/a:Text"/>
1311 </xsl:attribute>
1312 </value>
1313 </xsl:when>
1314 </xsl:choose>
1315
1316 <xsl:if test="$ccrTestNode/a:Flag">
1317 <xsl:call-template name="ccdCodedValue">
1318 <xsl:with-param name="ccrCodedDescription" select="$ccrTestNode/a:Flag"/>
1319 <xsl:with-param name="nodeName" select="'interpretationCode'"/>
1320 <xsl:with-param name="domain" select="'ObservationInterpretation'"/>
1321 </xsl:call-template>
1322 </xsl:if>
1323
1324 <xsl:if test="$ccrTestNode/a:NormalResult">
1325 <referenceRange>
1326 <xsl:if test="$ccrTestNode/a:NormalResult/a:Normal/a:Description/a:Text">
1327 <observationRange>
1328 <text>
1329 <xsl:value-of select="$ccrTestNode/a:NormalResult/a:Normal/a:Description/a:Text"/>
1330 </text>
1331 </observationRange>
1332 </xsl:if>
1333 </referenceRange>
1334 </xsl:if>
1335
1336 </observation>
1337 </component>
1338
1339 </xsl:template>
1340</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.