EASMTRP2 ; ALB/SCK - MEANS TEST REPORTS 2 ; 2/19/02
;;1.0;ENROLLMENT APPLICATION SYSTEM;**3,15,22**;MAR 15,2001
;
QUE ; Que pending letter count (letters flagged to print)
N ZTSAVE,DIR,EASUM,Y
;
S DIR(0)="YAO",DIR("A")="Print Summary Only? ",DIR("B")="YES"
S DIR("?")="'YES' will print a summary total only, 'NO' will print the summary and a detail listing by scheduled print date"
D ^DIR K DIR
Q:$D(DIRUT)
S EASUM=+Y
S ZTSAVE("EASUM")=""
D EN^XUTMDEVQ("PEND^EASMTRP2","EAS LETTERS DETAILED PENDING REPORT",.ZTSAVE)
Q
PEND ; Print report
N CNT,EASIEN,PCNT,RCNT,EASX,TOT,PAGE,EAS0,EAS4,EAS6,EASPDT,EAX,TOTALS,DUOUT
;
K ^TMP("EASPND",$J)
F EAX=0,30,60 S TOTALS(EAX)=0
S EASIEN=0
F S EASIEN=$O(^EAS(713.2,"AC",0,EASIEN)) Q:'EASIEN D
. I $P($G(^EAS(713.2,EASIEN,"Z")),U,2) D Q
. . S EAS0=$P($G(^EAS(713.2,EASIEN,"Z")),U,1)
. . S ^TMP("EASPND",$J,EAS0,0)=$G(^TMP("EASPND",$J,EAS0,0))+1
. . S TOTALS(0)=TOTALS(0)+1
. ;
. I $P($G(^EAS(713.2,EASIEN,4)),U,2) D Q
. . S EAS4=$P($G(^EAS(713.2,EASIEN,4)),U,1)
. . S ^TMP("EASPND",$J,EAS4,4)=$G(^TMP("EASPND",$J,EAS4,4))+1
. . S TOTALS(30)=TOTALS(30)+1
. ;
. I $P($G(^EAS(713.2,EASIEN,6)),U,2) D
. . S EAS6=$P($G(^EAS(713.2,EASIEN,6)),U,1)
. . S ^TMP("EASPND",$J,EAS6,6)=$G(^TMP("EASPND",$J,EAS6,6))+1
. . S TOTALS(60)=TOTALS(60)+1
;
D HDR1
I 'EASUM,$E(IOST,1,2)="C-" D Q:$D(DUOUT)
. S DIR(0)="FAO",DIR("A")="Press any key to continue..."
. D ^DIR K DIR
. Q:$D(DUOUT)
;
D:'EASUM DETAIL
Q
;
DETAIL ; Print details section
N EASPDT,DIRUT
;
D HDR
S EASPDT=0
F S EASPDT=$O(^TMP("EASPND",$J,EASPDT)) Q:'EASPDT D Q:$D(DIRUT)
. I ($Y+4)>IOSL D Q:$D(DIRUT)
. . I $E(IOST,1,2)="C-" D Q:$D(DIRUT)
. . . S DIR(0)="E"
. . . D ^DIR K DIR
. . D HDR
. W !?4,$$FMTE^XLFDT(EASPDT),?20
. S TOT=0
. F EAX=6,4,0 D
. . S CNT=$G(^TMP("EASPND",$J,EASPDT,EAX))
. . W $J(+CNT,6)," "
. . S TOT=$G(TOT)+(+CNT)
. W $J(TOT,8)
;
K ^TMP("EASPND",$J)
Q
;
HDR1 ;
N TAB,LINE,DASH
;
W @IOF
S LINE(1)="Count of Letters Pending to Print (Flag to Print marked 'YES')"
S LINE(2)="Printed: "_$$FMTE^XLFDT($$NOW^XLFDT)
S LINE(60)="60-Day letters flagged to print: "_$FN(TOTALS(60),",")
S LINE(30)="30-Day letters flagged to print: "_$FN(TOTALS(30),",")
S LINE(0)=" 0-Day letters flagged to print: "_$FN(TOTALS(0),",")
;
S TAB=(IOM-$L(LINE(1)))/2
W !?TAB,LINE(1)
W !?TAB,LINE(2)
S $P(DASH,"=",IOM)=""
W !,DASH
;
F EAX=60,30,0 D
. S TAB=(IOM-$L(LINE(EAX)))/2
. W !?TAB,LINE(EAX)
Q
;
HDR ;
N TAB,LINE
;
W @IOF
W !,"Detailed List of Letters Flagged to Print"
W !,"Printed: "_$$FMTE^XLFDT($$NOW^XLFDT)
S PAGE=$G(PAGE)+1
S TAB=IOM-8
W ?TAB,"PAGE: ",PAGE
W !!?4,"Sched. Date",?20,"60-Day"," ","30-Day"," "," 0-day"," "," TOTAL"
S $P(LINE,"=",IOM)="" W !,LINE
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HEASMTRP2 2877 printed Dec 13, 2024@01:55:31 Page 2
EASMTRP2 ; ALB/SCK - MEANS TEST REPORTS 2 ; 2/19/02
+1 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**3,15,22**;MAR 15,2001
+2 ;
QUE ; Que pending letter count (letters flagged to print)
+1 NEW ZTSAVE,DIR,EASUM,Y
+2 ;
+3 SET DIR(0)="YAO"
SET DIR("A")="Print Summary Only? "
SET DIR("B")="YES"
+4 SET DIR("?")="'YES' will print a summary total only, 'NO' will print the summary and a detail listing by scheduled print date"
+5 DO ^DIR
KILL DIR
+6 if $DATA(DIRUT)
QUIT
+7 SET EASUM=+Y
+8 SET ZTSAVE("EASUM")=""
+9 DO EN^XUTMDEVQ("PEND^EASMTRP2","EAS LETTERS DETAILED PENDING REPORT",.ZTSAVE)
+10 QUIT
PEND ; Print report
+1 NEW CNT,EASIEN,PCNT,RCNT,EASX,TOT,PAGE,EAS0,EAS4,EAS6,EASPDT,EAX,TOTALS,DUOUT
+2 ;
+3 KILL ^TMP("EASPND",$JOB)
+4 FOR EAX=0,30,60
SET TOTALS(EAX)=0
+5 SET EASIEN=0
+6 FOR
SET EASIEN=$ORDER(^EAS(713.2,"AC",0,EASIEN))
if 'EASIEN
QUIT
Begin DoDot:1
+7 IF $PIECE($GET(^EAS(713.2,EASIEN,"Z")),U,2)
Begin DoDot:2
+8 SET EAS0=$PIECE($GET(^EAS(713.2,EASIEN,"Z")),U,1)
+9 SET ^TMP("EASPND",$JOB,EAS0,0)=$GET(^TMP("EASPND",$JOB,EAS0,0))+1
+10 SET TOTALS(0)=TOTALS(0)+1
End DoDot:2
QUIT
+11 ;
+12 IF $PIECE($GET(^EAS(713.2,EASIEN,4)),U,2)
Begin DoDot:2
+13 SET EAS4=$PIECE($GET(^EAS(713.2,EASIEN,4)),U,1)
+14 SET ^TMP("EASPND",$JOB,EAS4,4)=$GET(^TMP("EASPND",$JOB,EAS4,4))+1
+15 SET TOTALS(30)=TOTALS(30)+1
End DoDot:2
QUIT
+16 ;
+17 IF $PIECE($GET(^EAS(713.2,EASIEN,6)),U,2)
Begin DoDot:2
+18 SET EAS6=$PIECE($GET(^EAS(713.2,EASIEN,6)),U,1)
+19 SET ^TMP("EASPND",$JOB,EAS6,6)=$GET(^TMP("EASPND",$JOB,EAS6,6))+1
+20 SET TOTALS(60)=TOTALS(60)+1
End DoDot:2
End DoDot:1
+21 ;
+22 DO HDR1
+23 IF 'EASUM
IF $EXTRACT(IOST,1,2)="C-"
Begin DoDot:1
+24 SET DIR(0)="FAO"
SET DIR("A")="Press any key to continue..."
+25 DO ^DIR
KILL DIR
+26 if $DATA(DUOUT)
QUIT
End DoDot:1
if $DATA(DUOUT)
QUIT
+27 ;
+28 if 'EASUM
DO DETAIL
+29 QUIT
+30 ;
DETAIL ; Print details section
+1 NEW EASPDT,DIRUT
+2 ;
+3 DO HDR
+4 SET EASPDT=0
+5 FOR
SET EASPDT=$ORDER(^TMP("EASPND",$JOB,EASPDT))
if 'EASPDT
QUIT
Begin DoDot:1
+6 IF ($Y+4)>IOSL
Begin DoDot:2
+7 IF $EXTRACT(IOST,1,2)="C-"
Begin DoDot:3
+8 SET DIR(0)="E"
+9 DO ^DIR
KILL DIR
End DoDot:3
if $DATA(DIRUT)
QUIT
+10 DO HDR
End DoDot:2
if $DATA(DIRUT)
QUIT
+11 WRITE !?4,$$FMTE^XLFDT(EASPDT),?20
+12 SET TOT=0
+13 FOR EAX=6,4,0
Begin DoDot:2
+14 SET CNT=$GET(^TMP("EASPND",$JOB,EASPDT,EAX))
+15 WRITE $JUSTIFY(+CNT,6)," "
+16 SET TOT=$GET(TOT)+(+CNT)
End DoDot:2
+17 WRITE $JUSTIFY(TOT,8)
End DoDot:1
if $DATA(DIRUT)
QUIT
+18 ;
+19 KILL ^TMP("EASPND",$JOB)
+20 QUIT
+21 ;
HDR1 ;
+1 NEW TAB,LINE,DASH
+2 ;
+3 WRITE @IOF
+4 SET LINE(1)="Count of Letters Pending to Print (Flag to Print marked 'YES')"
+5 SET LINE(2)="Printed: "_$$FMTE^XLFDT($$NOW^XLFDT)
+6 SET LINE(60)="60-Day letters flagged to print: "_$FNUMBER(TOTALS(60),",")
+7 SET LINE(30)="30-Day letters flagged to print: "_$FNUMBER(TOTALS(30),",")
+8 SET LINE(0)=" 0-Day letters flagged to print: "_$FNUMBER(TOTALS(0),",")
+9 ;
+10 SET TAB=(IOM-$LENGTH(LINE(1)))/2
+11 WRITE !?TAB,LINE(1)
+12 WRITE !?TAB,LINE(2)
+13 SET $PIECE(DASH,"=",IOM)=""
+14 WRITE !,DASH
+15 ;
+16 FOR EAX=60,30,0
Begin DoDot:1
+17 SET TAB=(IOM-$LENGTH(LINE(EAX)))/2
+18 WRITE !?TAB,LINE(EAX)
End DoDot:1
+19 QUIT
+20 ;
HDR ;
+1 NEW TAB,LINE
+2 ;
+3 WRITE @IOF
+4 WRITE !,"Detailed List of Letters Flagged to Print"
+5 WRITE !,"Printed: "_$$FMTE^XLFDT($$NOW^XLFDT)
+6 SET PAGE=$GET(PAGE)+1
+7 SET TAB=IOM-8
+8 WRITE ?TAB,"PAGE: ",PAGE
+9 WRITE !!?4,"Sched. Date",?20,"60-Day"," ","30-Day"," "," 0-day"," "," TOTAL"
+10 SET $PIECE(LINE,"=",IOM)=""
WRITE !,LINE
+11 QUIT