BNIGVLP2 ; IHS/CMI/LAB - print bni report ;
;;1.0;BNI CPHD ACTIVITY DATASYSTEM;;DEC 20, 2006
;
DONE ;EP
I $D(ZTQUEUED),BNIGCTYP="F" G DONE1
D DONE^BNIGVLU
DONE1 ;
K ^XTMP("BNIGVL",BNIGJOB,BNIGBT),^XTMP("BNIGFLAT",$J)
D DEL^BNIGVL
K BNIGBD,BNIGSD,BNIGED,BNIGEDD,BNIGBDD,BNIGRPT,BNIGHEAD,BNIGLINE,BNIGL,BNIGRCNT,BNIGI,BNIGCRIT,BNIGVIEN,BNIGVREC,BNIGJOB,BNIGBT,BNIGBTH,BNIGQUIT,BNIGHDR,BNIGDASH,BNIGLENG,BNIGPCNT,BNIGTCW,BNIGODAT,BNIGPG,AUPNDAYS,AUPNPAT,AUPNDOD,AUPNDOB,AUPNSEX
K BNIGSORT,BNIGSRT,BNIGSORX,BNIGFILE,BNIGFIEL,BNIGPRNT,BNIGX,BNIGTYPE,BNIGFOUN,D0,J,K,L,BNIGPRNM,BNIGTEST,BNIGSEAT,BNIGLHDR,BNIGFRST
Q
HEAD ;ENTRY POINT
I 'BNIGPG G HEAD1
I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S BNIGQUIT="" Q
HEAD1 ;EP
I BNIGCTYP="F",$D(ZTQUEUED) Q
W:$D(IOF) @IOF S BNIGPG=BNIGPG+1
I $G(BNIGUI) W "ZZZZZZZ",!
I $G(BNIGTITL)="",BNIGCTYP'="S" S BNIGTEXT="CPHAD RECORD LISTING",BNIGLENG=$L(BNIGTEXT) W !?((BNIGTCW-BNIGLENG)/2),BNIGTEXT,?(BNIGTCW-8),"Page ",BNIGPG
I $G(BNIGTITL)]"" S BNIGLENG=$L(BNIGTITL) W !?((BNIGTCW-BNIGLENG)/2),BNIGTITL,?(BNIGTCW-8),"Page ",BNIGPG
S X="Date Range: "_BNIGBDD_" and "_BNIGEDD W $$CTR^BNIGVL(X,$S(BNIGTCW:BNIGTCW,1:80)),!
I BNIGCTYP="S" S BNIGLENG=$L(BNIGSORV)+23 W !?((BNIGTCW-BNIGLENG)/2),"CPHAD Activity Record SUB-TOTALS BY: ",BNIGSORV,!
I $G(BNIGSPAG) S BNIGLENG=$L(BNIGSORV)+$L(BNIGSRTR)+2 S:BNIGTCW<BNIGLENG BNIGLENG=BNIGTCW W !?((BNIGTCW-BNIGLENG)/2),BNIGSORV,": ",BNIGSRTR,!
I BNIGHEAD]"" W !,BNIGHEAD,!
W BNIGDASH,!
I BNIGCTYP="S" W !,BNIGSORV,":"
I BNIGCTYP="F",$E(IOST)="C" W !!,"Flat file being created, hold on...",!
Q
BNIGVLP2 ; IHS/CMI/LAB - print bni report ;
+1 ;;1.0;BNI CPHD ACTIVITY DATASYSTEM;;DEC 20, 2006
+2 ;
DONE ;EP
+1 IF $DATA(ZTQUEUED)
IF BNIGCTYP="F"
GOTO DONE1
+2 DO DONE^BNIGVLU
DONE1 ;
+1 KILL ^XTMP("BNIGVL",BNIGJOB,BNIGBT),^XTMP("BNIGFLAT",$JOB)
+2 DO DEL^BNIGVL
+3 KILL BNIGBD,BNIGSD,BNIGED,BNIGEDD,BNIGBDD,BNIGRPT,BNIGHEAD,BNIGLINE,BNIGL,BNIGRCNT,BNIGI,BNIGCRIT,BNIGVIEN,BNIGVREC,BNIGJOB,BNIGBT,BNIGBTH,BNIGQUIT,BNIGHDR,BNIGDASH,BNIGLENG,BNIGPCNT,BNIGTCW,BNIGODAT,BNIGPG,AUPNDAYS,AUPNPAT,AUPNDOD,AUPNDOB,AUPN
SEX
+4 KILL BNIGSORT,BNIGSRT,BNIGSORX,BNIGFILE,BNIGFIEL,BNIGPRNT,BNIGX,BNIGTYPE,BNIGFOUN,D0,J,K,L,BNIGPRNM,BNIGTEST,BNIGSEAT,BNIGLHDR,BNIGFRST
+5 QUIT
HEAD ;ENTRY POINT
+1 IF 'BNIGPG
GOTO HEAD1
+2 IF $EXTRACT(IOST)="C"
IF IO=IO(0)
WRITE !
SET DIR(0)="EO"
DO ^DIR
KILL DIR
IF Y=0!(Y="^")!($DATA(DTOUT))
SET BNIGQUIT=""
QUIT
HEAD1 ;EP
+1 IF BNIGCTYP="F"
IF $DATA(ZTQUEUED)
QUIT
+2 IF $DATA(IOF)
WRITE @IOF
SET BNIGPG=BNIGPG+1
+3 IF $GET(BNIGUI)
WRITE "ZZZZZZZ",!
+4 IF $GET(BNIGTITL)=""
IF BNIGCTYP'="S"
SET BNIGTEXT="CPHAD RECORD LISTING"
SET BNIGLENG=$LENGTH(BNIGTEXT)
WRITE !?((BNIGTCW-BNIGLENG)/2),BNIGTEXT,?(BNIGTCW-8),"Page ",BNIGPG
+5 IF $GET(BNIGTITL)]""
SET BNIGLENG=$LENGTH(BNIGTITL)
WRITE !?((BNIGTCW-BNIGLENG)/2),BNIGTITL,?(BNIGTCW-8),"Page ",BNIGPG
+6 SET X="Date Range: "_BNIGBDD_" and "_BNIGEDD
WRITE $$CTR^BNIGVL(X,$SELECT(BNIGTCW:BNIGTCW,1:80)),!
+7 IF BNIGCTYP="S"
SET BNIGLENG=$LENGTH(BNIGSORV)+23
WRITE !?((BNIGTCW-BNIGLENG)/2),"CPHAD Activity Record SUB-TOTALS BY: ",BNIGSORV,!
+8 IF $GET(BNIGSPAG)
SET BNIGLENG=$LENGTH(BNIGSORV)+$LENGTH(BNIGSRTR)+2
IF BNIGTCW<BNIGLENG
SET BNIGLENG=BNIGTCW
WRITE !?((BNIGTCW-BNIGLENG)/2),BNIGSORV,": ",BNIGSRTR,!
+9 IF BNIGHEAD]""
WRITE !,BNIGHEAD,!
+10 WRITE BNIGDASH,!
+11 IF BNIGCTYP="S"
WRITE !,BNIGSORV,":"
+12 IF BNIGCTYP="F"
IF $EXTRACT(IOST)="C"
WRITE !!,"Flat file being created, hold on...",!
+13 QUIT