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