source: WorldVistAEHR/trunk/r/AUTOMATED_INFO_COLLECTION_SYS-IBD/IBDFN11.m@ 724

Last change on this file since 724 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 1.6 KB
Line 
1IBDFN11 ;ALB/CMR - ENCOUNTER FORM - (entry points for reprint of dynamic data) ;5/21/93
2 ;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
3 ;
4REPRINT(IBPFID,LIST,ARY) ; -- returns dynamic lists previously printed on a form
5 ; -- input IBPFID = ien of forms tracking file
6 ; LIST = ien of selection list file
7 ; ARY = name of array to return list in
8 ;
9 ; -- output The format of the returned array is as follows:
10 ; @ARY(0) = count of array element (0 if nothing found)
11 ; @ARY(1) = provider ien^provider
12 ; or @ARY(1) = problem ien^problem text^ICD code
13 ; or @ARY(1) = classification question
14 ;
15 Q:'IBPFID!('LIST)
16 N FID,ITEM,IBDIEN,NODE,COUNT
17 ; -- initialize counter
18 S COUNT=0
19 ; -- clean out storage area
20 K @ARY
21 ; -- get field ids associated with this list
22 S FID="S"_LIST
23 S XREF=$S($O(^IBD(357.96,IBPFID,"AD",FID))[LIST:"AD",$O(^IBD(357.96,IBPFID,"AC",FID))[LIST:"AC",1:"") Q:XREF']""
24 S FID=$O(^IBD(357.96,IBPFID,XREF,FID)) Q:FID'[LIST D
25 .; -- get all items for the field id
26 .S ITEM=0 F S ITEM=$O(^IBD(357.96,IBPFID,XREF,FID,ITEM)) Q:'ITEM D
27 ..; -- get ien for dynamic data entry
28 ..S IBDIEN=0 F S IBDIEN=$O(^IBD(357.96,IBPFID,XREF,FID,ITEM,IBDIEN)) Q:'IBDIEN S NODE=$S(XREF="AD":$G(^IBD(357.96,IBPFID,2,IBDIEN,0)),1:$G(^IBD(357.96,IBPFID,1,IBDIEN,0))) I NODE]"" D
29 ...; -- set output array with dynamic data previously printed
30 ...S COUNT=COUNT+1
31 ...S @ARY@(COUNT)=$P(NODE,"^",4)_"^"_$P(NODE,"^",8)_"^"_$S(ARY["GMP SELECT PATIENT ACTIVE PROBLEMS":$P($G(^ICD9(+$G(^AUPNPROB(+$P(NODE,"^",4),0)),0)),"^"),1:"")
32 S @ARY@(0)=COUNT
33 Q
Note: See TracBrowser for help on using the repository browser.