source: WorldVistAEHR/trunk/r/PAID-PRS/PRSATE0.m@ 1005

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

revised back to 6/30/08 version

File size: 1.5 KB
Line 
1PRSATE0 ; HISC/REL-Edit Variable Tours ;5/30/95 14:37
2 ;;4.0;PAID;;Sep 21, 1995
3 S TOLD="" F K=1:1:14 S Z=$P($G(^PRST(458,PPI,"E",DFN,"D",K,0)),"^",2),$P(TOLD,"^",K)=Z I SRT="N",$P($G(^(0)),"^",3) S $P(TOLD,"^",K)=$P(^(0),"^",4)
4 S ^PRST(458,PPI,"E",DFN,"T")=TOLD D DT^PRSATE2
5 K DDSFILE,DA,DR,PRSAERR S DDSFILE=458,DDSFILE(1)=458.01,DA(1)=PPI,DA=DFN
6 S DR="[PRSA TE EDIT]" D ^DDS K DS Q:$D(PRSAERR)
7 S TNEW=$G(^PRST(458,PPI,"E",DFN,"T")) K ^PRST(458,PPI,"E",DFN,"T")
8 I '$D(^PRST(458,PPI,"E",DFN,"D",0)) S ^(0)="^458.02^14^14"
9 F DAY=1:1:14 S TD=$P(TNEW,"^",DAY) I TD>0 D S1
10 Q
11S1 ; Set Tour if necessary
12 I TD=$P(TOLD,"^",DAY),$G(^PRST(457.1,+TD,1))=$G(^PRST(457.1,+$P(TOLD,"^",DAY),1)) Q
13 I SRT'="N" S Y=$G(^PRST(457.1,TD,1)),TDH=$P(^(0),"^",6) D SET^PRSATE Q
14 D NX^PRSATE Q
15VS ; Validate tour segments
16 S TRG=0 F K=1:3:19 Q:$P(Y,"^",K)="" S Z=$P(Y,"^",K+2) S:'Z TRG=1 I Z D
17 .S Z=$P($G(^PRST(457.2,Z,0)),"^",2) I Z="RG" S TRG=1 Q
18 .I ZENT'[Z S STR="Tour Indicator contains type of time to which employee is not entitled."
19 .Q
20 Q
21VAL ; Validate Tour
22 S (ZENT,STR)="" K PRSAERR D OT^PRSATP
23 S (HRS,TRS)=0 F DAY=1:1:14 S TD=$$GET^DDSVAL(DIE,.DA,DAY+200) S Z=$P($G(^PRST(457.1,+TD,0)),"^",6) S:Z HRS=HRS+Z S Y=$G(^(1)) D VS S:TRG TRS=TRS+1 I STR'="" G V1
24 I FLX="C",TRS>9 S STR="Warning: Compressed Schedule has more than 9 Tours!" D HLP^DDSUTL(.STR)
25 I NH'=HRS,NH'=112 S STR="Warning: Normal Hours are "_NH_"; Tour Hours are "_HRS D HLP^DDSUTL(.STR)
26 Q
27V1 S (DDSERROR,PRSAERR)=1 D HLP^DDSUTL(.STR) Q
Note: See TracBrowser for help on using the repository browser.