ORXTABS3 ; SLC/PKS - Edit calls, tab parameters preferences. [10/17/00 2:39pm]
;;3.0;ORDER ENTRY/RESULTS REPORTING;**9,47,84**;Dec 17, 1997
;
; NOTES: The routines herein are called by those of the same tag
; name in ORXTABS2. Most variables are NEW'd and assigned
; by one or more routines in the preceding call chains.
; Refer to comments and notes there for additional infor-
; mation.
;
; Each tag in this routine must return one of the following:
;
; 1 - A new value entered or selected by the user,
; 2 - A null string,
; 3 - The string "*Invalid*" - to repeat due to invalid entry,
; 4 - The "^" character, indicating user's cancel action.
;
Q
;
BEG ; Beginning date.
;
; Internal variables used:
;
; ORXBDAT = Current "BEG" date entry.
; ORXDATE = ORXNOW passed variable converted to external format.
; ORXEDAT = Matching "END" date data.
; ORXREQ = Flag for required or optional date entry.
; X = Passed variable used in date format conversion.
; Y = Passed variable used in date format conversion.
; %DT = Passed variable in date conversion.
;
N ORXBDAT,ORXDATE,ORXEDAT,ORXREQ,X,Y,%DT
K ORXDATE
S ORXREQ="O"
;
; Assign DIR variables and call DIR:
S DIR("T")=120 ; Two minute maximum timeout for response.
S DIR("A")=" Enter "_ORXPDIS_" value: "
S DIR("?")=" Enter beginning date; an empty response means an unrestricted beginning date range"
I ORXPDIR="IMAGING"!(ORXPDIR="REPORTS") D ; Required in some cases.
.S ORXREQ=""
.S DIR("A")=" Enter "_ORXPDIS_" value (required): "
.S DIR("?")=" Enter beginning date (required)"
;
; Assign DIR default, if any:
I $L($G(ORXNOW)) S DIR("B")=$S(ORXNOW?7N.1".".6N:$$FMTE^XLFDT(ORXNOW),1:ORXNOW)
S DIR(0)="DA"_ORXREQ_"^::ETX" ; DIR input restrictions.
W !! ; For screen display.
D ^DIR ; FM user input call.
S:$D(DTOUT) Y="^" ; Handle time-outs.
S (ORXNOW,ORXBDAT)=Y ; ORXBDAT for comparison.
S:X="@" ORXNOW="",ORXBDAT="" ; User wants null entry.
S:(X'="@")&(X'="^") ORXNOW=X ; Or use X value.
K DIR,X,Y ; Clean up each time.
;
; Use ORXEDAT twice to Check for valid date entry:
I ORXBDAT'="" D
.I ORXNOW="^" Q
.I (ORXCNT+1)>ORXNUM W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
.S ORXEDAT=$P($G(ORXSETS),";",ORXCNT+1)
.I ORXEDAT'="END" W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
.S ORXEDAT=$P($G(ORXCUR),";",$P($G(ORXPCS),";",ORXCNT+1))
.I ('$D(ORXEDAT)!(ORXEDAT="")) Q ; Null END = accept.
.S %DT="",X=ORXEDAT D ^%DT S ORXEDAT=Y ; Convert all dates.
.I ORXEDAT<ORXBDAT W !!,"ERROR: Beginning date cannot be later than ending date." S ORXNOW="*Invalid*"
;
Q
;
END ; Ending date.
;
; Internal variables used:
;
; ORXBDAT = Matching "BEG" date data.
; ORXEDAT = Current "END" date entry.
; ORXDATE = ORXNOW passed variable converted to external format.
; ORXREQ = Flag for required or optional date entry.
; X = Passed variable used in date format conversion.
; Y = Passed variable used in date format conversion.
; %DT = Passed variable in date conversion.
;
N ORXBDAT,ORXEDAT,ORXDATE,ORXREQ,X,Y,%DT
K ORXDATE
S ORXREQ="O"
;
; Assign DIR variables and call DIR:
S DIR("T")=120 ; Two minute maximum timeout for response.
S DIR("A")=" Enter "_ORXPDIS_" value: "
S DIR("?")=" Enter ending date; a null response means an unlimited ending date range"
I ORXPDIR="IMAGING"!(ORXPDIR="REPORTS") D ; Required in some cases.
.S ORXREQ=""
.S DIR("A")=" Enter "_ORXPDIS_" value (required): "
.S DIR("?")=" Enter ending date (required)"
;
; Assign DIR default, if any:
I $L($G(ORXNOW)) S DIR("B")=$S(ORXNOW?7N.1".".6N:$$FMTE^XLFDT(ORXNOW),1:ORXNOW)
S DIR(0)="DA"_ORXREQ_"^::ETX" ; DIR input restrictions.
W !! ; For screen display.
D ^DIR ; FM user input call.
S:$D(DTOUT) Y="^" ; Handle time-outs.
S (ORXNOW,ORXEDAT)=Y ; ORXEDAT for comparison.
S:X="@" ORXNOW="",ORXEDAT="" ; User wants null entry.
S:(X'="@")&(X'="^") ORXNOW=X ; Or use X value.
K DIR,X,Y ; Clean up each time.
;
; Use ORXBDAT twice to Check for valid date entry:
I ORXEDAT'="" D
.I ORXNOW="^" Q
.I (ORXCNT-1)<1 W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
.S ORXBDAT=$P($G(ORXSETS),";",ORXCNT-1)
.I ORXBDAT'="BEG" W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
.S ORXBDAT=$P($G(ORXCUR),";",$P($G(ORXPCS),";",ORXCNT-1))
.I ('$D(ORXBDAT)!(ORXBDAT="")) Q ; Null BEG = accept.
.S %DT="",X=ORXBDAT D ^%DT S ORXBDAT=Y ; Convert all dates.
.I ORXBDAT>ORXEDAT W !!,"ERROR: Ending date cannot be earlier than beginning date." S ORXNOW="*Invalid*"
;
Q
;
MAX ; Maximum.
;
; Assign DIR variables:
S DIR("T")=120 ; Two minute maximum timeout for response.
S DIR("A")=" Enter "_ORXPDIS_" # of items to display: "
S DIR("?")=" Entry must be between 1 and 999"
S DIR(0)="NA^1:999" ; Numerical, required.
I ORXPDIR="IMAGING" S DIR(0)="NAO^1:999" ; Imaging not required.
;
; Call tag to get/assign input:
D INPUT^ORXTABS2
;
Q
;
AUTHOR ; Author, for D/C Summaries or Notes.
;
; Internal variables used:
;
; DIC,X,Y,DTOUT,DUOUT = Variables for call to DIC.
; ORXSTAT = Used to hold current value of related STATUS value.
;
N DIC,X,Y,DTOUT,DUOUT,ORXSTAT
;
; Assign DIC variables and call DIC:
S DIC=200
S DIC(0)="AEFMQ"
S DIC("A")=" Select author: "
S DIC("B")=$P($G(^VA(200,DUZ,0)),U)
S DTIME=120
W !! ; Screen formatting.
D ^DIC
;
I $D(DUOUT) S ORXNOW="^"
I $D(DTOUT) S ORXNOW="^"
;
; Examine user entry, treat if needed, and assign it for return:
I ORXNOW'="^" S:+Y'>0 Y=""
I ORXNOW'="^" S ORXNOW=+Y
;
; Use ORXSTAT twice to Check for valid entry:
I ORXNOW'="" D
.I (ORXCNT-1)<1 W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
.S ORXSTAT=$P($G(ORXSETS),";",ORXCNT-1)
.I ORXSTAT'="STATUS" W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
.S ORXSTAT=$P($G(ORXCUR),";",$P($G(ORXPCS),";",ORXCNT-1))
.I '$D(ORXSTAT) Q ; Null STATUS = accept.
.I ((ORXSTAT=5)!(ORXNOW<4)) S ORXNOW="" ; If STATUS'=4, set null.
;
K DIC,X,Y,DTOUT,DUOUT
;
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORXTABS3 6774 printed Nov 22, 2024@17:48:07 Page 2
ORXTABS3 ; SLC/PKS - Edit calls, tab parameters preferences. [10/17/00 2:39pm]
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**9,47,84**;Dec 17, 1997
+2 ;
+3 ; NOTES: The routines herein are called by those of the same tag
+4 ; name in ORXTABS2. Most variables are NEW'd and assigned
+5 ; by one or more routines in the preceding call chains.
+6 ; Refer to comments and notes there for additional infor-
+7 ; mation.
+8 ;
+9 ; Each tag in this routine must return one of the following:
+10 ;
+11 ; 1 - A new value entered or selected by the user,
+12 ; 2 - A null string,
+13 ; 3 - The string "*Invalid*" - to repeat due to invalid entry,
+14 ; 4 - The "^" character, indicating user's cancel action.
+15 ;
+16 QUIT
+17 ;
BEG ; Beginning date.
+1 ;
+2 ; Internal variables used:
+3 ;
+4 ; ORXBDAT = Current "BEG" date entry.
+5 ; ORXDATE = ORXNOW passed variable converted to external format.
+6 ; ORXEDAT = Matching "END" date data.
+7 ; ORXREQ = Flag for required or optional date entry.
+8 ; X = Passed variable used in date format conversion.
+9 ; Y = Passed variable used in date format conversion.
+10 ; %DT = Passed variable in date conversion.
+11 ;
+12 NEW ORXBDAT,ORXDATE,ORXEDAT,ORXREQ,X,Y,%DT
+13 KILL ORXDATE
+14 SET ORXREQ="O"
+15 ;
+16 ; Assign DIR variables and call DIR:
+17 ; Two minute maximum timeout for response.
SET DIR("T")=120
+18 SET DIR("A")=" Enter "_ORXPDIS_" value: "
+19 SET DIR("?")=" Enter beginning date; an empty response means an unrestricted beginning date range"
+20 ; Required in some cases.
IF ORXPDIR="IMAGING"!(ORXPDIR="REPORTS")
Begin DoDot:1
+21 SET ORXREQ=""
+22 SET DIR("A")=" Enter "_ORXPDIS_" value (required): "
+23 SET DIR("?")=" Enter beginning date (required)"
End DoDot:1
+24 ;
+25 ; Assign DIR default, if any:
+26 IF $LENGTH($GET(ORXNOW))
SET DIR("B")=$SELECT(ORXNOW?7N.1".".6N:$$FMTE^XLFDT(ORXNOW),1:ORXNOW)
+27 ; DIR input restrictions.
SET DIR(0)="DA"_ORXREQ_"^::ETX"
+28 ; For screen display.
WRITE !!
+29 ; FM user input call.
DO ^DIR
+30 ; Handle time-outs.
if $DATA(DTOUT)
SET Y="^"
+31 ; ORXBDAT for comparison.
SET (ORXNOW,ORXBDAT)=Y
+32 ; User wants null entry.
if X="@"
SET ORXNOW=""
SET ORXBDAT=""
+33 ; Or use X value.
if (X'="@")&(X'="^")
SET ORXNOW=X
+34 ; Clean up each time.
KILL DIR,X,Y
+35 ;
+36 ; Use ORXEDAT twice to Check for valid date entry:
+37 IF ORXBDAT'=""
Begin DoDot:1
+38 IF ORXNOW="^"
QUIT
+39 IF (ORXCNT+1)>ORXNUM
WRITE !!,"ERROR: Improper TABS entry."
SET ORXNOW="^"
QUIT
+40 SET ORXEDAT=$PIECE($GET(ORXSETS),";",ORXCNT+1)
+41 IF ORXEDAT'="END"
WRITE !!,"ERROR: Improper TABS entry."
SET ORXNOW="^"
QUIT
+42 SET ORXEDAT=$PIECE($GET(ORXCUR),";",$PIECE($GET(ORXPCS),";",ORXCNT+1))
+43 ; Null END = accept.
IF ('$DATA(ORXEDAT)!(ORXEDAT=""))
QUIT
+44 ; Convert all dates.
SET %DT=""
SET X=ORXEDAT
DO ^%DT
SET ORXEDAT=Y
+45 IF ORXEDAT<ORXBDAT
WRITE !!,"ERROR: Beginning date cannot be later than ending date."
SET ORXNOW="*Invalid*"
End DoDot:1
+46 ;
+47 QUIT
+48 ;
END ; Ending date.
+1 ;
+2 ; Internal variables used:
+3 ;
+4 ; ORXBDAT = Matching "BEG" date data.
+5 ; ORXEDAT = Current "END" date entry.
+6 ; ORXDATE = ORXNOW passed variable converted to external format.
+7 ; ORXREQ = Flag for required or optional date entry.
+8 ; X = Passed variable used in date format conversion.
+9 ; Y = Passed variable used in date format conversion.
+10 ; %DT = Passed variable in date conversion.
+11 ;
+12 NEW ORXBDAT,ORXEDAT,ORXDATE,ORXREQ,X,Y,%DT
+13 KILL ORXDATE
+14 SET ORXREQ="O"
+15 ;
+16 ; Assign DIR variables and call DIR:
+17 ; Two minute maximum timeout for response.
SET DIR("T")=120
+18 SET DIR("A")=" Enter "_ORXPDIS_" value: "
+19 SET DIR("?")=" Enter ending date; a null response means an unlimited ending date range"
+20 ; Required in some cases.
IF ORXPDIR="IMAGING"!(ORXPDIR="REPORTS")
Begin DoDot:1
+21 SET ORXREQ=""
+22 SET DIR("A")=" Enter "_ORXPDIS_" value (required): "
+23 SET DIR("?")=" Enter ending date (required)"
End DoDot:1
+24 ;
+25 ; Assign DIR default, if any:
+26 IF $LENGTH($GET(ORXNOW))
SET DIR("B")=$SELECT(ORXNOW?7N.1".".6N:$$FMTE^XLFDT(ORXNOW),1:ORXNOW)
+27 ; DIR input restrictions.
SET DIR(0)="DA"_ORXREQ_"^::ETX"
+28 ; For screen display.
WRITE !!
+29 ; FM user input call.
DO ^DIR
+30 ; Handle time-outs.
if $DATA(DTOUT)
SET Y="^"
+31 ; ORXEDAT for comparison.
SET (ORXNOW,ORXEDAT)=Y
+32 ; User wants null entry.
if X="@"
SET ORXNOW=""
SET ORXEDAT=""
+33 ; Or use X value.
if (X'="@")&(X'="^")
SET ORXNOW=X
+34 ; Clean up each time.
KILL DIR,X,Y
+35 ;
+36 ; Use ORXBDAT twice to Check for valid date entry:
+37 IF ORXEDAT'=""
Begin DoDot:1
+38 IF ORXNOW="^"
QUIT
+39 IF (ORXCNT-1)<1
WRITE !!,"ERROR: Improper TABS entry."
SET ORXNOW="^"
QUIT
+40 SET ORXBDAT=$PIECE($GET(ORXSETS),";",ORXCNT-1)
+41 IF ORXBDAT'="BEG"
WRITE !!,"ERROR: Improper TABS entry."
SET ORXNOW="^"
QUIT
+42 SET ORXBDAT=$PIECE($GET(ORXCUR),";",$PIECE($GET(ORXPCS),";",ORXCNT-1))
+43 ; Null BEG = accept.
IF ('$DATA(ORXBDAT)!(ORXBDAT=""))
QUIT
+44 ; Convert all dates.
SET %DT=""
SET X=ORXBDAT
DO ^%DT
SET ORXBDAT=Y
+45 IF ORXBDAT>ORXEDAT
WRITE !!,"ERROR: Ending date cannot be earlier than beginning date."
SET ORXNOW="*Invalid*"
End DoDot:1
+46 ;
+47 QUIT
+48 ;
MAX ; Maximum.
+1 ;
+2 ; Assign DIR variables:
+3 ; Two minute maximum timeout for response.
SET DIR("T")=120
+4 SET DIR("A")=" Enter "_ORXPDIS_" # of items to display: "
+5 SET DIR("?")=" Entry must be between 1 and 999"
+6 ; Numerical, required.
SET DIR(0)="NA^1:999"
+7 ; Imaging not required.
IF ORXPDIR="IMAGING"
SET DIR(0)="NAO^1:999"
+8 ;
+9 ; Call tag to get/assign input:
+10 DO INPUT^ORXTABS2
+11 ;
+12 QUIT
+13 ;
AUTHOR ; Author, for D/C Summaries or Notes.
+1 ;
+2 ; Internal variables used:
+3 ;
+4 ; DIC,X,Y,DTOUT,DUOUT = Variables for call to DIC.
+5 ; ORXSTAT = Used to hold current value of related STATUS value.
+6 ;
+7 NEW DIC,X,Y,DTOUT,DUOUT,ORXSTAT
+8 ;
+9 ; Assign DIC variables and call DIC:
+10 SET DIC=200
+11 SET DIC(0)="AEFMQ"
+12 SET DIC("A")=" Select author: "
+13 SET DIC("B")=$PIECE($GET(^VA(200,DUZ,0)),U)
+14 SET DTIME=120
+15 ; Screen formatting.
WRITE !!
+16 DO ^DIC
+17 ;
+18 IF $DATA(DUOUT)
SET ORXNOW="^"
+19 IF $DATA(DTOUT)
SET ORXNOW="^"
+20 ;
+21 ; Examine user entry, treat if needed, and assign it for return:
+22 IF ORXNOW'="^"
if +Y'>0
SET Y=""
+23 IF ORXNOW'="^"
SET ORXNOW=+Y
+24 ;
+25 ; Use ORXSTAT twice to Check for valid entry:
+26 IF ORXNOW'=""
Begin DoDot:1
+27 IF (ORXCNT-1)<1
WRITE !!,"ERROR: Improper TABS entry."
SET ORXNOW="^"
QUIT
+28 SET ORXSTAT=$PIECE($GET(ORXSETS),";",ORXCNT-1)
+29 IF ORXSTAT'="STATUS"
WRITE !!,"ERROR: Improper TABS entry."
SET ORXNOW="^"
QUIT
+30 SET ORXSTAT=$PIECE($GET(ORXCUR),";",$PIECE($GET(ORXPCS),";",ORXCNT-1))
+31 ; Null STATUS = accept.
IF '$DATA(ORXSTAT)
QUIT
+32 ; If STATUS'=4, set null.
IF ((ORXSTAT=5)!(ORXNOW<4))
SET ORXNOW=""
End DoDot:1
+33 ;
+34 KILL DIC,X,Y,DTOUT,DUOUT
+35 ;
+36 QUIT
+37 ;