[3] | 1 | GPLCCD0 ; CCDCCR/GPL - CCD TEMPLATE AND ACCESS ROUTINES; 6/7/08
|
---|
[60] | 2 | ;;0.1;CCDCCR;nopatch;noreleasedate
|
---|
| 3 | ;Copyright 2008 WorldVistA. Licensed under the terms of the GNU
|
---|
| 4 | ;General Public License See attached copy of the License.
|
---|
| 5 | ;
|
---|
| 6 | ;This program is free software; you can redistribute it and/or modify
|
---|
| 7 | ;it under the terms of the GNU General Public License as published by
|
---|
| 8 | ;the Free Software Foundation; either version 2 of the License, or
|
---|
| 9 | ;(at your option) any later version.
|
---|
| 10 | ;
|
---|
| 11 | ;This program is distributed in the hope that it will be useful,
|
---|
| 12 | ;but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 13 | ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 14 | ;GNU General Public License for more details.
|
---|
| 15 | ;
|
---|
| 16 | ;You should have received a copy of the GNU General Public License along
|
---|
| 17 | ;with this program; if not, write to the Free Software Foundation, Inc.,
|
---|
| 18 | ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
---|
| 19 | ;
|
---|
[40] | 20 | W "This is a CCD TEMPLATE with processing routines",!
|
---|
| 21 | W !
|
---|
| 22 | Q
|
---|
| 23 | ;
|
---|
[3] | 24 | ZT(ZARY,BAT,LINE) ; private routine to add a line to the ZARY array
|
---|
[40] | 25 | ; ZARY IS PASSED BY NAME
|
---|
| 26 | ; BAT is a string identifying the section
|
---|
| 27 | ; LINE is a test which will evaluate to true or false
|
---|
| 28 | ; I '$G(@ZARY) D
|
---|
| 29 | . S @ZARY@(0)=0 ; initially there are no elements
|
---|
| 30 | . W "GOT HERE LOADING "_LINE,!
|
---|
| 31 | N CNT ; count of array elements
|
---|
| 32 | S CNT=@ZARY@(0) ; contains array count
|
---|
| 33 | S CNT=CNT+1 ; increment count
|
---|
| 34 | S @ZARY@(CNT)=LINE ; put the line in the array
|
---|
| 35 | ; S @ZARY@(BAT,CNT)="" ; index the test by battery
|
---|
| 36 | S @ZARY@(0)=CNT ; update the array counter
|
---|
| 37 | Q
|
---|
| 38 | ;
|
---|
| 39 | ZLOAD(ZARY,ROUTINE) ; load tests into ZARY which is passed by reference
|
---|
| 40 | ; ZARY IS PASSED BY NAME
|
---|
| 41 | ; ZARY = name of the root, closed array format (e.g., "^TMP($J)")
|
---|
| 42 | ; ROUTINE = NAME OF THE ROUTINE - PASSED BY VALUE
|
---|
| 43 | K @ZARY S @ZARY=""
|
---|
| 44 | S @ZARY@(0)=0 ; initialize array count
|
---|
| 45 | N LINE,LABEL,BODY
|
---|
| 46 | N INTEST S INTEST=0 ; switch for in the TEMPLATE section
|
---|
| 47 | N SECTION S SECTION="[anonymous]" ; NO section LABEL
|
---|
| 48 | ;
|
---|
| 49 | N NUM F NUM=1:1 S LINE=$T(+NUM^@ROUTINE) Q:LINE="" D
|
---|
| 50 | . I LINE?." "1";<TEMPLATE>".E S INTEST=1 ; entering section
|
---|
| 51 | . I LINE?." "1";</TEMPLATE>".E S INTEST=0 ; leaving section
|
---|
| 52 | . I INTEST D ; within the section
|
---|
| 53 | . . I LINE?." "1";><".E D ; sub-section name found
|
---|
| 54 | . . . S SECTION=$P($P(LINE,";><",2),">",1) ; pull out name
|
---|
| 55 | . . I LINE?." "1";;".E D ; line found
|
---|
| 56 | . . . D ZT(ZARY,SECTION,$P(LINE,";;",2)) ; put the line in the array
|
---|
| 57 | Q
|
---|
| 58 | ;
|
---|
[3] | 59 | LOAD(ARY) ; LOAD A CCR TEMPLATE INTO ARY PASSED BY NAME
|
---|
[40] | 60 | D ZLOAD(ARY,"GPLCCD0")
|
---|
| 61 | ; ZWR @ARY
|
---|
| 62 | Q
|
---|
| 63 | ;
|
---|
[74] | 64 | ;<TEMPLATE>
|
---|
| 65 | ;;<?xml version="1.0"?>
|
---|
| 66 | ;;<?xml-stylesheet type="text/xsl" href="CCD.xsl"?>
|
---|
| 67 | ;;<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">
|
---|
| 68 | ;;<typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/>
|
---|
| 69 | ;;<templateId root="2.16.840.1.113883.10.20.1"/>
|
---|
| 70 | ;;<id root="db734647-fc99-424c-a864-7e3cda82e703"/>
|
---|
| 71 | ;;<code code="34133-9" codeSystem="2.16.840.1.113883.6.1" displayName="Summarization of episode note"/>
|
---|
| 72 | ;;<title>< value="DOCTITLE"/>@@DOCTITLE@@Good Health Clinic Continuity of Care Document</title>
|
---|
| 73 | ;;<effectiveTime value="@@EFFECTIVETIME@@20000407130000+0500"/>
|
---|
| 74 | ;;<confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.25"/>
|
---|
| 75 | ;;<languageCode code="en-US"/>
|
---|
| 76 | ;;<recordTarget>
|
---|
| 77 | ;;<patientRole>
|
---|
| 78 | ;;<id extension="996-756-495" root="2.16.840.1.113883.19.5"/>
|
---|
| 79 | ;;<patient>
|
---|
| 80 | ;;<name>
|
---|
| 81 | ;;<given>@@PATIENTGIVENNAME@@</given>
|
---|
| 82 | ;;<family>@@PATIENTFAMILYNAME@@</family>
|
---|
| 83 | ;;<suffix>@@PATIENTNAMESUFFIX@@</suffix>
|
---|
| 84 | ;;</name>
|
---|
| 85 | ;;<administrativeGenderCode code="@@PATIENTGENDER@@M" codeSystem="2.16.840.1.113883.5.1"/>
|
---|
| 86 | ;;<birthTime value="@@PATIENTDATEOFBIRTH@@19320924"/>
|
---|
| 87 | ;;</patient>
|
---|
| 88 | ;;<providerOrganization>
|
---|
| 89 | ;;<id root="2.16.840.1.113883.19.5"/>
|
---|
| 90 | ;;<name>@@SITENAME@@Good Health Clinic</name>
|
---|
| 91 | ;;</providerOrganization>
|
---|
| 92 | ;;</patientRole>
|
---|
| 93 | ;;</recordTarget>
|
---|
| 94 | ;;<author>
|
---|
| 95 | ;;<time value="20000407130000+0500"/>
|
---|
| 96 | ;;<assignedAuthor>
|
---|
| 97 | ;;<id root="20cf14fb-b65c-4c8c-a54d-b0cca834c18c"/>
|
---|
| 98 | ;;<assignedPerson>
|
---|
| 99 | ;;<name><prefix>Dr.</prefix><given>@@AUTHORGIVENNAME@@Robert</given><family>@@AUTHORFAMILYNAME@@Dolin</family></name>
|
---|
| 100 | ;;</assignedPerson>
|
---|
| 101 | ;;<representedOrganization>
|
---|
| 102 | ;;<id root="2.16.840.1.113883.19.5"/>
|
---|
| 103 | ;;<name>@@AUTHORSITE@@Good Health Clinic</name>
|
---|
| 104 | ;;</representedOrganization>
|
---|
| 105 | ;;</assignedAuthor>
|
---|
| 106 | ;;</author>
|
---|
| 107 | ;;<informant>
|
---|
| 108 | ;;<assignedEntity>
|
---|
| 109 | ;;<id nullFlavor="NI"/>
|
---|
| 110 | ;;<representedOrganization>
|
---|
| 111 | ;;<id root="2.16.840.1.113883.19.5"/>
|
---|
| 112 | ;;<name>@@INFORMANTORG@@Good Health Clinic</name>
|
---|
| 113 | ;;</representedOrganization>
|
---|
| 114 | ;;</assignedEntity>
|
---|
| 115 | ;;</informant>
|
---|
| 116 | ;;<custodian>
|
---|
| 117 | ;;<assignedCustodian>
|
---|
| 118 | ;;<representedCustodianOrganization>
|
---|
| 119 | ;;<id root="2.16.840.1.113883.19.5"/>
|
---|
| 120 | ;;<name>@@CUSTODIANORG@@Good Health Clinic</name>
|
---|
| 121 | ;;</representedCustodianOrganization>
|
---|
| 122 | ;;</assignedCustodian>
|
---|
| 123 | ;;</custodian>
|
---|
| 124 | ;;<legalAuthenticator>
|
---|
| 125 | ;;<time value="20000407130000+0500"/>
|
---|
| 126 | ;;<signatureCode code="S"/>
|
---|
| 127 | ;;<assignedEntity>
|
---|
| 128 | ;;<id nullFlavor="NI"/>
|
---|
| 129 | ;;<representedOrganization>
|
---|
| 130 | ;;<id root="2.16.840.1.113883.19.5"/>
|
---|
| 131 | ;;<name>@@LEGALORG@@Good Health Clinic</name>
|
---|
| 132 | ;;</representedOrganization>
|
---|
| 133 | ;;</assignedEntity>
|
---|
| 134 | ;;</legalAuthenticator>
|
---|
| 135 | ;;<participant typeCode="IND">
|
---|
| 136 | ;;<associatedEntity classCode="GUAR">
|
---|
| 137 | ;;<id root="4ff51570-83a9-47b7-91f2-93ba30373141"/>
|
---|
| 138 | ;;<addr>
|
---|
| 139 | ;;<streetAddressLine>@@GUARSTREET@@17 Daws Rd.</streetAddressLine>
|
---|
| 140 | ;;<city>@@GUARCITY@@Blue Bell</city>
|
---|
| 141 | ;;<state>@@GUARSTATE@@MA</state>
|
---|
| 142 | ;;<postalCode>@@GUARZIP@@02368</postalCode>
|
---|
| 143 | ;;</addr>
|
---|
| 144 | ;;<telecom value="tel:@@GUARTELE@@(888)555-1212"/>
|
---|
| 145 | ;;<associatedPerson>
|
---|
| 146 | ;;<name>
|
---|
| 147 | ;;<given>@@GUARGIVENNAME@@Kenneth</given>
|
---|
| 148 | ;;<family>@@GUARFAMILYNAME@@Ross</family>
|
---|
| 149 | ;;</name>
|
---|
| 150 | ;;</associatedPerson>
|
---|
| 151 | ;;</associatedEntity>
|
---|
| 152 | ;;</participant>
|
---|
| 153 | ;;<participant typeCode="IND">
|
---|
| 154 | ;;<associatedEntity classCode="NOK">
|
---|
| 155 | ;;<id root="4ac71514-6a10-4164-9715-f8d96af48e6d"/>
|
---|
| 156 | ;;<code code="65656005" codeSystem="2.16.840.1.113883.6.96" displayName="@@NOKRELATION@@Biiological mother"/>
|
---|
| 157 | ;;<telecom value="tel:@@NOKTELE@@(999)555-1212"/>
|
---|
| 158 | ;;<associatedPerson>
|
---|
| 159 | ;;<name>
|
---|
| 160 | ;;<given>@@NOKGIVENNAME@@Henrietta</given>
|
---|
| 161 | ;;<family>@@NOKFAMILYNAME@@Levin</family>
|
---|
| 162 | ;;</name>
|
---|
| 163 | ;;</associatedPerson>
|
---|
| 164 | ;;</associatedEntity>
|
---|
| 165 | ;;</participant>
|
---|
| 166 | ;;<documentationOf>
|
---|
| 167 | ;;<serviceEvent classCode="PCPR">
|
---|
| 168 | ;;<effectiveTime><low value="@@DOCPERIODLOW@@19320924"/><high value="@@DOCPERIODHIGH@@20000407"/></effectiveTime>
|
---|
| 169 | ;;<performer typeCode="PRF">
|
---|
| 170 | ;;<functionCode code="PCP" codeSystem="2.16.840.1.113883.5.88"/>
|
---|
| 171 | ;;<time><low value="@@PCPPERIODLOW@@1990"/><high value='@@PCPPERIODHIGH@@20000407'/></time>
|
---|
| 172 | ;;<assignedEntity>
|
---|
| 173 | ;;<id root="20cf14fb-b65c-4c8c-a54d-b0cca834c18c"/>
|
---|
| 174 | ;;<assignedPerson>
|
---|
| 175 | ;;<name><prefix>@@PCPNAMEPREFIX@@Dr.</prefix><given>@@PCPNAMEGIVEN@@Robert</given><family>@@PCPNAMEFAMILY@@Dolin</family></name>
|
---|
| 176 | ;;</assignedPerson>
|
---|
| 177 | ;;<representedOrganization>
|
---|
| 178 | ;;<id root="2.16.840.1.113883.19.5"/>
|
---|
| 179 | ;;<name>@@PCPORG@@Good Health Clinic</name>
|
---|
| 180 | ;;</representedOrganization>
|
---|
| 181 | ;;</assignedEntity>
|
---|
| 182 | ;;</performer>
|
---|
| 183 | ;;</serviceEvent>
|
---|
| 184 | ;;</documentationOf>
|
---|
| 185 | ;;<component>
|
---|
| 186 | ;;<structuredBody>
|
---|
| 187 | ;;<component>
|
---|
| 188 | ;;<section>
|
---|
| 189 | ;;<templateId root='2.16.840.1.113883.10.20.1.13'/>
|
---|
| 190 | ;;<code code="48764-5" codeSystem="2.16.840.1.113883.6.1"/>
|
---|
| 191 | ;;<title>Summary Purpose</title>
|
---|
| 192 | ;;<text>Transfer of care</text>
|
---|
| 193 | ;;<entry typeCode="DRIV">
|
---|
| 194 | ;;<act classCode="ACT" moodCode="EVN">
|
---|
| 195 | ;;<templateId root='2.16.840.1.113883.10.20.1.30'/>
|
---|
| 196 | ;;<code code="23745001" codeSystem="2.16.840.1.113883.6.96" displayName="Documentation procedure"/>
|
---|
| 197 | ;;<statusCode code="completed"/>
|
---|
| 198 | ;;<entryRelationship typeCode="RSON">
|
---|
| 199 | ;;<act classCode="ACT" moodCode="EVN">
|
---|
| 200 | ;;<code code="308292007" codeSystem="2.16.840.1.113883.6.96" displayName="@@DOCPURPOSE@@Transfer of care"/>
|
---|
| 201 | ;;<statusCode code="completed"/>
|
---|
| 202 | ;;</act>
|
---|
| 203 | ;;</entryRelationship>
|
---|
| 204 | ;;</act>
|
---|
| 205 | ;;</entry>
|
---|
| 206 | ;;</section>
|
---|
| 207 | ;;</component>
|
---|
| 208 | ;;<component>
|
---|
| 209 | ;;<section>
|
---|
| 210 | ;;<templateId root="2.16.840.1.113883.10.20.1.14"/>
|
---|
| 211 | ;;<code code="30954-2" codeSystem="2.16.840.1.113883.6.1"/>
|
---|
| 212 | ;;<entry typeCode="DRIV">
|
---|
| 213 | ;;<organizer classCode="BATTERY" moodCode="EVN">
|
---|
| 214 | ;;<templateId root="2.16.840.1.113883.10.20.1.32"/>
|
---|
| 215 | ;;<id root="7d5a02b0-67a4-11db-bd13-0800200c9a66"/>
|
---|
| 216 | ;;<code code="@@BATTERYCODE@@43789009" codeSystem="@@BATTERYSYSTEM@@2.16.840.1.113883.6.96" displayName="@@BATTERYNAME@@CBC WO DIFFERENTIAL"/>
|
---|
| 217 | ;;<statusCode code="completed"/>
|
---|
| 218 | ;;<effectiveTime value="@@BATTERYTIME@@200003231430"/>
|
---|
| 219 | ;;<component>
|
---|
| 220 | ;;<observation classCode="OBS" moodCode="EVN">
|
---|
| 221 | ;;<templateId root="2.16.840.1.113883.10.20.1.31"/>
|
---|
| 222 | ;;<id root="107c2dc0-67a5-11db-bd13-0800200c9a66"/>
|
---|
| 223 | ;;<code code="@@COMPONENTCODE@@30313-1" codeSystem="@@COMPONENTSYSTEM@@2.16.840.1.113883.6.1" displayName="@@COMPONENTNAME@@HGB"/>
|
---|
| 224 | ;;<statusCode code="completed"/>
|
---|
| 225 | ;;<effectiveTime value="@@COMPONENTTIME@@200003231430"/>
|
---|
| 226 | ;;<value xsi:type="@@COMPONENTTYPE@@PQ" value="@@COMPONENTVALUE@13.2" unit="@@COMPONENTUNIT@@g/dl"/>
|
---|
| 227 | ;;<interpretationCode code="N" codeSystem="2.16.840.1.113883.5.83"/>
|
---|
| 228 | ;;<referenceRange>
|
---|
| 229 | ;;<value="OBSERVATIONRANGE"/>
|
---|
| 230 | ;;<observationRange>
|
---|
| 231 | ;;<text>@@OBSRANGETEXT@@M 13-18 g/dl; F 12-16 g/dl</text>
|
---|
| 232 | ;;</observationRange>
|
---|
| 233 | ;;</referenceRange>
|
---|
| 234 | ;;</observation>
|
---|
| 235 | ;;</component>
|
---|
| 236 | ;;</organizer>
|
---|
| 237 | ;;</entry>
|
---|
| 238 | ;;</section>
|
---|
| 239 | ;;</component>
|
---|
| 240 | ;;</structuredBody>
|
---|
| 241 | ;;</component>
|
---|
| 242 | ;;</ClinicalDocument>
|
---|
| 243 | ;</TEMPLATE>
|
---|