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

APCLCP9P.m

Go to the documentation of this file.
APCLCP9P ; IHS/CMI/LAB - print apc report by prov disc ;
 ;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
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,APCLNUM,APCLCNT)=0
 K APCLQUIT
 D HEAD,SUBHEAD
 F  S APCLNUM=$O(^XTMP("APCLCP9",APCLJOB,APCLBT,APCLSUF,"TOP TEN",APCLNUM)) Q:APCLNUM'=+APCLNUM!(APCLCNT=10)!($D(APCLQUIT))  D NUM
DONE ;
 D DONE^APCLOSUT
 K ^XTMP("APCLCP9",APCLJOB,APCLBT)
 Q
NUM ;
 S APCLCODE="" F  S APCLCODE=$O(^XTMP("APCLCP9",APCLJOB,APCLBT,APCLSUF,"TOP TEN",APCLNUM,APCLCODE)) Q:APCLCODE=""  D P
 Q
P ;
 I $Y>(IOSL-5) D HEAD,SUBHEAD Q:$D(APCLQUIT)
 S G=APCLGLOB_APCLCODE_")"
 I APCLGLOB="^ICD9(" W !,$E($P($$ICDDX^ICDEX(APCLCODE),U,4),1,26),?42,$J($S($D(^XTMP("APCLCP9",APCLJOB,APCLBT,APCLSUF,APCLCODE,"TOTAL")):^("TOTAL"),1:0),7) I 1
 E  W !,$E($P(@G@(0),U,APCLPIEC),1,26),?42,$J($S($D(^XTMP("APCLCP9",APCLJOB,APCLBT,APCLSUF,APCLCODE,"TOTAL")):^("TOTAL"),1:0),7)
 S APCLCNT=APCLCNT+1
 Q
SUBHEAD ;
 Q:$D(APCLQUIT)
 S APCLLENG=$L($P(^AUTTSU(APCLSU,0),U))
 W ?(80-(15+APCLLENG)/2),"SERVICE UNIT:  ",$P(^AUTTSU(APCLSUF,0),U),!
 W !,"PRIMARY DX",?38,"TOTAL PATIENT CONTACTS"
 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,!
 S APCLLENG=$L($P(^APCLACTG(APCLACTG,0),U))
 W ?(80-(46+APCLLENG)/2),"TOP TEN PRIMARY DX REPORT BY SERVICE UNIT ",$P(^APCLACTG(APCLACTG,0),U)," STAFF",!
 W ?18,"VISIT DATES:  ",APCLBDD,"  TO  ",APCLEDD,!
 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