source: WorldVistAEHR/trunk/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSJSPU0.m@ 1742

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

initial load of WorldVistAEHR

File size: 861 bytes
Line 
1PSJSPU0 ;BIR/CML3-SCHEDULE PROCESSOR UTILITY CONT. ;16 DEC 97 / 1:43 PM
2 ;;5.0; INPATIENT MEDICATIONS ;;16 DEC 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.