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.
  1. BCHRP2P ; IHS/CMI/LAB - print all visit report ;
  1. ;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
  1. ;IHS/CMI/LAB - tmp to xtmp
  1. START ;
  1. D NOW^%DTC S Y=X D DD^%DT S BCHDT=Y
  1. S Y=BCHBD D DD^%DT S BCHBDD=Y S Y=BCHED D DD^%DT S BCHEDD=Y
  1. S (BCHATOT,BCHFTOT,BCHPTOT,BCHPG)=0
  1. D @("HEAD"_(2-($E(IOST,1,2)="C-")))
  1. K BCHQUIT
  1. PROG ;
  1. S BCHPROG="" F S BCHPROG=$O(^XTMP("BCHRP2",BCHJOB,BCHBTH,"RECORDS",BCHPROG)) Q:BCHPROG=""!($D(BCHQUIT)) D
  1. .S (BCHATOT("R"),BCHATOT("AT"),BCHATOT("P"))=0
  1. .I $Y>(IOSL-4) D HEAD Q:$D(BCHQUIT)
  1. .W !,"PROGRAM: ",BCHPROG
  1. .D LOC
  1. .Q:$D(BCHQUIT)
  1. .I $Y>(IOSL-5) D HEAD Q:$D(BCHQUIT)
  1. .W !?50,"=======",?60,"=======",!
  1. .;W "PROGRAM TOTAL:",?50,$J(BCHATOT("R"),7),?60,$J(BCHATOT("AT"),7),!
  1. .W "PROGRAM TOTAL:",?50,$J(BCHATOT("R"),7),?60,$J((BCHATOT("AT")/60),7,1),!
  1. DONE ;
  1. D DONE^BCHUTIL1
  1. K ^XTMP("BCHRP2",BCHJOB,BCHBTH),BCHJOB,BCHBTH
  1. Q
  1. LOC ;
  1. S BCHLOC="" F S BCHLOC=$O(^XTMP("BCHRP2",BCHJOB,BCHBTH,"RECORDS",BCHPROG,BCHLOC)) Q:BCHLOC=""!($D(BCHQUIT)) D
  1. .S (BCHLTOT("R"),BCHLTOT("AT"),BCHLTOT("P"))=0
  1. .I $Y>(IOSL-4) D HEAD Q:$D(BCHQUIT)
  1. .W !?10,"ACTIVITY LOCATION: ",BCHLOC
  1. .D PROV
  1. .Q:$D(BCHQUIT)
  1. .I $Y>(IOSL-5) D HEAD Q:$D(BCHQUIT)
  1. .W !?50,"=======",?60,"=======",!
  1. .W ?10,"ACTIVITY LOCATION TOTAL:",?50,$J(BCHLTOT("R"),7),?60,$J((BCHLTOT("AT")/60),7,1),!
  1. Q
  1. PROV ;
  1. S BCHPROV="" F S BCHPROV=$O(^XTMP("BCHRP2",BCHJOB,BCHBTH,"RECORDS",BCHPROG,BCHLOC,BCHPROV)) Q:BCHPROV=""!($D(BCHQUIT)) D
  1. .S (BCHPTOT("R"),BCHPTOT("AT"),BCHPTOT("P"))=0
  1. .I $Y>(IOSL-4) D HEAD Q:$D(BCHQUIT)
  1. .W !?15,"PROVIDER: ",BCHPROV
  1. .D ACT
  1. .Q:$D(BCHQUIT)
  1. .I $Y>(IOSL-5) D HEAD Q:$D(BCHQUIT)
  1. .W !?50,"=======",?60,"=======",!
  1. .W ?15,"PROVIDER TOTAL:",?50,$J(BCHPTOT("R"),7),?60,$J((BCHPTOT("AT")/60),7,1),!
  1. Q
  1. ACT ;
  1. S BCHACT="" F S BCHACT=$O(^XTMP("BCHRP2",BCHJOB,BCHBTH,"RECORDS",BCHPROG,BCHLOC,BCHPROV,BCHACT)) Q:BCHACT=""!($D(BCHQUIT)) D
  1. .I $Y>(IOSL-4) D HEAD Q:$D(BCHQUIT)
  1. .S BCHREC=$P(^XTMP("BCHRP2",BCHJOB,BCHBT,"RECORDS",BCHPROG,BCHLOC,BCHPROV,BCHACT),U),BCHAT=$P(^(BCHACT),U,2),BCHPAT=$P(^(BCHACT),U,3)
  1. .W !?20,$E(BCHACT,1,29),?50,$J(BCHREC,7),?60,$J((BCHAT/60),7,1)
  1. .S BCHATOT("R")=BCHATOT("R")+BCHREC,BCHLTOT("R")=BCHLTOT("R")+BCHREC,BCHPTOT("R")=BCHPTOT("R")+BCHREC
  1. .S BCHATOT("AT")=BCHATOT("AT")+BCHAT,BCHLTOT("AT")=BCHLTOT("AT")+BCHAT,BCHPTOT("AT")=BCHPTOT("AT")+BCHAT
  1. .S BCHATOT("P")=BCHATOT("P")+BCHPAT,BCHLTOT("P")=BCHLTOT("P")+BCHPAT,BCHPTOT("P")=BCHPTOT("P")+BCHPAT
  1. Q
  1. 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
  1. HEAD1 ; if terminal
  1. W:$D(IOF) @IOF
  1. HEAD2 ; if printer
  1. S BCHPG=BCHPG+1
  1. W !?13,"********** CONFIDENTIAL PATIENT INFORMATION **********"
  1. W !?28,"CHR/PCC ACTIVITY REPORT"
  1. W !,$P(^VA(200,DUZ,0),U,2),?58,BCHDT,?72,"Page ",BCHPG,!
  1. W $$CTR^BCHRLU($$LOC^BCHRLU),!
  1. S BCHPROGN=$S(BCHPRG:$P(^BCHTPROG(BCHPRG,0),U)_" ("_$P(^(0),U,5)_")",1:"ALL"),X=$L(BCHPROGN)+10
  1. W ?((80-X)/2),"PROGRAM: ",BCHPROGN,!
  1. S X=$L("PATIENTS: "_BCHREGN)
  1. W ?((80-X)/2),"PATIENTS: ",BCHREGN
  1. W !?17,"REPORT DATES: ",BCHBDD," TO ",BCHEDD,!
  1. W !?45,"# Activities",?60,"ACT TIME (hrs)"
  1. W !,$TR($J(" ",80)," ","-")
  1. Q