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

BLRLABJD.m

Go to the documentation of this file.
  1. BLRLABJD ;IHS/MSC/MKK - Display Lab Job(s) (including HLZTCP) detail, if running; 17-Oct-2014 09:22 ; MKK
  1. ;;5.2;IHS LABORATORY;**1034**;NOV 01, 1997;Build 88
  1. ;
  1. EEP ; EP - Ersatz EP
  1. D EEP^BLRGMENU
  1. Q
  1. ;
  1. EP ; EP
  1. PEP ; EP
  1. NEW (DILOCKTM,DISYS,DT,DTIME,DUZ,IO,IOBS,IOF,IOM,ION,IOS,IOSL,IOST,IOT,IOXY,U,XPARSYS,XQXFLG)
  1. ;
  1. D BLRHLZTI
  1. ;
  1. F Q:'RSET.Next() D BLRHLZTL
  1. ;
  1. W !!,?4,CNTJOBS," Jobs analyzed."
  1. W !!,?9,$S(CNT<1:"No",1:CNT)," Lab Job"_$S(CNT>1:"s.",1:".")
  1. W !!,?14,$S(CNTTCP<1:"No HLZTCP Jobs found on the system.",1:CNTTCP_" HLZTCP Job"_$S(CNTTCP>1:"s.",1:"."))
  1. D PRESSKEY^BLRGMENU(4)
  1. Q
  1. ;
  1. BLRHLZTI ; EP -- Initialization
  1. S BLRVERN=$$TRIM^XLFSTR($P($T(+1),";"),"LR"," ")
  1. ;
  1. ; The following line of code will determine the MAJOR version of
  1. ; Cache that is running. If it's > 2007, then it's known
  1. ; that the %SYSTEM.Process class has been superseded by the
  1. ; %SYS.ProcessQuery class.
  1. S WOTSYS=$system.Version.GetMajor()
  1. ;
  1. S:WOTSYS<2008 SYSCALL="##class(%SYSTEM.Process).%OpenId(PID)."
  1. S:WOTSYS>2007 SYSCALL="##class(%SYS.ProcessQuery).%OpenId(PID)."
  1. ;
  1. S DEFUCI=$NAMESPACE
  1. ;
  1. S HEADER(1)="Lab Job Processes"
  1. S HEADER(2)=" "
  1. D HEADERDT^BLRGMENU
  1. W ?4,"Job Analysis"
  1. ;
  1. S (CNT,CNTJOBS,CNTTCP)=0
  1. ;
  1. S RSET=##class(%ResultSet).%New("%SYS.ProcessQuery:ListPids")
  1. D RSET.Execute()
  1. ;
  1. Q
  1. ;
  1. RESTHEAD ; EP - Rest of HEADER array
  1. S HEADER(3)="PID/User"
  1. S $E(HEADER(3),10)="Routine"
  1. S $E(HEADER(3),20)="Port #"
  1. S $E(HEADER(3),28)="IP Address"
  1. S $E(HEADER(3),44)="UCI"
  1. ;
  1. D HEADERDT^BLRGMENU
  1. Q
  1. ;
  1. BLRHLZTL ; EP - Line of Data
  1. S PID=RSET.GetData(1)
  1. Q:PID<1
  1. ;
  1. S CNTJOBS=CNTJOBS+1
  1. ;
  1. I CNT<1 W "." I $X>74 W !,?4
  1. ;
  1. S RTN=$$GETSYS("Routine")
  1. Q:RTN'["HLZTCP"&($E(RTN,1,3)'="BLR")&($E(RTN,1,2)'="LA")&($E(RTN,1,3)'="LR")
  1. ;
  1. S:RTN["HLZTCP" CNTTCP=CNTTCP+1
  1. ;
  1. D JOBVBRKO
  1. ;
  1. D:CNT<1 RESTHEAD
  1. ;
  1. W PID
  1. W ?9,$E(RTN,1,8)
  1. W ?19,$E($G(PORT),1,6)
  1. W ?27,$E($G(IPADDR),1,17)
  1. W ?43,$G(UCI)
  1. W !
  1. S LINES=LINES+1
  1. S CNT=CNT+1
  1. ;
  1. Q
  1. ;
  1. GETSYS(WOTDETAIL) ; EP -- Get System Information
  1. S GETWOT=SYSCALL_WOTDETAIL_"Get()"
  1. Q @GETWOT
  1. ;
  1. JOBVBRKO ; EP -- JOB Variables BReaKOut
  1. D JOBVBRKS
  1. ;
  1. S PORT=$P(PORT,"|",3)
  1. S:$P(PORT,":",2)'="" PORT=$P(PORT,":",2)
  1. ;
  1. S LOOKHERE="NO"
  1. S:RTN="HLZTCP" LOOKHERE="YES",HLZTCPCNT=1+$G(HLZTCPCNT)
  1. Q
  1. ;
  1. JOBVBRKS ; EP -- JOB Variables BReaKOut -- System variables
  1. S UCI=$$GETSYS("NameSpace")
  1. S IPADDR=$$GETSYS("ClientIPAddress")
  1. S PORT=$$GETSYS("CurrentDevice")
  1. S USERNAME=$$GETSYS("UserName")
  1. S USERNAME=$S(USERNAME="SYSTEM":"",USERNAME=UCI:"",1:USERNAME)
  1. Q