source: WorldVistAEHR/trunk/r/PCE_PATIENT_CARE_ENCOUNTER-AUTN-EFDP-PX-VSIT--PXRM/PXBCC.m@ 1154

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

initial load of WorldVistAEHR

File size: 6.2 KB
Line 
1PXBCC ;ISL/JVS - CURSOR CONTROLS-UTILITY ROUTINES ;9/10/04 11:33am
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;**7,73,141,124,164**;Aug 12, 1996
3 ;
4 ; Variable List
5 ; PXBSAVE= A Second copy fo the top Margin in a window
6 ; PXBCNT= A Count of how many Items listed in top window
7 ;
8ZERO ;--ZERO $X & $Y
9 N DX,DY
10 S DX=0,DY=0 X ^%ZOSF("XY")
11 Q
12DXDY ;RESET $X $Y
13 X ^%ZOSF("XY")
14 Q
15INHI() ; Switch to highlighted video (IOINHI must be defined by caller)
16 S DX=$X#81,DY=$Y#25 W IOINHI X ^%ZOSF("XY")
17 Q ""
18INLO() ; Switch to lowlighted video (IOINLOW must be defined by caller)
19 S DX=$X#81,DY=$Y#25 W IOINLOW X ^%ZOSF("XY")
20 Q ""
21FIX ;--FIX
22 D TERM,FULL0 W IOUOFF,IOG0
23 Q
24FIX1 ;--FIX
25 D TERM,FULL0 W IOUOFF,IOG0
26 Q
27WINDOW(PXBCNT,DOWN) ;--set up window area
28 N I,IOTM,IOBM
29 I PXBCNT>10 S IOTM=17
30 I PXBCNT<11 S IOTM=PXBCNT+7
31 S PXBSAVE=IOTM I '$D(IOSC) D TERM
32 S IOBM=(IOSL-1)
33 W IOSC W @IOSTBM W IORC ;--Create smaller window
34 I '$D(DOWN) F I=1:1:2 W IOCUD ;-- move cursor down twice
35 S PXBWIN=""
36 Q
37WIN17(PXBCNT) ;--set up window area on the 17th line
38 N I,IOTM,IOBM
39 W IOCUOFF
40 S IOTM=17
41 S PXBSAVE=IOTM I '$D(IOSC) D TERM
42 S IOBM=(IOSL-0)
43 W IOSC W @IOSTBM W IORC ;--Create smaller window
44 S PXBWIN=""
45 W IOCUON
46 Q
47 ;
48WINDOW1(PXBCNT) ;--set up window area
49 N I,IOTM,IOBM
50 S IOBM=IOSL-1
51 W IOSC W @IOSTBM W IORC ;--Create smaller window
52 F I=1:1:2 W IOCUD ;-- move currsor down once
53 Q
54 ;
55TERM ;--set up the terminal variables
56 N X
57 S X="IOSGRO;IOSTBM;IOCUU;IOSC;IORC;IOCUD;IOHOME;IOELALL;IORVON;IORVOFF;IOCUF;IONEL;IOBON;IOBOFF;IOUON;IOUOFF;IOELEOL;IOEDALL;IOEDEOP;IOCUB;IOECH;IOELBOL;IOIND"
58 D ENDR^%ZISS,GSET^%ZISS
59 S X="IOINLOW;IOINHI;IOINORM;IOCUOFF;IOCUON;IORI;IOIND;IORESET;IOCUOFF;IOCUON;IOSGR0"
60 D ENDR^%ZISS
61 I IOSTBM="" S IOSTBM=1
62 Q
63FULL ;--set terminal to full scrolling window
64 N IOTM,IOBM,X
65 K PXBWIN
66 I '$D(IOSTBM) D TERM
67 I IOSTBM]"" S IOTM=1,IOBM=(IOSL-(1)) W IOSC W @IOSTBM W IORC
68 S X=IOM X ^%ZOSF("RM")
69 Q
70FULL0 ;--set terminal to full scrolling window
71 N IOTM,IOBM,X
72 I '$D(IOSTBM) D TERM
73 I IOSTBM]"" S IOTM=1,IOBM=IOSL W IOSC W @IOSTBM W IORC
74 S X=IOM X ^%ZOSF("RM")
75 Q
76CLEAR1 ;--clean out all cursor control variables
77 D KILL^%ZISS,GKILL^%ZISS
78 Q
79UNDON ;--underline on
80 I '$D(IOUON) D TERM^PXBCC
81 W IOUON
82 Q
83UNDOFF ;--underline off
84 I '$D(IOUON) D TERM^PXBCC
85 W IOUOFF
86 Q
87REVCPT(LINE,PXRVON) ;--Reverse Video a particular CPT CODE,PROVIDER OR POV
88 ;
89 ; INPUT: LINE = Selection from PXBSAM array
90 ; PXRVON = Flag to turn reverse video on/off
91 ; where: 1 = reverse video on
92 ; 0 = reverse video off
93 ;
94 Q:$G(NOREV)=1
95 N ENTRY,XLINE,I,IOTM,IOBM,COL,DX,DY
96 S ENTRY=$G(PXBSAM(LINE))
97 ;Actual line on which CPT code displayed
98 ;S XLINE=LINE#10+4
99 S XLINE=PXBSAM(LINE,"LINE")#10+4 ;PX*1.0*164
100 I XLINE<5 S XLINE=XLINE+10
101 I '$D(IOSC) D TERM
102 S COL=4
103 W IOSC S IOTM=1,IOBM=IOSL W @IOSTBM W IOHOME D ZERO
104 F I=1:1:XLINE W IOCUD
105 F I=1:1:COL W IOCUF
106 S DY=XLINE,DX=COL D DXDY
107 I $G(PXRVON) W IORVON,$P(ENTRY,"^",1),IORVOFF
108 I '$G(PXRVON) W IORVOFF,$P(ENTRY,"^",1)
109 S IOTM=PXBSAVE,IOBM=IOSL W @IOSTBM W IORC
110 Q
111REVPRV(LINE) ;--Reverse Video a particular CPT CODE,PROVIDER OR POV
112 Q:$G(NOREV)=1 Q:$G(FROM)["CPT" Q:$G(FROM)["PL"
113 N ENTRY,XLINE,I,IOTM,IOBM,COL,DX,DY
114 S ENTRY=$G(PXBSAM(LINE)),XLINE=(LINE#10)+4
115 I XLINE<5 S XLINE=XLINE+10
116 I '$D(IOSC) D TERM
117 S COL=4
118 W IOSC S IOTM=1,IOBM=IOSL W @IOSTBM W IOHOME D ZERO
119 F I=1:1:XLINE W IOCUD
120 F I=1:1:COL W IOCUF
121 S DY=XLINE,DX=COL D DXDY
122 W IORVON,$P(ENTRY,"^",1),IORVOFF
123 S IOTM=PXBSAVE,IOBM=IOSL W @IOSTBM W IORC
124 Q
125REVPOV(LINE) ;--Reverse Video a particular CPT CODE,PROVIDER OR POV
126 Q:$G(NOREV)=1
127 N ENTRY,XLINE,I,IOTM,IOBM,COL,DX,DY
128 S ENTRY=$G(PXBSAM(LINE)),XLINE=(LINE*2-1#10)+4
129 I XLINE<5 S XLINE=XLINE+10
130 I '$D(IOSC) D TERM
131 S COL=4
132 W IOSC S IOTM=1,IOBM=IOSL W @IOSTBM W IOHOME D ZERO
133 F I=1:1:XLINE W IOCUD
134 F I=1:1:COL W IOCUF
135 S DY=XLINE,DX=COL D DXDY
136 W IORVON,$J($P($P(ENTRY,"^",1),".",1),4),".",$P($P(ENTRY,"^",1),".",2),IORVOFF
137 S IOTM=PXBSAVE,IOBM=IOSL W @IOSTBM W IORC
138 Q
139REVSTP(LINE) ;--Reverse Video a particular CPT CODE,PROVIDER OR POV
140 Q:$G(NOREV)=1
141 N ENTRY,XLINE,I,IOTM,IOBM,COL,DX,DY
142 S ENTRY=$G(PXBSAM(LINE)),XLINE=(LINE#10)+4
143 I XLINE<5 S XLINE=XLINE+10
144 I '$D(IOSC) D TERM
145 S COL=4
146 W IOSC S IOTM=1,IOBM=IOSL W @IOSTBM W IOHOME D ZERO
147 F I=1:1:XLINE W IOCUD
148 F I=1:1:COL W IOCUF
149 S DY=XLINE,DX=COL D DXDY
150 W IORVON,$P(ENTRY,"^",1),IORVOFF
151 S IOTM=PXBSAVE,IOBM=IOSL W @IOSTBM W IORC
152 Q
153 ;
154UREV(LINE) ;--Reverse Video a particular CPT CODE,PROVIDER OR POV
155 Q
156 ;--**OUT OF ORDER
157 N ENTRY,XLINE,I,IOTM,IOBM,DX,DY
158 S ENTRY=$G(PXBSAM(LINE)),XLINE=LINE+4
159 I '$D(IOSC) D TERM
160 W IOSC S IOTM=1,IOBM=IOSL W @IOSTBM W IOHOME D ZERO
161 F I=1:1:XLINE W IOCUD
162 F I=1:1:4 W IOCUF
163 S DY=XLINE,DX=COL D DXDY
164 W $P(ENTRY,"^",1)
165 S IOTM=PXBSAVE,IOBM=IOSL W @IOSTBM W IORC
166 Q
167 ;
168RREV(LINE,COLUMN,ENTRY) ;--Reverse REQUESTED information
169 Q:$G(NOREV)=1
170 N XLINE,I,IOTM,IOBM,DX,DY
171 S XLINE=LINE+1
172 I '$D(IOSC) D TERM
173 W IOSC S IOTM=1,IOBM=IOSL W @IOSTBM W IOHOME D ZERO
174 F I=1:1:XLINE W IOCUD
175 F I=1:1:COLUMN W IOCUF
176 S DY=XLINE,DX=COLUMN D DXDY
177 W IOELEOL,IOINHI,ENTRY,IOINLOW
178 S IOTM=PXBSAVE,IOBM=IOSL W @IOSTBM W IORC
179 Q
180RREVST(LINE,COLUMN,ENTRY) ;--Reverse REQUESTED information
181 Q:$G(NOREV)=1
182 N XLINE,I,IOTM,IOBM,DX,DY
183 S XLINE=LINE+1
184 I '$D(IOSC) D TERM
185 W IOSC S IOTM=1,IOBM=IOSL W @IOSTBM W IOHOME D ZERO
186 F I=1:1:XLINE W IOCUD
187 F I=1:1:COLUMN W IOCUF
188 S DY=XLINE,DX=COLUMN D DXDY
189 W IORVON,ENTRY,IORVOFF
190 S IOTM=PXBSAVE,IOBM=IOSL W @IOSTBM W IORC
191 Q
192RREVH(LINE,COLUMN,ENTRY) ;--Reverse REQUESTED information
193 Q:$G(NOREV)=1
194 N XLINE,I,IOTM,IOBM,DX,DY
195 S XLINE=LINE+1
196 I '$D(IOSC) D TERM
197 W IOSC S IOTM=1,IOBM=IOSL W @IOSTBM W IOHOME D ZERO
198 F I=1:1:XLINE W IOCUD
199 F I=1:1:COLUMN W IOCUF
200 S DY=XLINE,DX=COLUMN D DXDY
201 W IOELEOL,IOINHI,IOUON,ENTRY,IOINLOW,IOUON F I=1:1:5 W " "
202 W IOUOFF
203 S IOTM=PXBSAVE,IOBM=IOSL W @IOSTBM W IORC
204 Q
205LOC(LINE,COLUMN) ;--Locate Cursor to specified position
206 N PXBOS
207 S PXBOS=^%ZOSF("OS")
208 I PXBOS'["MSM" N DY,DX S DY=LINE,DX=COLUMN X IOXY,^%ZOSF("XY") Q
209 N XLINE,I,IOTM,IOBM,DX,DY
210 W IOCUOFF
211 I '$D(IOSTBM) D TERM
212 S IOTM=1,IOBM=IOSL W @IOSTBM W IOHOME D ZERO
213 I $D(LINE) F I=1:1:LINE W IOIND
214 F I=1:1:COLUMN W IOCUF
215 I $D(LINE) S DY=LINE
216 E S DY=$Y
217 S DX=COLUMN D DXDY
218 W IOCUON
219 Q
220 ;
221ERASE ;---ERASE THE LIST GOING UPWARDS
222 N PXI
223 I '$D(IOCUU) D TERM^PXBCC
224 D LOC^PXBCC(15,1)
225 S PXI=0 F I=1:1:11 W IORI,IOELALL
226 Q
Note: See TracBrowser for help on using the repository browser.