BRNRU1 ; IHS/OIT/LJF - REPORTING UTILITY SCREEN LOGIC
;;2.0;RELEASE OF INFO SYSTEM;*1*;APR 10, 2003
;IHS/OIT/LJF 10/19/2007 PATCH 1 Added this routine series and function to patch 1
;
ADD ;EP; called by ^BRNRU to use previous report or create a new temporary one
K BRNCAND
W !!
I $D(BRNNCAN) G ADD1
I $D(BRNSEAT),'$D(BRNEP1) G ADD1
S DIR(0)="Y",DIR("A")="Do you want to use a PREVIOUSLY DEFINED REPORT",DIR("B")="N" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
I $D(DIRUT) S BRNQUIT=1 Q
I 'Y G ADD1
S DIC="^BRNRPT("
S DIC("S")="I $P(^(0),U,2)" S:$D(BRNEP1) DIC("S")=DIC("S")_"&($P(^(0),U,9)=BRNPACK)"
S DIC(0)="AEQ",DIC("A")="REPORT NAME: ",D="C"
D IX^DIC K DIC,DA,DR
I Y=-1 S BRNQUIT=1 Q
S BRNRPT=+Y,BRNCAND=1
;--- set up sorting and report control variables
S BRNSORT=$P(^BRNRPT(BRNRPT,0),U,7),BRNSORV=$P(^(0),U,8),BRNSPAG=$P(^(0),U,4),BRNCTYP=$P(^(0),U,5)
S $P(^BRNRPT(BRNRPT,13),U)=$G(BRNBD),$P(^BRNRPT(BRNRPT,13),U,2)=$G(BRNED)
S X=0 F S X=$O(^BRNRPT(BRNRPT,12,X)) Q:X'=+X S BRNTCW=BRNTCW+$P(^BRNRPT(BRNRPT,12,X,0),U,2)+2
Q
ADD1 ;
;CREATE REPORT ENTRY IN FILEMAN FILE
S %H=$H D YX^%DTC S X=$P(^VA(200,DUZ,0),U)_"-"_Y
S DIC(0)="L",DIC="^BRNRPT(",DLAYGO=9001003.8,DIADD=1,DIC("DR")=".13////"_DUZ
D ^DIC K DIC,DA,DR,DIADD,DLAYGO I Y=-1 W !!,"UNABLE TO CREATE REPORT FILE ENTRY - NOTIFY SITE MANAGER!" S BRNQUIT=1 Q
S BRNRPT=+Y
K DIC,DIADD,DLAYGO,DR,DA,DD,X,Y,DINUM
;DELETE ALL 11 MULTIPLE HERE
K ^BRNRPT(BRNRPT,11)
Q
PAUSE ;EP
Q:$E(IOST)'="C"!(IO'=IO(0))
W ! S DIR(0)="EO",DIR("A")="Press enter to continue...." D ^DIR K DIR S:$D(DUOUT) DIRUT=1
Q
;
BRNRU1 ; IHS/OIT/LJF - REPORTING UTILITY SCREEN LOGIC
+1 ;;2.0;RELEASE OF INFO SYSTEM;*1*;APR 10, 2003
+2 ;IHS/OIT/LJF 10/19/2007 PATCH 1 Added this routine series and function to patch 1
+3 ;
ADD ;EP; called by ^BRNRU to use previous report or create a new temporary one
+1 KILL BRNCAND
+2 WRITE !!
+3 IF $DATA(BRNNCAN)
GOTO ADD1
+4 IF $DATA(BRNSEAT)
IF '$DATA(BRNEP1)
GOTO ADD1
+5 SET DIR(0)="Y"
SET DIR("A")="Do you want to use a PREVIOUSLY DEFINED REPORT"
SET DIR("B")="N"
DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+6 IF $DATA(DIRUT)
SET BRNQUIT=1
QUIT
+7 IF 'Y
GOTO ADD1
+8 SET DIC="^BRNRPT("
+9 SET DIC("S")="I $P(^(0),U,2)"
IF $DATA(BRNEP1)
SET DIC("S")=DIC("S")_"&($P(^(0),U,9)=BRNPACK)"
+10 SET DIC(0)="AEQ"
SET DIC("A")="REPORT NAME: "
SET D="C"
+11 DO IX^DIC
KILL DIC,DA,DR
+12 IF Y=-1
SET BRNQUIT=1
QUIT
+13 SET BRNRPT=+Y
SET BRNCAND=1
+14 ;--- set up sorting and report control variables
+15 SET BRNSORT=$PIECE(^BRNRPT(BRNRPT,0),U,7)
SET BRNSORV=$PIECE(^(0),U,8)
SET BRNSPAG=$PIECE(^(0),U,4)
SET BRNCTYP=$PIECE(^(0),U,5)
+16 SET $PIECE(^BRNRPT(BRNRPT,13),U)=$GET(BRNBD)
SET $PIECE(^BRNRPT(BRNRPT,13),U,2)=$GET(BRNED)
+17 SET X=0
FOR
SET X=$ORDER(^BRNRPT(BRNRPT,12,X))
IF X'=+X
QUIT
SET BRNTCW=BRNTCW+$PIECE(^BRNRPT(BRNRPT,12,X,0),U,2)+2
+18 QUIT
ADD1 ;
+1 ;CREATE REPORT ENTRY IN FILEMAN FILE
+2 SET %H=$HOROLOG
DO YX^%DTC
SET X=$PIECE(^VA(200,DUZ,0),U)_"-"_Y
+3 SET DIC(0)="L"
SET DIC="^BRNRPT("
SET DLAYGO=9001003.8
SET DIADD=1
SET DIC("DR")=".13////"_DUZ
+4 DO ^DIC
KILL DIC,DA,DR,DIADD,DLAYGO
IF Y=-1
WRITE !!,"UNABLE TO CREATE REPORT FILE ENTRY - NOTIFY SITE MANAGER!"
SET BRNQUIT=1
QUIT
+5 SET BRNRPT=+Y
+6 KILL DIC,DIADD,DLAYGO,DR,DA,DD,X,Y,DINUM
+7 ;DELETE ALL 11 MULTIPLE HERE
+8 KILL ^BRNRPT(BRNRPT,11)
+9 QUIT
PAUSE ;EP
+1 IF $EXTRACT(IOST)'="C"!(IO'=IO(0))
QUIT
+2 WRITE !
SET DIR(0)="EO"
SET DIR("A")="Press enter to continue...."
DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+3 QUIT
+4 ;