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
HEAD I 'APCLPG G HEAD1
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
APCLWL1P ; IHS/CMI/LAB - CLINIC HOURLY WORKLOAD REPORT ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
DOC ;This routine is the "printing" part of the Clinic Hourly Workload
+1 ;report. Called from the APCLWL11 routine.
+2 ;
+3 ;Listing of VARIABLES with brief descriptions:
+4 ;
START ;Start of routine
+1 SET APCL132S=""
SET $PIECE(APCL132S,"-",132)=""
+2 DO NOW^%DTC
SET Y=X
DO DD^%DT
SET APCLDT=Y
+3 SET Y=APCLBD
DO DD^%DT
SET APCLBDD=Y
SET Y=APCLED
DO DD^%DT
SET APCLEDD=Y
+4 SET (APCLPG,APCLDATE)=0
DO HEAD
+5 KILL APCLQUIT
+6 FOR
SET APCLDATE=$ORDER(^XTMP("APCLWL1",APCLJOB,APCLBT,"DATE",APCLDATE))
IF APCLDATE=""!($DATA(APCLQUIT))
QUIT
DO SORT
+7 IF $DATA(APCLQUIT)
GOTO DONE
+8 IF $Y>(IOSL-5)
DO HEAD
IF $DATA(APCLQUIT)
GOTO DONE
+9 WRITE !?2,"Totals: "
+10 SET APCLTAB=12
FOR APCLTIME=0:1:23
IF $DATA(APCLQUIT)
QUIT
Begin DoDot:1
+11 WRITE ?APCLTAB,$SELECT($DATA(^XTMP("APCLWL1",APCLJOB,APCLBT,"TIME TOTALS",APCLTIME)):$JUSTIFY(^(APCLTIME),3),1:" .")
SET APCLTAB=APCLTAB+5
End DoDot:1
+12 WRITE !
DONE ;
+1 DO DONE^APCLOSUT
+2 KILL ^XTMP("APCLWL1",APCLJOB,APCLBT)
+3 QUIT
SORT ;
+1 IF $Y>(IOSL-5)
DO HEAD
IF $DATA(APCLQUIT)
QUIT
+2 SET X=APCLDATE
DO DW^%DTC
SET APCLDOW=$EXTRACT(X,1,3)
+3 WRITE !,$EXTRACT(APCLDATE,4,5),"/",$EXTRACT(APCLDATE,6,7),?7,APCLDOW
+4 SET APCLTAB=12
FOR APCLTIME=0:1:23
IF $DATA(APCLQUIT)
QUIT
Begin DoDot:1
+5 IF $DATA(^XTMP("APCLWL1",APCLJOB,APCLBT,"DATE",APCLDATE,APCLTIME))
WRITE ?APCLTAB,$JUSTIFY(^XTMP("APCLWL1",APCLJOB,APCLBT,"DATE",APCLDATE,APCLTIME),3)
+6 IF '$TEST
WRITE ?APCLTAB," ."
+7 SET APCLTAB=APCLTAB+5
+8 QUIT
End DoDot:1
+9 QUIT
HEAD IF 'APCLPG
GOTO HEAD1
+1 IF $EXTRACT(IOST)="C"
IF IO=IO(0)
WRITE !
SET DIR(0)="EO"
DO ^DIR
KILL DIR
IF Y=0!(Y="^")!($DATA(DTOUT))
SET APCLQUIT=""
QUIT
HEAD1 ;
+1 IF $DATA(IOF)
WRITE @IOF
SET APCLPG=APCLPG+1
+2 WRITE ?52,"CLINIC HOURLY WORKLOAD REPORT",?100,APCLDT,?123,"Page ",APCLPG,!
+3 SET APCLLOCT=$SELECT(APCLLOC="":"ALL",1:$PIECE(^DIC(4,APCLLOC,0),U))
+4 SET APCLLENG=21+$LENGTH(APCLLOCT)
+5 WRITE ?((132-APCLLENG)/2),"LOCATION OF VISITS: ",APCLLOCT,!
+6 SET APCLCLNT=$SELECT(APCLCLN="":"ALL",1:$PIECE(^DIC(40.7,APCLCLN,0),U))
+7 SET APCLLENG=8+$LENGTH(APCLCLNT)
+8 WRITE ?((132-APCLLENG)/2),"CLINIC: ",APCLCLNT,!
+9 WRITE ?45,"VISIT DATES: ",APCLBDD," TO ",APCLEDD,!
+10 IF $DATA(APCLAGET)
WRITE ?45,"AGE RANGE: ",APCLAGET,!
+11 SET APCLFILE=$SELECT($PIECE(^DD(9000010.06,.01,0),U,2)[200:"200",1:"6")
+12 IF APCLPROV]""
WRITE ?55,"PROVIDER: "_$$VAL^XBDIQ1(APCLFILE,APCLPROV,.01)
+13 IF APCLPROV=""
WRITE ?59,"PROVIDER: ALL"
+14 WRITE !?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"
+15 WRITE ?72,"12PM",?77,"1PM",?82,"2PM",?87,"3PM",?92,"4PM",?97,"5PM",?102,"6PM",?107,"7PM",?112,"8PM",?117,"9PM",?122,"10PM",?127,"11PM",!
+16 WRITE APCL132S
+17 QUIT