PRS8OT ;HISC/MRL-DECOMPOSITION, SCHEDULED OT ;3/26/93 12:34
;;4.0;PAID;;Sep 21, 1995
;
;This routine is used to determine whether OT/CT was scheduled
;in advance of the workweek for the date being processed. OT/CT
;is considered scheduled in advance of the workweek if:
;
; o There is a 1098 request on file in file 458.2 for the
; date being processed, and:
; o The request was made before the workweek on which the OT/
; CT is worked, e.g., the ENTRY DATE/TIME was before the
; SUNDAY preceeding the date worked, AND:
; o The request WAS NOT cancelled or disapproved. Requests
; which were scheduled but pending approval are, for this
; purpose, considered to be approved unless cancelled or
; disapproved.
; o In addition, once the above three criteria are met, the
; T&L on which the OT/CT was worked must be one where
; premium pay is usually paid.
;
;Called by Routines: PRS8PP
;
S OK=0,X=$P(PPD,"^",DAY) D ^%DT ;get today's date as Y
S (X,NDD)=Y D H^%DTC ;get day number
S X1=NDD,X2="-"_(%Y+1) D C^%DTC S NDD(1)=X ;get previous Saturday
F ND=0:0 S ND=$O(^PRST(458.2,"AD",DFN,NDD,ND)) Q:ND'>0!(OK) D
.S X=^PRST(458.2,ND,0) ;zeroth node of the ot request file
.I "DX"[$P(X,"^",8) Q ;disapproved or cancelled
.S X1=$P(X,"^",12) Q:'X1 ;no ENTRY DATE
.I X1'>NDD(1) S OK=1,X=$P(X,"^",9)
S ND=OK G END:'ND
I $L(X)=3 D ;check T&L for premium ok
.S X=$O(^PRST(455.5,"B",X,0)) Q:'X
.S X=$P($G(^PRST(455.5,+X,0)),"^",7)
.S ND=+X ;reset ok to premium status
;
END ; --- done with this process
K NDD,OK,X,X1,X2 Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPRS8OT 1653 printed Dec 13, 2024@02:22:56 Page 2
PRS8OT ;HISC/MRL-DECOMPOSITION, SCHEDULED OT ;3/26/93 12:34
+1 ;;4.0;PAID;;Sep 21, 1995
+2 ;
+3 ;This routine is used to determine whether OT/CT was scheduled
+4 ;in advance of the workweek for the date being processed. OT/CT
+5 ;is considered scheduled in advance of the workweek if:
+6 ;
+7 ; o There is a 1098 request on file in file 458.2 for the
+8 ; date being processed, and:
+9 ; o The request was made before the workweek on which the OT/
+10 ; CT is worked, e.g., the ENTRY DATE/TIME was before the
+11 ; SUNDAY preceeding the date worked, AND:
+12 ; o The request WAS NOT cancelled or disapproved. Requests
+13 ; which were scheduled but pending approval are, for this
+14 ; purpose, considered to be approved unless cancelled or
+15 ; disapproved.
+16 ; o In addition, once the above three criteria are met, the
+17 ; T&L on which the OT/CT was worked must be one where
+18 ; premium pay is usually paid.
+19 ;
+20 ;Called by Routines: PRS8PP
+21 ;
+22 ;get today's date as Y
SET OK=0
SET X=$PIECE(PPD,"^",DAY)
DO ^%DT
+23 ;get day number
SET (X,NDD)=Y
DO H^%DTC
+24 ;get previous Saturday
SET X1=NDD
SET X2="-"_(%Y+1)
DO C^%DTC
SET NDD(1)=X
+25 FOR ND=0:0
SET ND=$ORDER(^PRST(458.2,"AD",DFN,NDD,ND))
if ND'>0!(OK)
QUIT
Begin DoDot:1
+26 ;zeroth node of the ot request file
SET X=^PRST(458.2,ND,0)
+27 ;disapproved or cancelled
IF "DX"[$PIECE(X,"^",8)
QUIT
+28 ;no ENTRY DATE
SET X1=$PIECE(X,"^",12)
if 'X1
QUIT
+29 IF X1'>NDD(1)
SET OK=1
SET X=$PIECE(X,"^",9)
End DoDot:1
+30 SET ND=OK
if 'ND
GOTO END
+31 ;check T&L for premium ok
IF $LENGTH(X)=3
Begin DoDot:1
+32 SET X=$ORDER(^PRST(455.5,"B",X,0))
if 'X
QUIT
+33 SET X=$PIECE($GET(^PRST(455.5,+X,0)),"^",7)
+34 ;reset ok to premium status
SET ND=+X
End DoDot:1
+35 ;
END ; --- done with this process
+1 KILL NDD,OK,X,X1,X2
QUIT