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

BCHRAP2P.m

Go to the documentation of this file.
BCHRAP2P ; IHS/CMI/LAB - print all visit report ; 
 ;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
 ;IHS/CMI/LAB - tmp to xtmp
 ;
 ;Print routine.
 ;
PRINT ;
 D NOW^%DTC S Y=X D DD^%DT S BCHDT=Y
 S Y=BCHBD D DD^%DT S BCHBDD=Y S Y=BCHED D DD^%DT S BCHEDD=Y
 D COVPAGE^BCHRPTCP
 S (BCHTOT,BCHPG,BCHPTOT,BCHTTOT)=0 D HEAD
 K BCHQUIT
 D SORT
 G:$D(BCHQUIT) DONE
 I $Y>(IOSL-5) D HEAD G:$D(BCHQUIT) DONE
 W !?47,"--------",?56,"--------",?68,"--------",!
 W ?32,"Totals:",?45,$J(BCHTOT,8),?54,$J(BCHPTOT,8) S X=BCHTTOT,X=$J((X/60),6,1) W ?66,$J(X,8)
DONE ;
 D DONE^BCHUTIL1
 K ^XTMP("BCHRAP2",BCHJOB,BCHBTH)
 K BCHBT,BCHET
 Q
SORT ;
 I $Y>(IOSL-6) D HEAD Q:$D(BCHQUIT)
 S BCHSORT="" F  S BCHSORT=$O(^XTMP("BCHRAP2",BCHJOB,BCHBTH,"TOTAL",BCHSORT)) Q:BCHSORT=""!($D(BCHQUIT))  D P
 Q
P ;
 I $Y>(IOSL-5) D HEAD Q:$D(BCHQUIT)
 S BCHSRT2=$O(^XTMP("BCHRAP2",BCHJOB,BCHBTH,"TOTAL",BCHSORT,""))
 S BCHPRNT=BCHSORT I BCHRPROC="DATE" S Y=BCHPRNT D DD^%DT S BCHPRNT=Y
 W !,$E(BCHPRNT,1,25) W ?28,$E(BCHSRT2,1,15),?45,$J(^XTMP("BCHRAP2",BCHJOB,BCHBTH,"TOTAL",BCHSORT,BCHSRT2),8)
 W ?54,$S($D(^XTMP("BCHRAP2",BCHJOB,BCHBTH,"PATIENT",BCHSORT,BCHSRT2)):$J(^XTMP("BCHRAP2",BCHJOB,BCHBTH,"PATIENT",BCHSORT,BCHSRT2),8),1:$J(0,8))
 I $D(^XTMP("BCHRAP2",BCHJOB,BCHBTH,"TIME TOTAL",BCHSORT,BCHSRT2)) S X=^(BCHSRT2),X=$J((X/60),1,1) W ?66,$J(X,8)
 S BCHTOT=BCHTOT+^XTMP("BCHRAP2",BCHJOB,BCHBTH,"TOTAL",BCHSORT,BCHSRT2)
 S BCHPTOT=BCHPTOT+$S($D(^XTMP("BCHRAP2",BCHJOB,BCHBTH,"PATIENT",BCHSORT,BCHSRT2)):^(BCHSRT2),1:0)
 S BCHTTOT=BCHTTOT+$S($D(^XTMP("BCHRAP2",BCHJOB,BCHBTH,"TIME TOTAL",BCHSORT,BCHSRT2)):^(BCHSRT2),1:0)
 Q
 I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S BCHQUIT="" Q
HEAD1 ;
 W:$D(IOF) @IOF S BCHPG=BCHPG+1
 W !
 W ?58,BCHDT,?72,"Page ",BCHPG,!
 W $$CTR^BCHRLU($$LOC^BCHRLU),!
 W ?17,"RECORD DATES:  ",BCHBDD,"  TO  ",BCHEDD,!
 S BCHLENG=30+$L(BCHTITL)
 W ?((80-BCHLENG)/2),"NUMBER OF ACTIVITY RECORDS BY ",BCHTITL,!
 W !,BCHHD1,?28,$E(BCHHD2,1,13),?47,"# PCC",?56,"# SERVED",?65,"ACTIVITY TIME",!,?47,"FORMS",?67,"(hrs)",!
 W !,$TR($J(" ",80)," ","-")
 Q