BGP8DHEP ; IHS/CMI/LAB - IHS HEDIS print ;
;;8.0;IHS CLINICAL REPORTING;**2**;MAR 12, 2008
;
;
PRINT ;
K ^TMP($J)
S BGPIOSL=$S($G(BGPGUI):55,1:IOSL)
I BGPROT="D" G DEL
D ^BGP8HEH
S BGPGPG=0
S BGPQUIT=""
D PRINT1
K ^TMP($J)
I BGPROT="P" K ^XTMP("BGP8D",BGPJ,BGPH),^TMP($J) Q
;
DEL ;create delimited output file
I '$D(BGPGUI) D ^%ZISC ;close printer device
K ^TMP($J)
D ^BGP8HEL ;create ^tmp of delimited report
K ^XTMP("BGP8D",BGPJ,BGPH)
K ^TMP($J)
Q
;
PRINT1 ;EP
S BGPIC=0 F S BGPIC=$O(BGPIND(BGPIC)) Q:BGPIC=""!(BGPQUIT) D
.D HEADER^BGP8DPH ;header for all measures
.I $Y>(BGPIOSL-3) D HEADER^BGP8DPH Q:BGPQUIT
.W !,$P(^BGPHEIE(BGPIC,0),U,3),!
.I $Y>(BGPIOSL-3) D HEADER^BGP8DPH Q:BGPQUIT
.W !,"Denominator(s):"
.S BGPX=0 F S BGPX=$O(^BGPHEIE(BGPIC,61,"B",BGPX)) Q:BGPX'=+BGPX!(BGPQUIT) D
..S BGPY=0 F S BGPY=$O(^BGPHEIE(BGPIC,61,"B",BGPX,BGPY)) Q:BGPY'=+BGPY!(BGPQUIT) D
...I $P(^BGPHEIE(BGPIC,61,BGPY,0),U,2)'[BGPRTYPE Q ;not a denom def for this report
...S BGPZ=0 F S BGPZ=$O(^BGPHEIE(BGPIC,61,BGPY,1,BGPZ)) Q:BGPZ'=+BGPZ!(BGPQUIT) D
....I $Y>(BGPIOSL-3) D HEADER^BGP8DPH Q:BGPQUIT
....W !,^BGPHEIE(BGPIC,61,BGPY,1,BGPZ,0)
....Q
...;W !
...Q
..Q
.I $Y>(BGPIOSL-3) D HEADER^BGP8DPH Q:BGPQUIT
.W !!,"Numerator(s):"
.S BGPX=0 F S BGPX=$O(^BGPHEIE(BGPIC,62,"B",BGPX)) Q:BGPX'=+BGPX!(BGPQUIT) D
..S BGPY=0 F S BGPY=$O(^BGPHEIE(BGPIC,62,"B",BGPX,BGPY)) Q:BGPY'=+BGPY!(BGPQUIT) D
...I $P(^BGPHEIE(BGPIC,62,BGPY,0),U,2)'[BGPRTYPE Q ;not a denom def for this report
...S BGPZ=0 F S BGPZ=$O(^BGPHEIE(BGPIC,62,BGPY,1,BGPZ)) Q:BGPZ'=+BGPZ!(BGPQUIT) D
....I $Y>(BGPIOSL-3) D HEADER^BGP8DPH Q:BGPQUIT
....W !,^BGPHEIE(BGPIC,62,BGPY,1,BGPZ,0)
....Q
...;W !
...Q
..Q
.I $O(^BGPHEIE(BGPIC,11,0)) W !!,"Logic:" S BGPX=0 F S BGPX=$O(^BGPHEIE(BGPIC,11,BGPX)) Q:BGPX'=+BGPX D
..I $Y>(BGPIOSL-3) D HEADER^BGP8DPH Q:BGPQUIT
..W !,^BGPHEIE(BGPIC,11,BGPX,0)
.I $O(^BGPHEIE(BGPIC,51,0)) W !!,"Performance Measure Description:" S BGPX=0 F S BGPX=$O(^BGPHEIE(BGPIC,51,BGPX)) Q:BGPX'=+BGPX D
..I $Y>(BGPIOSL-3) D HEADER^BGP8DPH Q:BGPQUIT
..W !,^BGPHEIE(BGPIC,51,BGPX,0)
.W !!,"HEDIS Rates:"
.I '$O(^BGPHEIE(BGPIC,52,0)) W !,"Not Reported." I 1
.E S BGPX=0 F S BGPX=$O(^BGPHEIE(BGPIC,52,BGPX)) Q:BGPX'=+BGPX D
..I $Y>(BGPIOSL-3) D HEADER^BGP8DPH Q:BGPQUIT
..W !,^BGPHEIE(BGPIC,52,BGPX,0)
.X ^BGPHEIE(BGPIC,3)
;
;D ^BGP8DSP
Q:BGPQUIT
D ^BGP8HES
D EXIT
Q
EXIT ;
I $E(IOST)="C",IO=IO(0),'$D(ZTQUEUED) W ! S DIR(0)="EO",DIR("A")="End of report. Press ENTER" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
Q
C(X,X2,X3) ;
D COMMA^%DTC
Q X
BGP8DHEP ; IHS/CMI/LAB - IHS HEDIS print ;
+1 ;;8.0;IHS CLINICAL REPORTING;**2**;MAR 12, 2008
+2 ;
+3 ;
PRINT ;
+1 KILL ^TMP($JOB)
+2 SET BGPIOSL=$SELECT($GET(BGPGUI):55,1:IOSL)
+3 IF BGPROT="D"
GOTO DEL
+4 DO ^BGP8HEH
+5 SET BGPGPG=0
+6 SET BGPQUIT=""
+7 DO PRINT1
+8 KILL ^TMP($JOB)
+9 IF BGPROT="P"
KILL ^XTMP("BGP8D",BGPJ,BGPH),^TMP($JOB)
QUIT
+10 ;
DEL ;create delimited output file
+1 ;close printer device
IF '$DATA(BGPGUI)
DO ^%ZISC
+2 KILL ^TMP($JOB)
+3 ;create ^tmp of delimited report
DO ^BGP8HEL
+4 KILL ^XTMP("BGP8D",BGPJ,BGPH)
+5 KILL ^TMP($JOB)
+6 QUIT
+7 ;
PRINT1 ;EP
+1 SET BGPIC=0
FOR
SET BGPIC=$ORDER(BGPIND(BGPIC))
IF BGPIC=""!(BGPQUIT)
QUIT
Begin DoDot:1
+2 ;header for all measures
DO HEADER^BGP8DPH
+3 IF $Y>(BGPIOSL-3)
DO HEADER^BGP8DPH
IF BGPQUIT
QUIT
+4 WRITE !,$PIECE(^BGPHEIE(BGPIC,0),U,3),!
+5 IF $Y>(BGPIOSL-3)
DO HEADER^BGP8DPH
IF BGPQUIT
QUIT
+6 WRITE !,"Denominator(s):"
+7 SET BGPX=0
FOR
SET BGPX=$ORDER(^BGPHEIE(BGPIC,61,"B",BGPX))
IF BGPX'=+BGPX!(BGPQUIT)
QUIT
Begin DoDot:2
+8 SET BGPY=0
FOR
SET BGPY=$ORDER(^BGPHEIE(BGPIC,61,"B",BGPX,BGPY))
IF BGPY'=+BGPY!(BGPQUIT)
QUIT
Begin DoDot:3
+9 ;not a denom def for this report
IF $PIECE(^BGPHEIE(BGPIC,61,BGPY,0),U,2)'[BGPRTYPE
QUIT
+10 SET BGPZ=0
FOR
SET BGPZ=$ORDER(^BGPHEIE(BGPIC,61,BGPY,1,BGPZ))
IF BGPZ'=+BGPZ!(BGPQUIT)
QUIT
Begin DoDot:4
+11 IF $Y>(BGPIOSL-3)
DO HEADER^BGP8DPH
IF BGPQUIT
QUIT
+12 WRITE !,^BGPHEIE(BGPIC,61,BGPY,1,BGPZ,0)
+13 QUIT
End DoDot:4
+14 ;W !
+15 QUIT
End DoDot:3
+16 QUIT
End DoDot:2
+17 IF $Y>(BGPIOSL-3)
DO HEADER^BGP8DPH
IF BGPQUIT
QUIT
+18 WRITE !!,"Numerator(s):"
+19 SET BGPX=0
FOR
SET BGPX=$ORDER(^BGPHEIE(BGPIC,62,"B",BGPX))
IF BGPX'=+BGPX!(BGPQUIT)
QUIT
Begin DoDot:2
+20 SET BGPY=0
FOR
SET BGPY=$ORDER(^BGPHEIE(BGPIC,62,"B",BGPX,BGPY))
IF BGPY'=+BGPY!(BGPQUIT)
QUIT
Begin DoDot:3
+21 ;not a denom def for this report
IF $PIECE(^BGPHEIE(BGPIC,62,BGPY,0),U,2)'[BGPRTYPE
QUIT
+22 SET BGPZ=0
FOR
SET BGPZ=$ORDER(^BGPHEIE(BGPIC,62,BGPY,1,BGPZ))
IF BGPZ'=+BGPZ!(BGPQUIT)
QUIT
Begin DoDot:4
+23 IF $Y>(BGPIOSL-3)
DO HEADER^BGP8DPH
IF BGPQUIT
QUIT
+24 WRITE !,^BGPHEIE(BGPIC,62,BGPY,1,BGPZ,0)
+25 QUIT
End DoDot:4
+26 ;W !
+27 QUIT
End DoDot:3
+28 QUIT
End DoDot:2
+29 IF $ORDER(^BGPHEIE(BGPIC,11,0))
WRITE !!,"Logic:"
SET BGPX=0
FOR
SET BGPX=$ORDER(^BGPHEIE(BGPIC,11,BGPX))
IF BGPX'=+BGPX
QUIT
Begin DoDot:2
+30 IF $Y>(BGPIOSL-3)
DO HEADER^BGP8DPH
IF BGPQUIT
QUIT
+31 WRITE !,^BGPHEIE(BGPIC,11,BGPX,0)
End DoDot:2
+32 IF $ORDER(^BGPHEIE(BGPIC,51,0))
WRITE !!,"Performance Measure Description:"
SET BGPX=0
FOR
SET BGPX=$ORDER(^BGPHEIE(BGPIC,51,BGPX))
IF BGPX'=+BGPX
QUIT
Begin DoDot:2
+33 IF $Y>(BGPIOSL-3)
DO HEADER^BGP8DPH
IF BGPQUIT
QUIT
+34 WRITE !,^BGPHEIE(BGPIC,51,BGPX,0)
End DoDot:2
+35 WRITE !!,"HEDIS Rates:"
+36 IF '$ORDER(^BGPHEIE(BGPIC,52,0))
WRITE !,"Not Reported."
IF 1
+37 IF '$TEST
SET BGPX=0
FOR
SET BGPX=$ORDER(^BGPHEIE(BGPIC,52,BGPX))
IF BGPX'=+BGPX
QUIT
Begin DoDot:2
+38 IF $Y>(BGPIOSL-3)
DO HEADER^BGP8DPH
IF BGPQUIT
QUIT
+39 WRITE !,^BGPHEIE(BGPIC,52,BGPX,0)
End DoDot:2
+40 XECUTE ^BGPHEIE(BGPIC,3)
End DoDot:1
+41 ;
+42 ;D ^BGP8DSP
+43 IF BGPQUIT
QUIT
+44 DO ^BGP8HES
+45 DO EXIT
+46 QUIT
EXIT ;
+1 IF $EXTRACT(IOST)="C"
IF IO=IO(0)
IF '$DATA(ZTQUEUED)
WRITE !
SET DIR(0)="EO"
SET DIR("A")="End of report. Press ENTER"
DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+2 QUIT
C(X,X2,X3) ;
+1 DO COMMA^%DTC
+2 QUIT X