Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ORXTABS3

ORXTABS3.m

Go to the documentation of this file.
  1. 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
  1. ;
  1. ; NOTES: The routines herein are called by those of the same tag
  1. ; name in ORXTABS2. Most variables are NEW'd and assigned
  1. ; by one or more routines in the preceding call chains.
  1. ; Refer to comments and notes there for additional infor-
  1. ; mation.
  1. ;
  1. ; Each tag in this routine must return one of the following:
  1. ;
  1. ; 1 - A new value entered or selected by the user,
  1. ; 2 - A null string,
  1. ; 3 - The string "*Invalid*" - to repeat due to invalid entry,
  1. ; 4 - The "^" character, indicating user's cancel action.
  1. ;
  1. Q
  1. ;
  1. BEG ; Beginning date.
  1. ;
  1. ; Internal variables used:
  1. ;
  1. ; ORXBDAT = Current "BEG" date entry.
  1. ; ORXDATE = ORXNOW passed variable converted to external format.
  1. ; ORXEDAT = Matching "END" date data.
  1. ; ORXREQ = Flag for required or optional date entry.
  1. ; X = Passed variable used in date format conversion.
  1. ; Y = Passed variable used in date format conversion.
  1. ; %DT = Passed variable in date conversion.
  1. ;
  1. N ORXBDAT,ORXDATE,ORXEDAT,ORXREQ,X,Y,%DT
  1. K ORXDATE
  1. S ORXREQ="O"
  1. ;
  1. ; Assign DIR variables and call DIR:
  1. S DIR("T")=120 ; Two minute maximum timeout for response.
  1. S DIR("A")=" Enter "_ORXPDIS_" value: "
  1. S DIR("?")=" Enter beginning date; an empty response means an unrestricted beginning date range"
  1. I ORXPDIR="IMAGING"!(ORXPDIR="REPORTS") D ; Required in some cases.
  1. .S ORXREQ=""
  1. .S DIR("A")=" Enter "_ORXPDIS_" value (required): "
  1. .S DIR("?")=" Enter beginning date (required)"
  1. ;
  1. ; Assign DIR default, if any:
  1. I $L($G(ORXNOW)) S DIR("B")=$S(ORXNOW?7N.1".".6N:$$FMTE^XLFDT(ORXNOW),1:ORXNOW)
  1. S DIR(0)="DA"_ORXREQ_"^::ETX" ; DIR input restrictions.
  1. W !! ; For screen display.
  1. D ^DIR ; FM user input call.
  1. S:$D(DTOUT) Y="^" ; Handle time-outs.
  1. S (ORXNOW,ORXBDAT)=Y ; ORXBDAT for comparison.
  1. S:X="@" ORXNOW="",ORXBDAT="" ; User wants null entry.
  1. S:(X'="@")&(X'="^") ORXNOW=X ; Or use X value.
  1. K DIR,X,Y ; Clean up each time.
  1. ;
  1. ; Use ORXEDAT twice to Check for valid date entry:
  1. I ORXBDAT'="" D
  1. .I ORXNOW="^" Q
  1. .I (ORXCNT+1)>ORXNUM W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
  1. .S ORXEDAT=$P($G(ORXSETS),";",ORXCNT+1)
  1. .I ORXEDAT'="END" W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
  1. .S ORXEDAT=$P($G(ORXCUR),";",$P($G(ORXPCS),";",ORXCNT+1))
  1. .I ('$D(ORXEDAT)!(ORXEDAT="")) Q ; Null END = accept.
  1. .S %DT="",X=ORXEDAT D ^%DT S ORXEDAT=Y ; Convert all dates.
  1. .I ORXEDAT<ORXBDAT W !!,"ERROR: Beginning date cannot be later than ending date." S ORXNOW="*Invalid*"
  1. ;
  1. Q
  1. ;
  1. END ; Ending date.
  1. ;
  1. ; Internal variables used:
  1. ;
  1. ; ORXBDAT = Matching "BEG" date data.
  1. ; ORXEDAT = Current "END" date entry.
  1. ; ORXDATE = ORXNOW passed variable converted to external format.
  1. ; ORXREQ = Flag for required or optional date entry.
  1. ; X = Passed variable used in date format conversion.
  1. ; Y = Passed variable used in date format conversion.
  1. ; %DT = Passed variable in date conversion.
  1. ;
  1. N ORXBDAT,ORXEDAT,ORXDATE,ORXREQ,X,Y,%DT
  1. K ORXDATE
  1. S ORXREQ="O"
  1. ;
  1. ; Assign DIR variables and call DIR:
  1. S DIR("T")=120 ; Two minute maximum timeout for response.
  1. S DIR("A")=" Enter "_ORXPDIS_" value: "
  1. S DIR("?")=" Enter ending date; a null response means an unlimited ending date range"
  1. I ORXPDIR="IMAGING"!(ORXPDIR="REPORTS") D ; Required in some cases.
  1. .S ORXREQ=""
  1. .S DIR("A")=" Enter "_ORXPDIS_" value (required): "
  1. .S DIR("?")=" Enter ending date (required)"
  1. ;
  1. ; Assign DIR default, if any:
  1. I $L($G(ORXNOW)) S DIR("B")=$S(ORXNOW?7N.1".".6N:$$FMTE^XLFDT(ORXNOW),1:ORXNOW)
  1. S DIR(0)="DA"_ORXREQ_"^::ETX" ; DIR input restrictions.
  1. W !! ; For screen display.
  1. D ^DIR ; FM user input call.
  1. S:$D(DTOUT) Y="^" ; Handle time-outs.
  1. S (ORXNOW,ORXEDAT)=Y ; ORXEDAT for comparison.
  1. S:X="@" ORXNOW="",ORXEDAT="" ; User wants null entry.
  1. S:(X'="@")&(X'="^") ORXNOW=X ; Or use X value.
  1. K DIR,X,Y ; Clean up each time.
  1. ;
  1. ; Use ORXBDAT twice to Check for valid date entry:
  1. I ORXEDAT'="" D
  1. .I ORXNOW="^" Q
  1. .I (ORXCNT-1)<1 W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
  1. .S ORXBDAT=$P($G(ORXSETS),";",ORXCNT-1)
  1. .I ORXBDAT'="BEG" W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
  1. .S ORXBDAT=$P($G(ORXCUR),";",$P($G(ORXPCS),";",ORXCNT-1))
  1. .I ('$D(ORXBDAT)!(ORXBDAT="")) Q ; Null BEG = accept.
  1. .S %DT="",X=ORXBDAT D ^%DT S ORXBDAT=Y ; Convert all dates.
  1. .I ORXBDAT>ORXEDAT W !!,"ERROR: Ending date cannot be earlier than beginning date." S ORXNOW="*Invalid*"
  1. ;
  1. Q
  1. ;
  1. MAX ; Maximum.
  1. ;
  1. ; Assign DIR variables:
  1. S DIR("T")=120 ; Two minute maximum timeout for response.
  1. S DIR("A")=" Enter "_ORXPDIS_" # of items to display: "
  1. S DIR("?")=" Entry must be between 1 and 999"
  1. S DIR(0)="NA^1:999" ; Numerical, required.
  1. I ORXPDIR="IMAGING" S DIR(0)="NAO^1:999" ; Imaging not required.
  1. ;
  1. ; Call tag to get/assign input:
  1. D INPUT^ORXTABS2
  1. ;
  1. Q
  1. ;
  1. AUTHOR ; Author, for D/C Summaries or Notes.
  1. ;
  1. ; Internal variables used:
  1. ;
  1. ; DIC,X,Y,DTOUT,DUOUT = Variables for call to DIC.
  1. ; ORXSTAT = Used to hold current value of related STATUS value.
  1. ;
  1. N DIC,X,Y,DTOUT,DUOUT,ORXSTAT
  1. ;
  1. ; Assign DIC variables and call DIC:
  1. S DIC=200
  1. S DIC(0)="AEFMQ"
  1. S DIC("A")=" Select author: "
  1. S DIC("B")=$P($G(^VA(200,DUZ,0)),U)
  1. S DTIME=120
  1. W !! ; Screen formatting.
  1. D ^DIC
  1. ;
  1. I $D(DUOUT) S ORXNOW="^"
  1. I $D(DTOUT) S ORXNOW="^"
  1. ;
  1. ; Examine user entry, treat if needed, and assign it for return:
  1. I ORXNOW'="^" S:+Y'>0 Y=""
  1. I ORXNOW'="^" S ORXNOW=+Y
  1. ;
  1. ; Use ORXSTAT twice to Check for valid entry:
  1. I ORXNOW'="" D
  1. .I (ORXCNT-1)<1 W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
  1. .S ORXSTAT=$P($G(ORXSETS),";",ORXCNT-1)
  1. .I ORXSTAT'="STATUS" W !!,"ERROR: Improper TABS entry." S ORXNOW="^" Q
  1. .S ORXSTAT=$P($G(ORXCUR),";",$P($G(ORXPCS),";",ORXCNT-1))
  1. .I '$D(ORXSTAT) Q ; Null STATUS = accept.
  1. .I ((ORXSTAT=5)!(ORXNOW<4)) S ORXNOW="" ; If STATUS'=4, set null.
  1. ;
  1. K DIC,X,Y,DTOUT,DUOUT
  1. ;
  1. Q
  1. ;