source: FOIAVistA/trunk/r/HOSPITAL_BASED_HOME_CARE-HBH/HBHCRP22.m@ 1783

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

initial load of FOIAVistA 6/30/08 version

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