source: FOIAVistA/trunk/r/KERNEL-XU-A4A7-USC-XG-XLF-XNOA-XPD-XQ-XVIR-ZI-ZOSF-ZOSV-ZT-ZU-%Z-XIP--XQAB--XUC--XUR--ZIN--ZTED/_ZIS2.m@ 1742

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

initial load of FOIAVistA 6/30/08 version

File size: 4.5 KB
Line 
1%ZIS2 ;SFISC/AC,RWF -- DEVICE HANDLER (CHECKS) ;1/24/08 16:07
2 ;;8.0;KERNEL;**69,104,112,118,136,241,440**;JUL 10, 1995;Build 13
3 ;Per VHA Directive 2004-038, this routine should not be modified
4HUNT S:'$D(%ZISHP) %ZISHP=%E,%ZISHGL=0 S %E=0
5 F S %ZISHGL=$O(^%ZIS(1,%ZISHG(0),"HG",%ZISHGL)) Q:%ZISHGL'>0 D Q:%E
6 . N %1,%2 S %1=$G(^%ZIS(1,%ZISHG(0),"HG",+%ZISHGL,0)),%2=$G(^%ZIS(1,+%1,0))
7 . ;Check that HG device is on same VOL.
8 . I $P(%2,"^",9)=%ZISV!($P(%2,"^",9)="") S %E=+$P(^%ZIS(1,%ZISHG(0),"HG",+%ZISHGL,0),"^")
9 . Q
10 G L2:%ZISHGL>0 S %ZISHPOP=1,%E=%ZISHP
11 ;
12L2 ;Entry point from %ZIS1
13 I $D(DTOUT)!$D(DUOUT) K %ZISHP,%ZISHPOP Q
14CHECK ;Get IO check for secondary $I
15 K %ZISCPU N %Z2
16 S POP=0,%Z=^%ZIS(1,%E,0),%Z2=$S(%ZIS("PRI")=1:"",1:$G(^%ZIS(1,%E,2))) ;Get Primary and secondary IO.
17 S IO=$S(%ZIS("PRI")=1:$P(%Z,"^",2),$L($P(%Z2,"^")):$P(%Z2,"^"),1:$P(%Z,"^",2)) ;
18 S:%IS["Q"&'$D(ZTQUEUED)&($P(%Z,"^",12)=1!$D(XQNOGO)) %ZISB=0,IO("Q")=1 ;Forced Queueing
19 I $P(%Z,"^",12)=2 S %IS=$TR(%IS,"Q") I $D(IO("Q")) D Q
20 . I '$D(IOP) W !,"Queuing NOT ALLOWED on this device"
21 . S POP=1 K:$D(IOP) IO("Q") Q
22 S %Z90=$G(^(90)),%Z95=$G(^(95)),%ZTIME=$G(^("TIME")),%ZTYPE=$G(^("TYPE")),%ZISHG=$O(^%ZIS(1,"AHG",%E,0))
23 I %ZISHG,$D(^%ZIS(1,+%ZISHG,0)) S:'$D(%ZISHG(0)) %ZISHG(0)=+%ZISHG S %ZISHG=$P(^(0),"^",1)
24 E S %ZISHG=""
25 I %ZTYPE="HG" D OTHCPU("HUNT GROUP") G T:$D(%ZISHG(0))!POP
26 I %ZTYPE="RES" S %ZISRL=+$P(%Z1,"^",10) G T
27VTRM I %ZTYPE="VTRM",'('$D(IO("Q"))&(%A=%H)) W:'$D(IOP)&'$D(%ZISHP) *7," [YOU CAN NOT SELECT A VIRTUAL TERMINAL]" S POP=1 ;Virtual Terminal Check
28 S:%ZTYPE="VTRM"&'$D(IO("Q"))&(%A=%H) IO=$I
29 ;
30SLAVE I $D(IO("Q")),$P(%Z,"^",2)=0,$P(%Z,"^",8)']"" W:'$D(IOP) *7,!?10," [SLAVE device NOT set up for queuing]" S POP=1 G T
31OCPU D OTHCPU("DEVICE")
32 ;
33OOS G T:POP I %Z90,$D(DT)#2,%Z90'>DT S POP=1 ;Out Of Service Check
34 I $T,'$D(IOP),'$D(%ZISHP) W *7," [Out of Service]" ;I 'POP W " ..OK" S %=2,U="^" D YN^%ZIS1 G:%=0 OOS S:%'=1 POP=1
35 ;
36PTIME G T:POP!(IO=$I)!(IO=0)
37 ;Prohibitted Time Check
38 S %A=$P(%ZTIME,"^") I %ZISB,$L(%A) D I POP,'$D(IOP),'$D(%ZISHP) W *7," [ACCESS PROHIBITED "_%A_"]" ;AT THIS TIME]"
39 . N %C,%L,%H ;%C is current time, %L is lower limit, %H is upper limit
40 . S %C=$P($H,",",2),%C=%C\60#60+(%C\3600*100),%H=$P(%A,"-",2),%L=+%A
41 . I $S(%H'<%L:(%C'>%H&(%C'<%L)),1:(%C'<%L!(%C'>%H))) S POP=1
42 . Q
43DUZ I 'POP D SEC ;Security Check
44 ;
45T I POP,$D(%ZISHG(0)),%IS'["D",'$D(%ZISHPOP),%ZISB G HUNT
46 I POP D HGBSY:$D(%ZISHPOP) ;G T2:%IS["T"
47 ;
48TMPVAR K IO("S") S %ZISIOS=%E S:IO=0 IO=$I,IO("S")=%H
49 S %ZISOPAR=$$IOPAR(%E,"IOPAR")
50 S %ZISUPAR=$$IOPAR(%E,"IOUPAR"),%ZISTO=+$P(%ZTIME,"^",2)
51 I $D(IO("S")) D I POP Q
52 . S IO=$S(%IS["S":$P($G(^%ZIS(1,+$P(%Z,"^",8),0)),"^",2),1:IO)
53 . I %IS["S",IO]"" S %H=+$P(%Z,"^",8),IO("S")=%H,IO(0)=IO
54 . S IO("S")=$S($G(^XUTL("XQ",$J,"IOST(0)")):^("IOST(0)"),1:$G(^%ZIS(1,%H,"SUBTYPE")))
55 . S:IO="" POP=1
56 . Q
57 S %A=+$G(^%ZIS(1,%E,"SUBTYPE")),%ZISTP=0 ;%A is pointer to subtype
58 I %E=%H,%ZTYPE["TRM" D I 1
59 . I $D(^XUTL("XQ",$J,"IOST(0)")) D ;Use home
60 . . S %A=+^XUTL("XQ",$J,"IOST(0)"),%Z91="",%ZISTP=1
61 . . F %ZISI="IOM","IOF","IOSL","IOBS","IOXY" S %Z91=%Z91_$G(^XUTL("XQ",$J,%ZISI))_"^"
62 . E S %=$$LNPRTSUB^%ZISUTL I %>0 S %A=%,%Z91=""
63 E S %Z91=$P($G(^%ZIS(2,%A,1)),"^",1,4),$P(%Z91,"^",5)=$G(^("XY"))
64 ;I $D(%Z91),%Z91'?1.4"^" ;$P(%Z91,"^")]"",$P(%Z91,"^",2)]"",$P(%Z91,"^",3),$P(%Z91,"^",4)]""
65 D ST^%ZIS3(%ZISTP) S:%IS["U" USIO=$P(%Z91,"^",1,4)
66T2 I POP S:%IS'["T" IO="" Q
67 G ^%ZIS3:"^MTRM^VTRM^TRM^SPL^MT^SDP^HFS^RES^OTH^BAR^HG^IMPC^CHAN^"[("^"_%ZTYPE_"^") ;Jump to next part
68 S POP=1 Q
69 ;
70HGBSY S POP=1 S:%IS'["T" IO="" K %ZISHP,%ZISHPOP Q:$D(IOP)
71 W:$X>38 !,?5 W *7," All devices in hunt group "_%ZISHG_" are busy!" Q
72 ;
73OTHCPU(%1) ;%1 should be either DEVICE or HUNT GROUP
74 N %2,X,Y,%ZISMSG S %ZISMSG=0
75 F %2="CPU","VOLUME SET" D
76 .I %2="VOLUME SET" S X=$P($P(%Z,"^",9),":"),Y=%ZISV
77 .E D GETENV^%ZOSV S X=$P($P(%Z,"^",9),":",2),Y=$P($P(Y,"^",4),":",2)
78 .I X=Y!(X="") Q:%1="DEVICE" D Q ;Other Vol Set/Cpu Check
79 ..S %ZISHG(0)=%E,%ZISHG=$P(%Z,"^")
80 ..I %ZISB S POP=1
81 ..E S IO=" "
82 .I %2="VOLUME SET" S $P(%ZISCPU,":")=X
83 .E S $P(%ZISCPU,":",2)=X
84 .I %1="HUNT GROUP" K %ZISHG(0)
85 .I %IS["Q" S IO("Q")=1,%ZISB=0 S:%1="HUNT GROUP" IO=" "
86 .E I %ZISB&(%ZTYPE="TRM"&($D(%ZISHG(0))&(%IS'["D"))) S POP=1
87 .E W:'$D(IOP)&'%ZISMSG *7," ["_%1_" is on another "_%2_" ('"_X_"')]",! S POP=1,%ZISMSG=1
88 Q
89IOPAR(%DA,%N) ;Return I/O parameters
90 Q $S($G(%ZIS(%N))]"":%ZIS(%N),1:$G(^%ZIS(1,%DA,%N)))
91 ;
92SEC I %Z95]"" S %X=$G(DUZ(0)) I %X'="@" S POP=1 F %A=1:1:$L(%X) I %Z95[$E(%X,%A) S POP=0 Q
93 I POP,'$D(IOP),'$D(%ZISHP) W *7," [Access Prohibited]"
94 Q
Note: See TracBrowser for help on using the repository browser.