BWGRVL3 ; IHS/CMI/LAB - NO DESCRIPTION PROVIDED ; [ 08/16/01 3:48 PM ]
;;2.0;WOMEN'S HEALTH;**6,8**;MAY 16, 1996
;
;
;IHS/CMI/LAB - modified file number
TITLE ;EP
Q:"FTC"[BWGRCTYP
K DIR,X,Y S DIR(0)="Y",DIR("A")="Would you like a custom title for this report",DIR("B")="N" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
I $D(DIRUT) S BWGRQUIT=1 Q
Q:Y=0
S BWGRLENG=$S(BWGRTCW:BWGRTCW-8,1:60)
I Y=1 K DIR,X,Y S DIR(0)="F^3:"_BWGRLENG,DIR("A")="Enter custom title",DIR("?")=" Enter from 3 to "_BWGRLENG_" characters" D ^DIR K DIR
G:$D(DIRUT) TITLE
S BWGRTITL=Y
Q
SAVE ;EP
Q:$D(BWGRCAND) ;--- don't ask if already a pre-defined rpt
Q:BWGRCTYP'="D" ;--- must be a detailed report to be saved
S BWGRSAVE=""
K DIR,X,Y S DIR(0)="Y",DIR("A")="Do you wish to SAVE this "_$S('$D(BWGREP1):"SEARCH/",1:"")_"PRINT/SORT logic for future use",DIR("B")="N" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
Q:$D(DIRUT)
Q:'Y
K DIR,X,Y S DIR(0)="9002086.88,.03",DIR("A")="Enter NAME for this REPORT DEFINITION" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
G:$D(DIRUT) SAVE
S BWGRNAME=Y
S DIE="^BWGRTRPT(",DA=BWGRRPT,DR=".02////1;.03///"_BWGRNAME_";.06///"_BWGRPTVS_";.05///"_BWGRCTYP S:$D(BWGREP1) DR=DR_";.09///"_BWGRPACK D ^DIE K DIE,DA,DR
Q
COUNT ;EP
W !!
S DIR(0)="S^T:Total Count Only;S:Sub-counts and Total Count;D:Detailed "_$S(BWGRPTVS="R":"WH Procedure",1:"Patient")_" Listing"
S DIR("A")=" Choose Type of Report",DIR("B")="D" D ^DIR K DIR W !!
S:$D(DUOUT) DIRUT=1
I $D(DIRUT) S BWGRQUIT=1 Q
S BWGRCTYP=Y
I BWGRCTYP="T" S $P(^BWGRTRPT(BWGRRPT,0),U,5)="T" S:BWGRPTVS="R" BWGRSORT=19,BWGRSORV="Procedure Date" S:BWGRPTVS="P" BWGRSORT=1,BWGRSORV="Patient Name" Q
I BWGRCTYP="D" D PRINT Q:$D(BWGRQUIT) D SORT Q
D SORT
Q
PRINT ;
S BWGRCNTL="P"
D ^BWGRVL4
Q
SORT ;EP
K BWGRSORT,BWGRSORV,BWGRQUIT
I BWGRCTYP="D",'$D(^BWGRTRPT(BWGRRPT,12)) W !!,"NO PRINT FIELDS SELECTED!!",$C(7),$C(7) S BWGRQUIT=1 Q
S BWGRSORT=""
D SHOWR^BWGRVLS
S BWGRCNTL="R" D ^BWGRVL4 K BWGRCNTL
I '$D(BWGRSORV) S BWGRQUIT=1 Q
Q:BWGRCTYP'="D"
PAGE ;
K BWGRSPAG
Q:BWGRCTYP'="D"
S DIR(0)="Y",DIR("A")="Do you want a separate page for each "_BWGRSORV,DIR("B")="N" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
I $D(DIRUT) G SORT
S BWGRSPAG=Y,DIE="^BWGRTRPT(",DA=BWGRRPT,DR=".04///"_BWGRSPAG D ^DIE K DA,DR,DIE
Q
FLAT ;
S BWGRFILE="BWGR"_DUZ_"."
S X2=$E(DT,1,3)_"0101",X1=DT D ^%DTC S BWGRJD=X+1
S BWGRFILE=BWGRFILE_BWGRJD
W !!,"I am going to create a file called ",BWGRFILE," which will reside in ",!,"the ",$S($P(^AUTTSITE(1,0),U,21)=1:"/usr/spool/uucppublic",1:"C:\EXPORT")," directory.",!
W "Actually, the file will be placed in the same directory that the data export"
W !,"globals are placed. See your site manager for assistance in finding the file",!,"after it is created. PLEASE jot down and remember the following file name:",!?15,"********** ",BWGRFILE," **********",!
W "It may be several hours (or overnight) before your report and flat file are ",!,"finished.",!
W !,"As a reminder, the records that are generated and placed in file ",BWGRFILE,!
W !,"are in a standard, pre-defined record format. For a definition of the format",!,"please see your user manual.",!
S DIR(0)="Y",DIR("A")="Is everything ok? Do you want to continue?",DIR("B")="Y" K DA D ^DIR K DIR
I $D(DIRUT)!(Y'=1) S BWGRQUIT=1 Q
S DA=BWGRRPT,DR=".12///"_BWGRFILE,DIE="^BWGRTRPT(" D ^DIE
K DIE,DA,DR
Q
BWGRVL3 ; IHS/CMI/LAB - NO DESCRIPTION PROVIDED ; [ 08/16/01 3:48 PM ]
+1 ;;2.0;WOMEN'S HEALTH;**6,8**;MAY 16, 1996
+2 ;
+3 ;
+4 ;IHS/CMI/LAB - modified file number
TITLE ;EP
+1 IF "FTC"[BWGRCTYP
QUIT
+2 KILL DIR,X,Y
SET DIR(0)="Y"
SET DIR("A")="Would you like a custom title for this report"
SET DIR("B")="N"
DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+3 IF $DATA(DIRUT)
SET BWGRQUIT=1
QUIT
+4 IF Y=0
QUIT
+5 SET BWGRLENG=$SELECT(BWGRTCW:BWGRTCW-8,1:60)
+6 IF Y=1
KILL DIR,X,Y
SET DIR(0)="F^3:"_BWGRLENG
SET DIR("A")="Enter custom title"
SET DIR("?")=" Enter from 3 to "_BWGRLENG_" characters"
DO ^DIR
KILL DIR
+7 IF $DATA(DIRUT)
GOTO TITLE
+8 SET BWGRTITL=Y
+9 QUIT
SAVE ;EP
+1 ;--- don't ask if already a pre-defined rpt
IF $DATA(BWGRCAND)
QUIT
+2 ;--- must be a detailed report to be saved
IF BWGRCTYP'="D"
QUIT
+3 SET BWGRSAVE=""
+4 KILL DIR,X,Y
SET DIR(0)="Y"
SET DIR("A")="Do you wish to SAVE this "_$SELECT('$DATA(BWGREP1):"SEARCH/",1:"")_"PRINT/SORT logic for future use"
SET DIR("B")="N"
DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+5 IF $DATA(DIRUT)
QUIT
+6 IF 'Y
QUIT
+7 KILL DIR,X,Y
SET DIR(0)="9002086.88,.03"
SET DIR("A")="Enter NAME for this REPORT DEFINITION"
DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+8 IF $DATA(DIRUT)
GOTO SAVE
+9 SET BWGRNAME=Y
+10 SET DIE="^BWGRTRPT("
SET DA=BWGRRPT
SET DR=".02////1;.03///"_BWGRNAME_";.06///"_BWGRPTVS_";.05///"_BWGRCTYP
IF $DATA(BWGREP1)
SET DR=DR_";.09///"_BWGRPACK
DO ^DIE
KILL DIE,DA,DR
+11 QUIT
COUNT ;EP
+1 WRITE !!
+2 SET DIR(0)="S^T:Total Count Only;S:Sub-counts and Total Count;D:Detailed "_$SELECT(BWGRPTVS="R":"WH Procedure",1:"Patient")_" Listing"
+3 SET DIR("A")=" Choose Type of Report"
SET DIR("B")="D"
DO ^DIR
KILL DIR
WRITE !!
+4 IF $DATA(DUOUT)
SET DIRUT=1
+5 IF $DATA(DIRUT)
SET BWGRQUIT=1
QUIT
+6 SET BWGRCTYP=Y
+7 IF BWGRCTYP="T"
SET $PIECE(^BWGRTRPT(BWGRRPT,0),U,5)="T"
IF BWGRPTVS="R"
SET BWGRSORT=19
SET BWGRSORV="Procedure Date"
IF BWGRPTVS="P"
SET BWGRSORT=1
SET BWGRSORV="Patient Name"
QUIT
+8 IF BWGRCTYP="D"
DO PRINT
IF $DATA(BWGRQUIT)
QUIT
DO SORT
QUIT
+9 DO SORT
+10 QUIT
PRINT ;
+1 SET BWGRCNTL="P"
+2 DO ^BWGRVL4
+3 QUIT
SORT ;EP
+1 KILL BWGRSORT,BWGRSORV,BWGRQUIT
+2 IF BWGRCTYP="D"
IF '$DATA(^BWGRTRPT(BWGRRPT,12))
WRITE !!,"NO PRINT FIELDS SELECTED!!",$CHAR(7),$CHAR(7)
SET BWGRQUIT=1
QUIT
+3 SET BWGRSORT=""
+4 DO SHOWR^BWGRVLS
+5 SET BWGRCNTL="R"
DO ^BWGRVL4
KILL BWGRCNTL
+6 IF '$DATA(BWGRSORV)
SET BWGRQUIT=1
QUIT
+7 IF BWGRCTYP'="D"
QUIT
PAGE ;
+1 KILL BWGRSPAG
+2 IF BWGRCTYP'="D"
QUIT
+3 SET DIR(0)="Y"
SET DIR("A")="Do you want a separate page for each "_BWGRSORV
SET DIR("B")="N"
DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+4 IF $DATA(DIRUT)
GOTO SORT
+5 SET BWGRSPAG=Y
SET DIE="^BWGRTRPT("
SET DA=BWGRRPT
SET DR=".04///"_BWGRSPAG
DO ^DIE
KILL DA,DR,DIE
+6 QUIT
FLAT ;
+1 SET BWGRFILE="BWGR"_DUZ_"."
+2 SET X2=$EXTRACT(DT,1,3)_"0101"
SET X1=DT
DO ^%DTC
SET BWGRJD=X+1
+3 SET BWGRFILE=BWGRFILE_BWGRJD
+4 WRITE !!,"I am going to create a file called ",BWGRFILE," which will reside in ",!,"the ",$SELECT($PIECE(^AUTTSITE(1,0),U,21)=1:"/usr/spool/uucppublic",1:"C:\EXPORT")," directory.",!
+5 WRITE "Actually, the file will be placed in the same directory that the data export"
+6 WRITE !,"globals are placed. See your site manager for assistance in finding the file",!,"after it is created. PLEASE jot down and remember the following file name:",!?15,"********** ",BWGRFILE," **********",!
+7 WRITE "It may be several hours (or overnight) before your report and flat file are ",!,"finished.",!
+8 WRITE !,"As a reminder, the records that are generated and placed in file ",BWGRFILE,!
+9 WRITE !,"are in a standard, pre-defined record format. For a definition of the format",!,"please see your user manual.",!
+10 SET DIR(0)="Y"
SET DIR("A")="Is everything ok? Do you want to continue?"
SET DIR("B")="Y"
KILL DA
DO ^DIR
KILL DIR
+11 IF $DATA(DIRUT)!(Y'=1)
SET BWGRQUIT=1
QUIT
+12 SET DA=BWGRRPT
SET DR=".12///"_BWGRFILE
SET DIE="^BWGRTRPT("
DO ^DIE
+13 KILL DIE,DA,DR
+14 QUIT