DDGFFLD ;SFISC/MKO-EDIT A FIELD ;01:47 PM 22 Nov 1994
;;22.0;VA FileMan;;Mar 30, 1999
;Per VHA Directive 10-93-142, this routine should not be modified.
EDIT ;
Q:$D(^DIST(.404,B,40,F,0))[0
I T="D" Q:C]"" K @DDGFREF@("F",DDGFPG,B,F)
;
S DDGFDY=DY,DDGFDX=DX
S DDGFTYPE=$P(^DIST(.404,B,40,F,0),U,3)
I 'DDGFTYPE D
. I $G(^DIST(.404,B,40,F,20))'?."^" S DDGFTYPE=2 Q
. I $P($G(^DIST(.404,B,0)),U,2),$G(^DIST(.404,B,40,F,1)) S DDGFTYPE=3
G:'DDGFTYPE EDITQ
;
S DDGFB2=@DDGFREF@("F",DDGFPG,B)
S DDGFB1=$P(DDGFB2,U),DDGFB2=$P(DDGFB2,U,2)
S DDGFDD=$P(^DIST(.404,B,0),U,2)
S (DDGFSUP,DDGFSUP0)=$S(C]""&(DDGFTYPE'=1):$E(C,$L(C))'=":",1:"")
S (DDGFCAP,DDGFCAP0)=$S(DDGFTYPE=1!DDGFSUP0:C,1:$E(C,1,$L(C)-1))
S (DDGFCC,DDGFCC0)=$S(C]"":C1-DDGFB1+1_","_(C2-DDGFB2+1),1:"")
I $D(D) D
. S (DDGFDL,DDGFDL0)=L
. S (DDGFDC,DDGFDC0)=D1-DDGFB1+1_","_(D2-DDGFB2+1)
K DDGFB1,DDGFB2
;
S DDSFILE=.404,DDSFILE(1)=.4044,DDSPARM="KSTW"
S DR="[DDGF FIELD "_$P("CAPTION ONLY^FORM ONLY^DD^COMPUTED",U,DDGFTYPE)_"]"
S DA=F,DA(1)=B
D
. N B,F,T,C,C1,C2,D,D1,D2,L,P1,P2
. D ^DDS K DDSFILE,DDSPARM,DR,DDGFDD
;
;If caption, caption coords, data length, data coords, or suppress
;colon flag changed we need to update some local variables
I $D(DA)#2,$G(DDSSAVE) D
. S DDGFNDB=$G(@DDGFREF@("F",DDGFPG,B))
. S:DDGFCAP="" (DDGFSUP,DDGFCC)=""
. S DR=""
. ;
. I DDGFCAP'=DDGFCAP0!(DDGFSUP'=DDGFSUP0) D
.. S C=DDGFCAP_$S(DDGFCAP]""&(DDGFTYPE'=1)&'DDGFSUP:":",1:"")
.. S:DDGFCAP'=DDGFCAP0 DR=DR_"1////"_$S(DDGFCAP]"":DDGFCAP,1:"@")_";"
.. S:DDGFSUP'=DDGFSUP0 DR=DR_"5.2////"_$S(DDGFSUP:1,1:"@")_";"
. ;
. D:DDGFCC'=DDGFCC0
.. S C1=$S(DDGFCAP]"":$P(DDGFCC,",")-1+$P(DDGFNDB,U),1:"")
.. S C2=$S(DDGFCAP]"":$P(DDGFCC,",",2)-1+$P(DDGFNDB,U,2),1:"")
.. S DR=DR_"5.1////"_$S(DDGFCC]"":DDGFCC,1:"@")_";"
. ;
. D:$D(D)
.. D:DDGFDC'=DDGFDC0
... S D1=$P(DDGFDC,",")-1+$P(DDGFNDB,U)
... S D2=$P(DDGFDC,",",2)-1+$P(DDGFNDB,U,2)
... S DR=DR_"4.1////"_DDGFDC_";"
.. D:DDGFDL'=DDGFDL0
... S L=DDGFDL
... S D=$TR($J("",L)," ","_")
... S DR=DR_"4.2////"_DDGFDL_";"
. ;
. I T="D",C]"" D
.. D WRITE^DDGLIBW(DDGFWID,C,C1-P1,C2-P2,"",1)
.. S @DDGFREF@("RC",DDGFWID,C1,C2,C2+$L(C)-1,B,F,"C")=""
. ;
. I DR]"" D
.. N B,F,T,C,C1,C2,D,D1,D2,L,P1,P2
.. S DIE="^DIST(.404,"_DA(1)_",40,"
.. S DR=$E(DR,1,$L(DR)-1)
.. D ^DIE
;
K DA,DDGFNDB
K DDGFSUP,DDGFSUP0,DDGFCAP,DDGFCAP0,DDGFCC,DDGFCC0
K DDGFDL,DDGFDL0,DDGFDC,DDGFDC0,DDSSAVE
K DIE,DR
;
D REFRESH^DDGF,RC(DDGFDY,DDGFDX)
EDITQ S DDGFE=1
K DDGFDY,DDGFDX,DDGFTYPE
Q
;
RC(DDGFY,DDGFX) ;Update status line, reset DX and DY, move cursor
N S
I DDGFR D
. S DY=IOSL-6,DX=IOM-9,S="R"_(DDGFY+1)_",C"_(DDGFX+1)
. X IOXY W S_$J("",7-$L(S))
S DY=DDGFY,DX=DDGFX X IOXY
Q
DDGFFLD ;SFISC/MKO-EDIT A FIELD ;01:47 PM 22 Nov 1994
+1 ;;22.0;VA FileMan;;Mar 30, 1999
+2 ;Per VHA Directive 10-93-142, this routine should not be modified.
EDIT ;
+1 IF $DATA(^DIST(.404,B,40,F,0))[0
QUIT
+2 IF T="D"
IF C]""
QUIT
KILL @DDGFREF@("F",DDGFPG,B,F)
+3 ;
+4 SET DDGFDY=DY
SET DDGFDX=DX
+5 SET DDGFTYPE=$PIECE(^DIST(.404,B,40,F,0),U,3)
+6 IF 'DDGFTYPE
Begin DoDot:1
+7 IF $GET(^DIST(.404,B,40,F,20))'?."^"
SET DDGFTYPE=2
QUIT
+8 IF $PIECE($GET(^DIST(.404,B,0)),U,2)
IF $GET(^DIST(.404,B,40,F,1))
SET DDGFTYPE=3
End DoDot:1
+9 IF 'DDGFTYPE
GOTO EDITQ
+10 ;
+11 SET DDGFB2=@DDGFREF@("F",DDGFPG,B)
+12 SET DDGFB1=$PIECE(DDGFB2,U)
SET DDGFB2=$PIECE(DDGFB2,U,2)
+13 SET DDGFDD=$PIECE(^DIST(.404,B,0),U,2)
+14 SET (DDGFSUP,DDGFSUP0)=$SELECT(C]""&(DDGFTYPE'=1):$EXTRACT(C,$LENGTH(C))'=":",1:"")
+15 SET (DDGFCAP,DDGFCAP0)=$SELECT(DDGFTYPE=1!DDGFSUP0:C,1:$EXTRACT(C,1,$LENGTH(C)-1))
+16 SET (DDGFCC,DDGFCC0)=$SELECT(C]"":C1-DDGFB1+1_","_(C2-DDGFB2+1),1:"")
+17 IF $DATA(D)
Begin DoDot:1
+18 SET (DDGFDL,DDGFDL0)=L
+19 SET (DDGFDC,DDGFDC0)=D1-DDGFB1+1_","_(D2-DDGFB2+1)
End DoDot:1
+20 KILL DDGFB1,DDGFB2
+21 ;
+22 SET DDSFILE=.404
SET DDSFILE(1)=.4044
SET DDSPARM="KSTW"
+23 SET DR="[DDGF FIELD "_$PIECE("CAPTION ONLY^FORM ONLY^DD^COMPUTED",U,DDGFTYPE)_"]"
+24 SET DA=F
SET DA(1)=B
+25 Begin DoDot:1
+26 NEW B,F,T,C,C1,C2,D,D1,D2,L,P1,P2
+27 DO ^DDS
KILL DDSFILE,DDSPARM,DR,DDGFDD
End DoDot:1
+28 ;
+29 ;If caption, caption coords, data length, data coords, or suppress
+30 ;colon flag changed we need to update some local variables
+31 IF $DATA(DA)#2
IF $GET(DDSSAVE)
Begin DoDot:1
+32 SET DDGFNDB=$GET(@DDGFREF@("F",DDGFPG,B))
+33 IF DDGFCAP=""
SET (DDGFSUP,DDGFCC)=""
+34 SET DR=""
+35 ;
+36 IF DDGFCAP'=DDGFCAP0!(DDGFSUP'=DDGFSUP0)
Begin DoDot:2
+37 SET C=DDGFCAP_$SELECT(DDGFCAP]""&(DDGFTYPE'=1)&'DDGFSUP:":",1:"")
+38 IF DDGFCAP'=DDGFCAP0
SET DR=DR_"1////"_$SELECT(DDGFCAP]"":DDGFCAP,1:"@")_";"
+39 IF DDGFSUP'=DDGFSUP0
SET DR=DR_"5.2////"_$SELECT(DDGFSUP:1,1:"@")_";"
End DoDot:2
+40 ;
+41 IF DDGFCC'=DDGFCC0
Begin DoDot:2
+42 SET C1=$SELECT(DDGFCAP]"":$PIECE(DDGFCC,",")-1+$PIECE(DDGFNDB,U),1:"")
+43 SET C2=$SELECT(DDGFCAP]"":$PIECE(DDGFCC,",",2)-1+$PIECE(DDGFNDB,U,2),1:"")
+44 SET DR=DR_"5.1////"_$SELECT(DDGFCC]"":DDGFCC,1:"@")_";"
End DoDot:2
+45 ;
+46 IF $DATA(D)
Begin DoDot:2
+47 IF DDGFDC'=DDGFDC0
Begin DoDot:3
+48 SET D1=$PIECE(DDGFDC,",")-1+$PIECE(DDGFNDB,U)
+49 SET D2=$PIECE(DDGFDC,",",2)-1+$PIECE(DDGFNDB,U,2)
+50 SET DR=DR_"4.1////"_DDGFDC_";"
End DoDot:3
+51 IF DDGFDL'=DDGFDL0
Begin DoDot:3
+52 SET L=DDGFDL
+53 SET D=$TRANSLATE($JUSTIFY("",L)," ","_")
+54 SET DR=DR_"4.2////"_DDGFDL_";"
End DoDot:3
End DoDot:2
+55 ;
+56 IF T="D"
IF C]""
Begin DoDot:2
+57 DO WRITE^DDGLIBW(DDGFWID,C,C1-P1,C2-P2,"",1)
+58 SET @DDGFREF@("RC",DDGFWID,C1,C2,C2+$LENGTH(C)-1,B,F,"C")=""
End DoDot:2
+59 ;
+60 IF DR]""
Begin DoDot:2
+61 NEW B,F,T,C,C1,C2,D,D1,D2,L,P1,P2
+62 SET DIE="^DIST(.404,"_DA(1)_",40,"
+63 SET DR=$EXTRACT(DR,1,$LENGTH(DR)-1)
+64 DO ^DIE
End DoDot:2
End DoDot:1
+65 ;
+66 KILL DA,DDGFNDB
+67 KILL DDGFSUP,DDGFSUP0,DDGFCAP,DDGFCAP0,DDGFCC,DDGFCC0
+68 KILL DDGFDL,DDGFDL0,DDGFDC,DDGFDC0,DDSSAVE
+69 KILL DIE,DR
+70 ;
+71 DO REFRESH^DDGF
DO RC(DDGFDY,DDGFDX)
EDITQ SET DDGFE=1
+1 KILL DDGFDY,DDGFDX,DDGFTYPE
+2 QUIT
+3 ;
RC(DDGFY,DDGFX) ;Update status line, reset DX and DY, move cursor
+1 NEW S
+2 IF DDGFR
Begin DoDot:1
+3 SET DY=IOSL-6
SET DX=IOM-9
SET S="R"_(DDGFY+1)_",C"_(DDGFX+1)
+4 XECUTE IOXY
WRITE S_$JUSTIFY("",7-$LENGTH(S))
End DoDot:1
+5 SET DY=DDGFY
SET DX=DDGFX
XECUTE IOXY
+6 QUIT