ACDRLS ;IHS/ADC/EDE/KML - SHOW SCREENS;
;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
;
SHOWP ;EP
I '$D(ACDDONE) W:$D(IOF) @IOF
W !!?6,"PRINT Items Selected:"
I ACDCTYP="S" W !?12,"Report includes sub-totals and total only." Q
I ACDCTYP="T" W !?12,"Report will includes total only." Q
Q:'$D(^ACDRPTD(ACDRPT,12))
S (ACDI,ACDTCW)=0 F S ACDI=$O(^ACDRPTD(ACDRPT,12,ACDI)) Q:ACDI'=+ACDI S ACDCRIT=$P(^ACDRPTD(ACDRPT,12,ACDI,0),U) D
.W !?12,$P(^ACDTITEM(ACDCRIT,0),U)," - column width ",$P(^ACDRPTD(ACDRPT,12,ACDI,0),U,2) S ACDTCW=ACDTCW+$P(^(0),U,2)+2
.I $Y>(IOSL-5) D PAUSE^ACDRL01 W:$D(IOF) @IOF
W !!?12,"Total Report width (including column margins - 2 spaces): ",ACDTCW
Q
SHOW ;EP
W:$D(IOF) @IOF
I $D(ACDDONE) S ACDLHDR="REPORT SUMMARY" W ?((80-$L(ACDLHDR))/2),ACDLHDR,!
W !!?6,$S(ACDPTVS="V":"VISIT",1:"PATIENT")_" Selection Criteria"
W:ACDPTVS="V" !?12,"Visit Date range: ",ACDBDD," to ",ACDEDD
I $D(ACDRDTR),$D(ACDBDD) W !,"Visit Date range: ",ACDBDD," to ",ACDEDD,"."
Q:'$D(^ACDRPTD(ACDRPT,11))
S ACDI=0 F S ACDI=$O(^ACDRPTD(ACDRPT,11,ACDI)) Q:ACDI'=+ACDI D
.I $Y>(IOSL-5) D PAUSE^ACDRL01 W @IOF
.W !?12,$P(^ACDTITEM(ACDI,0),U),": "
.K ACDQ
.S ACDY=0,ACDC=0 F S ACDY=$O(^ACDRPTD(ACDRPT,11,ACDI,11,"B",ACDY)) S ACDC=ACDC+1 Q:ACDY=""!($D(ACDQ)) W:ACDC'=1 " ; " S X=ACDY X:$D(^ACDTITEM(ACDI,2)) ^(2) W X
K ACDC,ACDQ
Q
SHOWR ;EP
I '$D(ACDDONE) W:$D(IOF) @IOF
W !!?6,$S(ACDPTVS="V":"Visit",1:"Patient")_" SORTING Criteria"
W:ACDPTVS="V"&('$D(ACDDONE)) !?12,"Visit Date range: ",ACDBDD," to ",ACDEDD
Q:'$G(ACDSORT)
W !?12,$S(ACDPTVS="V":"Visits",1:"Patients")_" will be sorted by: ",$P(^ACDTITEM(ACDSORT,0),U),!
Q
ACDRLS ;IHS/ADC/EDE/KML - SHOW SCREENS;
+1 ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
+2 ;
SHOWP ;EP
+1 IF '$DATA(ACDDONE)
IF $DATA(IOF)
WRITE @IOF
+2 WRITE !!?6,"PRINT Items Selected:"
+3 IF ACDCTYP="S"
WRITE !?12,"Report includes sub-totals and total only."
QUIT
+4 IF ACDCTYP="T"
WRITE !?12,"Report will includes total only."
QUIT
+5 IF '$DATA(^ACDRPTD(ACDRPT,12))
QUIT
+6 SET (ACDI,ACDTCW)=0
FOR
SET ACDI=$ORDER(^ACDRPTD(ACDRPT,12,ACDI))
IF ACDI'=+ACDI
QUIT
SET ACDCRIT=$PIECE(^ACDRPTD(ACDRPT,12,ACDI,0),U)
Begin DoDot:1
+7 WRITE !?12,$PIECE(^ACDTITEM(ACDCRIT,0),U)," - column width ",$PIECE(^ACDRPTD(ACDRPT,12,ACDI,0),U,2)
SET ACDTCW=ACDTCW+$PIECE(^(0),U,2)+2
+8 IF $Y>(IOSL-5)
DO PAUSE^ACDRL01
IF $DATA(IOF)
WRITE @IOF
End DoDot:1
+9 WRITE !!?12,"Total Report width (including column margins - 2 spaces): ",ACDTCW
+10 QUIT
SHOW ;EP
+1 IF $DATA(IOF)
WRITE @IOF
+2 IF $DATA(ACDDONE)
SET ACDLHDR="REPORT SUMMARY"
WRITE ?((80-$LENGTH(ACDLHDR))/2),ACDLHDR,!
+3 WRITE !!?6,$SELECT(ACDPTVS="V":"VISIT",1:"PATIENT")_" Selection Criteria"
+4 IF ACDPTVS="V"
WRITE !?12,"Visit Date range: ",ACDBDD," to ",ACDEDD
+5 IF $DATA(ACDRDTR)
IF $DATA(ACDBDD)
WRITE !,"Visit Date range: ",ACDBDD," to ",ACDEDD,"."
+6 IF '$DATA(^ACDRPTD(ACDRPT,11))
QUIT
+7 SET ACDI=0
FOR
SET ACDI=$ORDER(^ACDRPTD(ACDRPT,11,ACDI))
IF ACDI'=+ACDI
QUIT
Begin DoDot:1
+8 IF $Y>(IOSL-5)
DO PAUSE^ACDRL01
WRITE @IOF
+9 WRITE !?12,$PIECE(^ACDTITEM(ACDI,0),U),": "
+10 KILL ACDQ
+11 SET ACDY=0
SET ACDC=0
FOR
SET ACDY=$ORDER(^ACDRPTD(ACDRPT,11,ACDI,11,"B",ACDY))
SET ACDC=ACDC+1
IF ACDY=""!($DATA(ACDQ))
QUIT
IF ACDC'=1
WRITE " ; "
SET X=ACDY
IF $DATA(^ACDTITEM(ACDI,2))
XECUTE ^(2)
WRITE X
End DoDot:1
+12 KILL ACDC,ACDQ
+13 QUIT
SHOWR ;EP
+1 IF '$DATA(ACDDONE)
IF $DATA(IOF)
WRITE @IOF
+2 WRITE !!?6,$SELECT(ACDPTVS="V":"Visit",1:"Patient")_" SORTING Criteria"
+3 IF ACDPTVS="V"&('$DATA(ACDDONE))
WRITE !?12,"Visit Date range: ",ACDBDD," to ",ACDEDD
+4 IF '$GET(ACDSORT)
QUIT
+5 WRITE !?12,$SELECT(ACDPTVS="V":"Visits",1:"Patients")_" will be sorted by: ",$PIECE(^ACDTITEM(ACDSORT,0),U),!
+6 QUIT