source: WorldVistAEHR/trunk/r/HEALTH_DATA_AND_INFORMATICS-HDI/HDISVF02.m@ 1261

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

initial load of WorldVistAEHR

File size: 5.9 KB
Line 
1HDISVF02 ;BPFO/JRP - FILE UTILITIES/API;12/20/2004
2 ;;1.0;HEALTH DATA & INFORMATICS;;Feb 22, 2005
3 ;
4 ;---------- Begin HDIS PARAMETER file (#7118.29) APIs ----------
5 ;
6GETTYPE(SYSPTR) ;Get value of SYSTEM TYPE field (#.02)
7 ; Input : SYSPTR - Pointer to HDIS System file
8 ; (default to current system)
9 ;Output : Internal Value ^ External Value
10 ; Notes : If no value found, values for client system type returned
11 N FAC,ARR,NTRNL,XTRNL
12 S FAC=$$GETPTR^HDISVF10($G(SYSPTR))
13 I 'FAC Q "1^CLIENT"
14 S XTRNL=$$GET(7118.29,.02,(FAC_","),"B",.ARR)
15 I XTRNL="" Q "1^CLIENT"
16 Q ARR("I")_"^"_XTRNL
17 ;
18SETTYPE(VALUE,SYSPTR) ;Set value of SYSTEM TYPE field (#.02)
19 ; Input : VALUE - New value (internal or external)
20 ; : SYSPTR - Pointer to HDIS System file
21 ; (default to current system)
22 ;Output : None
23 N FAC,X,HDIVAL,HDIERR
24 S FAC=$$GETPTR^HDISVF10($G(SYSPTR))
25 I 'FAC Q
26 ;Convert VALUE to internal - allows changing of uneditable field
27 D CHK^DIE(7118.29,.02,"",$G(VALUE),.HDIVAL,"HDIERR")
28 I HDIVAL="^" Q
29 S X=$$SET(7118.29,.02,(FAC_","),HDIVAL,0)
30 Q
31 ;
32GETVFAIL(SYSPTR) ;Get value of DISABLE VUID ACTIVITY field (#11)
33 ; Input : SYSPTR - Pointer to HDIS System file
34 ; (default to current system)
35 ;Output : Internal Value ^ External Value
36 ; Notes : If no value found, values for OFF are returned
37 N FAC,ARR,NTRNL,XTRNL
38 S FAC=$$GETPTR^HDISVF10($G(SYSPTR))
39 I 'FAC Q "0^OFF"
40 S XTRNL=$$GET(7118.29,11,(FAC_","),"B",.ARR)
41 I XTRNL="" Q "0^OFF"
42 Q ARR("I")_"^"_XTRNL
43 ;
44SETVFAIL(VALUE,SYSPTR) ;Set value of DISABLE VUID ACTIVITY field (#11)
45 ; Input : VALUE - New value (internal or external)
46 ; : SYSPTR - Pointer to HDIS System file
47 ; (default to current system)
48 ;Output : None
49 N FAC,X
50 S FAC=$$GETPTR^HDISVF10($G(SYSPTR))
51 I 'FAC Q
52 S X=$$SET(7118.29,11,(FAC_","),$G(VALUE),1)
53 Q
54 ;
55GETVLOC(SYSPTR) ;Get value of VUID SERVER LOCATION field (#12)
56 ; Input : SYSPTR - Pointer to HDIS System file
57 ; (default to current system)
58 ;Output : Value of field
59 ; Notes : If no value found, domain for FORUM returned
60 N FAC,XTRNL
61 S FAC=$$GETPTR^HDISVF10($G(SYSPTR))
62 I 'FAC Q "FORUM.VA.GOV"
63 S XTRNL=$$GET(7118.29,12,(FAC_","),"E")
64 I XTRNL="" Q "FORUM.VA.GOV"
65 Q XTRNL
66 ;
67SETVLOC(VALUE,SYSPTR) ;Set value of VUID SERVER LOCATION field (#12)
68 ; Input : VALUE - New value (internal or external)
69 ; : SYSPTR - Pointer to HDIS System file
70 ; (default to current system)
71 ;Output : None
72 N FAC,X
73 S FAC=$$GETPTR^HDISVF10($G(SYSPTR))
74 I 'FAC Q
75 S X=$$SET(7118.29,12,(FAC_","),$G(VALUE),1)
76 Q
77 ;
78GETVCON(SYSPTR) ;Get value of VUID SERVER CONNECTION TYPE field (#13)
79 ; Input : SYSPTR - Pointer to HDIS System file
80 ; (default to current system)
81 ;Output : Internal Value ^ External Value
82 ; Notes : If no value found, values for MailMan connection returned
83 N FAC,ARR,NTRNL,XTRNL
84 S FAC=$$GETPTR^HDISVF10($G(SYSPTR))
85 I 'FAC Q "1^MAILMAN"
86 S XTRNL=$$GET(7118.29,13,(FAC_","),"B",.ARR)
87 I XTRNL="" Q "1^MAILMAN"
88 Q ARR("I")_"^"_XTRNL
89 ;
90SETVCON(VALUE,SYSPTR) ;Set value of VUID SERVER CONNECTION TYPE field (#13)
91 ; Input : VALUE - New value (internal or external)
92 ; : SYSPTR - Pointer to HDIS System file
93 ; (default to current system)
94 ;Output : None
95 N FAC,X
96 S FAC=$$GETPTR^HDISVF10($G(SYSPTR))
97 I 'FAC Q
98 S X=$$SET(7118.29,13,(FAC_","),$G(VALUE),1)
99 Q
100 ;
101GETVSRV(SYSPTR) ;Get value of VUID SERVER OPTION field (#21)
102 ; Input : SYSPTR - Pointer to HDIS System file
103 ; (default to current system)
104 ;Output : Value of field
105 ; Notes : If no value found, HDIS-FACILITY-DATA-SERVER returned
106 N FAC,XTRNL
107 S FAC=$$GETPTR^HDISVF10($G(SYSPTR))
108 I 'FAC Q "HDIS-FACILITY-DATA-SERVER"
109 S XTRNL=$$GET(7118.29,21,(FAC_","),"E")
110 I XTRNL="" Q "HDIS-FACILITY-DATA-SERVER"
111 Q XTRNL
112 ;
113SETVSRV(VALUE,SYSPTR) ;Set value of VUID SERVER OPTION field (#21)
114 ; Input : VALUE - New value (internal or external)
115 ; : SYSPTR - Pointer to HDIS System file
116 ; (default to current system)
117 ;Output : None
118 N FAC,X
119 S FAC=$$GETPTR^HDISVF10($G(SYSPTR))
120 I 'FAC Q
121 S X=$$SET(7118.29,21,(FAC_","),$G(VALUE),1)
122 Q
123 ;
124 ;---------- End HDIS PARAMETER file APIs ----------
125 ;
126SET(FILE,FIELD,IENS,VALUE,XTRNL) ;Store value into a field
127 ; Input : FILE - File number
128 ; FIELD - Field number
129 ; IENS - IENS of entry
130 ; VALUE - Value to store
131 ; XTRNL - Flag indicating if VALUE is in external format
132 ; 1 = Yes (external) 0 = No (internal) (default)
133 ;Output : Flag indicating if storing of value was done
134 ; 1 = OK 0 = Error
135 ; Notes : Assumes input values are valid and exist
136 ; : Does not support word processing fields
137 N HDISFDA,HDISMSG,FLAGS
138 S HDISFDA(FILE,IENS,FIELD)=VALUE
139 S FLAGS=$S(XTRNL:"E",1:"")
140 D FILE^DIE(FLAGS,"HDISFDA","HDISMSG")
141 Q $D(HDISMSG)
142 ;
143GET(FILE,FIELD,IENS,HOW,OUTPUT) ;Get value for a field
144 ; Input : FILE - File number
145 ; FIELD - Field number
146 ; IENS - IENS of entry
147 ; HOW - Flag indicating how value should be returned
148 ; I - Return internal value
149 ; E - Return external value
150 ; B - Return internal and external value
151 ; OUTPUT - Output array (pass by reference - dot notation)
152 ; Only set if HOW = B (both)
153 ; OUTPUT("I") = Internal value
154 ; OUTPUT("E") = External value
155 ;Output : If HOW = I, internal value
156 ; If HOW = E, external value
157 ; If HOW = B, external value
158 ; Notes : Assumes input values are valid and exist
159 ; : Does not support word processing fields
160 ; : Null ("") returned on error
161 N FLAGS,HDISTRG,HDISMSG
162 S FLAGS=$S(HOW="I":"I",HOW="E":"E",1:"IE")
163 D GETS^DIQ(FILE,IENS,FIELD,FLAGS,"HDISTRG","HDISMSG")
164 I $D(HDISMSG) K OUTPUT Q ""
165 I HOW'="B" Q $G(HDISTRG(FILE,IENS,FIELD,HOW))
166 S OUTPUT("I")=$G(HDISTRG(FILE,IENS,FIELD,"I"))
167 S OUTPUT("E")=$G(HDISTRG(FILE,IENS,FIELD,"E"))
168 Q OUTPUT("E")
Note: See TracBrowser for help on using the repository browser.