ACDWRP22 ;IHS/ADC/EDE/KML - OUTPUT GENERATOR;
;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
;Report 308
I '$D(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL")) D ^ACDWK Q
S (ACDNCNT,ACDVCNT)=0
P1 ;
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,40) S ACDN0=^(ACDP1) D P2 Q:$D(DIRUT)
W:'$D(DIRUT) !?49,"=====",?60,"=====",!?49,ACDNCNT,?60,ACDVCNT
D ^ACDWK
Q
P2 ;
S ACDVIS=$P(ACDN0,U),ACDNUMR=$P(ACDN0,U,2)
W ?49,ACDNUMR,?60,ACDVIS,?72,$J(ACDNUMR/ACDVIS,7,2),!
S ACDNCNT=ACDNCNT+ACDNUMR,ACDVCNT=ACDVCNT+ACDVIS
Q
F ;Form feed
I $Y+4>IOSL D F^ACDWUTL D:'$D(DIRUT) C
Q
C ;Column
W !,ACDC(1),?49,ACDC(2),?60,ACDC(3),?71,ACDC(4),!,ACDH(1),!
Q
ACDWRP22 ;IHS/ADC/EDE/KML - OUTPUT GENERATOR;
+1 ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
+2 ;Report 308
+3 IF '$DATA(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL"))
DO ^ACDWK
QUIT
+4 SET (ACDNCNT,ACDVCNT)=0
P1 ;
+1 DO C
+2 SET ACDP1=""
+3 FOR
DO F
IF $DATA(DIRUT)
QUIT
SET ACDP1=$ORDER(^TMP("ACD",ACDJOB,ACDBT,ACDTGSUB,"VAL",ACDP1))
IF ACDP1=""
QUIT
WRITE !,$EXTRACT(ACDP1,1,40)
SET ACDN0=^(ACDP1)
DO P2
IF $DATA(DIRUT)
QUIT
+4 IF '$DATA(DIRUT)
WRITE !?49,"=====",?60,"=====",!?49,ACDNCNT,?60,ACDVCNT
+5 DO ^ACDWK
+6 QUIT
P2 ;
+1 SET ACDVIS=$PIECE(ACDN0,U)
SET ACDNUMR=$PIECE(ACDN0,U,2)
+2 WRITE ?49,ACDNUMR,?60,ACDVIS,?72,$JUSTIFY(ACDNUMR/ACDVIS,7,2),!
+3 SET ACDNCNT=ACDNCNT+ACDNUMR
SET ACDVCNT=ACDVCNT+ACDVIS
+4 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),?49,ACDC(2),?60,ACDC(3),?71,ACDC(4),!,ACDH(1),!
+2 QUIT