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

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

initial load of WorldVistAEHR

File size: 2.2 KB
Line 
1DITC1 ;SFISC/XAK-COMPARE FILE ENTRIES PRINT ;7/1/93 4:31 PM
2 ;;22.0;VA FileMan;;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4PRNT S %ZIS("B")="",%ZIS=$S($D(DIMERGE):"M",1:"QM") D ^%ZIS G:POP END^DITC I $D(IO("Q")) G QUE
5COMP W:$D(DDSP) !,"COMPARING THE TWO ENTRIES" F I=1:1:2 I $L(DTO(I)) S J=-1 F K=0:0 S @("J=$O("_DTO(I)_"J))") Q:J="" W:$D(DDSP) "." D EACH
6 D DISP
7 Q
8EACH ;
9 I @("$D("_DTO(I)_"J))'<10") D MUL Q
10 S X=^(J) F N=1:1 D:$L($P(X,U,N)) SETU Q:'$L($P(X,U,N,999))
11 Q
12SETU ;
13 I '$D(^UTILITY($J,"DIT",J,N,0)) S @("Y=$O(^DD("_DFF_",""GL"",J,"_N_",-1))") Q:Y="" S %=^DD(DFF,Y,0),^UTILITY($J,"DIT",J,N,0)=Y_U_$P(%,U,1)_U I Y=.01,$P(%,U,5,999)["DINUM" S ^UTILITY($J,"DITDINUM",J,N,0)=""
14 S O=+^UTILITY($J,"DIT",J,N,0) S:$P(^DD(DFF,O,0),U,2)["O" ^UTILITY($J,"DITI",J,N,I)=$P(X,U,N)
15 S C=^DD(DFF,O,0),O=$P(C,U,1),C=$P(C,U,2),D0=DIT(I),Y=$P(X,U,N) D Y^DIQ S ^UTILITY($J,"DIT",J,N,I)=Y
16 Q
17MUL ;
18 I '$D(^UTILITY($J,"DIT",U,J,0)) S @("Y=$O(^DD("_DFF_",""GL"",J,0,-1))") Q:Y="" S ^UTILITY($J,"DIT",U,J,0)=Y_U_$P(^DD(DFF,Y,0),U,1)_U
19 S N=0 F L=0:1 S @("N=$O("_DTO(I)_"J,N))") Q:'N
20 S $P(^UTILITY($J,"DIT",U,J,0),U,I+3)=L
21 Q
22DISP ;
23 U IO
24 I $D(DIMERGE) S J=-1 F S J=$O(^UTILITY($J,"DIT",J)) Q:U[J S N=-1 F S N=$O(^UTILITY($J,"DIT",J,N)) Q:N="" D D11^DITC2
25 S DC=0,DDSH="",$P(DDSH,"-",IOM-1)="-",$P(DDSPC," ",30)=" ",DV=(IOM-1)\3
26 S DHD(0)="COMPARISON OF "_DFL(1)_" FILE ENTRIES"
27 S R=$S(DSUB(DSUB)[",":1,1:0),%H=$H D YX^%DTC S DHD(9)=$P(Y,":",1,2)
28 F I=1:1:2 I $L(DTO(I)) F J=1:2 S K=$P(DTO(I),",",1,J+R) Q:($E(K,$L(K))=",") D D0
29 S DIFF=$S(IOST?1"C".E:1,1:0) D ^DITC2 K DUOUT
30 I $D(DTOUT)!('$D(DIMERGE)) G EX
31 I IOST'?1"C".E W !!!!,?3,"**** NOW PROCEEDING WITH THE MERGE ****" W @IOF S DIACT="P" D ACT^DITC3 G EX
32 I X=U D ASK^DITC3 G EX
33 W ! D @($P("ASK",U,'$O(^UTILITY($J,"DIT",U,0)))_"^DITC3")
34EX X $G(^%ZIS("C")) G END^DITC
35 Q
36D0 ;
37 I '$D(^DD(DFF(J+1\2),.001,0)) S K=K_",0)" Q:'$D(@K) S Y=^(0),Y=$P(Y,U,1) Q:'$L(Y) S C=^DD(DFF(J+1\2),.01,0) G D01
38 S Y=$P($P(DTO(I),DIC,2),",",1),C=^DD(DFF(J+1\2),.001,0)
39D01 S O=$P(C,U,1),C=$P(C,U,2) D Y^DIQ S $P(DHD(J\2+1),U,I)=Y
40 Q
41QUE ;
42 K Y,K,L,M,N,I,X,X1,C,DDSP,DMSG
43 S DJ=0,DHD="COMPARE OF "_DFL(1)_" FILE" D ^DIP4 G END^DITC
44 Q
45DQ ;
46 D NOW^%DTC S DT=X K %,%I G COMP
Note: See TracBrowser for help on using the repository browser.