source: WorldVistAEHR/trunk/r/AUTOMATED_MED_INFO_EXCHANGE-DVBA-DVBC/DVBAB99.m@ 1582

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

initial load of WorldVistAEHR

File size: 4.7 KB
Line 
1DVBAB99 ;ALB/SPH - CAPRI CONVERSION OF VALM FOR SUPPORT GUI CALLS ;09/06/000
2 ;;2.7;AMIE;**35**;Apr 10, 1995
3 ;
4EN(NAME,PARMS) ; -- main entry point
5 ; input: NAME := free text name of list template or routine call
6 ; PARMS := parameter list
7 ;
8 I $G(PARMS)["T" K VALMEVL ; kill if 'T'op level
9 D INIT^VALM0(.NAME,$G(PARMS)) G ENQ:$D(VALMQUIT)
10 ; -- build list of items
11 I $G(^TMP("VALM DATA",$J,VALMEVL,"INIT"))]"" X ^("INIT") G ENQ:$D(VALMQUIT)
12 ; -- start event loop
13 S VALMBCK="R" D ASK
14 X:$G(^TMP("VALM DATA",$J,VALMEVL,"FNL"))]"" ^("FNL")
15ENQ D POP^VALM0
16 Q
17 ;
18ASK ; -- event loop
19 S X=VALM("PROTOCOL") D XQORM
20 ;,EN^XQOR
21 ;I $D(VALMBCK),VALMBCK'="Q" G ASK
22ASKQ K XQORM,DTOUT,DIROUT,DUOUT Q
23 ;
24COL ; -- set up column dd array
25 K VALMDDF
26 S I=0 F S I=$O(^SD(409.61,VALM("IFN"),"COL",I)) Q:'I I $D(^(I,0)) S VALMDDF($P(^(0),U))=^(0)
27 Q
28 ;
29CAPTION() ; -- set up caption line of header
30 N X,COL,FLD
31 S $P(X,$S(VALMCC:" ",1:"-"),VALM("RM")+1)=""
32 S COL="" F S COL=$O(VALMDDF(COL)) Q:COL="" S FLD=VALMDDF(COL) D
33 .S X=$$SETSTR^VALM1($P(FLD,U,4),X,+$P(FLD,U,2),$S($L($P(FLD,U,4))<$P(FLD,U,3):$L($P(FLD,U,4)),1:+$P(FLD,U,3)))
34 Q X
35 ;
36CHGCAP(FLD,LABEL) ; -- change label on caption
37 ; input: FLD := name of field
38 ; LABEL := text for column header
39 S $P(VALMDDF(FLD),U,4)=LABEL,VALMCAP=$$CAPTION
40 Q
41 ;
42REFRESH ; -- refresh display
43 S VALMPGE=$$PAGE^VALM4(VALMBG,VALM("LINES"))
44 S X=0 X ^%ZOSF("RM")
45 D HDR:$G(VALMBCK)'["P",TBAR,LIST,LBAR
46 S VALMBCK=""
47 Q
48 ;
49HDR ; -- prt/display header
50 N X,I
51 I '$D(VALMHDR) X:$G(VALM("HDR"))]"" VALM("HDR")
52 ; -- prt hdr line
53 W:'$D(VALMPG1) @IOF K VALMPG1
54 W:VALMCC $C(13)_IOUON_$C(13)_IOINHI_$C(13) ; -- turn on undln/hi
55 I $E(IOST,1,2)="C-" D IOXY^VALM4(0,0) ; -- position cursor
56 W $E(VALM("TITLE"),1,30) ; -- prt title
57 W:VALMCC IOINORM,IOUON ; -- turn off hi
58 W $J("",30-$L(VALM("TITLE"))) ; -- fill in w/blanks
59 I $E(IOST,1,2)="C-" W $C(13) D IOXY^VALM4(30,0) ; -- position cursor
60 W $J("",((VALMWD-80)/2)),$$LOWER^VALM1($$NOW^VALM1),$J("",10+((VALMWD-80)/2)),"Page: ",$J(VALMPGE,4)," of ",$J($$PAGE^VALM4(VALMCNT,VALM("LINES")),4)_$S($D(VALMORE):"+",1:" ") ; -- prt rest of hdr
61 W:VALMCC IOUOFF I $E(IOST,1,2)="C-" D IOXY^VALM4(0,0) ; -- turn off undln
62 F I=1:1:VALM("TM")-3 W !,$S('$D(VALMHDR(I)):"",$L(VALMHDR(I))>(VALMWD-1):$$EXTRACT^VALM4($G(VALMHDR(I))),1:VALMHDR(I)) ; -- prt hdr
63 Q
64 ;
65TBAR ; -- print caption/top bar
66 N X
67 D CRT(0,VALM("TM")-3)
68 S VALMUP=(VALMBG>1),VALMCAP=$S(VALMUP:"+",VALMCC:" ",1:"-")_$E(VALMCAP,2,VALM("RM"))
69 S X=$E(VALMCAP,1,VALM("FIXED"))_$E(VALMCAP,VALMLFT,VALMLFT+VALMWD-1-VALM("FIXED"))
70 I VALM("TM")>2 D
71 .S:VALMCC X=IOUON_$C(13)_X_$C(13)_IOUOFF_$C(13)
72 .W !,X
73 Q
74 ;
75LIST ; -- list items
76 N I,LN,DY,DX
77 S DY=0
78 I $E(IOST,1,2)="C-" W ! S DX=0,DY=VALM("TM")-2 X IOXY
79 S I=VALMBG,VALMLST=I+VALM("LINES")-1 S:VALMLST>VALMCNT VALMLST=VALMCNT
80 F LN=1:1:VALM("LINES") D WRITE^VALM4(I,1,1,DY+LN) S I=I+1
81 Q
82 ;
83LBAR ; -- print low bar
84 N CHR,X
85 D CRT(0,VALM("BM")-1)
86 S CHR=$S(VALMCC:" ",1:"-")
87 K X S $P(X,CHR,VALMWD+1)=""
88 S X=$E(X,1,10)_$E($E($S($G(VALMSG)="":$$MSG(),1:VALMSG),1,50)_$E(X,11,75),1,65)_$E(X,76,VALMWD) K VALMSG
89 S VALMDN=(VALMLST<VALMCNT)
90 S X=$S(VALMDN:"+",1:CHR)_CHR_$S(VALMLFT>(VALM("FIXED")+1):"<<<",1:CHR_CHR_CHR)_$E(X,6,VALMWD-3)_$S((VALMLFT+(VALMWD-VALM("FIXED")))<VALM("RM"):">>>",1:CHR_CHR_CHR)
91 S:VALMCC X=$C(13)_IORVON_$C(13)_X_$C(13)_IORVOFF_$C(13)
92 W !,X
93 I $E(IOST,1,2)="C-" W !
94 Q
95 ;
96MSG() ;
97 Q "Enter ?? for more actions"
98 ;
99CRT(DX,DY) ;
100 I DX'<0,DY'<0,$E(IOST,1,2)="C-" W $C(13) D IOXY^VALM4(.DX,.DY)
101 Q
102 ;
103SHOW ; -- show items to user / main call back
104 W VALMCOFF
105 N DX,DY
106 S:'$D(VALMBG) VALMBG=1
107 S:'$D(VALMLFT) VALMLFT=VALM("FIXED")+1
108 S VALMPGE=$$PAGE^VALM4(VALMBG,VALM("LINES"))
109 I $G(VALMBCK)="R" D REFRESH
110 I $D(VALMSG) D MSG^VALM10(VALMSG) K VALMSG
111 I '$D(XQORM("B")),VALM("DEFS") S XQORM("B")=$S(VALMLST<VALMCNT:"Next Screen",1:"Quit")
112 I VALMCC D RESET^VALM4
113 S DX=0,DY=VALM("BM")-$S(VALM("TYPE")=2:0,1:VALMMENU) X IOXY
114 I VALMMENU D
115 .S X="?" D DISP^XQORM1
116 .W:VALMCC IOEDEOP
117 W VALMCON
118 D XQORM,KEYS K VALMBCK,VALMDY
119 Q
120 ;
121WP1(VALMREF) ; -- quick setup
122 S VALMCNT=+$P(@VALMREF@(0),U,4)
123 S VALM("ARRAY")=VALMREF
124 S:$D(VALMWPTL) VALM("TITLE")=VALMWPTL
125 Q
126 ;
127WP(VALMREF,VALMWPTL) ; -- quick entry to List Manager (c)
128 D EN("WP1^VALM(VALMREF)")
129 Q
130 ;
131XQORM ; -- set XQOR init vars
132 S XQORM(0)=VALM("MAX")_"AR\"
133 S XQORM("??")="D HELP^VALM2"
134 K DTOUT,DIROUT,DUOUT
135 Q
136 ;
137KEYS ; -- set XQOR auto-protocols
138 N I S I=0
139 F S I=$O(VALMKEY(I)) Q:'I S X=VALMKEY(I) S:$P(X,U,2)]"" XQORM("KEY",$P(X,U,2))=+X_"^1"
140 S XQORM("XLATE","LEFT")="<=1",XQORM("XLATE","RIGHT")=">=1"
141 S XQORM("XLATE","FIND")="SE",XQORM("XLATE","HELP")="??"
142 S XQORM("XLATE","DOWN")="DN",XQORM("XLATE","UP")="UP"
143 Q
Note: See TracBrowser for help on using the repository browser.