source: ccr/trunk/p/GPLCCD0.m@ 40

Last change on this file since 40 was 40, checked in by Christopher Edwards, 16 years ago

fixed spacing issues

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