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/ZIS3.m@ 1713

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

initial load of FOIAVistA 6/30/08 version

File size: 3.5 KB
Line 
1%ZIS3 ;SFISC/AC,RWF -- DEVICE HANDLER(DEVICE TYPES & PARAMETERS) ;1/24/08 13:18
2 ;;8.0;KERNEL;**18,36,69,104,391,440**;JUL 10, 1995;Build 13
3 ;Per VHA Directive 2004-038, this routine should not be modified
4 ;Call with a Go from ^%ZIS2
5 I %ZIS'["T",$G(^%ZIS(1,+%E,"POX"))]"" D XPOX^ZISX(%E) ;Pre-Open
6 I $D(%ZISQUIT) S POP=1 K %ZISQUIT
7 S %ZISCHK=1
8 ;I 'POP&(%ZISB)&(%ZTYPE'="RES")&(%ZTYPE'="OTH")&(%ZTYPE'="SDP")&(IO'["::") D DEVOK
9 ;See if need to lock.
10 K %ZISLOCK
11 I %ZIS'["T",+$G(^%ZIS(1,+%E,"GBL")) S %ZISLOCK=$NA(^%ZIS("lock",IO))
12 ;
13 I 'POP G TRM:(%ZTYPE["TRM"),@(%ZTYPE_"^%ZIS6") ;Jump to next part
14 ;
15Q ;%ZIS6 Returns here
16 ;See if need to un-lock.
17 I $D(%ZISUOUT) K %ZISUOUT,%ZISHP,%ZISHPOP Q
18 I $D(%ZISHPOP)&$S(IO="":1,1:'$D(IO(1,IO))) D HGBSY^%ZIS2 Q
19 I POP S:%ZIS'["T" IO="" I $D(%ZISHG(0)),%ZIS'["D",'$D(%ZISHPOP) G HUNT^%ZIS2
20 Q ;Return to %ZIS1
21 ;
22VTRM ;Virtual terminal type
23TRM ;D OPEN^%ZIS4:'POP&(%ZISB&(%ZIS'["T")),MARGN:'POP,SETPAR:'POP ;Terminal type
24 D MARGN:'POP,SETPAR:'POP ;Terminal type// TEST CHANGE
25 I 'POP,%ZIS'["T",%ZISB=1,'$D(IOP),IO'=IO(0),'$D(IO("Q")),%ZIS["Q" D AQUE
26 W:'$D(IOP) !
27 I '$D(IO("Q")),'POP,%ZISB,%ZIS'["T" D O^%ZIS4
28 G Q
29DEVOK N X,Y,X1 ;Not sure this is needed
30 S X=IO,X1=%ZTYPE
31 D DEVOK^%ZOSV I Y=-99!(Y=0)!(Y=$J) Q
32 I Y>0 S POP=1 W:'$D(IOP)&('$D(%ZISHG(0))!(%IS["D")) !,$C(7),"[Device Unavailable]" Q
33 I Y=-1 S IO="",POP=1 W:'$D(IOP)&('$D(ZISHG(0))!(%IS["D")) !,$C(7),"[Device does not Exist or Unavailable]" Q
34 Q
35 ;
36MARGN ;Get the margin and page length
37 S %A=$P(%Y,";",1)
38 I %A?1A.ANP D SUBIEN(.%A,1) I $D(^%ZIS(2,%A,1)) K %Z91 D ST(1) S %Y=$P(%Y,";",2,9),%ZISMY=$P(%ZISMY,";",2,9) G MARGN
39 I %A>3 S $P(%Z91,"^")=$S(%A>255:255,1:+%A)
40 I $P(%Y,";",2) S $P(%Z91,"^",3)=+$S($P(%Y,";",2)>65530:65530,1:$P(%Y,";",2)) ;Cache fix for $Y#65535 wrap
41 ;
42ALTP I '$D(IO("P")) Q:%A>3 G ASKMAR:%ZTYPE["TRM" Q
43 S %X=$F(IO("P"),"M") I %X S %A=+$E(IO("P"),%X,99),$P(%Z91,"^")=$S(%A>255:255,1:%A)
44 S %X=$F(IO("P"),"L") I %X S $P(%Z91,"^",3)=+$E(IO("P"),%X,99)
45 Q:%A>3!(%ZTYPE'["TRM")
46ASKMAR I %IS["M",'$D(IOP),$S(%E=%H:+$P(%Z,"^",3),1:1),$P(%Z,"^",4) W " Right Margin: " W:$P(%Z91,"^")]"" +%Z91,"// "
47 E Q
48 D SBR^%ZIS1 I '$D(DTOUT)&'$D(DUOUT) S:%X=""&($P(%Z91,"^")]"") %X=+%Z91 G ASKMAR:%X'?1.N S $P(%Z91,"^")=$S(%X>255:255,1:%X) Q
49 S POP=1 I %ZISB&(%ZTYPE["TRM")&(IO'=IO(0)) C IO K IO(1,IO) Q
50 Q
51SETPAR S:$L(%ZISOPAR)&($E(%ZISOPAR)'="(") %ZISOPAR="("_%ZISOPAR_")"
52 Q
53AQUE ;Ask about Queueing
54 W ! S %=$S($D(IO("Q")):1,1:2),U="^",%ZISDTIM=60
55 I $D(IO("Q")) W !,"Previously, you have selected queueing."
56 W !,"Do you "_$S($D(IO("Q")):"STILL ",1:"")_"want your output QUEUED"
57 D YN^%ZIS1 K %ZISDTIM G AQUE:%=0 Q:$D(IO("Q"))
58 I %=-1 S POP=1,%ZISHPOP=1,%ZISUOUT=1 C IO K IO(1,IO) Q
59 I %=1 S IO("Q")=1 C IO K IO(1,IO) Q
60 ;I %=2 K IO("Q")
61 Q
62ST(%ZISTP) ;
63 S %ZISIOST(0)=%A,%ZISIOST=$P($G(^%ZIS(2,%A,0)),"^")
64 S:'$D(%Z91) %Z91=$P($G(^%ZIS(2,%A,1),"132^#^60^$C(8)"),"^",1,4),$P(%Z91,"^",5)=$G(^("XY"))
65 Q:%ZISTP
66STP N %B ;%E is a pointer to the Device file
67 S %B=$G(^%ZIS(1,%E,91))
68 S:$P(%B,"^")]"" $P(%Z91,"^")=+%B S:$P(%B,"^",3)]"" $P(%Z91,"^",3)=$P(%B,"^",3) ;S $P(%Z91,"^",5)=$G(^%ZIS(2,%ZISIOST(0),"XY"))
69 Q
70SUBIEN(%1,%) ;Return Subtype ien. %1 is call by Ref.
71 N %XX,%YY
72 I $D(^%ZIS(2,"B",%1))>9 S %1=+$O(^%ZIS(2,"B",%1,0)) Q
73 I '$G(%) S X="" Q
74 S %XX=%1 D 2^%ZIS5 S %1=+%YY
75 Q
76SUBTYPE(%A) ;Called from %ZISH
77 N %ZISIOST,%Z91
78 S:$G(%A)="" %A="P-OTHER"
79 D SUBIEN(.%A),ST(1)
80 S IOM=$P(%Z91,U,1),IOF=$P(%Z91,U,2),IOSL=$P(%Z91,U,3),IOST=%ZISIOST,IOST(0)=%ZISIOST(0),IOBS="$C(8)"
81 S:IOST="" IOST="P-OTHER",IOST(0)=0
82 Q
Note: See TracBrowser for help on using the repository browser.