source: FOIAVistA/trunk/r/HOSPITAL_BASED_HOME_CARE-HBH/HBHCRP20.m@ 1801

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

initial load of FOIAVistA 6/30/08 version

File size: 2.5 KB
Line 
1HBHCRP20 ; LR VAMC(IRMS)/MJT-HBHC report on file 632, unique patients by date range summary ; Apr 2000
2 ;;1.0;HOSPITAL BASED HOME CARE;**8,10,16**;NOV 01, 1993
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^HBHCRP20",ZTDESC="HBPC Unique Patients by Date Range Summary Report",ZTSAVE("HBHC*")="" D ^%ZTLOAD G EXIT
7DQ ; De-queue
8 U IO
9 K ^TMP("HBHC",$J)
10 S $P(HBHCY,"-",81)="",HBHCHEAD="Unique Patients by Date Range Summary",(HBHCCNT,HBHCCNT1)=0
11 S HBHCCOLM=(80-(30+$L(HBHCHEAD))\2) S:HBHCCOLM'>0 HBHCCOLM=1
12 D TODAY^HBHCUTL D:IO'=IO(0)!($D(IO("S"))) HDRRANGE^HBHCUTL
13 I '$D(IO("S")),(IO=IO(0)) S HBHCCC=HBHCCC+1 D HDRRANGE^HBHCUTL
14LOOP ; Loop thru ^HBHC(632) "C" (appointment date) cross-ref to build report
15 S X1=HBHCBEG1,X2=-1 D C^%DTC S HBHCAPDT=X_.9999
16 F S HBHCAPDT=$O(^HBHC(632,"C",HBHCAPDT)) Q:(HBHCAPDT="")!(HBHCAPDT>HBHCEND1) S HBHCDFN="" F S HBHCDFN=$O(^HBHC(632,"C",HBHCAPDT,HBHCDFN)) Q:HBHCDFN="" S HBHCNOD0=^HBHC(632,HBHCDFN,0) D:$P(HBHCNOD0,U,7)="" PROCESS
17 D CNTLOOP
18 W !!,"Total Patients with Single Appointment Only:",?46,$J(HBHCCNT1,4)
19 W !,"Total Patients with Multiple Appointments:",?46,$J(HBHCCNT,4)
20 W !!,"Total Unique Patients: ",$J((HBHCCNT+HBHCCNT1),5)
21 D ENDRPT^HBHCUTL1
22EXIT ; Exit module
23 D ^%ZISC
24 K HBHCAPDT,HBHCBEG1,HBHCBEG2,HBHCCC,HBHCCNT,HBHCCNT1,HBHCCOLM,HBHCDFN,HBHCDPT0,HBHCEND1,HBHCEND2,HBHCHEAD,HBHCNAME,HBHCNOD0,HBHCPAGE,HBHCSSN,HBHCTDY,HBHCY,HBHCZ,X,X1,X2,Y,^TMP("HBHC",$J)
25 Q
26PROCESS ; Process record & build ^TMP("HBHC",$J) global
27 S HBHCDPT0=^DPT($P(HBHCNOD0,U),0)
28 D:$D(^TMP("HBHC",$J,$P(HBHCDPT0,U),$E($P(HBHCDPT0,U,9),1,3)_"-"_$E($P(HBHCDPT0,U,9),4,5)_"-"_$E($P(HBHCDPT0,U,9),6,9))) SET
29 S:'$D(^TMP("HBHC",$J,$P(HBHCDPT0,U),$E($P(HBHCDPT0,U,9),1,3)_"-"_$E($P(HBHCDPT0,U,9),4,5)_"-"_$E($P(HBHCDPT0,U,9),6,9))) ^TMP("HBHC",$J,$P(HBHCDPT0,U),$E($P(HBHCDPT0,U,9),1,3)_"-"_$E($P(HBHCDPT0,U,9),4,5)_"-"_$E($P(HBHCDPT0,U,9),6,9))=HBHCAPDT
30 Q
31SET ; Set ^TMP("HBHC",$J
32 S ^TMP("HBHC",$J,$P(HBHCDPT0,U),$E($P(HBHCDPT0,U,9),1,3)_"-"_$E($P(HBHCDPT0,U,9),4,5)_"-"_$E($P(HBHCDPT0,U,9),6,9))=HBHCAPDT_U_"*"
33 Q
34CNTLOOP ; Count loop
35 S HBHCNAME="" F S HBHCNAME=$O(^TMP("HBHC",$J,HBHCNAME)) Q:HBHCNAME="" S HBHCSSN="" F S HBHCSSN=$O(^TMP("HBHC",$J,HBHCNAME,HBHCSSN)) Q:HBHCSSN="" D COUNT
36 Q
37COUNT ; Count
38 ; patients with multiple visits
39 S:$P(^TMP("HBHC",$J,HBHCNAME,HBHCSSN),U,2)]"" HBHCCNT=HBHCCNT+1
40 ; patients with only 1 visit
41 S:$P(^TMP("HBHC",$J,HBHCNAME,HBHCSSN),U,2)="" HBHCCNT1=HBHCCNT1+1
42 Q
Note: See TracBrowser for help on using the repository browser.