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

BCHRC1P.m

Go to the documentation of this file.
BCHRC1P ; 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
 K BCHQUIT S BCHPG=0
 S Y=BCHBD D DD^%DT S BCHBDD=Y S Y=BCHED D DD^%DT S BCHEDD=Y
 I '$D(^XTMP("BCHRC1",BCHJOB,BCHBTH,"DATA")) D HEAD W !!,"NO DATA TO REPORT",!! G DONE
HA ;
 D @("HEAD"_(2-($E(IOST,1,2)="C-")))
 ;set total numbers and print
 S BCHTOTS=($P(^XTMP("BCHRC1",BCHJOB,BCHBTH,"DATA","*TOTAL*"),U,2)/60),BCHTOTA=$P(^("*TOTAL*"),U),BCHTOTC=$P(^("*TOTAL*"),U,4),BCHTOTT=($P(^("*TOTAL*"),U,3)/60)
 I $Y>(IOSL-3) D HEAD G:$D(BCHQUIT) DONE
 W !?4,"TOTAL",?28,$J($FN(BCHTOTS,",",0),6),?35,"100%",?41,$J($FN(BCHTOTT,",",0),5),?47,"100%",?54,$J($FN(BCHTOTC,",",0),5),?60,"100%",?67,$J($FN(BCHTOTA,",",0),5),?73,"100%",!
 S BCHHA="*Z" F  S BCHHA=$O(^XTMP("BCHRC1",BCHJOB,BCHBTH,"DATA",BCHHA)) Q:BCHHA=""!($D(BCHQUIT))  D
 .S BCHCS=($P(^XTMP("BCHRC1",BCHJOB,BCHBTH,"DATA",BCHHA),U,2)/60),BCHCA=$P(^(BCHHA),U),BCHCC=$P(^(BCHHA),U,4),BCHCT=($P(^(BCHHA),U,3)/60)
 .I $Y>(IOSL-4) D HEAD Q:$D(BCHQUIT)
 .W !
 .I BCHSUB W !
 .W $P(BCHHA,"|",2),"  ",$E($P(BCHHA,"|"),1,22)
 .W ?29,$J(BCHCS,5,0) W ?35,$S(BCHTOTS:$J(((BCHCS/BCHTOTS)*100),3,0),1:$J("0",3,0)),"%"
 .W ?41,$J(BCHCT,5,0),?47,$S(BCHTOTT:$J(((BCHCT/BCHTOTT)*100),3,0),1:$J("0",3,0)),"%"
 .W ?54,$J(BCHCC,5),?60,$S(BCHTOTC:$J(((BCHCC/BCHTOTC)*100),3,0),1:$J("0",3,0)),"%"
 .W ?67,$J(BCHCA,5),?73,$S(BCHTOTA:$J(((BCHCA/BCHTOTA)*100),3,0),1:$J("0",3,0)),"%"
 .Q:'BCHSUB
 .W !
 .S BCHSUB1="" F  S BCHSUB1=$O(^XTMP("BCHRC1",BCHJOB,BCHBTH,"DATA",BCHHA,BCHSUB1)) Q:BCHSUB1=""!($D(BCHQUIT))  D
 ..S BCHCS=($P(^XTMP("BCHRC1",BCHJOB,BCHBTH,"DATA",BCHHA,BCHSUB1),U,2)/60),BCHCA=$P(^(BCHSUB1),U),BCHCC=$P(^(BCHSUB1),U,4),BCHCT=($P(^(BCHSUB1),U,3)/60)
 ..I $Y>(IOSL-4) D HEAD Q:$D(BCHQUIT)
 ..W !?2,$P(BCHSUB1,"|",2),"  ",$E($P(BCHSUB1,"|"),1,22)
 ..W ?29,$J(BCHCS,5,0) W ?35,$S(BCHTOTS:$J(((BCHCS/BCHTOTS)*100),3,0),1:$J("0",3,0)),"%"
 ..W ?41,$J(BCHCT,5,0),?47,$S(BCHTOTT:$J(((BCHCT/BCHTOTT)*100),3,0),1:$J("0",3,0)),"%"
 ..W ?54,$J(BCHCC,5),?60,$S(BCHTOTC:$J(((BCHCC/BCHTOTC)*100),3,0),1:$J("0",3,0)),"%"
 ..W ?67,$J(BCHCA,5),?73,$S(BCHTOTA:$J(((BCHCA/BCHTOTA)*100),3,0),1:$J("0",3,0)),"%"
 ..Q
DONE ;
 D DONE^BCHUTIL1
 K ^XTMP("BCHRC1",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 ;
 W:$D(IOF) @IOF
HEAD2 ;
 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. ",BCHRPT,"  **********"
 W !?((80-($L(BCHCH)+47))/2),"TIME SPENT, ",$S(BCHRPT=3:"# SERVED",1:"SERVICE ACTIVITIES"),", AND SERVICES by ",BCHCH
 S BCHPROGN=$S(BCHPRG:$P(^BCHTPROG(BCHPRG,0),U)_" ("_$P(^(0),U,5)_")",1:"ALL"),X=$L(BCHPROGN)+10
 W !!?((80-X)/2),"PROGRAM:  ",BCHPROGN
 S BCHPROVN=$S(BCHPROVT="O":$P(^VA(200,BCHCHR1,0),U),1:"ALL"),X=$L(BCHPROGN)+10
 W !?((80-X)/2),"PROVIDER:  ",BCHPROVN
 S X=$L("PATIENTS:  "_BCHREGN)
 W !?((80-X)/2),"PATIENTS:  ",BCHREGN
 W !?17,"REPORT DATES:  ",BCHBDD,"  TO  ",BCHEDD,!
 W !,"* SERVICES is equal to # of Lines of Assessment"
 W !!?3,BCHCH,?31,"SERVICE",?44,"TRAVEL",?56,$S(BCHRPT=3:"NUMBER",1:"SERVICE"),?69,"SERVICES*"
 W !?31,"HOURS",?44,"HOURS",?56,$S(BCHRPT=3:"SERVED",1:"ACTIVITIES")
 W !,$TR($J(" ",80)," ","-")
 Q