source: WorldVistAEHR/trunk/r/PAID-PRS/PRSEPMD5.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.7 KB
Line 
1PRSEPMD5 ;HISC/GLB/JH-INCOMPLETE EMP. M I REPORT ;9/21/1998
2 ;;4.0;PAID;**20,35,44**;Sep 21, 1995
3 ;
4 ;INCOMPLETE EMPLOYEE M I REPORT (BY CLASS) PART 1 OF 2
5 ;
6EN1 ; SERVICE EMPLOYEE DEFICIENCY REPORT
7 S X=$G(^PRSE(452.7,1,"OFF")) I X=""!(X=1) D MSG6^PRSEMSG Q
8 S (PRSEOUT,NOUT,NQ,NSW1)=0 D EN2^PRSEUTL3(DUZ) I '(PRSESER>0)&'(DUZ(0)="@") D MSG3^PRSEMSG G QUIT
9 K POUT S DATSEL="NS^N+" D DATSEL^PRSEUTL G:$D(POUT) Q
10 I '+$$EN4^PRSEUTL3($G(DUZ)),'(DUZ(0)["@") S PSPC=PRSESER("TX"),PSPC(1)=PRSESER G AR
11 K DIC D EN3^PRSEUTL1 G:$D(POUT) QUIT
12AR S CORGCODE=+$O(^PRSP(454,1,"ORG","C",+$G(PSPC(1)),0))
13 S CORGCODE=$TR($P($G(^PRSP(454,1,"ORG",CORGCODE,0)),U),":")
14 S DIC("S")="S DATA=$G(^PRSE(452.1,+Y,0)) I $P($G(DATA),U,7)=""M"",($P($G(DATA),U,9)=0!($P($G(DATA),U,8)=PRSESER!(DUZ(0)[""@""!(+$$EN3^PRSEUTL3($G(DUZ))))))" D EN7^PRSEUTL1 G:$D(POUT) Q
15 W ! S ZTRTN="START^PRSEPMD5",ZTDESC="EMPLOYEE M.I. DEFICIENCY by PROGRAM/CLASS" D LOOP,DEV^PRSEUTL G Q:POP!($D(ZTSK))
16 ;
17START ;DEFINE OUTPUT DATE/HEADERS
18 S PRSE132=$S(IOM'<132:1,1:0)
19 K ^TMP("PRSE",$J) U IO S (HOLD,HOLD1,HOLD2,COUNT)=0,PRSESERV("OLD")=""
20 I $G(PSPC(1)) D
21 . S PRS454=0
22 . F S PRS454=$O(^PRSP(454,1,"ORG","C",PSPC(1),PRS454)) Q:PRS454'>0 D
23 .. S CORGCODE=$TR($P($G(^PRSP(454,1,"ORG",PRS454,0)),U),":")
24 .. I CORGCODE]"" D MAINLOOP
25 .. Q
26 . Q
27 E D
28 . F S CORGCODE=$O(^PRSPC("ACC",CORGCODE)) Q:CORGCODE="" D MAINLOOP
29 . Q
30 D ^PRSEPMD6
31 ;
32QUIT ;KILL LOCAL VARIABLES
33Q K ^TMP("PRSE",$J)
34 S POUT=+$G(PRSEOUT)
35 S:$D(ZTSK) ZTREQ="@" D CLOSE^PRSEUTL
36 D ^PRSEKILL K DUEDT
37 Q
38 ;
39MAINLOOP ;
40 S DA=0,PRSESERV=$$SERV(CORGCODE),ONESERV=0
41 F S DA=$O(^PRSPC("ACC",CORGCODE,DA)) Q:DA'>0 D
42 .S X(0)=$G(^PRSPC(DA,0)),X(1)=$G(^(1)),SSN=$P(X(0),U,9)
43 .Q:(SSN="")!($P(X(1),U,33)="Y")
44 .S PRDA=+$O(^VA(200,"SSN",SSN,0)) Q:PRDA'>0 ;PRDA=IEN of file 200
45 .S PRSENAME=$P(X(0),U) ; name from 450
46 .S NSCT="",PRCOD=$S($P(X(0),U,17)'="":$P(X(0),U,17),1:0)
47 .S NSCT=$$EN12^PRSEUTL2(PRCOD) S:NSCT="" NSCT=" BLANK"
48 .Q:'+$$EN3^PRSEUTL3($G(PRDA))=PRSESER&'(DUZ(0)="@")&'(+$$EN4^PRSEUTL3($G(DUZ)))
49 .W:$E(IOST)="C" "."
50 .S NAM=$S($P(^VA(200,PRDA,0),U)'="":$P(^(0),U),1:" BLANK") ;NAM=200name
51 .F D1=0:0 S D1=$O(^PRSPC(DA,6,D1)) Q:D1'>0 D
52 ..K DROPDEAD
53 ..S PRSE=$G(^PRSPC(DA,6,D1,0)),CLASSIEN=+$P(PRSE,U) Q:CLASSIEN'>0
54 ..Q:$S($P(PRSE,U,3)'>0:1,$P(PRSE,U,3)>YREND:1,$P(PRSE,U,3)>DT:1,1:0)
55 ..S CLASS=$G(^PRSE(452.1,CLASSIEN,0)) Q:CLASS=""
56 ..I $P(CLASS,U,7)'="M" Q ; Only Mandatory Inservice
57 ..S CLASSTXT=$P(CLASS,U),FREQ=+$P(CLASS,U,6)
58 ..I 'NSP,PRSECLS=CLASSTXT S ONESERV=1
59 ..S CLASSTXT(0)=$S(PRSE132:CLASSTXT,1:$E(CLASSTXT,1,25))
60 ..S:CLASSTXT(0)="" CLASSTXT(0)=" BLANK"
61 ..I 'NSP,PRSECLS'=CLASSTXT Q
62 ..I $D(PSPC(1)),'(+PSPC(1)=+$$EN3^PRSEUTL3($G(PRDA))) Q
63 ..I PRSESERV]"",$G(^TMP("PRSE",$J,"DA",DA))'>0 D
64 ...S TMP=$G(^TMP("PRSE",$J,"%",PRSESERV)) S:TMP="01" TMP=0 S $P(TMP,U)=$P(TMP,U)+1
65 ...S ^TMP("PRSE",$J,"%",PRSESERV)=TMP,^TMP("PRSE",$J,"DA",DA)=1
66 ...Q
67 ..;I "^C^F^"[(U_TYP_U),FREQ<1 Q
68 ..;I "S"=TYP,FREQ'<1 Q
69 ..S DATE=+$O(^PRSE(452,"AA","M",PRDA,CLASSTXT,0))
70 ..S LASTDATE=$S(DATE:9999999-DATE\1,1:0) ;date last took course
71 ..I 'LASTDATE S LASTDATE=$P(PRSE,U,3)
72 ..I $E(LASTDATE,6,7)="00" D
73 ...N MONTH,YEAR
74 ...S MONTH=+$E(LASTDATE,4,5),YEAR=1700+$E(LASTDATE,1,3)
75 ...S LASTDAY=$P("31^"_(28+$$LEAPYR^PRSLIB00(YEAR))_"^31^30^31^30^31^31^30^31^30^31",U,MONTH)
76 ...S LASTDATE=$E(LASTDATE,1,5)_LASTDAY
77 ...Q
78 ..S X1=LASTDATE,X2=$J(FREQ*365.25,0,0) D C^%DTC S DROPDEAD=X
79 ..I FREQ=0,DATE Q ; ONE TIME ONLY CLASS
80 ..I DROPDEAD>YREND Q
81 ..Q:$S(DROPDEAD'<YRST:0,DROPDEAD'>YREND:0,1:1)
82 ..I $G(CLASSNUM)'>0 S CLASSNUM=1
83 ..S CLASSNUM(0)=+$G(^TMP("PRSE",$J,"SORT1",PRSESERV,NSCT))
84 ..I CLASSNUM(0)'>0 D
85 ...S CLASSNUM(0)=CLASSNUM,CLASSNUM=CLASSNUM+1
86 ...S ^TMP("PRSE",$J,"SORT1",PRSESERV,NSCT)=CLASSNUM(0)
87 ...Q
88 ..S ^TMP("PRSE",$J,"SORT2",CLASSNUM(0),PRSENAME,CLASSTXT(0))=$G(DROPDEAD)
89 ..I PRSESERV]"",$G(^TMP("PRSE",$J,"DA",DA))'>1 D
90 ...S TMP=$G(^TMP("PRSE",$J,"%",PRSESERV)) I $G(DROPDEAD)'>$G(DT) S $P(TMP,U,2)=$P(TMP,U,2)+1
91 ...;to calculate compliance use TODAY as the date to compute attendance
92 ...;see SUBHDR^PRSEPMD6
93 ...S ^TMP("PRSE",$J,"%",PRSESERV)=TMP,^TMP("PRSE",$J,"DA",DA)=2
94 ...Q
95 ..Q
96 .Q
97 I ($G(NSP)!($G(NSP)'>0&ONESERV)),'$D(^TMP("PRSE",$J,"SORT1",PRSESERV)) D
98 .S ^TMP("PRSE",$J,"SORT1",PRSESERV)="",^TMP("PRSE",$J,"%",PRSESERV)="01"
99 .Q
100 Q
101 ;
102LOOP F X="PSP","PSPC","PSPC(","CORGCODE","PYR","NSP","PRDA","PRSESE","YRCHK","YRST","YREND","REQWRD","NCAT","NSCAT","NHOS","NWRD","NSW1","NOUT","PRSEOUT","TYP","PRSECLS","PRSECLS(","PRSEDA","PRSECHK","PRSENAM","PRSESER" D
103 . S ZTSAVE(X)=""
104 Q
105 ;
106SERV(COSTCEN) ;
107 N NLOC
108 S COSTCEN=$E(COSTCEN,1,4)_":"_$E(COSTCEN,5,8)
109 S COSTCEN=+$O(^PRSP(454,1,"ORG","B",COSTCEN,0))
110 S NLOC=+$P($G(^PRSP(454,1,"ORG",COSTCEN,0)),U,2)
111 S NLOC=$P($G(^PRSP(454.1,NLOC,0)),U)
112 S:NLOC="" NLOC=" BLANK"
113 Q NLOC
Note: See TracBrowser for help on using the repository browser.