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

APCLCZPP.m

Go to the documentation of this file.
APCLCZPP ; IHS/CMI/LAB - print all visit report ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
START ;
 S APCL80S="-------------------------------------------------------------------------------"
 D NOW^%DTC S Y=X D DD^%DT S APCLDT=Y
 S Y=APCLBD D DD^%DT S APCLBDD=Y S Y=APCLED D DD^%DT S APCLEDD=Y
 S (APCLTOT,APCLPG,APCLVLOC)=0 D HEAD
 K APCLQUIT
 F  S APCLVLOC=$O(^XTMP("APCLCZP",APCLJOB,APCLBTH,"LOCTOT",APCLVLOC)) Q:APCLVLOC=""!($D(APCLQUIT))  D SORT
 G:$D(APCLQUIT) DONE
 I $Y>(IOSL-5) D HEAD G:$D(APCLQUIT) DONE
 W !?60,"--------",!
 W ?52,"Total:",?60,$J(APCLTOT,8),!
DONE ;
 D DONE^APCLOSUT
 K ^XTMP("APCLCZP",APCLJOB,APCLBTH)
 Q
SORT ;
 I $Y>(IOSL-6) D HEAD Q:$D(APCLQUIT)
 W !,$P(^DIC(4,APCLVLOC,0),U) W:APCLPROC'="LOS" !
 S APCLSORT="" F  S APCLSORT=$O(^XTMP("APCLCZP",APCLJOB,APCLBTH,"LOCTOT",APCLVLOC,APCLSORT)) Q:APCLSORT=""!($D(APCLQUIT))  D P
 Q:$D(APCLQUIT)
 Q:APCLPROC="LOS"
 W !?60,"--------",!
 W ?40,"Location Subtotal:",?60,$J(^XTMP("APCLCZP",APCLJOB,APCLBTH,"SUBTOTAL",APCLVLOC),8),!
 Q
P ;
 S APCLCLNT=0
 S:'$D(^XTMP("APCLCZP",APCLJOB,APCLBTH,"SUBTOTAL",APCLVLOC)) ^XTMP("APCLCZP",APCLJOB,APCLBTH,"SUBTOTAL",APCLVLOC)=0
 I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
 S APCLSRT2=$O(^XTMP("APCLCZP",APCLJOB,APCLBTH,"LOCTOT",APCLVLOC,APCLSORT,""))
 S APCLPRNT=APCLSORT I APCLPROC="DATE" S Y=APCLPRNT D DD^%DT S APCLPRNT=Y
 W:APCLPROC'="LOS" !?5,$E(APCLPRNT,1,25),"  (",APCLSRT2,")"
 S APCLCZP="" F  S APCLCZP=$O(^XTMP("APCLCZP",APCLJOB,APCLBTH,"LOCTOT",APCLVLOC,APCLSORT,APCLSRT2,APCLCZP)) Q:APCLCZP=""  D
 .W !?35,APCLCZP,?60,$J(^XTMP("APCLCZP",APCLJOB,APCLBTH,"LOCTOT",APCLVLOC,APCLSORT,APCLSRT2,APCLCZP),8)
 .S APCLCLNT=APCLCLNT+^XTMP("APCLCZP",APCLJOB,APCLBTH,"LOCTOT",APCLVLOC,APCLSORT,APCLSRT2,APCLCZP)
 .S APCLTOT=APCLTOT+^XTMP("APCLCZP",APCLJOB,APCLBTH,"LOCTOT",APCLVLOC,APCLSORT,APCLSRT2,APCLCZP)
 .S ^XTMP("APCLCZP",APCLJOB,APCLBTH,"SUBTOTAL",APCLVLOC)=^XTMP("APCLCZP",APCLJOB,APCLBTH,"SUBTOTAL",APCLVLOC)+^XTMP("APCLCZP",APCLJOB,APCLBTH,"LOCTOT",APCLVLOC,APCLSORT,APCLSRT2,APCLCZP)
 W !!?40,"Clinic Total:",?60,$J(APCLCLNT,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 APCLQUIT="" Q
HEAD1 ;
 W:$D(IOF) @IOF S APCLPG=APCLPG+1
 W !
 W ?58,APCLDT,?72,"Page ",APCLPG,!
 S APCLLENG=31+$L(APCLTITL)
 W ?((80-APCLLENG)/2),"NUMBER OF AMBULATORY VISITS BY ",APCLTITL,!
 S APCLLOCT=$S(APCLLOC="":"ALL",1:$P(^DIC(4,APCLLOC,0),U))
 S APCLLENG=21+$L(APCLLOCT)
 W ?((80-APCLLENG)/2),"LOCATION OF VISITS:  ",APCLLOCT,!
 W ?18,"VISIT DATES:  ",APCLBDD,"  TO  ",APCLEDD,!
 W !,"LOCATION OF VISIT"
 W !?5,APCLHD1," (CODE)",?35,"ZIP CODE",?60,"# VISITS",!
 W APCL80S,!
 Q