ACDWRP99 ;IHS/ADC/EDE/KML - REPORT GENERATOR;
;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
;Reports 12,15
I '$D(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL")) D ^ACDWK Q
S (ACDGTOT,ACDGTOT1)=0
D C S ACDP1="" F D F Q:$D(DIRUT) S ACDP1=$O(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1)) Q:ACDP1="" W !,$E(ACDP1,1,24) D P1 Q:$D(DIRUT)
D ^ACDWK
Q
P1 ;
S ACDP2="" F D F Q:$D(DIRUT) S ACDP2=$O(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1,ACDP2)) Q:ACDP2="" W ?26,ACDP2 D P2 Q:$D(DIRUT)
Q
P2 ;
S ACDP3="" F D F Q:$D(DIRUT) S ACDP3=$O(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1,ACDP2,ACDP3)) Q:ACDP3="" W ?45,$E(ACDP3) D P3 Q:$D(DIRUT)
Q
P3 ;
S (ACDSTOT,ACDARR)=0,ACDP4="" F D F Q:$D(DIRUT) S ACDP4=$O(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1,ACDP2,ACDP3,ACDP4)) Q:'ACDP4 D P4 Q:$D(DIRUT)
Q:$D(DIRUT)
W ?57,ACDARR,?70,ACDSTOT,!
Q
;
P4 ;
S ACDSTOT=ACDSTOT+1,ACDARR=ACDARR+^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1,ACDP2,ACDP3,ACDP4)
Q
;
F ;Form feed
I $Y+4>IOSL D F^ACDWUTL D:'$D(DIRUT) C
Q
C ;Column
W !!,ACDC(1),?26,ACDC(2),?45,ACDC(3),?57,ACDC(4),?70,ACDC(5),!,ACDH(1),!
Q
ACDWRP99 ;IHS/ADC/EDE/KML - REPORT GENERATOR;
+1 ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
+2 ;Reports 12,15
+3 IF '$DATA(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL"))
DO ^ACDWK
QUIT
+4 SET (ACDGTOT,ACDGTOT1)=0
+5 DO C
SET ACDP1=""
FOR
DO F
IF $DATA(DIRUT)
QUIT
SET ACDP1=$ORDER(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1))
IF ACDP1=""
QUIT
WRITE !,$EXTRACT(ACDP1,1,24)
DO P1
IF $DATA(DIRUT)
QUIT
+6 DO ^ACDWK
+7 QUIT
P1 ;
+1 SET ACDP2=""
FOR
DO F
IF $DATA(DIRUT)
QUIT
SET ACDP2=$ORDER(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1,ACDP2))
IF ACDP2=""
QUIT
WRITE ?26,ACDP2
DO P2
IF $DATA(DIRUT)
QUIT
+2 QUIT
P2 ;
+1 SET ACDP3=""
FOR
DO F
IF $DATA(DIRUT)
QUIT
SET ACDP3=$ORDER(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1,ACDP2,ACDP3))
IF ACDP3=""
QUIT
WRITE ?45,$EXTRACT(ACDP3)
DO P3
IF $DATA(DIRUT)
QUIT
+2 QUIT
P3 ;
+1 SET (ACDSTOT,ACDARR)=0
SET ACDP4=""
FOR
DO F
IF $DATA(DIRUT)
QUIT
SET ACDP4=$ORDER(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1,ACDP2,ACDP3,ACDP4))
IF 'ACDP4
QUIT
DO P4
IF $DATA(DIRUT)
QUIT
+2 IF $DATA(DIRUT)
QUIT
+3 WRITE ?57,ACDARR,?70,ACDSTOT,!
+4 QUIT
+5 ;
P4 ;
+1 SET ACDSTOT=ACDSTOT+1
SET ACDARR=ACDARR+^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1,ACDP2,ACDP3,ACDP4)
+2 QUIT
+3 ;
F ;Form feed
+1 IF $Y+4>IOSL
DO F^ACDWUTL
IF '$DATA(DIRUT)
DO C
+2 QUIT
C ;Column
+1 WRITE !!,ACDC(1),?26,ACDC(2),?45,ACDC(3),?57,ACDC(4),?70,ACDC(5),!,ACDH(1),!
+2 QUIT