BCHFCP ; IHS/CMI/LAB - PRINT FORMS COUNT REPORT ;
;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
;IHS/CMI/LAB - tmp to xtmp
START ;
S BCH80S="-------------------------------------------------------------------------------",BCHPG=0
S Y=BCHBD D DD^%DT S BCHBDD=Y S Y=BCHED D DD^%DT S BCHEDD=Y
S (BCHTOT,BCHPROV,BCHTDES)=0
K BCHQUIT
I '$D(^XTMP("BCHFC",BCHJOB,BCHH)) S BCHPROV="NONE TO REPORT" D HEAD G DONE
F S BCHPROV=$O(^XTMP("BCHFC",BCHJOB,BCHH,BCHPROV)) Q:BCHPROV=""!($D(BCHQUIT)) D HEAD Q:$D(BCHQUIT) D SORT
G:$D(BCHQUIT) DONE
I $Y>(IOSL-5) D HEAD G:$D(BCHQUIT) DONE
W !?42,"------",!
W ?5,"Grand Total for ALL Operators:",?42,$J(BCHTOT,6)
D SUMMPAGE
DONE I $D(BCHET) S BCHTS=(86400*($P(BCHET,",")-$P(BCHBT,",")))+($P(BCHET,",",2)-$P(BCHBT,",",2)),BCHH=$P(BCHTS/3600,".") S:BCHH="" BCHH=0
S BCHTS=BCHTS-(BCHH*3600),BCHM=$P(BCHTS/60,".") S:BCHM="" BCHM=0 S BCHTS=BCHTS-(BCHM*60),BCHS=BCHTS W !!,"RUN TIME (H.M.S): ",BCHH,".",BCHM,".",BCHS
I $E(IOST)="C",IO=IO(0) S DIR(0)="E" D ^DIR K DIR
W:$D(IOF) @IOF
K ^XTMP("BCHFC",BCHJOB,BCHH),BCHJOB,BCHH
Q
SORT ;
S (BCHSUB,BCHDESU)=0,BCHFC("DAYS",BCHPROV)=0
S BCHDATE=0 F S BCHDATE=$O(^XTMP("BCHFC",BCHJOB,BCHH,BCHPROV,BCHDATE)) Q:BCHDATE'=+BCHDATE!($D(BCHQUIT)) D WRITE
W !?42,"------",!
W ?5,"Totals for ",BCHPROV,?42,$J(BCHSUB,6)
S BCHFC("FORMS",BCHPROV)=BCHSUB
Q
WRITE ;
S Y=BCHDATE D DD^%DT S BCHWDAT=Y
I $Y>(IOSL-5) D HEAD Q:$D(BCHQUIT)
W ?25,BCHWDAT,?42,$J(^XTMP("BCHFC",BCHJOB,BCHH,BCHPROV,BCHDATE),6),!
S BCHSUB=BCHSUB+^XTMP("BCHFC",BCHJOB,BCHH,BCHPROV,BCHDATE),BCHTOT=BCHTOT+^XTMP("BCHFC",BCHJOB,BCHH,BCHPROV,BCHDATE)
S BCHFC("DAYS",BCHPROV)=BCHFC("DAYS",BCHPROV)+1
Q
SUMMPAGE ;
I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S BCHQUIT="" Q
W:$D(IOF) @IOF S BCHPG=BCHPG+1
W !?58,$$FMTE^XLFDT(DT),?70,"Page ",BCHPG
W !?20,"SUMMARY OF FORMS KEYED BY ALL OPERATORS"
W !?15,"CHR RECORD POSTING DATES: ",BCHBDD," TO ",BCHEDD,!
W !?35,"No. of",?43,"Forms",?53,"% of"
W !?11,"Operator",?35,"Forms",?43,"per day",?53,"Workload"
W !,BCH80S
S X="" F S X=$O(BCHFC("FORMS",X)) Q:X="" W !,X,?32,$J(BCHFC("FORMS",X),8),?40,$J((BCHFC("FORMS",X)/BCHFC("DAYS",X)),8,2),?51,$J(((BCHFC("FORMS",X)/BCHTOT)*100),8,2)
;S X="" F S X=$O(BCHFC("FORMS",X)) Q:X="" W !,X,?32,$J(BCHFC("FORMS",X),8),?40,$J(((BCHFC("FORMS",X)/BCHFC("DAYS",X)),8),?51,$J((((BCHFC("FORMS",X)/BCHTOT)*100),8)
W !?35,"--------",!?32,$J(BCHTOT,8)
Q
HEAD I 'BCHPG G HEAD1
I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S BCHQUIT="" Q
HEAD1 ;
W @IOF S BCHPG=BCHPG+1
W !?58,$$FMTE^XLFDT(DT),?70,"Page ",BCHPG,!
S BCHLENG=$L($P(^DIC(4,DUZ(2),0),U))
W ?((80-BCHLENG)/2),$P(^DIC(4,DUZ(2),0),U),!
W ?29,"NUMBER OF FORMS KEYED",!
S BCHLENG=21+$L(BCHPROV)
W ?((80-BCHLENG)/2),"DATE ENTRY OPERATOR: ",BCHPROV,!
W ?15,"CHR RECORD POSTING DATES: ",BCHBDD," TO ",BCHEDD,!
W !?25,"POSTING DATE",?40,"# FORMS",!
W BCH80S,!
Q
BCHFCP ; IHS/CMI/LAB - PRINT FORMS COUNT REPORT ;
+1 ;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
+2 ;IHS/CMI/LAB - tmp to xtmp
START ;
+1 SET BCH80S="-------------------------------------------------------------------------------"
SET BCHPG=0
+2 SET Y=BCHBD
DO DD^%DT
SET BCHBDD=Y
SET Y=BCHED
DO DD^%DT
SET BCHEDD=Y
+3 SET (BCHTOT,BCHPROV,BCHTDES)=0
+4 KILL BCHQUIT
+5 IF '$DATA(^XTMP("BCHFC",BCHJOB,BCHH))
SET BCHPROV="NONE TO REPORT"
DO HEAD
GOTO DONE
+6 FOR
SET BCHPROV=$ORDER(^XTMP("BCHFC",BCHJOB,BCHH,BCHPROV))
IF BCHPROV=""!($DATA(BCHQUIT))
QUIT
DO HEAD
IF $DATA(BCHQUIT)
QUIT
DO SORT
+7 IF $DATA(BCHQUIT)
GOTO DONE
+8 IF $Y>(IOSL-5)
DO HEAD
IF $DATA(BCHQUIT)
GOTO DONE
+9 WRITE !?42,"------",!
+10 WRITE ?5,"Grand Total for ALL Operators:",?42,$JUSTIFY(BCHTOT,6)
+11 DO SUMMPAGE
DONE IF $DATA(BCHET)
SET BCHTS=(86400*($PIECE(BCHET,",")-$PIECE(BCHBT,",")))+($PIECE(BCHET,",",2)-$PIECE(BCHBT,",",2))
SET BCHH=$PIECE(BCHTS/3600,".")
IF BCHH=""
SET BCHH=0
+1 SET BCHTS=BCHTS-(BCHH*3600)
SET BCHM=$PIECE(BCHTS/60,".")
IF BCHM=""
SET BCHM=0
SET BCHTS=BCHTS-(BCHM*60)
SET BCHS=BCHTS
WRITE !!,"RUN TIME (H.M.S): ",BCHH,".",BCHM,".",BCHS
+2 IF $EXTRACT(IOST)="C"
IF IO=IO(0)
SET DIR(0)="E"
DO ^DIR
KILL DIR
+3 IF $DATA(IOF)
WRITE @IOF
+4 KILL ^XTMP("BCHFC",BCHJOB,BCHH),BCHJOB,BCHH
+5 QUIT
SORT ;
+1 SET (BCHSUB,BCHDESU)=0
SET BCHFC("DAYS",BCHPROV)=0
+2 SET BCHDATE=0
FOR
SET BCHDATE=$ORDER(^XTMP("BCHFC",BCHJOB,BCHH,BCHPROV,BCHDATE))
IF BCHDATE'=+BCHDATE!($DATA(BCHQUIT))
QUIT
DO WRITE
+3 WRITE !?42,"------",!
+4 WRITE ?5,"Totals for ",BCHPROV,?42,$JUSTIFY(BCHSUB,6)
+5 SET BCHFC("FORMS",BCHPROV)=BCHSUB
+6 QUIT
WRITE ;
+1 SET Y=BCHDATE
DO DD^%DT
SET BCHWDAT=Y
+2 IF $Y>(IOSL-5)
DO HEAD
IF $DATA(BCHQUIT)
QUIT
+3 WRITE ?25,BCHWDAT,?42,$JUSTIFY(^XTMP("BCHFC",BCHJOB,BCHH,BCHPROV,BCHDATE),6),!
+4 SET BCHSUB=BCHSUB+^XTMP("BCHFC",BCHJOB,BCHH,BCHPROV,BCHDATE)
SET BCHTOT=BCHTOT+^XTMP("BCHFC",BCHJOB,BCHH,BCHPROV,BCHDATE)
+5 SET BCHFC("DAYS",BCHPROV)=BCHFC("DAYS",BCHPROV)+1
+6 QUIT
SUMMPAGE ;
+1 IF $EXTRACT(IOST)="C"
IF IO=IO(0)
WRITE !
SET DIR(0)="EO"
DO ^DIR
KILL DIR
IF Y=0!(Y="^")!($DATA(DTOUT))
SET BCHQUIT=""
QUIT
+2 IF $DATA(IOF)
WRITE @IOF
SET BCHPG=BCHPG+1
+3 WRITE !?58,$$FMTE^XLFDT(DT),?70,"Page ",BCHPG
+4 WRITE !?20,"SUMMARY OF FORMS KEYED BY ALL OPERATORS"
+5 WRITE !?15,"CHR RECORD POSTING DATES: ",BCHBDD," TO ",BCHEDD,!
+6 WRITE !?35,"No. of",?43,"Forms",?53,"% of"
+7 WRITE !?11,"Operator",?35,"Forms",?43,"per day",?53,"Workload"
+8 WRITE !,BCH80S
+9 SET X=""
FOR
SET X=$ORDER(BCHFC("FORMS",X))
IF X=""
QUIT
WRITE !,X,?32,$JUSTIFY(BCHFC("FORMS",X),8),?40,$JUSTIFY((BCHFC("FORMS",X)/BCHFC("DAYS",X)),8,2),?51,$JUSTIFY(((BCHFC("FORMS",X)/BCHTOT)*100),8,2)
+10 ;S X="" F S X=$O(BCHFC("FORMS",X)) Q:X="" W !,X,?32,$J(BCHFC("FORMS",X),8),?40,$J(((BCHFC("FORMS",X)/BCHFC("DAYS",X)),8),?51,$J((((BCHFC("FORMS",X)/BCHTOT)*100),8)
+11 WRITE !?35,"--------",!?32,$JUSTIFY(BCHTOT,8)
+12 QUIT
HEAD IF 'BCHPG
GOTO HEAD1
+1 IF $EXTRACT(IOST)="C"
IF IO=IO(0)
WRITE !
SET DIR(0)="EO"
DO ^DIR
KILL DIR
IF Y=0!(Y="^")!($DATA(DTOUT))
SET BCHQUIT=""
QUIT
HEAD1 ;
+1 WRITE @IOF
SET BCHPG=BCHPG+1
+2 WRITE !?58,$$FMTE^XLFDT(DT),?70,"Page ",BCHPG,!
+3 SET BCHLENG=$LENGTH($PIECE(^DIC(4,DUZ(2),0),U))
+4 WRITE ?((80-BCHLENG)/2),$PIECE(^DIC(4,DUZ(2),0),U),!
+5 WRITE ?29,"NUMBER OF FORMS KEYED",!
+6 SET BCHLENG=21+$LENGTH(BCHPROV)
+7 WRITE ?((80-BCHLENG)/2),"DATE ENTRY OPERATOR: ",BCHPROV,!
+8 WRITE ?15,"CHR RECORD POSTING DATES: ",BCHBDD," TO ",BCHEDD,!
+9 WRITE !?25,"POSTING DATE",?40,"# FORMS",!
+10 WRITE BCH80S,!
+11 QUIT