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

APCLWL1P.m

Go to the documentation of this file.
APCLWL1P ; IHS/CMI/LAB - CLINIC HOURLY WORKLOAD REPORT ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
DOC ;This routine is the "printing" part of the Clinic Hourly Workload
 ;report.  Called from the APCLWL11 routine.
 ;
 ;Listing of VARIABLES with brief descriptions:
 ;
START ;Start of routine            
 S APCL132S="",$P(APCL132S,"-",132)=""
 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 (APCLPG,APCLDATE)=0 D HEAD
 K APCLQUIT
 F  S APCLDATE=$O(^XTMP("APCLWL1",APCLJOB,APCLBT,"DATE",APCLDATE)) Q:APCLDATE=""!($D(APCLQUIT))  D SORT
 G:$D(APCLQUIT) DONE
 I $Y>(IOSL-5) D HEAD G:$D(APCLQUIT) DONE
 W !?2,"Totals:  "
 S APCLTAB=12 F APCLTIME=0:1:23 Q:$D(APCLQUIT)  D
 .W ?APCLTAB,$S($D(^XTMP("APCLWL1",APCLJOB,APCLBT,"TIME TOTALS",APCLTIME)):$J(^(APCLTIME),3),1:"  .") S APCLTAB=APCLTAB+5
 W !
DONE ;
 D DONE^APCLOSUT
 K ^XTMP("APCLWL1",APCLJOB,APCLBT)
 Q
SORT ;
 I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
 S X=APCLDATE D DW^%DTC S APCLDOW=$E(X,1,3)
 W !,$E(APCLDATE,4,5),"/",$E(APCLDATE,6,7),?7,APCLDOW
 S APCLTAB=12 F APCLTIME=0:1:23 Q:$D(APCLQUIT)  D
 .I $D(^XTMP("APCLWL1",APCLJOB,APCLBT,"DATE",APCLDATE,APCLTIME)) W ?APCLTAB,$J(^XTMP("APCLWL1",APCLJOB,APCLBT,"DATE",APCLDATE,APCLTIME),3)
 .E  W ?APCLTAB,"  ."
 .S APCLTAB=APCLTAB+5
 .Q
 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 ?52,"CLINIC HOURLY WORKLOAD REPORT",?100,APCLDT,?123,"Page ",APCLPG,!
 S APCLLOCT=$S(APCLLOC="":"ALL",1:$P(^DIC(4,APCLLOC,0),U))
 S APCLLENG=21+$L(APCLLOCT)
 W ?((132-APCLLENG)/2),"LOCATION OF VISITS:  ",APCLLOCT,!
 S APCLCLNT=$S(APCLCLN="":"ALL",1:$P(^DIC(40.7,APCLCLN,0),U))
 S APCLLENG=8+$L(APCLCLNT)
 W ?((132-APCLLENG)/2),"CLINIC:  ",APCLCLNT,!
 W ?45,"VISIT DATES:  ",APCLBDD,"  TO  ",APCLEDD,!
 I $D(APCLAGET) W ?45,"AGE RANGE:  ",APCLAGET,!
 S APCLFILE=$S($P(^DD(9000010.06,.01,0),U,2)[200:"200",1:"6")
 I APCLPROV]"" W ?55,"PROVIDER: "_$$VAL^XBDIQ1(APCLFILE,APCLPROV,.01)
 I APCLPROV="" W ?59,"PROVIDER:  ALL"
 W !?1,"DATE",?7,"DOW",?12,"12AM",?17,"1AM",?22,"2AM",?27,"3AM",?32,"4AM",?37,"5AM",?42,"6AM",?47,"7AM",?52,"8AM",?57,"9AM",?62,"10AM",?67,"11AM"
 W ?72,"12PM",?77,"1PM",?82,"2PM",?87,"3PM",?92,"4PM",?97,"5PM",?102,"6PM",?107,"7PM",?112,"8PM",?117,"9PM",?122,"10PM",?127,"11PM",!
 W APCL132S
 Q