Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SDWU

SDWU.m

Go to the documentation of this file.
  1. SDWU ; SLC/KCM - General Utilites for Windows Calls; 2/28/01
  1. ;;5.3;Scheduling;**262**;Aug 13, 1993
  1. ;
  1. Q
  1. ACTLOC(LOC) ; Function: returns TRUE if active hospital location
  1. N D0,X I +$G(^SC(LOC,"OOS")) Q 0 ; screen out OOS entry
  1. S D0=+$G(^SC(LOC,42)) I D0 D WIN^DGPMDDCF Q 'X ; chk out of svc wards
  1. S X=$G(^SC(LOC,"I")) I +X=0 Q 1 ; no inactivate date
  1. I DT>$P(X,U)&($P(X,U,2)=""!(DT<$P(X,U,2))) Q 0 ; chk reactivate date
  1. Q 1 ; must still be active
  1. ;
  1. CLINLOC(Y,FROM,DIR) ; Return a set of clinics from HOSPITAL LOCATION
  1. ; .Y=returned list, FROM=text to $O from, DIR=$O direction,
  1. N I,IEN,CNT S I=0,CNT=44
  1. F Q:I'<CNT S FROM=$O(^SC("B",FROM),DIR) Q:FROM="" D
  1. . S IEN="" F S IEN=$O(^SC("B",FROM,IEN),DIR) Q:'IEN D
  1. . . I ($P($G(^SC(IEN,0)),U,3)'="C")!('$$ACTLOC(IEN)) Q
  1. . . S I=I+1,Y(I)=IEN_"^"_FROM
  1. Q
  1. INPLOC(Y,FROM,DIR) ;Return a set of wards from HOSPITAL LOCATION
  1. ; .Y=returned list, FROM=text to $O from, DIR=$O direction,
  1. N I,IEN,CNT S I=0,CNT=44
  1. F Q:I'<CNT S FROM=$O(^SC("B",FROM),DIR) Q:FROM="" D
  1. . S IEN="" F S IEN=$O(^SC("B",FROM,IEN),DIR) Q:'IEN D
  1. . . I ($P($G(^SC(IEN,0)),U,3)'="W")!('$$ACTLOC(IEN)) Q
  1. . . S I=I+1,Y(I)=IEN_"^"_FROM
  1. Q
  1. HOSPLOC(Y,FROM,DIR) ; Return a set of locations from HOSPITAL LOCATION
  1. ; .Y=returned list, FROM=text to $O from, DIR=$O direction,
  1. N I,IEN,CNT S I=0,CNT=44
  1. F Q:I'<CNT S FROM=$O(^SC("B",FROM),DIR) Q:FROM="" D
  1. . S IEN="" F S IEN=$O(^SC("B",FROM,IEN),DIR) Q:'IEN D
  1. . . I '$$ACTLOC(IEN) Q
  1. . . S I=I+1,Y(I)=IEN_"^"_FROM
  1. Q