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

APCLCP6P.m

Go to the documentation of this file.
APCLCP6P ; IHS/CMI/LAB - print activity report ;
 ;;2.0;IHS PCC SUITE;**2**;MAY 14, 2009
START ;
 S APCL80S="-------------------------------------------------------------------------------"
 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,APCLVAL)=0
 I '$D(^XTMP(APCLNSP,APCLJOB,APCLBT)) D HEAD W !,"No data to report.",! G DONE
 K APCLQUIT
 F  S APCLVAL=$O(^XTMP(APCLNSP,APCLJOB,APCLBT,APCLVAL)) Q:APCLVAL'=+APCLVAL!($D(APCLQUIT))  D LOC
DONE ;
 D DONE^APCLOSUT
 K ^XTMP(APCLNSP,APCLJOB,APCLBT)
 Q
LOC ;
 D HEAD,SUBHEAD Q:$D(APCLQUIT)
 S ^XTMP(APCLNSP,APCLJOB,APCLBT,"SUBTOTAL",APCLVAL,"TOTAL")=0
 S APCLLOC="" F  S APCLLOC=$O(^XTMP(APCLNSP,APCLJOB,APCLBT,APCLVAL,APCLLOC)) Q:APCLLOC=""!($D(APCLQUIT))  D P
 W !!?10,"TOTAL:"
 W ?38,$J($S($D(^XTMP(APCLNSP,APCLJOB,APCLBT,"SUBTOTAL",APCLVAL,"TOTAL")):^("TOTAL"),1:0),7)
 Q
P ;
 S:$D(^XTMP(APCLNSP,APCLJOB,APCLBT,APCLVAL,APCLLOC,"TOTAL")) ^XTMP(APCLNSP,APCLJOB,APCLBT,"SUBTOTAL",APCLVAL,"TOTAL")=^XTMP(APCLNSP,APCLJOB,APCLBT,"SUBTOTAL",APCLVAL,"TOTAL")+^XTMP(APCLNSP,APCLJOB,APCLBT,APCLVAL,APCLLOC,"TOTAL")
 I $Y>(IOSL-5) D HEAD,SUBHEAD Q:$D(APCLQUIT)
 W !,$E($P(^DIC(4,APCLLOC,0),U),1,26),?38,$J($S($D(^XTMP(APCLNSP,APCLJOB,APCLBT,APCLVAL,APCLLOC,"TOTAL")):^("TOTAL"),1:0),7)
 Q
SUBHEAD ;
 Q:$D(APCLQUIT)
 I APCLSORV="APCLAP" S APCLVALP=$S($P(^DD(9000010.06,.01,0),U,2)[200:$P(^VA(200,APCLVAL,0),U),1:$P(^DIC(16,APCLVAL,0),U)) S APCLLENG=$L(APCLVALP)
 I APCLSORV="APCLSU" S APCLLENG=$L($S(APCLSU:$P(^AUTTSU(APCLSU,0),U),1:"UNKNOWN/MISSING")),APCLVALP=$S(APCLSU:$P(^AUTTSU(APCLSU,0),U),1:"UNKNOWN/MISSING")
 W ?(80-(11+APCLLENG)/2),APCLSORT,":  ",APCLVALP
 W !!?35,"TOTAL NUMBER OF"
 W !?35,"INDIVIDUALS SEEN"
 W !,APCL80S,!
 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 !
 W APCLDT,?72,"Page ",APCLPG,!
 W ?(80-(36+$L($P(^APCLACTG(APCLACTG,0),U)))/2),"NUMBER OF INDIVIDUALS SEEN BY ",$P(^APCLACTG(APCLACTG,0),U)," STAFF",!
 W ?18,"VISIT DATES:  ",APCLBDD,"  TO  ",APCLEDD,!
 S X="" I '$D(APCLLOC) S X="All Locations"
 I $D(APCLLOC) S X="Locations: " S Y=0 F  S Y=$O(APCLLOC(Y)) Q:Y'=+Y  S X=X_$E($P(^DIC(4,Y,0),U),1,10)_"; "
 W $$CTR^APCLCP1P(X),!
 S X="" I '$D(APCLCLN) S X="All Clinics"
 I $D(APCLCLN) S X="Clinics: " S Y=0 F  S Y=$O(APCLCLN(Y)) Q:Y'=+Y  S X=X_$E($P(^DIC(40.7,Y,0),U),1,10)_"; "
 W $$CTR^APCLCP1P(X),!
 Q