1 | HBHCRP10 ; LR VAMC(IRMS)/MJT-HBHC report on file 631, All active (admitted but not discharged) cases by date range, sorted by patient name, includes: patient name, Last Four, admission date, & total ; 12/21/05 3:31pm
|
---|
2 | ;;1.0;HOSPITAL BASED HOME CARE;**6,22**;NOV 01, 1993;Build 2
|
---|
3 | D START^HBHCUTL
|
---|
4 | G:(HBHCBEG1=-1)!(HBHCEND1=-1) EXIT
|
---|
5 | S %ZIS="Q",HBHCCC=0 K IOP,ZTIO,ZTSAVE D ^%ZIS G:POP EXIT
|
---|
6 | I $D(IO("Q")) S ZTRTN="DQ^HBHCRP10",ZTDESC="HBPC Program Census Report",ZTSAVE("HBHC*")="" D ^%ZTLOAD G EXIT
|
---|
7 | DQ ; De-queue
|
---|
8 | U IO
|
---|
9 | K ^TMP("HBHC",$J)
|
---|
10 | S HBHCTOT=0,$P(HBHCY,"-",81)="",HBHCHEAD="Program Census",HBHCHDR="W !,""Patient Name"",?43,""Last Four"",?68,""Date""",HBHCCOLM=(80-(30+$L(HBHCHEAD))\2) S:HBHCCOLM'>0 HBHCCOLM=1
|
---|
11 | D TODAY^HBHCUTL D:IO'=IO(0)!($D(IO("S"))) HDRRANGE^HBHCUTL
|
---|
12 | I '$D(IO("S")),(IO=IO(0)) S HBHCCC=HBHCCC+1 D HDRRANGE^HBHCUTL
|
---|
13 | LOOP ; Loop thru ^HBHC(631) "AD" (admission date) cross-ref to build report
|
---|
14 | S X1=HBHCBEG1,X2=-1 D C^%DTC S HBHCADDT=X
|
---|
15 | F S HBHCADDT=$O(^HBHC(631,"AD",HBHCADDT)) Q:(HBHCADDT="")!(HBHCADDT>HBHCEND1) S HBHCDFN="" F S HBHCDFN=$O(^HBHC(631,"AD",HBHCADDT,HBHCDFN)) Q:HBHCDFN="" S HBHCNOD0=^HBHC(631,HBHCDFN,0) D:$P(HBHCNOD0,U,15)=1 PROCESS
|
---|
16 | W:'$D(^TMP("HBHC",$J)) !!,"No data found for Date Range selected."
|
---|
17 | I $D(^TMP("HBHC",$J)) D PRTLOOP W !!,HBHCZ,!,"Program Census Total: ",HBHCTOT,!,HBHCZ
|
---|
18 | D ENDRPT^HBHCUTL1
|
---|
19 | EXIT ; Exit module
|
---|
20 | D ^%ZISC
|
---|
21 | K HBHCADDT,HBHCBEG1,HBHCBEG2,HBHCCOLM,HBHCCC,HBHCDFN,HBHCDPT0,HBHCEND1,HBHCEND2,HBHCHDR,HBHCHEAD,HBHCNAME,HBHCNOD0,HBHCPAGE,HBHCTDY,HBHCTOT,HBHCY,HBHCZ,X,X1,X2,Y,^TMP("HBHC",$J)
|
---|
22 | Q
|
---|
23 | PROCESS ; Process record & build ^TMP("HBHC",$J) global
|
---|
24 | Q:($P(HBHCNOD0,U,40)]"")&($P(HBHCNOD0,U,40)<HBHCEND1)
|
---|
25 | S HBHCDPT0=^DPT($P(HBHCNOD0,U),0)
|
---|
26 | S ^TMP("HBHC",$J,$P(HBHCDPT0,U),HBHCADDT)=$E($P(HBHCDPT0,U,9),6,9)
|
---|
27 | Q
|
---|
28 | PRTLOOP ; Print loop
|
---|
29 | S HBHCNAME="" F S HBHCNAME=$O(^TMP("HBHC",$J,HBHCNAME)) Q:HBHCNAME="" S HBHCADDT="" F S HBHCADDT=$O(^TMP("HBHC",$J,HBHCNAME,HBHCADDT)) Q:HBHCADDT="" D PRINT
|
---|
30 | Q
|
---|
31 | PRINT ; Print report
|
---|
32 | I ($D(ZTRTN)!(HBHCCC=0))&((IOSL-$Y)<5) W @IOF D HDRRANGE^HBHCUTL
|
---|
33 | S Y=HBHCADDT D DD^%DT
|
---|
34 | W !,HBHCNAME,?43,^TMP("HBHC",$J,HBHCNAME,HBHCADDT),?68,Y,!,HBHCY
|
---|
35 | S HBHCTOT=HBHCTOT+1
|
---|
36 | Q
|
---|