FSCLIMIT ;SLC/STAFF-NOIS Limit Restrictions ;1/13/98 12:31
;;1.1;NOIS;;Sep 06, 1998
;
RESTRICT(RESTRICT) ; from FSCULOOK
N OK
S OK=0 F D Q:OK
.N DIR,X,Y K DIR S RESTRICT=""
.S DIR(0)="SAMO^DATE RANGE:DATE RANGE;LAST N CALLS:LAST N CALLS;NO RESTRICTION:NO RESTRICTION"
.S DIR("A",1)="-- restrictions that can be applied to this list --"
.S DIR("A")="(D)ate range, (L)ast n calls, (N)o restriction: "
.S DIR("B")="NO RESTRICTION"
.S DIR("?",1)="Enter DATE RANGE to restrict calls to a date range (date openend)."
.S DIR("?",2)="Enter LAST N CALLS to restrict to the last number of calls received."
.S DIR("?",3)="Enter NO RESTRICTIONS or '^' to get the entire list."
.S DIR("?",4)="Enter '??' for further help."
.S DIR("?")="^D HELP^FSCU(.DIR)"
.S DIR("??")="FSC U1 NOIS"
.D ^DIR K DIR
.S OK=1
.D
..I Y="NO RESTRICTION" S RESTRICT=0 Q
..I Y="DATE RANGE" D Q
...N FROM,TO
...D DATES(.FROM,.TO)
...I FROM,TO S RESTRICT="1^^"_FROM_U_TO Q
...S OK=0 W $C(7)
..I Y="LAST N CALLS" D Q
...N LASTN
...D LASTN(.LASTN)
...I LASTN S RESTRICT="1^"_LASTN Q
...S OK=0 W $C(7)
Q
;
DATES(FROM,TO) ;
N DIR,X,Y K DIR S (FROM,TO)=0
S DIR(0)="DAO^2900101:DT:EX"
S DIR("A")="From: "
S DIR("?",1)="Enter the beginning date of a date range."
S DIR("?")="^D HELP^%DTC,HELP^FSCU(.DIR)"
S DIR("??")="FSC U1 NOIS"
D ^DIR K DIR
I $D(DIRUT) Q
S FROM=Y
;
N DIR,X,Y K DIR
S DIR(0)="DAO^2900101:DT:EX"
S DIR("A")="To: "
S DIR("?",1)="Enter the ending date of a date range."
S DIR("?")="^D HELP^%DTC,HELP^FSCU(.DIR)"
S DIR("??")="FSC U1 NOIS"
D ^DIR K DIR
I $D(DIRUT) S FROM=0 Q
S TO=Y I FROM>TO S X=FROM,FROM=TO,TO=X
Q
;
LASTN(LASTN) ;
N DIR,X,Y K DIR S LASTN=0
S DIR(0)="NAO^1:100000:0"
S DIR("A")="Enter the maximum number of the last calls received: "
S DIR("?",1)="Enter the maximum number of calls you want from this list."
S DIR("?",2)="The calls will be restricted to this number of calls, starting with"
S DIR("?",3)="the most recently entered call, up to but not exceeding the number."
S DIR("?")="^D HELP^FSCU(.DIR)"
S DIR("??")="FSC U1 NOIS"
D ^DIR K DIR
I $D(DIRUT) Q
S LASTN=+Y
Q
;
ASK(LIST) ; $$(list#) -> 1 or 0, on whether to ask for restrictions
N APPROX,LIMIT
S LIMIT=$P($G(^FSC("LIST",+LIST,0)),U,8),APPROX=$P($G(^(0)),U,9)
I 'LIMIT Q 0
I LIMIT=-1 Q 1
I APPROX,APPROX>LIMIT Q 1
Q 0
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCLIMIT 2418 printed Oct 16, 2024@18:18:40 Page 2
FSCLIMIT ;SLC/STAFF-NOIS Limit Restrictions ;1/13/98 12:31
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
RESTRICT(RESTRICT) ; from FSCULOOK
+1 NEW OK
+2 SET OK=0
FOR
Begin DoDot:1
+3 NEW DIR,X,Y
KILL DIR
SET RESTRICT=""
+4 SET DIR(0)="SAMO^DATE RANGE:DATE RANGE;LAST N CALLS:LAST N CALLS;NO RESTRICTION:NO RESTRICTION"
+5 SET DIR("A",1)="-- restrictions that can be applied to this list --"
+6 SET DIR("A")="(D)ate range, (L)ast n calls, (N)o restriction: "
+7 SET DIR("B")="NO RESTRICTION"
+8 SET DIR("?",1)="Enter DATE RANGE to restrict calls to a date range (date openend)."
+9 SET DIR("?",2)="Enter LAST N CALLS to restrict to the last number of calls received."
+10 SET DIR("?",3)="Enter NO RESTRICTIONS or '^' to get the entire list."
+11 SET DIR("?",4)="Enter '??' for further help."
+12 SET DIR("?")="^D HELP^FSCU(.DIR)"
+13 SET DIR("??")="FSC U1 NOIS"
+14 DO ^DIR
KILL DIR
+15 SET OK=1
+16 Begin DoDot:2
+17 IF Y="NO RESTRICTION"
SET RESTRICT=0
QUIT
+18 IF Y="DATE RANGE"
Begin DoDot:3
+19 NEW FROM,TO
+20 DO DATES(.FROM,.TO)
+21 IF FROM
IF TO
SET RESTRICT="1^^"_FROM_U_TO
QUIT
+22 SET OK=0
WRITE $CHAR(7)
End DoDot:3
QUIT
+23 IF Y="LAST N CALLS"
Begin DoDot:3
+24 NEW LASTN
+25 DO LASTN(.LASTN)
+26 IF LASTN
SET RESTRICT="1^"_LASTN
QUIT
+27 SET OK=0
WRITE $CHAR(7)
End DoDot:3
QUIT
End DoDot:2
End DoDot:1
if OK
QUIT
+28 QUIT
+29 ;
DATES(FROM,TO) ;
+1 NEW DIR,X,Y
KILL DIR
SET (FROM,TO)=0
+2 SET DIR(0)="DAO^2900101:DT:EX"
+3 SET DIR("A")="From: "
+4 SET DIR("?",1)="Enter the beginning date of a date range."
+5 SET DIR("?")="^D HELP^%DTC,HELP^FSCU(.DIR)"
+6 SET DIR("??")="FSC U1 NOIS"
+7 DO ^DIR
KILL DIR
+8 IF $DATA(DIRUT)
QUIT
+9 SET FROM=Y
+10 ;
+11 NEW DIR,X,Y
KILL DIR
+12 SET DIR(0)="DAO^2900101:DT:EX"
+13 SET DIR("A")="To: "
+14 SET DIR("?",1)="Enter the ending date of a date range."
+15 SET DIR("?")="^D HELP^%DTC,HELP^FSCU(.DIR)"
+16 SET DIR("??")="FSC U1 NOIS"
+17 DO ^DIR
KILL DIR
+18 IF $DATA(DIRUT)
SET FROM=0
QUIT
+19 SET TO=Y
IF FROM>TO
SET X=FROM
SET FROM=TO
SET TO=X
+20 QUIT
+21 ;
LASTN(LASTN) ;
+1 NEW DIR,X,Y
KILL DIR
SET LASTN=0
+2 SET DIR(0)="NAO^1:100000:0"
+3 SET DIR("A")="Enter the maximum number of the last calls received: "
+4 SET DIR("?",1)="Enter the maximum number of calls you want from this list."
+5 SET DIR("?",2)="The calls will be restricted to this number of calls, starting with"
+6 SET DIR("?",3)="the most recently entered call, up to but not exceeding the number."
+7 SET DIR("?")="^D HELP^FSCU(.DIR)"
+8 SET DIR("??")="FSC U1 NOIS"
+9 DO ^DIR
KILL DIR
+10 IF $DATA(DIRUT)
QUIT
+11 SET LASTN=+Y
+12 QUIT
+13 ;
ASK(LIST) ; $$(list#) -> 1 or 0, on whether to ask for restrictions
+1 NEW APPROX,LIMIT
+2 SET LIMIT=$PIECE($GET(^FSC("LIST",+LIST,0)),U,8)
SET APPROX=$PIECE($GET(^(0)),U,9)
+3 IF 'LIMIT
QUIT 0
+4 IF LIMIT=-1
QUIT 1
+5 IF APPROX
IF APPROX>LIMIT
QUIT 1
+6 QUIT 0