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

ORB3ENV.m

Go to the documentation of this file.
  1. ORB3ENV ; slc/CLA - OE/RR 3 Notifications/Order Check Environment Check Routine ;9/19/01 14:29
  1. ;;3.0;ORDER ENTRY/RESULTS REPORTING;**105**;Dec 17, 1997
  1. EN ; main entry point
  1. D ORMTIME
  1. Q
  1. ORMTIME ; determine if ORMTIME is running
  1. N I,J,STATUS,JOB,OK,LASTDT,NOWDT,DIFFDT,SCHDT,ORY,MSG
  1. S OK=0
  1. D BMES^XPDUTL("Checking to see if ORMTIME is running...")
  1. ;
  1. ;for loop that runs for 12 iterations (60 secs.) - quits if no lock
  1. F I=1:1:12 Q:OK=1 D
  1. .L +^OR(100,"AE"):5 I $T S OK=1 Q
  1. .I I=1 D BMES^XPDUTL("Pausing because ORMTIME is running...")
  1. .E D MES^XPDUTL(".")
  1. ;
  1. I OK=1 LOCK ;^OR(100,"AE"):0
  1. ;
  1. ;if ORMTIME is not currently running see if scheduled in near future:
  1. I OK=1 D
  1. .S LASTDT=$$GET^XPAR("SYS","ORM ORMTIME LAST RUN",1,"I")
  1. .;
  1. .D OPTSTAT^XUTMOPT("ORMTIME RUN",.ORY) ;get option sch info IA# 1472
  1. .F J=1:1:ORY Q:OK=2 D
  1. ..S SCHDT=$P(ORY(J),U,2) ;next scheduled ORMTIME run time
  1. ..S NOWDT=$$NOW^XLFDT
  1. ..S DIFFDT=$$FMDIFF^XLFDT(SCHDT,NOWDT,2)
  1. ..I DIFFDT>0,DIFFDT<300 S OK=2 ;if sched to run in less than 5 minutes
  1. ;
  1. I OK=1 D ;ORMTIME not running
  1. .D BMES^XPDUTL("ORMTIME not running nor scheduled within 5 minutes. Okay to install.")
  1. ;
  1. I OK=0 D ;ORMTIME still running
  1. .D BMES^XPDUTL("ORMTIME is still running...")
  1. .S JOB="",JOB=$O(^TMP("OCXORMTIME",JOB),-1)
  1. .I +$G(JOB)>0,$D(^TMP("OCXORMTIME",JOB,"STATUS")) D
  1. ..S STATUS=^TMP("OCXORMTIME",JOB,"STATUS")
  1. ..D MES^XPDUTL(STATUS)
  1. .D BMES^XPDUTL("*** ABORTING INSTALLATION *** - due to potential conflict with ORMTIME.")
  1. .D MES^XPDUTL("Try installation again after ORMTIME run completes.")
  1. .D MES^XPDUTL("(ORMTIME usually requires less than 10 mintues to run to completion.)")
  1. .S XPDQUIT=2 ;abort installation but leave transport global in ^XTMP
  1. ;
  1. I OK=2 D ;ORMTIME scheduled to run before patch install completes
  1. .S MSG=$$FMTE^XLFDT(SCHDT)
  1. .S MSG="ORMTIME scheduled at: "_MSG_" and may impact patch installation."
  1. .D BMES^XPDUTL(MSG)
  1. .D BMES^XPDUTL("*** ABORTING INSTALLATION *** - due to potential conflict with ORMTIME.")
  1. .D MES^XPDUTL("Try installation again after ORMTIME run completes.")
  1. .D MES^XPDUTL("(ORMTIME usually requires less than 10 mintues to run to completion.)")
  1. .S XPDQUIT=2 ;abort installation but leave transport global in ^XTMP
  1. ;
  1. Q