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

APCLCP8P.m

Go to the documentation of this file.
APCLCP8P ; IHS/CMI/LAB - print apc report by prov disc ; 11 Apr 2013  10:34 AM
 ;;2.0;IHS PCC SUITE;**10**;MAY 14, 2009;Build 88
 ;IHS/CMI/LAB changed minutes to hours in print
START ;
 S APCL80S="-------------------------------------------------------------------------------"
 S Y=APCLBD D DD^%DT S APCLBDD=Y S Y=APCLED D DD^%DT S APCLEDD=Y
 S (APCLPG,APCLSEX)=0
 K APCLQUIT
 F  S APCLSEX=$O(^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX)) Q:APCLSEX=""!($D(APCLQUIT))  D LOC
DONE ;
 D DONE^APCLOSUT
 K ^XTMP("APCLCP8",APCLJOB,APCLBT)
 Q
LOC ;
 D HEAD,SUBHEAD Q:$D(APCLQUIT)
 S ^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"ACT")=0
 S ^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"TT")=0
 S ^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"PRIM")=0
 S ^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"SEC")=0
 S ^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"TOTAL")=0
 S APCLAGE="" F  S APCLAGE=$O(^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX,APCLAGE)) Q:APCLAGE=""!($D(APCLQUIT))  D P
 W !!?10,"TOTAL:"
 W ?28,$J($S($D(^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"TOTAL")):^("TOTAL"),1:"."),7)
 W ?38,$J($S($D(^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"PRIM")):^("PRIM"),1:"."),7)
 W ?48,$J($S($D(^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"SEC")):^("SEC"),1:"."),7)
 W ?58,$J($S($D(^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"ACT")):^("ACT")/60,1:"."),7,2) ;IHS/CMI/LAB minutes to hours
 W ?68,$J($S($D(^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"TT")):^("TT")/60,1:"."),7,2) ;IHS/CMI/LAB - minutes to hours
 I $D(^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX,"NOACT")) W !!,"* -- ",^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX,"NOACT")," of the visits did not have an activity time recorded."
 D NOTE
 Q
P ;
 S:$D(^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX,APCLAGE,"ACT")) ^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"ACT")=^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"ACT")+^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX,APCLAGE,"ACT")
 S:$D(^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX,APCLAGE,"TT")) ^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"TT")=^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"TT")+^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX,APCLAGE,"TT")
 S:$D(^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX,APCLAGE,"PRIM")) ^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"PRIM")=^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"PRIM")+^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX,APCLAGE,"PRIM")
 S:$D(^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX,APCLAGE,"SEC")) ^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"SEC")=^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"SEC")+^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX,APCLAGE,"SEC")
 I $D(^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX,APCLAGE,"TOTAL")) D
 .S ^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"TOTAL")=^XTMP("APCLCP8",APCLJOB,APCLBT,"SUBTOTAL",APCLSEX,"TOTAL")+^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX,APCLAGE,"TOTAL")
 I $Y>(IOSL-5) D HEAD,SUBHEAD Q:$D(APCLQUIT)
 W !,$P(APCLBIN,";",APCLAGE)," years",?28,$J($S($D(^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX,APCLAGE,"TOTAL")):^("TOTAL"),1:"."),7)
 W ?38,$J($S($D(^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX,APCLAGE,"PRIM")):^("PRIM"),1:"."),7)
 W ?48,$J($S($D(^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX,APCLAGE,"SEC")):^("SEC"),1:"."),7)
 W ?58,$J($S($D(^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX,APCLAGE,"ACT")):^("ACT")/60,1:"."),7,2) ;IHS/CMI/LAB - minutes to hours
 W ?68,$J($S($D(^XTMP("APCLCP8",APCLJOB,APCLBT,"SEX",APCLSEX,APCLAGE,"TT")):^("TT")/60,1:"."),7,2) ;IHS/CMI/LAB - minutes to hours
 Q
SUBHEAD ;
 Q:$D(APCLQUIT)
 S APCLLENG=$L($S(APCLSEX="F":"FEMALE",APCLSEX="U":"UNKNOWN",1:"MALE"))
 W ?(80-(6+APCLLENG)/2),"SEX:  ",$S(APCLSEX="F":"FEMALE",APCLSEX="U":"UNKNOWN",1:"MALE")
 W !!?28,"TOTAL",?38,"# CONTS",?48,"# CONTS"
 W !?28,"PATIENT",?38,"AS PRIM.",?48,"AS SEC.",?58,"ACTIVITY",?69,"TRAVEL"
 W !,"AGE GROUP",?28,"CONTACTS",?38,"PROVIDER",?48,"PROVIDER",?58,"TIME*",?69,"TIME"
 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-(44+$L($P(^APCLACTG(APCLACTG,0),U)))/2),"TIME AND SERVICES REPORT BY AGE AND SEX FOR ",$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
NOTE ;
 I $Y>(IOSL-6) D HEAD Q:$D(APCLQUIT)
 D NOTE2^APCLCPUT
 Q