BGP0DHEP ; IHS/CMI/LAB - IHS HEDIS print ;
;;10.0;IHS CLINICAL REPORTING;;JUN 18, 2010
;
;
PRINT ;
K ^TMP($J)
S BGPIOSL=$S($G(BGPGUI):55,1:IOSL)
I BGPROT="D" G DEL
S BGPPTYPE="P"
D ^BGP0HEH
S BGPGPG=0
S BGPQUIT=""
D PRINT1
K ^TMP($J)
I BGPROT="P" K ^XTMP("BGP0D",BGPJ,BGPH),^TMP($J) Q
;
DEL ;create delimited output file
S BGPPTYPE="D"
I '$D(BGPGUI) D ^%ZISC ;close printer device
K ^TMP($J)
D ^BGP0HEL ;create ^tmp of delimited report
K ^XTMP("BGP0D",BGPJ,BGPH)
K ^TMP($J)
Q
WP ;
K ^UTILITY($J,"W")
S BGPZ=0,BGPLCNT=0
S DIWL=1,DIWR=80,DIWF="",BGPZ=0 F S BGPZ=$O(^BGPHEIT(BGPIC,BGPNODE,BGPY,1,BGPZ)) Q:BGPZ'=+BGPZ D
.S BGPLCNT=BGPLCNT+1
.S X=^BGPHEIT(BGPIC,BGPNODE,BGPY,1,BGPZ,0) S:BGPLCNT=1 X=" - "_X D ^DIWP
.Q
WPS ;
S Z=0 F S Z=$O(^UTILITY($J,"W",DIWL,Z)) Q:Z'=+Z D
.I $Y>(BGPIOSL-3) D HEADER^BGP0DPH Q:BGPQUIT
.W !,^UTILITY($J,"W",DIWL,Z,0)
K DIWL,DIWR,DIWF,Z
K ^UTILITY($J,"W"),X
Q
;
PRINT1 ;EP
S BGPIC=0 F S BGPIC=$O(BGPIND(BGPIC)) Q:BGPIC=""!(BGPQUIT) D
.D HEADER^BGP0DPH ;header for all measures
.I $Y>(BGPIOSL-3) D HEADER^BGP0DPH Q:BGPQUIT
.W !,$P(^BGPHEIT(BGPIC,0),U,3),!
.I $Y>(BGPIOSL-3) D HEADER^BGP0DPH Q:BGPQUIT
.W !,"Denominator(s):"
.S BGPNODE=61
.S BGPX=0 F S BGPX=$O(^BGPHEIT(BGPIC,61,"B",BGPX)) Q:BGPX'=+BGPX!(BGPQUIT) D
..S BGPY=0 F S BGPY=$O(^BGPHEIT(BGPIC,61,"B",BGPX,BGPY)) Q:BGPY'=+BGPY!(BGPQUIT) D
...I $P(^BGPHEIT(BGPIC,61,BGPY,0),U,2)'[BGPRTYPE Q ;not a denom def for this report
...D WP
.I $Y>(BGPIOSL-3) D HEADER^BGP0DPH Q:BGPQUIT
.W !!,"Numerator(s):"
.S BGPNODE=62
.S BGPX=0 F S BGPX=$O(^BGPHEIT(BGPIC,62,"B",BGPX)) Q:BGPX'=+BGPX!(BGPQUIT) D
..S BGPY=0 F S BGPY=$O(^BGPHEIT(BGPIC,62,"B",BGPX,BGPY)) Q:BGPY'=+BGPY!(BGPQUIT) D
...I $P(^BGPHEIT(BGPIC,62,BGPY,0),U,2)'[BGPRTYPE Q ;not a denom def for this report
...D WP
.I $O(^BGPHEIT(BGPIC,11,0)) W !!,"Logic:" S BGPX=0 F S BGPX=$O(^BGPHEIT(BGPIC,11,BGPX)) Q:BGPX'=+BGPX D
..I $Y>(BGPIOSL-3) D HEADER^BGP0DPH Q:BGPQUIT
..W !,^BGPHEIT(BGPIC,11,BGPX,0)
.I $O(^BGPHEIT(BGPIC,51,0)) W !!,"Performance Measure Description:" S BGPX=0 F S BGPX=$O(^BGPHEIT(BGPIC,51,BGPX)) Q:BGPX'=+BGPX D
..I $Y>(BGPIOSL-3) D HEADER^BGP0DPH Q:BGPQUIT
..W !,^BGPHEIT(BGPIC,51,BGPX,0)
.W !!,"HEDIS Rates:"
.I '$O(^BGPHEIT(BGPIC,52,0)) W !,"Not Reported." I 1
.E S BGPX=0 F S BGPX=$O(^BGPHEIT(BGPIC,52,BGPX)) Q:BGPX'=+BGPX D
..I $Y>(BGPIOSL-3) D HEADER^BGP0DPH Q:BGPQUIT
..W !,^BGPHEIT(BGPIC,52,BGPX,0)
.X ^BGPHEIT(BGPIC,3)
;
;D ^BGP0DSP
Q:BGPQUIT
D ^BGP0HES
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
BGP0DHEP ; IHS/CMI/LAB - IHS HEDIS print ;
+1 ;;10.0;IHS CLINICAL REPORTING;;JUN 18, 2010
+2 ;
+3 ;
PRINT ;
+1 KILL ^TMP($JOB)
+2 SET BGPIOSL=$SELECT($GET(BGPGUI):55,1:IOSL)
+3 IF BGPROT="D"
GOTO DEL
+4 SET BGPPTYPE="P"
+5 DO ^BGP0HEH
+6 SET BGPGPG=0
+7 SET BGPQUIT=""
+8 DO PRINT1
+9 KILL ^TMP($JOB)
+10 IF BGPROT="P"
KILL ^XTMP("BGP0D",BGPJ,BGPH),^TMP($JOB)
QUIT
+11 ;
DEL ;create delimited output file
+1 SET BGPPTYPE="D"
+2 ;close printer device
IF '$DATA(BGPGUI)
DO ^%ZISC
+3 KILL ^TMP($JOB)
+4 ;create ^tmp of delimited report
DO ^BGP0HEL
+5 KILL ^XTMP("BGP0D",BGPJ,BGPH)
+6 KILL ^TMP($JOB)
+7 QUIT
WP ;
+1 KILL ^UTILITY($JOB,"W")
+2 SET BGPZ=0
SET BGPLCNT=0
+3 SET DIWL=1
SET DIWR=80
SET DIWF=""
SET BGPZ=0
FOR
SET BGPZ=$ORDER(^BGPHEIT(BGPIC,BGPNODE,BGPY,1,BGPZ))
IF BGPZ'=+BGPZ
QUIT
Begin DoDot:1
+4 SET BGPLCNT=BGPLCNT+1
+5 SET X=^BGPHEIT(BGPIC,BGPNODE,BGPY,1,BGPZ,0)
IF BGPLCNT=1
SET X=" - "_X
DO ^DIWP
+6 QUIT
End DoDot:1
WPS ;
+1 SET Z=0
FOR
SET Z=$ORDER(^UTILITY($JOB,"W",DIWL,Z))
IF Z'=+Z
QUIT
Begin DoDot:1
+2 IF $Y>(BGPIOSL-3)
DO HEADER^BGP0DPH
IF BGPQUIT
QUIT
+3 WRITE !,^UTILITY($JOB,"W",DIWL,Z,0)
End DoDot:1
+4 KILL DIWL,DIWR,DIWF,Z
+5 KILL ^UTILITY($JOB,"W"),X
+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^BGP0DPH
+3 IF $Y>(BGPIOSL-3)
DO HEADER^BGP0DPH
IF BGPQUIT
QUIT
+4 WRITE !,$PIECE(^BGPHEIT(BGPIC,0),U,3),!
+5 IF $Y>(BGPIOSL-3)
DO HEADER^BGP0DPH
IF BGPQUIT
QUIT
+6 WRITE !,"Denominator(s):"
+7 SET BGPNODE=61
+8 SET BGPX=0
FOR
SET BGPX=$ORDER(^BGPHEIT(BGPIC,61,"B",BGPX))
IF BGPX'=+BGPX!(BGPQUIT)
QUIT
Begin DoDot:2
+9 SET BGPY=0
FOR
SET BGPY=$ORDER(^BGPHEIT(BGPIC,61,"B",BGPX,BGPY))
IF BGPY'=+BGPY!(BGPQUIT)
QUIT
Begin DoDot:3
+10 ;not a denom def for this report
IF $PIECE(^BGPHEIT(BGPIC,61,BGPY,0),U,2)'[BGPRTYPE
QUIT
+11 DO WP
End DoDot:3
End DoDot:2
+12 IF $Y>(BGPIOSL-3)
DO HEADER^BGP0DPH
IF BGPQUIT
QUIT
+13 WRITE !!,"Numerator(s):"
+14 SET BGPNODE=62
+15 SET BGPX=0
FOR
SET BGPX=$ORDER(^BGPHEIT(BGPIC,62,"B",BGPX))
IF BGPX'=+BGPX!(BGPQUIT)
QUIT
Begin DoDot:2
+16 SET BGPY=0
FOR
SET BGPY=$ORDER(^BGPHEIT(BGPIC,62,"B",BGPX,BGPY))
IF BGPY'=+BGPY!(BGPQUIT)
QUIT
Begin DoDot:3
+17 ;not a denom def for this report
IF $PIECE(^BGPHEIT(BGPIC,62,BGPY,0),U,2)'[BGPRTYPE
QUIT
+18 DO WP
End DoDot:3
End DoDot:2
+19 IF $ORDER(^BGPHEIT(BGPIC,11,0))
WRITE !!,"Logic:"
SET BGPX=0
FOR
SET BGPX=$ORDER(^BGPHEIT(BGPIC,11,BGPX))
IF BGPX'=+BGPX
QUIT
Begin DoDot:2
+20 IF $Y>(BGPIOSL-3)
DO HEADER^BGP0DPH
IF BGPQUIT
QUIT
+21 WRITE !,^BGPHEIT(BGPIC,11,BGPX,0)
End DoDot:2
+22 IF $ORDER(^BGPHEIT(BGPIC,51,0))
WRITE !!,"Performance Measure Description:"
SET BGPX=0
FOR
SET BGPX=$ORDER(^BGPHEIT(BGPIC,51,BGPX))
IF BGPX'=+BGPX
QUIT
Begin DoDot:2
+23 IF $Y>(BGPIOSL-3)
DO HEADER^BGP0DPH
IF BGPQUIT
QUIT
+24 WRITE !,^BGPHEIT(BGPIC,51,BGPX,0)
End DoDot:2
+25 WRITE !!,"HEDIS Rates:"
+26 IF '$ORDER(^BGPHEIT(BGPIC,52,0))
WRITE !,"Not Reported."
IF 1
+27 IF '$TEST
SET BGPX=0
FOR
SET BGPX=$ORDER(^BGPHEIT(BGPIC,52,BGPX))
IF BGPX'=+BGPX
QUIT
Begin DoDot:2
+28 IF $Y>(BGPIOSL-3)
DO HEADER^BGP0DPH
IF BGPQUIT
QUIT
+29 WRITE !,^BGPHEIT(BGPIC,52,BGPX,0)
End DoDot:2
+30 XECUTE ^BGPHEIT(BGPIC,3)
End DoDot:1
+31 ;
+32 ;D ^BGP0DSP
+33 IF BGPQUIT
QUIT
+34 DO ^BGP0HES
+35 DO EXIT
+36 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