source: FOIAVistA/trunk/r/VA_FILEMAN-ARJT-DI-DD-DM-DT-%DT-%RCR/DDGFFLD.m@ 767

Last change on this file since 767 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

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