source: WorldVistAEHR/trunk/r/PAID-PRS/PRSEUTL3.m@ 1150

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

initial load of WorldVistAEHR

File size: 4.4 KB
RevLine 
[613]1PRSEUTL3 ;HISC/JH/MD-EMPLOYEE EDUCATION REPORT - UTILITY ;8/10/99
2 ;;4.0;PAID;**3,18,50**;Sep 21, 1995
3EN1 ; DEFAULT FROM CLASS ROOM HOURS WHILE ON DUTY
4 S PRSW=0 I +$P($G(^PRSE(452.8,DA,0)),U,11)>0 S PRSW=1 Q
5 S XXX=PRSELEN,PRSELEN=$$EN5^PRSEUTL3($G(XXX)),$P(^PRSE(452.8,DA,0),U,11)=PRSELEN
6 Q
7EN2(DUZ) ; USER SERVICE SELECTION ROUTINE
8 S (PRSESER,PDA,PRSE)=""
9 I $P($G(^VA(200,+$G(DUZ),1)),U,9)?9N S PRSE=$P(^(1),U,9)
10 I (PRSE>0) S PDA=+$O(^PRSPC("SSN",PRSE,0)) Q:$P($G(^PRSPC(+PDA,1)),U,33)="Y"
11 I +PDA>0 S $P(PRSE,U,2)=$P($G(^PRSPC(PDA,0)),U,49) I $P(PRSE,U,2)?8N S $P(PRSE,U,3)=$O(^PRSP(454,1,"ORG","B",$E($P(PRSE,U,2),1,4)_":"_$E($P(PRSE,U,2),5,8),0))
12 I $P($G(PRSE),U,3)>0 S PRSESER=$P(^PRSP(454,1,"ORG",$P(PRSE,U,3),0),U,2),PRSESER("TX")=$P($G(^PRSP(454.1,+PRSESER,0)),U)
13 I PRSESER="",+$$EN4^PRSEUTL3($G(DUZ)) S PRSESER=$O(^PRSP(454.1,"B","MISCELLANEOUS",0)),PRSESER("TX")=$P($G(^PRSP(454.1,+PRSESER,0)),U)
14 K PDA,PRSE
15 Q
16EN3(PRDA) ; USER SERVICE SELECTION ROUTINE WITH NEW PERSON FILE POINTER
17 I '$G(PRDA) Q ""
18 N PRSEDATA S (XXX,PDA,PRSEDATA)=""
19 I $P($G(^VA(200,PRDA,1)),U,9)?9N S PRSEDATA=$P(^(1),U,9) S:$G(PRSEDATA)'="" PDA=$O(^PRSPC("SSN",PRSEDATA,0))
20 I +$G(PDA),$P($G(^PRSPC(PDA,1)),U,33)'="Y" S $P(PRSEDATA,U,2)=$P($G(^PRSPC(PDA,0)),U,49) I $P(PRSEDATA,U,2)?8N S $P(PRSEDATA,U,3)=$O(^PRSP(454,1,"ORG","B",$E($P(PRSEDATA,U,2),1,4)_":"_$E($P(PRSEDATA,U,2),5,8),0))
21 I +$P(PRSEDATA,U,3)>0 S XXX=$P(^PRSP(454,1,"ORG",+$P(PRSEDATA,U,3),0),U,2)
22 K PDA,PRSEDATA
23 Q XXX
24SALCLS ; SETS AL_CLS XREF FOR FIELD 2 IN FILE 452
25 N PRSECLS
26 S PRSECLS=$P($G(^PRSE(452,DA,0)),U,2) Q:PRSECLS=""
27 I '$D(^PRSE(452,"AL"_PRSECLS,X)) S ^PRSE(452,"AL"_PRSECLS,X,DA)=""
28 Q
29DALCLS ; KILLS AL_CLS XREF FOR FIELD 2 IN FILE 452
30 N PRSECLS,PRSEDT
31 S PRSECLS=$P($G(^PRSE(452,DA,0)),U,2) Q:PRSECLS=""
32 Q:'$D(^PRSE(452,"AL"_PRSECLS,X,DA))
33 S PRSEDT=0 F S PRSEDT=$O(^PRSE(452,"H",X,PRSEDT)) Q:PRSEDT'>0 I $P($G(^PRSE(452,PRSEDT,0)),U,2)=PRSECLS,PRSEDT'=DA Q
34 I PRSEDT>0 S ^PRSE(452,"AL"_PRSECLS,X,PRSEDT)=""
35 K ^PRSE(452,"AL"_PRSECLS,X,DA)
36 Q
37SALCLS1 ; SETS AL_CLS XREF FOR FIELD 1 IN FILE 452
38 N PRSECLS1
39 S PRSECLS1=$P($G(^PRSE(452,DA,0)),U,3) Q:PRSECLS1=""
40 I '$D(^PRSE(452,"AL"_X,PRSECLS1)) S ^PRSE(452,"AL"_X,PRSECLS1,DA)=""
41 Q
42DALCLS1 ; KILLS AL_CLS XREF FOR FIELD 1 IN FILE 452
43 N PRSECLS1,PRSEDT1
44 S PRSECLS1=$P($G(^PRSE(452,DA,0)),U,3) Q:PRSECLS1=""
45 Q:'$D(^PRSE(452,"AL"_X,PRSECLS1,DA))
46 S PRSEDT1=0 F S PRSEDT1=$O(^PRSE(452,"H",X,PRSEDT1)) Q:PRSEDT1'>0 I $P($G(^PRSE(452,PRSEDT1,0)),U,2)=PRSECLS1,PRSEDT1'=DA Q
47 I PRSEDT1>0 S ^PRSE(452,"AL"_X,PRSECLS1,PRSEDT1)=""
48 K ^PRSE(452,"AL"_X,PRSECLS1,DA)
49 Q
50EN4(DUZ) ; PRSE-CORD SECURITY KEY CHECK
51 Q $S($D(^XUSEC("PRSE CORD",DUZ)):1,1:0)
52EN5(XXX) ; ROUND VALUE IN VARIBLE XXX
53 S XXX=$J(XXX,1,0)
54 Q XXX
55EN6(DUZ) ; PRSE SUP SECURITY KEY CHECK
56 Q $S($D(^XUSEC("PRSE SUP",DUZ)):1,1:0)
57EN7(X,VA200DA,DA) ; DETERMINE THE SPONSORING SERVICE OF A CLASS
58 ;I '$G(PRSXSW),$G(PRSELCL)="N" S PRSESVC="" G Q
59 S PRSEIEN=$O(^PRSE(452.1,"B",X,"")),PRSEIEN=$P($G(^PRSE(452.1,+PRSEIEN,0)),U,8),PRSEIEN(1)=$$EN3^PRSEUTL3($G(VA200DA))
60 S PRSESVC=$S($G(PRSEIEN)'="":PRSEIEN,$G(PRSEIEN(1))'="":PRSEIEN(1),1:+$O(^PRSP(454.1,"B","MISCELLANEOUS",0)))
61Q Q PRSESVC
62EN8(PRX) ; LATEST DATE
63 S PRSEDT=0 F XXX=0:0 S XXX=$O(^PRSE(452.8,PRX,3,"C",XXX)) Q:XXX'>0 I ((9999999-XXX)\1'>DT) N Y S Y=(9999999-XXX) D:+Y D^DIQ S PRSEDT=Y Q
64 Q PRSEDT
65EN9(DUZ) ; PRSE TRAIN SECURITY KEY CHECK
66 Q $S($D(^XUSEC("PRSE TRAIN",DUZ)):1,1:0)
67EN10(SSN) ; USER TITLE/OCCUPATION
68 N Y S XXX="",PRSDA=$O(^PRSPC("SSN",SSN,0))
69 I $P($G(^PRSPC(+PRSDA,0)),U,17)'="" S Y=$P(^(0),U,17) D OST^PRSDUTIL S XXX=$G(Y)
70 K PRSDA
71 Q XXX
72EN11(X,D0) ; CHECK CLASS FILE FOR DUPLICATE NAME IF FOUND RETURN 1
73 N C,CLASS,IEN,PRSEDUP,Y K PRSEDUPL
74 S IEN=+$O(^PRSE(452.1,"B",X,0))
75 S PRSEDUP=$S(IEN'>0:0,IEN'=D0:1,1:0)
76 I PRSEDUP D
77 .S CLASS=$G(^PRSE(452.1,IEN,0))
78 .S PRSEDUPL(1)=""
79 .S PRSEDUPL(2)=" Duplicate class name found."
80 .S PRSEDUPL(3)=" Title: "_$S($P(CLASS,U)]"":$P(CLASS,U),1:"???")
81 .S Y=$P(CLASS,U,7),C=$P(^DD(452.1,5,0),U,2) D:Y]"" Y^DIQ
82 .S PRSEDUPL(4)=" Type: "_$S(Y]"":Y,1:"???")
83 .S PRSEDUPL(5)=" Service: "_$P($G(^PRSP(454.1,+$P($G(CLASS),U,8),0)),U,1)
84 Q PRSEDUP
85EN12(D0) ; INPUT: D0 = File 200 IEN
86 ; OUTPUT: 0 - No SSN found in file 200
87 ; 1 - SSN found in file 200
88 N SSN
89 S SSN=$P($G(^VA(200,+D0,1)),U,9) S:SSN="" SSN=U
90 Q $S(SSN=U:0,1:1)
91 ;
92EN13(X) ; INPUT 'X' = internal entry # for file 200
93 ; OUTPUT = internal entry # for file 450 or null
94 I $S('$G(X):1,'$D(^VA(200,+$G(X),450)):1,1:0) Q ""
95 Q +$G(^VA(200,+$G(X),450))
Note: See TracBrowser for help on using the repository browser.