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

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

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1DIFROMSX ;SFIRMFO/DCM/TKW-MOVE INDEX FILE ENTRIES ;12:31 PM 31 Oct 2001
2 ;;22.0;VA FileMan;**1,11,92**;Mar 30, 1999
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4DDIXOUT(DIFRFILE,DIFRF2,DIFRFDD,DIFRTA) ; retrieve INDEX entries for file
5 ; DIFRFILE=top level file#
6 ; DIFRF2=current file/subfile #
7 ; DIFRFDD=1 if sending full DD
8 ; DIFRTA=Global reference of transport global.
9 N DIFRNAME,DIFRD0,DIFRD1,DIFRF,DIFRFLD,DIOUT,X,DICNT1,DICNT2
10 S DIFRNAME="",DIOUT=0
11 F S DIFRNAME=$O(^DD("IX","BB",DIFRF2,DIFRNAME)) Q:DIFRNAME="" D Q:DIOUT
12 . S DIFRD0=$O(^DD("IX","BB",DIFRF2,DIFRNAME,0)) Q:'DIFRD0
13 . S (DIFRD1,DICNT1,DICNT2)=0
14 . F S DIFRD1=$O(^DD("IX",DIFRD0,11.1,DIFRD1)) Q:'DIFRD1 D Q:DIOUT
15 . . S X=$G(^DD("IX",DIFRD0,11.1,DIFRD1,0))
16 . . S DIFRF=$P(X,U,3),DIFRFLD=$P(X,U,4) Q:'DIFRFLD!('DIFRF)
17 . . S DICNT1=DICNT1+1,X=$$FNO^DILIBF(DIFRF)
18 . . I '$D(@DIFRTA@("^DD",X,DIFRF,DIFRFLD)) D Q
19 . . . Q:'DIFRFDD&($G(@DIFRTA@("FIA",X,DIFRF))'=0)
20 . . . D ERR1(DIFRF,DIFRFLD,DIFRNAME,"INDEX") Q
21 . . S DICNT2=DICNT2+1
22 . . Q
23 . Q:DIOUT I DICNT2=0,'DIFRFDD Q
24 . ;I DICNT1'=DICNT2 D ERR2(DIFRF2,DIFRNAME,"INDEX") Q
25 . M @DIFRTA@("IX",DIFRFILE,DIFRF2,DIFRNAME)=^DD("IX",DIFRD0)
26 . K @DIFRTA@("IX",DIFRFILE,DIFRF2,DIFRNAME,11.1,"AC")
27 . K @DIFRTA@("IX",DIFRFILE,DIFRF2,DIFRNAME,11.1,"B")
28 . K @DIFRTA@("IX",DIFRFILE,DIFRF2,DIFRNAME,11.1,"BB")
29 . Q
30 Q
31 ;
32DDIXIN(DIFRFILE,DIFRF2,DIFRSA) ; Install INDEX file entries for file DIFRFILE
33 ; DIFRFILE=source file#
34 ; DIFRF2=current file/subfile#
35 ; DIFRSA=name of array containing incoming data.
36 N DIFRER,DIFRIN,DIFRNAME,DIFRD1,DIOUT,DIFRIN1,DIFRF,DIFRFLD,X
37 I '$D(^DD(.11)) S DIFRER("FILE")=.11 D BLD^DIALOG(401,.DIFRER) Q
38 S DIFRIN=$NA(@DIFRSA@("IX",DIFRFILE,DIFRF2))
39 S DIFRNAME=""
40 F S DIFRNAME=$O(@DIFRIN@(DIFRNAME)) Q:DIFRNAME="" D
41 . S (DIFRD1,DIOUT)=0,DIFRIN1=$NA(@DIFRIN@(DIFRNAME))
42 . F S DIFRD1=$O(@DIFRIN1@(11.1,DIFRD1)) Q:'DIFRD1 D Q:DIOUT
43 . . S X=$G(@DIFRIN1@(11.1,DIFRD1,0))
44 . . S DIFRF=$P(X,U,3),DIFRFLD=$P(X,U,4)
45 . . I 'DIFRF!('DIFRFLD) Q
46 . . I '$D(^DD(DIFRF,DIFRFLD,0)) D ERR3(DIFRF,DIFRFLD,DIFRNAME,"INDEX") Q
47 . . I $O(^DD(DIFRF,DIFRFLD,5,0)) D
48 . . . Q:$D(^TMP("DIFROMS2",$J,"TRIG",DIFRFILE,DIFRF,DIFRFLD))
49 . . . D TRMOD^DICR(DIFRF,DIFRFLD)
50 . . . S ^TMP("DIFROMS2",$J,"TRIG",DIFRFLD,DIFRF,DIFRFLD)="" Q
51 . . Q
52 . Q:DIOUT
53 . N DIEN,DIK,DA,DIC,DO
54 . S DIEN=$O(^DD("IX","BB",DIFRF2,DIFRNAME,0))
55 . I DIEN D N DINUM S DINUM=DIEN
56 . . S DIK="^DD(""IX"",",DA=DIEN N DIEN D ^DIK Q
57 . S DIC="^DD(""IX"",",DIC(0)="L",DIC("DR")=".02///^S X="_""""_DIFRNAME_"""",X=DIFRF2 D FILE^DICN S DIEN=+Y
58 . I DIEN'>0 D ERR4(DIFRF2,DIFRNAME,"INDEX") Q
59 . M ^DD("IX",DIEN)=@DIFRIN1
60 . K DIK,DA S DIK="^DD(""IX"",",DA=DIEN D IX1^DIK
61 . Q
62 Q
63 ;
64ERR1(DIFRF,DIFRFLD,DIFRNAME,DIFRTYPE) ;
65 N DIFRER S DIFRER(1)=DIFRFLD
66 S DIFRER(2)=DIFRF
67 S DIFRER(3)=DIFRNAME,DIFRER(4)=DIFRTYPE
68 D BLD^DIALOG(9543,.DIFRER) S DIOUT=1 Q
69ERR2(DIFRF2,DIFRNAME,DIFRTYPE) ;
70 N DIFRER S DIFRER(1)=DIFRNAME,DIFRER(2)=DIFRTYPE
71 S DIFRER(3)=DIFRF2
72 D BLD^DIALOG(9544,.DIFRER) Q
73ERR3(DIFRF,DIFRFLD,DIFRNAME,DIFRTYPE) ;
74 N DIFRER S DIFRER(1)=DIFRTYPE,DIFRER(2)=DIFRNAME
75 S DIFRER(3)=DIFRFLD
76 S DIFRER(4)=DIFRF
77 D BLD^DIALOG(9545,.DIFRER) S DIOUT=1 Q
78ERR4(DIFRF2,DIFRNAME,DIFRTYPE) ;
79 N DIFRER S DIFRER(1)=DIFRTYPE,DIFRER(2)=DIFRNAME,DIFRER(3)=DIFRF2
80 D BLD^DIALOG(9549,.DIFRER) Q
81 ;
82 ;9543 Field |1| of file |2|, part of '|3|' |4| entry, is missing from the transport global...
83 ;9544 Field(s) that are part of |1| |2| entry are missing from the transport global.
84 ;9545 |1| entry |2| not installed. The REFERENCE FIELD |3| in file |4| does not exist on the system.
85 ;9549 |1| "|2|" on file |3| not installed, FILE^DICN call failed.
86 ;
Note: See TracBrowser for help on using the repository browser.