Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PSGCT

PSGCT.m

Go to the documentation of this file.
PSGCT ;BIR/CML3-ADD OR SUBTRACT MINUTES FROM A DATE/TIME ;16 DEC 97 / 1:36 PM 
 ;;5.0; INPATIENT MEDICATIONS ;;16 DEC 97
 ;
EN(ST,AM) ;
 ; ST=start date/time   AM=minutes (+ or -)  X=new date/time
 N H,HRS,M,MN,T,X,X1,X2
 S:'AM X=ST Q:'AM X  S T=1 S:AM<0 T=-1,AM=-AM S X2=AM\1440,AM=AM-(X2*1440),H=AM\60,M=AM#60,HRS=+$E(ST_"0000",9,10),MN=+$E(ST_"0000",11,12),X=$P(ST,".")
 I M S MN=MN+(M*T) S:MN>59 MN=MN-60,H=H+1 S:MN<0 MN=MN+60,H=H+1
 S:H HRS=HRS+(H*T) S:HRS>24!(HRS=24&MN) HRS=HRS-24,X2=X2+1 S:HRS<0 HRS=HRS+24,X2=X2+1
 I X2 S X1=X,X2=X2*T D C^%DTC
 S X=+(X_"."_$E(0,HRS<10)_HRS_$E(0,MN<10)_MN) Q X