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

BCHRP2P.m

Go to the documentation of this file.
BCHRP2P ; 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
 S (BCHATOT,BCHFTOT,BCHPTOT,BCHPG)=0
 D @("HEAD"_(2-($E(IOST,1,2)="C-")))
 K BCHQUIT
PROG ;
 S BCHPROG="" F  S BCHPROG=$O(^XTMP("BCHRP2",BCHJOB,BCHBTH,"RECORDS",BCHPROG)) Q:BCHPROG=""!($D(BCHQUIT))  D
 .S (BCHATOT("R"),BCHATOT("AT"),BCHATOT("P"))=0
 .I $Y>(IOSL-4) D HEAD Q:$D(BCHQUIT)
 .W !,"PROGRAM:  ",BCHPROG
 .D LOC
 .Q:$D(BCHQUIT)
 .I $Y>(IOSL-5) D HEAD Q:$D(BCHQUIT)
 .W !?50,"=======",?60,"=======",!
 .;W "PROGRAM TOTAL:",?50,$J(BCHATOT("R"),7),?60,$J(BCHATOT("AT"),7),!
 .W "PROGRAM TOTAL:",?50,$J(BCHATOT("R"),7),?60,$J((BCHATOT("AT")/60),7,1),!
DONE ;
 D DONE^BCHUTIL1
 K ^XTMP("BCHRP2",BCHJOB,BCHBTH),BCHJOB,BCHBTH
 Q
LOC ;
 S BCHLOC="" F  S BCHLOC=$O(^XTMP("BCHRP2",BCHJOB,BCHBTH,"RECORDS",BCHPROG,BCHLOC)) Q:BCHLOC=""!($D(BCHQUIT))  D
 .S (BCHLTOT("R"),BCHLTOT("AT"),BCHLTOT("P"))=0
 .I $Y>(IOSL-4) D HEAD Q:$D(BCHQUIT)
 .W !?10,"ACTIVITY LOCATION:  ",BCHLOC
 .D PROV
 .Q:$D(BCHQUIT)
 .I $Y>(IOSL-5) D HEAD Q:$D(BCHQUIT)
 .W !?50,"=======",?60,"=======",!
 .W ?10,"ACTIVITY LOCATION TOTAL:",?50,$J(BCHLTOT("R"),7),?60,$J((BCHLTOT("AT")/60),7,1),!
 Q
PROV ;
 S BCHPROV="" F  S BCHPROV=$O(^XTMP("BCHRP2",BCHJOB,BCHBTH,"RECORDS",BCHPROG,BCHLOC,BCHPROV)) Q:BCHPROV=""!($D(BCHQUIT))  D
 .S (BCHPTOT("R"),BCHPTOT("AT"),BCHPTOT("P"))=0
 .I $Y>(IOSL-4) D HEAD Q:$D(BCHQUIT)
 .W !?15,"PROVIDER:  ",BCHPROV
 .D ACT
 .Q:$D(BCHQUIT)
 .I $Y>(IOSL-5) D HEAD Q:$D(BCHQUIT)
 .W !?50,"=======",?60,"=======",!
 .W ?15,"PROVIDER TOTAL:",?50,$J(BCHPTOT("R"),7),?60,$J((BCHPTOT("AT")/60),7,1),!
 Q
ACT ;
 S BCHACT="" F  S BCHACT=$O(^XTMP("BCHRP2",BCHJOB,BCHBTH,"RECORDS",BCHPROG,BCHLOC,BCHPROV,BCHACT)) Q:BCHACT=""!($D(BCHQUIT))  D
 .I $Y>(IOSL-4) D HEAD Q:$D(BCHQUIT)
 .S BCHREC=$P(^XTMP("BCHRP2",BCHJOB,BCHBT,"RECORDS",BCHPROG,BCHLOC,BCHPROV,BCHACT),U),BCHAT=$P(^(BCHACT),U,2),BCHPAT=$P(^(BCHACT),U,3)
 .W !?20,$E(BCHACT,1,29),?50,$J(BCHREC,7),?60,$J((BCHAT/60),7,1)
 .S BCHATOT("R")=BCHATOT("R")+BCHREC,BCHLTOT("R")=BCHLTOT("R")+BCHREC,BCHPTOT("R")=BCHPTOT("R")+BCHREC
 .S BCHATOT("AT")=BCHATOT("AT")+BCHAT,BCHLTOT("AT")=BCHLTOT("AT")+BCHAT,BCHPTOT("AT")=BCHPTOT("AT")+BCHAT
 .S BCHATOT("P")=BCHATOT("P")+BCHPAT,BCHLTOT("P")=BCHLTOT("P")+BCHPAT,BCHPTOT("P")=BCHPTOT("P")+BCHPAT
 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 !?13,"********** CONFIDENTIAL PATIENT INFORMATION **********"
 W !?28,"CHR/PCC ACTIVITY REPORT"
 W !,$P(^VA(200,DUZ,0),U,2),?58,BCHDT,?72,"Page ",BCHPG,!
 W $$CTR^BCHRLU($$LOC^BCHRLU),!
 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 X=$L("PATIENTS:  "_BCHREGN)
 W ?((80-X)/2),"PATIENTS:  ",BCHREGN
 W !?17,"REPORT DATES:  ",BCHBDD,"  TO  ",BCHEDD,!
 W !?45,"# Activities",?60,"ACT TIME (hrs)"
 W !,$TR($J(" ",80)," ","-")
 Q