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

BGP9DP.m

Go to the documentation of this file.
BGP9DP ; IHS/CMI/LAB - IHS gpra print 03 Jul 2008 6:26 AM ; 
 ;;9.0;IHS CLINICAL REPORTING;;JUL 1, 2009
 ;
 ;
PRINT ;
 K ^TMP($J)
 K BGPDELIM
 S BGPIOSL=$S($G(BGPGUI):55,1:$G(IOSL))
 I $G(BGPAREAA) D SETEXCEL
 S BGPIFTR=""
 I BGPROT="D" G DEL
 S BGPQHDR=0
 D ^BGP9DH
 I BGPQHDR D KITM Q
 S BGPGPG=0
 S BGPQUIT=""
 D PRINT1
 K ^TMP($J)
 I BGPROT="P" D KITM Q
 ;
DEL ;create delimited output file
 I '$D(BGPGUI) D ^%ZISC ;close printer device
 K ^TMP($J)
 D ^BGP9PDL ;create ^tmp of delimited report
 S BGPIFTR=1
 K ^XTMP("BGP9D",BGPJ,BGPH)
 K ^XTMP("BGP9DNP",BGPJ,BGPH)
 K ^XTMP("BGP08CPL",BGPJ,BGPH)
 K ^TMP($J)
 Q
 ;
WTITLE ;EP - write title line
 NEW T,X,Y,S
 S T=$P(^BGPINDN(BGPIC,0),U,3)
 I $L(T)<81 W !,T,! Q
 F X=$E(T,1,80)
 S S=""
 F Y=80:-1:1 Q:S  S I=$E(X,Y) I I=" " S S=Y
 W !,$E(T,1,S)
 W !,$E(T,(S+1),$L(T)),!
 Q
PRINT1 ;EP
 S BGPIC=0 F  S BGPIC=$O(BGPIND(BGPIC)) Q:BGPIC=""!(BGPQUIT)  D
 .I $G(BGPSUMON) G CALC
 .D HEADER^BGP9DPH ;header for all measures
 .I $Y>(BGPIOSL-3) D HEADER^BGP9DPH Q:BGPQUIT
 .D WTITLE
 .;W !,$P(^BGPINDN(BGPIC,0),U,3),!
 .I $Y>(BGPIOSL-3) D HEADER^BGP9DPH Q:BGPQUIT
 .W !,"Denominator(s):"
 .S BGPX=0 F  S BGPX=$O(^BGPINDN(BGPIC,61,"B",BGPX)) Q:BGPX'=+BGPX!(BGPQUIT)  D
 ..S BGPY=0 F  S BGPY=$O(^BGPINDN(BGPIC,61,"B",BGPX,BGPY)) Q:BGPY'=+BGPY!(BGPQUIT)  D
 ...I '$D(^BGPINDN(BGPIC,61,BGPY,11,"B",BGPRTYPE)) Q  ;not this report type
 ...I BGPRTYPE=4,'$D(^BGPINDN(BGPIC,61,BGPY,12,"B",BGPINDT)) Q  ;not this measure type on selected
 ...S BGPZ=0 F  S BGPZ=$O(^BGPINDN(BGPIC,61,BGPY,1,BGPZ)) Q:BGPZ'=+BGPZ!(BGPQUIT)  D
 ....I $Y>(BGPIOSL-3) D HEADER^BGP9DPH Q:BGPQUIT
 ....W !,^BGPINDN(BGPIC,61,BGPY,1,BGPZ,0)
 ....Q
 ...;W !
 ...Q
 ..Q
 .I $Y>(BGPIOSL-3) D HEADER^BGP9DPH Q:BGPQUIT
 .W !!,"Numerator(s):"
 .S BGPX=0 F  S BGPX=$O(^BGPINDN(BGPIC,62,"B",BGPX)) Q:BGPX'=+BGPX!(BGPQUIT)  D
 ..S BGPY=0 F  S BGPY=$O(^BGPINDN(BGPIC,62,"B",BGPX,BGPY)) Q:BGPY'=+BGPY!(BGPQUIT)  D
 ...I '$D(^BGPINDN(BGPIC,62,BGPY,11,"B",BGPRTYPE)) Q  ;not this report type
 ...I BGPRTYPE=4,'$D(^BGPINDN(BGPIC,62,BGPY,12,"B",BGPINDT)) Q  ;not this measure type on selected
 ...S BGPZ=0 F  S BGPZ=$O(^BGPINDN(BGPIC,62,BGPY,1,BGPZ)) Q:BGPZ'=+BGPZ!(BGPQUIT)  D
 ....I $Y>(BGPIOSL-3) D HEADER^BGP9DPH Q:BGPQUIT
 ....W !,^BGPINDN(BGPIC,62,BGPY,1,BGPZ,0)
 ....Q
 ...;W !
 ...Q
 ..Q
 .S BGPNODE=11
 .I BGPRTYPE=1,$O(^BGPINDN(BGPIC,54,0)) S BGPNODE=54
 .I BGPRTYPE=7,$O(^BGPINDN(BGPIC,56,0)) S BGPNODE=56
 .W !!,"Logic:" S BGPX=0 F  S BGPX=$O(^BGPINDN(BGPIC,BGPNODE,BGPX)) Q:BGPX'=+BGPX  D
 ..I $Y>(BGPIOSL-3) D HEADER^BGP9DPH Q:BGPQUIT
 ..W !,^BGPINDN(BGPIC,BGPNODE,BGPX,0)
 .W !!,"Performance Measure Description:" S BGPX=0 F  S BGPX=$O(^BGPINDN(BGPIC,$S($G(BGPNGR09):57,1:51),BGPX)) Q:BGPX'=+BGPX  D
 ..I $Y>(BGPIOSL-3) D HEADER^BGP9DPH Q:BGPQUIT
 ..W !,^BGPINDN(BGPIC,$S($G(BGPNGR09):57,1:51),BGPX,0)
 .I $O(^BGPINDN(BGPIC,52,0)) W !!,"Past Performance and/or Target:" S BGPX=0 F  S BGPX=$O(^BGPINDN(BGPIC,52,BGPX)) Q:BGPX'=+BGPX  D
 ..I $Y>(BGPIOSL-3) D HEADER^BGP9DPH Q:BGPQUIT
 ..W !,^BGPINDN(BGPIC,52,BGPX,0)
 .I $O(^BGPINDN(BGPIC,55,0)) W !!,"Source:" S BGPX=0 F  S BGPX=$O(^BGPINDN(BGPIC,55,BGPX)) Q:BGPX'=+BGPX  D
 ..I $Y>(BGPIOSL-3) D HEADER^BGP9DPH Q:BGPQUIT
 ..W !,^BGPINDN(BGPIC,55,BGPX,0)
 .I '$O(^BGPINDN(BGPIC,55,0)) W !
CALC .X ^BGPINDN(BGPIC,3) W !
 .I $G(BGPNPL),$D(BGPINDL(BGPIC)),'$D(BGP9NPLT) S BGPINDN=BGPIC D NPL1^BGP9NPLP ;printed nat gpra list
 .I $G(BGPNPL),$D(BGPINDL(BGPIC)),$D(BGP9NPLT) S BGPINDN=BGPIC D CT^BGP9DSTM ;printed nat gpra SEARCH TEMPLATE
 ;
 I BGPIC="" S BGPIFTR=1
 I BGPRTYPE=1 D ^BGP9DSPN  ;NON GPRA
 I BGPRTYPE=1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..S BGPONN1(X)=L_U_$P(N,U,9)_U_D_U_$$DATE^BGP9UTL($P(N,U,13)) S P=5 F Y=1:1:6 S $P(BGPONN1(X),U,P)=$$DATE^BGP9UTL($P(N,U,Y)),P=P+1
 ..S BGPONN2(X)=L_U_$P(N,U,9)_U_D_U_$$DATE^BGP9UTL($P(N,U,13)) S P=5 F Y=1:1:6 S $P(BGPONN2(X),U,P)=$$DATE^BGP9UTL($P(N,U,Y)),P=P+1
 ..S BGPONN3(X)=L_U_$P(N,U,9)_U_D_U_$$DATE^BGP9UTL($P(N,U,13)) S P=5 F Y=1:1:6 S $P(BGPONN3(X),U,P)=$$DATE^BGP9UTL($P(N,U,Y)),P=P+1
 ..Q
 .Q
 ;S X=BGPRPT
 ;S N=^BGPGPDCN(X,0)
 ;S L=$P(N,U,9),L=$O(^AUTTLOC("C",L,0)) S D=$P($G(^AUTTLOC(L,1)),U,3),L=$S(L:$P(^DIC(4,L,0),U),1:"?????")
 ;S BGPEI(X)=L_U_$P(N,U,9)_U_D_U_$$DATE^BGP9UTL($P(N,U,13)) S P=5 F Y=1:1:6 S $P(BGPEI(X),U,P)=$$DATE^BGP9UTL($P(N,U,Y)),P=P+1
 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