DICM2 ;SFISC/XAK/TKW-LOOKUP FOR VAR PTR ;2/15/00 14:55 [ 04/02/2003 8:25 AM ]
;;22.0;VA FileMan;**1001**;APR 1, 2003
;;22.0;VA FileMan;**4,31**;Mar 30, 1999
;Per VHA Directive 10-93-142, this routine should not be modified.
;
N A9,DIEX,DISAVIEX,DIV,DIVDIC,DIVDO,DIVP,DIVP1,DIVP2,DIVPDIC,DIVY,DIASKOK
S DIVDO=+DO(2),DIVDIC=DIC,DIVY=%Y N DIADD,DS
F %="DR","W","P","V","A" I $D(DIC(%)) M DIV(%)=DIC(%) K DIC(%)
I $D(DIC("S")) S DICR(DICR,"S")=DIC("S") K DIC("S")
K DO,DUOUT S (DIEX,DISAVIEX)=X
I '$D(DICR(DICR,"V")) D
. I DIC(0)'["L" S DICR(DICR,"V")=1 Q
. S:DICR>1 DICR(DICR,"V")=1 Q
G ALL:X'["."
I $P(X,".",2,999)="" S Y=-1 G ALL
V S DIVP=$P(DIEX,"."),A9=1
I DIVP="" G ALL
I $D(^DD(DIVDO,DIVY,"V","P",DIVP)) S (DIVP,DIVPDIC)=+$O(^(DIVP,0)),DIVPDIC=$S($D(^DD(DIVDO,DIVY,"V",DIVP,0)):^(0),1:"") G Q:'DIVPDIC S X=$P(DIEX,".",2,999),A9=0 D ^DICM3 G Q
S DIVP2="",DIVP=$P(DIEX,".")
F %=0:0 S DIVP2=$O(^DD(DIVDO,DIVY,"V","M",DIVP2)) Q:DIVP2="" I $P(DIVP2,DIVP)="" D G Q:'DIVPDIC D ^DICM3 G Q:Y>0 S DIVP=$P(DIEX,".")
. S (DIVP,DIVPDIC)=+$O(^DD(DIVDO,DIVY,"V","M",DIVP2,0))
. S DIVPDIC=$S($D(^DD(DIVDO,DIVY,"V",DIVP,0)):^(0),1:"")
. S X=$P(DIEX,".",2,999),A9=0 Q
F DIVP=0:0 S DIVP=+$O(^DD(DIVDO,DIVY,"V",DIVP)) Q:'DIVP I $D(^(DIVP,0)) S DIVPDIC=^(0) I $D(^DIC(+DIVPDIC,0)) S %=$P(^(0),U) I $P(%,$P(DIEX,"."))="" S X=$P(DIEX,".",2,999),A9=0 D ^DICM3 G Q:Y>0 S X=DIEX
I A9,$P(DIEX,".")?.E1L.E S $P(DIEX,".")=$$OUT^DIALOGU($P(DIEX,"."),"UC") G V
I A9 S X=DISAVIEX,A9=0 G ALL
K X G Q
ALL F DIVP1=0:0 S DIVP1=+$O(^DD(DIVDO,DIVY,"V","O",DIVP1)) Q:'DIVP1 S DIVP=+$O(^(DIVP1,0)) I $D(^DD(DIVDO,DIVY,"V",DIVP,0)) S DIVPDIC=^(0) D ^DICM3 G Q:Y>0!(%<0)!$D(DUOUT) S X=DIEX
G Q:DICR>1!$D(DICR(DICR,"V")) S DICR(DICR,"V")=1 K DIVP G ALL
;
;
Q I '$D(DUOUT),Y<0,DICR<2,'$D(DICR(DICR,"V")) S DICR(DICR,"V")=1 K DIVP G V
K:Y<0 X S DICR(DICR,"V")=1
F %="DR","W","P","V","A" I $D(DIV(%)) M DIC(%)=DIV(%)
I $D(DICR(DICR,"S")) S DIC("S")=DICR(DICR,"S")
QQ K:Y DICR(DICR,6)
K DUOUT,DIVP,DIVDIC,DIVY,DO,DIVDO,DIVPDIC,DIEX,DIVP1,DIVP2,DIV,A9 Q
;
NAME ;DETERMINE EXTERNAL FORM FROM INTERNAL FOR VP
S DINAME=DIY Q:DIY'?1.N1";"1.E
N % S %=$P(DIY,";",2),DINAME="^"_%_+DIY_",0)",DINAME=$S($D(@DINAME)#2:$P(^(0),U,1),1:DIY),%=$S($D(@("^"_%_"0)")):$P(^(0),U,2),1:"")
Q:%=""
I %["P"!(%["S")!(%["D")!(%["V") S DINAME=$$EXT^DIC2(+%,.01,DINAME)
Q
;
DICM2 ;SFISC/XAK/TKW-LOOKUP FOR VAR PTR ;2/15/00 14:55 [ 04/02/2003 8:25 AM ]
+1 ;;22.0;VA FileMan;**1001**;APR 1, 2003
+2 ;;22.0;VA FileMan;**4,31**;Mar 30, 1999
+3 ;Per VHA Directive 10-93-142, this routine should not be modified.
+4 ;
+5 NEW A9,DIEX,DISAVIEX,DIV,DIVDIC,DIVDO,DIVP,DIVP1,DIVP2,DIVPDIC,DIVY,DIASKOK
+6 SET DIVDO=+DO(2)
SET DIVDIC=DIC
SET DIVY=%Y
NEW DIADD,DS
+7 FOR %="DR","W","P","V","A"
IF $DATA(DIC(%))
MERGE DIV(%)=DIC(%)
KILL DIC(%)
+8 IF $DATA(DIC("S"))
SET DICR(DICR,"S")=DIC("S")
KILL DIC("S")
+9 KILL DO,DUOUT
SET (DIEX,DISAVIEX)=X
+10 IF '$DATA(DICR(DICR,"V"))
Begin DoDot:1
+11 IF DIC(0)'["L"
SET DICR(DICR,"V")=1
QUIT
+12 IF DICR>1
SET DICR(DICR,"V")=1
QUIT
End DoDot:1
+13 IF X'["."
GOTO ALL
+14 IF $PIECE(X,".",2,999)=""
SET Y=-1
GOTO ALL
V SET DIVP=$PIECE(DIEX,".")
SET A9=1
+1 IF DIVP=""
GOTO ALL
+2 IF $DATA(^DD(DIVDO,DIVY,"V","P",DIVP))
SET (DIVP,DIVPDIC)=+$ORDER(^(DIVP,0))
SET DIVPDIC=$SELECT($DATA(^DD(DIVDO,DIVY,"V",DIVP,0)):^(0),1:"")
IF 'DIVPDIC
GOTO Q
SET X=$PIECE(DIEX,".",2,999)
SET A9=0
DO ^DICM3
GOTO Q
+3 SET DIVP2=""
SET DIVP=$PIECE(DIEX,".")
+4 FOR %=0:0
SET DIVP2=$ORDER(^DD(DIVDO,DIVY,"V","M",DIVP2))
IF DIVP2=""
QUIT
IF $PIECE(DIVP2,DIVP)=""
Begin DoDot:1
+5 SET (DIVP,DIVPDIC)=+$ORDER(^DD(DIVDO,DIVY,"V","M",DIVP2,0))
+6 SET DIVPDIC=$SELECT($DATA(^DD(DIVDO,DIVY,"V",DIVP,0)):^(0),1:"")
+7 SET X=$PIECE(DIEX,".",2,999)
SET A9=0
QUIT
End DoDot:1
IF 'DIVPDIC
GOTO Q
DO ^DICM3
IF Y>0
GOTO Q
SET DIVP=$PIECE(DIEX,".")
+8 FOR DIVP=0:0
SET DIVP=+$ORDER(^DD(DIVDO,DIVY,"V",DIVP))
IF 'DIVP
QUIT
IF $DATA(^(DIVP,0))
SET DIVPDIC=^(0)
IF $DATA(^DIC(+DIVPDIC,0))
SET %=$PIECE(^(0),U)
IF $PIECE(%,$PIECE(DIEX,"."))=""
SET X=$PIECE(DIEX,".",2,999)
SET A9=0
DO ^DICM3
IF Y>0
GOTO Q
SET X=DIEX
+9 IF A9
IF $PIECE(DIEX,".")?.E1L.E
SET $PIECE(DIEX,".")=$$OUT^DIALOGU($PIECE(DIEX,"."),"UC")
GOTO V
+10 IF A9
SET X=DISAVIEX
SET A9=0
GOTO ALL
+11 KILL X
GOTO Q
ALL FOR DIVP1=0:0
SET DIVP1=+$ORDER(^DD(DIVDO,DIVY,"V","O",DIVP1))
IF 'DIVP1
QUIT
SET DIVP=+$ORDER(^(DIVP1,0))
IF $DATA(^DD(DIVDO,DIVY,"V",DIVP,0))
SET DIVPDIC=^(0)
DO ^DICM3
IF Y>0!(%<0)!$DATA(DUOUT)
GOTO Q
SET X=DIEX
+1 IF DICR>1!$DATA(DICR(DICR,"V"))
GOTO Q
SET DICR(DICR,"V")=1
KILL DIVP
GOTO ALL
+2 ;
+3 ;
Q IF '$DATA(DUOUT)
IF Y<0
IF DICR<2
IF '$DATA(DICR(DICR,"V"))
SET DICR(DICR,"V")=1
KILL DIVP
GOTO V
+1 IF Y<0
KILL X
SET DICR(DICR,"V")=1
+2 FOR %="DR","W","P","V","A"
IF $DATA(DIV(%))
MERGE DIC(%)=DIV(%)
+3 IF $DATA(DICR(DICR,"S"))
SET DIC("S")=DICR(DICR,"S")
QQ IF Y
KILL DICR(DICR,6)
+1 KILL DUOUT,DIVP,DIVDIC,DIVY,DO,DIVDO,DIVPDIC,DIEX,DIVP1,DIVP2,DIV,A9
QUIT
+2 ;
NAME ;DETERMINE EXTERNAL FORM FROM INTERNAL FOR VP
+1 SET DINAME=DIY
IF DIY'?1.N1";"1.E
QUIT
+2 NEW %
SET %=$PIECE(DIY,";",2)
SET DINAME="^"_%_+DIY_",0)"
SET DINAME=$SELECT($DATA(@DINAME)#2:$PIECE(^(0),U,1),1:DIY)
SET %=$SELECT($DATA(@("^"_%_"0)")):$PIECE(^(0),U,2),1:"")
+3 IF %=""
QUIT
+4 IF %["P"!(%["S")!(%["D")!(%["V")
SET DINAME=$$EXT^DIC2(+%,.01,DINAME)
+5 QUIT
+6 ;