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

FSCLIMIT.m

Go to the documentation of this file.
  1. FSCLIMIT ;SLC/STAFF-NOIS Limit Restrictions ;1/13/98 12:31
  1. ;;1.1;NOIS;;Sep 06, 1998
  1. ;
  1. RESTRICT(RESTRICT) ; from FSCULOOK
  1. N OK
  1. S OK=0 F D Q:OK
  1. .N DIR,X,Y K DIR S RESTRICT=""
  1. .S DIR(0)="SAMO^DATE RANGE:DATE RANGE;LAST N CALLS:LAST N CALLS;NO RESTRICTION:NO RESTRICTION"
  1. .S DIR("A",1)="-- restrictions that can be applied to this list --"
  1. .S DIR("A")="(D)ate range, (L)ast n calls, (N)o restriction: "
  1. .S DIR("B")="NO RESTRICTION"
  1. .S DIR("?",1)="Enter DATE RANGE to restrict calls to a date range (date openend)."
  1. .S DIR("?",2)="Enter LAST N CALLS to restrict to the last number of calls received."
  1. .S DIR("?",3)="Enter NO RESTRICTIONS or '^' to get the entire list."
  1. .S DIR("?",4)="Enter '??' for further help."
  1. .S DIR("?")="^D HELP^FSCU(.DIR)"
  1. .S DIR("??")="FSC U1 NOIS"
  1. .D ^DIR K DIR
  1. .S OK=1
  1. .D
  1. ..I Y="NO RESTRICTION" S RESTRICT=0 Q
  1. ..I Y="DATE RANGE" D Q
  1. ...N FROM,TO
  1. ...D DATES(.FROM,.TO)
  1. ...I FROM,TO S RESTRICT="1^^"_FROM_U_TO Q
  1. ...S OK=0 W $C(7)
  1. ..I Y="LAST N CALLS" D Q
  1. ...N LASTN
  1. ...D LASTN(.LASTN)
  1. ...I LASTN S RESTRICT="1^"_LASTN Q
  1. ...S OK=0 W $C(7)
  1. Q
  1. ;
  1. DATES(FROM,TO) ;
  1. N DIR,X,Y K DIR S (FROM,TO)=0
  1. S DIR(0)="DAO^2900101:DT:EX"
  1. S DIR("A")="From: "
  1. S DIR("?",1)="Enter the beginning date of a date range."
  1. S DIR("?")="^D HELP^%DTC,HELP^FSCU(.DIR)"
  1. S DIR("??")="FSC U1 NOIS"
  1. D ^DIR K DIR
  1. I $D(DIRUT) Q
  1. S FROM=Y
  1. ;
  1. N DIR,X,Y K DIR
  1. S DIR(0)="DAO^2900101:DT:EX"
  1. S DIR("A")="To: "
  1. S DIR("?",1)="Enter the ending date of a date range."
  1. S DIR("?")="^D HELP^%DTC,HELP^FSCU(.DIR)"
  1. S DIR("??")="FSC U1 NOIS"
  1. D ^DIR K DIR
  1. I $D(DIRUT) S FROM=0 Q
  1. S TO=Y I FROM>TO S X=FROM,FROM=TO,TO=X
  1. Q
  1. ;
  1. LASTN(LASTN) ;
  1. N DIR,X,Y K DIR S LASTN=0
  1. S DIR(0)="NAO^1:100000:0"
  1. S DIR("A")="Enter the maximum number of the last calls received: "
  1. S DIR("?",1)="Enter the maximum number of calls you want from this list."
  1. S DIR("?",2)="The calls will be restricted to this number of calls, starting with"
  1. S DIR("?",3)="the most recently entered call, up to but not exceeding the number."
  1. S DIR("?")="^D HELP^FSCU(.DIR)"
  1. S DIR("??")="FSC U1 NOIS"
  1. D ^DIR K DIR
  1. I $D(DIRUT) Q
  1. S LASTN=+Y
  1. Q
  1. ;
  1. ASK(LIST) ; $$(list#) -> 1 or 0, on whether to ask for restrictions
  1. N APPROX,LIMIT
  1. S LIMIT=$P($G(^FSC("LIST",+LIST,0)),U,8),APPROX=$P($G(^(0)),U,9)
  1. I 'LIMIT Q 0
  1. I LIMIT=-1 Q 1
  1. I APPROX,APPROX>LIMIT Q 1
  1. Q 0