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

APCLAP8P.m

Go to the documentation of this file.
APCLAP8P ; IHS/CMI/LAB - APC Visit Counts Print Report ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;to tally average number of visit per day of week by clinic
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,APCLCLN="" D HEAD
 K APCLQUIT
 F  S APCLCLN=$O(^XTMP("APCLAP8",APCLJOB,APCLBTH,"DOW #",APCLCLN)) Q:APCLCLN=""!($D(APCLQUIT))  D
 .I $Y>(IOSL-4) D HEAD Q:$D(APCLQUIT)
 .W !,$E(APCLCLN,1,20) S J=24 F APCLDAY="MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY" Q:$D(APCLQUIT)  D
 ..I '$D(^XTMP("APCLAP8",APCLJOB,APCLBTH,"DOW #",APCLCLN,APCLDAY)) S APCLTOT=0,APCLTOT=$J(APCLTOT,6,0) W ?J,APCLTOT S J=J+8 Q
 ..S APCLTOT=^XTMP("APCLAP8",APCLJOB,APCLBTH,"VISITS DOW",APCLCLN,APCLDAY)/^XTMP("APCLAP8",APCLJOB,APCLBTH,"DOW #",APCLCLN,APCLDAY) S APCLTOT=$J(APCLTOT,6,0) W ?J,APCLTOT S J=J+8
 ..Q
 .Q
DONE ;
 D DONE^APCLOSUT
 K ^XTMP("APCLAP8",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 "*",?17,"AVERAGE DAILY OUTPATIENT VISITS BY CLINIC",?78,"*",!,?28,"SERVICE CATEGORIES:  ALL",!
 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 ?10,"CLINIC",?24,"MONDAY  TUESDAY WEDNESD THURSDA FRIDAY  SATURDA SUNDAY  "
 Q