ACDWRP21 ;IHS/ADC/EDE/KML - REPORT GENERATOR;
;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
;Report 305,306,307
I '$D(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL")) D ^ACDWK Q
S ACDVIS=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)
;PUT TOTALS HERE
W !?74,"=====",!?74,ACDVIS
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 ?40,$E(ACDP2,1,23),?74,^(ACDP2),! S ACDVIS=ACDVIS+^(ACDP2)
Q
F ;Form feed
I $Y+4>IOSL D F^ACDWUTL D:'$D(DIRUT) C
Q
C ;Column
W !!,ACDC(1),?40,ACDC(2),?71,ACDC(3),!,ACDH(1),!
Q
ACDWRP21 ;IHS/ADC/EDE/KML - REPORT GENERATOR;
+1 ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
+2 ;Report 305,306,307
+3 IF '$DATA(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL"))
DO ^ACDWK
QUIT
+4 SET ACDVIS=0
+5 DO C
+6 SET ACDP1=""
+7 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
+8 ;PUT TOTALS HERE
+9 WRITE !?74,"=====",!?74,ACDVIS
+10 DO ^ACDWK
+11 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 ?40,$EXTRACT(ACDP2,1,23),?74,^(ACDP2),!
SET ACDVIS=ACDVIS+^(ACDP2)
+2 QUIT
F ;Form feed
+1 IF $Y+4>IOSL
DO F^ACDWUTL
IF '$DATA(DIRUT)
DO C
+2 QUIT
C ;Column
+1 WRITE !!,ACDC(1),?40,ACDC(2),?71,ACDC(3),!,ACDH(1),!
+2 QUIT