ABSPOSU2 ; IHS/FCS/DRS - copied for POS ; [ 09/12/2002 10:19 AM ]
;;1.0;PHARMACY POINT OF SALE;**3**;JUN 21, 2001;Build 38
;----------------------------------------------------------------------
;----------------------------------------------------------------------
;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)
ABSPOSU2 ; IHS/FCS/DRS - copied for POS ; [ 09/12/2002 10:19 AM ]
+1 ;;1.0;PHARMACY POINT OF SALE;**3**;JUN 21, 2001;Build 38
+2 ;----------------------------------------------------------------------
+3 ;----------------------------------------------------------------------
+4 ;Standard FREETEXT and Numeric Functions
+5 ;----------------------------------------------------------------------
+6 ;Standard FREETEXT PROMPT:
+7 ;
+8 ;Parameters:
+9 ; PROMPT = Text to be displayed before read
+10 ; DFLT = DEFAULT text
+11 ; OPT = 1 - Answer optional 0 - Answer required
+12 ; MINLEN = Minimum length of response text
+13 ; MAXLEN = Maximum length of response text
+14 ; TIMEOUT = Number of seconds
+15 ;
+16 ;Returns:
+17 ; <null> = No response <^> - Up-arrow entered
+18 ; <-1> = Timeout occurred <^^> - Two up-arrows entered
+19 ; <text> = Response text
+20 ;---------------------------------------------------------------------
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)