DIU31 ;SFISC/GFT-UNEDITABLE, INPUT TRANS., OUTPUT TRANS. ;10/4/90 8:57 AM
;;22.0;VA FileMan;;Mar 30, 1999
;Per VHA Directive 10-93-142, this routine should not be modified.
;
9 ;
S %=2,DA=+Y
I $P(Y(0),U,2)["I" W !,$C(7),"FIELD IS ALREADY UNEDITABLE",!,"DO YOU WANT TO ALLOW EDITING AGAIN" D YN^DICN Q:%-1 S X=$P(^(0),U,2),^(0)=$P(^(0),U,1)_U_$P(X,"I",1)_$P(X,"I",2)_$P(X,"I",3)_U_$P(^(0),U,3,99) W " ..OK" S %=1 G 2
W !,"WANT TO PREVENT ALL USERS FROM CHANGING OR DELETING DATA VALUES",!
W "THAT ARE ENTERED FOR THE '"_$P(Y,U,2)_"' FIELD" D YN^DICN Q:%-1 S ^(0)=$P(^(0),U,1,2)_"I^"_$P(^(0),U,3,99) W $C(7),!?9,"...FIELD IS NOW UNEDITABLE!" S %=2
2 I $D(DDA) S A0="UNEDITABLE^",(A1,A2)="",@("A"_%)="I" D IT^DICATTA
G DIEZ^DIU0
;
5 W !,$P(Y,U,2) S DA=+Y,Y=$P(Y(0),U,5,99) S:$D(DDA) DDA=Y
W " INPUT TRANSFORM: ",Y D RW^DIR2 Q:X="" S %=$L($P(Y(0),U,1,4))+$L(X) I %>244 W !!?5,$C(7),"Input Transform is TOO LONG by ",%-244," characters.",! K X S Y=DA_U_$P(Y(0),U) G 5
I $P(Y(0),U,2)["K",X'[" ^DIM" K X S Y=DA_U_$P(Y(0),U) W $C(7),!?5,"Input Transform must contain D ^DIM",! G 5
I $P(Y(0),U,2)["F",X["DINUM" W $C(7),!?5,"DINUM on a Freetext field can cause database",!?5,"problems unless you are sure DINUM is numeric."
D ^DIM I '$D(X) W $C(7),"??" S Y=DA_U_$P(Y(0),U) G 5
S ^DD(DI,DA,0)=$P(Y(0),U,1,2)_$E("X",$P(Y(0),U,2)'["X")_U_$P(Y(0),U,3,4)_U_X
I $D(DDA),DDA'=X S A0="INPUT TRANSFORM^.5",A1=DDA,A2=X D IT^DICATTA
S DR="3:4" I $P(Y(0),U,2)["P" S %=$F(X," D ^DIC") I % S X=$E(X,1,%-8),%=$F(X,"DIC(""S"")=") I % S X=$E(X,%-9,$L(X)),^(12.1)="S "_X,DR=DR_";12EXPLANATION OF SCREEN"
S DIE=DIC I $P(Y(0),U,2)["C" D PZ^DIU0 G Q
F %=3,4,12.1 S:$D(^DD(DI,DA,%)) ^UTILITY("DDA",$J,DI,DA,%)=^(%)
S DDA=DI D ^DIE S DI=DDA D IT1^DICATTA,DIEZ^DIU0 G Q
;
O S DIK=1,DJJ=+Y W !,$P(Y,U,2)_" OUTPUT TRANSFORM: "
I '$D(^DD(DI,DJJ,2)) R X:DTIME I '$T S DTOUT=1 G Q
I $D(^(2)) S (DIK,Y)=^(2) S:$D(DDA) DDA=Y S:$D(^(2.1)) Y=^(2.1) W Y D RW^DIR2 I X="@" W !?9,"DELETED!" K ^(2),^(2.1) S Y=$P(^(0),U,2),$P(^(0),U,2)=$P(Y,"O")_$P(Y,"O",2),%="" G EX
G Q:X="" I X?."?" S Y=DJJ_U_$P(^(0),U) W !?4,"Enter a computed-field expression using '"_$P(Y,U,2)_"'",! W:DUZ(0)="@" ?4,"or MUMPS code that takes Y and transforms it to a different Y.",! G O
K ^(2) S DICOMPX(1,DI,DJJ)="Y(0)",DA=DIC_DJJ_",2,",DGG=X,DQI="Y("
D ^DICOMP K DQI,DICOMPX F %=9.2:.1 Q:'$D(X(%)) S @(DA_"%)=X(%)")
I $D(X) S ^DD(DI,DJJ,2)="S Y(0)=Y "_X_$P(" S Y=X",U,Y'["X"),^(2.1)=DGG S:$P(^(0),U,2)'["O" $P(^(0),U,2)=$P(^(0),U,2)_"O" S %=^(2) G EX
S:'DIK ^DD(DI,DJJ,2)=DIK
X W $C(7),"??" Q
;
EX S DA=DJJ I $D(DDA),DDA'=% S A1=DDA,A2=%,A0="OUTPUT TRANSFORM^2" D IT^DICATTA
D PZ^DIU0
Q G Q^DIU
DIU31 ;SFISC/GFT-UNEDITABLE, INPUT TRANS., OUTPUT TRANS. ;10/4/90 8:57 AM
+1 ;;22.0;VA FileMan;;Mar 30, 1999
+2 ;Per VHA Directive 10-93-142, this routine should not be modified.
+3 ;
9 ;
+1 SET %=2
SET DA=+Y
+2 IF $PIECE(Y(0),U,2)["I"
WRITE !,$CHAR(7),"FIELD IS ALREADY UNEDITABLE",!,"DO YOU WANT TO ALLOW EDITING AGAIN"
DO YN^DICN
IF %-1
QUIT
SET X=$PIECE(^(0),U,2)
SET ^(0)=$PIECE(^(0),U,1)_U_$PIECE(X,"I",1)_$PIECE(X,"I",2)_$PIECE(X,"I",3)_U_$PIECE(^(0),U,3,99)
WRITE " ..OK"
SET %=1
GOTO 2
+3 WRITE !,"WANT TO PREVENT ALL USERS FROM CHANGING OR DELETING DATA VALUES",!
+4 WRITE "THAT ARE ENTERED FOR THE '"_$PIECE(Y,U,2)_"' FIELD"
DO YN^DICN
IF %-1
QUIT
SET ^(0)=$PIECE(^(0),U,1,2)_"I^"_$PIECE(^(0),U,3,99)
WRITE $CHAR(7),!?9,"...FIELD IS NOW UNEDITABLE!"
SET %=2
2 IF $DATA(DDA)
SET A0="UNEDITABLE^"
SET (A1,A2)=""
SET @("A"_%)="I"
DO IT^DICATTA
+1 GOTO DIEZ^DIU0
+2 ;
5 WRITE !,$PIECE(Y,U,2)
SET DA=+Y
SET Y=$PIECE(Y(0),U,5,99)
IF $DATA(DDA)
SET DDA=Y
+1 WRITE " INPUT TRANSFORM: ",Y
DO RW^DIR2
IF X=""
QUIT
SET %=$LENGTH($PIECE(Y(0),U,1,4))+$LENGTH(X)
IF %>244
WRITE !!?5,$CHAR(7),"Input Transform is TOO LONG by ",%-244," characters.",!
KILL X
SET Y=DA_U_$PIECE(Y(0),U)
GOTO 5
+2 IF $PIECE(Y(0),U,2)["K"
IF X'[" ^DIM"
KILL X
SET Y=DA_U_$PIECE(Y(0),U)
WRITE $CHAR(7),!?5,"Input Transform must contain D ^DIM",!
GOTO 5
+3 IF $PIECE(Y(0),U,2)["F"
IF X["DINUM"
WRITE $CHAR(7),!?5,"DINUM on a Freetext field can cause database",!?5,"problems unless you are sure DINUM is numeric."
+4 DO ^DIM
IF '$DATA(X)
WRITE $CHAR(7),"??"
SET Y=DA_U_$PIECE(Y(0),U)
GOTO 5
+5 SET ^DD(DI,DA,0)=$PIECE(Y(0),U,1,2)_$EXTRACT("X",$PIECE(Y(0),U,2)'["X")_U_$PIECE(Y(0),U,3,4)_U_X
+6 IF $DATA(DDA)
IF DDA'=X
SET A0="INPUT TRANSFORM^.5"
SET A1=DDA
SET A2=X
DO IT^DICATTA
+7 SET DR="3:4"
IF $PIECE(Y(0),U,2)["P"
SET %=$FIND(X," D ^DIC")
IF %
SET X=$EXTRACT(X,1,%-8)
SET %=$FIND(X,"DIC(""S"")=")
IF %
SET X=$EXTRACT(X,%-9,$LENGTH(X))
SET ^(12.1)="S "_X
SET DR=DR_";12EXPLANATION OF SCREEN"
+8 SET DIE=DIC
IF $PIECE(Y(0),U,2)["C"
DO PZ^DIU0
GOTO Q
+9 FOR %=3,4,12.1
IF $DATA(^DD(DI,DA,%))
SET ^UTILITY("DDA",$JOB,DI,DA,%)=^(%)
+10 SET DDA=DI
DO ^DIE
SET DI=DDA
DO IT1^DICATTA
DO DIEZ^DIU0
GOTO Q
+11 ;
O SET DIK=1
SET DJJ=+Y
WRITE !,$PIECE(Y,U,2)_" OUTPUT TRANSFORM: "
+1 IF '$DATA(^DD(DI,DJJ,2))
READ X:DTIME
IF '$TEST
SET DTOUT=1
GOTO Q
+2 IF $DATA(^(2))
SET (DIK,Y)=^(2)
IF $DATA(DDA)
SET DDA=Y
IF $DATA(^(2.1))
SET Y=^(2.1)
WRITE Y
DO RW^DIR2
IF X="@"
WRITE !?9,"DELETED!"
KILL ^(2),^(2.1)
SET Y=$PIECE(^(0),U,2)
SET $PIECE(^(0),U,2)=$PIECE(Y,"O")_$PIECE(Y,"O",2)
SET %=""
GOTO EX
+3 IF X=""
GOTO Q
IF X?."?"
SET Y=DJJ_U_$PIECE(^(0),U)
WRITE !?4,"Enter a computed-field expression using '"_$PIECE(Y,U,2)_"'",!
IF DUZ(0)="@"
WRITE ?4,"or MUMPS code that takes Y and transforms it to a different Y.",!
GOTO O
+4 KILL ^(2)
SET DICOMPX(1,DI,DJJ)="Y(0)"
SET DA=DIC_DJJ_",2,"
SET DGG=X
SET DQI="Y("
+5 DO ^DICOMP
KILL DQI,DICOMPX
FOR %=9.2:.1
IF '$DATA(X(%))
QUIT
SET @(DA_"%)=X(%)")
+6 IF $DATA(X)
SET ^DD(DI,DJJ,2)="S Y(0)=Y "_X_$PIECE(" S Y=X",U,Y'["X")
SET ^(2.1)=DGG
IF $PIECE(^(0),U,2)'["O"
SET $PIECE(^(0),U,2)=$PIECE(^(0),U,2)_"O"
SET %=^(2)
GOTO EX
+7 IF 'DIK
SET ^DD(DI,DJJ,2)=DIK
X WRITE $CHAR(7),"??"
QUIT
+1 ;
EX SET DA=DJJ
IF $DATA(DDA)
IF DDA'=%
SET A1=DDA
SET A2=%
SET A0="OUTPUT TRANSFORM^2"
DO IT^DICATTA
+1 DO PZ^DIU0
Q GOTO Q^DIU