source: FOIAVistA/trunk/r/E_CLAIMS_MGMT_ENGINE-BPS/BPSOSU3.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 2.2 KB
Line 
1BPSOSU3 ;BHAM ISC/FCS/DRS/FLS - copied for ECME ;06/01/2004
2 ;;1.0;E CLAIMS MGMT ENGINE;**1**;JUN 2004
3 ;----------------------------------------------------------------------
4 ;----------------------------------------------------------------------
5 ;Standard SET and YESNO Functions
6 ;----------------------------------------------------------------------
7 ;Standard SET PROMPT:
8 ;
9 ;Parameters:
10 ; PROMPT = Text to be displayed before read
11 ; DFLT = DEFAULT choice (external format)
12 ; OPT = 1 - Answer optional 0 - Answer required
13 ; DISPLAY = V - Vertical display H - Horizontal display
14 ; N - No display
15 ; CHOICES = <code>:<choice>;<code>:<choice>.....
16 ; TIMEOUT = Number of seconds
17 ;
18 ;Returns:
19 ; <null> = No response <^> - Up-arrow entered
20 ; <-1> = Timeout occurred <^^> - Two up-arrows entered
21 ; <Choice> = Response choice (internal format)
22 ;---------------------------------------------------------------------
23SET(PROMPT,DFLT,OPT,DISPLAY,CHOICES,TIMEOUT) ;EP
24 ;
25 N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
26 ;
27 Q:$G(PROMPT)="" ""
28 Q:$G(DISPLAY)="" ""
29 Q:$G(CHOICES)="" ""
30 ;
31 S $P(DIR(0),"^",1)="S"_$S(DISPLAY="H":"B",DISPLAY="N":"A",1:"")_$S(OPT=1:"O",1:"")
32 S $P(DIR(0),"^",2)=CHOICES
33 S DIR("A")=PROMPT
34 S:$G(DFLT)'="" DIR("B")=DFLT
35 S:+$G(TIMEOUT)>0 DIR("T")=TIMEOUT
36 D ^DIR
37 Q $S($G(DTOUT)=1:-1,$G(DIROUT)=1:"^^",$G(DUOUT)=1:"^",1:Y)
38 ;---------------------------------------------------------------------
39 ;Standard Yes/No PROMPT:
40 ;
41 ;Parameters:
42 ; PROMPT = Text to be displayed before read
43 ; DFLT = YES, NO or <Null>
44 ; OPT = 1 - Answer optional 0 - Answer required
45 ; TIMEOUT = Number of seconds
46 ;
47 ;Returns:
48 ; <null> = No response <^> - Up-arrow entered
49 ; <-1> = Timeout occurred <^^> - Two up-arrows entered
50 ; <0> = No <1> - Yes
51 ;---------------------------------------------------------------------
52YESNO(PROMPT,DFLT,OPT,TIMEOUT) ;EP
53 ;
54 N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
55 ;
56 Q:$G(PROMPT)="" ""
57 ;
58 S $P(DIR(0),"^",1)="Y"_$S(OPT=1:"O",1:"")
59 S DIR("A")=PROMPT
60 S:$G(DFLT)'="" DIR("B")=DFLT
61 S:+$G(TIMEOUT)>0 DIR("T")=TIMEOUT
62 D ^DIR
63 Q $S($G(DTOUT)=1:-1,$G(DIROUT)=1:"^^",$G(DUOUT)=1:"^",1:Y)
Note: See TracBrowser for help on using the repository browser.