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

BCHRP3P.m

Go to the documentation of this file.
BCHRP3P ; 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,BCHACTOT,BCHSTOT,BCHFTOT,BCHPTOT,BCHPG)=0
 D @("HEAD"_(2-($E(IOST,1,2)="C-")))
 K BCHQUIT
PROG ;
 S BCHPROG="" F  S BCHPROG=$O(^XTMP("BCHRP3",BCHJOB,BCHBTH,"RECORDS",BCHPROG)) Q:BCHPROG=""!($D(BCHQUIT))  D
 .S (BCHATOT("R"),BCHATOT("AT"))=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 !?59,"=======",?67,"=======",!
 .W "PROGRAM TOTAL:",?59,$J(BCHATOT("R"),7),?67,$J((BCHATOT("AT")/60),7,1),!
DONE ;
 D DONE^BCHUTIL1
 K ^XTMP("BCHRP3",BCHJOB,BCHBTH)
 Q
LOC ;
 S BCHLOC="" F  S BCHLOC=$O(^XTMP("BCHRP3",BCHJOB,BCHBTH,"RECORDS",BCHPROG,BCHLOC)) Q:BCHLOC=""!($D(BCHQUIT))  D
 .S (BCHLTOT("R"),BCHLTOT("AT"))=0
 .I $Y>(IOSL-4) D HEAD Q:$D(BCHQUIT)
 .W !?4,"ACTIVITY LOCATION:  ",BCHLOC
 .D PROV
 .Q:$D(BCHQUIT)
 .I $Y>(IOSL-5) D HEAD Q:$D(BCHQUIT)
 .W !?59,"=======",?67,"=======",!
 .W ?4,"ACTIVITY LOCATION TOTAL:",?59,$J(BCHLTOT("R"),7),?67,$J((BCHLTOT("AT")/60),7,1),!
 Q
PROV ;
 S BCHPROV="" F  S BCHPROV=$O(^XTMP("BCHRP3",BCHJOB,BCHBTH,"RECORDS",BCHPROG,BCHLOC,BCHPROV)) Q:BCHPROV=""!($D(BCHQUIT))  D
 .S (BCHPTOT("R"),BCHPTOT("AT"))=0
 .I $Y>(IOSL-4) D HEAD Q:$D(BCHQUIT)
 .W !?11,"CHR:  ",BCHPROV
 .D ACT
 .Q:$D(BCHQUIT)
 .I $Y>(IOSL-5) D HEAD Q:$D(BCHQUIT)
 .W !?59,"=======",?67,"=======",!
 .W ?11,"PROVIDER TOTAL:",?59,$J(BCHPTOT("R"),7),?67,$J((BCHPTOT("AT")/60),7,1),!
 Q
ACT ;
 S BCHACT="" F  S BCHACT=$O(^XTMP("BCHRP3",BCHJOB,BCHBTH,"RECORDS",BCHPROG,BCHLOC,BCHPROV,BCHACT)) Q:BCHACT=""!($D(BCHQUIT))  D
 .S (BCHACTOT("R"),BCHACTOT("AT"))=0
 .I $Y>(IOSL-4) D HEAD Q:$D(BCHQUIT)
 .W !?17,"ACTIVITY:  ",$E(BCHACT,1,28)
 .D PROB
 .Q:$D(BCHQUIT)
 .I $Y>(IOSL-5) D HEAD Q:$D(BCHQUIT)
 .W !?59,"=======",?67,"=======",!
 .W ?17,"ACTIVITY TOTAL:",?59,$J(BCHACTOT("R"),7),?67,$J((BCHACTOT("AT")/60),7,1),!
 Q
PROB ;
 S BCHPROB="" F  S BCHPROB=$O(^XTMP("BCHRP3",BCHJOB,BCHBTH,"RECORDS",BCHPROG,BCHLOC,BCHPROV,BCHACT,BCHPROB)) Q:BCHPROB=""!($D(BCHQUIT))  D
 .I $Y>(IOSL-4) D HEAD Q:$D(BCHQUIT)
 .S BCHREC=$P(^XTMP("BCHRP3",BCHJOB,BCHBT,"RECORDS",BCHPROG,BCHLOC,BCHPROV,BCHACT,BCHPROB),U),BCHAT=$P(^(BCHPROB),U,2),BCHPAT=$P(^(BCHPROB),U,3)
 .W !?22,"PROBLEM:",?32,$E(BCHPROB,1,30),?59,$J(BCHREC,7),?67,$J((BCHAT/60),7,1)
 .S BCHATOT("R")=BCHATOT("R")+BCHREC,BCHLTOT("R")=BCHLTOT("R")+BCHREC,BCHPTOT("R")=BCHPTOT("R")+BCHREC,BCHACTOT("R")=BCHACTOT("R")+BCHREC
 .S BCHATOT("AT")=BCHATOT("AT")+BCHAT,BCHLTOT("AT")=BCHLTOT("AT")+BCHAT,BCHPTOT("AT")=BCHPTOT("AT")+BCHAT,BCHACTOT("AT")=BCHACTOT("AT")+BCHAT
 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 !,$P(^VA(200,DUZ,0),U,2),?33,BCHDT,?70,"Page ",BCHPG,!
 W $$CTR^BCHRLU($$LOC^BCHRLU),!
 W ?24,"ACTIVITY REPORT BY HEALTH PROBLEM",!
 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 !?52,"# Activities",?66,"ACT TIME (hrs)",!
 W !,$TR($J(" ",80)," ","-")
 Q