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

PRSATP7.m

Go to the documentation of this file.
  1. PRSATP7 ;HISC/MGD-Timekeeper Post Absence ;04/18/06
  1. ;;4.0;PAID;**102,108**;Sep 21, 1995
  1. ;
  1. DAH(PPIP,DFN,WDAY,DAH,QUIT) ;
  1. ; Find Day After Holiday - Called from PRSASR
  1. ; Input:
  1. ; PPIP - IEN of pay period to check
  1. ; DFN - IEN of employee to check
  1. ; WDAY - Day to start looping from
  1. ; DAH - Null
  1. ; QUIT - Null
  1. ;
  1. ; Output:
  1. ; DAH - PPIP^WDAY^Type of non-pay
  1. ; QUIT - Will be set to 1 if the holiday encapsulation
  1. ; rules are broken
  1. ;
  1. N DADRFM,EDATA,EEND,EIN,EINDX,ETOT,NODE0,NODE1,NODE2,NODE4
  1. N TINDX,TOUR1,TOUR2,REGHRS1,REGHRS2
  1. N NT,NE,NO,NC ; New ordered arrays
  1. S NODE0=$G(^PRST(458,PPIP,"E",DFN,"D",WDAY,0))
  1. I NODE0="" S QUIT=1 Q ; Corrupted data
  1. S NODE2=$G(^PRST(458,PPIP,"E",DFN,"D",WDAY,2))
  1. ;
  1. ; Skip Days off
  1. Q:$P(NODE0,U,2)=1
  1. ;
  1. ; Check for tours with no regular hours
  1. S TOUR1=+$P(NODE0,U,2),TOUR2=+$P(NODE0,U,13)
  1. S REGHRS1=$P($G(^PRST(457.1,TOUR1,0)),U,6)
  1. S REGHRS2=$S(TOUR2:$P($G(^PRST(457.1,TOUR2,0)),U,6),1:"")
  1. Q:$P(NODE0,U,2)'=2&($P(NODE0,U,2)'=3)&(REGHRS1+REGHRS2=0)
  1. ;
  1. ; If scheduled work day w/o any non-pay, set QUIT
  1. I $P(NODE0,U,2)>1,NODE2'["NP",NODE2'["WP" S QUIT=1 Q
  1. ;
  1. ; Checks for employees with DAILY tours
  1. I $P(NODE0,U,2)=2!($P(NODE0,U,2)=3) S DAH=PPIP_U_DFN_U_$P(NODE2,U,3) Q
  1. ;
  1. ; Load tours and convert to numeric equivalents
  1. ; This creates the ordered arrays
  1. ;
  1. S DADRFM=1
  1. S NODE1=$G(^PRST(458,PPIP,"E",DFN,"D",WDAY,1))
  1. D CNV96^PRSATP5(.NODE1,3,"NT",NODE0,.DADRFM)
  1. S NODE4=$G(^PRST(458,PPIP,"E",DFN,"D",WDAY,4))
  1. I NODE4'="" D CNV96^PRSATP5(.NODE4,3,"NT",NODE0,.DADRFM)
  1. D CNV96^PRSATP5(.NODE2,4,"NE",NODE0,.DADRFM)
  1. ;
  1. ; Identify beginning of tour
  1. S TINDX="",TINDX=$O(NT(TINDX))
  1. ;
  1. ; Loop through ordered exceptions to see if the first 15 minutes
  1. ; of the tour was non-pay
  1. S (EINDX,EDATA)=""
  1. F EIN=1:1:7 D Q:QUIT!(EINDX="")!(DAH'="")
  1. . S EINDX=$O(NE(EINDX))
  1. . Q:EINDX=""
  1. . S EDATA=NE(EINDX),EEND=$P(EDATA,U,2),ETOT=$P(EDATA,U,3)
  1. . Q:EINDX'=TINDX ; not first 15 minutes
  1. . I ETOT'="NP"&(ETOT'="WP") S QUIT=1 Q ; first 15 wasn't non-pay
  1. . S DAH=PPIP_U_WDAY_U_ETOT
  1. I DAH="" S QUIT=1
  1. Q