BPSOSU3 ;BHAM ISC/FCS/DRS/FLS - copied for ECME ;03/07/08 10:37
;;1.0;E CLAIMS MGMT ENGINE;**1,7**;JUN 2004;Build 46
;;Per VHA Directive 2004-038, this routine should not be modified.
;
;----------------------------------------------------------------------
;Standard SET and YESNO Functions
;----------------------------------------------------------------------
;Standard SET PROMPT:
;
;Parameters:
; PROMPT = Text to be displayed before read
; DFLT = DEFAULT choice (external format)
; OPT = 1 - Answer optional 0 - Answer required
; DISPLAY = V - Vertical display H - Horizontal display
; N - No display
; CHOICES = <code>:<choice><code>:<choice>.....
; TIMEOUT = Number of seconds
;
;Returns:
; <null> = No response <^> - Up-arrow entered
; <-1> = Timeout occurred <^^> - Two up-arrows entered
; <Choice> = Response choice (internal format)
;---------------------------------------------------------------------
SET(PROMPT,DFLT,OPT,DISPLAY,CHOICES,TIMEOUT) ;EP
;
N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
;
Q:$G(PROMPT)="" ""
Q:$G(DISPLAY)="" ""
Q:$G(CHOICES)="" ""
;
S $P(DIR(0),"^",1)="S"_$S(DISPLAY="H":"B",DISPLAY="N":"A",1:"")_$S(OPT=1:"O",1:"")
S $P(DIR(0),"^",2)=CHOICES
S DIR("A")=PROMPT
S:$G(DFLT)'="" DIR("B")=DFLT
S:+$G(TIMEOUT)>0 DIR("T")=TIMEOUT
D ^DIR
Q $S($G(DTOUT)=1:-1,$G(DIROUT)=1:"^^",$G(DUOUT)=1:"^",1:Y)
;---------------------------------------------------------------------
;Standard Yes/No PROMPT:
;
;Parameters:
; PROMPT = Text to be displayed before read
; DFLT = YES, NO or <Null>
; OPT = 1 - Answer optional 0 - Answer required
; TIMEOUT = Number of seconds
;
;Returns:
; <null> = No response <^> - Up-arrow entered
; <-1> = Timeout occurred <^^> - Two up-arrows entered
; <0> = No <1> - Yes
;---------------------------------------------------------------------
YESNO(PROMPT,DFLT,OPT,TIMEOUT) ;EP
;
N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
;
Q:$G(PROMPT)="" ""
;
S $P(DIR(0),"^",1)="Y"_$S(OPT=1:"O",1:"")
S DIR("A")=PROMPT
S:$G(DFLT)'="" DIR("B")=DFLT
S:+$G(TIMEOUT)>0 DIR("T")=TIMEOUT
D ^DIR
Q $S($G(DTOUT)=1:-1,$G(DIROUT)=1:"^^",$G(DUOUT)=1:"^",1:Y)
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HBPSOSU3 2379 printed Oct 16, 2024@17:53 Page 2
BPSOSU3 ;BHAM ISC/FCS/DRS/FLS - copied for ECME ;03/07/08 10:37
+1 ;;1.0;E CLAIMS MGMT ENGINE;**1,7**;JUN 2004;Build 46
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+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 ;---------------------------------------------------------------------
SET(PROMPT,DFLT,OPT,DISPLAY,CHOICES,TIMEOUT) ;EP
+1 ;
+2 NEW DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
+3 ;
+4 if $GET(PROMPT)=""
QUIT ""
+5 if $GET(DISPLAY)=""
QUIT ""
+6 if $GET(CHOICES)=""
QUIT ""
+7 ;
+8 SET $PIECE(DIR(0),"^",1)="S"_$SELECT(DISPLAY="H":"B",DISPLAY="N":"A",1:"")_$SELECT(OPT=1:"O",1:"")
+9 SET $PIECE(DIR(0),"^",2)=CHOICES
+10 SET DIR("A")=PROMPT
+11 if $GET(DFLT)'=""
SET DIR("B")=DFLT
+12 if +$GET(TIMEOUT)>0
SET DIR("T")=TIMEOUT
+13 DO ^DIR
+14 QUIT $SELECT($GET(DTOUT)=1:-1,$GET(DIROUT)=1:"^^",$GET(DUOUT)=1:"^",1:Y)
+15 ;---------------------------------------------------------------------
+16 ;Standard Yes/No PROMPT:
+17 ;
+18 ;Parameters:
+19 ; PROMPT = Text to be displayed before read
+20 ; DFLT = YES, NO or <Null>
+21 ; OPT = 1 - Answer optional 0 - Answer required
+22 ; TIMEOUT = Number of seconds
+23 ;
+24 ;Returns:
+25 ; <null> = No response <^> - Up-arrow entered
+26 ; <-1> = Timeout occurred <^^> - Two up-arrows entered
+27 ; <0> = No <1> - Yes
+28 ;---------------------------------------------------------------------
YESNO(PROMPT,DFLT,OPT,TIMEOUT) ;EP
+1 ;
+2 NEW DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
+3 ;
+4 if $GET(PROMPT)=""
QUIT ""
+5 ;
+6 SET $PIECE(DIR(0),"^",1)="Y"_$SELECT(OPT=1:"O",1:"")
+7 SET DIR("A")=PROMPT
+8 if $GET(DFLT)'=""
SET DIR("B")=DFLT
+9 if +$GET(TIMEOUT)>0
SET DIR("T")=TIMEOUT
+10 DO ^DIR
+11 QUIT $SELECT($GET(DTOUT)=1:-1,$GET(DIROUT)=1:"^^",$GET(DUOUT)=1:"^",1:Y)