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

APCLAP4P.m

Go to the documentation of this file.
APCLAP4P ; 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 APCLDAY=0 K APCLQUIT
 F APCLDAY="MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY" Q:$D(APCLQUIT)  D
 .I '$D(^XTMP("APCLAP4",APCLJOB,APCLBTH,"DOW #",APCLDAY)) S APCLTOT=0,APCLTOT=$J(APCLTOT,6,0) D P Q
 .S APCLTOT=^XTMP("APCLAP4",APCLJOB,APCLBTH,"VISITS DOW",APCLDAY)/^XTMP("APCLAP4",APCLJOB,APCLBTH,"DOW #",APCLDAY) S APCLTOT=$J(APCLTOT,6,0) D P
 .Q
DONE ;
 D DONE^APCLOSUT
 K ^XTMP("APCLAP4",APCLJOB,APCLBTH)
 Q
P ;
 I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
 W !!?10,APCLDAY,?40,APCLTOT
 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),?56,APCLDT,?72,"Page ",APCLPG,?78,"*",!
 W "*",?78,"*",!
 W "*",?22,"AVERAGE DAILY OUTPATIENT (APC) VISITS",?78,"*",!
 S APCLLOCT=$S(APCLLOC=0:"ALL",1:"SELECTED")
 S APCLLENG=21+$L(APCLLOCT)
 W "*",?((80-APCLLENG)/2),"LOCATION OF VISITS:  ",APCLLOCT,?78,"*",!
 I $D(APCLCLNT) D DISPCLN
 W "*",?18,"REPORT DATE:  ",APCLBDD,"  TO  ",APCLEDD,?78,"*",!
 W APCL80S,!
 W !!
 W ?10,"DAY-OF-WEEK",?35,"AVERAGE # VISITS PER DAY"
 Q
DISPCLN ;
 NEW X S X=0 F  S X=$O(APCLCLNT(X)) Q:X'=+X  D
 .S APCLLENG=9+$L($P(^DIC(40.7,X,0),U))
 .W "*",?((80-APCLLENG)/2),"CLINIC:  ",$P(^DIC(40.7,X,0),U),?78,"*",!
 .Q
 Q