source: WorldVistAEHR/trunk/r/HOSPITAL_BASED_HOME_CARE-HBH/HBHCRP17.m@ 660

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

initial load of WorldVistAEHR

File size: 2.4 KB
Line 
1HBHCRP17 ; LR VAMC(IRMS)/MJT-HBHC report on file 632, user selected date range, CPT code(s) (can be range of CPTs), with summary totals, calls: CPT^HBHCUTL3, EN1^HBHCUTL4 & KILL^HBHCUTL4 ; Apr 2000
2 ;;1.0;HOSPITAL BASED HOME CARE;**6,11,16**;NOV 01, 1993
3 D EN1^HBHCUTL4
4 G:(HBHCBEG1=-1)!(HBHCEND1=-1)!($D(DTOUT))!(('$D(HBHCCPTB))&('$D(HBHCCPTE))&('$D(HBHCTMP)))!(($D(HBHCCPTB))&('$D(HBHCCPTE))) EXIT
5 S %ZIS="Q",HBHCCC=0 K IOP,ZTIO,ZTSAVE D ^%ZIS G:POP EXIT
6 I $D(IO("Q")) S ZTRTN="DQ^HBHCRP17",ZTDESC="HBPC CPT Code Summary Report",ZTSAVE("HBHC*")="" D ^%ZTLOAD G EXIT
7DQ ; De-queue
8 U IO
9 K ^TMP("HBHC",$J)
10 S HBHCCC=0,HBHCHEAD="CPT Code Summary",HBHCHDR="W !,""CPT Code"",?39,""Total""",HBHCCOLM=(80-(30+$L(HBHCHEAD))\2) S:HBHCCOLM'>0 HBHCCOLM=1
11 S HBHCTOT=0,$P(HBHCY,"-",81)=""
12LOOP ; Loop thru ^HBHC(632) "C" (visit date) cross-ref to build report
13 S X1=HBHCBEG1,X2=-1 D C^%DTC S HBHCDATE=X_.9999
14 F S HBHCDATE=$O(^HBHC(632,"C",HBHCDATE)) Q:(HBHCDATE="")!($P(HBHCDATE,".")>HBHCEND1) S HBHCDFN="" F S HBHCDFN=$O(^HBHC(632,"C",HBHCDATE,HBHCDFN)) Q:HBHCDFN="" S HBHCNOD0=^HBHC(632,HBHCDFN,0) D:$P(HBHCNOD0,U,7)="" PROCESS
15 D:IO'=IO(0)!($D(IO("S"))) HDRRANGE^HBHCUTL
16 I '$D(IO("S")),(IO=IO(0)) S HBHCCC=HBHCCC+1 D HDRRANGE^HBHCUTL
17 W:'$D(^TMP("HBHC",$J)) !!,"No Visits containing CPT codes requested found for Date Range selected."
18 I $D(^TMP("HBHC",$J)) D PRTLOOP
19 I ($D(ZTRTN)!(HBHCCC=0))&((IOSL-$Y)<5) W @IOF D HDRRANGE^HBHCUTL
20 W !!,HBHCZ,!,"Total CPT Codes: ",$J(HBHCTOT,6),!,HBHCZ
21 D ENDRPT^HBHCUTL1
22EXIT ; Exit module
23 D ^%ZISC,KILL^HBHCUTL4
24 K DIC,DTOUT,DUOUT,HBHCBEG1,HBHCCPTB,HBHCCPTE,HBHCEND1,HBHCHEAD,Y
25 Q
26PROCESS ; Process record & create ^TMP("HBHC",$J global
27 S HBHCDPT0=^DPT($P(HBHCNOD0,U),0)
28 D CPT^HBHCUTL3
29 S HBHCI=0 F S HBHCI=$O(HBHCCPTA(HBHCI)) Q:HBHCI'>0 S HBHCCPT=HBHCCPTA(HBHCI) D SET
30 Q
31SET ; Set TMP node for CPTs
32 I HBHCDIR=1 Q:(($P(HBHCCPT," "))<HBHCCPTB)!(($P(HBHCCPT," "))>HBHCCPTE)
33 Q:(HBHCDIR=0)&('$D(HBHCTMP($P(HBHCCPT," "))))
34 S:$D(^TMP("HBHC",$J,HBHCCPT)) ^TMP("HBHC",$J,HBHCCPT)=^TMP("HBHC",$J,HBHCCPT)+1
35 S:'$D(^TMP("HBHC",$J,HBHCCPT)) ^TMP("HBHC",$J,HBHCCPT)=1
36 Q
37PRTLOOP ; Print loop
38 S HBHCCPT="" F S HBHCCPT=$O(^TMP("HBHC",$J,HBHCCPT)) Q:HBHCCPT="" D PRINT
39 Q
40PRINT ; Print report
41 S HBHCCNT=^TMP("HBHC",$J,HBHCCPT)
42 S HBHCTOT=HBHCTOT+HBHCCNT
43 I ($D(ZTRTN)!(HBHCCC=0))&((IOSL-$Y)<5) W @IOF D HDRRANGE^HBHCUTL
44 W !,HBHCCPT,?39,$J(HBHCCNT,5)
45 W !,HBHCY
46 Q
Note: See TracBrowser for help on using the repository browser.