source: ccr/trunk/p/GPLCCD1.m@ 84

Last change on this file since 84 was 75, checked in by George Lilly, 16 years ago

second CCD commit

File size: 8.7 KB
Line 
1GPLCCD0 ; CCDCCR/GPL - CCD TEMPLATE AND ACCESS ROUTINES; 6/7/08
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 ;
20 W "This is a CCD TEMPLATE with processing routines",!
21 W !
22 Q
23 ;
24ZT(ZARY,BAT,LINE) ; private routine to add a line to the ZARY array
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 ;
39ZLOAD(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 ;
59LOAD(ARY) ; LOAD A CCR TEMPLATE INTO ARY PASSED BY NAME
60 D ZLOAD(ARY,"GPLCCD1")
61 ; ZWR @ARY
62 Q
63 ;
64TRMCCD ; ROUTINE TO BE WRITTEN TO REMOVE CCR MARKUP FROM CCD
65 Q
66MARKUP ;<MARKUP>
67 ;;<Body>
68 ;;<Problems>
69 ;;</Problems>
70 ;;<FamilyHistory>
71 ;;</FamilyHistory>
72 ;;<SocialHistory>
73 ;;</SocialHistory>
74 ;;<Alerts>
75 ;;</Alerts>
76 ;;<Medications>
77 ;;</Medications>
78 ;;<VitalSigns>
79 ;;</VitalSigns>
80 ;;<Results>
81 ;;</Results>
82 ;;</Body>
83 ;;</ContinuityOfCareRecord>
84 ;</MARKUP>
85 ;;<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">
86 ;;</ClinicalDocument>
87 Q
88 ;
89 ;<TEMPLATE>
90 ;;<?xml version="1.0"?>
91 ;;<?xml-stylesheet type="text/xsl" href="CCD.xsl"?>
92 ;;<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">
93 ;;<typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/>
94 ;;<templateId root="2.16.840.1.113883.10.20.1"/>
95 ;;<id root="db734647-fc99-424c-a864-7e3cda82e703"/>
96 ;;<code code="34133-9" codeSystem="2.16.840.1.113883.6.1" displayName="Summarization of episode note"/>
97 ;;<title>Continuity of Care Document</title>
98 ;;<effectiveTime value="20000407130000+0500"/>
99 ;;<confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.25"/>
100 ;;<languageCode code="en-US"/>
101 ;;<recordTarget>
102 ;;<patientRole>
103 ;;<id extension="@@ACTORIEN@@" root="2.16.840.1.113883.19.5"/>
104 ;;<patient>
105 ;;<name>
106 ;;<given>@@ACTORGIVENNAME@@</given>
107 ;;<family>@@ACTORFAMILYNAME@@</family>
108 ;;<suffix>@@ACTORSUFFIXNAME@@</suffix>
109 ;;</name>
110 ;;<administrativeGenderCode code="@@ACTORGENDER@@" codeSystem="2.16.840.1.113883.5.1"/>
111 ;;<birthTime value="@@ACTORDATEOFBIRTH@@"/>
112 ;;</patient>
113 ;;<providerOrganization>
114 ;;<id root="2.16.840.1.113883.19.5"/>
115 ;;<name>@@ORGANIZATIONNAME@@</name>
116 ;;</providerOrganization>
117 ;;</patientRole>
118 ;;</recordTarget>
119 ;;<author>
120 ;;<time value="20000407130000+0500"/>
121 ;;<assignedAuthor>
122 ;;<id root="20cf14fb-b65c-4c8c-a54d-b0cca834c18c"/>
123 ;;<assignedPerson>
124 ;;<name>
125 ;;<prefix>@@ACTORNAMEPREFIX@@</prefix>
126 ;;<given>@@ACTORGIVENNAME@@</given>
127 ;;<family>@@ACTORFAMILYNAME@@</family>
128 ;;</name>
129 ;;</assignedPerson>
130 ;;<representedOrganization>
131 ;;<id root="2.16.840.1.113883.19.5"/>
132 ;;<name>@@ORGANIZATIONNAME@@</name>
133 ;;</representedOrganization>
134 ;;</assignedAuthor>
135 ;;</author>
136 ;;<informant>
137 ;;<assignedEntity>
138 ;;<id nullFlavor="NI"/>
139 ;;<representedOrganization>
140 ;;<id root="2.16.840.1.113883.19.5"/>
141 ;;<name>@@ORGANIZATIONNAME@@</name>
142 ;;</representedOrganization>
143 ;;</assignedEntity>
144 ;;</informant>
145 ;;<custodian>
146 ;;<assignedCustodian>
147 ;;<representedCustodianOrganization>
148 ;;<id root="2.16.840.1.113883.19.5"/>
149 ;;<name>@@ORGANIZATIONNAME@@</name>
150 ;;</representedCustodianOrganization>
151 ;;</assignedCustodian>
152 ;;</custodian>
153 ;;<legalAuthenticator>
154 ;;<time value="20000407130000+0500"/>
155 ;;<signatureCode code="S"/>
156 ;;<assignedEntity>
157 ;;<id nullFlavor="NI"/>
158 ;;<representedOrganization>
159 ;;<id root="2.16.840.1.113883.19.5"/>
160 ;;<name>@@ORGANIZATIONNAME@@</name>
161 ;;</representedOrganization>
162 ;;</assignedEntity>
163 ;;</legalAuthenticator>
164 ;;<Actors>
165 ;;<ACTOR-NOK>
166 ;;<participant typeCode="IND">
167 ;;<associatedEntity classCode="NOK">
168 ;;<id root="4ac71514-6a10-4164-9715-f8d96af48e6d"/>
169 ;;<code code="65656005" codeSystem="2.16.840.1.113883.6.96" displayName="Biiological mother"/>
170 ;;<telecom value="tel:(999)555-1212"/>
171 ;;<associatedPerson>
172 ;;<name>
173 ;;<given>Henrietta</given>
174 ;;<family>Levin</family>
175 ;;</name>
176 ;;</associatedPerson>
177 ;;</associatedEntity>
178 ;;</participant>
179 ;;</ACTOR-NOK>
180 ;;</Actors>
181 ;;<documentationOf>
182 ;;<serviceEvent classCode="PCPR">
183 ;;<effectiveTime>
184 ;;<high value="@@DATETIME@@"/>
185 ;;</effectiveTime>
186 ;;<performer typeCode="PRF">
187 ;;<functionCode code="PCP" codeSystem="2.16.840.1.113883.5.88"/>
188 ;;<time>
189 ;;<low value="1990"/>
190 ;;<high value='20000407'/>
191 ;;</time>
192 ;;<assignedEntity>
193 ;;<id root="20cf14fb-b65c-4c8c-a54d-b0cca834c18c"/>
194 ;;<assignedPerson>
195 ;;<name>
196 ;;<prefix>@@ACTORPREFIXNAME@@</prefix>
197 ;;<given>@@ACTORGIVENNAME@@</given>
198 ;;<family>@@ACTORFAMILYNAME@@</family>
199 ;;</name>
200 ;;</assignedPerson>
201 ;;<representedOrganization>
202 ;;<id root="2.16.840.1.113883.19.5"/>
203 ;;<name>@@ORGANIZATIONNAME@@</name>
204 ;;</representedOrganization>
205 ;;</assignedEntity>
206 ;;</performer>
207 ;;</serviceEvent>
208 ;;</documentationOf>
209 ;;<Body>
210 ;;<Problems>
211 ;;<component>
212 ;;<section>
213 ;;<templateId root='2.16.840.1.113883.10.20.1.11'/>
214 ;;<code code="11450-4" codeSystem="2.16.840.1.113883.6.1"/>
215 ;;<title>Problems</title>
216 ;;<entry typeCode="DRIV">
217 ;;<act classCode="ACT" moodCode="EVN">
218 ;;<templateId root='2.16.840.1.113883.10.20.1.27'/>
219 ;;<id root="6a2fa88d-4174-4909-aece-db44b60a3abb"/>
220 ;;<code nullFlavor="NA"/>
221 ;;<entryRelationship typeCode="SUBJ">
222 ;;<observation classCode="OBS" moodCode="EVN">
223 ;;<templateId root='2.16.840.1.113883.10.20.1.28'/>
224 ;;<id root="d11275e7-67ae-11db-bd13-0800200c9a66"/>
225 ;;<code code="ASSERTION" codeSystem="2.16.840.1.113883.5.4"/>
226 ;;<statusCode code="completed"/>
227 ;;<effectiveTime>
228 ;;<low value="@@PROBLEMDATEOFONSET@@"/>
229 ;;</effectiveTime>
230 ;;<value xsi:type="CD" code="@@PROBLEMCODEVALUE@@" codeSystem="2.16.840.1.113883.6.96" displayName="@@PROBLEMDESCRIPTION@@"/>
231 ;;<entryRelationship typeCode="REFR">
232 ;;<observation classCode="OBS" moodCode="EVN">
233 ;;<templateId root='2.16.840.1.113883.10.20.1.50'/>
234 ;;<code code="33999-4" codeSystem="2.16.840.1.113883.6.1" displayName="Status"/>
235 ;;<statusCode code="completed"/>
236 ;;<value xsi:type="CE" code="55561003" codeSystem="2.16.840.1.113883.6.96" displayName="Active"/>
237 ;;</observation>
238 ;;</entryRelationship>
239 ;;</observation>
240 ;;</entryRelationship>
241 ;;</act>
242 ;;</entry>
243 ;;</section>
244 ;;</component>
245 ;;</Problems>
246 ;;<FamilyHistory>
247 ;;</FamilyHistory>
248 ;;<SocialHistory>
249 ;;</SocialHistory>
250 ;;<Alerts>
251 ;;</Alerts>
252 ;;<Medications>
253 ;;</Medications>
254 ;;<VitalSigns>
255 ;;</VitalSigns>
256 ;;<Results>
257 ;;</Results>
258 ;;</Body>
259 ;;</ClinicalDocument>
260 ;</TEMPLATE>
Note: See TracBrowser for help on using the repository browser.