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

APCLT1P.m

Go to the documentation of this file.
APCLT1P ; IHS/CMI/LAB - print apc report ;
 ;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
 ;IHS/TUCSON/LAB - added a header line to display appt/wi header 05/01/97
START ;
 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 APCLCLN=0 K APCLQUIT
 F  S APCLCLN=$O(^XTMP("APCLT1",APCLJOB,APCLBTH,"TOTAL",APCLCLN)) Q:APCLCLN=""!($D(APCLQUIT))  D P
 G:$D(APCLQUIT) DONE
 I $D(^XTMP("APCLT1",APCLJOB,APCLBTH,"OUTLIERS")) S APCLOUT=1 D HEAD
 S APCLX=0 F  S APCLX=$O(^XTMP("APCLT1",APCLJOB,APCLBTH,"OUTLIERS",APCLX)) Q:APCLX'=+APCLX!($D(APCLQUIT))  D
 .I $Y>(IOSL-4) D HEAD Q:$D(APCLQUIT)
 .S X=^XTMP("APCLT1",APCLJOB,APCLBTH,"OUTLIERS",APCLX)
 .W !,$P(X,U),?16,$P(X,U,2),?47,$P(X,U,3),?62,$P(X,U,4)
 .Q
DONE ;
 D DONE^APCLOSUT
 K ^XTMP("APCLT1",APCLJOB,APCLBTH),APCLOUT
 Q
P ;
 I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
 W !!,$P(^DIC(40.7,APCLCLN,0),U),?24,$J($P(^XTMP("APCLT1",APCLJOB,APCLBTH,"TOTAL",APCLCLN),U),6),?32,$J($P(^(APCLCLN),U,2),6)
 S T=$P(^XTMP("APCLT1",APCLJOB,APCLBTH,"TOTAL",APCLCLN),U,3),V=$P(^XTMP("APCLT1",APCLJOB,APCLBTH,"TOTAL",APCLCLN),U,2),M=$S(V:T/V/60,1:".")
 W ?39,$J(M,6,1)
 W:$P(^XTMP("APCLT1",APCLJOB,APCLBTH,"TOTAL",APCLCLN),U,4) ?46,$J($P(^XTMP("APCLT1",APCLJOB,APCLBTH,"TOTAL",APCLCLN),U,4)/60,6,1)
 W:$P(^XTMP("APCLT1",APCLJOB,APCLBTH,"TOTAL",APCLCLN),U,5) ?53,$J($P(^XTMP("APCLT1",APCLJOB,APCLBTH,"TOTAL",APCLCLN),U,5)/60,6,1)
 W ?63,$J($P(^XTMP("APCLT1",APCLJOB,APCLBTH,"TOTAL",APCLCLN),U,6),6),?71,$J($P(^XTMP("APCLT1",APCLJOB,APCLBTH,"TOTAL",APCLCLN),U,7),6)
 ;WRITE PROVIDER INFORMATION
 S APCLX=0 F  S APCLX=$O(^XTMP("APCLT1",APCLJOB,APCLBTH,"IND",APCLCLN,APCLX)) Q:APCLX'=+APCLX!$D(APCLQUIT)  D
 .I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
 .W !?3,$E($S($P(^DD(9000010.06,.01,0),U,2)[200:$P(^VA(200,APCLX,0),U),1:$P(^DIC(16,APCLX,0),U)),1,20),?24,$J($P(^XTMP("APCLT1",APCLJOB,APCLBTH,"IND",APCLCLN,APCLX),U),6),?32,$J($P(^(APCLX),U,2),6)
 .S T=$P(^XTMP("APCLT1",APCLJOB,APCLBTH,"IND",APCLCLN,APCLX),U,3),V=$P(^XTMP("APCLT1",APCLJOB,APCLBTH,"IND",APCLCLN,APCLX),U,2),M=$S(V:T/V/60,1:".")
 .W ?39,$J(M,6,1)
 .W:$P(^XTMP("APCLT1",APCLJOB,APCLBTH,"IND",APCLCLN,APCLX),U,4) ?46,$J($P(^XTMP("APCLT1",APCLJOB,APCLBTH,"IND",APCLCLN,APCLX),U,4)/60,6,1)
 .W:$P(^XTMP("APCLT1",APCLJOB,APCLBTH,"IND",APCLCLN,APCLX),U,5) ?53,$J($P(^XTMP("APCLT1",APCLJOB,APCLBTH,"IND",APCLCLN,APCLX),U,5)/60,6,1)
 .W ?63,$J($P(^XTMP("APCLT1",APCLJOB,APCLBTH,"IND",APCLCLN,APCLX),U,6),6),?71,$J($P(^XTMP("APCLT1",APCLJOB,APCLBTH,"IND",APCLCLN,APCLX),U,7),6)
 .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 !,$TR($J("",79)," ","*"),!
 W "*",?3,$P(^DIC(4,DUZ(2),0),U),?58,APCLDT,?68,"Page ",APCLPG,?76,"*",!
 W "*",?78,"*",!
 W "*",?22,"WAITING TIMES BY CLINIC AND PROVIDER",?78,"*",!
 S APCLLOCT=$P(^DIC(4,DUZ(2),0),U)
 S APCLLENG=21+$L(APCLLOCT)
 W "*",?((80-APCLLENG)/2),"LOCATION OF VISITS:  ",APCLLOCT,?78,"*",!
 W "*",?18,"REPORT DATE:  ",APCLBDD,"  TO  ",APCLEDD,?78,"*",!
 W ?21,"Report includes ",$S(APCLAPWI="A":"APPOINTMENTS",1:"WALK INS")," only.",! ;IHS/TUCSON/LAB - patch 1 05/01/97
 W $TR($J("",79)," ","*"),!!
 I $G(APCLOUT) W ?10,"VISITS NOT COUNTED BECAUSE OF >240 MINUTE WAIT TIMES",!,"ARRIVAL TIME",?16,"PATIENT NAME",?47,"APPT TIME",?62,"PROV SEEN" Q
 W !,"CLINIC",?24,"TOTAL",?32,"# VSTS",?41,"AVG",?48,"MIN",?55,"MAX",?61,"  #",?69,"  #",!
 W ?24,"VISITS",?34,"USED",?41,"WAIT",?48,"WAIT",?55,"WAIT",?64,"EARLY",?72,"LATE",!
 S X="",$P(X,"-",80)="" W X,!
 Q