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

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

switch proccessing of vitals and problems so CCR would validate
added date time for ccr
cleaned up template ccr (more to come)
more work done in vitals section

File size: 13.4 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@@</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>@@ACTORTOTEXT@@</Text>
75;;</ActorRole>
76;;</ActorLink>
77;;</To>
78;;<Purpose>
79;;<Description>
80;;<Text>@@PURPOSEDESCRIPTION@@</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>@@FAMILYHISTORYOBJECTID@@</CCRDataObjectID>
108;;<Source>
109;;<Actor>
110;;<ActorID>@@FAMILYHISTORYACTORID@@</ActorID>
111;;</Actor>
112;;</Source>
113;;<FamilyMember>
114;;<ActorID>@@FAMILYMEMBERACTORID@@</ActorID>
115;;<ActorRole>
116;;<Text>@@FAMILYMEMBERACTORROLETEXT@@</Text>
117;;</ActorRole>
118;;<Source>
119;;<Actor>
120;;<ActorID>@@FAMILYMEMBERSOURCACTORID@@</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>@@SOCIALHISTORYOBJECTID@@</CCRDataObjectID>
245;;<Type>
246;;<Text>@@SOCIALHISTORYTYPETEXT@@</Text>
247;;</Type>
248;;<Description>
249;;<Text>@@SOCIALHISTORYDESCRIPTIONTEXT@@</Text>
250;;</Description>
251;;<Source>
252;;<Actor>
253;;<ActorID>@@SOCIALHISTORYSOURCACTORID@@</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>@@MEDICATIONOBJECTID@@</CCRDataObjectID>
303;;<DateTime>
304;;<Type>
305;;<Text>@@MEDICATIONDATETIMETEXT@@</Text>
306;;</Type>
307;;<Age>
308;;<Value>@@MEDICATIONDATETIMEAGE@@</Value>
309;;<Units>
310;;<Unit>@@MEDICATIONDATETIMEAGEUNITS@@</Unit>
311;;</Units>
312;;</Age>
313;;</DateTime>
314;;<Type>
315;;<Text>@@MEDICATIONTYPETEXT@@</Text>
316;;</Type>
317;;<Status>
318;;<Text>@@MEDICATIONSTATUSTEXT@@</Text>
319;;</Status>
320;;<Source>
321;;<Actor>
322;;<ActorID>@@MEDICATIONSOURCEACTORID@@</ActorID>
323;;</Actor>
324;;</Source>
325;;<Product>
326;;<ProductName>
327;;<Text>@@MEDICATIONPRODUCTNAMETEXT@@</Text>
328;;<Code>
329;;<Value>@@MEDICATIONPRODUCTNAMECODEVALUE@@</Value>
330;;<CodingSystem>@@MEDICATIONPRODUCTNAMECODINGINGSYSTEM@@</CodingSystem>
331;;<Version>@@MEDICATIONPRODUCTNAMECODEVERSION@@</Version>
332;;</Code>
333;;</ProductName>
334;;<BrandName>
335;;<Text>@@MEDICATIONBRANDNAMETEXT@@</Text>
336;;<Code>
337;;<Value>@@MEDICATIONBRANDNAMECODEVALUE@@</Value>
338;;<CodingSystem>@@MEDICATIONBRANDNAMECODINGSYSTEM@@</CodingSystem>
339;;<Version>@@MEDICATIONBRANDNAMECODEVERSION@@</Version>
340;;</Code>
341;;</BrandName>
342;;<Strength>
343;;<Value>@@MEDICATIONSTRENGTHVALUE@@</Value>
344;;<Units>
345;;<Unit>@@MEDICATIONSTRENGTHUNIT@@</Unit>
346;;</Units>
347;;</Strength>
348;;<Form>
349;;<Text>@@MEDICATIONFORMTEXT@@</Text>
350;;</Form>
351;;</Product>
352;;<Directions>
353;;<Direction>
354;;<Description>
355;;<Text>@@MEDICATIONDIRECTIONDESCRIPTIONTEXT@@</Text>
356;;</Description>
357;;<Dose>
358;;<Value>@@MEDICATIONDIRECTIONDOSEVALUE@@</Value>
359;;</Dose>
360;;<Route>
361;;<Text>@@MEDICATIONDIRECTIONROUTETEXT@@</Text>
362;;</Route>
363;;<Frequency>
364;;<Value>@@MEDICATIONDIRECTIONFREQUENCYVALUE@@</Value>
365;;</Frequency>
366;;</Direction>
367;;</Directions>
368;;</Medication>
369;;</Medications>
370;;<VitalSigns>
371;;<Result>
372;;<CCRDataObjectID>@@VITALSIGNSDATAOBJECTID@@</CCRDataObjectID>
373;;<DateTime>
374;;<Type>
375;;<Text>@@VITALSIGNSDATETIMETYPETEXT@@</Text>
376;;</Type>
377;;<ExactDateTime>@@VITALSIGNSEXACTDATETIME@@</ExactDateTime>
378;;</DateTime>
379;;<Description>
380;;<Text>@@VITALSIGNSDESCRIPTIONTEXT@@</Text>
381;;</Description>
382;;<Source>
383;;<Actor>
384;;<ActorID>@@VITALSIGNSSOURCEACTORID@@</ActorID>
385;;</Actor>
386;;</Source>
387;;<Test>
388;;<CCRDataObjectID>@@VITALSIGNSTESTOBJECTID@@</CCRDataObjectID>
389;;<Type>
390;;<Text>@@VITALSIGNSTESTTYPETEXT@@</Text>
391;;</Type>
392;;<Description>
393;;<Text>@@VITALSIGNSDESCRIPTIONTEXT@@</Text>
394;;<Code>
395;;<Value>@@VITALSIGNSDESCRIPTIONCODEVALUE@@</Value>
396;;<CodingSystem>@@VITALSIGNSDESCRIPTIONCODINGSYSTEM@@</CodingSystem>
397;;<Version>@@VITALSIGNSCODEVERSION@@</Version>
398;;</Code>
399;;</Description>
400;;<Source>
401;;<Actor>
402;;<ActorID>@@VITALSIGNSTESTSOURCEACTORID@@</ActorID>
403;;</Actor>
404;;</Source>
405;;<TestResult>
406;;<Value>@@VITALSIGNSTESTRESULTVALUE@@</Value>
407;;<Units>
408;;<Unit>@@VITALSIGNSTESTRESULTUNIT@@</Unit>
409;;</Units>
410;;</TestResult>
411;;</Test>
412;;</Result>
413;;</VitalSigns>
414;;<HealthCareProviders>
415;;<Provider>
416;;<ActorID>AA0005</ActorID>
417;;<ActorRole>
418;;<Text>Primary Provider</Text>
419;;</ActorRole>
420;;</Provider>
421;;</HealthCareProviders>
422;;</Body>
423;;<Actors>
424;;<Actor>
425;;<ActorObjectID>@@ACTOROBJECTID@@</ActorObjectID>
426;;<Person>
427;;<Name>
428;;<CurrentName>
429;;<Given>@@ACTORGIVENNAME@@</Given>
430;;<Middle>@@ACTORMIDDLENAME@@</Middle>
431;;<Family>@@ACTORFAMILYNAME@@</Family>
432;;</CurrentName>
433;;</Name>
434;;<DateOfBirth>
435;;<ExactDateTime>@@ACTORDATEOFBIRTH@@</ExactDateTime>
436;;</DateOfBirth>
437;;<Gender>
438;;<Text>@@ACTORGENDER@@</Text>
439;;</Gender>
440;;</Person>
441;;<IDs>
442;;<Type>
443;;<Text>SSN</Text>
444;;</Type>
445;;<ID>@@ACTORSSN@@</ID>
446;;<Source>
447;;<Actor>
448;;<ActorID>@@ACTORSSNSOURCEID@@</ActorID>
449;;</Actor>
450;;</Source>
451;;</IDs>
452;;<Address>
453;;<Type>
454;;<Text>@@ACTORADDRESSTYPE@@</Text>
455;;</Type>
456;;<Line1>@@ACTORADDRESSLINE1@@</Line1>
457;;<Line2>@@ACTORADDRESSLINE2@@</Line2>
458;;<City>@@ACTORADDRESSCITY@@</City>
459;;<State>@@ACTORADDRESSSTATE@@</State>
460;;<PostalCode>@@ACTORADDRESSZIPCODE@@</PostalCode>
461;;</Address>
462;;<Telephone>
463;;<Value>@@ACTORTELEPHONE@@</Value>
464;;<Type>
465;;<Text>@@ACTORTELEPHONETYPE@@</Text>
466;;</Type>
467;;</Telephone>
468;;<EMail>
469;;<Value>@@ACTOREMAIL@@</Value>
470;;</EMail>
471;;<Source>
472;;<Actor>
473;;<ActorID>@@ACTORADDRESSSOURCEID@@</ActorID>
474;;</Actor>
475;;</Source>
476;;</Actor>
477;;<Actor>
478;;<ActorObjectID>@@ACTOROBJECTID@@</ActorObjectID>
479;;<InformationSystem>
480;;<Name>@@ACTORINFOSYSNAME@@</Name>
481;;<Version>@@ACTORINFOSYSVER@@</Version>
482;;</InformationSystem>
483;;<Source>
484;;<Actor>
485;;<ActorID>@@ACTORINFOSYSSOURCEID@@</ActorID>
486;;</Actor>
487;;</Source>
488;;</Actor>
489;;<Actor>
490;;<ActorObjectID>AA0003</ActorObjectID>
491;;<Person>
492;;<Name>
493;;<DisplayName>@@ACTORDISPLAYNAME@@</DisplayName>
494;;</Name>
495;;</Person>
496;;<Relation>
497;;<Text>@@ACTORRELATION@@</Text>
498;;</Relation>
499;;<Source>
500;;<Actor>
501;;<ActorID>@@ACTORRELATIONSOURCEID@@</ActorID>
502;;</Actor>
503;;</Source>
504;;</Actor>
505;;<Actor>
506;;<ActorObjectID>@@ACTOROBJECTID@@</ActorObjectID>
507;;<Person>
508;;<Name>
509;;<CurrentName>
510;;<Given>@@ACTORGIVENNAME@@</Given>
511;;<Family>@@ACTORFAMILYNAME@@</Family>
512;;</CurrentName>
513;;</Name>
514;;</Person>
515;;<Specialty>
516;;<Text>@@ACTORSPECIALITY@@</Text>
517;;</Specialty>
518;;<Address>
519;;<Type>
520;;<Text>@@ACTORADDRESSTYPE@@</Text>
521;;</Type>
522;;<Line1>@@ACTORADDRESSLINE1@@</Line1>
523;;<City>@@ACTORADDRESSLINE2@@</City>
524;;<State>@@ACTORADDRESSSTATE@@</State>
525;;</Address>
526;;<Source>
527;;<Actor>
528;;<ActorID>@@ACTORSOURCEID@@</ActorID>
529;;</Actor>
530;;</Source>
531;;</Actor>
532;;</Actors>
533;;<Signatures>
534;;<CCRSignature>
535;;<SignatureObjectID>S0001</SignatureObjectID>
536;;<ExactDateTime>2008-03-18T23:10:58Z</ExactDateTime>
537;;<Source>
538;;<ActorID>AA0001</ActorID>
539;;</Source>
540;;<Signature>
541;;<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
542;;<SignedInfo>
543;;<CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
544;;<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
545;;<Reference URI="">
546;;<Transforms>
547;;<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
548;;</Transforms>
549;;<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
550;;<DigestValue>YFveLLyo+75P7rSciv0/m1O6Ot4=</DigestValue>
551;;</Reference>
552;;</SignedInfo>
553;;<SignatureValue>Bj6sACXl74hrlbUYnu8HqnRab5VGy69BOYjOH7dETxgppXMEd7AoVYaePZvgJft78JR4oQY76hbFyGcIslYauPpJxx2hCd5d56xFeaQg01R6AQOvGnhjlq63TbpFdUq0B4tYsmiibJPbQJhTQe+TcWTBvWaQt8Fkk5blO571YvI=</SignatureValue>
554;;<KeyInfo>
555;;<KeyValue>
556;;<RSAKeyValue>
557;;<Modulus>meH817QYol+/uUEg6j8Mg89s7GTlaN9B+/CGlzrtnQH+swMigZRnEPxHVO8PhEymP/W9nlhAjTScV/CUzA9yJ9WiaOn17c+KReKhfBqL24DX9BpbJ+kLYVz7mBO5Qydk5AzUT2hFwW93irD8iRKP+/t+2Mi2CjNfj8VTjJpHpm0=</Modulus>
558;;<Exponent>AQAB</Exponent>
559;;</RSAKeyValue>
560;;</KeyValue>
561;;</KeyInfo>
562;;</Signature>
563;;</Signature>
564;;</CCRSignature>
565;;</Signatures>
566;;</ContinuityOfCareRecord>
567;</TEMPLATE>
Note: See TracBrowser for help on using the repository browser.