FHINIT2 ; ; 11-OCT-1995
;;5.0;Dietetics;;Oct 11, 1995
;
;
K ^UTILITY("DIFROM",$J),DIC S DIDUZ=0 S:$D(DUZ)#2 DIDUZ=DUZ S DUZ=.5
I $D(^DIC(9.2,0))#2,^(0)?1"HEL".E S (DIC,DLAYGO)=9.2,N="HEL",DIC(0)="LX" G ADD
Q
;
ADD F R=0:0 S R=$O(^UTILITY(U,$J,N,R)) Q:R'>0 S X=$P(^(R,0),U,1) W "." K DA D ^DIC I Y>0,'$D(DIFQ(N))!$P(Y,U,3) S ^UTILITY("DIFROM",$J,N,X)=+Y K ^DIC(9.2,+Y,1),^(2),^(3),^(10) S %X="^UTILITY(U,$J,N,R,",%Y=DIC_"+Y,",DA=+Y D %XY^%RCR
S DIK=DIC
HELP S R=$O(^UTILITY("DIFROM",$J,N,R)) Q:R="" W !,"'"_R_"' Help Frame filed." S DA=^(R)
F X=0:0 S X=$O(^DIC(9.2,DA,2,X)) Q:'X S I=$S($D(^(X,0)):^(0),1:0),Y=$P(I,U,2) S:Y]"" Y=$O(^DIC(9.2,"B",Y,0)) S ^(0)=$P(^DIC(9.2,DA,2,X,0),U,1)_U_$S(Y>0:Y,1:"")_U_$P(^(0),U,3,99)
S I=0 F X=0:0 S X=$O(^DIC(9.2,DA,10,X)) Q:'X I $D(^(X,0)) S Y=$P(^(0),U),Y=$S(Y]"":$O(^MAG("B",Y,0)),1:0) S:Y $P(^DIC(9.2,DA,10,X,0),U)=Y,I=I+1,%=X I 'Y K ^DIC(9.2,DA,10,X,0)
I I S $P(^DIC(9.2,DA,10,0),U,3,4)=%_U_I
IX D IX1^DIK G HELP
;
U I $D(DIRUT) S DIFQ=1
W ! Q
REP S DIR(0)="Y",DIR("A")="Shall I change the NAME of the file to "_DIF
S DIR("??")="^D REP^DIFROMH1",DIR("B")="NO" D ^DIR G U:$D(DIRUT)
I Y S DIE=1,DIFQ=0,DA=N,DR=".01////"_DIF D ^DIE Q
S DIR("A")="Shall I replace your file with mine"
S DIR("??")="^D AG^DIFROMH1" D ^DIR G U:$D(DIRUT)!'Y
S DIU(0)="E",DIR("A")="Do you want to keep the Data"
S DIR("??")="^D CHG^DIFROMH1" D ^DIR G U:$D(DIRUT)
S:'Y DIU(0)=DIU(0)_"D"
S DIR("A")="Do you want to keep the Templates"
S DIR("??")="^D TEMP^DIFROMH1" D ^DIR G U:$D(DIRUT) S:'Y DIU(0)=DIU(0)_"T"
S DIFQ(N)=1,DIFKEP(N)=DIU(0) W !?15," (",DIF,") " Q
FHINIT2 ; ; 11-OCT-1995
+1 ;;5.0;Dietetics;;Oct 11, 1995
+2 ;
+3 ;
+4 KILL ^UTILITY("DIFROM",$JOB),DIC
SET DIDUZ=0
IF $DATA(DUZ)#2
SET DIDUZ=DUZ
SET DUZ=.5
+5 IF $DATA(^DIC(9.2,0))#2
IF ^(0)?1"HEL".E
SET (DIC,DLAYGO)=9.2
SET N="HEL"
SET DIC(0)="LX"
GOTO ADD
+6 QUIT
+7 ;
ADD FOR R=0:0
SET R=$ORDER(^UTILITY(U,$JOB,N,R))
IF R'>0
QUIT
SET X=$PIECE(^(R,0),U,1)
WRITE "."
KILL DA
DO ^DIC
IF Y>0
IF '$DATA(DIFQ(N))!$PIECE(Y,U,3)
SET ^UTILITY("DIFROM",$JOB,N,X)=+Y
KILL ^DIC(9.2,+Y,1),^(2),^(3),^(10)
SET %X="^UTILITY(U,$J,N,R,"
SET %Y=DIC_"+Y,"
SET DA=+Y
DO %XY^%RCR
+1 SET DIK=DIC
HELP SET R=$ORDER(^UTILITY("DIFROM",$JOB,N,R))
IF R=""
QUIT
WRITE !,"'"_R_"' Help Frame filed."
SET DA=^(R)
+1 FOR X=0:0
SET X=$ORDER(^DIC(9.2,DA,2,X))
IF 'X
QUIT
SET I=$SELECT($DATA(^(X,0)):^(0),1:0)
SET Y=$PIECE(I,U,2)
IF Y]""
SET Y=$ORDER(^DIC(9.2,"B",Y,0))
SET ^(0)=$PIECE(^DIC(9.2,DA,2,X,0),U,1)_U_$SELECT(Y>0:Y,1:"")_U_$PIECE(^(0),U,3,99)
+2 SET I=0
FOR X=0:0
SET X=$ORDER(^DIC(9.2,DA,10,X))
IF 'X
QUIT
IF $DATA(^(X,0))
SET Y=$PIECE(^(0),U)
SET Y=$SELECT(Y]"":$ORDER(^MAG("B",Y,0)),1:0)
IF Y
SET $PIECE(^DIC(9.2,DA,10,X,0),U)=Y
SET I=I+1
SET %=X
IF 'Y
KILL ^DIC(9.2,DA,10,X,0)
+3 IF I
SET $PIECE(^DIC(9.2,DA,10,0),U,3,4)=%_U_I
IX DO IX1^DIK
GOTO HELP
+1 ;
U IF $DATA(DIRUT)
SET DIFQ=1
+1 WRITE !
QUIT
REP SET DIR(0)="Y"
SET DIR("A")="Shall I change the NAME of the file to "_DIF
+1 SET DIR("??")="^D REP^DIFROMH1"
SET DIR("B")="NO"
DO ^DIR
IF $DATA(DIRUT)
GOTO U
+2 IF Y
SET DIE=1
SET DIFQ=0
SET DA=N
SET DR=".01////"_DIF
DO ^DIE
QUIT
+3 SET DIR("A")="Shall I replace your file with mine"
+4 SET DIR("??")="^D AG^DIFROMH1"
DO ^DIR
IF $DATA(DIRUT)!'Y
GOTO U
+5 SET DIU(0)="E"
SET DIR("A")="Do you want to keep the Data"
+6 SET DIR("??")="^D CHG^DIFROMH1"
DO ^DIR
IF $DATA(DIRUT)
GOTO U
+7 IF 'Y
SET DIU(0)=DIU(0)_"D"
+8 SET DIR("A")="Do you want to keep the Templates"
+9 SET DIR("??")="^D TEMP^DIFROMH1"
DO ^DIR
IF $DATA(DIRUT)
GOTO U
IF 'Y
SET DIU(0)=DIU(0)_"T"
+10 SET DIFQ(N)=1
SET DIFKEP(N)=DIU(0)
WRITE !?15," (",DIF,") "
QUIT