INHVA5 ;FRW ; ; Load files into the data mappaing file (#4090.1)
;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
;COPYRIGHT 1991-2000 SAIC
EN ;Main entry point
;
;GET SYSTEM - PROMPT USER IF OK - INSYS
S INSYS="SC"
;
;Get MAP FUNCTION
K DIC S DIC=4090.2,DIC(0)="AEQMZ" D ^DIC Q:Y<0 S INOK=1 D Q:'INOK
.S INMAP=+Y,INMAP(0)=Y(0)
.;Must be static map
.I '$P(INMAP(0),U,3) W !!,*7,"Must be a STATIC Map Function" S INOK=0 Q
.;Must have a local file
.I '$P($G(^INVD(4090.2,INMAP,INSYS)),U,1) W *7,!!,"Map Function must have a loacl file (",INSYS," FILE field)." S INOK=0 Q
.;
A ;
I $D(^INVD(4090.1,"VA",INMAP))!$D(^INVD(4090.1,"SC",INMAP)) W *7,!!,"WARNING! - There is mapped data for this function in fiel 4090.1",!!
;
;Get local file reference
S INFILN=$P(^INVD(4090.2,INMAP,INSYS),U,1),INFILR=$G(^DIC(INFILN,0,"GL"))
I '$L(INFILR) W *7,!!,"No global storage location for local file - ^DIC(file,0,""GL"")" Q
;Convert lcoal file reference
S L=$L(INFILR),INFILR=$E(INFILR,1,L-1)_$S($E(INFILR,L)="(":"",$E(INFILR,L)=",":")",1:"")
;
;Add device & taskman calls
;
ENQUE ;Taskman entry point
;
K ^UTILITY($J)
;Loop through entries in the file
F S INDA=$O(@INFILR@(INDA)) Q:'INDA D
.Q:'$D(@INFILR@(INDA,0)) I $L(INFILSC) X INFILSC Q:'$T
.K DIC S DIC=4090.1,DIC(0)="XL",X=INFILN_"-"_INDA D ^DIC
.I Y<0 W !!,"WARNING: Map value not added for entry #",INDA,!! Q
INHVA5 ;FRW ; ; Load files into the data mappaing file (#4090.1)
+1 ;;3.01;BHL IHS Interfaces with GIS;;JUL 01, 2001
+2 ;COPYRIGHT 1991-2000 SAIC
EN ;Main entry point
+1 ;
+2 ;GET SYSTEM - PROMPT USER IF OK - INSYS
+3 SET INSYS="SC"
+4 ;
+5 ;Get MAP FUNCTION
+6 KILL DIC
SET DIC=4090.2
SET DIC(0)="AEQMZ"
DO ^DIC
IF Y<0
QUIT
SET INOK=1
Begin DoDot:1
+7 SET INMAP=+Y
SET INMAP(0)=Y(0)
+8 ;Must be static map
+9 IF '$PIECE(INMAP(0),U,3)
WRITE !!,*7,"Must be a STATIC Map Function"
SET INOK=0
QUIT
+10 ;Must have a local file
+11 IF '$PIECE($GET(^INVD(4090.2,INMAP,INSYS)),U,1)
WRITE *7,!!,"Map Function must have a loacl file (",INSYS," FILE field)."
SET INOK=0
QUIT
+12 ;
End DoDot:1
IF 'INOK
QUIT
A ;
+1 IF $DATA(^INVD(4090.1,"VA",INMAP))!$DATA(^INVD(4090.1,"SC",INMAP))
WRITE *7,!!,"WARNING! - There is mapped data for this function in fiel 4090.1",!!
+2 ;
+3 ;Get local file reference
+4 SET INFILN=$PIECE(^INVD(4090.2,INMAP,INSYS),U,1)
SET INFILR=$GET(^DIC(INFILN,0,"GL"))
+5 IF '$LENGTH(INFILR)
WRITE *7,!!,"No global storage location for local file - ^DIC(file,0,""GL"")"
QUIT
+6 ;Convert lcoal file reference
+7 SET L=$LENGTH(INFILR)
SET INFILR=$EXTRACT(INFILR,1,L-1)_$SELECT($EXTRACT(INFILR,L)="(":"",$EXTRACT(INFILR,L)=",":")",1:"")
+8 ;
+9 ;Add device & taskman calls
+10 ;
ENQUE ;Taskman entry point
+1 ;
+2 KILL ^UTILITY($JOB)
+3 ;Loop through entries in the file
+4 FOR
SET INDA=$ORDER(@INFILR@(INDA))
IF 'INDA
QUIT
Begin DoDot:1
+5 IF '$DATA(@INFILR@(INDA,0))
QUIT
IF $LENGTH(INFILSC)
XECUTE INFILSC
IF '$TEST
QUIT
+6 KILL DIC
SET DIC=4090.1
SET DIC(0)="XL"
SET X=INFILN_"-"_INDA
DO ^DIC
+7 IF Y<0
WRITE !!,"WARNING: Map value not added for entry #",INDA,!!
QUIT
End DoDot:1