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

DINVONT.m

Go to the documentation of this file.
  1. %ZOSV ;SFISC/AC - $View commands for Open M for NT. ;2015-01-02 4:31 PM
  1. ;;22.2;VA FileMan;;Jan 05, 2016;Build 42
  1. ;;Per VA Directive 6402, this routine should not be modified.
  1. ;;Submitted to OSEHRA 5 January 2015 by the VISTA Expertise Network.
  1. ;;Based on Medsphere Systems Corporation's MSC FileMan 1051.
  1. ;;Licensed under the terms of the Apache License, Version 2.0.
  1. ;
  1. ACTJ() ;# Active jobs
  1. N Y,% S %=0 F Y=0:1 S %=$ZJ(%) Q:%=""
  1. Q Y
  1. AVJ() ;# available jobs
  1. ;Return fixed value if version < 2.1.6 (e.i. not Cache)
  1. N V S V=$$VERSION($ZV) I 216>$TR(V,".") Q 15 ;
  1. N MAXPID S MAXPID=$V($ZU(40,2,118),-2,4) ;from %SS
  1. Q MAXPID-$$ACTJ() ;need ISM to provide maxpid in ^%MACHINE
  1. PRIINQ() ;
  1. Q 8
  1. UCI ;Current UCI
  1. S Y=$ZU(5)_","_^%ZOSF("VOL") Q
  1. ;
  1. UCICHECK(X) ;Check if valid UCI
  1. N Y,%
  1. S %=$P(X,",",1),Y=0 I ##CLASS(%SYS.Namespace).Exists(%) S Y=%
  1. Q Y
  1. JOBPAR ;See if X points to a valid Job. Return its UCI.
  1. N ZJ S Y="",$ZT="JOBX"
  1. Q:'$D(^$JOB(X)) S Y=$V(-1,X),Y=$P(Y,"^",14)_","_^%ZOSF("VOL")
  1. JOBX Q
  1. ;
  1. T0 ; start RT clock
  1. S XRT0=$H Q
  1. T1 ; store RT datum
  1. S ^%ZRTL(3,XRTL,+$H,XRTN,$P($H,",",2))=XRT0 K XRT0 Q
  1. NOLOG ;
  1. S Y="$V(0,-2,4)\4096#2" Q
  1. ;
  1. PROGMODE() ;Check if in PROG mode
  1. Q $ZJ#2
  1. ;
  1. PRGMODE ;
  1. W ! S ZTPAC=$S('$D(^VA(200,+DUZ,.1)):"",1:$P(^(.1),U,5)),XUVOL=^%ZOSF("VOL")
  1. S X="" X ^%ZOSF("EOFF") R:ZTPAC]"" !,"PAC: ",X:60 D LC^XUS X ^%ZOSF("EON") I X'=ZTPAC W "??",*7 Q
  1. S XMB="XUPROGMODE",XMB(1)=DUZ,XMB(2)=$I D ^XMB:$L($T(^XMB)) D BYE^XUSCLEAN K ZTPAC,X,XMB
  1. D UCI S XUCI=Y,XQZ="PRGM^ZUA[MGR]",XUSLNT=1 D DO^%XUCI D ^%PMODE U $I:("":"+B+C+R") S $ZT="" Q
  1. Q
  1. LGR() S $ZT="LGRX^%ZOSV"
  1. Q $ZR ;Last Global ref.
  1. LGRX Q ""
  1. ;
  1. EC() Q $ZE ;Error code
  1. ;
  1. DOLRO ;SAVE ENTIRE SYMBOL TABLE IN LOCATION SPECIFIED BY X
  1. S Y="%" F %=0:0 S Y=$O(@Y) Q:Y="" S %=$D(@Y) S:%#2 @(X_"Y)="_Y) I %>9 S %X=Y_"(",%Y=X_"Y," D %XY^%RCR
  1. Q
  1. ;
  1. ORDER ;SAVE PART OF SYMBOL TABLE IN LOCATION SPECIFIED BY X
  1. S (Y,Y1)=$P(Y,"*",1) I $D(@Y)=0 F %=0:0 S Y=$O(@Y) Q:Y=""!(Y[Y1)
  1. Q:Y="" S %=$D(@Y) S:%#2 @(X_"Y)="_Y) I %>9 S %X=Y_"(",%Y=X_"Y," D %XY^%RCR
  1. F %=0:0 S Y=$O(@Y) Q:Y=""!(Y'[Y1) S %=$D(@Y) S:%#2 @(X_"Y)="_Y) I %>9 S %X=Y_"(",%Y=X_"Y," D %XY^%RCR
  1. K %,X,Y,Y1 Q
  1. ;
  1. PARSIZ ;
  1. S X=3 Q
  1. ;
  1. DEVOPN ;List of Devices opened
  1. ;Returns variable Y. Y=Devices owned separated by a comma
  1. S X=$J
  1. N % S Y=$P($V(-1,$J),"^",3) F %=1:1:$L(Y,",") S $P(Y,",",%)=$P($P(Y,",",%),"*",1)
  1. Q
  1. DEVOK ;
  1. S Y=0,X1=$G(X1) Q:X=2 Q:(X1="HFS")!(X1="MT") G:X1="RES" RES ;Quit w/ OK for HFS, Spool, MT
  1. S $ZT="OPNERR"
  1. O X::$S($D(%ZISTO):%ZISTO,1:0) E S Y=999 Q ;G NOPN
  1. S Y=0 I '$D(%ZISCHK)!$S($D(%ZIS)#2:(%ZIS["T"),1:0) C X Q
  1. S:X]"" IO(1,X)="" Q
  1. Q
  1. NOPN ;
  1. N ZJ S $ZT="NJ"
  1. S ZJ="" F %=0:0 S ZJ=$ZJ(ZJ) Q:'ZJ D NOPN1 Q:'ZJ
  1. Q
  1. NOPN1 S Y=$V(-1,ZJ) I $P(Y,"^",3)[X_","!($P(Y,"^",3)[X_"*,") S Y=ZJ,ZJ="" Q
  1. Q
  1. NJ Q ;NOJOB ERROR
  1. OPNERR S Y=-1 Q
  1. ;
  1. RES S Y=0,%ZISD0=$O(^%ZISL(3.54,"B",X,0))
  1. I '%ZISD0 S Y=-1,%ZISD0=%O(^%ZIS(1,"C",X)) Q:'%ZISD0 Q:'$D(^%ZIS(1,+%ZISD0,0)) Q:$P(^(0),"^")'=X Q:'$D(^("TYPE")) Q:^("TYPE")'="RES" S Y=0 Q
  1. S X1=$S($D(^%ZISL(3.54,+%ZISD0,0)):^(0),1:"")
  1. I $P(X1,"^",2)&(X=$P(X1,"^")) S Y=0 Q
  1. S Y=999 F %ZISD1=0:0 S %ZISD1=$O(^%ZISL(3.54,%ZISD0,1,%ZISD1)) Q:%ZISD1'>0 I $D(^(%ZISD1,0)) S Y=$P(^(0),"^",3) Q
  1. K %ZISD0,%ZISD1
  1. Q
  1. GETENV ;Get environment (UCI^VOL^NODE)
  1. X ^%ZOSF("UCI") S Y=$P(Y,",")_"^"_^%ZOSF("VOL")_"^"_$ZU(110)_"^"_^%ZOSF("VOL")
  1. Q
  1. VERSION(X) ;return OS version, X=1 - return OS
  1. Q $S($G(X):$P($ZV,")")_")",1:$P($P($ZV,") ",2),"("))
  1. ;
  1. SETNM(X) ;Set name, Fall into SETENV
  1. SETENV ;Set environment
  1. Q
  1. ;
  1. HFSREW(IO,IOPAR) ;Rewind Host File.
  1. S $ZT="HFSRWERR"
  1. C IO O @(""""_IO_""""_$S(IOPAR]"":":"_IOPAR_":1",1:":1")) I '$T Q 0
  1. Q 1
  1. HFSRWERR ;Error encountered
  1. Q 0
  1. LOGRSRC(OPT) ;record resource usage in ^XTMP("KMPR"
  1. D RO^%ZOSVKR(OPT)
  1. Q
  1. SETTRM(X) ;Turn on specified terminators.
  1. U $I:(::X)
  1. Q 1