Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: HBHCRP22

HBHCRP22.m

Go to the documentation of this file.
HBHCRP22 ; 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
 ;;1.0;HOSPITAL BASED HOME CARE;**11,16**;NOV 01, 1993
 ; calls:  PROV^HBHCUTL2, EN^HBHCUTL2, TOT^HBHCUTL2, FTOT^HBHCUTL2, CPT^HBHCUTL3, EN1^HBHCUTL4, & KILL^HBHCUTL4
 D PROV^HBHCUTL2,EN^HBHCUTL2
 G:(%=-1)!($D(DTOUT))!($D(DUOUT)) EXIT
 D EN1^HBHCUTL4
 G:(HBHCBEG1=-1)!(HBHCEND1=-1)!($D(DTOUT))!(('$D(HBHCCPTB))&('$D(HBHCCPTE))&('$D(HBHCTMP)))!(($D(HBHCCPTB))&('$D(HBHCCPTE))) EXIT
 S %ZIS="Q" K IOP,ZTIO,ZTSAVE D ^%ZIS G:POP EXIT
 I $D(IO("Q")) S ZTRTN="DQ^HBHCRP22",ZTDESC="HBPC Provider CPT Code Summary Report",ZTSAVE("HBHC*")="" D ^%ZTLOAD G EXIT
DQ ; De-queue
 U IO
 K ^TMP("HBHC",$J)
 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
LOOP ; Loop thru ^HBHC(632) "C" (visit date) cross-ref to build report
 S X1=HBHCBEG1,X2=-1 D C^%DTC S HBHCDATE=X_.9999
 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
 I '$D(^TMP("HBHC",$J)) K HBHCNAM D HDRRANGE^HBHCUTL W !!,"No Visits containing CPT codes requested found for Date Range selected."
 I $D(^TMP("HBHC",$J)) D PRTLOOP D:'$D(HBHCPRVL) FTOT^HBHCUTL2
 D ENDRPT^HBHCUTL1
EXIT ; Exit module
 D ^%ZISC,KILL^HBHCUTL4
 K DIC,DTOUT,DUOUT,HBHCBEG1,HBHCCLM1,HBHCCPTB,HBHCCPTE,HBHCEND1,HBHCFTOT,HBHCHEAD,HBHCNAM,HBHCONE,HBHCPRV,HBHCPRVL,HBHCTXT,HBHCWHO,HBHCWHOC,HBHCWHOS,Y,%
 Q
PROCESS ; Process record & create ^TMP("HBHC",$J global
 ; Quit if not provider requested
 S HBHCPRV=$P(HBHCNOD0,U,4)
 I $D(HBHCPRVL) Q:'$D(HBHCPRVL(HBHCPRV))
 S HBHCDPT0=^DPT($P(HBHCNOD0,U),0)
 D CPT^HBHCUTL3
 S HBHCI=0 F  S HBHCI=$O(HBHCCPTA(HBHCI)) Q:HBHCI'>0  S HBHCCPT=HBHCCPTA(HBHCI) D SET
 Q
SET ; Set TMP node for CPTs
 I HBHCDIR=1 Q:(($P(HBHCCPT,"  "))<HBHCCPTB)!(($P(HBHCCPT,"  "))>HBHCCPTE)
 Q:(HBHCDIR=0)&('$D(HBHCTMP($P(HBHCCPT,"  "))))
 S HBHCNAM=$P(^VA(200,$P(^HBHC(631.4,HBHCPRV,0),U,2),0),U)_"  ("_$P(^HBHC(631.4,HBHCPRV,0),U)_")"
 S:$D(^TMP("HBHC",$J,HBHCNAM,HBHCCPT)) ^TMP("HBHC",$J,HBHCNAM,HBHCCPT)=^TMP("HBHC",$J,HBHCNAM,HBHCCPT)+1
 S:'$D(^TMP("HBHC",$J,HBHCNAM,HBHCCPT)) ^TMP("HBHC",$J,HBHCNAM,HBHCCPT)=1
 Q
PRTLOOP ; Print loop
 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
 Q
PRINT ; Print report
 S HBHCCNT=^TMP("HBHC",$J,HBHCPRV,HBHCCPT)
 S HBHCTOT=HBHCTOT+HBHCCNT
 I ($D(ZTRTN)!(HBHCCC=0))&((IOSL-$Y)<5) W @IOF D HDRRANGE^HBHCUTL
 W !,HBHCCPT,?39,HBHCCNT
 W !,HBHCY
 Q
HDR ; Report header setup
 S HBHCPAGE=0,HBHCNAM=HBHCPRV,HBHCCLM1=(80-(20+$L(HBHCNAM))\2) S:HBHCCLM1'>0 HBHCCLM1=1
 W @IOF D HDRRANGE^HBHCUTL
 Q