source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SDWU.m@ 1742

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

initial load of FOIAVistA 6/30/08 version

File size: 1.5 KB
Line 
1SDWU ; SLC/KCM - General Utilites for Windows Calls; 2/28/01
2 ;;5.3;Scheduling;**262**;Aug 13, 1993
3 ;
4 Q
5ACTLOC(LOC) ; Function: returns TRUE if active hospital location
6 N D0,X I +$G(^SC(LOC,"OOS")) Q 0 ; screen out OOS entry
7 S D0=+$G(^SC(LOC,42)) I D0 D WIN^DGPMDDCF Q 'X ; chk out of svc wards
8 S X=$G(^SC(LOC,"I")) I +X=0 Q 1 ; no inactivate date
9 I DT>$P(X,U)&($P(X,U,2)=""!(DT<$P(X,U,2))) Q 0 ; chk reactivate date
10 Q 1 ; must still be active
11 ;
12CLINLOC(Y,FROM,DIR) ; Return a set of clinics from HOSPITAL LOCATION
13 ; .Y=returned list, FROM=text to $O from, DIR=$O direction,
14 N I,IEN,CNT S I=0,CNT=44
15 F Q:I'<CNT S FROM=$O(^SC("B",FROM),DIR) Q:FROM="" D
16 . S IEN="" F S IEN=$O(^SC("B",FROM,IEN),DIR) Q:'IEN D
17 . . I ($P($G(^SC(IEN,0)),U,3)'="C")!('$$ACTLOC(IEN)) Q
18 . . S I=I+1,Y(I)=IEN_"^"_FROM
19 Q
20INPLOC(Y,FROM,DIR) ;Return a set of wards from HOSPITAL LOCATION
21 ; .Y=returned list, FROM=text to $O from, DIR=$O direction,
22 N I,IEN,CNT S I=0,CNT=44
23 F Q:I'<CNT S FROM=$O(^SC("B",FROM),DIR) Q:FROM="" D
24 . S IEN="" F S IEN=$O(^SC("B",FROM,IEN),DIR) Q:'IEN D
25 . . I ($P($G(^SC(IEN,0)),U,3)'="W")!('$$ACTLOC(IEN)) Q
26 . . S I=I+1,Y(I)=IEN_"^"_FROM
27 Q
28HOSPLOC(Y,FROM,DIR) ; Return a set of locations from HOSPITAL LOCATION
29 ; .Y=returned list, FROM=text to $O from, DIR=$O direction,
30 N I,IEN,CNT S I=0,CNT=44
31 F Q:I'<CNT S FROM=$O(^SC("B",FROM),DIR) Q:FROM="" D
32 . S IEN="" F S IEN=$O(^SC("B",FROM,IEN),DIR) Q:'IEN D
33 . . I '$$ACTLOC(IEN) Q
34 . . S I=I+1,Y(I)=IEN_"^"_FROM
35 Q
36
Note: See TracBrowser for help on using the repository browser.