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

APCL1HP.m

Go to the documentation of this file.
APCL1HP ; IHS/CMI/LAB - print report 2A ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
START ;
 S APCLDT=$$FMTE^XLFDT(DT)
 S APCL132="__________________________________________________________________________________________________________________________________"
 S APCLMOL="OCT.,NOV.,DEC.,JAN.,FEB.,MAR.,APR.,MAY ,JUNE,JULY,AUG.,SEPT"
 S Y=$E(APCLFYE,1,3)_"0000" D DD^%DT S APCLFYD=Y S Y=DT D DD^%DT S APCLDT=Y
 I '$D(^AUTTAREA(APCLAREA,0)) S (APCLAREA,APCLAREC)="???" G START2
 S APCLAREC=$P(^AUTTAREA(APCLAREA,0),U,2),APCLAREA=$P(^AUTTAREA(APCLAREA,0),U)
START2 S (APCLPG,APCLLOC)=0 D HEAD
 K APCLQUIT
 I APCLGRAN=0 W !!,"NO VISITS FOR THIS FISCAL YEAR",! G DONE
 F  S APCLLOC=$O(^XTMP("APCL1H",APCLJOB,APCLBT,"MONLOCTOT",APCLLOC)) Q:APCLLOC=""!($D(APCLQUIT))  D P
 G:$D(APCLQUIT) DONE
 I $Y>(IOSL-8) D HEAD G:$D(APCLQUIT) DONE
 W !!," T O T A L",?29,$J(APCLGRAN,6)
 S APCLMON="",APCLTAB=36 F APCLJ=10,11,12,1,2,3,4,5,6,7,8,9 S APCLMON=$S($D(^XTMP("APCL1H",APCLJOB,APCLBT,"MONTOT",APCLJ)):^(APCLJ),1:0) W ?APCLTAB,$J(APCLMON,6) S APCLTAB=APCLTAB+8
 W !
DONE ;
 D DONE^APCLOSUT
 K ^XTMP("APCL1H",APCLJOB,APCLBT)
 Q
P ;
 I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
 S APCLT=^XTMP("APCL1H",APCLJOB,APCLBT,"LOCTOT",APCLLOC)
 S APCLLOCN=$E($P(^DIC(4,APCLLOC,0),U),1,28)
 W !,APCLLOCN,?29,$J(APCLT,6)
 S APCLMON="",APCLTAB=36 F APCLJ=10,11,12,1,2,3,4,5,6,7,8,9 S APCLMON=$S($D(^XTMP("APCL1H",APCLJOB,APCLBT,"MONLOCTOT",APCLLOC,APCLJ)):^(APCLJ),1:0) W ?APCLTAB,$J(APCLMON,6) S APCLTAB=APCLTAB+8 D MONTOT
 Q
 ;
MONTOT ;set up month totals for all discharges
 S ^(APCLJ)=$S($D(^XTMP("APCL1H",APCLJOB,APCLBT,"MONTOT",APCLJ)):^(APCLJ)+APCLMON,1:APCLMON)
 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 APCL132,!
 W !?25,"NUMBER OF HOSPITAL DISCHARGES BY MONTH OF DISCHARGE    FISCAL YEAR",APCLFYD
 W !,"AREA:  ",APCLAREC,"      ",APCLAREA,?105,APCLDT,?120,"Page ",APCLPG
 W !,APCL132,!
 W !,"HOSPITAL NAME",?30,"YR-TO",!
 W ?30,"DATE"
 S APCLTAB=38 F APCLX=1:1:12 W ?APCLTAB,$P(APCLMOL,",",APCLX) S APCLTAB=APCLTAB+8
 W !,APCL132
 Q
 ;