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

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

initial load of WorldVistAEHR

File size: 2.9 KB
RevLine 
[613]1%ZISG3 ;SFISC/AC -- Device Handler Prototype
2 ;;8.0T3
3B2 ;VADIMS M@WAPI/KWAPI INTERFACE
4 I '@XGWIN@("ZISGTRM","G","SUBTYPE","VISIBLE") D
5 .S SUB=@XGWIN@("ZISGTRM","G","SUB","VALUE")
6 .I SUB]"" D
7 ..S ITEM=$$SUBITEM(SUB)
8 ..I ITEM]"" D
9 ...D S^XG("ZISGTRM","G","SUBTYPE","VALUE",ITEM,"")
10 ...D S^XG("ZISGTRM","G","SUBTYPE","TOPSHOW",ITEM)
11 .;S ^$W("ZISGTRM","G","MARGIN","ACTIVE")=0
12 .D S^XG("ZISGTRM","G","SUBTYPE","VISIBLE",1)
13 E D
14 .D S^XG("ZISGTRM","G","SUBTYPE","VISIBLE",0)
15 .;S ^$W("ZISGTRM","G","MARGIN","ACTIVE")=1
16 .S ITEM=$O(@XGWIN@("ZISGTRM","G","SUBTYPE","VALUE",""))
17 .I ITEM D S^XG("ZISGTRM","G","SUB","VALUE",@XGWIN@("ZISGTRM","G","SUBTYPE","CHOICE",ITEM))
18 I $D(^$EVENT("ELEMENT")),^$EVENT("ELEMENT")["SUBTYPE" D
19 .N SUB
20 .S SUB=@XGWIN@("ZISGTRM","G","SUBTYPE","CHOICE",ITEM)
21 .D SUBCHG(SUB)
22 Q
23SUB ; Callback for SUB item
24 S SUB=^$W("ZISGTRM","G","SUB","VALUE")
25 I SUB]"" D D SUBCHG(SUB)
26 .N %,%1
27 .K ^$W("ZISGTRM","G","SUBTYPE","VALUE")
28 .F %=1:1 Q:'$D(^$W("ZISGTRM","G","SUBTYPE","CHOICE",%))!(SUB="") D
29 ..S %1=^$W("ZISGTRM","G","SUBTYPE","CHOICE",%)
30 ..I %1=SUB S ^$W("ZISGTRM","G","SUBTYPE","VALUE",%)="" S SUB="" Q
31 ..I %1]SUB S ^$W("ZISGTRM","G","SUBTYPE","TOPSHOW")=% S SUB="" Q
32 Q
33SUBITEM(X) ;
34 N %,%1,Y S Y=""
35 .F %=1:1 Q:'$D(^$W("ZISGTRM","G","SUBTYPE","CHOICE",%))!(X="") D
36 .S %1=^$W("ZISGTRM","G","SUBTYPE","CHOICE",%)
37 .I %1=X!(%1]X S Y=% S X="" Q
38 Q Y
39SUBCHG(X) ;Change in subtype
40 ;This sub-routine triggers appropriate values to the
41 ;relevant MWAPI fields(MARGIN and PAGE LENGTH).
42 W !,"SUBCHG(X) has been called!!!"
43 N %,RM,SL Q:$G(X)=""
44 S %=$O(^%ZIS(2,"B",X,0)) Q:%'>0
45 I '($D(^%ZIS(2,+%,0))#2) Q
46 W !,"X==>>"_X
47 Q:$P($G(^(0)),"^")'=X
48 S RM=$P($G(^(1)),"^"),SL=$P($G(^(1)),"^",3)
49 W !,"RM==>>"_RM
50 I RM=80!(RM=132!(RM=255)) D
51 .W !,"SETTING VALUE INTO ZMARGIN"
52 .S ^$W("ZISGTRM","G","ZMARGIN","VALUE")=$S(RM=80:1,RM=132:2,RM=255:3,1:4)
53 .W !,"SETTING MARGINVAL TO INACTIVE"
54 .S ^$W("ZISGTRM","G","MARGINVAL","ACTIVE")=0
55 E D
56 .S ^$W("ZISGTRM","G","ZMARGIN","VALUE")=4
57 .S ^$W("ZISGTRM","G","MARGINVAL","ACTIVE")=1
58 S ^$W("ZISGTRM","G","MARGINVAL","VALUE")=RM
59 I SL=24!(SL=66!(SL=88!(SL=96))) D
60 .S ^$W("ZISGTRM","G","ZPAGELENGTH","VALUE")=$S(SL=24:1,SL=66:2,SL=88:3,SL=96:4,1:5)
61 .S ^$W("ZISGTRM","G","PAGELENGTHVAL","ACTIVE")=0
62 E D
63 .S ^$W("ZISGTRM","G","ZPAGELENGTH","VALUE")=5
64 .S ^$W("ZISGTRM","G","PAGELENGTHVAL","ACTIVE")=1
65 S ^$W("ZISGTRM","G","PAGELENGTHVAL","VALUE")=SL
66 Q
67CHGRAD ;CHANGE IN MARGIN
68 N REF
69 ;S REF="^$W("""_^$EVENT("WINDOW")_""",""G"")"
70 ;S REF=@XGWIN_"("""_@XGEVENT@("WINDOW")_""",""G"")"
71 S REF=XGWIN_"("""_@XGEVENT@("WINDOW")_""",""G"")"
72 ;S GADGET=$P(^$EVENT("ELEMENT"),",",2)
73 S GADGET=$P(@XGEVENT@("ELEMENT"),",",2)
74 S ITEM=@REF@(GADGET,"VALUE")
75 S VALUE=@REF@(GADGET,"CHOICE",ITEM)
76 S GADVAL=$E(GADGET,2,$L(GADGET))_"VAL"
77 I VALUE="OTHER" D
78 .S @REF@(GADVAL,"ACTIVE")=1
79 E D
80 .S @REF@(GADVAL,"VALUE")=VALUE
81 .S @REF@(GADVAL,"ACTIVE")=0
82 ;S ^$W("ZISGTRM","G","MARGINVAL","VALUE")=^$EVENT("CHOICE")
83 Q
Note: See TracBrowser for help on using the repository browser.