source: WorldVistAEHR/trunk/r/PATIENT_DATA_EXCHANGE-VAQ/VAQXRF3.m@ 1639

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

initial load of WorldVistAEHR

File size: 2.7 KB
Line 
1VAQXRF3 ;ALB/JRP - X-REF CODES FOR PDX;17-FEB-92
2 ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
3AF(IFN,SET,FNUM,OLDX) ;AF* X-REF FOR DATA FILE (#394.62)
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 ;NOTE: This x-ref is only SET if data was stored in display
16 ; ready format. KILLing of x-ref is always allowed.
17 ;
18 ;CHECK INPUT & RECORD EXISTANCE
19 Q:($G(IFN)="") -2
20 S SET=+$G(SET)
21 Q:('$D(^VAT(394.62,IFN))) -2
22 Q:(('SET)&('$D(FNUM))&('$D(OLDX))) -2
23 ;DECLARE VARIABLES
24 N ZERO,TRANS,SEGMENT,DISPLAY
25 ;GET INFO FOR X-REF & QUIT IF ANY PART IS NULL
26 S ZERO=$G(^VAT(394.62,IFN,0))
27 Q:(ZERO="") -1
28 S DISPLAY=$P(ZERO,"^",5)
29 Q:(('DISPLAY)&SET) -1
30 S SEGMENT=$P(ZERO,"^",2)
31 I ('SET) S:(FNUM=.02) SEGMENT=OLDX
32 Q:(SEGMENT="") -1
33 S TRANS=$P($G(^VAT(394.62,IFN,"TRNS")),"^",1)
34 I ('SET) S:(FNUM=40) TRANS=OLDX
35 Q:(TRANS="") -1
36 ;SET X-REF
37 S:(SET) ^VAT(394.62,"A-DISPLAY",TRANS,SEGMENT,IFN)=""
38 ;KILL X-REF
39 K:('SET) ^VAT(394.62,"A-DISPLAY",TRANS,SEGMENT,IFN)
40 Q 0
41 ;
42AG(IFN) ;AG X-REF FOR DATA FILE (#394.62)
43 ;INPUT : IFN - Internal file number of record
44 ;
45 ;OUTPUT : If now display ready, result of killing AF x-ref
46 ; If now info only, result of setting AF x-ref
47 ;
48 ;NOTE: This x-ref is used to clean-up the node set by the AF*
49 ; x-refs. It will only be executed when field .05 is changed
50 ; (only used in KILL logic).
51 ;
52 ;CHECK INPUT & RECORD EXISTANCE
53 Q:($G(IFN)="") -2
54 Q:('$D(^VAT(394.62,IFN))) -2
55 ;DECLARE VARIABLES
56 N TEMP,DISPLAY,RESULT
57 S DISPLAY=$P($G(^VAT(394.62,IFN,0)),"^",5)
58 Q:(DISPLAY="") -1
59 ;NEW FORMAT IS DISPLAY READY
60 I (DISPLAY) D
61 .;SET AF* X-REF
62 .S RESULT=$$AF^VAQXRF3(IFN,1)
63 ;NEW FORMAT IS NOT DISPLAY READY
64 I ('DISPLAY) D
65 .;KILL AF* X-REF
66 .S RESULT=$$AF^VAQXRF3(IFN,0,"","")
67 Q RESULT
68ONEPAR(FACPTR) ;SCREEN TO ONLY ALLOW ONE ENTRY IN PARAMTER FILE
69 ;INPUT : FACPTR - Pointer to INSTITUTION File (what user has entered)
70 ;OUTPUT : 1 - Institution entered may be used
71 ; (there is no entry or it is the existing entry)
72 ; 0 - Institution entered may not be used
73 ; (it is not the existing entry)
74 ;NOTES : Used in screening of field .01
75 ;
76 ;CHECK INPUT
77 Q:('FACPTR) 0
78 ;DECLARE VARIABLES
79 N IFN,CURPTR
80 ;CURRENTLY NO ENTRY
81 S IFN=$O(^VAT(394.81,0))
82 Q:('IFN) 1
83 ;CURRENT ENTRY IS ENTERED INSTITUTION
84 S CURPTR=+$G(^VAT(394.81,IFN,0))
85 Q:(FACPTR=CURPTR) 1
86 ;DON'T ALLOW SELECTION
87 Q 0
Note: See TracBrowser for help on using the repository browser.