Changeset 968 for Scheduling/trunk/m/BSDX01.m
- Timestamp:
- Sep 29, 2010, 3:48:57 AM (15 years ago)
- File:
-
- 1 edited
-
Scheduling/trunk/m/BSDX01.m (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Scheduling/trunk/m/BSDX01.m
r965 r968 1 1 BSDX01 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 9/29/10 10:20am 2 ;;1.4 ;BSDX;;Sep 07, 20102 ;;1.41;BSDX;;Sep 29, 2010 3 3 ; 4 4 SUINFOD(BSDXY,BSDXDUZ) ;EP Debugging entry point … … 38 38 ;based on entries in BSDX RESOURCE USER file (Say this again for myself: Groups ONLY!!) 39 39 ;If BSDXDUZ=0 then returns all department names for current DUZ 40 ;if not linked, always returned.40 ;if not linked, always returned. 41 41 ;If user BSDXDUZ possesses the key BSDXZMGR or XUPROGMODE 42 42 ;then ALL resource group names are returned regardless of whether any active resources … … 61 61 . S BSDXRES=$P(^BSDXRSU(BSDXIEN,0),U) 62 62 . 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) 63 . ; Q:'$$INDIV2(BSDXRES) ; If not in the same division as user, quit63 . ; Q:'$$INDIV2(BSDXRES) ; If not in the same division as user, quit 64 64 . S BSDXRNOD=^BSDXRES(BSDXRES,0) 65 65 . ;QUIT if the resource is inactive … … 120 120 . S BSDXRNOD=^BSDXRES(BSDXRES,0) 121 121 . N BSDXSC S BSDXSC=$P(BSDXRNOD,U,4) ; Hospital Location 122 . ;Q:$P(BSDXRNOD,U,2)=1 ;Inactive resources not filtered122 . ;Q:$P(BSDXRNOD,U,2)=1 ;Inactive resources not filtered 123 123 . ;S BSDXRDAT=$P(BSDXRNOD,U,1,4) 124 124 . ;I '$$INDIV(BSDXSC) QUIT ; If not in division, quit 125 . K BSDXRDAT125 . K BSDXRDAT 126 126 . F BSDX=1:1:4 S $P(BSDXRDAT,U,BSDX)=$P(BSDXRNOD,U,BSDX) 127 127 . S BSDXRDAT=BSDXRES_U_BSDXRDAT … … 198 198 . S BSDXRES=$P(^BSDXRSU(BSDXIEN,0),U) 199 199 . Q:'$D(^BSDXDEPT("AB",BSDXRES)) ; Quit if Resource isn't part of any Group 200 . ;Q:'$$INDIV2(BSDXRES) ; Quit if Resource isn't in same division as user.200 . ;Q:'$$INDIV2(BSDXRES) ; Quit if Resource isn't in same division as user. 201 201 . S BSDXRNOD=$G(^BSDXRES(BSDXRES,0)) 202 202 . Q:BSDXRNOD="" … … 223 223 . . S BSDXRESD=$P(^BSDXDEPT(BSDXIEN,1,BSDXRES,0),"^") 224 224 . . Q:'$D(^BSDXRES(BSDXRESD,0)) ; Quit if zero node of resouce file is invalid 225 . . ;Q:'$$INDIV2(BSDXRESD) ; Quit if resource is not in the same division225 . . ;Q:'$$INDIV2(BSDXRESD) ; Quit if resource is not in the same division 226 226 . . S BSDXRNOD=$G(^BSDXRES(BSDXRESD,0)) 227 227 . . Q:BSDXRNOD="" … … 257 257 I '$D(^VA(200,BSDXDUZ,51,BSDXIEN,0)) Q 0 258 258 Q 1 259 INDIV(BSDXSC) ; PEP - Is ^SC clinic in the same DUZ(2) as user?260 ; Input: BSDXSC - Hospital Location IEN261 ; Output: True or False262 I '+BSDXSC QUIT 1 ;If not tied to clinic, yes263 I '$D(^SC(BSDXSC,0)) QUIT 1 ; If Clinic does not exist, yes264 ; Jump to Division:Medical Center Division:Inst File Pointer for265 ; Institution IEN (and get its internal value)266 N DIV S DIV=$$GET1^DIQ(44,BSDXSC_",","3.5:.07","I")267 I DIV="" Q 1 ; If clinic has no division, consider it avial to user.268 I DIV=DUZ(2) Q 1 ; If same, then User is in same Div as Clinic269 E Q 0 ; Otherwise, no270 QUIT271 INDIV2(BSDXRES) ; PEP - Is Resource in the same DUZ(2) as user?272 ; Input BSDXRES - BSDX RESOURCE IEN273 ; Output: True of False274 Q $$INDIV($P($G(^BSDXRES(BSDXRES,0)),U,4)) ; Extract Hospital Location and send to $$INDIV275 UnitTestINDIV 276 W "Testing if they are the same",!277 S DUZ(2)=67278 I '$$INDIV(1) W "ERROR",!279 I '$$INDIV(2) W "ERROR",!280 W "Testing if Div not defined in 44, should be true",!281 I '$$INDIV(3) W "ERROR",!282 W "Testing empty string. Should be true",!283 I '$$INDIV("") W "ERROR",!284 W "Testing if they are different",!285 S DUZ(2)=899286 I $$INDIV(1) W "ERROR",!287 I $$INDIV(2) W "ERROR",!288 QUIT289 UnitTestINDIV2 290 W "Testing if they are the same",!291 S DUZ(2)=69292 I $$INDIV2(22)'=0 W "ERROR",!293 I $$INDIV2(25)'=1 W "ERROR",!294 I $$INDIV2(26)'=1 W "ERROR",!295 I $$INDIV2(27)'=1 W "ERROR",!296 QUIT259 INDIV(BSDXSC) ; PEP - Is ^SC clinic in the same DUZ(2) as user? 260 ; Input: BSDXSC - Hospital Location IEN 261 ; Output: True or False 262 I '+BSDXSC QUIT 1 ;If not tied to clinic, yes 263 I '$D(^SC(BSDXSC,0)) QUIT 1 ; If Clinic does not exist, yes 264 ; Jump to Division:Medical Center Division:Inst File Pointer for 265 ; Institution IEN (and get its internal value) 266 N DIV S DIV=$$GET1^DIQ(44,BSDXSC_",","3.5:.07","I") 267 I DIV="" Q 1 ; If clinic has no division, consider it avial to user. 268 I DIV=DUZ(2) Q 1 ; If same, then User is in same Div as Clinic 269 E Q 0 ; Otherwise, no 270 QUIT 271 INDIV2(BSDXRES) ; PEP - Is Resource in the same DUZ(2) as user? 272 ; Input BSDXRES - BSDX RESOURCE IEN 273 ; Output: True of False 274 Q $$INDIV($P($G(^BSDXRES(BSDXRES,0)),U,4)) ; Extract Hospital Location and send to $$INDIV 275 UnitTestINDIV 276 W "Testing if they are the same",! 277 S DUZ(2)=67 278 I '$$INDIV(1) W "ERROR",! 279 I '$$INDIV(2) W "ERROR",! 280 W "Testing if Div not defined in 44, should be true",! 281 I '$$INDIV(3) W "ERROR",! 282 W "Testing empty string. Should be true",! 283 I '$$INDIV("") W "ERROR",! 284 W "Testing if they are different",! 285 S DUZ(2)=899 286 I $$INDIV(1) W "ERROR",! 287 I $$INDIV(2) W "ERROR",! 288 QUIT 289 UnitTestINDIV2 290 W "Testing if they are the same",! 291 S DUZ(2)=69 292 I $$INDIV2(22)'=0 W "ERROR",! 293 I $$INDIV2(25)'=1 W "ERROR",! 294 I $$INDIV2(26)'=1 W "ERROR",! 295 I $$INDIV2(27)'=1 W "ERROR",! 296 QUIT
Note:
See TracChangeset
for help on using the changeset viewer.
