Changeset 963
- Timestamp:
- Sep 28, 2010, 9:37:08 AM (14 years ago)
- Location:
- Scheduling/trunk/m
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/m/BSDX01.m
r962 r963 1 BSDX01 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 9/ 16/10 9:54am1 BSDX01 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 9/28/10 4:47pm 2 2 ;;1.4;BSDX;;Sep 07, 2010 3 ; Change Log: 4 ; V 1.4.1 (Sep 28 2010): Separate user divisions based on $$INDIV. 5 ; Affects: 6 ; - RESUSR 7 ; - DEPUSR 8 ; - DEPRES 3 9 ; 4 10 ; … … 39 45 ;Called by BSDX RESOURCE GROUPS BY USER 40 46 ;Returns ADO Recordset with all ACTIVE resource group names to which user has access 41 ;based on entries in BSDX RESOURCE USER file 47 ;based on entries in BSDX RESOURCE USER file (Say this again for myself: Groups ONLY!!) 42 48 ;If BSDXDUZ=0 then returns all department names for current DUZ 49 ;What is returned depends if it is in the same divsion as the hosptial location if it is linked 50 ;if not linked, always returned. 43 51 ;If user BSDXDUZ possesses the key BSDXZMGR or XUPROGMODE 44 52 ;then ALL resource group names are returned regardless of whether any active resources … … 62 70 I 'BSDXMGR,$D(^BSDXRSU("AC",BSDXDUZ)) S BSDXIEN=0 F S BSDXIEN=$O(^BSDXRSU("AC",BSDXDUZ,BSDXIEN)) Q:'+BSDXIEN D 63 71 . S BSDXRES=$P(^BSDXRSU(BSDXIEN,0),U) 64 . Q:'$D(^BSDXDEPT("AB",BSDXRES)) 72 . Q:'$D(^BSDXDEPT("AB",BSDXRES)) ; If not part of a group, quit ("AB" is the whole file index for the resource multiple in Group file) 73 . Q:'$$INDIV2(BSDXRES) ; If not in the same division as user, quit 65 74 . S BSDXRNOD=^BSDXRES(BSDXRES,0) 66 75 . ;QUIT if the resource is inactive … … 178 187 ;Returns ADO Recordset with all ACTIVE GROUP/RESOURCE combinations 179 188 ;to which user has access based on entries in BSDX RESOURCE USER file 189 ;by Division (set in DUZ(2)) 180 190 ;If BSDXDUZ=0 then returns all ACTIVE GROUP/RESOURCE combinations for current DUZ 181 191 ;If user BSDXDUZ possesses the key BSDXZMGR or XUPROGMODE … … 198 208 I 'BSDXMGR,$D(^BSDXRSU("AC",BSDXDUZ)) S BSDXIEN=0 F S BSDXIEN=$O(^BSDXRSU("AC",BSDXDUZ,BSDXIEN)) Q:'+BSDXIEN D 199 209 . S BSDXRES=$P(^BSDXRSU(BSDXIEN,0),U) 200 . Q:'$D(^BSDXDEPT("AB",BSDXRES)) 210 . Q:'$D(^BSDXDEPT("AB",BSDXRES)) ; Quit if Resource isn't part of any Group 211 . Q:'$$INDIV2(BSDXRES) ; Quit if Resource isn't in same division as user. 201 212 . S BSDXRNOD=$G(^BSDXRES(BSDXRES,0)) 202 213 . Q:BSDXRNOD="" … … 220 231 . S BSDXRES=0 F S BSDXRES=$O(^BSDXDEPT(BSDXIEN,1,BSDXRES)) Q:'+BSDXRES D 221 232 . . N BSDXRESD 222 . . Q:'$D(^BSDXDEPT(BSDXIEN,1,BSDXRES,0)) 233 . . Q:'$D(^BSDXDEPT(BSDXIEN,1,BSDXRES,0)) ; Quit if zero node is invalid in multiple 223 234 . . S BSDXRESD=$P(^BSDXDEPT(BSDXIEN,1,BSDXRES,0),"^") 224 . . Q:'$D(^BSDXRES(BSDXRESD,0)) 235 . . Q:'$D(^BSDXRES(BSDXRESD,0)) ; Quit if zero node of resouce file is invalid 236 . . Q:'$$INDIV2(BSDXRESD) ; Quit if resource is not in the same division 225 237 . . S BSDXRNOD=$G(^BSDXRES(BSDXRESD,0)) 226 238 . . Q:BSDXRNOD="" … … 257 269 Q 1 258 270 INDIV(BSDXSC) ; PEP - Is ^SC clinic in the same DUZ(2) as user? 271 ; Input: BSDXSC - Hospital Location IEN 272 ; Output: True or False 259 273 I '+BSDXSC QUIT 1 ;If not tied to clinic, yes 260 274 I '$D(^SC(BSDXSC,0)) QUIT 1 ; If Clinic does not exist, yes … … 266 280 E Q 0 ; Otherwise, no 267 281 QUIT 282 INDIV2(BSDXRES) ; PEP - Is Resource in the same DUZ(2) as user? 283 ; Input BSDXRES - BSDX RESOURCE IEN 284 ; Output: True of False 285 Q $$INDIV($P($G(^BSDXRES(BSDXRES,0)),U,4)) ; Extract Hospital Location and send to $$INDIV 268 286 UnitTestINDIV 269 287 W "Testing if they are the same",! … … 280 298 I $$INDIV(2) W "ERROR",! 281 299 QUIT 300 UnitTestINDIV2 301 W "Testing if they are the same",! 302 S DUZ(2)=69 303 I $$INDIV2(22)'=0 W "ERROR",! 304 I $$INDIV2(25)'=1 W "ERROR",! 305 I $$INDIV2(26)'=1 W "ERROR",! 306 I $$INDIV2(27)'=1 W "ERROR",! 307 QUIT -
Scheduling/trunk/m/BSDX32.m
r951 r963 20 20 HOSPLOC(BSDXY) ;EP 21 21 ;Called by BSDX HOSPITAL LOCATION 22 ;Returns all hospital locations that are active AND in the same division as the user 22 23 ; 23 24 N BSDXI,BSDXIEN,BSDXNOD,BSDXNAM,BSDXINA,BSDXREA,BSDXSCOD … … 33 34 . Q:'+BSDXIEN>0 34 35 . Q:'$D(^SC(+BSDXIEN,0)) 36 . Q:'$$INDIV^BSDX01(+BSDXIEN) ; if not in the same division, quit 35 37 . S BSDXINA=$$GET1^DIQ(44,BSDXIEN_",",2505) ;INACTIVATE 36 38 . S BSDXREA=$$GET1^DIQ(44,BSDXIEN_",",2506) ;REACTIVATE
Note:
See TracChangeset
for help on using the changeset viewer.