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

APCLAP1P.m

Go to the documentation of this file.
APCLAP1P ; IHS/CMI/LAB - print apc report ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
START ;
 S APCL80S="*******************************************************************************"
 S APCLDT=$$FMTE^XLFDT(DT)
 S Y=APCLBD D DD^%DT S APCLBDD=Y S Y=APCLED D DD^%DT S APCLEDD=Y
 S (APCLTOT,APCLPG)=0 D HEAD
 S APCLSORT=0 K APCLQUIT
 F I=0:0 S APCLSORT=$O(^XTMP("APCLAP1",APCLJOB,APCLBTH,APCLSORT)) Q:APCLSORT=""!($D(APCLQUIT))  D P
 G:$D(APCLQUIT) DONE
 I $Y>(IOSL-5) D HEAD G:$D(APCLQUIT) DONE
 W !?61,"-------",!
 W ?52,"Total:",?60,$J(APCLTOT,8),!
DONE ;
 D DONE^APCLOSUT
 K ^XTMP("APCLAP1",APCLJOB,APCLBTH)
 Q
P ;
 S APCLSRT2=0 F  S APCLSRT2=$O(^XTMP("APCLAP1",APCLJOB,APCLBTH,APCLSORT,APCLSRT2)) Q:APCLSRT2=""!($D(APCLQUIT))  D
 .I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
 .;S APCLSRT2=$O(^XTMP("APCLAP1",APCLJOB,APCLBTH,APCLSORT,""))
 .S APCLPRNT=APCLSORT I APCLPROC="DATE" S Y=APCLPRNT D DD^%DT S APCLPRNT=Y
 .W !?5,$E(APCLPRNT,1,25),?35,$E(APCLSRT2,1,20),?60,$J(^XTMP("APCLAP1",APCLJOB,APCLBTH,APCLSORT,APCLSRT2),8)
 .S APCLTOT=APCLTOT+^XTMP("APCLAP1",APCLJOB,APCLBTH,APCLSORT,APCLSRT2)
 Q
 I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S APCLQUIT="" Q
HEAD1 ;
 W:$D(IOF) @IOF S APCLPG=APCLPG+1
 W APCL80S,!
 W "*",?3,$P(^DIC(4,APCLSITE,0),U),?58,APCLDT,?72,"Page ",APCLPG,?78,"*",!
 W "*",?78,"*",!
 S APCLLENG=24+$L(APCLTITL)
 W "*",?((80-APCLLENG)/2),"NUMBER OF APC VISITS BY ",APCLTITL,?78,"*",!
 S APCLLOCT=$S(APCLLOC=0:"ALL",1:"SELECTED")
 S APCLLENG=21+$L(APCLLOCT)
 W "*",?((80-APCLLENG)/2),"LOCATION OF VISITS:  ",APCLLOCT,?78,"*",!
 W "*",?18,"REPORT DATE:  ",APCLBDD,"  TO  ",APCLEDD,?78,"*",!
 W APCL80S,!
 W !!
 W ?5,APCLHD1,?35,APCLHD2,?60,"# VISITS",!
 Q