BNIGVL1 ; IHS/CMI/LAB - process record list ;
;;1.0;BNI CPHD ACTIVITY DATASYSTEM;;DEC 20, 2006
;
;
;
START ;
S (BNIGBT,BNIGBTH)=$H,BNIGJOB=$J,BNIGRCNT=0
D XTMP^BNIGVLU("BNIGVL","CPHAD GENERAL RETRIEVAL")
D @BNIGTYPE,END
Q
;
RS ; Run by visit date
S X1=BNIGBD,X2=-1 D C^%DTC S BNIGSD=X
S BNIGODAT=BNIGSD_".9999" F S BNIGODAT=$O(^BNIREC("B",BNIGODAT)) Q:BNIGODAT=""!($E(BNIGODAT,1,5)>$E(BNIGED,1,5)) D V1
Q
;
;
END ;
S BNIGET=$H
Q
V1 ;
S BNIGVIEN="" F S BNIGVIEN=$O(^BNIREC("B",BNIGODAT,BNIGVIEN)) Q:BNIGVIEN'=+BNIGVIEN I $D(^BNIREC(BNIGVIEN,0)) D PROC
Q
PROC ;
K BNIGSPEC,BNIGVREC,BNIGPREC,DFN
I BNIGPTVS="R" S BNIGVREC=^BNIREC(BNIGVIEN,0)
D SCREENS
Q:$D(BNIGSKIP)
K BNIGSRT,BNIGPRNT S BNIGCRIT=BNIGSORT,BNIGX=0
X:$D(^BNIGRI(BNIGSORT,4)) ^BNIGRI(BNIGSORT,4) I '$D(BNIGPRNT) D
. I BNIGPTVS="R" S Y=$P($P(BNIGVREC,U),".") S BNIGPRNT=Y Q
.Q
S BNIGSRT=BNIGPRNT
S ^XTMP("BNIGVL",BNIGJOB,BNIGBTH,"DATA HITS",BNIGSRT,BNIGVIEN)="",BNIGRCNT=BNIGRCNT+1
Q
SCREENS ;
K BNIGSKIP
S BNIGI=0 F S BNIGI=$O(^BNIRTMP(BNIGRPT,11,BNIGI)) Q:BNIGI'=+BNIGI!($D(BNIGSKIP)) D
.I '$P(^BNIGRI(BNIGI,0),U,8) D SINGLE Q
.D MULT
.Q
Q
SINGLE ;
K X,BNIGSPEC S X="",BNIGX=0
X:$D(^BNIGRI(BNIGI,1)) ^(1)
I X="" S BNIGSKIP="" Q
I '$D(BNIGSPEC),'$D(^BNIRTMP(BNIGRPT,11,BNIGI,11,"B",X)) S BNIGSKIP="" Q
Q
MULT ;
K BNIGFOUN,BNIGSKIP,BNIGSPEC,X S BNIGX=0,X=""
X:$D(^BNIGRI(BNIGI,1)) ^(1)
I $O(X(""))="" S BNIGSKIP="" Q
I '$D(BNIGSPEC) S Y="" F S Y=$O(X(Y)) Q:Y="" I $D(^BNIRTMP(BNIGRPT,11,BNIGI,11,"B",Y)) S BNIGFOUN="" Q
I $D(BNIGSPEC),$G(X) S BNIGFOUN=1 Q
S:'$D(BNIGFOUN) BNIGSKIP=""
Q
XIT ;EP - CALLED FROM BNIGVL
D EN^XBVK("BNIG"),EN^XBVK("AMQQ")
XIT1 ;EP
K BNIGANS,BNIGBTH,BNIGC,BNIGCNT,BNIGCRIT,BNIGCUT,BNIGD,BNIGDISP,BNIGDONE,BNIGHIGH,BNIGI,BNIGJOB,BNIGQMAN,BNIGSEL,BNIGTEXT,BNIGVAR,BNIGSKIP,BNIGPRNT,BNIGPRNM,BNIGLINE,BNIGRCNT,BNIGSCNT,BNIGDFET,BNIGY,DFN
K X,X1,X2,IO("Q"),%,Y,POP,DIRUT,ZTSK,ZTQUEUED,H,S,TS,M,ZTIO,DUOUT,DIR,DTOUT,V,Z,I,DIC,DIK,DIADD,DLAYGO,DA,DR,DIE,DIU,AMQQTAX,DINUM,BNIGPACK,BNIGEP1,BNIGEP2,D,BNIGLENG,BNIGLHDR,BNIGSAVE,AMQQND
Q
BNIGVL1 ; IHS/CMI/LAB - process record list ;
+1 ;;1.0;BNI CPHD ACTIVITY DATASYSTEM;;DEC 20, 2006
+2 ;
+3 ;
+4 ;
START ;
+1 SET (BNIGBT,BNIGBTH)=$HOROLOG
SET BNIGJOB=$JOB
SET BNIGRCNT=0
+2 DO XTMP^BNIGVLU("BNIGVL","CPHAD GENERAL RETRIEVAL")
+3 DO @BNIGTYPE
DO END
+4 QUIT
+5 ;
RS ; Run by visit date
+1 SET X1=BNIGBD
SET X2=-1
DO C^%DTC
SET BNIGSD=X
+2 SET BNIGODAT=BNIGSD_".9999"
FOR
SET BNIGODAT=$ORDER(^BNIREC("B",BNIGODAT))
IF BNIGODAT=""!($EXTRACT(BNIGODAT,1,5)>$EXTRACT(BNIGED,1,5))
QUIT
DO V1
+3 QUIT
+4 ;
+5 ;
END ;
+1 SET BNIGET=$HOROLOG
+2 QUIT
V1 ;
+1 SET BNIGVIEN=""
FOR
SET BNIGVIEN=$ORDER(^BNIREC("B",BNIGODAT,BNIGVIEN))
IF BNIGVIEN'=+BNIGVIEN
QUIT
IF $DATA(^BNIREC(BNIGVIEN,0))
DO PROC
+2 QUIT
PROC ;
+1 KILL BNIGSPEC,BNIGVREC,BNIGPREC,DFN
+2 IF BNIGPTVS="R"
SET BNIGVREC=^BNIREC(BNIGVIEN,0)
+3 DO SCREENS
+4 IF $DATA(BNIGSKIP)
QUIT
+5 KILL BNIGSRT,BNIGPRNT
SET BNIGCRIT=BNIGSORT
SET BNIGX=0
+6 IF $DATA(^BNIGRI(BNIGSORT,4))
XECUTE ^BNIGRI(BNIGSORT,4)
IF '$DATA(BNIGPRNT)
Begin DoDot:1
+7 IF BNIGPTVS="R"
SET Y=$PIECE($PIECE(BNIGVREC,U),".")
SET BNIGPRNT=Y
QUIT
+8 QUIT
End DoDot:1
+9 SET BNIGSRT=BNIGPRNT
+10 SET ^XTMP("BNIGVL",BNIGJOB,BNIGBTH,"DATA HITS",BNIGSRT,BNIGVIEN)=""
SET BNIGRCNT=BNIGRCNT+1
+11 QUIT
SCREENS ;
+1 KILL BNIGSKIP
+2 SET BNIGI=0
FOR
SET BNIGI=$ORDER(^BNIRTMP(BNIGRPT,11,BNIGI))
IF BNIGI'=+BNIGI!($DATA(BNIGSKIP))
QUIT
Begin DoDot:1
+3 IF '$PIECE(^BNIGRI(BNIGI,0),U,8)
DO SINGLE
QUIT
+4 DO MULT
+5 QUIT
End DoDot:1
+6 QUIT
SINGLE ;
+1 KIL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