BGP9GTA ; IHS/CMI/LAB - BGPG Gui CRS Tables 2/2/2005 10:24:22 AM ;
;;9.0;IHS CLINICAL REPORTING;**1**;JUL 01, 2009
;
;
;
DIV(RETVAL) ;-- return all medical center divisions
S X="MERR^BGP9GU",@^%ZOSF("TRAP") ; m error trap
N BGPGI,BGPGDA
S RETVAL="^BGPGTMP("_$J_")"
S BGPGI=0
S ^BGPGTMP($J,BGPGI)="T00050DIVISIONS"_$C(30)
S BGPGDA=0 F S BGPGDA=$O(^DG(40.8,"B",BGPGDA)) Q:BGPGDA="" D
. S BGPGI=BGPGI+1
. S ^BGPGTMP($J,BGPGI)=BGPGDA_$C(30)
S ^BGPGTMP($J,BGPGI+1)=$C(31)
Q
;
BGP9GTA ; IHS/CMI/LAB - BGPG Gui CRS Tables 2/2/2005 10:24:22 AM ;
+1 ;;9.0;IHS CLINICAL REPORTING;**1**;JUL 01, 2009
+2 ;
+3 ;
+4 ;
DIV(RETVAL) ;-- return all medical center divisions
+1 ; m error trap
SET X="MERR^BGP9GU"
SET @^%ZOSF("TRAP")
+2 NEW BGPGI,BGPGDA
+3 SET RETVAL="^BGPGTMP("_$JOB_")"
+4 SET BGPGI=0
+5 SET ^BGPGTMP($JOB,BGPGI)="T00050DIVISIONS"_$CHAR(30)
+6 SET BGPGDA=0
FOR
SET BGPGDA=$ORDER(^DG(40.8,"B",BGPGDA))
IF BGPGDA=""
QUIT
Begin DoDot:1
+7 SET BGPGI=BGPGI+1
+8 SET ^BGPGTMP($JOB,BGPGI)=BGPGDA_$CHAR(30)
End DoDot:1
+9 SET ^BGPGTMP($JOB,BGPGI+1)=$CHAR(31)
+10 QUIT
+11 ;