ACDWRP13 ;IHS/ADC/EDE/KML - OUTPUT GENERATOR;
;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
;Reports 13,60
I '$D(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL")) D ^ACDWK Q
D C
S ACDP1=""
F D F Q:$D(DIRUT) S (ACDCLI,ACDNUM)=0,ACDP1=$O(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1)) Q:ACDP1="" D
. W !,ACDP1
. F ACDP2=0:0 S ACDP2=$O(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1,ACDP2)) W:'ACDP2 ?65,$J(ACDNUM/ACDCLI,8,2) Q:ACDP2'>0 D SUM
. Q
D ^ACDWK
Q
F ;Form feed
I $Y+4>IOSL D F^ACDWUTL D:'$D(DIRUT) C
Q
C ;Column
W !!,ACDC(1),?53,ACDC(2),!,ACDH(1)
Q
SUM ;
I ACDTG="G60"!(ACDTG="G13") S ACDNUM=ACDNUM+ACDP2,ACDCLI=ACDCLI+^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1,ACDP2) Q
ACDWRP13 ;IHS/ADC/EDE/KML - OUTPUT GENERATOR;
+1 ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
+2 ;Reports 13,60
+3 IF '$DATA(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL"))
DO ^ACDWK
QUIT
+4 DO C
+5 SET ACDP1=""
+6 FOR
DO F
IF $DATA(DIRUT)
QUIT
SET (ACDCLI,ACDNUM)=0
SET ACDP1=$ORDER(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1))
IF ACDP1=""
QUIT
Begin DoDot:1
+7 WRITE !,ACDP1
+8 FOR ACDP2=0:0
SET ACDP2=$ORDER(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1,ACDP2))
IF 'ACDP2
WRITE ?65,$JUSTIFY(ACDNUM/ACDCLI,8,2)
IF ACDP2'>0
QUIT
DO SUM
+9 QUIT
End DoDot:1
+10 DO ^ACDWK
+11 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),?53,ACDC(2),!,ACDH(1)
+2 QUIT
SUM ;
+1 IF ACDTG="G60"!(ACDTG="G13")
SET ACDNUM=ACDNUM+ACDP2
SET ACDCLI=ACDCLI+^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1,ACDP2)
QUIT