source: FOIAVistA/trunk/r/PHARMACY_DATA_MANAGEMENT-PSS/PSSJSPU0.m@ 794

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

initial load of FOIAVistA 6/30/08 version

File size: 859 bytes
Line 
1PSSJSPU0 ;BIR/CML3,WRT-SCHEDULE PROCESSOR UTILITY CONT. ; 06/24/96 9:22
2 ;;1.0;PHARMACY DATA MANAGEMENT;;9/30/97
3 ;
4ENDSD ; calculate default start date
5 N %,%H,%I,ET,FT,LT,NT,X,X1,X2,Y D NOW^%DTC
6 I $S(PSJTS="O":1,'PSJAT:1,PSJSCH="NOW":1,PSJSCH="STAT":1,PSJSCH="ONCE":1,PSJSCH="ONE-TIME":1,PSJSCH="ONE TIME":1,1:PSJSCH="ON CALL") S PSJX=$E(%,1,10)+($E(%,11,12)>30/100) Q:$P(PSJX,".",2) S X1=PSJX_.24,X2=-1 D C^%DTC S PSJX=X Q
7 S NT=%#1,FT="."_$P(PSJAT,"-"),LT="."_$P(PSJAT,"-",$L(PSJAT,"-"))
8 I FT=LT S ET=FT,X2=$S(NT>FT:FT+.24-NT<(NT-FT),1:$S(NT+.24-FT<(FT-NT):-1,1:0)) G SADD
9 I NT>LT S ET=$S(FT+.24-NT<(NT-LT):FT,1:LT),X2=ET=FT G SADD
10 I NT<FT S ET=$S(NT+.24-LT<(FT-NT):LT,1:FT),X2=$S(ET=LT:-1,1:0)
11 E S LT=1,X2=0 F F=1:1 S FT="."_$P(PSJAT,"-",F) Q:'FT S TT=FT-NT S:TT<0 TT=-TT S:TT<LT ET=FT,LT=TT
12SADD ;
13 S (X,X1)=$P(%,".") D:X2 C^%DTC S PSJX=X_ET
14 Q
Note: See TracBrowser for help on using the repository browser.