47 lines
2.4 KiB
Mathematica
47 lines
2.4 KiB
Mathematica
HBHCRP17 ; 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
|
|
;;1.0;HOSPITAL BASED HOME CARE;**6,11,16**;NOV 01, 1993
|
|
D EN1^HBHCUTL4
|
|
G:(HBHCBEG1=-1)!(HBHCEND1=-1)!($D(DTOUT))!(('$D(HBHCCPTB))&('$D(HBHCCPTE))&('$D(HBHCTMP)))!(($D(HBHCCPTB))&('$D(HBHCCPTE))) EXIT
|
|
S %ZIS="Q",HBHCCC=0 K IOP,ZTIO,ZTSAVE D ^%ZIS G:POP EXIT
|
|
I $D(IO("Q")) S ZTRTN="DQ^HBHCRP17",ZTDESC="HBPC CPT Code Summary Report",ZTSAVE("HBHC*")="" D ^%ZTLOAD G EXIT
|
|
DQ ; De-queue
|
|
U IO
|
|
K ^TMP("HBHC",$J)
|
|
S HBHCCC=0,HBHCHEAD="CPT Code Summary",HBHCHDR="W !,""CPT Code"",?39,""Total""",HBHCCOLM=(80-(30+$L(HBHCHEAD))\2) S:HBHCCOLM'>0 HBHCCOLM=1
|
|
S HBHCTOT=0,$P(HBHCY,"-",81)=""
|
|
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
|
|
D:IO'=IO(0)!($D(IO("S"))) HDRRANGE^HBHCUTL
|
|
I '$D(IO("S")),(IO=IO(0)) S HBHCCC=HBHCCC+1 D HDRRANGE^HBHCUTL
|
|
W:'$D(^TMP("HBHC",$J)) !!,"No Visits containing CPT codes requested found for Date Range selected."
|
|
I $D(^TMP("HBHC",$J)) D PRTLOOP
|
|
I ($D(ZTRTN)!(HBHCCC=0))&((IOSL-$Y)<5) W @IOF D HDRRANGE^HBHCUTL
|
|
W !!,HBHCZ,!,"Total CPT Codes: ",$J(HBHCTOT,6),!,HBHCZ
|
|
D ENDRPT^HBHCUTL1
|
|
EXIT ; Exit module
|
|
D ^%ZISC,KILL^HBHCUTL4
|
|
K DIC,DTOUT,DUOUT,HBHCBEG1,HBHCCPTB,HBHCCPTE,HBHCEND1,HBHCHEAD,Y
|
|
Q
|
|
PROCESS ; Process record & create ^TMP("HBHC",$J global
|
|
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:$D(^TMP("HBHC",$J,HBHCCPT)) ^TMP("HBHC",$J,HBHCCPT)=^TMP("HBHC",$J,HBHCCPT)+1
|
|
S:'$D(^TMP("HBHC",$J,HBHCCPT)) ^TMP("HBHC",$J,HBHCCPT)=1
|
|
Q
|
|
PRTLOOP ; Print loop
|
|
S HBHCCPT="" F S HBHCCPT=$O(^TMP("HBHC",$J,HBHCCPT)) Q:HBHCCPT="" D PRINT
|
|
Q
|
|
PRINT ; Print report
|
|
S HBHCCNT=^TMP("HBHC",$J,HBHCCPT)
|
|
S HBHCTOT=HBHCTOT+HBHCCNT
|
|
I ($D(ZTRTN)!(HBHCCC=0))&((IOSL-$Y)<5) W @IOF D HDRRANGE^HBHCUTL
|
|
W !,HBHCCPT,?39,$J(HBHCCNT,5)
|
|
W !,HBHCY
|
|
Q
|