source: FOIAVistA/trunk/r/INTERIM_MANAGEMENT_SUPPORT-ECT/ECTP1TL0.m@ 1274

Last change on this file since 1274 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.7 KB
Line 
1ECTP1TL0 ;B'ham ISC/PTD-PAID Data for One T&L Unit - CONTINUED ;01/29/91 08:00
2V ;;1.05;INTERIM MANAGEMENT SUPPORT;**4,8,10**;
3ENQ ;ENTRY POINT WHEN QUEUED
4 K ^TMP($J) S YP=(BYRPP-1)
5LP1 ;LOOP THROUGH DATE/PAY PERIOD REQUESTED
6 F J=0:0 S YP=$O(^PRST(455,YP)) G:'YP EN1^ECTP1TL1 G:YP>EYRPP EN1^ECTP1TL1 S (EMPDA,PAL,PSL,PLWOP,PAA,PCTE,PCTU,PUNS,POT)=0 D LP2 D:$D(TMP(TLDA,YP)) SETGL
7 ;
8LP2 ;LOOP THROUGH ALL RECORDS FOR DATE/PAY PERIOD
9 Q:'$O(^PRST(455,YP,0))
10EMP F K=0:0 S EMPDA=$O(^PRST(455,YP,1,EMPDA)) Q:'EMPDA S TL=$P(^PRST(455,YP,1,EMPDA,0),"^",7) G:TL="" EMP G:TL'=TLPTR EMP D GTDTA
11 Q
12 ;
13 ;
14GTDTA ;FOR SELECTED PAY PERIOD, EXTRACT DATA FOR INDIVIDUAL
15 I '$D(^PRST(455,YP,1,EMPDA,1)) S LOC0=^PRST(455,YP,1,EMPDA,0) F PC=1,2,3,6,7,11,12,13,17,18,19,47,48,49,50,51,53 S $P(LOC1,"^",PC)="000"
16 I G CALC
17 S LOC0=^PRST(455,YP,1,EMPDA,0),LOC1=^PRST(455,YP,1,EMPDA,1)
18CALC ;COMPUTE FIRST AND SECOND WEEK TOTALS FOR PAY PERIOD
19 S (AL,SL,LWOP,AA,CTE,CTU,UNS,OT)=0,(NC,L4SSN)=""
20 S NC=$P(LOC0,"^",6),L4SSN=$E($P(LOC0,"^",5),6,9)
21PHYS ;IS INDIVIDUAL FULL-TIME PHYSICIAN OR RESIDENT
22 I (($P(LOC0,"^",10)="J")!($P(LOC0,"^",10)="L")),($P(LOC0,"^",11)=1) D CONV^ECTPAS0 G IND
23AL S AL1=$P(LOC0,"^",13),AL2=$P(LOC0,"^",48),AL=(($E(AL1,3)/4)+($E(AL1,1,2))+($E(AL2,3)/4)+($E(AL2,1,2)))
24SL S SL1=$P(LOC0,"^",14),SL2=$P(LOC0,"^",49),SL=(($E(SL1,3)/4)+($E(SL1,1,2))+($E(SL2,3)/4)+($E(SL2,1,2)))
25LWOP S LWOP1=$P(LOC0,"^",15),LWOP2=$P(LOC0,"^",50),LWOP=(($E(LWOP1,3)/4)+($E(LWOP1,1,2))+($E(LWOP2,3)/4)+($E(LWOP2,1,2)))
26AA S AA1=$P(LOC0,"^",17),AA2=$P(LOC0,"^",52),AA=(($E(AA1,3)/4)+($E(AA1,1,2))+($E(AA2,3)/4)+($E(AA2,1,2)))
27CTE S CTE1=$P(LOC0,"^",19),CTE2=$P(LOC1,"^"),CTE=(($E(CTE1,3)/4)+($E(CTE1,1,2))+($E(CTE2,3)/4)+($E(CTE2,1,2)))
28CTU S CTU1=$P(LOC0,"^",20),CTU2=$P(LOC1,"^",2),CTU=(($E(CTU1,3)/4)+($E(CTU1,1,2))+($E(CTU2,3)/4)+($E(CTU2,1,2)))
29UNS S UNS1=$P(LOC0,"^",21),UNS2=$P(LOC1,"^",3),UNS=(($E(UNS1,3)/4)+($E(UNS1,1,2))+($E(UNS2,3)/4)+($E(UNS2,1,2)))
30OT S (OT1,OT2)=0 F PC=25,29,30,31,33,35,36,37 S OT1=OT1+$P(LOC0,"^",PC) I $E(OT1,$L(OT1))>3 S OT1=OT1+6
31 F PC=6,7,49 S OT1=OT1+$P(LOC1,"^",PC) I $E(OT1,$L(OT1))>3 S OT1=OT1+6
32 F PC=11,12,13,17,18,19,47,48,50,51,53 S OT2=OT2+$P(LOC1,"^",PC) I $E(OT2,$L(OT2))>3 S OT2=OT2+6
33 S OT1=$E("000",1,3-$L(OT1))_OT1,OT2=$E("000",1,3-$L(OT2))_OT2,OT=(($E(OT1,3)/4)+($E(OT1,1,2))+($E(OT2,3)/4)+($E(OT2,1,2)))
34IND ;SET TMP GLOBAL WITH INDIVIDUAL'S DATA
35 S ^TMP($J,TLDA,YP,NC,L4SSN)=AL_"^"_SL_"^"_LWOP_"^"_AA_"^"_CTE_"^"_CTU_"^"_UNS_"^"_OT
36SETPP ;INCREMENT PAY PERIOD COUNTERS FOR THIS INDIVIDUAL
37 S PAL=PAL+AL,PSL=PSL+SL,PLWOP=PLWOP+LWOP,PAA=PAA+AA,PCTE=PCTE+CTE,PCTU=PCTU+CTU,PUNS=PUNS+UNS,POT=POT+OT
38 S TMP(TLDA,YP)=PAL_"^"_PSL_"^"_PLWOP_"^"_PAA_"^"_PCTE_"^"_PCTU_"^"_PUNS_"^"_POT
39 Q
40 ;
41SETGL ;SET TMP GLOBAL
42 S ^TMP($J,TLDA,YP)=TMP(TLDA,YP)
43 Q
44 ;
Note: See TracBrowser for help on using the repository browser.