LRAPALRT ;VA/DALOI/CKA - SEND AN AP ALERT AFTER THE REPORT HAS BEEN RELEASED;2/26/08
;;5.2;LAB SERVICE;**1030,1031**;NOV 1, 1997;Build 188
;
;;VA LR Patche(s): 365,315
;
EP ; EP
;
N LRMSG,LREND,LRQUIT,LRIENS,LRSF,LRZ
S LRQUIT=0
D SECTION^LRAPRES
I LRQUIT D END Q
D ACCYR^LRAPRES
I LRQUIT D END Q
D LOOKUP^LRAPUTL(.LRDATA,LRH(0),LRO(68),LRSS,LRAD,LRAA)
I LRDATA<1 S LRQUIT=1
I LRQUIT D END Q
I 'LRAU D
.S LRDFN=LRDATA,LRI=LRDATA(1)
.S LRA=^LR(LRDFN,LRSS,LRI,0)
.S LRIENS=LRI_","_LRDFN_","
.S LRZ(2)=$$GET1^DIQ(LRSF,LRIENS,.11,"I")
.S LRAC=$$GET1^DIQ(LRSF,LRIENS,.06,"I")
.D:'LRZ(2)
..W $C(7)
..S LRMSG="Report has not been released. An alert cannot be sent."
..D EN^DDIOL(LRMSG,"","!!") K LRMSG
..S LRQUIT=1 Q
I LRQUIT D END Q
I LRAU D
.S LRDFN=LRDATA
.I $G(^LR(LRDFN,"AU"))="" D Q
..S LRMSG="No information found for this accession in the "
..S LRMSG=LRMSG_"LAB DATA file (#63)."
..D EN^DDIOL(LRMSG,"","!!") K LRMSG
..S LRQUIT=1 Q
.S LRZ=$$GET1^DIQ(63,LRDFN_",",14.7,"I")
.D:'LRZ
..W $C(7)
..S LRMSG="Report has not been released. An alert cannot be sent."
..D EN^DDIOL(LRMSG,"","!!") K LRMSG
..S LRQUIT=1 Q
.S LRA=^LR(LRDFN,"AU")
.S LRI=$P(LRA,U)
.S LRAC=$$GET1^DIQ(63,LRDFN_",",14,"I")
I LRQUIT D END Q
D MAIN^LRAPRES1(LRDFN,LRSS,LRI,LRSF,LRP,LRAC)
;
END D END^LRAPRES2
Q
LRAPALRT ;VA/DALOI/CKA - SEND AN AP ALERT AFTER THE REPORT HAS BEEN RELEASED;2/26/08
+1 ;;5.2;LAB SERVICE;**1030,1031**;NOV 1, 1997;Build 188
+2 ;
+3 ;;VA LR Patche(s): 365,315
+4 ;
EP ; EP
+1 ;
+2 NEW LRMSG,LREND,LRQUIT,LRIENS,LRSF,LRZ
+3 SET LRQUIT=0
+4 DO SECTION^LRAPRES
+5 IF LRQUIT
DO END
QUIT
+6 DO ACCYR^LRAPRES
+7 IF LRQUIT
DO END
QUIT
+8 DO LOOKUP^LRAPUTL(.LRDATA,LRH(0),LRO(68),LRSS,LRAD,LRAA)
+9 IF LRDATA<1
SET LRQUIT=1
+10 IF LRQUIT
DO END
QUIT
+11 IF 'LRAU
Begin DoDot:1
+12 SET LRDFN=LRDATA
SET LRI=LRDATA(1)
+13 SET LRA=^LR(LRDFN,LRSS,LRI,0)
+14 SET LRIENS=LRI_","_LRDFN_","
+15 SET LRZ(2)=$$GET1^DIQ(LRSF,LRIENS,.11,"I")
+16 SET LRAC=$$GET1^DIQ(LRSF,LRIENS,.06,"I")
+17 IF 'LRZ(2)
Begin DoDot:2
+18 WRITE $CHAR(7)
+19 SET LRMSG="Report has not been released. An alert cannot be sent."
+20 DO EN^DDIOL(LRMSG,"","!!")
KILL LRMSG
+21 SET LRQUIT=1
QUIT
End DoDot:2
End DoDot:1
+22 IF LRQUIT
DO END
QUIT
+23 IF LRAU
Begin DoDot:1
+24 SET LRDFN=LRDATA
+25 IF $GET(^LR(LRDFN,"AU"))=""
Begin DoDot:2
+26 SET LRMSG="No information found for this accession in the "
+27 SET LRMSG=LRMSG_"LAB DATA file (#63)."
+28 DO EN^DDIOL(LRMSG,"","!!")
KILL LRMSG
+29 SET LRQUIT=1
QUIT
End DoDot:2
QUIT
+30 SET LRZ=$$GET1^DIQ(63,LRDFN_",",14.7,"I")
+31 IF 'LRZ
Begin DoDot:2
+32 WRITE $CHAR(7)
+33 SET LRMSG="Report has not been released. An alert cannot be sent."
+34 DO EN^DDIOL(LRMSG,"","!!")
KILL LRMSG
+35 SET LRQUIT=1
QUIT
End DoDot:2
+36 SET LRA=^LR(LRDFN,"AU")
+37 SET LRI=$PIECE(LRA,U)
+38 SET LRAC=$$GET1^DIQ(63,LRDFN_",",14,"I")
End DoDot:1
+39 IF LRQUIT
DO END
QUIT
+40 DO MAIN^LRAPRES1(LRDFN,LRSS,LRI,LRSF,LRP,LRAC)
+41 ;
END DO END^LRAPRES2
+1 QUIT