Changeset 636 for FOIAVistA/tag/r/PAID-PRS/PRSATE0.m
- Timestamp:
- Dec 4, 2009, 8:26:01 PM (14 years ago)
- Location:
- FOIAVistA/tag/r
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
FOIAVistA/tag/r/PAID-PRS/PRSATE0.m
r628 r636 1 1 PRSATE0 ; HISC/REL-Edit Variable Tours ;5/30/95 14:37 2 ;;4.0;PAID;**112**;Sep 21, 1995;Build 54 3 ;;Per VHA Directive 2004-038, this routine should not be modified. 2 ;;4.0;PAID;;Sep 21, 1995 4 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) 5 K KS ^PRST(458,PPI,"E",DFN,"T")=TOLD D DT^PRSATE24 S ^PRST(458,PPI,"E",DFN,"T")=TOLD D DT^PRSATE2 6 5 K DDSFILE,DA,DR,PRSAERR S DDSFILE=458,DDSFILE(1)=458.01,DA(1)=PPI,DA=DFN 7 6 S DR="[PRSA TE EDIT]" D ^DDS K DS Q:$D(PRSAERR) … … 9 8 I '$D(^PRST(458,PPI,"E",DFN,"D",0)) S ^(0)="^458.02^14^14" 10 9 F DAY=1:1:14 S TD=$P(TNEW,"^",DAY) I TD>0 D S1 11 K TNEW,TOLDQ10 Q 12 11 S1 ; Set Tour if necessary 13 12 I TD=$P(TOLD,"^",DAY),$G(^PRST(457.1,+TD,1))=$G(^PRST(457.1,+$P(TOLD,"^",DAY),1)) Q … … 21 20 Q 22 21 VAL ; Validate Tour 23 N NAWS,SNAWS,TDT S (ZENT,STR)="" K PRSAERR D OT^PRSATP S DB=$P(C0,U,10) I "KM"[PP,DB=1,NH=72 S NAWS=1 24 S (HRS,TRS,TDT)=0 F DAY=1:1:14 D I STR'="" G V1 25 .S TD=$$GET^DDSVAL(DIE,.DA,DAY+200),Z=$P($G(^PRST(457.1,+TD,0)),"^",6) S:Z HRS=HRS+Z S Y=$G(^(1)) 26 .I DAY=7!(DAY=14)&'TDT S TDT=$P($G(^PRST(457.1,+TD,0)),U,5)="Y" 27 .I $D(NAWS) S:Z'=12&Z NAWS=0 S $P(SNAWS,U,DAY)=TD I Z=12 S NAWS(DAY-1\7+1)=$G(NAWS(DAY-1\7+1))+1 28 .D VS S:TRG TRS=TRS+1 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 29 24 I FLX="C",TRS>9 S STR="Warning: Compressed Schedule has more than 9 Tours!" D HLP^DDSUTL(.STR) 30 25 I NH'=HRS,NH'=112 S STR="Warning: Normal Hours are "_NH_"; Tour Hours are "_HRS D HLP^DDSUTL(.STR) 31 I $D(NAWS) D 32 .I $G(NAWS(1))'=3!($G(NAWS(2))'=3)!'NAWS S STR=$P($T(NAWS1),";",3) D HLP^DDSUTL(.STR) 33 .D TOURHRS^PRSARC07(.HRS,PPI,DFN,SNAWS) 34 .I $G(HRS("W1"))'=36!($G(HRS("W2"))'=36) S STR=$P($T(NAWS2),";",3) D HLP^DDSUTL(.STR) 35 .I $G(TDT) S STR=$P($T(NAWS3),";",3) D HLP^DDSUTL(.STR) 36 K K,STR,TRG,TRS Q 37 V1 S (DDSERROR,PRSAERR)=1 D HLP^DDSUTL(.STR) K DDSERROR Q 38 NAWS1 ;;Warning: There are not three 12 hour tours in week 1 and/or week 2 for this AWS 36/40 Nurse 39 NAWS2 ;;Warning: Hours in week 1 and/or week 2 are not 36 for this AWS 36/40 Nurse. 40 NAWS3 ;;Warning: Tour overlaps two administrative work weeks for this 36/40 Nurse. 26 Q 27 V1 S (DDSERROR,PRSAERR)=1 D HLP^DDSUTL(.STR) Q
Note:
See TracChangeset
for help on using the changeset viewer.