source: WorldVistAEHR/trunk/r/HEALTH_SUMMARY-GMTS/GMTSMAGE.m@ 1800

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

initial load of WorldVistAEHR

File size: 1.2 KB
RevLine 
[613]1GMTSMAGE ;SLC/RMP - Imaging HS Comp Data Extraction ; 08/27/2002
2 ;;2.7;Health Summary;**26,56**;Oct 20, 1995
3 ;
4 ; External References
5 ; DBIA 2791 ^MAG(2005
6 ;
7IMGPTRE(ZY,MAGMESS) ; Return Image Info List for Patient
8 N MAX,Y,MAGDFN,MAGDUZ,CT,PD,T,I,P
9 S MAX=$S(+($G(GMTSNDM))>0:+($G(GMTSNDM)),1:99999)
10 S MAGDFN=$P(MAGMESS,"^",1),MAGDUZ=$P(MAGMESS,"^",2) S:MAGDUZ="" MAGDUZ=0
11 F I=1:1:10 I $E(MAGDFN,1)=" " S MAGDFN=$E(MAGDFN,2,99)
12 S MAGDFN=+MAGDFN I '$D(^MAG(2005,"APDTPX",MAGDFN)) S ZY(0)="1^0" Q
13 S CT=0,T=0,I=0,P="",PD=""
14 F S PD=$O(^MAG(2005,"APDTPX",MAGDFN,PD)) Q:PD="" Q:'$$GT(PD) D
15 . S P="" F S P=$O(^MAG(2005,"APDTPX",MAGDFN,PD,P)) Q:P="" D
16 . . S I="" F S I=$O(^MAG(2005,"APDTPX",MAGDFN,PD,P,I)) Q:+I<1 D
17 . . . Q:$P($G(^MAG(2005,I,0)),"^",10) ; Child of Group
18 . . . S T=T+1 Q:T>250 Q:(MAX>1)&(MAX<(CT+1)) S CT=CT+1
19 . . . D ARRY(.ZY,CT,I)
20 S ZY(0)="1^"_CT S:T>CT ZY(0)=ZY(0)_" of "_T K T,I
21 Q
22GT(ADT) ; Date Range Check
23 Q:ADT>GMTS2 0
24 Q $S(ADT>GMTS1:1,1:0)
25ARRY(ZY,CT,I) ; Build Array
26 S ZY(CT)=$P(^MAG(2005,I,2),"^",5)
27 S $P(ZY(CT),"^",2)=$P(^MAG(2005,I,0),"^",8)
28 S $P(ZY(CT),"^",3)=$P(^MAG(2005,I,2),"^",4)
29 Q
Note: See TracBrowser for help on using the repository browser.