source: FOIAVistA/trunk/r/PATIENT_DATA_EXCHANGE-VAQ/VAQXRF1.m@ 811

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

initial load of FOIAVistA 6/30/08 version

File size: 2.2 KB
Line 
1VAQXRF1 ;ALB/JRP - X-REF CODES FOR PDX;25-NOV-92
2 ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
3AB(IFN,SET,FNUM,OLDX) ;AB* X-REF FOR ENCRYPTED FIELDS FILE (#394.73)
4 ;INPUT : IFN - Internal file number of record
5 ; SET - If 1, set cross reference
6 ; If 0, kill cross reference (DEFAULT)
7 ; FNUM - Only valid for KILLS
8 ; The field number that was changed
9 ; OLDX - Only valid for KILLS
10 ; The previous value
11 ;OUTPUT : 0 - Cross reference was set/killed
12 ; -1 - Cross reference not set/killed
13 ; -2 - Bad input
14 ;
15 ;CHECK INPUT & RECORD EXISTANCE
16 Q:($G(IFN)="") -2
17 S SET=+$G(SET)
18 Q:('$D(^VAT(394.73,IFN))) -2
19 Q:(('SET)&('$D(FNUM))&('$D(OLDX))) -2
20 ;DECLARE VARIABLES
21 N FILE,FIELD,ZERO
22 ;GET INFO FOR X-REF & QUIT IF ANY PART IS NULL
23 S ZERO=$G(^VAT(394.73,IFN,0))
24 Q:(ZERO="") -1
25 S FILE=$P(ZERO,"^",2)
26 I ('SET) S:(FNUM=.02) FILE=OLDX
27 Q:(FILE="") -1
28 S FIELD=$P(ZERO,"^",3)
29 I ('SET) S:(FNUM=.03) FIELD=OLDX
30 Q:(FIELD="") -1
31 ;SET X-REF
32 S:(SET) ^VAT(394.73,"A-NCRYPT",FILE,FIELD,IFN)=""
33 ;KILL X-REF
34 K:('SET) ^VAT(394.73,"A-NCRYPT",FILE,FIELD,IFN)
35 Q 0
36 ;
37AC(IFN,SET,FNUM,OLDX) ;AC* X-REF FOR DATA FILE (#394.62)
38 ;INPUT : IFN - Internal file number of record
39 ; SET - If 1, set cross reference
40 ; If 0, kill cross reference (DEFAULT)
41 ; FNUM - Only valid for KILLS
42 ; The field number that was changed
43 ; OLDX - Only valid for KILLS
44 ; The previous value
45 ;OUTPUT : 0 - Cross reference was set/killed
46 ; -1 - Cross reference not set/killed
47 ; -2 - Bad input
48 ;
49 ;
50 ;CHECK INPUT & RECORD EXISTANCE
51 Q:($G(IFN)="") -2
52 S SET=+$G(SET)
53 Q:('$D(^VAT(394.62,IFN))) -2
54 Q:(('SET)&('$D(FNUM))&('$D(OLDX))) -2
55 ;DECLARE VARIABLES
56 N TRANS,SEG,ZERO
57 ;GET INFO FOR X-REF & QUIT IF ANY PART IS NULL
58 S ZERO=$G(^VAT(394.62,IFN,0))
59 Q:(ZERO="") -1
60 S SEG=$P(ZERO,"^",2)
61 I ('SET) S:(FNUM=.02) SEG=OLDX
62 Q:(SEG="") -1
63 S TRANS=$P($G(^VAT(394.62,IFN,"TRNS")),"^",1)
64 I ('SET) S:(FNUM=40) TRANS=OLDX
65 Q:(TRANS="") -1
66 ;SET X-REF
67 S:(SET) ^VAT(394.62,"A-SEGMENT",TRANS,SEG,IFN)=""
68 ;KILL X-REF
69 K:('SET) ^VAT(394.62,"A-SEGMENT",TRANS,SEG,IFN)
70 Q 0
71 ;
Note: See TracBrowser for help on using the repository browser.