DGPMDDCF ;ALB/MIR - COMPUTED FIELDS IN FILES 42,405.4 ; 29 MAY 90 @1400 ;;5.3;Registration;;Aug 13, 1993 ;called from computed fields in ward location and room-bed files WIN ;is this ward location currently inactive? (1=inactive, 0=active) ;input: D0 = IFN of WARD LOCATION file ; DGPMOS = date for which you would like to know. leave ; undefined if desired date is today. ;output: X = 1 if inactive (out-of-service), 0 otherwise ; (-1 if D0 not defined or date not valid) ; ; (called from record tracking package) N DGX,DGY S X=-1 Q:'$D(D0) S DGY=$S($D(DGPMOS):DGPMOS,1:DT) S DGY=$P(DGY,".") I DGY'?7N G WINQ S DGX=+$O(^DIC(42,D0,"OOS","AINV",9999998.9-DGY)),DGX=$S($D(^DIC(42,D0,"OOS",+$O(^(+DGX,0)),0)):^(0),1:"") I '$P(DGX,U,6) S X=0 G WINQ I $P(DGX,U,6),'$P(DGX,U,4) S X=1 G WINQ I $P(DGX,U,6),$P(DGX,U,4)