Changeset 757
- Timestamp:
- May 18, 2010, 11:42:02 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr2ccd-xslt/trunk/ccr_ccd.xsl
r746 r757 1 1 <?xml version="1.0" encoding="utf-8"?> 2 3 2 <!-- 4 Conversion of CCR to Level 2CCD5 6 Author: Ken Miller3 Conversion of CCR to Level 3 CCD 4 5 Orginal Author: Ken Miller 7 6 Solventus LLC 8 7 ken.miller@solventus.coms 9 8 10 Date: 2008-04-25 9 Contributors: 10 Richard Braman, EHR Doctors, Inc rbraman@ehrdoctors.com 11 George Gilly (WorldVistA glilly@glilly.net) 12 xxxx - Oroville Hospital 13 14 Date: 2010-05-5 11 15 Version: 0.1 12 16 17 License : 18 19 This program is free software: you can redistribute it and/or modify 20 it under the terms of the GNU General Public License as published by 21 the Free Software Foundation, either version 3 of the License, or 22 (at your option) any later version. 23 24 This program is distributed in the hope that it will be useful, 25 but WITHOUT ANY WARRANTY; without even the implied warranty of 26 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 GNU General Public License for more details. 28 29 You should have received a copy of the GNU General Public License 30 along with this program. If not, see http://www.gnu.org/licenses. 31 13 32 --> 14 15 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="urn:astm-org:CCR" xmlns:date="http://exslt.org/dates-and-times" exclude-result-prefixes="a date"> 16 33 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="urn:astm-org:CCR" xmlns:date="http://exslt.org/dates-and-times" exclude-result-prefixes="a date" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:str="http://exslt.org/strings" extension-element-prefixes="str" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 17 34 <xsl:import href="./templates/code.xsl"/> 18 <xsl:import href="./templates/datetime.xsl"/> 35 <xsl:import href="./templates/ccdcodedvalue.xsl"/> 36 <xsl:import href="./templates/ccdentity.xsl"/> 37 <xsl:import href="./templates/ccdid.xsl"/> 38 <xsl:import href="./templates/ccddatetime.xsl"/> 39 <xsl:import href="./templates/ccdstatus.xsl"/> 40 <xsl:import href="./templates/ccdmedicationfrequency.xsl"/> 19 41 <xsl:import href="./templates/actor.xsl"/> 20 42 <xsl:import href="./templates/problemDescription.xsl"/> 21 22 <xsl:output method="xml" encoding="utf-8" version="1.0"/> 43 <xsl:import href="./templates/HL7OIDLookup.xsl"/> 44 45 <xsl:output method="xml" encoding="utf-8" version="1.0" indent="yes"/> 23 46 <xsl:template match="/"> 24 <ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:voc="urn:hl7-org:v3/voc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 25 <typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040" /> 47 <xsl:processing-instruction name="xml-stylesheet">type="text/xsl" href="CCD.xsl"</xsl:processing-instruction> 48 <ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:voc="urn:hl7-org:v3/voc" xmlns:sdtc="urn:hl7-org:sdtc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 http://xreg2.nist.gov:8080/hitspValidation/schema/cdar2c32/infrastructure/cda/C32_CDA.xsd" classCode="DOCCLIN" moodCode="EVN"> 49 <realmCode code="US"/> 50 <typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/> 26 51 <templateId root="2.16.840.1.113883.10.20.1"/> 27 <id root="db4"/> 28 <code code="34133-9" codeSystem="2.16.840.1.113883.6.1" displayName="Summarization of episode note"/> 52 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.1.1"/> 53 <templateId root="2.16.840.1.113883.10.20.3"/> 54 <templateId root="2.16.840.1.113883.3.88.11.32.1"/> 55 56 <id> 57 <xsl:attribute name="root"> 58 <xsl:value-of select="/a:ContinuityOfCareRecord/a:CCRDocumentObjectID"></xsl:value-of> 59 </xsl:attribute> 60 </id> 61 <code code="34133-9" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Summarization of episode note"/> 29 62 <title>Continuity of Care Document</title> 30 < xsl:element name="effectiveTime">63 <effectiveTime> 31 64 <xsl:attribute name="value"> 32 65 <xsl:call-template name="date:format-date"> 33 66 <xsl:with-param name="date-time"> 34 <xsl:value-of select=" a:ContinuityOfCareRecord/a:DateTime/a:ExactDateTime"/>67 <xsl:value-of select="/a:ContinuityOfCareRecord/a:DateTime/a:ExactDateTime"/> 35 68 </xsl:with-param> 36 69 <xsl:with-param name="pattern">yyyyMMddhhmmss+0000</xsl:with-param> 37 70 </xsl:call-template> 38 71 </xsl:attribute> 39 </ xsl:element>72 </effectiveTime> 40 73 <confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.25"/> 41 74 <languageCode code="en-US"/> 42 <xsl:variable name="patientID" select=" a:ContinuityOfCareRecord/a:Patient[1]/a:ActorID"/>75 <xsl:variable name="patientID" select="/a:ContinuityOfCareRecord/a:Patient[1]/a:ActorID"/> 43 76 <recordTarget> 44 77 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$patientID]"> 45 78 <patientRole> 46 <xsl:element name="id"> 47 <xsl:attribute name="extension"> 48 <xsl:value-of select="a:IDs/a:ID[1]"/> 49 </xsl:attribute> 50 </xsl:element> 51 <patient> 52 <name> 53 <given> 54 <xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Given"></xsl:value-of> 55 </given> 56 <family> 57 <xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Family"></xsl:value-of> 58 </family> 59 </name> 60 <xsl:element name="administrativeGenderCode"> 61 <xsl:attribute name="code"> 62 <xsl:value-of select="a:Person/a:Gender/a:Text"></xsl:value-of> 63 </xsl:attribute> 64 </xsl:element> 65 <xsl:element name="birthTime"> 66 <xsl:attribute name="value"> 67 <xsl:call-template name="date:format-date"> 68 <xsl:with-param name="date-time"> 69 <xsl:value-of select="a:Person/a:DateOfBirth/a:ExactDateTime"/> 70 </xsl:with-param> 71 <xsl:with-param name="pattern">yyyyMMddhhmmss</xsl:with-param> 72 </xsl:call-template> 73 </xsl:attribute> 74 </xsl:element> 75 </patient> 79 <xsl:call-template name="ccdEntity"> 80 <xsl:with-param name="ccrActorObjectID" select="/a:ContinuityOfCareRecord/a:Patient[1]/a:ActorID"></xsl:with-param> 81 <xsl:with-param name="personNodeName">patient</xsl:with-param> 82 </xsl:call-template> 76 83 </patientRole> 77 84 </xsl:for-each> 78 85 </recordTarget> 86 87 <xsl:variable name="fromID" select="/a:ContinuityOfCareRecord/a:From/a:ActorLink[1]/a:ActorID"/> 79 88 <author> 80 <xsl:variable name="fromID" select="a:ContinuityOfCareRecord/a:From/a:ActorLink[1]/a:ActorID"/>81 89 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$fromID]"> 82 < xsl:element name="time">90 <time> 83 91 <xsl:attribute name="value"> 84 92 <xsl:call-template name="date:format-date"> … … 89 97 </xsl:call-template> 90 98 </xsl:attribute> 91 </xsl:element> 92 <assignedAuthor> 93 <xsl:element name="id"> 94 <xsl:attribute name="extension"> 95 <xsl:choose> 96 <xsl:when test="a:IDs/a:ID[1]"> 97 <xsl:value-of select="a:IDs/a:ID[1]"/> 98 </xsl:when> 99 <xsl:otherwise> 100 <xsl:value-of select="$fromID"/> 101 </xsl:otherwise> 102 </xsl:choose> 103 </xsl:attribute> 104 </xsl:element> 105 <assignedPerson> 106 <name> 107 <prefix> 108 <xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Title"></xsl:value-of> 109 </prefix> 110 <given> 111 <xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Given"></xsl:value-of> 112 </given> 113 <family> 114 <xsl:value-of select="a:Person/a:Name/a:CurrentName/a:Family"></xsl:value-of> 115 </family> 116 </name> 117 </assignedPerson> 118 </assignedAuthor> 99 </time> 100 <xsl:call-template name="ccdEntity"> 101 <xsl:with-param name="ccrActorObjectID" select="/a:ContinuityOfCareRecord/a:From/a:ActorLink[1]/a:ActorID"></xsl:with-param> 102 </xsl:call-template> 119 103 </xsl:for-each> 120 104 </author> 105 121 106 <custodian> 122 107 <assignedCustodian> 123 108 <representedCustodianOrganization> 124 <id root="2.16.840.1.113883.3.96.3.42"/> 125 <xsl:element name="name"> 126 <xsl:call-template name="actorName"> 127 <xsl:with-param name="objID" select="a:ContinuityOfCareRecord/a:From/a:ActorLink[1]/a:ActorID"/> 128 </xsl:call-template> 129 </xsl:element> 109 <xsl:call-template name="ccdEntity"> 110 <xsl:with-param name="ccrActorObjectID" select="/a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$fromID]/a:InternalCCRLink[a:LinkRelationship='Organization']/a:LinkID"></xsl:with-param> 111 </xsl:call-template> 130 112 </representedCustodianOrganization> 131 113 </assignedCustodian> 132 114 </custodian> 115 133 116 <documentationOf> 134 117 <serviceEvent classCode="PCPR"> 135 118 <effectiveTime> 136 < xsl:element name="low">119 <low> 137 120 <xsl:attribute name="value"> 138 121 <xsl:call-template name="date:format-date"> 139 122 <xsl:with-param name="date-time"> 140 <xsl:value-of select="a:ContinuityOfCareRecord/a:Actors/a:Actor[a:ActorObjectID=$patientID]/a:Person/a:DateOfBirth/a:ExactDateTime"/> 123 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body//a:DateTime//a:ExactDateTime"> 124 <xsl:sort order="ascending"/> 125 <xsl:if test="position()=1"> 126 <xsl:value-of select="."/> 127 </xsl:if> 128 </xsl:for-each> 141 129 </xsl:with-param> 142 130 <xsl:with-param name="pattern">yyyyMMdd</xsl:with-param> 143 131 </xsl:call-template> 144 132 </xsl:attribute> 145 </ xsl:element>146 < xsl:element name="high">133 </low> 134 <high> 147 135 <xsl:attribute name="value"> 148 136 <xsl:call-template name="date:format-date"> 149 137 <xsl:with-param name="date-time"> 150 <xsl:value-of select="a:ContinuityOfCareRecord/a:DateTime/a:ExactDateTime"/> 138 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body//a:DateTime//a:ExactDateTime"> 139 <xsl:sort order="descending"/> 140 <xsl:if test="position()=1"> 141 <xsl:value-of select="."/> 142 </xsl:if> 143 </xsl:for-each> 151 144 </xsl:with-param> 152 145 <xsl:with-param name="pattern">yyyyMMdd</xsl:with-param> 153 146 </xsl:call-template> 154 147 </xsl:attribute> 155 </ xsl:element>148 </high> 156 149 </effectiveTime> 157 150 </serviceEvent> 151 152 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:HealthCareProviders/a:Provider"> 153 <assignedEntity> 154 <xsl:call-template name="ccdEntity"> 155 <xsl:with-param name="a:ccrActorObjectID" select="a:ActorID"/> 156 </xsl:call-template> 157 </assignedEntity> 158 </xsl:for-each> 159 158 160 </documentationOf> 161 159 162 <component> 160 163 <structuredBody> … … 165 168 <title>Purpose</title> 166 169 <text> 167 <xsl:value-of select=" a:ContinuityOfCareRecord/a:Purpose/a:Description/a:Text"></xsl:value-of>170 <xsl:value-of select="/a:ContinuityOfCareRecord/a:Purpose/a:Description/a:Text"></xsl:value-of> 168 171 </text> 169 172 </section> … … 186 189 <th>Source</th> 187 190 </tr> 188 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Body/a:Alerts/a:Alert">191 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Alerts/a:Alert"> 189 192 <tr> 190 193 <td> … … 239 242 <th>Source</th> 240 243 </tr> 241 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Body/a:AdvanceDirectives/a:AdvanceDirective">244 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:AdvanceDirectives/a:AdvanceDirective"> 242 245 <tr> 243 246 <td> … … 323 326 <component> 324 327 <section> 325 <templateId root="2.16.840.1.113883.10.20.1.11"/> 328 <templateId root="2.16.840.1.113883.3.88.11.83.103" assigningAuthorityName="HITSP/C83"/> 329 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.6" assigningAuthorityName="IHE PCC"/> 330 <templateId root="2.16.840.1.113883.10.20.1.11" assigningAuthorityName="HL7 CCD"/> 326 331 <code code="11450-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Problem list"/> 327 332 <title>Problems</title> … … 337 342 <th>Source</th> 338 343 </tr> 339 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem">344 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem"> 340 345 <tr> 346 <xsl:attribute name="id"> 347 <xsl:value-of select="a:CCRDataObjectID"></xsl:value-of> 348 </xsl:attribute> 349 341 350 <td> 342 351 <xsl:value-of select="a:Type/a:Text"/> 343 352 </td> 344 353 <td> 345 < xsl:call-template name="date:format-date">346 < xsl:with-param name="date-time">347 <xsl: value-of select="a:DateTime/a:ExactDateTime"/>348 </ xsl:with-param>349 </ xsl:call-template>354 <table> 355 <tbody> 356 <xsl:apply-templates select="a:DateTime"/> 357 </tbody> 358 </table> 350 359 </td> 351 360 <td> … … 368 377 </table> 369 378 </text> 370 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem">379 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Problems/a:Problem"> 371 380 <entry typeCode="DRIV"> 372 381 <act classCode="ACT" moodCode="EVN"> 373 382 <templateId root="2.16.840.1.113883.10.20.1.27"/> 374 383 <!-- Problem act template --> 375 <id root="6a2fa88d-4174-4909-aece-db44b60a3abb"/> 384 385 <!-- <id> --> 386 <xsl:call-template name="ccdID"> 387 <xsl:with-param name="ccrObjectID"> 388 <xsl:value-of select="a:CCRDataObjectID"></xsl:value-of> 389 </xsl:with-param> 390 </xsl:call-template> 391 376 392 <code nullFlavor="NA"/> 377 <xsl:variable name="SourceActorID" select="a:Source/a:Actor/a:ActorID"/> 393 378 394 <performer typeCode="PRF"> 379 395 <assignedEntity> 380 <xsl:variable name="CCRActor" select="//a:ContinuityOfCareRecord/a:Actors[a:ActorObjectID=$SourceActorID]/a:Actor"/> 381 <xsl:if test="$CCRActor/a:Address"> 382 <addr> 383 <streetAddressLine> 384 <xsl:value-of select="$CCRActor/a:Address[0]/a:Line1"/> 385 </streetAddressLine> 386 <city> 387 <xsl:value-of select="$CCRActor/a:Address[0]/a:City"/> 388 </city> 389 <state> 390 <xsl:value-of select="$CCRActor/a:Address[0]/a:State"/> 391 </state> 392 <postalcode> 393 <xsl:value-of select="$CCRActor/a:Address[0]/a:PostalCode"/> 394 </postalcode> 395 </addr> 396 </xsl:if> 397 <xsl:if test="$CCRActor/a:Telephone"> 398 <xsl:element name="telecom"> 399 <xsl:attribute name="extension"> 400 <xsl:value-of select="$CCRActor/a:Telephone[0]/a:Value"/> 401 </xsl:attribute> 402 </xsl:element> 403 </xsl:if> 404 <assignedPerson> 405 <name> 406 <xsl:call-template name="actorName"> 407 <xsl:with-param name="objID" select="$SourceActorID"/> 408 </xsl:call-template> 409 </name> 410 </assignedPerson> 396 <xsl:call-template name="ccdEntity"> 397 <xsl:with-param name="ccrActorObjectID"> 398 <xsl:value-of select="a:Source/a:Actor/a:ActorID"></xsl:value-of> 399 </xsl:with-param> 400 </xsl:call-template> 411 401 </assignedEntity> 412 402 </performer> 403 413 404 <entryRelationship typeCode="SUBJ"> 414 405 <observation classCode="OBS" moodCode="EVN"> 415 406 <templateId root="2.16.840.1.113883.10.20.1.28" assigningAuthorityName="CCD"/> 416 407 <!--Problem observation template--> 417 <id root="d11275e7-67ae-11db-bd13-0800200c9a66"/> 408 409 <!-- <id> --> 410 <xsl:call-template name="ccdID"> 411 <xsl:with-param name="ccrObjectID"> 412 <xsl:value-of select="a:CCRDataObjectID"></xsl:value-of> 413 </xsl:with-param> 414 <xsl:with-param name="suffix">.1</xsl:with-param> 415 </xsl:call-template> 416 418 417 <code code="64572001" displayName="Condition" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED-CT"/> 418 419 419 <text> 420 < xsl:element name="reference">420 <reference> 421 421 <xsl:attribute name="value"> 422 <xsl:value-of select="a:CCRObjectID"/> 422 <xsl:text>#</xsl:text> 423 <xsl:value-of select="a:CCRDataObjectID"/> 423 424 </xsl:attribute> 424 </ xsl:element>425 </reference> 425 426 </text> 426 <xsl:element name="statusCode"> 427 <xsl:attribute name="value"> 428 <xsl:value-of select="a:Status/a:Code/a:Value"/> 429 </xsl:attribute> 430 </xsl:element> 431 <xsl:element name="effectiveTime"> 432 <xsl:attribute name="value"> 433 <xsl:call-template name="date:format-date"> 434 <xsl:with-param name="date-time"> 435 <xsl:value-of select="a:DateTime[0]/a:ExactDateTime"/> 436 </xsl:with-param> 437 <xsl:with-param name="pattern">yyyyMMddhhmmss+0000</xsl:with-param> 438 </xsl:call-template> 439 </xsl:attribute> 440 </xsl:element> 441 <xsl:element name="value"> 442 <xsl:attribute name="displayName"> 443 <xsl:value-of select="a:Description/a:Text"/> 444 </xsl:attribute> 445 <xsl:attribute name="code"> 446 <xsl:value-of select="a:Description/a:Code/a:Value"/> 447 </xsl:attribute> 448 <xsl:attribute name="codeSystemName"> 449 <xsl:value-of select="a:Description/a:Code/a:CodingSystem"/> 450 </xsl:attribute> 451 </xsl:element> 427 428 <statusCode code="completed"/> 429 430 <xsl:call-template name="ccdDateTime"> 431 <xsl:with-param name="dt" select="a:DateTime"/> 432 </xsl:call-template> 433 434 <xsl:call-template name="ccdCodedValue"> 435 <xsl:with-param name="ccrCodedDescription" select="a:Description"/> 436 </xsl:call-template> 437 438 <xsl:call-template name="ccdStatus"> 439 <xsl:with-param name="ccrStatus" select="a:Status"/> 440 </xsl:call-template> 452 441 </observation> 453 442 </entryRelationship> 443 454 444 </act> 455 445 </entry> … … 480 470 <th>Source</th> 481 471 </tr> 482 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure">472 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure"> 483 473 <tr> 474 <xsl:attribute name="id"> 475 <xsl:value-of select="a:CCRDataObjectID"></xsl:value-of> 476 </xsl:attribute> 477 484 478 <td> 485 479 <xsl:value-of select="a:Type/a:Text"/> 486 480 </td> 487 <td> 488 <xsl:call-template name="date:format-date"> 489 <xsl:with-param name="date-time"> 490 <xsl:value-of select="a:DateTime/a:ExactDateTime"/> 491 </xsl:with-param> 492 </xsl:call-template> 493 </td> 481 <table> 482 <tbody> 483 <xsl:apply-templates select="a:DateTime"/> 484 </tbody> 485 </table> 494 486 <td> 495 487 <xsl:apply-templates select="a:Description/a:Code"/> … … 543 535 </section> 544 536 </component> 537 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Procedures/a:Procedure"> 538 <entry typeCode="DRIV"> 539 <procedure classCode="PROC" moodCode="EVN"> 540 <templateId root="2.16.840.1.113883.3.88.11.83.17" assigningAuthorityName="HITSP C83"/> 541 <templateId root="2.16.840.1.113883.10.20.1.29" assigningAuthorityName="CCD"/> 542 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.19" assigningAuthorityName="IHE PCC"/> 543 <id> 544 <xsl:attribute name="root"> 545 <xsl:value-of select="a:CCRDataObjectID"></xsl:value-of> 546 </xsl:attribute> 547 </id> 548 <code> 549 <xsl:attribute name="code"> 550 <xsl:value-of select="a:Description/a:Code/a:Value"/> 551 </xsl:attribute> 552 <xsl:attribute name="codeSystemName"> 553 <xsl:value-of select="a:Description/a:Code/a:CodingSystem"/> 554 </xsl:attribute> 555 <xsl:attribute name="codeSystem"> 556 <xsl:call-template name="HL7OIDLookup"> 557 <xsl:with-param name="name" select="a:Description/a:Code/a:CodingSystem"/> 558 </xsl:call-template> 559 </xsl:attribute> 560 <xsl:attribute name="displayName"> 561 <xsl:value-of select="a:Description/a:Text"/> 562 </xsl:attribute> 563 </code> 564 <text> 565 <reference> 566 <xsl:attribute name="value"> 567 <xsl:value-of select="a:CCRDataObjectID"/> 568 </xsl:attribute> 569 </reference> 570 </text> 571 <statusCode> 572 <xsl:attribute name="value"> 573 <xsl:value-of select="a:Status/a:Text"/> 574 </xsl:attribute> 575 </statusCode> 576 <xsl:call-template name="ccdDateTime"> 577 <xsl:with-param name="dt" select="a:DateTime"/> 578 </xsl:call-template> 579 <xsl:if test="a:Method"> 580 <approachSiteCode> 581 <xsl:attribute name="code"> 582 <xsl:value-of select="a:Method/a:Code/a:Value"/> 583 </xsl:attribute> 584 <xsl:attribute name="codeSystemName"> 585 <xsl:value-of select="a:Method/a:Code/a:CodingSystem"/> 586 </xsl:attribute> 587 <xsl:attribute name="codeSystem"> 588 <xsl:call-template name="HL7OIDLookup"> 589 <xsl:with-param name="name" select="a:Method/a:Code/a:CodingSystem"/> 590 </xsl:call-template> 591 </xsl:attribute> 592 <xsl:attribute name="displayName"> 593 <xsl:value-of select="a:Method/a:Text"/> 594 </xsl:attribute> 595 </approachSiteCode> 596 </xsl:if> 597 <xsl:if test="a:Site"> 598 <targetSiteCode> 599 <xsl:attribute name="code"> 600 <xsl:value-of select="a:Site/a:Code/a:Value"/> 601 </xsl:attribute> 602 <xsl:attribute name="codeSystemName"> 603 <xsl:value-of select="a:Site/a:Code/a:CodingSystem"/> 604 </xsl:attribute> 605 <xsl:attribute name="codeSystem"> 606 <xsl:call-template name="HL7OIDLookup"> 607 <xsl:with-param name="name" select="a:Site/a:Code/a:CodingSystem"/> 608 </xsl:call-template> 609 </xsl:attribute> 610 <xsl:attribute name="displayName"> 611 <xsl:value-of select="a:Site/a:Text"/> 612 </xsl:attribute> 613 </targetSiteCode> 614 </xsl:if> 615 <xsl:if test="a:Practitioners/a:Practitioner"> 616 <xsl:variable name="PractitionerActorID" select="a:Practitioners/a:Practitioner[0]/a:ActorID"/> 617 <performer typeCode="PRF"> 618 <assignedEntity> 619 <xsl:variable name="CCRActor" select="/a:ContinuityOfCareRecord/a:Actors[a:ActorObjectID=$PractitionerActorID]/a:Actor"/> 620 <xsl:if test="$CCRActor/a:Address"> 621 <addr> 622 <streetAddressLine> 623 <xsl:value-of select="$CCRActor/a:Address[0]/a:Line1"/> 624 </streetAddressLine> 625 <city> 626 <xsl:value-of select="$CCRActor/a:Address[0]/a:City"/> 627 </city> 628 <state> 629 <xsl:value-of select="$CCRActor/a:Address[0]/a:State"/> 630 </state> 631 <postalcode> 632 <xsl:value-of select="$CCRActor/a:Address[0]/a:PostalCode"/> 633 </postalcode> 634 </addr> 635 </xsl:if> 636 <xsl:if test="$CCRActor/a:Telephone"> 637 <telecom> 638 <xsl:attribute name="extension"> 639 <xsl:value-of select="$CCRActor/a:Telephone[0]/a:Value"/> 640 </xsl:attribute> 641 </telecom> 642 </xsl:if> 643 <assignedPerson> 644 <name> 645 <xsl:call-template name="actorName"> 646 <xsl:with-param name="objID" select="$PractitionerActorID"/> 647 </xsl:call-template> 648 </name> 649 </assignedPerson> 650 </assignedEntity> 651 </performer> 652 </xsl:if> 653 </procedure> 654 </entry> 655 </xsl:for-each> 545 656 </xsl:if> 546 657 <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:Medications"> 547 658 <component> 548 659 <section> 549 <templateId root="2.16.840.1.113883.10.20.1.8"/> 550 <code code="10160-0" codeSystem="2.16.840.1.113883.6.1"/> 660 <templateId root="2.16.840.1.113883.3.88.11.83.112" assigningAuthorityName="HITSP/C83"/> 661 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.19" assigningAuthorityName="IHE PCC"/> 662 <templateId root="2.16.840.1.113883.10.20.1.8" assigningAuthorityName="HL7 CCD"/> 663 <!--Medications section template--> 664 <code code="10160-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of medication use"/> 551 665 <title>Medications</title> 552 666 <text> … … 566 680 <th>Source</th> 567 681 </tr> 568 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Body/a:Medications/a:Medication">682 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Medications/a:Medication"> 569 683 <tr> 570 684 <td> 571 572 685 <xsl:value-of select="a:Product/a:ProductName/a:Text"/> 573 686 <xsl:if test="a:Product/a:BrandName"> … … 662 775 </table> 663 776 </text> 777 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Medications/a:Medication"> 778 <entry typeCode="DRIV"> 779 <substanceAdministration classCode="SBADM" moodCode="EVN"> 780 <templateId root="2.16.840.1.113883.10.20.1.24" assigningAuthorityName="CCD"/> 781 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1" assigningAuthorityName="IHE PCC"/> 782 <!--Medication activity template --> 783 <id> 784 <xsl:attribute name="root"> 785 <xsl:value-of select="a:CCRDataObjectID"></xsl:value-of> 786 </xsl:attribute> 787 </id> 788 <statusCode> 789 <xsl:attribute name="value"> 790 <xsl:value-of select="a:Status/a:Text"/> 791 </xsl:attribute> 792 </statusCode> 793 <xsl:call-template name="ccdDateTime"> 794 <xsl:with-param name="dt" select="a:DateTime"/> 795 <xsl:with-param name="type" select="'IVL_TS'"/> 796 </xsl:call-template> 797 <xsl:call-template name="ccdMedicationFrequency"> 798 <xsl:with-param name="frequency" select="a:Directions/a:Direction/a:Frequency"/> 799 </xsl:call-template> 800 <xsl:if test="a:Directions/a:Direction/a:Route"> 801 <routeCode> 802 <xsl:attribute name="code"> 803 <xsl:value-of select="a:Directions/a:Direction/a:Route/a:Code/a:Value"></xsl:value-of> 804 </xsl:attribute> 805 <xsl:attribute name="codeSystem"> 806 <xsl:call-template name="HL7OIDLookup"> 807 <xsl:with-param name="name" select="a:Directions/a:Direction/a:Route/a:Code/a:CodingSystem"/> 808 </xsl:call-template> 809 </xsl:attribute> 810 <xsl:attribute name="displayName"> 811 <xsl:value-of select="a:Directions/a:Direction/a:Route/a:Text"></xsl:value-of> 812 </xsl:attribute> 813 </routeCode> 814 </xsl:if> 815 <xsl:if test="a:Directions/a:Direction/a:Dose"> 816 <doseQuantity> 817 <low> 818 <xsl:attribute name="value"> 819 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Value"></xsl:value-of> 820 </xsl:attribute> 821 <xsl:attribute name="unit"> 822 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Unit"></xsl:value-of> 823 </xsl:attribute> 824 </low> 825 <high> 826 <xsl:attribute name="value"> 827 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Value"></xsl:value-of> 828 </xsl:attribute> 829 <xsl:attribute name="unit"> 830 <xsl:value-of select="a:Directions/a:Direction/a:Dose/a:Unit"></xsl:value-of> 831 </xsl:attribute> 832 </high> 833 </doseQuantity> 834 </xsl:if> 835 <consumable> 836 <manufacturedProduct> 837 <templateId root="2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName="HITSP C83"/> 838 <templateId root="2.16.840.1.113883.10.20.1.53" assigningAuthorityName="CCD"/> 839 <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName="IHE PCC"/> 840 <!-- Product template --> 841 <manufacturedMaterial> 842 <code> 843 <xsl:attribute name="code"> 844 <xsl:value-of select="a:Product/a:ProductName/a:Code/a:Value"></xsl:value-of> 845 </xsl:attribute> 846 <xsl:attribute name="codeSystem"> 847 <xsl:call-template name="HL7OIDLookup"> 848 <xsl:with-param name="name" select="a:Product/a:ProductName/a:Code/a:CodingSystem"/> 849 </xsl:call-template> 850 </xsl:attribute> 851 <xsl:attribute name="displayName"> 852 <xsl:value-of select="a:Product/a:ProductName/a:Text"></xsl:value-of> 853 </xsl:attribute> 854 </code> 855 <name> 856 <xsl:value-of select="a:Product/a:BrandName/a:Text"></xsl:value-of> 857 </name> 858 </manufacturedMaterial> 859 </manufacturedProduct> 860 </consumable> 861 </substanceAdministration> 862 </entry> 863 </xsl:for-each> 664 864 </section> 665 865 </component> … … 682 882 <th>Source</th> 683 883 </tr> 684 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Body/a:Immunizations/a:Immunization">884 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Immunizations/a:Immunization"> 685 885 <tr> 686 886 <td> … … 735 935 <th>Source</th> 736 936 </tr> 737 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Body/a:VitalSigns/a:Result">937 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:VitalSigns/a:Result"> 738 938 <tr> 739 939 <td> … … 791 991 <th>Source</th> 792 992 </tr> 793 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Body/a:Encounters/a:Encounter">993 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Encounters/a:Encounter"> 794 994 <tr> 795 995 <td> … … 864 1064 <th>Source</th> 865 1065 </tr> 866 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement">1066 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:SocialHistory/a:SocialHistoryElement"> 867 1067 <tr> 868 1068 <td> … … 916 1116 <th>Source</th> 917 1117 </tr> 918 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Body/a:FamilyHistory/a:FamilyProblemHistory">1118 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:FamilyHistory/a:FamilyProblemHistory"> 919 1119 <tr> 920 1120 <td> … … 971 1171 <th>Source</th> 972 1172 </tr> 973 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Body/a:Results/a:Result[a:Test/a:TestResult/a:Value!='']">1173 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Results/a:Result[a:Test/a:TestResult/a:Value!='']"> 974 1174 <tr> 975 1175 <td> … … 1033 1233 <th>Source</th> 1034 1234 </tr> 1035 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Body/a:Payers/a:Payer">1235 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Payers/a:Payer"> 1036 1236 <tr> 1037 1237 <td> … … 1092 1292 <th>Source</th> 1093 1293 </tr> 1094 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Treatment Recommendation']">1294 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Treatment Recommendation']"> 1095 1295 <tr> 1096 1296 <td> … … 1136 1336 <th>Source</th> 1137 1337 </tr> 1138 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Order']">1338 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:PlanOfCare/a:Plan[a:Type/a:Text='Order']"> 1139 1339 <tr> 1140 1340 <td> … … 1213 1413 <th>Name</th> 1214 1414 </tr> 1215 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Body/a:HealthCareProviders/a:Provider">1415 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:HealthCareProviders/a:Provider"> 1216 1416 <tr> 1217 1417 <td> … … 1242 1442 <th>Name</th> 1243 1443 </tr> 1244 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Body/a:Support/a:SupportProvider">1444 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:Support/a:SupportProvider"> 1245 1445 <tr> 1246 1446 <td> … … 1274 1474 <th>Source</th> 1275 1475 </tr> 1276 <xsl:for-each select=" a:ContinuityOfCareRecord/a:References/a:Reference">1476 <xsl:for-each select="/a:ContinuityOfCareRecord/a:References/a:Reference"> 1277 1477 <tr> 1278 1478 <td> … … 1322 1522 <th>Address/ E-mail</th> 1323 1523 </tr> 1324 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Actors/a:Actor">1524 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Actors/a:Actor"> 1325 1525 <xsl:sort select="a:Person/a:Name/a:DisplayName|a:Person/a:Name/a:CurrentName/a:Family" data-type="text" order="ascending"/> 1326 1526 <xsl:if test="a:Person"> … … 1367 1567 </xsl:if> 1368 1568 <xsl:if test="a:City"> 1369 <xsl:value-of select="a:City"/>, 1569 <xsl:value-of select="a:City"/> 1570 <xsl:text>, </xsl:text> 1370 1571 </xsl:if> 1371 1572 <xsl:value-of select="a:State"/> … … 1395 1596 <th>Address/ E-mail</th> 1396 1597 </tr> 1397 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Actors/a:Actor">1598 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Actors/a:Actor"> 1398 1599 <xsl:sort select="a:Organization/a:Name" data-type="text" order="ascending"/> 1399 1600 <xsl:if test="a:Organization"> … … 1438 1639 </xsl:if> 1439 1640 <xsl:if test="a:City"> 1440 <xsl:value-of select="a:City"/>, 1641 <xsl:value-of select="a:City"/> 1642 <xsl:text>, </xsl:text> 1441 1643 </xsl:if> 1442 1644 <xsl:value-of select="a:State"/> … … 1466 1668 <th>Address/ E-mail</th> 1467 1669 </tr> 1468 <xsl:for-each select=" a:ContinuityOfCareRecord/a:Actors/a:Actor">1670 <xsl:for-each select="/a:ContinuityOfCareRecord/a:Actors/a:Actor"> 1469 1671 <xsl:sort select="a:InformationSystem/a:Name" data-type="text" order="ascending"/> 1470 1672 <xsl:if test="a:InformationSystem"> … … 1509 1711 </xsl:if> 1510 1712 <xsl:if test="a:City"> 1511 <xsl:value-of select="a:City"/>, 1713 <xsl:value-of select="a:City"/> 1714 <xsl:text>, </xsl:text> 1512 1715 </xsl:if> 1513 1716 <xsl:value-of select="a:State"/>
Note:
See TracChangeset
for help on using the changeset viewer.