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

PRSATP1.m

Go to the documentation of this file.
  1. PRSATP1 ; HISC/REL,WOIFO/PLT - Daily Post verification ;11/28/2006
  1. ;;4.0;PAID;**34,57,112**;Sep 21, 1995;Build 54
  1. ;;Per VHA Directive 2004-038, this routine should not be modified.
  1. ;routine is called to validate data entered during the
  1. ;screenman posting of an employees pay period
  1. ;
  1. K T S ZS="",TWO=$P($G(^PRST(457.1,+TC,0)),"^",5),DY2=TWO="Y" I TC2,'DY2 S TWO=$P($G(^PRST(457.1,+TC2,0)),"^",5),DY2=TWO="Y"
  1. F K=1:4:25 I $P(Z,"^",K)'="" D
  1. .S X=$P(Z,"^",K)_"^"_$P(Z,"^",K+1) I $P(Z,"^",K+1)="" D E8 Q
  1. .D CNV^PRSATIM S Z1=$P(Y,"^",1),Z2=$P(Y,"^",2) D V0
  1. .I Z2>1440,TWO'="Y","OT CT SB ON UA"'[$P(Z,"^",K+2) D E4 Q
  1. .I Z2>2880 D E5 Q
  1. .I $P(Z,"^",K+2)="" D E9 Q
  1. .;check duplicate start time if no rs-type of time in exception string z for node 2
  1. .I Z'["^RS",'(Z["HX"&("ON HW"[$P(Z,"^",K+2))),'(Z["^ON"&(Z["OT")),'(Z["^ON"&(Z["CT")),$D(T(Z1)) D E3 Q
  1. .I $P(Z,"^",K+2)="HW",Z'["HX",'$P($G(^PRST(458,PPI,"E",DFN,"D",DAY,0)),"^",12) D E7 Q
  1. .I $P(Z,"^",K+2)'="" S T(Z1)=$G(T(Z1))_$P(Z,U,K+2)_U,T(Z1,K)=Z2_"^"_$P(Z,"^",K,K+3)
  1. .Q
  1. I '$D(T) Q
  1. ;check duplicate start time if rs in exception string z for node 2.
  1. S Z1="" I Z["^RS",'(Z["^ON"&(Z["OT")),'(Z["^ON"&(Z["CT")) F S Z1=$O(T(Z1)) QUIT:Z1="" QUIT:Z["HX"&("^ON^HW^"[T(Z1)) I $L(T(Z1),U)>2 D QUIT:Z1="*"
  1. . N A
  1. . S A=T(Z1),A=U_A
  1. . I $L(A,U)>4 S Z1="*" QUIT
  1. . I A'["^RS^" S A=$P(A,"^ON")_$P(A,"^ON",2) S:A="" A="^ON" I "^CT^"'[A,"^OT^"'[A,Z'["^HX"!("^HW^"'[A) S Z1="*" QUIT
  1. . I A["^RS^" S A=$P(A,"^RS")_$P(A,"^RS",2) S:A="" A="^RS" I "^CT^OT^RG^ON^HW^"'[A S Z1="*" QUIT
  1. . QUIT
  1. G:Z1="*" E3
  1. ;exclude rs with ct, ot, rg, on, hw for error e2 check
  1. I Z'["HX",'(Z["^ON"&(Z["OT")),'(Z["^ON"&(Z["CT")) S Z1="" F S Z1=$O(T(Z1)) Q:Z1="" G:Z1'<T(Z1,$O(T(Z1,0))) E1 S Y=$O(T(Z1)) I Y,T(Z1,$O(T(Z1,0)))>Y G E2:'(T(Z1)["RS^"&("^CT^OT^RG^ON^HW^"[T(Y)))&'("^CT^OT^RG^ON^HW^"[T(Z1)&(T(Y)["RS^"))
  1. S Z1="",LL=1 F S Z1=$O(T(Z1)) Q:Z1="" F K=0:0 S K=$O(T(Z1,K)) Q:K<1 D
  1. .S $P(ZS,"^",LL)=$P(T(Z1,K),"^",2),$P(ZS,"^",LL+1)=$P(T(Z1,K),"^",3),$P(ZS,"^",LL+2)=$P(T(Z1,K),"^",4) S:$P(T(Z1,K),"^",5)'="" $P(ZS,"^",LL+3)=$P(T(Z1,K),"^",5)
  1. .S LL=LL+4 Q
  1. S Z1=$$GET^DDSVAL(DIE,.DA,70)
  1. I Z1="" F K=1:4:25 G:$P(Z,"^",K+2)="AA" E6 I $P(Z,"^",K+2)="WP",$P(Z,"^",K+3)=3 G E10
  1. ;loop thru posting checking for comptime w/out remarks code.
  1. F K=1:4:25 G:($P(Z,"^",K+2)="CT")&($P(Z,"^",K+3)="") E11
  1. F K=1:4:25 G:($P(Z,"^",K+2)="CU")&($P(Z,"^",K+3)="") E12
  1. ;Now loop again checking to make sure compressed tours aren't
  1. ;trying to post credit hours remarks.
  1. I $$COMPR(PPI,DFN) F K=1:4:25 G:$$CTCH(Z,K) E13
  1. Q
  1. ;-------------------------------------------------
  1. COMPR(P,D) ;return true if employee has a compressed tour indicator
  1. ; this pay period
  1. ; INPUT: P--pay period ien; D--Day number
  1. ;
  1. Q $P($G(^PRST(458,+P,"E",D,0)),"^",6)="C"
  1. ;-------------------------------------------------
  1. CTCH(Z,K) ;return true if comp/credit earned (CT) posted and
  1. ; the remarks code is credit hours.
  1. ; INPUT: Z--Posting node from file 458
  1. ; K--segment of posting node
  1. Q $P(Z,"^",K+2)="CT"&($P(Z,"^",K+3)="16")
  1. ;-------------------------------------------------
  1. ;
  1. V0 I Z2>Z1 S:DY2=1&($O(T(0))>Z1) DY2=2 I DY2=2 S Z1=Z1+1440,Z2=Z2+1440
  1. S:Z2'>Z1 Z2=Z2+1440,DY2=2 Q
  1. E1 S STR="A start time is not less than a stop time." G E20
  1. E2 S STR="End of one segment must not be greater than start of next." G E20
  1. E3 S STR="Duplicate start times encountered." G E20
  1. E4 S STR="Segment of second day encountered; no two-day tour specified." G E20
  1. E5 S STR="Segment of third day encountered." G E20
  1. E6 S STR="Remarks must be entered when AA is posted." G E20
  1. E7 S STR="HW can only be posted with HX or on a Holiday." G E20
  1. E8 S STR="Stop Time not entered for a segment." G E20
  1. E9 S STR="Type of Time not entered for a segment." G E20
  1. E10 S STR="Remarks must be entered for WP due to AWOL." G E20
  1. E11 S STR="REMARKS CODE must be entered when CT is posted." G E20
  1. E12 S STR="REMARKS CODE must be entered when CU is posted." G E20
  1. E13 S STR="REMARKS CODE: Compressed tours can't earn credit hours." G E20
  1. E20 K ZS,T S DDSERROR=1,TIM=0 D HLP^DDSUTL(.STR) Q