source: WorldVistAEHR/trunk/r/PAID-PRS/PRSAEDL.m@ 1096

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

initial load of WorldVistAEHR

File size: 2.9 KB
RevLine 
[613]1PRSAEDL ; HISC/REL-Display Envir. Diff. Requests ;8/23/94 08:48
2 ;;4.0;PAID;**114**;Sep 21, 1995;Build 6
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4TK ; Timekeeper Entry
5 S PRSTLV=2 G L0
6SUP ; Supervisor Entry
7 S PRSTLV=3 G L0
8L0 D ^PRSAUTL G:TLI<1 EX
9 K DIC S DIC("A")="Select EMPLOYEE (or RETURN for all): ",DIC("S")="I $P(^(0),""^"",8)=TLE",DIC(0)="AEQM",DIC="^PRSPC(",D="ATL"_TLE W ! D IX^DIC S DFN=+Y K DIC
10 G:$D(DTOUT) EX I DFN<1,X'="" G EX
11D1 K %DT S %DT="AEX",%DT("A")="Begin with Date: " W ! D ^%DT K %DT S:$D(DTOUT) Y=0 G:Y<1 EX S SDT=Y
12 K %DT S %DT="AEX",%DT("A")="End with Date: " W ! D ^%DT K %DT S:$D(DTOUT) Y=0 G:Y<1 EX S EDT=Y
13 I SDT>EDT W *7,!?5,"Starting Date cannot be later than Ending Date!" G D1
14D2 S SRT="E" I DFN<1 R !!,"Sort by: (E=Employee D=Date) E// ",SRT:DTIME G:'$T!(SRT["^") EX S:SRT="" SRT="E" S SRT=$TR(SRT,"de","DE") I SRT'?1U!("DE"'[SRT) W *7," Enter E or D" G D2
15 W ! K IOP,%ZIS S %ZIS("A")="Select Device: ",%ZIS="MQ" D ^%ZIS K %ZIS,IOP G:POP EX
16 I $D(IO("Q")) S PRSAPGM="Q1^PRSAEDL",PRSALST="DFN^TLE^SDT^EDT^SRT" D QUE^PRSAUTL G EX
17 U IO D Q1 D ^%ZISC K %ZIS,IOP G EX
18Q1 K ^TMP($J) I DFN>0 D Q2 G P1
19 S NN="" F S NN=$O(^PRSPC("ATL"_TLE,NN)) Q:NN="" F DFN=0:0 S DFN=$O(^PRSPC("ATL"_TLE,NN,DFN)) Q:DFN<1 D Q2
20 G P1
21Q2 S LST=9999999-SDT
22 F DTI=9999999-EDT-.1:0 S DTI=$O(^PRST(458.3,"AD",DFN,DTI)) Q:DTI=""!(DTI>LST) F DA=0:0 S DA=$O(^PRST(458.3,"AD",DFN,DTI,DA)) Q:DA="" D Q3
23 Q
24Q3 I SRT="E" S ^TMP($J,DFN,9999999-DTI,DA)="" Q
25 S ^TMP($J,9999999-DTI,DFN,DA)="" Q
26P1 S (PG,CNT,QT)=0 D HDR S EDS=";"_$P(^DD(458.3,8,0),"^",3)
27 F N1=0:0 S N1=$O(^TMP($J,N1)) Q:N1="" S HDR=0 F N2=0:0 S N2=$O(^TMP($J,N1,N2)) Q:N2="" F DA=0:0 S DA=$O(^TMP($J,N1,N2,DA)) Q:DA="" D LST G:QT P2
28 D CK,H1
29P2 Q
30CK W:'CNT !!,"No Environmental Differential Requests found for this period." Q
31LST ; Display Request
32 S DFN=$S(SRT="E":N1,1:N2),Y0=$G(^PRSPC(DFN,0)) I HDR D:$Y>(IOSL-3) HDR Q:QT G L1
33 D:$Y>(IOSL-6) HDR Q:QT I SRT="E" W !!,$P(Y0,"^",1) S X=$P(Y0,"^",9) I X W ?50,$E(X),"XX-XX-",$E(X,6,9) S HDR=1 G L1
34 S X=N1 D DTP W !!,Y
35L1 ; List item
36 S Z=$G(^PRST(458.3,DA,0)) Q:Z="" S SCOM=$P($G(^(1)),"^",1),CNT=CNT+1
37 I SRT="D" W !?3,$P(Y0,"^",1)
38 E S X=$P(Z,"^",3) D DTP W !?3,Y
39 W " ",$P(Z,"^",4),"-",$P(Z,"^",6)," (Meal: ",+$P(Z,"^",5),") "
40 S X=$P(Z,"^",7)
41 W $P($G(^PRST(457.6,+X,0)),"^",1)," Envir. Diff. "
42 S X=$P(Z,"^",9)
43 S %=$F(EDS,";"_X_":") I %>0 W $P($E(EDS,%,999),";",1)
44 S X=$P(Z,"^",8) W:X'="" !?5,X W:SCOM'="" !?5,"Supr: ",SCOM Q
45DTP ; Printable Date
46 S Y=$J(+$E(X,6,7),2)_"-"_$P("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"," ",+$E(X,4,5))_"-"_$E(X,2,3)
47 Q
48HDR ; Display Header
49 D H1 Q:QT W:'($E(IOST,1,2)'="C-"&'PG) @IOF
50 S PG=PG+1,HDR=0 W !?26,"VA TIME & ATTENDANCE SYSTEM",?72,"Page ",PG
51 W !?18,"T&L ",TLE," ENVIRONMENTAL DIFFERENTIAL REQUESTS"
52 S X=SDT D DTP W !!?27,"From ",Y S X=EDT D DTP W " to ",Y Q
53H1 I PG,$E(IOST,1,2)="C-" R !!,"Press RETURN to Continue.",X:DTIME S:'$T!(X["^") QT=1
54 Q
55EX G KILL^XUSCLEAN
Note: See TracBrowser for help on using the repository browser.