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

PRS8CR.m

Go to the documentation of this file.
  1. PRS8CR ;HISC/MRL-DECOMPOSITION, CREATE STRING ;01/17/07
  1. ;;4.0;PAID;**2,6,45,69,112,117,132**;Sep 21, 1995;Build 13
  1. ;;Per VHA Directive 2004-038, this routine should not be modified.
  1. ;
  1. ;This routine take the information contained in the WK array
  1. ;and creates the activity string to be passed to Austin. The
  1. ;WK(1) node contains those items pertaining to Week 1 activity,
  1. ;WK(2) contains those items pertaining to Week 2 activity and
  1. ;WK(3) contains the Miscellaneous information shown on the bottom
  1. ;of the timecard.
  1. ;
  1. ;Called by Routines: PRS8DR
  1. ;
  1. ;Variable S contains the lengths of each of the Values for the
  1. ;different time codes. Used to format values with leading and
  1. ;trailing zero's
  1. N MLINHRS
  1. S MLINHRS=$$MLINHRS^PRSAENT(DFN)
  1. S S="3333333333333333333333333333333334436232333333333333333333"
  1. S E(1)="ANSKWDNOAURTCECUUNNANBSPSASBSCDADBDCTFOAOBOCYAOKOMRARBRCHAHBHCPTPAONYDHDVCEA EB TATCFAFCADNTRSSRSDNDCFCHCPCRTWTSTM"
  1. S E(2)="ALSLWPNPABRLCTCOUSNRNSSQSESFSGDEDFDGTGOEOFOGYEOSOURERFRGHLHMHNPHPBCLYHHOVSEC ED TBTDFBFDAFNHRNSSSHNUCGCICQCSTXTTTN"
  1. S E(3)="NLDWINTLLULNLDDTTOLAMLCAPCCYRRFFFECD"
  1. K V S V="" F I=1,2,3 S V(I)=""
  1. ;
  1. ;Next section gets Week 1 and Week 2 data and stores in V(WK)
  1. F J=1,2 F I=1:1:38,40,42:1:58 S X=+$P(WK(J),"^",I) I X]"" D
  1. .; Don't report PT/PT for nurses on AWS schedules
  1. .Q:$E(AC,2)=1&($P(C0,U,16)=72)&(I=32) ; 36/40 AWS
  1. .Q:$E(AC,2)=2&($P(C0,U,16)=80)&(I=32) ; 9month AWS
  1. .;
  1. .I TYP'["D",I'=38,I'=40 D QH
  1. .I TYP["D" S X=+X_"0"
  1. .I TYP["Pd",$E(ENT,2)'="D",$P(WK(J),"^",32)="",V(J)="" S V(J)=V(J)_$S(J=1:"PT000",J=2:"PH000",1:"") ;for p/t drs put PT,PH in 8B string even if they are 0 (PT+PH=NH)
  1. .;Part time hours
  1. .I I=32,TYP["P",TYP["N",TYP'["B"!(TYP["H"),'X D Q
  1. ..S X=$E("0000000",0,+$E(S,I)-$L(X))_X
  1. ..S V(J)=V(J)_$E(E(J),I+(I-1),I*2)_X
  1. ..Q
  1. .;holiday hours
  1. .I I=37,$P(C0,"^",20)="P",$P(C0,"^",21)="U" D
  1. ..S X=$E("0000000",0,+$E(S,I)-$L(X))_X
  1. ..I 'X S V(J)=V(J)_$E(E(J),I+(I-1),I*2)_X
  1. ..Q
  1. .S X=+X I I=32,TYP["Pd",X=0 S X=1
  1. .Q:'X
  1. .I I=32,TYP["Pd",X=1 S X=0
  1. .I I=38!(I=40) D
  1. ..S Z=X,X=4*$P(WK(J),"^",I+1) D QH
  1. ..S X=($E("00",0,$E(S,I)-$L(Z))_+Z)_($E("000",0,$E(S,I+1)-$L(+X))_+X) ;combine env. diff. % and hours
  1. ..Q
  1. .E S X=$E("0000000",0,+$E(S,I)-$L(X))_+X
  1. .I +X S V(J)=V(J)_$E(E(J),I+(I-1),I*2)_X,V=V+X
  1. ;Now we get miscellaneous data
  1. ;
  1. S S="22134446114423146"
  1. F I=1:1:17 S X=$P(WK(3),"^",I) I X'="" D
  1. .I I=11 D
  1. . . I MLINHRS D QH ; Convert to 1/4 hours.
  1. . . I MLINHRS=0 S X=X_"0" ; Convert to 1/4 hours.
  1. .S X=$E("000000",0,+$E(S,I)-$L(X))_X
  1. .I $D(X) S V(3)=V(3)_$E(E(3),I+(I-1),I*2)_X,V=V+X
  1. ;
  1. ;finish up
  1. ;
  1. S VAL="" I $L(V(1))!($L(V(2)))!($L(V(3))) S X=V(1)_V(2)_V(3)_"CD"_$E("000000",0,6-$L(+V))_+V,VAL=X
  1. ;
  1. STUB ; --- enter here to create stub only
  1. I '($D(VAL)#2) S VAL=""
  1. ; code below to add CP field to STUB record (32nd position)
  1. S CPFX=""
  1. S CPFX=$P($G(^PRST(458,PY,"E",DFN,0)),"^",6) ;get CP from 458
  1. I CPFX="" S CPFX=$P($G(^PRSPC(DFN,1)),"^",7) ;if 458 null get from 450
  1. I "0"[CPFX S CPFX=" " ;if it is 0 or "" set CPFX = " "
  1. S PPE=$G(^PRST(458,+PY,0)),PPE=$P(PPE,"^",1),PPI=+PY D ^PRSAXSR
  1. S VAL=HDR_CPFX_VAL ;decomp no longer saves 8B in 5 node (6/95)
  1. K I,J,S Q
  1. ;
  1. QH ; --- for persons paid hourly/convert to Quarter Hours
  1. ;
  1. I I'=37 S X1=X#4,X=X\4_+X1 K X1
  1. Q