source: ccr/trunk/p/GPLCCR0.m@ 34

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

Enabled Vitals processing in GPLCCR.m
Fixed bug where if you ran EXPORTGPLCCR more than once body tags would still get added (added K TMP($J,"CCRSTEP") before setting it by INITSTPS)
Added code to start processing Vitals for selected patient
Cleaned up some of the template CCR so information in CCR would be correct

File size: 14.1 KB
Line 
1GPLCCR0 ; CCDCCR/GPL - CCR TEMPLATE AND ACCESS ROUTINES; 5/31/08
2 ;;0.1;CCDCCR;nopatch;noreleasedate
3 W "This is a CCR 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,"GPLCCR0")
44 ; ZWR @ARY
45 Q
46 ;
47;<TEMPLATE>
48;;<?xml version="1.0" encoding="UTF-8"?>
49;;<?xml-stylesheet type="text/xsl" href="ccr_20060420.xsl"?>
50;;<ContinuityOfCareRecord xmlns="urn:astm-org:CCR">
51;;<CCRDocumentObjectID>871bd605-e8f8-4b80-9918-4b03f781129e</CCRDocumentObjectID>
52;;<Language>
53;;<Text>English</Text>
54;;</Language>
55;;<Version>V1.0</Version>
56;;<DateTime>
57;;<ExactDateTime>@@DATETIME@@2008-03-18T23:10:58Z</ExactDateTime>
58;;</DateTime>
59;;<Patient>
60;;<ActorID>@@ACTORPATIENT@@</ActorID>
61;;</Patient>
62;;<From>
63;;<ActorLink>
64;;<ActorID>@@ACTORFROM@@</ActorID>
65;;</ActorLink>
66;;<ActorLink>
67;;<ActorID>@@ACTORFROM2@@</ActorID>
68;;</ActorLink>
69;;</From>
70;;<To>
71;;<ActorLink>
72;;<ActorID>@@ACTORTO@@</ActorID>
73;;<ActorRole>
74;;<Text>Primary Provider</Text>
75;;</ActorRole>
76;;</ActorLink>
77;;</To>
78;;<Purpose>
79;;<Description>
80;;<Text>@@PURPOSEDESCRIPTION@@CEND PHR</Text>
81;;</Description>
82;;</Purpose>
83;;<Body>
84;;<Problems>
85;;<Problem>
86;;<CCRDataObjectID>@@PROBLEMOBJECTID@@</CCRDataObjectID>
87;;<Type>
88;;<Text>Problem</Text>
89;;</Type>
90;;<Description>
91;;<Text>@@PROBLEMDESCRIPTION@@</Text>
92;;<Code>
93;;<Value>@@PROBLEMCODEVALUE@@</Value>
94;;<CodingSystem>ICD9CM</CodingSystem>
95;;<Version>@@PROBLEMCODINGVERSION@@</Version>
96;;</Code>
97;;</Description>
98;;<Source>
99;;<Actor>
100;;<ActorID>@@PROBLEMSOURCEACTORID@@</ActorID>
101;;</Actor>
102;;</Source>
103;;</Problem>
104;;</Problems>
105;;<FamilyHistory>
106;;<FamilyProblemHistory>
107;;<CCRDataObjectID></CCRDataObjectID>
108;;<Source>
109;;<Actor>
110;;<ActorID>AA0001</ActorID>
111;;</Actor>
112;;</Source>
113;;<FamilyMember>
114;;<ActorID>AA0003</ActorID>
115;;<ActorRole>
116;;<Text>Father</Text>
117;;</ActorRole>
118;;<Source>
119;;<Actor>
120;;<ActorID>AA0001</ActorID>
121;;</Actor>
122;;</Source>
123;;</FamilyMember>
124;;<Problem>
125;;<Type>
126;;<Text>Problem</Text>
127;;</Type>
128;;<Description>
129;;<Text>Heart Disease</Text>
130;;<Code>
131;;<Value>C0018799</Value>
132;;<CodingSystem>UMLS Concept</CodingSystem>
133;;<Version>2006</Version>
134;;</Code>
135;;<Code>
136;;<Value>429.9</Value>
137;;<CodingSystem>ICD9CM</CodingSystem>
138;;<Version>2006</Version>
139;;</Code>
140;;<Code>
141;;<Value>56265001</Value>
142;;<CodingSystem>SNOMEDCT</CodingSystem>
143;;<Version>2006</Version>
144;;</Code>
145;;</Description>
146;;<Source>
147;;<Actor>
148;;<ActorID>AA0001</ActorID>
149;;</Actor>
150;;</Source>
151;;</Problem>
152;;</FamilyProblemHistory>
153;;<FamilyProblemHistory>
154;;<CCRDataObjectID>BB0003</CCRDataObjectID>
155;;<Source>
156;;<Actor>
157;;<ActorID>AA0001</ActorID>
158;;</Actor>
159;;</Source>
160;;<FamilyMember>
161;;<ActorID>AA0004</ActorID>
162;;<ActorRole>
163;;<Text>Grandparents</Text>
164;;</ActorRole>
165;;<Source>
166;;<Actor>
167;;<ActorID>AA0001</ActorID>
168;;</Actor>
169;;</Source>
170;;</FamilyMember>
171;;<Problem>
172;;<Type>
173;;<Text>Problem</Text>
174;;</Type>
175;;<Description>
176;;<Text>Arthritis</Text>
177;;<Code>
178;;<Value>C0003873</Value>
179;;<CodingSystem>UMLS Concept</CodingSystem>
180;;<Version>2006</Version>
181;;</Code>
182;;<Code>
183;;<Value>714.0</Value>
184;;<CodingSystem>ICD9CM</CodingSystem>
185;;<Version>2006</Version>
186;;</Code>
187;;<Code>
188;;<Value>69896004</Value>
189;;<CodingSystem>SNOMEDCT</CodingSystem>
190;;<Version>2006</Version>
191;;</Code>
192;;</Description>
193;;<Source>
194;;<Actor>
195;;<ActorID>AA0001</ActorID>
196;;</Actor>
197;;</Source>
198;;</Problem>
199;;<Problem>
200;;<Type>
201;;<Text>Problem</Text>
202;;</Type>
203;;<Description>
204;;<Text>Diabetes Mellitus</Text>
205;;<Code>
206;;<Value>C0375113</Value>
207;;<CodingSystem>UMLS Concept</CodingSystem>
208;;<Version>2006</Version>
209;;</Code>
210;;<Code>
211;;<Value>250.00</Value>
212;;<CodingSystem>ICD9CM</CodingSystem>
213;;<Version>2006</Version>
214;;</Code>
215;;</Description>
216;;<Source>
217;;<Actor>
218;;<ActorID>AA0001</ActorID>
219;;</Actor>
220;;</Source>
221;;</Problem>
222;;<Problem>
223;;<Type>
224;;<Text>Problem</Text>
225;;</Type>
226;;<Description>
227;;<Text>Parkinson's disease NOS</Text>
228;;<Code>
229;;<Value>332.0</Value>
230;;<CodingSystem>ICD9CM</CodingSystem>
231;;<Version>2007</Version>
232;;</Code>
233;;</Description>
234;;<Source>
235;;<Actor>
236;;<ActorID>AA0001</ActorID>
237;;</Actor>
238;;</Source>
239;;</Problem>
240;;</FamilyProblemHistory>
241;;</FamilyHistory>
242;;<SocialHistory>
243;;<SocialHistoryElement>
244;;<CCRDataObjectID>BB0004</CCRDataObjectID>
245;;<Type>
246;;<Text>Marital Status</Text>
247;;</Type>
248;;<Description>
249;;<Text>Married</Text>
250;;</Description>
251;;<Source>
252;;<Actor>
253;;<ActorID>AA0001</ActorID>
254;;</Actor>
255;;</Source>
256;;</SocialHistoryElement>
257;;<SocialHistoryElement>
258;;<CCRDataObjectID>BB0005</CCRDataObjectID>
259;;<Type>
260;;<Text>Ethnic Origin</Text>
261;;</Type>
262;;<Description>
263;;<Text>Not Hispanic or Latino</Text>
264;;</Description>
265;;<Source>
266;;<Actor>
267;;<ActorID>AA0001</ActorID>
268;;</Actor>
269;;</Source>
270;;</SocialHistoryElement>
271;;<SocialHistoryElement>
272;;<CCRDataObjectID>BB0006</CCRDataObjectID>
273;;<Type>
274;;<Text>Race</Text>
275;;</Type>
276;;<Description>
277;;<Text>White</Text>
278;;</Description>
279;;<Source>
280;;<Actor>
281;;<ActorID>AA0001</ActorID>
282;;</Actor>
283;;</Source>
284;;</SocialHistoryElement>
285;;<SocialHistoryElement>
286;;<CCRDataObjectID>BB0007</CCRDataObjectID>
287;;<Type>
288;;<Text>Occupation</Text>
289;;</Type>
290;;<Description>
291;;<Text>Physician</Text>
292;;</Description>
293;;<Source>
294;;<Actor>
295;;<ActorID>AA0001</ActorID>
296;;</Actor>
297;;</Source>
298;;</SocialHistoryElement>
299;;</SocialHistory>
300;;<Medications>
301;;<Medication>
302;;<CCRDataObjectID>BB0008</CCRDataObjectID>
303;;<DateTime>
304;;<Type>
305;;<Text>Begin Date</Text>
306;;</Type>
307;;<Age>
308;;<Value>42</Value>
309;;<Units>
310;;<Unit>Years</Unit>
311;;</Units>
312;;</Age>
313;;</DateTime>
314;;<Type>
315;;<Text>Medication</Text>
316;;</Type>
317;;<Status>
318;;<Text>Active</Text>
319;;</Status>
320;;<Source>
321;;<Actor>
322;;<ActorID>AA0001</ActorID>
323;;</Actor>
324;;</Source>
325;;<Product>
326;;<ProductName>
327;;<Text>simvastatin</Text>
328;;<Code>
329;;<Value>36567</Value>
330;;<CodingSystem>RXNORM</CodingSystem>
331;;<Version>2005</Version>
332;;</Code>
333;;</ProductName>
334;;<BrandName>
335;;<Text>Simvastatin</Text>
336;;<Code>
337;;<Value>00093715510</Value>
338;;<CodingSystem>NDC</CodingSystem>
339;;<Version>2005</Version>
340;;</Code>
341;;</BrandName>
342;;<Strength>
343;;<Value>40</Value>
344;;<Units>
345;;<Unit>mg</Unit>
346;;</Units>
347;;</Strength>
348;;<Form>
349;;<Text>tablet</Text>
350;;</Form>
351;;</Product>
352;;<Directions>
353;;<Direction>
354;;<Description>
355;;<Text>1 PO 1 time per day</Text>
356;;</Description>
357;;<Dose>
358;;<Value>1</Value>
359;;</Dose>
360;;<Route>
361;;<Text>PO</Text>
362;;</Route>
363;;<Frequency>
364;;<Value>1 time per day</Value>
365;;</Frequency>
366;;</Direction>
367;;</Directions>
368;;</Medication>
369;;</Medications>
370;;<VitalSigns>
371;;<Result>
372;;<CCRDataObjectID>@@DATAOBJECTID@@</CCRDataObjectID>
373;;<DateTime>
374;;<Type>
375;;<Text>Assessment Time</Text>
376;;</Type>
377;;<ExactDateTime>@@HEIGHTWEIGHTDATATIME@@</ExactDateTime>
378;;</DateTime>
379;;<Description>
380;;<Text>Height &amp; Weight</Text>
381;;</Description>
382;;<Source>
383;;<Actor>
384;;<ActorID>@@HEIGHTWEIGHTSOURCE@@</ActorID>
385;;</Actor>
386;;</Source>
387;;<Test>
388;;<CCRDataObjectID>@@DATAOBJECTID@@</CCRDataObjectID>
389;;<Type>
390;;<Text>Observation</Text>
391;;</Type>
392;;<Description>
393;;<Text>Height</Text>
394;;<Code>
395;;<Value>50373000</Value>
396;;<CodingSystem>SNOMED</CodingSystem>
397;;<Version>2006</Version>
398;;</Code>
399;;</Description>
400;;<Source>
401;;<Actor>
402;;<ActorID>@@HEIGHTSOURCEID@@</ActorID>
403;;</Actor>
404;;</Source>
405;;<TestResult>
406;;<Value>@@HEIGHTINCHES@@</Value>
407;;<Units>
408;;<Unit>in</Unit>
409;;</Units>
410;;</TestResult>
411;;</Test>
412;;<Test>
413;;<CCRDataObjectID>@@DATAOBJECTID@@</CCRDataObjectID>
414;;<Type>
415;;<Text>Observation</Text>
416;;</Type>
417;;<Description>
418;;<Text>Weight</Text>
419;;<Code>
420;;<Value>363808001</Value>
421;;<CodingSystem>SNOMED</CodingSystem>
422;;<Version>2006</Version>
423;;</Code>
424;;</Description>
425;;<Source>
426;;<Actor>
427;;<ActorID>@@WEIGHTSOURCEID@@</ActorID>
428;;</Actor>
429;;</Source>
430;;<TestResult>
431;;<Value>@@WEIGHTLBS@@</Value>
432;;<Units>
433;;<Unit>lb</Unit>
434;;</Units>
435;;</TestResult>
436;;</Test>
437;;</Result>
438;;<Result>
439;;<CCRDataObjectID>@@DATAOBJECTID@@</CCRDataObjectID>
440;;<Description>
441;;<Text>Blood Type</Text>
442;;</Description>
443;;<Source>
444;;<Actor>
445;;<ActorID>@@BLOODTYPESOURCEID@@</ActorID>
446;;</Actor>
447;;</Source>
448;;<Test>
449;;<CCRDataObjectID>@@DATAOBJECTID@@</CCRDataObjectID>
450;;<Type>
451;;<Text>Result</Text>
452;;</Type>
453;;<Description>
454;;<Text>Blood Type</Text>
455;;<Code>
456;;<Value>278149003</Value>
457;;<CodingSystem>SNOMED</CodingSystem>
458;;<Version>2005</Version>
459;;</Code>
460;;</Description>
461;;<Source>
462;;<Actor>
463;;<ActorID>@@BLOODTYPESOURCEID2@@</ActorID>
464;;</Actor>
465;;</Source>
466;;<TestResult>
467;;<Value>@@BLOODTYPERESULT@@</Value>
468;;</TestResult>
469;;</Test>
470;;</Result>
471;;</VitalSigns>
472;;<HealthCareProviders>
473;;<Provider>
474;;<ActorID>AA0005</ActorID>
475;;<ActorRole>
476;;<Text>Primary Provider</Text>
477;;</ActorRole>
478;;</Provider>
479;;</HealthCareProviders>
480;;</Body>
481;;<Actors>
482;;<Actor>
483;;<ActorObjectID>@@ACTOROBJECTID@@</ActorObjectID>
484;;<Person>
485;;<Name>
486;;<CurrentName>
487;;<Given>@@ACTORGIVENNAME@@</Given>
488;;<Middle>@@ACTORMIDDLENAME@@</Middle>
489;;<Family>@@ACTORFAMILYNAME@@</Family>
490;;</CurrentName>
491;;</Name>
492;;<DateOfBirth>
493;;<ExactDateTime>@@ACTORDATEOFBIRTH@@</ExactDateTime>
494;;</DateOfBirth>
495;;<Gender>
496;;<Text>@@ACTORGENDER@@</Text>
497;;</Gender>
498;;</Person>
499;;<IDs>
500;;<Type>
501;;<Text>SSN</Text>
502;;</Type>
503;;<ID>@@ACTORSSN@@</ID>
504;;<Source>
505;;<Actor>
506;;<ActorID>@@ACTORSSNSOURCEID@@</ActorID>
507;;</Actor>
508;;</Source>
509;;</IDs>
510;;<Address>
511;;<Type>
512;;<Text>@@ACTORADDRESSTYPE@@</Text>
513;;</Type>
514;;<Line1>@@ACTORADDRESSLINE1@@</Line1>
515;;<Line2>@@ACTORADDRESSLINE2@@</Line2>
516;;<City>@@ACTORADDRESSCITY@@</City>
517;;<State>@@ACTORADDRESSSTATE@@</State>
518;;<PostalCode>@@ACTORADDRESSZIPCODE@@</PostalCode>
519;;</Address>
520;;<Telephone>
521;;<Value>@@ACTORTELEPHONE@@</Value>
522;;<Type>
523;;<Text>@@ACTORTELEPHONETYPE@@</Text>
524;;</Type>
525;;</Telephone>
526;;<EMail>
527;;<Value>@@ACTOREMAIL@@</Value>
528;;</EMail>
529;;<Source>
530;;<Actor>
531;;<ActorID>@@ACTORADDRESSSOURCEID@@</ActorID>
532;;</Actor>
533;;</Source>
534;;</Actor>
535;;<Actor>
536;;<ActorObjectID>@@ACTOROBJECTID@@</ActorObjectID>
537;;<InformationSystem>
538;;<Name>@@ACTORINFOSYSNAME@@</Name>
539;;<Version>@@ACTORINFOSYSVER@@</Version>
540;;</InformationSystem>
541;;<Source>
542;;<Actor>
543;;<ActorID>@@ACTORINFOSYSSOURCEID@@</ActorID>
544;;</Actor>
545;;</Source>
546;;</Actor>
547;;<Actor>
548;;<ActorObjectID>AA0003</ActorObjectID>
549;;<Person>
550;;<Name>
551;;<DisplayName>@@ACTORDISPLAYNAME@@</DisplayName>
552;;</Name>
553;;</Person>
554;;<Relation>
555;;<Text>@@ACTORRELATION@@</Text>
556;;</Relation>
557;;<Source>
558;;<Actor>
559;;<ActorID>@@ACTORRELATIONSOURCEID@@</ActorID>
560;;</Actor>
561;;</Source>
562;;</Actor>
563;;<Actor>
564;;<ActorObjectID>@@ACTOROBJECTID@@</ActorObjectID>
565;;<Person>
566;;<Name>
567;;<CurrentName>
568;;<Given>@@ACTORGIVENNAME@@</Given>
569;;<Family>@@ACTORFAMILYNAME@@</Family>
570;;</CurrentName>
571;;</Name>
572;;</Person>
573;;<Specialty>
574;;<Text>@@ACTORSPECIALITY@@</Text>
575;;</Specialty>
576;;<Address>
577;;<Type>
578;;<Text>@@ACTORADDRESSTYPE@@</Text>
579;;</Type>
580;;<Line1>@@ACTORADDRESSLINE1@@</Line1>
581;;<City>@@ACTORADDRESSLINE2@@</City>
582;;<State>@@ACTORADDRESSSTATE@@</State>
583;;</Address>
584;;<Source>
585;;<Actor>
586;;<ActorID>@@ACTORSOURCEID@@</ActorID>
587;;</Actor>
588;;</Source>
589;;</Actor>
590;;</Actors>
591;;<Signatures>
592;;<CCRSignature>
593;;<SignatureObjectID>S0001</SignatureObjectID>
594;;<ExactDateTime>2008-03-18T23:10:58Z</ExactDateTime>
595;;<Source>
596;;<ActorID>AA0001</ActorID>
597;;</Source>
598;;<Signature>
599;;<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
600;;<SignedInfo>
601;;<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
602;;<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
603;;<Reference URI="">
604;;<Transforms>
605;;<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
606;;</Transforms>
607;;<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
608;;<DigestValue>YFveLLyo+75P7rSciv0/m1O6Ot4=</DigestValue>
609;;</Reference>
610;;</SignedInfo>
611;;<SignatureValue>Bj6sACXl74hrlbUYnu8HqnRab5VGy69BOYjOH7dETxgppXMEd7AoVYaePZvgJft78JR4oQY76hbFyGcIslYauPpJxx2hCd5d56xFeaQg01R6AQOvGnhjlq63TbpFdUq0B4tYsmiibJPbQJhTQe+TcWTBvWaQt8Fkk5blO571YvI=</SignatureValue>
612;;<KeyInfo>
613;;<KeyValue>
614;;<RSAKeyValue>
615;;<Modulus>meH817QYol+/uUEg6j8Mg89s7GTlaN9B+/CGlzrtnQH+swMigZRnEPxHVO8PhEymP/W9nlhAjTScV/CUzA9yJ9WiaOn17c+KReKhfBqL24DX9BpbJ+kLYVz7mBO5Qydk5AzUT2hFwW93irD8iRKP+/t+2Mi2CjNfj8VTjJpHpm0=</Modulus>
616;;<Exponent>AQAB</Exponent>
617;;</RSAKeyValue>
618;;</KeyValue>
619;;</KeyInfo>
620;;</Signature>
621;;</Signature>
622;;</CCRSignature>
623;;</Signatures>
624;;</ContinuityOfCareRecord>
625;</TEMPLATE>
Note: See TracBrowser for help on using the repository browser.