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

BGP9GR2.m

Go to the documentation of this file.
BGP9GR2 ; IHS/CMI/LAB - BGPG Visual CRS Reports 12/30/2004 12:29:35 PM 27 Apr 2008 10:30 PM ;
 ;;9.0;IHS CLINICAL REPORTING;**1**;JUL 01, 2009
 ;
 ;
CATSTR(BGPSRET,STR) ;EP
 N BGPDA
 S BGPSRET=""
 S BGPDA=0 F  S BGPDA=$O(STR(BGPDA)) Q:'BGPDA  D
 . S BGPSRET=BGPSRET_$G(STR(BGPDA))
 Q
 ;
XP(RETVAL,BGPSTR) ;EP
 S X="MERR^BGP9GU",@^%ZOSF("TRAP")
 N BGPI,BGPJ,BGPDATA,BGPDA,P,BGPERR,BGPCT,BGPEX,BGPLD,BGPRT
 ;BGPCT = COMMUNITY TAXONOMY IEN OR NAME
 ;BGPEX = EXPORT 1 or 0
 ;BGPLD = local files 1 or 0
 ;BGPRT = time to run report
 ;
 S P="|",R="~"
 S BGPI=0
 S BGPERR=""
 S BGPCT=$P($P(BGPSTR,P),R)
 I $P(BGPCT,R)'?.N S BGPCT=$O(^ATXAX("B",BGPCT,0))
 ;S BGPCT=$O(^ATXAX("B",BGPCT,0))
 S BGPEX=$P(BGPSTR,P,2)
 S BGPLD=$P(BGPSTR,P,3)
 S BGPOPT="CR 09 COMPREHENSIVE NATIONAL EXPORT"
 S BGPMFITI=$P(BGPSTR,P,4)  ;added for mfi v6.1
 S BGPRT=$P(BGPSTR,P,5)
 K ^BGPTMP($J)
 S RETVAL="^BGPTMP("_$J_")"
 S ^BGPTMP($J,BGPI)="T00250DATA"_$C(30)
 D EP^BGP9GNXP(.BGPERR,DUZ,DUZ(2),BGPOPT,BGPCT,BGPEX,BGPLD,BGPMFITI,BGPRT)
 S BGPI=BGPI+1
 S ^BGPTMP($J,BGPI)=+$G(BGPERR)_$C(30)
 S ^BGPTMP($J,BGPI+1)=$C(31)
 D EN^XBVK("BGP")
 Q
 ;
PED(RETVAL,BGPSTR) ;EP
 S X="MERR^BGP9GU",@^%ZOSF("TRAP") ; m error trap
 N BGPI,BGPJ,BGPDATA,BGPDA,P,BGPERR,BGPCT,BGPOT,BGPOPT,BGPRT,P,R,A,BGPFN
 N BGPTP,BGPQTR,BGPRDT,BGPRE,BGPBAS,BGPPATT,BGPLIST,BGPPRV,BGPPROV,BGPEXP,BGPIND
 S P="|",R="~",A="*"
 I $G(BGPSTR)="" D CATSTR(.BGPSTR,.BGPSTR)
 S BGPI=0
 S BGPERR=""
 S BGPCT=$P($P(BGPSTR,P),R)
 I $P(BGPCT,R)'?.N S BGPCT=$O(^ATXAX("B",BGPCT,0))
 S BGPTP=$P(BGPSTR,P,2)
 S BGPQTR=$P(BGPSTR,P,3)
 S BGPRDT=$P(BGPSTR,P,4)
 S BGPRE=$P(BGPSTR,P,5)
 S BGPOPT="CRS 09 PATIENT EDUCATION REPORT"
 S BGPBAS=$P(BGPSTR,P,6)
 S BGPPATT=$P(BGPSTR,P,7)
 S BGPLIST=$P(BGPSTR,P,8)
 S BGPPRV=$P($P(BGPSTR,P,9),R)
 S BGPPROV=$P($P(BGPSTR,P,9),R,2)
 S BGPEXP=$P(BGPSTR,P,10)
 S BGPOT=$P(BGPSTR,P,11)
 S BGPINDI=$P(BGPSTR,P,13)
 S BGPLSTI=$P(BGPSTR,P,12)
 S BGPMFITI=$P(BGPSTR,P,14)
 S BGPFN=$P(BGPSTR,P,15)
 N I
 F I=2:1 D  Q:$P(BGPLSTI,A,I)=""
 . Q:$P(BGPLSTI,A,I)=""
 . N BGPL
 . S BGPL=$P($P(BGPLSTI,A,I),R)
 . S BGPLIST(BGPL)=""
 N J
 F J=2:1 D  Q:$P(BGPINDI,A,J)=""
 . Q:$P(BGPINDI,A,J)=""
 . N BGPL
 . S BGPL=$P($P(BGPINDI,A,J),R)
 . S BGPIND(BGPL)=""
 K ^BGPTMP($J)
 S RETVAL="^BGPTMP("_$J_")"
 S ^BGPTMP($J,BGPI)="T00250DATA"_$C(30)
 D EP^BGP9GPED(.BGPERR,DUZ,DUZ(2),BGPOPT,BGPCT,BGPTP,.BGPIND,BGPQTR,BGPRE,BGPBAS,BGPPATT,BGPLIST,.BGPLIST,BGPPRV,BGPPROV,BGPEXP,BGPOT,BGPRDT,BGPMFITI,BGPFN,"")
 S BGPI=BGPI+1
 S ^BGPTMP($J,BGPI)=$G(BGPERR)_$C(30)
 S ^BGPTMP($J,BGPI+1)=$C(31)
 D EN^XBVK("BGP")
 Q
 ;
PEDPP(RETVAL,BGPSTR) ;EP
 S X="MERR^BGP9GU",@^%ZOSF("TRAP") ; m error trap
 N BGPI,BGPJ,BGPDATA,BGPDA,P,BGPERR,BGPST,BGPOT,BGPOPT,BGPRT,P,R,A,BGPFN,BGPSTMP
 N BGPTP,BGPQTR,BGPRDT,BGPRE,BGPBAS,BGPPATT,BGPLIST,BGPPRV,BGPPROV,BGPEXP,BGPIND
 S P="|",R="~",A="*"
 I $G(BGPSTR)="" D CATSTR(.BGPSTR,.BGPSTR)
 S BGPI=0
 S BGPERR=""
 S BGPST=$P($P(BGPSTR,P),R)
 I $P(BGPST,R)'?.N S BGPST=$O(^DIBT("B",BGPST,0))
 S BGPTP=$P(BGPSTR,P,2)
 S BGPQTR=$P(BGPSTR,P,3)
 S BGPRDT=$P(BGPSTR,P,4)
 S BGPRE=$P(BGPSTR,P,5)
 S BGPOPT="CRS 09 PATIENT EDUCATION REPORT"
 S BGPBAS=$P(BGPSTR,P,6)
 S BGPPATT=$P(BGPSTR,P,7)
 S BGPLIST=$P(BGPSTR,P,8)
 S BGPPRV=$P($P(BGPSTR,P,9),R)
 S BGPPROV=$P($P(BGPSTR,P,9),R,2)
 S BGPEXP=$P(BGPSTR,P,10)
 S BGPOT=$P(BGPSTR,P,11)
 S BGPINDI=$P(BGPSTR,P,13)
 S BGPLSTI=$P(BGPSTR,P,12)
 S BGPMFITI=$P(BGPSTR,P,14)
 S BGPFN=$P(BGPSTR,P,15)
 N I
 F I=2:1 D  Q:$P(BGPLSTI,A,I)=""
 . Q:$P(BGPLSTI,A,I)=""
 . N BGPL
 . S BGPL=$P($P(BGPLSTI,A,I),R)
 . S BGPLIST(BGPL)=""
 N J
 F J=2:1 D  Q:$P(BGPINDI,A,J)=""
 . Q:$P(BGPINDI,A,J)=""
 . N BGPL
 . S BGPL=$P($P(BGPINDI,A,J),R)
 . S BGPIND(BGPL)=""
 K ^BGPTMP($J)
 S RETVAL="^BGPTMP("_$J_")"
 S ^BGPTMP($J,BGPI)="T00250DATA"_$C(30)
 D EP^BGP9GPED(.BGPERR,DUZ,DUZ(2),BGPOPT,"",BGPTP,.BGPIND,BGPQTR,BGPRE,BGPBAS,BGPPATT,BGPLIST,.BGPLIST,BGPPRV,BGPPROV,BGPEXP,BGPOT,BGPRDT,BGPMFITI,BGPFN,BGPST)
 S BGPI=BGPI+1
 S ^BGPTMP($J,BGPI)=$G(BGPERR)_$C(30)
 S ^BGPTMP($J,BGPI+1)=$C(31)
 D EN^XBVK("BGP")
 Q
 ;
LHW(RETVAL,BGPSTR) ;EP
 S X="MERR^BGP9GU",@^%ZOSF("TRAP")
 N BGPI,BGPJ,BGPDATA,BGPDA,P,BGPERR,BGPCT,BGPEX,BGPLD,BGPRT,BGPMFITI,BGPOM,BGPOT,BGPFN
 ;BGPCT = COMMUNITY TAXONOMY IEN OR NAME
 ;BGPEX = EXPORT 1 or 0
 ;BGPLD = local files 1 or 0
 ;BGPRT = time to run report
 ;
 S P="|",R="~"
 S BGPI=0
 S BGPERR=""
 S BGPCT=$P($P(BGPSTR,P),R)
 I $P(BGPCT,R)'?.N S BGPCT=$O(^ATXAX("B",BGPCT,0))
 ;S BGPCT=$O(^ATXAX("B",BGPCT,0))
 S BGPOM=$P(BGPSTR,P,3)
 S BGPOPT="CRS 09 LOCAL HT/WT"
 S BGPMFITI=$P(BGPSTR,P,2)  ;added for mfi v6.1
 S BGPRT=$P(BGPSTR,P,5)
 S BGPOT=$P(BGPSTR,P,4)
 S BGPFN=$P(BGPSTR,P,6)
 K ^BGPTMP($J)
 S RETVAL="^BGPTMP("_$J_")"
 S ^BGPTMP($J,BGPI)="T00250DATA"_$C(30)
 D EP^BGP9GLHW(.BGPERR,DUZ,DUZ(2),BGPOPT,BGPCT,BGPMFITI,BGPOM,BGPOT,BGPRT,BGPFN)
 S BGPI=BGPI+1
 S ^BGPTMP($J,BGPI)=$G(BGPERR)_$C(30)
 S ^BGPTMP($J,BGPI+1)=$C(31)
 D EN^XBVK("BGP")
 Q
 ;