BPSOSU2 ;BHAM ISC/FCS/DRS/FLS - copied for ECME ;03/07/08 10:36
;;1.0;E CLAIMS MGMT ENGINE;**1,7**;JUN 2004;Build 46
;;Per VHA Directive 2004-038, this routine should not be modified.
;
;----------------------------------------------------------------------
;Standard FREETEXT and Numeric Functions
;----------------------------------------------------------------------
;Standard FREETEXT PROMPT:
;
;Parameters:
; PROMPT = Text to be displayed before read
; DFLT = DEFAULT text
; OPT = 1 - Answer optional 0 - Answer required
; MINLEN = Minimum length of response text
; MAXLEN = Maximum length of response text
; TIMEOUT = Number of seconds
;
;Returns:
; <null> = No response <^> - Up-arrow entered
; <-1> = Timeout occurred <^^> - Two up-arrows entered
; <text> = Response text
;---------------------------------------------------------------------
FREETEXT(PROMPT,DFLT,OPT,MINLEN,MAXLEN,TIMEOUT) ;EP
;
N XDATA,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
;
Q:$G(PROMPT)="" ""
S:$G(MINLEN)="" MINLEN=0
S:$G(MAXLEN)="" MAXLEN=245
;
S $P(DIR(0),"^",1)="FA"_$S(OPT=1:"O",1:"")
S $P(XDATA,":",1)=MINLEN
S $P(XDATA,":",2)=MAXLEN
S $P(DIR(0),"^",2)=XDATA
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 Numeric PROMPT:
;
;Parameters:
; PROMPT = Text to be displayed before read
; DFLT = DEFAULT Numeric
; OPT = 1 - Answer optional 0 - Answer required
; MINNUM = Minimum numeric value
; MAXNUM = Maximum numeric value
; MAXDEC = Maximum number of decimal places allowed
; TIMEOUT = Number of seconds
;
;Returns:
; <null> = No response <^> - Up-arrow entered
; <-1> = Timeout occurred <^^> - Two up-arrows entered
; <Numeric> = Response Numeric
;---------------------------------------------------------------------
NUMERIC(PROMPT,DFLT,OPT,MINNUM,MAXNUM,MAXDEC,TIMEOUT) ;EP
;
N XDATA,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
;
Q:$G(PROMPT)="" ""
;
S $P(DIR(0),"^",1)="NA"_$S(OPT=1:"O",1:"")
S $P(XDATA,":",1)=$G(MINNUM)
S $P(XDATA,":",2)=$G(MAXNUM)
S $P(XDATA,":",3)=$G(MAXDEC)
S $P(DIR(0),"^",2)=XDATA
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[HBPSOSU2 2589 printed Nov 22, 2024@17:02:22 Page 2
BPSOSU2 ;BHAM ISC/FCS/DRS/FLS - copied for ECME ;03/07/08 10:36
+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 FREETEXT and Numeric Functions
+6 ;----------------------------------------------------------------------
+7 ;Standard FREETEXT PROMPT:
+8 ;
+9 ;Parameters:
+10 ; PROMPT = Text to be displayed before read
+11 ; DFLT = DEFAULT text
+12 ; OPT = 1 - Answer optional 0 - Answer required
+13 ; MINLEN = Minimum length of response text
+14 ; MAXLEN = Maximum length of response text
+15 ; TIMEOUT = Number of seconds
+16 ;
+17 ;Returns:
+18 ; <null> = No response <^> - Up-arrow entered
+19 ; <-1> = Timeout occurred <^^> - Two up-arrows entered
+20 ; <text> = Response text
+21 ;---------------------------------------------------------------------
FREETEXT(PROMPT,DFLT,OPT,MINLEN,MAXLEN,TIMEOUT) ;EP
+1 ;
+2 NEW XDATA,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
+3 ;
+4 if $GET(PROMPT)=""
QUIT ""
+5 if $GET(MINLEN)=""
SET MINLEN=0
+6 if $GET(MAXLEN)=""
SET MAXLEN=245
+7 ;
+8 SET $PIECE(DIR(0),"^",1)="FA"_$SELECT(OPT=1:"O",1:"")
+9 SET $PIECE(XDATA,":",1)=MINLEN
+10 SET $PIECE(XDATA,":",2)=MAXLEN
+11 SET $PIECE(DIR(0),"^",2)=XDATA
+12 SET DIR("A")=PROMPT
+13 if $GET(DFLT)'=""
SET DIR("B")=DFLT
+14 if +$GET(TIMEOUT)>0
SET DIR("T")=TIMEOUT
+15 DO ^DIR
+16 QUIT $SELECT($GET(DTOUT)=1:-1,$GET(DIROUT)=1:"^^",$GET(DUOUT)=1:"^",1:Y)
+17 ;---------------------------------------------------------------------
+18 ;Standard Numeric PROMPT:
+19 ;
+20 ;Parameters:
+21 ; PROMPT = Text to be displayed before read
+22 ; DFLT = DEFAULT Numeric
+23 ; OPT = 1 - Answer optional 0 - Answer required
+24 ; MINNUM = Minimum numeric value
+25 ; MAXNUM = Maximum numeric value
+26 ; MAXDEC = Maximum number of decimal places allowed
+27 ; TIMEOUT = Number of seconds
+28 ;
+29 ;Returns:
+30 ; <null> = No response <^> - Up-arrow entered
+31 ; <-1> = Timeout occurred <^^> - Two up-arrows entered
+32 ; <Numeric> = Response Numeric
+33 ;---------------------------------------------------------------------
NUMERIC(PROMPT,DFLT,OPT,MINNUM,MAXNUM,MAXDEC,TIMEOUT) ;EP
+1 ;
+2 NEW XDATA,DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
+3 ;
+4 if $GET(PROMPT)=""
QUIT ""
+5 ;
+6 SET $PIECE(DIR(0),"^",1)="NA"_$SELECT(OPT=1:"O",1:"")
+7 SET $PIECE(XDATA,":",1)=$GET(MINNUM)
+8 SET $PIECE(XDATA,":",2)=$GET(MAXNUM)
+9 SET $PIECE(XDATA,":",3)=$GET(MAXDEC)
+10 SET $PIECE(DIR(0),"^",2)=XDATA
+11 SET DIR("A")=PROMPT
+12 if $GET(DFLT)'=""
SET DIR("B")=DFLT
+13 if +$GET(TIMEOUT)>0
SET DIR("T")=TIMEOUT
+14 DO ^DIR
+15 QUIT $SELECT($GET(DTOUT)=1:-1,$GET(DIROUT)=1:"^^",$GET(DUOUT)=1:"^",1:Y)