| [875] | 1 | <xsl:if test="a:ContinuityOfCareRecord/a:Body/a:AdvanceDirectives"> | 
|---|
|  | 2 | <component> | 
|---|
|  | 3 | <section> | 
|---|
|  | 4 | <templateId root="2.16.840.1.113883.10.20.1.1" assigningAuthorityName="HL7 CCD"/> | 
|---|
|  | 5 | <templateId root="2.16.840.1.113883.3.88.11.83.116" assigningAuthorityName="HITSP/C83"/> | 
|---|
|  | 6 | <templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.35" assigningAuthorityName="IHE PCC"/> | 
|---|
|  | 7 | <templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.34" assigningAuthorityName="IHE PCC"/> | 
|---|
|  | 8 | <!--Advance Directives section template--> | 
|---|
|  | 9 | <code code="42348-3" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Advance directives"/> | 
|---|
|  | 10 | <title>Advance Directives</title> | 
|---|
|  | 11 | <text> | 
|---|
|  | 12 | <table> | 
|---|
|  | 13 | <tbody> | 
|---|
|  | 14 | <tr> | 
|---|
|  | 15 | <th>Type</th> | 
|---|
|  | 16 | <th>Date</th> | 
|---|
|  | 17 | <th>Description</th> | 
|---|
|  | 18 | <th>Status</th> | 
|---|
|  | 19 | <th>Source</th> | 
|---|
|  | 20 | </tr> | 
|---|
|  | 21 | <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:AdvanceDirectives/a:AdvanceDirective"> | 
|---|
|  | 22 | <tr> | 
|---|
|  | 23 | <xsl:attribute name="id"> | 
|---|
|  | 24 | <xsl:value-of select="a:CCRDataObjectID"/> | 
|---|
|  | 25 | </xsl:attribute> | 
|---|
|  | 26 | <td> | 
|---|
|  | 27 | <xsl:value-of select="a:Type/a:Text"/> | 
|---|
|  | 28 | </td> | 
|---|
|  | 29 | <td> | 
|---|
|  | 30 | <xsl:call-template name="date:format-date"> | 
|---|
|  | 31 | <xsl:with-param name="date-time" select="a:DateTime/a:ExactDateTime"/> | 
|---|
|  | 32 | </xsl:call-template> | 
|---|
|  | 33 | </td> | 
|---|
|  | 34 | <td> | 
|---|
|  | 35 | <xsl:attribute name="id"> | 
|---|
|  | 36 | <xsl:value-of select="a:CCRDataObjectID"/> | 
|---|
|  | 37 | <xsl:text>:Narrative</xsl:text> | 
|---|
|  | 38 | </xsl:attribute> | 
|---|
|  | 39 |  | 
|---|
|  | 40 | <xsl:value-of select="a:Description/a:Text"/> | 
|---|
|  | 41 | </td> | 
|---|
|  | 42 | <td> | 
|---|
|  | 43 | <xsl:value-of select="a:Status/a:Text"/> | 
|---|
|  | 44 | </td> | 
|---|
|  | 45 | <td> | 
|---|
|  | 46 | <xsl:call-template name="actorName"> | 
|---|
|  | 47 | <xsl:with-param name="objID" select="a:Source/a:Actor/a:ActorID"/> | 
|---|
|  | 48 | </xsl:call-template> | 
|---|
|  | 49 | </td> | 
|---|
|  | 50 | </tr> | 
|---|
|  | 51 | </xsl:for-each> | 
|---|
|  | 52 | </tbody> | 
|---|
|  | 53 | </table> | 
|---|
|  | 54 | </text> | 
|---|
|  | 55 | <xsl:for-each select="/a:ContinuityOfCareRecord/a:Body/a:AdvanceDirectives/a:AdvanceDirective"> | 
|---|
|  | 56 | <entry typeCode="DRIV"> | 
|---|
|  | 57 | <observation classCode="OBS" moodCode="EVN"> | 
|---|
|  | 58 | <templateId root="2.16.840.1.113883.3.88.11.83.12" assigningAuthorityName="HITSP C83"/> | 
|---|
|  | 59 | <templateId root="2.16.840.1.113883.10.20.1.17" assigningAuthorityName="CCD"/> | 
|---|
|  | 60 | <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13" assigningAuthorityName="IHE PCC"/> | 
|---|
|  | 61 | <templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.13.7" assigningAuthorityName="IHE PCC"/> | 
|---|
|  | 62 | <!-- Advance directive observation template --> | 
|---|
|  | 63 |  | 
|---|
|  | 64 | <!-- <id> --> | 
|---|
|  | 65 | <xsl:call-template name="ccdID"> | 
|---|
|  | 66 | <xsl:with-param name="ccrObjectID" select="a:CCRDataObjectID"/> | 
|---|
|  | 67 | </xsl:call-template> | 
|---|
|  | 68 |  | 
|---|
|  | 69 | <text> | 
|---|
|  | 70 | <reference> | 
|---|
|  | 71 | <xsl:attribute name="value"> | 
|---|
|  | 72 | <xsl:text>#</xsl:text> | 
|---|
|  | 73 | <xsl:value-of select="a:CCRDataObjectID"/> | 
|---|
|  | 74 | </xsl:attribute> | 
|---|
|  | 75 | </reference> | 
|---|
|  | 76 | </text> | 
|---|
|  | 77 |  | 
|---|
|  | 78 | <statusCode code="completed"/> | 
|---|
|  | 79 |  | 
|---|
|  | 80 | <xsl:call-template name="ccdDateTime"> | 
|---|
|  | 81 | <xsl:with-param name="dt" select="a:DateTime"/> | 
|---|
|  | 82 | </xsl:call-template> | 
|---|
|  | 83 |  | 
|---|
|  | 84 | <xsl:call-template name="ccdCodedValue"> | 
|---|
|  | 85 | <xsl:with-param name="ccrCodedDescription" select="a:Description"/> | 
|---|
|  | 86 | <xsl:with-param name="originalTextReference"> | 
|---|
|  | 87 | <xsl:text>#</xsl:text> | 
|---|
|  | 88 | <xsl:value-of select="a:CCRDataObjectID"/> | 
|---|
|  | 89 | <xsl:text>:Narrative</xsl:text> | 
|---|
|  | 90 | </xsl:with-param> | 
|---|
|  | 91 | </xsl:call-template> | 
|---|
|  | 92 |  | 
|---|
|  | 93 | <participant typeCode="VRF"> | 
|---|
|  | 94 | <templateId root="2.16.840.1.113883.10.20.1.58"/> | 
|---|
|  | 95 | <!--Verification of an advance directive observation template --> | 
|---|
|  | 96 | <time nullFlavor="UNK"/> | 
|---|
|  | 97 | <xsl:call-template name="ccdParticipantRoleActor"> | 
|---|
|  | 98 | <xsl:with-param name="ccrActorObjectID" select="a:Source[1]/a:ActorID"/> | 
|---|
|  | 99 | </xsl:call-template> | 
|---|
|  | 100 | </participant> | 
|---|
|  | 101 |  | 
|---|
|  | 102 | <xsl:if test="a:ReferenceID"> | 
|---|
|  | 103 | <reference typeCode="REFR"> | 
|---|
|  | 104 | <externalDocument> | 
|---|
|  | 105 | <templateId root="2.16.840.1.113883.10.20.1.36"/> | 
|---|
|  | 106 | <!-- Advance directive reference template --> | 
|---|
|  | 107 | <xsl:variable name="referenceID" select="a:ReferenceID"/> | 
|---|
|  | 108 | <!-- <id> --> | 
|---|
|  | 109 | <xsl:call-template name="ccdID"> | 
|---|
|  | 110 | <xsl:with-param name="ccrObjectID" select="$referenceID"/> | 
|---|
|  | 111 | </xsl:call-template> | 
|---|
|  | 112 | <code code="371538006" codeSystem="2.16.840.1.113883.6.96" displayName="Advance directive"/> | 
|---|
|  | 113 | <xsl:variable name="reference" select="/a:ContinuityOfCareRecord/a:References/a:Reference[a:ReferenceObjectID=$referenceID]"/> | 
|---|
|  | 114 | <text> | 
|---|
|  | 115 | <xsl:attribute name="mediaType"> | 
|---|
|  | 116 | <xsl:value-of select="$reference/a:Type/a:Text"/> | 
|---|
|  | 117 | </xsl:attribute> | 
|---|
|  | 118 | <reference> | 
|---|
|  | 119 | <xsl:value-of select="$reference/a:Location[1]/a:Description/a:Text"/> | 
|---|
|  | 120 | </reference> | 
|---|
|  | 121 | </text> | 
|---|
|  | 122 | </externalDocument> | 
|---|
|  | 123 | </reference> | 
|---|
|  | 124 | </xsl:if> | 
|---|
|  | 125 | </observation> | 
|---|
|  | 126 | </entry> | 
|---|
|  | 127 |  | 
|---|
|  | 128 | </xsl:for-each> | 
|---|
|  | 129 | </section> | 
|---|
|  | 130 | </component> | 
|---|
|  | 131 | </xsl:if> | 
|---|