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

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

Inital release of GPL*.m files for creating a CCR from VistA. Usage EXPORTGPLCCR

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