Ignore:
Timestamp:
Sep 29, 2010, 3:48:57 AM (14 years ago)
Author:
Sam Habiel
Message:

Bumped version up to 1.41

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Scheduling/trunk/m/BSDX01.m

    r965 r968  
    11BSDX01  ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 9/29/10 10:20am
    2         ;;1.4;BSDX;;Sep 07, 2010
     2        ;;1.41;BSDX;;Sep 29, 2010
    33        ;
    44SUINFOD(BSDXY,BSDXDUZ)  ;EP Debugging entry point
     
    3838        ;based on entries in BSDX RESOURCE USER file (Say this again for myself: Groups ONLY!!)
    3939        ;If BSDXDUZ=0 then returns all department names for current DUZ
    40     ;if not linked, always returned.
     40           ;if not linked, always returned.
    4141        ;If user BSDXDUZ possesses the key BSDXZMGR or XUPROGMODE
    4242        ;then ALL resource group names are returned regardless of whether any active resources
     
    6161        . S BSDXRES=$P(^BSDXRSU(BSDXIEN,0),U)
    6262        . 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, quit
     63           . ; Q:'$$INDIV2(BSDXRES)  ; If not in the same division as user, quit
    6464        . S BSDXRNOD=^BSDXRES(BSDXRES,0)
    6565        . ;QUIT if the resource is inactive
     
    120120        . S BSDXRNOD=^BSDXRES(BSDXRES,0)
    121121        . N BSDXSC S BSDXSC=$P(BSDXRNOD,U,4)  ; Hospital Location
    122     . ;Q:$P(BSDXRNOD,U,2)=1  ;Inactive resources not filtered
     122           . ;Q:$P(BSDXRNOD,U,2)=1  ;Inactive resources not filtered
    123123        . ;S BSDXRDAT=$P(BSDXRNOD,U,1,4)
    124124        . ;I '$$INDIV(BSDXSC) QUIT  ; If not in division, quit
    125     . K BSDXRDAT
     125           . K BSDXRDAT
    126126        . F BSDX=1:1:4 S $P(BSDXRDAT,U,BSDX)=$P(BSDXRNOD,U,BSDX)
    127127        . S BSDXRDAT=BSDXRES_U_BSDXRDAT
     
    198198        . S BSDXRES=$P(^BSDXRSU(BSDXIEN,0),U)
    199199        . 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.
    201201        . S BSDXRNOD=$G(^BSDXRES(BSDXRES,0))
    202202        . Q:BSDXRNOD=""
     
    223223        . . S BSDXRESD=$P(^BSDXDEPT(BSDXIEN,1,BSDXRES,0),"^")
    224224        . . 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 division
     225           . . ;Q:'$$INDIV2(BSDXRESD)  ; Quit if resource is not in the same division
    226226        . . S BSDXRNOD=$G(^BSDXRES(BSDXRESD,0))
    227227        . . Q:BSDXRNOD=""
     
    257257        I '$D(^VA(200,BSDXDUZ,51,BSDXIEN,0)) Q 0
    258258        Q 1
    259 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
     259INDIV(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
     271INDIV2(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
     275UnitTestINDIV   
     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
     289UnitTestINDIV2 
     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.