Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BCHFCP

BCHFCP.m

Go to the documentation of this file.
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
 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