source: WorldVistAEHR/trunk/r/PAID-PRS/PRSPDEM.m@ 1147

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

initial load of WorldVistAEHR

File size: 5.4 KB
Line 
1PRSPDEM ; HISC/MGD - DISPLAY PT PHYSICIAN EXPIRING MEMORANDUMS ;06/28/05
2 ;;4.0;PAID;**93**;Sep 21, 1995;Build 7
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4PAY ; Payroll Entry
5 N PPERIOD
6 S PRSTLV=7
7TOP W:$E(IOST,1,2)="C-" @IOF W !?26,"VA TIME & ATTENDANCE SYSTEM"
8 S TEXT="MEMORANDA EXPIRING WITHIN THE NEXT 30 DAYS"
9 S SCRTTL=TEXT
10 W !?19,TEXT
11 ; Prompt for Expiration date
12 W !!,"This report identifies PT Physician memorandums that will expire"
13 W !,"within the next 30 days. You may specify a date range other "
14 W "than 30."
15 W !
16EDAT ;
17 S %DT="AEFX",%DT("A")="Expiration Date: ",%DT("B")="T+30",%DT(0)=DT
18 D ^%DT
19 S EDAT=Y
20 ;
21PRCNT ; Prompt for optional off by percentage
22 W !!,"You have the option to enter an Off By Percentage that will only"
23 W !,"list memorandums that are expiring within the specified date and"
24 W !,"that are only off by more than the percentage you specify."
25 W !!
26 S DIR("A")="Would you like to specify an Off By Percentage "
27 S DIR(0)="YO"
28 S PRCNT=""
29 D ^DIR K DIR
30 I X="Y" D
31 . W !
32 . S DIR(0)="NO^1:100:0"
33 . S DIR("A")="Select Off By Percentage "
34 . D ^DIR
35 . I X S PRCNT=X
36 ;====================================================================
37L1 W ! K IOP,%ZIS S %ZIS("A")="Select Device: ",%ZIS="MQ" D ^%ZIS K %ZIS,IOP Q:POP
38 I $D(IO("Q")) D Q
39 . S PRSAPGM="DIS^PRSPDEM",PRSALST="DT^EDAT^PRCNT^POT"
40 . D QUE^PRSAUTL
41 U IO D DIS
42 ; pause screen when employee to prevent scroll (other users prompted)
43 I $E(IOST,1,2)="C-",'QT,PRSTLV=1 S PG=PG+1 D H1
44 D ^%ZISC K %ZIS,IOP Q
45 ;
46DIS ; Display Memorandum
47 ;
48 S (CNT,MIEN,PG,QT)=0
49 F S MIEN=$O(^PRST(458.7,MIEN)) Q:'MIEN D Q:QT
50 . S DATA0=$G(^PRST(458.7,MIEN,0)),DATA4=$G(^PRST(458.7,MIEN,4))
51 . S DATA3=$G(^PRST(458.7,MIEN,3))
52 . Q:$P(DATA3,U,1) ; Memo has been reconciled
53 . ;
54 . ; Check for Termination date beyond user selected expiration date
55 . S PRSIEN=$P(DATA0,U,1),POT=$P(DATA0,U,17)
56 . S TDAT=$P(DATA4,U,1),ENDAT=$P(DATA0,U,3)
57 . Q:TDAT&(TDAT>EDAT)
58 . ;
59 . ; Check for end date beyond user selected expiration date
60 . Q:TDAT=""&(ENDAT>EDAT)
61 . ;
62 . ; Quit if less that Percent Off Target
63 . Q:PRCNT&(+$FN(POT,"T")<PRCNT)
64 . ;
65 . ; Update counter and display memo
66 . S CNT=CNT+1
67 . D DISPLAY
68 . I $D(DIRUT) S QT=1 Q
69 . D PSE
70 ;
71 Q:$D(DIRUT)
72 W !!,"There were "_CNT_" PT Physician Memorandums expiring in the"
73 W " date range specified"
74 I PRCNT D
75 . W !,"who were more than "_PRCNT_"% off target"
76 W "."
77 Q
78 ;
79DISPLAY ; Display memorandum information
80 W @IOF
81 S SCRTTL="DISPLAY PT PHYSICIAN MEMORANDA"
82 S ARRAY="^TMP($J,""PRSPDM"",",INDEX=1
83 D HDR^PRSPUT1(PRSIEN,SCRTTL,ARRAY,INDEX)
84 D MEM^PRSPUT1(PRSIEN,MIEN,ARRAY)
85 D AL^PRSPUT3(PRSIEN,ARRAY)
86 D PPSUM^PRSPUT2(PRSIEN,MIEN,ARRAY)
87 I $E(IOST,1,2)="C-" D
88 . S DIR(0)="E",DIR("A")="Press RETURN to continue" D ^DIR
89 . I '$D(DIRUT) W @IOF
90 Q:$D(DIRUT)
91 ;
92ESRCHK ; Check for any incomplete ESR within the memoranda.
93 ;
94 F I=1:1:26 D
95 . S PPE=$P($G(^PRST(458.7,MIEN,9,I,0)),U)
96 . I PPE="" S ^TMP($J,"INCESR","NO DATA")="" Q
97 . S PPI=$O(^PRST(458,"B",PPE,0))
98 . Q:'PPI ; Pay Period is not opened yet.
99 . S QUIT=0
100 . F DAY=1:1:14 D Q:QUIT
101 . . S ESRSTAT=$P($G(^PRST(458,PPI,"E",PRSIEN,"D",DAY,7)),U,1)
102 . . I ESRSTAT<5 S ^TMP($J,"INCESR",PPE)="",QUIT=1
103 S INDEX=INDEX+1
104 S TEXT=""
105 D A1^PRSPUT1,A1^PRSPUT1 ; Blank Lines
106 S TEXT="The following Pay Periods have days with incomplete daily ESRs: "
107 D A1^PRSPUT1
108 S (PPE,PPEX)=""
109 F S PPE=$O(^TMP($J,"INCESR",PPE)) Q:PPE="" D
110 . S PPEX=$S(PPEX="":PPE,1:PPEX_", "_PPE)
111 S TEXT="" D A1^PRSPUT1 ; Blank Line
112 S TEXT=PPEX
113 D A1^PRSPUT1
114 K ^TMP($J,"INCESR")
115 ;
116 ; Load and display any HR Initial comments
117 S MESSAGE=$G(^PRST(458.7,MIEN,1))
118 I MESSAGE'="" D
119 . S TEXT=""
120 . D A1^PRSPUT1 ; Blank Line
121 . F J=1:1:3 D
122 . . S HEADER=$S(J=1:"HR Initial Comments: ",1:"")
123 . . D TEXT^PRSPDM(HEADER,.MESSAGE)
124 . . D A1^PRSPUT1
125 . I $Y>(IOSL-5) D PSE Q:$D(DIRUT)
126 ;
127 ; Load and display Termination information if any
128 S DATA4=$G(^PRST(458.7,MIEN,4))
129 S TDAT=$P(DATA4,U,1),TERMBY=$P(DATA4,U,2),TERMDT=$P(DATA4,U,3)
130 I TDAT'="" D
131 . S Y=TDAT
132 . D DD^%DT
133 . S TDAT=Y
134 . I TDAT'="" D
135 . . S TEXT=""
136 . . D A1^PRSPUT1 ; Blank Line
137 . . S TEXT=" Termination date: "_TDAT
138 . . D A1^PRSPUT1
139 ;
140 I TERMBY'="" D
141 . S TERMBY=$P($G(^VA(200,TERMBY,0)),U,1)
142 . S TEXT=" Terminated by: "_TERMBY
143 . D A1^PRSPUT1
144 ;
145 I TERMDT'="" D
146 . S Y=TERMDT
147 . D DD^%DT
148 . S TERMDT=Y
149 . I TERMDT'="" D
150 . . S TEXT="Date/Time Terminated: "_TERMDT
151 . . D A1^PRSPUT1
152 I $Y>(IOSL-5) D PSE Q:$D(DIRUT)
153 ;
154 S MESSAGE=$G(^PRST(458.7,MIEN,4.1))
155 I MESSAGE'="" D
156 . S TEXT=""
157 . D A1^PRSPUT1 ; Blank Line
158 . F J=1:1:3 D
159 . . S HEADER=$S(J=1:"HR's Termination Comments: ",1:"")
160 . . D TEXT^PRSPDM(HEADER,.MESSAGE)
161 . . D A1^PRSPUT1
162 . I $Y>(IOSL-5) D PSE Q:$D(DIRUT)
163 Q
164PSE ; Pause for screen breaks
165 Q:$E(IOST,1,2)'="C-"
166 W !
167 S DIR(0)="E",DIR("A")="Press RETURN to continue" D ^DIR
168 I $D(DIRUT) S QT=1
169 W @IOF
170 Q
171 ;
172 ;====================================================================
173 ;
174H1 I PG,$E(IOST,1,2)="C-" R !!,"Press RETURN to Continue.",X:DTIME S:'$T!(X["^") QT=1
175 S PG=PG+1
176 Q
177EX ; Clean up variables
178 K ARRAY,CNT,D,D1,DASH,DATA0,DATA2,DATA3,DATA31,DATA4,DATA41,DATA4580
179 K DAY,DAY1,DFN,DIRUT,EDAT,ENDAT,ESRSTAT,HEADER,HRS,I,ICOM
180 K IDAYS,IEN,INDEX,J,MESSAGE,MIEN,MT,PDT,PG,POP,POT,PPEX,PRCNT,PRSIEN
181 K PTPRC,PTPRCOM,RECONBY,RECONDAT,SDAT,TDAT,TERMBY,TERMDT,TEXT,TL
182 K PPE,PPI,PRSALST,PRSAPGM,PRSTLV,PTPRMKS,QUIT,QT,RC,RCEX,SCRTTL
183 K SEG,SSN,START,STAT,STATEX,STOP,T1,T1EX,TLI,TLSCREEN,TOT,TOTEX
184 K X,Y,%DT,%ZIS
185 Q
Note: See TracBrowser for help on using the repository browser.