Changeset 962


Ignore:
Timestamp:
Sep 28, 2010, 6:53:22 AM (14 years ago)
Author:
Sam Habiel
Message:

First draft of division separation for Scheduling GUI

File:
1 edited

Legend:

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

    r951 r962  
    1 BSDX01  ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 9/15/10 9:09pm
     1BSDX01  ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 9/16/10 9:54am
    22        ;;1.4;BSDX;;Sep 07, 2010
    33        ;
     
    121121        . S BSDXRNOD=^BSDXRES(BSDXRES,0)
    122122        . N BSDXSC S BSDXSC=$P(BSDXRNOD,U,4)  ; Hospital Location
    123     . ; super line... if tied to hospital location,
    124     . ; Hosp location exists, AND 4th piece isn't the same as
    125     . ; DUZ(2), quit. Filters based on Divisions.
    126     . ; . I +BSDXSC,$D(^SC(BSDXSC,0)),$P(^SC(BSDXSC,0),U,4)'=DUZ(2) QUIT
    127123    . ;Q:$P(BSDXRNOD,U,2)=1  ;Inactive resources not filtered
    128124        . ;S BSDXRDAT=$P(BSDXRNOD,U,1,4)
    129         . K BSDXRDAT
     125        . I '$$INDIV(BSDXSC) QUIT  ; If not in division, quit
     126    . K BSDXRDAT
    130127        . F BSDX=1:1:4 S $P(BSDXRDAT,U,BSDX)=$P(BSDXRNOD,U,BSDX)
    131128        . S BSDXRDAT=BSDXRES_U_BSDXRDAT
     
    259256        I '$D(^VA(200,BSDXDUZ,51,BSDXIEN,0)) Q 0
    260257        Q 1
     258INDIV(BSDXSC) ; PEP - Is ^SC clinic in the same DUZ(2) as user?
     259    I '+BSDXSC QUIT 1  ;If not tied to clinic, yes
     260    I '$D(^SC(BSDXSC,0)) QUIT 1 ; If Clinic does not exist, yes
     261    ; Jump to Division:Medical Center Division:Inst File Pointer for
     262    ; Institution IEN (and get its internal value)
     263    N DIV S DIV=$$GET1^DIQ(44,BSDXSC_",","3.5:.07","I")
     264    I DIV="" Q 1 ; If clinic has no division, consider it avial to user.
     265    I DIV=DUZ(2) Q 1 ; If same, then User is in same Div as Clinic
     266    E  Q 0 ; Otherwise, no
     267    QUIT
     268UnitTestINDIV
     269    W "Testing if they are the same",!
     270    S DUZ(2)=67
     271    I '$$INDIV(1) W "ERROR",!
     272    I '$$INDIV(2) W "ERROR",!
     273    W "Testing if Div not defined in 44, should be true",!
     274    I '$$INDIV(3) W "ERROR",!
     275    W "Testing empty string. Should be true",!
     276    I '$$INDIV("") W "ERROR",!
     277    W "Testing if they are different",!
     278    S DUZ(2)=899
     279    I $$INDIV(1) W "ERROR",!
     280    I $$INDIV(2) W "ERROR",!
     281    QUIT
Note: See TracChangeset for help on using the changeset viewer.