ANRVSITE ;BHAM/MAM - ENTER/EDIT PARAMETERS ; 4 Feb 98 / 9:00 AM
;;4.0; Visual Impairment Service Team ;;12 Jun 98
CHECK ; check to see if the entry exists
S ANRVOUT=0 I $O(^ANRV(2041,0)) D EDIT01 I ANRVOUT G END
I '$O(^ANRV(2041,0)) D CREATE I ANRVOUT G END
EDIT ; edit all information in the VIST PARAMETER file
K DR S DIE=2041,DA=ANRVIFN,DR="[ANRV PARAM EDIT]" D ^DIE K DR,DIE,DA
END ; clean up variables, quit
K ANRVSITE,ANRVOUT,DIC
Q
EDIT01 ; edit the .01 node of the VIST PARAMETERS file
S ANRVIFN=$O(^ANRV(2041,0)),X=$P(^ANRV(2041,ANRVIFN,0),"^"),ANRVSITE=$P(^DIC(4,X,0),"^")
W !!,"The site name, "_ANRVSITE_", is already defined in the VIST PARAMETERS",!,"file.",!
N DIR,DIRUT,DUOUT,DTOUT,X,Y
S DIR(0)="Y",DIR("A")="Do you want to edit the SITE NAME in the VIST PARAMETER file",DIR("B")="No"
S DIR("?")="Enter ""Yes"" to edit the site name in the VIST PARAMETERS file, ""No"" to exit."
D ^DIR
I $D(DUOUT)!$D(DIRUT) S ANRVOUT=1
I Y'=1 W ! Q
W !! K DR S DIE=2041,DA=ANRVIFN,DR=.01 D ^DIE K DR,DIE,DA
Q
CREATE ; create new entry
W !!,"There are no entries in the VIST PARAMETER file. Only one entry can be created",!,"in this file.",!!
N DIR,DIRUT,DUOUT,DTOUT,X,Y
S DIR(0)="Y",DIR("A")="Do you want to add the SITE NAME to the VIST PARAMETER file now",DIR("B")="Yes"
S DIR("?")="Enter ""Yes"" to enter the site name in the VIST PARAMETERS file, ""No"" to exit."
D ^DIR
I $D(DUOUT)!$D(DIRUT) S ANRVOUT=1
I Y'=1 S ANRVOUT=1 Q
NEW ; add new entry to VIST PARAMETER file
W !! K DIC S DIC=4,DIC(0)="QEAMZ" D ^DIC I Y<0 S ANRVOUT=1 Q
K DA,DIC,DO,DD,DINUM,ANRVIFN S X=+Y,DIC="^ANRV(2041,",DIC(0)="L",DLAYGO=2041 D FILE^DICN K DIC,DLAYGO S ANRVIFN=+Y
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HANRVSITE 1709 printed Sep 15, 2024@22:09:47 Page 2
ANRVSITE ;BHAM/MAM - ENTER/EDIT PARAMETERS ; 4 Feb 98 / 9:00 AM
+1 ;;4.0; Visual Impairment Service Team ;;12 Jun 98
CHECK ; check to see if the entry exists
+1 SET ANRVOUT=0
IF $ORDER(^ANRV(2041,0))
DO EDIT01
IF ANRVOUT
GOTO END
+2 IF '$ORDER(^ANRV(2041,0))
DO CREATE
IF ANRVOUT
GOTO END
EDIT ; edit all information in the VIST PARAMETER file
+1 KILL DR
SET DIE=2041
SET DA=ANRVIFN
SET DR="[ANRV PARAM EDIT]"
DO ^DIE
KILL DR,DIE,DA
END ; clean up variables, quit
+1 KILL ANRVSITE,ANRVOUT,DIC
+2 QUIT
EDIT01 ; edit the .01 node of the VIST PARAMETERS file
+1 SET ANRVIFN=$ORDER(^ANRV(2041,0))
SET X=$PIECE(^ANRV(2041,ANRVIFN,0),"^")
SET ANRVSITE=$PIECE(^DIC(4,X,0),"^")
+2 WRITE !!,"The site name, "_ANRVSITE_", is already defined in the VIST PARAMETERS",!,"file.",!
+3 NEW DIR,DIRUT,DUOUT,DTOUT,X,Y
+4 SET DIR(0)="Y"
SET DIR("A")="Do you want to edit the SITE NAME in the VIST PARAMETER file"
SET DIR("B")="No"
+5 SET DIR("?")="Enter ""Yes"" to edit the site name in the VIST PARAMETERS file, ""No"" to exit."
+6 DO ^DIR
+7 IF $DATA(DUOUT)!$DATA(DIRUT)
SET ANRVOUT=1
+8 IF Y'=1
WRITE !
QUIT
+9 WRITE !!
KILL DR
SET DIE=2041
SET DA=ANRVIFN
SET DR=.01
DO ^DIE
KILL DR,DIE,DA
+10 QUIT
CREATE ; create new entry
+1 WRITE !!,"There are no entries in the VIST PARAMETER file. Only one entry can be created",!,"in this file.",!!
+2 NEW DIR,DIRUT,DUOUT,DTOUT,X,Y
+3 SET DIR(0)="Y"
SET DIR("A")="Do you want to add the SITE NAME to the VIST PARAMETER file now"
SET DIR("B")="Yes"
+4 SET DIR("?")="Enter ""Yes"" to enter the site name in the VIST PARAMETERS file, ""No"" to exit."
+5 DO ^DIR
+6 IF $DATA(DUOUT)!$DATA(DIRUT)
SET ANRVOUT=1
+7 IF Y'=1
SET ANRVOUT=1
QUIT
NEW ; add new entry to VIST PARAMETER file
+1 WRITE !!
KILL DIC
SET DIC=4
SET DIC(0)="QEAMZ"
DO ^DIC
IF Y<0
SET ANRVOUT=1
QUIT
+2 KILL DA,DIC,DO,DD,DINUM,ANRVIFN
SET X=+Y
SET DIC="^ANRV(2041,"
SET DIC(0)="L"
SET DLAYGO=2041
DO FILE^DICN
KILL DIC,DLAYGO
SET ANRVIFN=+Y
+3 QUIT