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

BCHRC8P.m

Go to the documentation of this file.
BCHRC8P ; IHS/CMI/LAB - print all visit report ; 
 ;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
 ;IHS/CMI/LAB - tmp to xtmp
START ;
 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
 I '$D(^XTMP("BCHRC8",BCHJOB,BCHBTH)) S BCHNONE="",BCHPG=0 D HEAD W !!,"NO DATA TO REPORT",!! G DONE
 K BCHQUIT S BCHPG=0
 ;
PROG ; process for each program, monthly numbers
 S BCHPROG=0 F  S BCHPROG=$O(^XTMP("BCHRC8",BCHJOB,BCHBT,BCHPROG)) Q:BCHPROG'=+BCHPROG!($D(BCHQUIT))  D  Q:$D(BCHQUIT)
 . D @("HEAD"_(2-($E(IOST,1,2)="C-")))
 . Q:$D(BCHQUIT)
 .S M="" F  S M=$O(^XTMP("BCHRC8",BCHJOB,BCHBT,BCHPROG,"MONTHS",M)) Q:M'=+M!($D(BCHQUIT))  D  Q:$D(BCHQUIT)
 ..  I $Y>(IOSL-4) D EOP Q:$D(BCHQUIT)
 ..; I $Y>(IOSL-4) D HEAD Q:$D(BCHQUIT)
 ..  S R=$O(^XTMP("BCHRC8",BCHJOB,BCHBT,BCHPROG,"MONTHS",M,""))
 ..  W !?3,R F I=1:1:3 S V=$P(^XTMP("BCHRC8",BCHJOB,BCHBT,BCHPROG,"MONTHS",M,R),U,I),V=V/60 W ?(I*20),$J($FN(V,",",0),10)
 ..  Q
 .  Q:$D(BCHQUIT)
 .  D:$O(^XTMP("BCHRC8",BCHJOB,BCHBT,BCHPROG))'="" EOP
 .  Q
DONE ;
 D DONE^BCHUTIL1
 K ^XTMP("BCHRC8",BCHJOB,BCHBTH),BCHJOB,BCHBTH
 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 ; if terminal
 W:$D(IOF) @IOF
HEAD2 ; if printer
 S BCHPG=BCHPG+1
 W !,$P(^VA(200,DUZ,0),U,2),?58,BCHDT,?72,"Page ",BCHPG,!
 W $$CTR^BCHRLU($$LOC^BCHRLU),!
 W !?20,"**********  CHR REPORT NO. ",BCHRN,"  **********"
 W !!?17,"HOURS (SERVICE+TRAVEL) BY MONTH AND ",BCHCH
 I BCHRPT="PR" S BCHPROGN=$S(BCHPRG:$P(^BCHTPROG(BCHPRG,0),U)_" ("_$P(^(0),U,5)_")",1:"ALL"),X=$L(BCHPROGN)+10
 I BCHRPT="PR" W !?((80-X)/2),"PROGRAM:  ",BCHPROGN
 D @BCHRPT
 S X=$L("PATIENTS:  "_BCHREGN)
 W !?((80-X)/2),"PATIENTS:  ",BCHREGN
 W !?17,"REPORT DATES:  ",BCHBDD,"  TO  ",BCHEDD,!
 W !,"MONTH/YEAR",?20,"TOTAL HOURS",?40,"SERVICE HOURS",?60,"TRAVEL HOURS"
 W !,$TR($J(" ",80)," ","-")
 Q
PG ;
 Q:$D(BCHNONE)
 S BCHPROGN=$P(^BCHTPROG(BCHPROG,0),U)_" ("_$P(^(0),U,5)_")",X=$L(BCHPROGN)+10
 W !!?((80-X)/2),"PROGRAM:  ",BCHPROGN
 Q
PR ;
 Q:$D(BCHNONE)
 S BCHNAME=$P(^VA(200,BCHPROG,0),U),X=$L(BCHNAME)+11 W !!?((80-X)/2),"PROVIDER:  ",$P(^VA(200,BCHPROG,0),U)
 Q
 ;
EOP ; pause OR form feed between pages of report for terminal/printer
 I $E(IOST,1,2)="P-"!($D(IO("S"))) W @IOF Q
 W ! S DIR(0)="EO" D ^DIR K DIR S:$D(DUOUT) (DIRUT,BCHQUIT)=1
 Q