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

BGP0GRB.m

Go to the documentation of this file.
  1. BGP0GRB ; IHS/CMI/LAB - BGP Gui Area Reports 5/2/2005 8:38:59 PM ;
  1. ;;10.0;IHS CLINICAL REPORTING;**1**;JUN 18, 2010
  1. ;
  1. ;
  1. ;
  1. ;area GPRA reports
  1. Q
  1. ;
  1. DEBUG(RETVAL,BGPSTR) ;run the debugger
  1. D DEBUG^%Serenji("FOR^BGP0GRB(.RETVAL,.BGPSTR)")
  1. Q
  1. ;
  1. FOR(RETVAL,BGPSTR) ;-- gpra patient forcast report
  1. S X="MERR^BGP0GU",@^%ZOSF("TRAP") ; m error trap
  1. N BGPI,BGPGDA,P,R,BGPLST,BGPDIV,BGPBADT,BGPEADT,BGPCLN,BGPPATL,BGPPATI,BGPPAT,BGPCLNL,BGPST,BGPSTI,BGPCNT,BGPFN
  1. S P="|",R="~"
  1. S RETVAL="^BGPTMP("_$J_")"
  1. S BGPI=0
  1. S BGPOPT="CRS 10 PATIENT FORECAST REPORT"
  1. I $G(BGPSTR)="" D CATSTR^BGP0GU(.BGPSTR,.BGPSTR)
  1. S BGPLST=$P(BGPSTR,P)
  1. S BGPDIV=$P(BGPSTR,P,2)
  1. I BGPDIV]"" S BGPDIV=$O(^DG(40.8,"B",BGPDIV,0))
  1. S BGPBADT=$P(BGPSTR,P,3)
  1. S BGPEADT=$P(BGPSTR,P,4)
  1. S BGPCLNL=$P(BGPSTR,P,5)
  1. S BGPPATL=$P(BGPSTR,P,6)
  1. S BGPPATI=$P(BGPSTR,P,7)
  1. I BGPPATI]"" S BGPPATL(BGPPATI)="",BGPPAT(BGPPATI)=""
  1. S BGPRT=$P(BGPSTR,P,8)
  1. S BGPST=$P(BGPSTR,P,9)
  1. S BGPFN=$P(BGPSTR,P,10)
  1. ;I BGPST]"" S BGPSTI=$O(^DIBT("B",BGPST,0))
  1. I BGPCLNL]"",BGPCLNL'="A" D
  1. . N I
  1. . F I=1:1 D Q:$P(BGPCLNL,R,I)=""
  1. .. Q:$P(BGPCLNL,R,I)=""
  1. .. S BGPCLN($P(BGPCLNL,R,I))=$P(BGPCLNL,R,I)
  1. I BGPPATL]"" D
  1. . N J
  1. . F J=1:1 D Q:$P(BGPPATL,R,J)=""
  1. .. Q:$P(BGPPATL,R,J)=""
  1. .. S BGPPAT($P(BGPPATL,R,J))=$P(BGPPATL,R,J)
  1. I $G(BGPST) D
  1. . N BGPDA
  1. . S BGPCNT=0
  1. . S BGPDA=0 F S BGPDA=$O(^DIBT(BGPST,1,BGPDA)) Q:'BGPDA D
  1. .. S BGPCNT=BGPCNT+1
  1. .. S BGPPAT(BGPCNT)=BGPDA
  1. S ^BGPTMP($J,BGPI)="T00250DATA"_$C(30)
  1. D EP^BGP0GFOR(.BGPERR,DUZ,DUZ(2),BGPOPT,BGPLST,BGPDIV,BGPBADT,BGPEADT,.BGPCLN,.BGPPAT,BGPRT,BGPFN)
  1. S BGPI=BGPI+1
  1. S ^BGPTMP($J,BGPI)=+$G(BGPERR)_$C(30)
  1. S ^BGPTMP($J,BGPI+1)=$C(31)
  1. D EN^XBVK("BGP")
  1. Q
  1. ;
  1. FORD(RETVAL,BGPSTR) ;-- return the patient forecast denominator
  1. S X="MERR^BGP0GU",@^%ZOSF("TRAP") ; m error trap
  1. N P,BGPRDT,BGPFN
  1. S P="|"
  1. S BGPRDT=$P(BGPSTR,P)
  1. S BGPFN=$P(BGPSTR,P,2)
  1. S RETVAL="^BGPTMP("_$J_")"
  1. S BGPI=0
  1. S BGPGUI=1
  1. S BGPOPT="CRS 10 PATIENT FORECAST DENOMINATOR DEFINITIONS"
  1. D ^XBFMK
  1. D GUILOG(BGPOPT,BGPRDT,BGPFN)
  1. S ^BGPTMP($J,BGPI)="T00250DATA"_$C(30)
  1. K ZTSAVE S ZTSAVE("*")=""
  1. S ZTIO="",ZTDTH=$S(BGPRDT]"":BGPRDT,1:$$NOW^XLFDT),ZTRTN="GUIECP^BGP0DPA",ZTDESC="GUI Denominator Definitions" D ^%ZTLOAD
  1. S BGPI=BGPI+1
  1. S ^BGPTMP($J,BGPI)=+$G(BGPERR)_$C(30)
  1. S ^BGPTMP($J,BGPI+1)=$C(31)
  1. D EN^XBVK("BGP")
  1. Q
  1. AEO(RETVAL,BGPSTR) ;-- area EO report
  1. S X="MERR^BGP0GU",@^%ZOSF("TRAP") ; m error trap
  1. N BGPI,BGPJ,BGPDATA,BGPDA,P,BGPERR,BGPCT,BGPYN,BGPOT,BGPOPT,BGPRT,BGPHC
  1. N BGPQTR,BGPRE,BGPBAS,BGPBEN,BGPFAC,A,R,BGPFN
  1. I $G(BGPSTR)="" D CATSTR^BGPGR(.BGPSTR,.BGPSTR)
  1. S P="|",A="*",R="~"
  1. S BGPI=0
  1. S BGPERR=""
  1. S BGPQTR=$P(BGPSTR,P)
  1. S BGPRT=$P(BGPSTR,P,2)
  1. S BGPRE=$P(BGPSTR,P,3)
  1. S BGPPER=$P(BGPSTR,P,4)
  1. S BGPBAS=$P(BGPSTR,P,5)
  1. S BGPBEN=$P(BGPSTR,P,6)
  1. S BGPOT=$P(BGPSTR,P,7)
  1. S BGPLSTI=$P(BGPSTR,P,8)
  1. S BGPHC=$P(BGPSTR,P,9)
  1. S BGPFN=$P(BGPSTR,P,11)
  1. S BGPOPT="CRS 10 AREA EO REPORT"
  1. N I
  1. F I=2:1 D Q:$P(BGPLSTI,A,I)=""
  1. . Q:$P(BGPLSTI,A,I)=""
  1. . N BGPL
  1. . S BGPL=$P($P(BGPLSTI,A,I),R)
  1. . S BGPLIST(BGPL)=""
  1. K ^BGPTMP($J)
  1. S RETVAL="^BGPTMP("_$J_")"
  1. S ^BGPTMP($J,BGPI)="T00250DATA"_$C(30)
  1. D EP^BGP0GAEO(.BGPERR,DUZ,DUZ(2),BGPOPT,BGPRT,.BGPLIST,BGPQTR,BGPPER,BGPBAS,BGPBEN,BGPOT,BGPRE,BGPHC,BGPFN)
  1. S BGPI=BGPI+1
  1. S ^BGPTMP($J,BGPI)=$G(BGPERR)_$C(30)
  1. S ^BGPTMP($J,BGPI+1)=$C(31)
  1. D EN^XBVK("BGP")
  1. Q
  1. ;
  1. GUILOG(BGPOPT,RDT,FN) ;-- log in the GUI REPORT FILE
  1. D NOW^%DTC
  1. S BGPNOW=$G(%)
  1. K DD,D0,DIC
  1. S X=DUZ_$$NOW^XLFDT
  1. S X=FN
  1. S BGPGFNM=X
  1. S DIC="^BGPGUIT(",DIC(0)="L",DIADD=1,DLAYGO=90378.08,DIC("DR")=".02////"_DUZ_";.03////"_$S(RDT]"":RDT,1:$$NOW^XLFDT)_";.05///"_BGPOPT_";.06///R;.07///P"
  1. K DD,D0,DO D FILE^DICN K DLAYGO,DIADD,DD,D0,DO
  1. I Y=-1 S BGPIEN=-1 Q
  1. S BGPIEN=+Y
  1. Q
  1. ;
  1. FOR9(RETVAL,BGPSTR) ;-- gpra patient forcast report
  1. S X="MERR^BGP0GU",@^%ZOSF("TRAP") ; m error trap
  1. N BGPI,BGPGDA,P,R,BGPLST,BGPDIV,BGPBADT,BGPEADT,BGPCLN,BGPPATL,BGPPATI,BGPPAT,BGPCLNL,BGPST,BGPSTI,BGPCNT,BGPFN
  1. S P="|",R="~"
  1. S RETVAL="^BGPTMP("_$J_")"
  1. S BGPI=0
  1. S BGPOPT="CRS 10 PATIENT FORECAST REPORT 10"
  1. I $G(BGPSTR)="" D CATSTR^BGP0GU(.BGPSTR,.BGPSTR)
  1. S BGPLST=$P(BGPSTR,P)
  1. S BGPDIV=$P(BGPSTR,P,2)
  1. I BGPDIV]"" S BGPDIV=$O(^DG(40.8,"B",BGPDIV,0))
  1. S BGPBADT=$P(BGPSTR,P,3)
  1. S BGPEADT=$P(BGPSTR,P,4)
  1. S BGPCLNL=$P(BGPSTR,P,5)
  1. S BGPPATL=$P(BGPSTR,P,6)
  1. S BGPPATI=$P(BGPSTR,P,7)
  1. I BGPPATI]"" S BGPPATL(BGPPATI)="",BGPPAT(BGPPATI)=""
  1. S BGPRT=$P(BGPSTR,P,8)
  1. S BGPST=$P(BGPSTR,P,9)
  1. S BGPFN=$P(BGPSTR,P,10)
  1. I BGPST]"" S BGPSTI=$O(^DIBT("B",BGPST,0))
  1. I BGPCLNL]"",BGPCLNL'="A" D
  1. . N I
  1. . F I=1:1 D Q:$P(BGPCLNL,R,I)=""
  1. .. Q:$P(BGPCLNL,R,I)=""
  1. .. S BGPCLN($P(BGPCLNL,R,I))=$P(BGPCLNL,R,I)
  1. I BGPPATL]"" D
  1. . N J
  1. . F J=1:1 D Q:$P(BGPPATL,R,J)=""
  1. .. Q:$P(BGPPATL,R,J)=""
  1. .. S BGPPAT($P(BGPPATL,R,J))=$P(BGPPATL,R,J)
  1. I $G(BGPSTI) D
  1. . N BGPDA
  1. . S BGPCNT=0
  1. . S BGPDA=0 F S BGPDA=$O(^DIBT(BGPSTI,1,BGPDA)) Q:'BGPDA D
  1. .. S BGPCNT=BGPCNT+1
  1. .. S BGPPAT(BGPCNT)=BGPDA
  1. S ^BGPTMP($J,BGPI)="T00250DATA"_$C(30)
  1. D EP^BGP0GFO9(.BGPERR,DUZ,DUZ(2),BGPOPT,BGPLST,BGPDIV,BGPBADT,BGPEADT,.BGPCLN,.BGPPAT,BGPRT,BGPFN)
  1. S BGPI=BGPI+1
  1. S ^BGPTMP($J,BGPI)=+$G(BGPERR)_$C(30)
  1. S ^BGPTMP($J,BGPI+1)=$C(31)
  1. D EN^XBVK("BGP")
  1. Q
  1. ;
  1. FOR10(RETVAL,BGPSTR) ;-- gpra patient forcast report
  1. S X="MERR^BGP0GU",@^%ZOSF("TRAP") ; m error trap
  1. N BGPI,BGPGDA,P,R,BGPLST,BGPDIV,BGPBADT,BGPEADT,BGPCLN,BGPPATL,BGPPATI,BGPPAT,BGPCLNL,BGPST,BGPSTI,BGPCNT,BGPFN
  1. S P="|",R="~"
  1. S RETVAL="^BGPTMP("_$J_")"
  1. S BGPI=0
  1. S BGPOPT="CRS 10 PATIENT FORECAST REPORT 10"
  1. I $G(BGPSTR)="" D CATSTR^BGP0GU(.BGPSTR,.BGPSTR)
  1. S BGPLST=$P(BGPSTR,P)
  1. S BGPDIV=$P(BGPSTR,P,2)
  1. I BGPDIV]"" S BGPDIV=$O(^DG(40.8,"B",BGPDIV,0))
  1. S BGPBADT=$P(BGPSTR,P,3)
  1. S BGPEADT=$P(BGPSTR,P,4)
  1. S BGPCLNL=$P(BGPSTR,P,5)
  1. S BGPPATL=$P(BGPSTR,P,6)
  1. S BGPPATI=$P(BGPSTR,P,7)
  1. I BGPPATI]"" S BGPPATL(BGPPATI)="",BGPPAT(BGPPATI)=""
  1. S BGPRT=$P(BGPSTR,P,8)
  1. S BGPST=$P(BGPSTR,P,9)
  1. S BGPFN=$P(BGPSTR,P,10)
  1. I BGPST]"" S BGPSTI=$O(^DIBT("B",BGPST,0))
  1. I BGPCLNL]"",BGPCLNL'="A" D
  1. . N I
  1. . F I=1:1 D Q:$P(BGPCLNL,R,I)=""
  1. .. Q:$P(BGPCLNL,R,I)=""
  1. .. S BGPCLN($P(BGPCLNL,R,I))=$P(BGPCLNL,R,I)
  1. I BGPPATL]"" D
  1. . N J
  1. . F J=1:1 D Q:$P(BGPPATL,R,J)=""
  1. .. Q:$P(BGPPATL,R,J)=""
  1. .. S BGPPAT($P(BGPPATL,R,J))=$P(BGPPATL,R,J)
  1. I $G(BGPSTI) D
  1. . N BGPDA
  1. . S BGPCNT=0
  1. . S BGPDA=0 F S BGPDA=$O(^DIBT(BGPSTI,1,BGPDA)) Q:'BGPDA D
  1. .. S BGPCNT=BGPCNT+1
  1. .. S BGPPAT(BGPCNT)=BGPDA
  1. S ^BGPTMP($J,BGPI)="T00250DATA"_$C(30)
  1. D EP^BGP0GFO9(.BGPERR,DUZ,DUZ(2),BGPOPT,BGPLST,BGPDIV,BGPBADT,BGPEADT,.BGPCLN,.BGPPAT,BGPRT,BGPFN)
  1. S BGPI=BGPI+1
  1. S ^BGPTMP($J,BGPI)=+$G(BGPERR)_$C(30)
  1. S ^BGPTMP($J,BGPI+1)=$C(31)
  1. D EN^XBVK("BGP")
  1. Q
  1. ;