source: WorldVistAEHR/trunk/r/VA_FILEMAN-ARJT-DI-DD-DM-DT-%DT-%RCR/DICATTD.m@ 1046

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

initial load of WorldVistAEHR

File size: 4.5 KB
Line 
1DICATTD ;SFISC/GFT-SCREEN-MODE 'MODIFY FILE ATTRIBUTES' ;01:41 PM 24 Dec 2001
2 ;;22.0;VA FileMan;**1,8,42,89**;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 N DG,DLAYGO,DIC,DICATTB,DICATTA,DICATTF,DA,DDA
6 K ^UTILITY("DICATTD",$J),^UTILITY("DDA",$J) ;auditing
7 S DLAYGO=1 D D^DICRW Q:Y<0 I $P($G(^DD(+Y,0,"DI")),U)["Y",$P(@(^DIC(+Y,0,"GL")_"0)"),U,4) W !!,$C(7),"DATA DICTIONARY MODIFICATIONS ON ARCHIVE FILES ARE NOT ALLOWED!" Q
8 I '$D(DIC) D DIE^DIB Q:'$D(DG) S DIC=DG
9LOCK S (DA,DICATTB,DICATTA)=+$P(@(DIC_"0)"),U,2) L +^DICATTD(DA):1 E W !!,"SOMEONE ELSE IS EDITING THIS FILE" Q ;N.B.--There is no such Global
10 I $G(^DD(DA,0,"DDA"))["Y" S DDA="" ;DD auditing
11ASKLOOP F K DICATTF D M I $S('$D(DICATTF):1,'$D(^DD(DICATTA)):1,DICATTF-.01:0,1:$P(^DD(DICATTA,DICATTF,0),U,2)["W") Q:DICATTA=DICATTB S DICATTA=DICATTB
12END L -^DICATTD(DICATTB) Q
13 ;
14M N DICATTVP,DICATTDK,DICATT2N,DICATTMN,DICATTDW,DDSERROR,DICS,DICATTSC
15 N DICATT2,DICATT4,DICATT3,DICATT3N,DICATTL,DICATTLN,DICATT5,DICATT5N,DICATT5P
16 N O,DIU0,I,J,DR,A,DQ
17 N DDSFILE,DIMSG,DUOUT,DTOUT,DDSPAGE,DDSPARM,DDSSAVE,DICATTNW
18FIELD W !!! K DIC,O,^UTILITY("DICATTD",$J) ;clean WP buffer
19 S DIC(0)="ALEQIZ",DIC="^DD("_DICATTA_"," S:$D(DICS) DIC("S")=DICS
20 S DIC("W")="S %=$P(^(0),U,2) I % W $P("" (multiple)^ (word-processing)"",U,$P(^DD(+%,.01,0),U,2)[""W""+1)"
21 I $P(^DD(DICATTA,.01,0),U,2)["W" S DIC(0)="AEQZ",DIC("B")=.01
22 D ^DIC K DIC I Y<0 K DICATTF Q ;look-up
23NEWFIELD I $P(Y,U,3) S DICATTNW=1 S:$D(DDA) DDA="N"
24 E S DIU0=DICATTA,O(1)=$P(^(0),U,1,2),O(2)=$G(^(.1)) I $D(DDA) D
25 .N A S A=DIU0 S DDA="E" D SV^DICATTA
26 S:$D(DDA) DDA(1)=DICATTA
27 S DICATTF=+Y
28 D GET
29MUL I DICATT2 D S DICATTA=+$G(DICATT2) Q:'DICATTA!'$D(^DD(DICATTA)) G FIELD ;If it's multiple...
30 .N DICATT2N,DDSPAGE S DDSPAGE=10 D DDS ;...we do Page 10
31DDS K DDSSAVE,DIMSG S DDSPARM="S",DA="",DR="[DICATT]",DDSFILE=1
32 D ^DDS ;invoke SCREENMAN!
33 Q:'$D(^DD(DICATTA,DICATTF,0))
34 S DICATT2N=$P(^(0),U,2) I DICATT2N="",DICATTF-.01 D DELFLD^DICATTDK(DICATTA,DICATTF) Q ;delete field
35VERIFY I '$D(DTOUT),'$D(DIMSG),$D(DDSSAVE) D N^DICATTDE I 'DICATT2N,'$G(DICATTNW),$D(DICATTMN) D DIVR^DIUTL(DICATTA,DICATTF) ;re-verify fields
36 Q
37 ;
38GET ;
39 K DICATT2N,DICATT3N,DICATT5N,DICATTLN,DICATT5P
40 S DICATT2=$P(^DD(DICATTA,DICATTF,0),U,2),DICATT3=$P(^(0),U,3),DICATT4=$P(^(0),U,4),DICATT5=$P(^(0),U,5,99)
41 I $D(^DD(DICATTA,DICATTF,"V")) D GET^DICATTD8 ;Variable-pointer
42 Q
43 ;
44PRE ;PRE-ACTION of first block
45 N DIAC,DIFILE
46 I DICATTF=.01 D REQ^DDSUTL(1,"DICATT",1,1) ;for now
47 I DICATT2["C" D CUNED^DICATTD6(DICATT2)
48 I DICATT2["W" F X=18,3,4 D UNED(X)
49 S X=1 I DICATTF=.01,DICATTA-DICATTB S X=2
50 D UNED^DDSUTL(20.5,"DICATT",1,X) ;2 means REACHABLE but not EDITABLE
51 S DIAC="AUDIT",DIFILE=DICATTB D ^DIAC I %-1 D UNED(3) ;check AUDIT ACCESS
52 I DUZ(0)'="@" D ;only programmers can...
53 .D UNED(4),UNED(99) ; ..edit AUDIT CONDITION, XECUTABLE HELP, or ...
54 .I DICATT2["X" D X,UNED(1),UNED(2) ;edit LABEL of 'X' field, or ...
55 .I $$TYPE=9 D UNED(20) ;edit a MUMPS type
56 .F I=4,5 D UNED^DDSUTL(I,"DICATTVP",8,1) ;build VARIABLE-POINTER SCREEN
57 .F I=16,17 D UNED^DDSUTL(I,"DICATTM",3,1) ;specify location of
58 .F I=76,76.1 D UNED^DDSUTL(I,"DICATTS",4,1) ;...data
59 Q:DICATT2'["X"
60X D UNED(20) D HLP^DDSUTL("NOTE THAT THIS FIELD'S DEFINITION IS NOT EDITABLE")
61 Q
62 ;
63UNED(I) D UNED^DDSUTL(I,"DICATT",1,1) Q
64 ;
65NUMBER ;
66 D IJ^DIUTL(DICATTA) S Y=" File #"_J(0)
67 F I=1:1 Q:'$D(J(I)) S Y=" Sub-File #"_J(I)_" of"_Y
68 S Y="Field #"_DICATTF_" in"_Y
69 I $P($G(^DD(DICATTA,DICATTF,0)),U,2) S Y="Multiple "_Y
70 S Y=$J("",78-$L(Y)\2)_Y Q
71 ;
72TYPE() ;Figure out TYPE from the second piece of the zero node
73 I DICATT2="" Q ""
74 N N F N=9:-1:5,1:1:4,100 I DICATT2[$E("DNSFWCPVK",N) Q
75 S:N=100 N=4 Q N
76 ;
77SCREEN ;
78 N N
79 I DICATTF=.001 S DIR("S")="I Y<4!(Y=7)" Q
80 S N=$$TYPE I N="" S:DUZ(0)'="@" DIR("S")="I Y-9" Q
81 I N=6 S DIR("S")="I Y=6" Q ;can't change a COMPUTED FIELD's type
82 S DIR("S")="I Y-6,Y-9"_$P(",Y-5",U,N\2-2!'$D(^DD(DICATTA,0,"UP"))!(DICATTF-.01)!($O(^DD(DICATTA,DICATTF))>0))_$S(N=7:",Y-8",N=8:",Y-7",1:"")
83 Q
84 ;
85BRANCH ;given X=TYPE
86 F I=31,32 D REQ^DDSUTL(I,"DICATT2",2.2,X=2) ;UPPER BOUND & LOWER BOUND if we are doing a NUMERIC
87 F I=68,69 D REQ^DDSUTL(I,"DICATT4",2.4,X=4) ;MAX LENGTH & MIN LENGTH if we are doing a FREE TEXT
88 I X=9 G ^DICATTD9
89 I DICATT4="",DICATTF>.001 D UNED^DDSUTL(20.5,"DICATT",1,X=5) ;W-P doesn't ask MULTIPLE
90 K DICATTSC
91 S DDSSTACK="2."_X Q ;For types 1-8, we have Pages
92 ;
93CHNG I DICATT5N=DICATT5 K DICATTMN ;No DICATTMN means no change
94 D:$D(DICATTMN) PUT^DDSVALF(98,"DICATT",1,DICATTMN) ;HELP-PROMPT prompted
95 Q
96 ;
Note: See TracBrowser for help on using the repository browser.