source: WorldVistAEHR/trunk/r/HOSPITAL_BASED_HOME_CARE-HBH/HBHCRP11.m@ 1780

Last change on this file since 1780 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.7 KB
Line 
1HBHCRP11 ; LR VAMC(IRMS)/MJT-HBHC rpt on file 631, All active (admitted but not D/C) cases by date range, sorted by HBHC Team, then by name, includes: patient name, Last Four, admission date, & totals for team & all ; 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^HBHCRP11",ZTDESC="HBPC Team Census Report",ZTSAVE("HBHC*")="" D ^%ZTLOAD G EXIT
7DQ ; De-queue
8 U IO
9 K ^TMP("HBHC",$J)
10 S $P(HBHCY,"-",81)="",(HBHCFTOT,HBHCTOT)=0,HBHCHEAD="Team 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
12LOOP ; Loop thru ^HBHC(631) "AD" (admission date) cross-ref to build report
13 S X1=HBHCBEG1,X2=-1 D C^%DTC S HBHCADDT=X
14 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
15 I '$D(^TMP("HBHC",$J)) K HBHCNAM D HDRRANGE^HBHCUTL W !!,"No data found for Date Range selected."
16 I $D(^TMP("HBHC",$J)) D PRTLOOP W !!,HBHCZ,!,"All Team Census Total: ",HBHCFTOT,!,HBHCZ
17 D ENDRPT^HBHCUTL1
18EXIT ; Exit module
19 D ^%ZISC
20 K HBHCADDT,HBHCBEG1,HBHCBEG2,HBHCCLM1,HBHCCC,HBHCCOLM,HBHCDFN,HBHCDPT0,HBHCDT,HBHCEND1,HBHCEND2,HBHCFFFL,HBHCFTOT,HBHCHDR,HBHCHEAD,HBHCN,HBHCNAM,HBHCNOD0,HBHCPAGE,HBHCPT,HBHCTDY,HBHCTOT,HBHCY,HBHCZ,X,X1,X2,Y,^TMP("HBHC",$J)
21 Q
22PROCESS ; Process record & build ^TMP("HBHC",$J) global
23 Q:($P(HBHCNOD0,U,40)]"")&($P(HBHCNOD0,U,40)<HBHCEND1)
24 S HBHCNAM=$P($G(^HBHC(631,HBHCDFN,1)),U,13) S:HBHCNAM]"" HBHCNAM=$G(^HBHC(633,$P(^HBHC(631.4,HBHCNAM,0),U,6),0)) S:HBHCNAM="" HBHCNAM="Unknown"
25 S HBHCDPT0=^DPT($P(HBHCNOD0,U),0)
26 S ^TMP("HBHC",$J,HBHCNAM,$P(HBHCDPT0,U),HBHCADDT)=$E($P(HBHCDPT0,U,9),6,9)
27 Q
28PRTLOOP ; Print loop
29 S HBHCNAM=""
30 F S HBHCNAM=$O(^TMP("HBHC",$J,HBHCNAM)) D:HBHCTOT>0 TOT Q:HBHCNAM="" D HDR S HBHCPT="" F S HBHCPT=$O(^TMP("HBHC",$J,HBHCNAM,HBHCPT)) Q:HBHCPT="" S HBHCDT="" F S HBHCDT=$O(^TMP("HBHC",$J,HBHCNAM,HBHCPT,HBHCDT)) Q:HBHCDT="" D PRT
31 Q
32HDR ; Print header
33 S HBHCN=HBHCNAM,HBHCCLM1=(80-(22+$L(HBHCNAM))\2) S:HBHCCLM1'>0 HBHCCLM1=1 W:$D(HBHCFFFL) @IOF
34 D:IO'=IO(0)!($D(IO("S"))) HDRRANGE^HBHCUTL
35 I '$D(IO("S")),(IO=IO(0)) S HBHCCC=HBHCCC+1 D HDRRANGE^HBHCUTL
36 S:'$D(HBHCFFFL) HBHCFFFL=1
37 Q
38PRT ; Print report
39 I ($D(ZTRTN)!(HBHCCC=0))&((IOSL-$Y)<5) W @IOF D HDRRANGE^HBHCUTL
40 S HBHCTOT=HBHCTOT+1,Y=HBHCDT D DD^%DT
41 W !,HBHCPT,?43,^TMP("HBHC",$J,HBHCNAM,HBHCPT,HBHCDT),?68,Y,!,HBHCY
42 Q
43TOT ; Print HBHC team total
44 W !!,"Team: "_HBHCN_" Census Total: ",HBHCTOT
45 S HBHCFTOT=HBHCFTOT+HBHCTOT,HBHCTOT=0
46 Q
Note: See TracBrowser for help on using the repository browser.