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

AMHFCP.m

Go to the documentation of this file.
AMHFCP ; IHS/CMI/LAB - PRINT FORMS COUNT REPORT ;
 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
START ;
 S AMH80S="-------------------------------------------------------------------------------",AMHPG=0
 S Y=AMHBD D DD^%DT S AMHBDD=Y S Y=AMHED D DD^%DT S AMHEDD=Y
 S (AMHTOT,AMHPROV,AMHTDES)=0
 K AMHQUIT
 I '$D(^XTMP("AMHFC",$J)) S AMHPROV="NONE TO REPORT" D HEAD G DONE
 F  S AMHPROV=$O(^XTMP("AMHFC",$J,AMHPROV)) Q:AMHPROV=""!($D(AMHQUIT))  D HEAD Q:$D(AMHQUIT)  D SORT
 G:$D(AMHQUIT) DONE
 I $Y>(IOSL-5) D HEAD G:$D(AMHQUIT) DONE
 W !?42,"------",!
 W ?5,"Grand Total for ALL Operators:",?42,$J(AMHTOT,6)
 D SUMMPAGE
DONE I $D(AMHET) S AMHTS=(86400*($P(AMHET,",")-$P(AMHBT,",")))+($P(AMHET,",",2)-$P(AMHBT,",",2)),AMHH=$P(AMHTS/3600,".") S:AMHH="" AMHH=0
 S AMHTS=AMHTS-(AMHH*3600),AMHM=$P(AMHTS/60,".") S:AMHM="" AMHM=0 S AMHTS=AMHTS-(AMHM*60),AMHS=AMHTS W !!,"RUN TIME (H.M.S): ",AMHH,".",AMHM,".",AMHS
 I $E(IOST)="C",IO=IO(0) S DIR(0)="E" D ^DIR K DIR
 W:$D(IOF) @IOF
 Q
SORT ;
 S (AMHSUB,AMHDESU)=0,AMHFC("DAYS",AMHPROV)=0
 S AMHDATE=0 F  S AMHDATE=$O(^XTMP("AMHFC",$J,AMHPROV,AMHDATE)) Q:AMHDATE'=+AMHDATE!($D(AMHQUIT))  D WRITE
 W !?42,"------",!
 W ?5,"Totals for ",AMHPROV,?42,$J(AMHSUB,6)
 S AMHFC("FORMS",AMHPROV)=AMHSUB
 Q
WRITE ;
 S Y=AMHDATE D DD^%DT S AMHWDAT=Y
 I $Y>(IOSL-5) D HEAD Q:$D(AMHQUIT)
 W ?25,AMHWDAT,?42,$J(^XTMP("AMHFC",$J,AMHPROV,AMHDATE),6),!
 S AMHSUB=AMHSUB+^XTMP("AMHFC",$J,AMHPROV,AMHDATE),AMHTOT=AMHTOT+^XTMP("AMHFC",$J,AMHPROV,AMHDATE)
 S AMHFC("DAYS",AMHPROV)=AMHFC("DAYS",AMHPROV)+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 AMHQUIT="" Q
 W:$D(IOF) @IOF S AMHPG=AMHPG+1
 W !?58,AMHDT,?70,"Page ",AMHPG
 W !?20,"SUMMARY OF FORMS KEYED BY ALL OPERATORS"
 W !?15,"BH RECORD POSTING DATES:  ",AMHBDD,"  TO  ",AMHEDD,!
 W !?35,"No. of",?43,"Forms",?53,"% of"
 W !?11,"Operator",?35,"Forms",?43,"per day",?53,"Workload"
 W !,AMH80S
 S X="" F  S X=$O(AMHFC("FORMS",X)) Q:X=""  W !,X,?32,$J(AMHFC("FORMS",X),8),?40,$J((AMHFC("FORMS",X)/AMHFC("DAYS",X)),8,1),?51,$J(((AMHFC("FORMS",X)/AMHTOT)*100),8,1)
 ;S X="" F  S X=$O(AMHFC("FORMS",X)) Q:X=""  W !,X,?32,$J(AMHFC("FORMS",X),8),?40,$J((AMHFC("FORMS",X)/AMHFC("DAYS",X)),8,1),?51,$J(((AMHFC("FORMS",X)/AMHTOT)*100),8,1)
 W !?35,"--------",!?32,$J(AMHTOT,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 AMHQUIT="" Q
HEAD1 ;
 W @IOF S AMHPG=AMHPG+1
 W !?58,AMHDT,?70,"Page ",AMHPG,!
 S AMHLENG=$L($P(^DIC(4,DUZ(2),0),U))
 W ?((80-AMHLENG)/2),$P(^DIC(4,DUZ(2),0),U),!
 W ?29,"NUMBER OF FORMS KEYED",!
 S AMHLENG=21+$L(AMHPROV)
 W ?((80-AMHLENG)/2),"DATE ENTRY OPERATOR:  ",AMHPROV,!
 W ?15,"BH RECORD POSTING DATES:  ",AMHBDD,"  TO  ",AMHEDD,!
 W !?25,"POSTING DATE",?40,"# FORMS",!
 W AMH80S,!
 Q