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

APCLYV63.m

Go to the documentation of this file.
APCLYV63 ; IHS/CMI/LAB - VISIT COUNTS BY PROV FOR 1 DAY (PRINT) ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;
INIT ;initialize variables
 I '$D(^XTMP("APCLYV6",APCLJOB,APCLBT)) D HEAD W !,"No data to report." G END
 S APCLSTOP="",PAGE=0
 S APCLTOT=0 ;total count
 ;
SET ;set up print fields
 S APCLCS=0 D HEAD
SET1 S APCLCS=$O(^XTMP("APCLYV6",APCLJOB,APCLBT,APCLCS)) G FINAL:APCLCS=""
 S APCLPRN=0 I APCLS'=1 W !!,APCLCS,":"
SET2 S APCLPRN=$O(^XTMP("APCLYV6",APCLJOB,APCLBT,APCLCS,APCLPRN)) G SET1:APCLPRN=""
 S APCLPR=0
SET3 S APCLPR=$O(^XTMP("APCLYV6",APCLJOB,APCLBT,APCLCS,APCLPRN,APCLPR)) G SET2:APCLPR=""
 S APCLVDAT=0,APCLFLG=0
SET4 S APCLVDAT=$O(^XTMP("APCLYV6",APCLJOB,APCLBT,APCLCS,APCLPRN,APCLPR,APCLVDAT))
 G SET3:APCLVDAT="" S APCLCL=0
SET5 S APCLCL=$O(^XTMP("APCLYV6",APCLJOB,APCLBT,APCLCS,APCLPRN,APCLPR,APCLVDAT,APCLCL)) G SET4:APCLCL="" S APCLCNT=^(APCLCL),APCLTOT=APCLTOT+APCLCNT
 I $Y>(IOSL-5) D PAGE G END:APCLSTOP="^"
 I 'APCLFLG W !,APCLPRN,?25,APCLCL,?60,$J(APCLCNT,5) S APCLFLG=1 G SET5
 W !?25,APCLCL,?60,$J(APCLCNT,5) G SET5
 ;
FINAL ;print grand totals
 I $Y>(IOSL-5) D PAGE
 W !!?40,"TOTAL VISITS:",?60,$J(APCLTOT,5),!!
END ;
 D DONE^APCLOSUT
 K APCLCL,APCLTOT,APCLCS,APCLVDAT,PAGE,APCLSTOP,APCLCNT
 K APCLPRN,APCLPR,APCLPRV,APCLPDFN,APCLSTR,APCLFLG,APCLBD
 K APCLED,X,Y
 W:IOST'?1"C-".E @IOF K ^XTMP("APCLYV6",APCLJOB,APCLBT)
 Q
 Q
 ;
 W !!,$P(^VA(200,DUZ,0),"^",2),?(80-$L(X)/2),X,?70,"Page ",PAGE
 S X=$P($H,",",2) D TIME W !,Y,?28,"VISIT COUNTS BY PROVIDER"
 S Y=DT X ^DD("DD") W !,Y
 W ?34,"for ",$E(APCLBD,4,5),"/",$E(APCLBD,6,7),"/",$E(APCLBD,2,3)
 W !!,"PROVIDER",?25,"CLINIC",?60,"NUMBER OF VISITS"
 W !,"--------",?25,"------",?60,"----------------"
 Q
 ;
PAGE ;form feed to new page
 I IOST'?1"C-".E D HEAD Q
 I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="E" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S APCLSTOP="^" Q
 I APCLSTOP'="^" D HEAD
 Q
TIME S Y="" Q:'$D(X)  Q:X<0!(X>86400)
 S %A=X\60,%B=%A\60 S:%B>12 %B=%B-12 S:%B=0 %B=12 S:%B<10 %B=" "_%B
 S %C=$S(%A=0:"M ",%A=720:"N ",%A=1440:"M ",%A<720:"am",1:"pm")
 S Y=%B_":"_$E(%A#60+100,2,3)_" "_%C K %A,%B,%C Q