DITC3 ;SFISC/XAK-COMPARE FILE ENTRIES ;9/17/91 3:12 PM
;;22.0;VA FileMan;;Mar 30, 1999
;Per VHA Directive 10-93-142, this routine should not be modified.
F I=1:1:(IOSL-$Y-1) W !
W "Enter RETURN to continue: " R X:DTIME S:'$T DTOUT=1
ASK Q:$D(DTOUT) K DUOUT,DIRUT W @IOF,!,"OK. I'M READY TO DO THE MERGE."
S DIR(0)="S^P:PROCEED to merge the data;S:SUMMARIZE the modifications before proceeding;E:EDIT the data again before proceeding"
S DIR("A")="ACTION" D ^DIR K DIR
Q:$D(DIRUT) I Y="E" D ^DITC2 Q:$D(DTOUT) G ASK:X=U,DITC3:$D(^UTILITY($J,"DIT",U)),ASK
S DIACT=Y,DNUM=0 D ACT Q:DIACT="P" G:$D(DIRUT) ASK G DITC3
ACT ;
I DIACT="S" D SUMHD
S DIT1="" F K=0:0 Q:$D(DTOUT) S DIT1=$O(^UTILITY($J,"DIT",DIT1)) Q:DIT1="" S DIT2="" F K=0:0 Q:$D(DTOUT) S DIT2=$O(^UTILITY($J,"DIT",DIT1,DIT2)) Q:DIT2="" S X(0)=^(DIT2,0),%=$P(X(0),U,3) I %,DDEF'=% D EACH
W !!,?2,"NOTE: Multiples will be merged into the target record"
K DIT1,DIT2 Q
EACH ;
I DIACT="S" G SUMEACH
S DIE=DFF(1),DA=$P(DIT(DDEF),","),X2=$S($D(^UTILITY($J,"DITI",DIT1,DIT2,%)):^(%),'$D(^UTILITY($J,"DIT",DIT1,DIT2,%)):"@",1:^(%))
S DR=+X(0)_"///"_X2 D ^DIE W "."
K DR,DIE Q
SUMHD ;
W @IOF,!,"SUMMARY OF MODIFICATIONS TO ",$P(DHD(DFL),U,DDEF),!,"FIELD",?DV,$S(DDEF=1:"OLD",1:"NEW")," VALUE",?(DV*2),$S(DDEF=1:"NEW",1:"OLD")," VALUE",!,DDSH
Q
SUMEACH ;
I $Y+5>IOSL K DIR S DIR(0)="E" D ^DIR K DIR Q:$D(DIRUT) D SUMHD
K D S X2="",X(0)=$P(X(0),U,2) F I=1:1:2 S X(I)=$S($D(^UTILITY($J,"DIT",DIT1,DIT2,I)):^(I),1:"")
D D20^DITC2
Q
DITC3 ;SFISC/XAK-COMPARE FILE ENTRIES ;9/17/91 3:12 PM
+1 ;;22.0;VA FileMan;;Mar 30, 1999
+2 ;Per VHA Directive 10-93-142, this routine should not be modified.
+3 FOR I=1:1:(IOSL-$Y-1)
WRITE !
+4 WRITE "Enter RETURN to continue: "
READ X:DTIME
IF '$TEST
SET DTOUT=1
ASK IF $DATA(DTOUT)
QUIT
KILL DUOUT,DIRUT
WRITE @IOF,!,"OK. I'M READY TO DO THE MERGE."
+1 SET DIR(0)="S^P:PROCEED to merge the data;S:SUMMARIZE the modifications before proceeding;E:EDIT the data again before proceeding"
+2 SET DIR("A")="ACTION"
DO ^DIR
KILL DIR
+3 IF $DATA(DIRUT)
QUIT
IF Y="E"
DO ^DITC2
IF $DATA(DTOUT)
QUIT
IF X=U
GOTO ASK
IF $DATA(^UTILITY($JOB,"DIT",U))
GOTO DITC3
GOTO ASK
+4 SET DIACT=Y
SET DNUM=0
DO ACT
IF DIACT="P"
QUIT
IF $DATA(DIRUT)
GOTO ASK
GOTO DITC3
ACT ;
+1 IF DIACT="S"
DO SUMHD
+2 SET DIT1=""
FOR K=0:0
IF $DATA(DTOUT)
QUIT
SET DIT1=$ORDER(^UTILITY($JOB,"DIT",DIT1))
IF DIT1=""
QUIT
SET DIT2=""
FOR K=0:0
IF $DATA(DTOUT)
QUIT
SET DIT2=$ORDER(^UTILITY($JOB,"DIT",DIT1,DIT2))
IF DIT2=""
QUIT
SET X(0)=^(DIT2,0)
SET %=$PIECE(X(0),U,3)
IF %
IF DDEF'=%
DO EACH
+3 WRITE !!,?2,"NOTE: Multiples will be merged into the target record"
+4 KILL DIT1,DIT2
QUIT
EACH ;
+1 IF DIACT="S"
GOTO SUMEACH
+2 SET DIE=DFF(1)
SET DA=$PIECE(DIT(DDEF),",")
SET X2=$SELECT($DATA(^UTILITY($JOB,"DITI",DIT1,DIT2,%)):^(%),'$DATA(^UTILITY($JOB,"DIT",DIT1,DIT2,%)):"@",1:^(%))
+3 SET DR=+X(0)_"///"_X2
DO ^DIE
WRITE "."
+4 KILL DR,DIE
QUIT
SUMHD ;
+1 WRITE @IOF,!,"SUMMARY OF MODIFICATIONS TO ",$PIECE(DHD(DFL),U,DDEF),!,"FIELD",?DV,$SELECT(DDEF=1:"OLD",1:"NEW")," VALUE",?(DV*2),$SELECT(DDEF=1:"NEW",1:"OLD")," VALUE",!,DDSH
+2 QUIT
SUMEACH ;
+1 IF $Y+5>IOSL
KILL DIR
SET DIR(0)="E"
DO ^DIR
KILL DIR
IF $DATA(DIRUT)
QUIT
DO SUMHD
+2 KILL D
SET X2=""
SET X(0)=$PIECE(X(0),U,2)
FOR I=1:1:2
SET X(I)=$SELECT($DATA(^UTILITY($JOB,"DIT",DIT1,DIT2,I)):^(I),1:"")
+3 DO D20^DITC2
+4 QUIT