source: FOIAVistA/trunk/r/VA_FILEMAN-ARJT-DI-DD-DM-DT-%DT-%RCR/DDSZ1.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: 4.4 KB
Line 
1DDSZ1 ;SFISC/MKO-GET BLOCK INFO,SCREEN IMAGE ;9:59 AM 15 Jul 1997
2 ;;22.0;VA FileMan;;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4EN(DDSPG,DDSBK,DDP,DDSBY,DDSBX,DDSBO,DDSTP,DDSREP,DDSNDD,DDSPGRP,DDSSCR,DDSNAV,DDSORD,DDSRNAV) ;
5 ;Input:
6 ; DDSREFS = Global ref
7 ;Output:
8 ; DDSSCR
9 ; DDSNAV
10 ; DDSORD
11 ; DDSRNAV
12 ;
13 N Y
14 S:$G(DDSTP)="" DDSTP="e"
15 I DDSTP'="h",$G(DDSBO),$D(DDSORD(DDSBO))[0 D
16 . S DDSORD(DDSBO)=DDSBK
17 . S:$G(DDSREP)>1 $P(DDSORD(DDSBO),U,2)=$S($P(DDSREP,U,5)]"":$P($$GETFLD^DDSLIB($P(DDSREP,U,5),"","","","",DDSBK),","),1:"FIRST")
18 ;
19 S DDSF=0
20 F S DDSF=$O(^DIST(.404,DDSBK,40,DDSF)) Q:DDSF'=+DDSF D FLD
21 ;
22KILL K DDSC1,DDSC2,DDSCAP,DDSCLN,DDSD1,DDSD2,DDSD3
23 K DDSDDL0,DDSF,DDSFLD,DDSKEY,DDSL0,DDSL01,DDSL2,DDSL4,DDSN
24 Q
25 ;
26FLD ;Set up
27 ; @DDSREFS@(pg,bk,ddo,
28 ; "D") = data $Y^data $X^data $L^field#
29 ; ^xcap $Y^xcap $X^xcap colon^xcap req
30 ; ^1 if computed field^1 if right justified
31 ; "COMPE") = M code that sets X
32 ; "COMPE",1) = array sets DDSE(n)
33 ;
34 ; @DDSREFS@("Ffile#",field#,"L",pg,bk,ddo)=""
35 ;
36 ; DDSSCR(row) = captions on that row
37 ; DDSSCR(row,col) = final columns underlined
38 ; DDSNAV(row,col) = ddo,bk for editable fields
39 ; DDSORD(bo,fo) = ddo for editable fields
40 ;
41 ;Get field properties
42 S:'$P(^DIST(.404,DDSBK,40,DDSF,0),U,3) $P(^(0),U,3)=3
43 S DDSL0=$G(^DIST(.404,DDSBK,40,DDSF,0)),DDSL01=$G(^(.1)),DDSFLD=$S($P(DDSL0,U,3)=2:DDSF_","_DDSBK,1:+$G(^(1))),DDSL2=$G(^(2)),DDSL4=$G(^(4))
44 K:$P(DDSL0,U,3)=3!'$P(DDSL0,U,3) DDSNDD
45 S DDSDDL0=$G(^DD(DDP,DDSFLD,0)) Q:DDSL0?."^"!(DDSL2?."^")
46 S DDSKEY=DDSFLD'[","&($D(^DD("KEY","F",DDP,DDSFLD))>1)
47 S DDSD1=$P($P(DDSL2,U),",")+DDSBY-1
48 S DDSD2=$P($P(DDSL2,U),",",2)+DDSBX-1
49 S DDSD3=$P(DDSL2,U,2)
50 S DDSC1=$P($P(DDSL2,U,3),",")+DDSBY-1
51 S DDSC2=$P($P(DDSL2,U,3),",",2)+DDSBX-1
52 S DDSCAP=$TR($P(DDSL0,U,2)," ",$C(0))
53 S DDSCLN=$S(DDSCAP="":"",$P(DDSL0,U,3)=1:"",$P(DDSL2,U,4):"",1:":")
54 ;
55 I DDSC1'<0,DDSC2'<0,$L(DDSCAP)>0,DDSCAP'="!M" D
56 . ;Set CAP xref for ^-jumping
57 . I DDSTP="e","^2^3^"[(U_$P(DDSL0,U,3)_U)!'$P(DDSL0,U,3) D
58 .. N C,I,L
59 .. S I=0 F S I=$O(DDSPGRP(I)) Q:'I Q:U_DDSPGRP(I)_U[(U_DDSPG_U)
60 .. Q:'I
61 .. S C=$P(DDSL0,U,2)
62 .. S:C?1"Select ".E C=$P(C,"Select ",2,999)
63 .. S C=$E($TR(C,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ"),1,40)
64 .. S L=$L(DDSREFS)+$L(C)+$L(DDSPGRP(I))+$L(DDSPG)+$L(DDSBK)+$L(DDSF)+30
65 .. S:L>127 C=$E(C,1,$L(C)-(L-127))
66 .. S:C]"" @DDSREFS@("CAP",C,DDSPGRP(I),DDSPG,DDSBK,DDSF)=""
67 . ;
68 . ;Set DDSSCR
69 . I DDSC1'<0,DDSC2'<0,$L(DDSCAP)>0,DDSCAP'="!M" D
70 .. N DDSI,DDSX
71 .. S DDSX=DDSCAP_DDSCLN
72 .. F DDSI=1:1:+DDSREP D
73 ... S $E(DDSSCR(DDSC1+DDSI),DDSC2+1,DDSC2+$L(DDSX))=DDSX
74 ... S:$S($P(DDSL4,U)]"":+DDSL4,1:$P(DDSDDL0,U,2)["R")!DDSKEY DDSSCR(DDSC1+DDSI,DDSC2+1)=DDSC2+$L(DDSCAP)
75 ;
76 ;Set "D", "L" nodes, DDSNAV, and DDSORD
77 I DDSD1'<0,DDSD2'<0,DDSD3>0 D
78 . S @DDSREFS@(DDSPG,DDSBK,DDSF,"D")=DDSD1_U_DDSD2_U_DDSD3_U_DDSFLD
79 . S @DDSREFS@("F"_$S(DDSFLD[",":0,1:DDP),DDSFLD,"L",DDSPG,DDSBK,DDSF)=""
80 I DDSCAP="!M",DDSC1'<0,DDSC2'<0 S $P(@DDSREFS@(DDSPG,DDSBK,DDSF,"D"),U,5,8)=DDSC1_U_DDSC2_U_DDSCLN_U_($P(DDSDDL0,U,2)["R"!+DDSL4!DDSKEY)
81 S:$P(DDSL4,U,3) $P(@DDSREFS@(DDSPG,DDSBK,DDSF,"D"),U,10)=1
82 ;
83 ;Computed fields
84 I $P(DDSL0,U,3)=4 D K DDSCOMP,DDSAR,DDSEXP,DDSFD Q
85 . S DDSCOMP=$G(^DIST(.404,DDSBK,40,DDSF,30)) Q:DDSCOMP?."^"
86 . D PARSE^DDSCOMP(DDP,DDSCOMP,DDSBK,.DDSEXP,.DDSAR,.DDSFD)
87 . Q:DDSEXP=""!$G(DIERR)
88 . S @DDSREFS@("COMPE",DDSBK,DDSF)=DDSEXP
89 . F DDSAR=1:1:DDSAR D
90 .. S:DDSAR(DDSAR)["*DDSREFC*" DDSAR(DDSAR)=$P(DDSAR(DDSAR),"*DDSREFC*")_$E(DDSREFS,1,$L(DDSREFS)-1)_",""COMPE"","_DDSBK_","_DDSF_","_DDSAR_$P(DDSAR(DDSAR),"*DDSREFC*",2,999)
91 .. S @DDSREFS@("COMPE",DDSBK,DDSF,DDSAR)=DDSAR(DDSAR)
92 .. I $D(DDSAR(DDSAR))>9 N I F I=1:1 Q:$D(DDSAR(DDSAR,I))[0 D
93 ... S @DDSREFS@("COMPE",DDSBK,DDSF,DDSAR,I)=DDSAR(DDSAR,I)
94 . S $P(@DDSREFS@(DDSPG,DDSBK,DDSF,"D"),U,9)=1
95 . I $G(DDSFD)]"" F DDSAR=1:1:$L(DDSFD,U) D
96 .. N F S F=$P(DDSFD,U,DDSAR) Q:F=""
97 .. S @DDSREFS@("COMP",$P(F,","),$P($P(F,",",2,99),";"),DDSPG,DDSBK,DDSF)=""
98 ;
99 Q:DDSD1<0!(DDSD2<0)!(DDSD3'>0)!(DDSL2?."^")
100 Q:$P(DDSDDL0,U,4)=" ; " Q:DDSTP="h" Q:DDSFLD=.001
101 I '$P(DDSDDL0,U,2),DDSTP'="e" Q
102 ;
103 S DDSORD(DDSBO,+DDSL0)=DDSF
104 S DDSNAV(DDSD1,DDSD2)=DDSF_","_DDSBK
105 S:$P(DDSDDL0,U,2) DDSMUL(DDSBK,DDSF)=""
106 ;
107 I $G(DDSREP)>1 D
108 . S $P(DDSNAV(DDSD1,DDSD2),",",3)=DDSBO
109 . S DDSRNAV(DDSBO,DDSD1)=DDSBK
110 . S DDSRNAV(DDSBO,DDSD1,DDSD2)=DDSF
111 . S DDSRNAV(DDSBO,DDSD1-1,DDSD2)=DDSF_",-1"
112 . S DDSRNAV(DDSBO,DDSD1+1,DDSD2)=DDSF_",+1"
113 Q
Note: See TracBrowser for help on using the repository browser.