source: FOIAVistA/trunk/r/PAID-PRS/PRSRUT0.m@ 1590

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

initial load of FOIAVistA 6/30/08 version

File size: 3.4 KB
Line 
1PRSRUT0 ;HISC/JH,JAH-UTILITY ROUTINE FOR PAID ADDIM. REPORTS ;6/24/94
2 ;;4.0;PAID;**2,17,114**;Sep 21, 1995;Build 6
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4QUE ;QUEUE FOR PAID REPORTS
5 S IOP="Q",%ZIS="Q" D ^%ZIS K %ZIS K:POP IO("Q") I POP S ZTSTOP=1 Q
6 I $D(IO("Q")) K IO("Q"),IO("C") S ZTIO=ION_";"_IOST_";"_IOM_";"_IOSL,ZTSAVE("IOM")="" D ^%ZTLOAD S:'$D(ZTSK) (ZTSTOP,POP)=1
7 Q
8QUE1 ;QUEUE FOR PAID REPORTS
9 S %ZIS="Q" D ^%ZIS K %ZIS K:POP IO("Q") S:POP ZTSTOP=0 Q:POP
10 I $D(IO("Q")) K IO("Q"),IO("C") S ZTIO=ION_";"_IOST_";"_IOM_";"_IOSL D ^%ZTLOAD S:'$D(ZTSK) POP=1
11 Q
12Q ;TERMINAL RESET FROM 132 TO 80 CHARS.
13 I $E(IOST)="C",IOM=132 S X="IORESET" D ENDR^%ZISS W @X D HOME^%ZIS K %,%T,%XX,%YY,IOHG,IOPAR,IORESET,IOUPAR
14 Q
15FOOT ;CODE = 3 Char code for type of report, NUM = Report Number,
16 ;FOOT = Type of system this report is for,
17 ;TYP = Type of report (T&L,T&A,BUDGET,MANPOWER,COST,...),
18 ;TLUNIT = (T&L Unit,T&A Unit,Pay Period,FY,...),
19 F I=1:1 W ! Q:$Y=(IOSL-3)
20FOOT1 W !,"DHCP PAID REPORT ",CODE,?(IOM-$L(FOOT))/2,FOOT
21 Q
22FOOT2 W !,"DHCP PAID REPORT ",CODE,?40,FOOT
23 Q
24CKTOUR(CK) N LL,M,K,KK S M=CK,CK="",KK=1 F K=1:4 S LL=$P(M,"^",K+2) Q:LL="" S %=$F(LVT,";"_LL_":") S:% $P(CK,"^",KK,KK+3)=$P(M,"^",K,K+3) S KK=$S(%:KK+4,1:KK)
25 Q
26TYPSTF S DFN=$O(^PRSPC("SSN",PRSRSSN,0)) N PP D ^PRSAENT S SW(2)=$S($E(ENT,1,2)["D":77,1:73)
27 Q
28TLESEL ;user select T&L units
29 ; set up array:
30 ; TLE(n)="T&L number ^ unit name"
31 ; TLE(n,m) = "ien ^ member name"
32 ; TLE= approving T&L unit
33 ;
34 N A,B,C,D,E,F,X
35 ; get duz of current user
36 S USR="",TLE="" D DUZ^PRSRUTL Q:SSN=""
37TL ; Select T&L from those allowed
38 S:SSN'="" USR=$O(^PRSPC("SSN",SSN,0))
39 K DIC
40 ;
41 ;Z1 for T&L unit file x-ref lookup: T=TimeKeeper, S=Supervisor
42 S Z1=$S(PRSTLV=2:"T",PRSTLV="3":"S",PRSTLV=7:"S",1:"*")
43 I PRSR=1 S TLI=$O(^PRST(455.5,"A"_Z1,DUZ,0)) I TLI<1 W !!,*7,"No T&L Units have been assigned to you!" Q
44 Q:PRSR=3
45SEL W ! S DIC="^PRST(455.5,"
46 S DIC(0)="AEMQ",DIC("A")="Select T&L: "
47 ;screen checks:
48 ; if payroll then all T&L's available OR
49 ; if T&A supervisor then only T&L's that are assigned
50 S DIC("S")="I PRSR=2!(PRSR=1&($D(^PRST(455.5,Y,Z1,DUZ,0))))"
51 D ^DIC Q:$D(DTOUT)!$D(DUOUT)!(Y=-1) K DIC S X=$P(Y,"^",2)
52 D VALSEL I TLE="" W ?($X+2),$C(7),"??" G SEL
53P1 ;S TLI=$P($G(^PRSPC(PRSRDUZ,0)),U,8)
54 Q
55P2 S TLE=1,TLE(I)=$P($G(^PRST(455.5,TLI,0)),"^",1,2)
56 S TLI=$P($G(^PRSPC(PRSRDUZ,0)),U,8)
57 Q
58VALSEL ; Validate input in form 001 or 211,234,333 or 221,2233,345-367,400
59 S C=0,D=1 F A=1:1 Q:$P(X,",",A)="" D
60 . I $P(X,",",A)'["-" S I=$P(X,",",A) S TLE(D)=I,D=D+1
61 . E S B=$P($P(X,",",A),"-"),C=$P($P(X,",",A),"-",2) F I=B:1:C S TLE(D)=I,D=D+1
62 . Q
63CHKSEL ; Check selection array eliminating T&L units not assigned, if not Fiscal.
64 S TLE=D-1 S I=0 F II=1:1 S I=$O(TLE(I)) Q:I'>0 D
65 . I $L(TLE(I))<1!'($O(^PRST(455.5,"B",TLE(I),0))) D KILL Q
66 . S F=$O(^PRST(455.5,"B",TLE(I),0)) I PRSR=1,'$D(^PRST(455.5,F,Z1,DUZ,0)) D KILL
67 . E S $P(TLE(I),U,2)=$P(^PRST(455.5,F,0),U,2) D GET
68 . Q
69 S:D=1 TLE=D Q
70KILL K TLE(D) S TLE=TLE-1 Q
71ALL S DA=0 F I=1:1 S DA=$O(^PRST(455.5,"A"_Z1,DUZ,DA)) Q:DA'>0 D
72 . S TLE(I)=$P($G(^PRST(455.5,DA,0)),U,1,2) D GET
73 . Q
74 Q
75GET S DA(1)="" F II=1:1 S DA(1)=$O(^PRSPC("ATL"_$P(TLE(I),U),DA(1))) Q:DA(1)="" D
76 . S TLE(I,II)=$O(^PRSPC("ATL"_$P(TLE(I),U),DA(1),0))_"^"_DA(1)
77 . Q
78 S TLE=$S(PRSRDUZ:$P($G(^PRSPC(PRSRDUZ,0)),U,8),1:"000"),SW=1 Q
79MSG W !!,$C(7),"ENTER CODE(s), ONE OR MORE, SEPERATED BY COMMA(S) ( , ) or ( ALL ) .",! G SEL
Note: See TracBrowser for help on using the repository browser.