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

PRSAENT.m

Go to the documentation of this file.
  1. PRSAENT ;HISC/MGD-Entitlement String ;10/21/04
  1. ;;4.0;PAID;**6,21,45,69,75,76,90,96,112**;Sep 21, 1995;Build 54
  1. ;;Per VHA Directive 2004-038, this routine should not be modified.
  1. ;
  1. ;VARS:
  1. ; C0=employees 0 node of master record in file 450
  1. ; NH= employees 8B normal hours
  1. ; FLX= compressed/flextime code (0=none,C=compressed,F=flextime)
  1. ; PMP= premium pay indicator
  1. ; ( D = entitled Sun., F = entitled Sat./Sun.,
  1. ; E = entitled variable Sat./Sun. premium pay,
  1. ; G = entitled variable Sun. prem pay
  1. ; X = title 5 employees
  1. ; R, C, O = 3 types of firefighters )
  1. ; AC= 3 single char codes concat. w/o delims + a possible 4th char.
  1. ; AC= PP_DutyBasis(full-1,part-2,intermit-3)_FLSA(E=Exempt,N=NonExempt)
  1. ; _(*EWXY8BT02S9P)
  1. ; PP= employees pay plan (possible chars 0AEFGJKLMNPQRSTUWXY)
  1. ; PB= pay basis-code for time condition for computing pay.
  1. ; TA= type of appointment (career, career conditional, etc.)
  1. ; OCC= 4 digit cost center for fund appropriation accounting
  1. ; LVG= one digit code for employees leave group.
  1. ; ASS= specialty assignment of physicians,dentists, nurses,
  1. ; summer employees,trainees and other special programs.
  1. ; ENT= 39 character entitlement string
  1. ; PMP = Premium Pay Code
  1. ;
  1. N PAYPDTMP,PPLOLD,DUTYTEMP,FLSATEMP
  1. ;
  1. S C0=^PRSPC(DFN,0)
  1. ;
  1. ; pay plan in master record.
  1. S PP=$P(C0,"^",21)
  1. ;
  1. ;=====================================================================
  1. ; duty basis from master record
  1. S DUTYTEMP=$P(C0,"^",10)
  1. ;
  1. ; FLSA indicator from master record
  1. S FLSATEMP=$P(C0,"^",12)
  1. ;
  1. ;Make sure we've called this routine from an entry point that uses
  1. ;PY for pay period. A few reports, call PRSAENT from TYPSTF^PRSRUT0
  1. ;and the reports aren't concerned about differing pay plans from
  1. ;other pay periods.
  1. ;
  1. I +($G(PY))>0 D
  1. .S PAYPDTMP=$P($G(^PRST(458,+PY,0)),"^") ;pay period we're working with.
  1. .S PPLOLD=$$OLDPP^PRS8UT(PAYPDTMP,+DFN) ;pay plan from PAYPDTMP.
  1. .;if we find an old pay plan and it's different than the master record
  1. .;use the old pay plan to determine VCS or FEE.
  1. .I PPLOLD'=0,(PP'=PPLOLD) D
  1. .. S PP=PPLOLD
  1. .. S DUTYTEMP=OLDPP("DUTYBS")
  1. ;=====================================================================
  1. ;
  1. ; Numeric Pay plans are all Wage grade. Set them to 0.
  1. S:PP?1N PP=0
  1. ;
  1. ;
  1. S:"BC"[PP PP="A"
  1. I "0AEFGJKLMNPQRSTUWXY"'[PP D NO Q
  1. S NH=+$P(C0,"^",16)
  1. S FLX=$P($G(^PRSPC(DFN,1)),"^",7)
  1. S PMP=$P($G(^PRSPC(DFN,"PREMIUM")),"^",6)
  1. S AC=PP_DUTYTEMP_FLSATEMP
  1. I $L(AC)'=3 D NO Q
  1. ;
  1. ;
  1. D @PP
  1. D FND
  1. Q
  1. ;===========================================================
  1. ;
  1. 0 Q
  1. ;
  1. A ;patch 45: firefighters entitlements are based on PMP Codes.
  1. ; Code O still uses nh>80 to determine entitlement.
  1. I "RC"[PMP S AC=AC_PMP Q
  1. ;
  1. ;This check does not concern itself with whether or not a code
  1. ; O is present. Simply if not a code R or C then an over 80
  1. ; must be a code O firefighter under the rules implemented in
  1. ; patch 45.
  1. ;
  1. I "CR"'[PMP,NH>80 S AC=AC_"*" Q
  1. ;
  1. Q:PMP=""
  1. I $E(AC,2)'=3,"WXY"[PMP S AC=AC_PMP Q
  1. S:"EF"[PMP AC=AC_"E"
  1. ;The following check is for Public Law 108-170
  1. S:"STUV"[PMP AC=AC_PMP
  1. Q
  1. E Q
  1. F Q
  1. G I $E(AC,2)<3 Q
  1. S TA=$P(C0,"^",43) S:TA=8 AC=AC_"8" Q
  1. J Q
  1. K S:NH=48 AC=AC_"B" Q
  1. L I $E(AC,2)=2 S PB=$P(C0,"^",20) S:PB=0 AC=AC_"*" Q
  1. I $E(AC,2)=3 S OCC=$P(C0,"^",17),OCC=+$E(OCC,5,6) S:OCC>20&(OCC<38) AC=AC_"*" Q
  1. S LVG=$P(C0,"^",15) S:LVG=5 AC=AC_"*" Q
  1. M I $E(AC,2)=1,NH=48 S AC=AC_"B" Q
  1. I $E(AC,2)=2,NH=80 S AC=AC_"R" Q
  1. I $E(AC,2)=2 S PB=$P(C0,"^",20) I PB=0 S AC=AC_"0" Q
  1. I $E(AC,2)=3 S PB=$P(C0,"^",20) I PB=2 S AC=AC_"2" Q
  1. S OCC=$P(C0,"^",17) S:OCC="" OCC="*"
  1. S:" 061056 061057 "[OCC AC=AC_"T"
  1. S:" 061071 061072 061080 061083 061084 "[OCC AC=AC_"T"
  1. S:" 060552 060556 "[OCC AC=AC_"T" Q
  1. N S ASS=$P(C0,"^",4),PB=$P(C0,"^",20)
  1. ;The following check is for Public Law 108-170
  1. I "^S^T^U^V^"[("^"_PMP_"^") S AC=AC_PMP Q
  1. I AC="N2E",PB=0 S AC=AC_"0" Q
  1. I $E(AC,2)=3,PB="S" S AC=AC_"$" Q
  1. S OCC=$P(C0,"^",17) S:OCC="" OCC="*"
  1. I OCC="069961" S AC=AC_"T" Q ; Student Nurse Technician
  1. I OCC="069964" S AC=AC_"T" Q ; Student Nurse Technician
  1. S AC=AC_$S(ASS="TR":"T",ASS?1"T"1N:"T",ASS?1"A"1N:"T",1:"") Q
  1. P Q
  1. Q I $E(AC,2)'=2 Q
  1. S PB=$P(C0,"^",20) S:PB=0 AC=AC_"0" Q
  1. R Q
  1. S Q
  1. T I $E(AC,2)'=3 Q
  1. S PB=$P(C0,"^",20) S:PB=9 AC=AC_"9" Q
  1. U S PB=$P(C0,"^",20) I $E(AC,3)="N",PB="P" S AC=AC_"P"
  1. Q
  1. W Q
  1. X S:'NH AC=AC_"0" Q
  1. Y Q
  1. ;
  1. ;= = = = = = = = = = = = = = = = = = = = = = = =
  1. FND ;Look up the 39 character entitlement string in the entitlement table
  1. ;The lookup is based on the AC x-ref that matches the AC variable that
  1. ;is built in this routine from the three 1 character codes from the
  1. ;450 fields (pay plan, duty basis, FLSA).
  1. ;
  1. S A1=$O(^PRST(457.5,"AC",AC,0))
  1. D NO
  1. I +A1 S ENT=^PRST(457.5,A1,1)
  1. ; The following check was added to address the Hybrid employees
  1. ; defined in Public Law 107-135. These Hybrids do not have a
  1. ; Premium Pay Indicator but are entitled to Saturday and Sunday
  1. ; Premium Pay.
  1. I $$HYBRID^PRSAENT1(DFN) D
  1. . S $E(ENT,8,9)="11"
  1. ;
  1. Q
  1. ;= = = = = = = = = = = = = = = = = = = = = = = =
  1. NO S ENT=""
  1. Q
  1. ;
  1. MLINHRS(IEN) ;
  1. ;----------------------------------------------------------------------
  1. ; Determine if the employee is entitled to Military Leave in hours.
  1. ;
  1. ; Input Vars:
  1. ; IEN - the ien number of the employee in the PAID EMPLOYEE (#450)
  1. ; file.
  1. ;
  1. ; Local Vars:
  1. ; DATA - the 0 node of the employee from the PAID EMPLOYEE (#450)
  1. ; file.
  1. ; DB - Duty Basis field #9 from the #450 file.
  1. ; NH - Normal Hours field # 15 from the #450 file.
  1. ; PP - Pay Plan field # 20 from the #450 file.
  1. ;
  1. ; Output:
  1. ; 1 : Entitled to ML in hours.
  1. ; 0 : Entitled to ML in days.
  1. ; X : Some of the required fields were not defined or the employee
  1. ; is not entitled to Military Leave.
  1. ;----------------------------------------------------------------------
  1. ; Quit if no IEN passed in
  1. ;
  1. Q:'+IEN "X"
  1. ;
  1. ; Verify that ENT is defined. If not call PRSAENT to define it.
  1. ;
  1. I '$D(ENT) D PRSAENT
  1. ;
  1. ; Quit if the Entitlement string is not defined for the employee
  1. ;
  1. Q:ENT="" "X"
  1. ;
  1. ; Quit if the employee is not entitled to Military Leave
  1. ;
  1. Q:'$E(ENT,34) "X"
  1. ;
  1. N DATA,PP,DB,NH
  1. S DATA=$G(^PRSPC(IEN,0))
  1. Q:DATA="" "X"
  1. S DB=$P(DATA,U,10),NH=$P(DATA,U,16),PP=$P(DATA,U,21)
  1. Q:DB=""!(NH="")!(PP="") "X" ; Quit if DB or NH or PP is not defined.
  1. ;
  1. ; Check for ML in Days
  1. ;
  1. I DB=1,NH=0,"^J^L^P^Q^X^"[PP Q 0
  1. ;
  1. ; Otherwise the employee is entitled to ML in hours.
  1. ;
  1. Q 1