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

APCLAP3P.m

Go to the documentation of this file.
APCLAP3P ; IHS/CMI/LAB - print visits by prov ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
START ;
 S APCL80S="-------------------------------------------------------------------------------"
 S Y=APCLED D DD^%DT S APCLEDD=Y
 D NOW^%DTC S Y=X D DD^%DT S APCLDT=Y
 S (APCLTOT,APCLPG)=0 D HEAD
 S (APCLTOT,APCLPOS)=0 K APCLQUIT
 F  S APCLPOS=$O(^XTMP("APCLAP3",APCLJOB,APCLBTH,APCLPOS)) Q:APCLPOS=""!($D(APCLQUIT))  D P
 G:$D(APCLQUIT) DONE
 I $Y>(IOSL-5) D HEAD G:$D(APCLQUIT) DONE
 W !!?53,"-------",!
 W ?15,"Total Number of Provider Contacts:",?53,$J(APCLTOT,6),!
DONE ;
 D DONE^APCLOSUT
 K ^XTMP("APCLAP3",APCLJOB,APCLBTH)
 Q
P ;
 I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
 W !!,"Provider ",$S(APCLPSRT="D":"Discipline",APCLPSRT="A":"Discipline",1:"of Service"),":  "
 W $S(APCLPSRT="D":$P(^DIC(7,APCLPOS,0),U),APCLPSRT="A":$P(^DIC(7,APCLPOS,0),U),1:$S($P(^DD(9000010.06,.01,0),U,2)[200:$P(^VA(200,APCLPOS,0),U),1:$P(^DIC(16,APCLPOS,0),U)))
 I APCLPSRT'="D",APCLPSRT'="A" W "  [",$$VAL^XBDIQ1(200,APCLPOS,53.5),"]"
 S APCLVLOC=0 F  S APCLVLOC=$O(^XTMP("APCLAP3",APCLJOB,APCLBTH,APCLPOS,APCLVLOC)) Q:APCLVLOC'=+APCLVLOC!($D(APCLQUIT))  D
 . W !?5,$P(^DIC(4,APCLVLOC,0),U)
 . S APCLCAT="" F  S APCLCAT=$O(^XTMP("APCLAP3",APCLJOB,APCLBTH,APCLPOS,APCLVLOC,APCLCAT)) Q:APCLCAT=""!($D(APCLQUIT))  D
 .. I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
 .. W !?10,APCLCAT,?53,$J(^XTMP("APCLAP3",APCLJOB,APCLBTH,APCLPOS,APCLVLOC,APCLCAT),6)
 Q:$D(APCLQUIT)
 I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
 W !?53,"------",!?40,"Subtotal: ",?53,$J(^XTMP("APCLAP3",APCLJOB,APCLBTH,APCLPOS,"TOTAL"),6)
 S APCLTOT=APCLTOT+^XTMP("APCLAP3",APCLJOB,APCLBTH,APCLPOS,"TOTAL")
 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 ?58,APCLDT,?72,"Page ",APCLPG,!
 W !?9,"NUMBER OF CONTACTS BY PROVIDER, LOCATION AND SERVICE CATEGORY"
 S APCLLOCT=$S(APCLLOC=0:"ALL",1:"SELECTED")
 S APCLPROT=$S(APCLPSRT="D":"PROVIDER DISCIPLINE:  ",APCLPSRT="A":"PROVIDER DISCIPLINE:  ",1:"PROVIDER OF SERVICE:  ")
 S APCLPROS=$S(APCLPSRT="D":$P(^DIC(7,APCLDISC,0),U),APCLPSRT="P":"ALL",APCLPSRT="A":"ALL",1:$S($P(^DD(9000010.06,.01,0),U,2)[200:$P(^VA(200,APCLPROV,0),U),1:$P(^DIC(16,APCLPROV,0),U)))
 S APCLLENG=21+$L(APCLLOCT)
 W !?((80-APCLLENG)/2),"LOCATION OF VISITS:  ",APCLLOCT,!
 S APCLLENG=$L(APCLPROT)+$L(APCLPROS)
 W ?((80-APCLLENG)/2),APCLPROT,APCLPROS,!
 S APCLTAB=$S(APCLPRIM:29,1:20),APCLTEXT=$S(APCLPRIM:"PRIMARY PROVIDER ONLY",1:"PRIMARY AND SECONDARY PROVIDERS INCLUDED")
 W ?APCLTAB,APCLTEXT,!
 W ?18,"VISIT DATES:  ",APCLBDD,"  TO  ",APCLEDD,!
 W !?5,"LOCATION OF VISIT"
 W !?10,"SERVICE CATEGORY",?50,"# PROVIDER CONTACTS",!
 W APCL80S
 Q