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

APCLAP5P.m

Go to the documentation of this file.
APCLAP5P ; IHS/CMI/LAB - PRINT CLINIC VISITS ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;IHS/CMI/LAB - Y2K
 ;
INIT ;
 S APCLDT=$$FMTE^XLFDT(DT)
 S Y=APCLBD D DD^%DT S APCLBDD=Y S Y=APCLED D DD^%DT S APCLEDD=Y
 S APCLPG=0
 I '$D(^XTMP("APCLAP5",APCLJOB,APCLBTH)) D HEAD W !,"No visits to report."  G END
 ;
SET ;
 D HEAD
 S APCLVD=0
 F  S APCLVD=$O(^XTMP("APCLAP5",APCLJOB,APCLBTH,APCLVD)) Q:APCLVD=""!($D(APCLQUIT))  D SET2
END ;
 D DONE^APCLOSUT
 K ^XTMP("APCLAP5",APCLJOB,APCLBTH)
 Q
SET2 ;
 I $Y>(IOSL-5) D HEAD Q:$D(APCLQUIT)
 ;begin Y2K
 ;W !,$E(APCLVD,4,5),"/",$E(APCLVD,6,7),"/",$E(APCLVD,2,3) ;Y2000
 W !,$E(APCLVD,4,5),"/",$E(APCLVD,6,7),"/",(1700+($E(APCLVD,1,3))) ;Y2000
 ;end Y2K
 S J=12,APCLX=0
 I $D(APCLCLNT) F  S APCLX=$O(APCLCLNT(APCLX)) Q:APCLX'=+APCLX  D PRINT
 I $D(APCLLOCT) F  S APCLX=$O(APCLLOCT(APCLX)) Q:APCLX'=+APCLX  D PRINT
 Q
 ;
PRINT ;
 S Y=$S($D(^XTMP("APCLAP5",APCLJOB,APCLBTH,APCLVD,APCLX)):^(APCLX),1:0)
 W ?J,$J(Y,7) S J=J+10
 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 !
 S X=$P(^DIC(4,DUZ(2),0),U)
 W !!,$P(^VA(200,DUZ,0),"^",2),?(80-$L(X)/2),X,?70,"Page ",APCLPG
 W !?13,"PRIMARY CARE PROVIDER VISITS - PRIMARY PROVIDER ONLY"
 W !?18,"VISITS DATES:  ",APCLBDD,"  TO  ",APCLEDD
 I $D(APCLCLNT) D
 .S APCLL=$S(APCLLOC="":"ALL",1:"SELECTED")
 .S APCLLENG=21+$L(APCLL)
 .W !?((80-APCLLENG)/2),"LOCATION OF VISITS:  ",APCLL
 W !!?2,"DATE"
 I $D(APCLCLNT) S X=0,J=12 F  S X=$O(APCLCLNT(X)) Q:X'=+X  W ?J,$E($P(^DIC(40.7,X,0),U),1,8) S J=J+10
 I $D(APCLLOCT) S X=0,J=12 F  S X=$O(APCLLOCT(X)) Q:X'=+X  W ?J,$E($P(^DIC(4,X,0),U),1,8) S J=J+10
 W ! S X=$S(J>75:132,1:80) W $TR($J("",X)," ","-")
 W !
 Q
 ;