source: WorldVistAEHR/trunk/r/NOIS-FSC/FSCLIMIT.m@ 1154

Last change on this file since 1154 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.3 KB
Line 
1FSCLIMIT ;SLC/STAFF-NOIS Limit Restrictions ;1/13/98 12:31
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4RESTRICT(RESTRICT) ; from FSCULOOK
5 N OK
6 S OK=0 F D Q:OK
7 .N DIR,X,Y K DIR S RESTRICT=""
8 .S DIR(0)="SAMO^DATE RANGE:DATE RANGE;LAST N CALLS:LAST N CALLS;NO RESTRICTION:NO RESTRICTION"
9 .S DIR("A",1)="-- restrictions that can be applied to this list --"
10 .S DIR("A")="(D)ate range, (L)ast n calls, (N)o restriction: "
11 .S DIR("B")="NO RESTRICTION"
12 .S DIR("?",1)="Enter DATE RANGE to restrict calls to a date range (date openend)."
13 .S DIR("?",2)="Enter LAST N CALLS to restrict to the last number of calls received."
14 .S DIR("?",3)="Enter NO RESTRICTIONS or '^' to get the entire list."
15 .S DIR("?",4)="Enter '??' for further help."
16 .S DIR("?")="^D HELP^FSCU(.DIR)"
17 .S DIR("??")="FSC U1 NOIS"
18 .D ^DIR K DIR
19 .S OK=1
20 .D
21 ..I Y="NO RESTRICTION" S RESTRICT=0 Q
22 ..I Y="DATE RANGE" D Q
23 ...N FROM,TO
24 ...D DATES(.FROM,.TO)
25 ...I FROM,TO S RESTRICT="1^^"_FROM_U_TO Q
26 ...S OK=0 W $C(7)
27 ..I Y="LAST N CALLS" D Q
28 ...N LASTN
29 ...D LASTN(.LASTN)
30 ...I LASTN S RESTRICT="1^"_LASTN Q
31 ...S OK=0 W $C(7)
32 Q
33 ;
34DATES(FROM,TO) ;
35 N DIR,X,Y K DIR S (FROM,TO)=0
36 S DIR(0)="DAO^2900101:DT:EX"
37 S DIR("A")="From: "
38 S DIR("?",1)="Enter the beginning date of a date range."
39 S DIR("?")="^D HELP^%DTC,HELP^FSCU(.DIR)"
40 S DIR("??")="FSC U1 NOIS"
41 D ^DIR K DIR
42 I $D(DIRUT) Q
43 S FROM=Y
44 ;
45 N DIR,X,Y K DIR
46 S DIR(0)="DAO^2900101:DT:EX"
47 S DIR("A")="To: "
48 S DIR("?",1)="Enter the ending date of a date range."
49 S DIR("?")="^D HELP^%DTC,HELP^FSCU(.DIR)"
50 S DIR("??")="FSC U1 NOIS"
51 D ^DIR K DIR
52 I $D(DIRUT) S FROM=0 Q
53 S TO=Y I FROM>TO S X=FROM,FROM=TO,TO=X
54 Q
55 ;
56LASTN(LASTN) ;
57 N DIR,X,Y K DIR S LASTN=0
58 S DIR(0)="NAO^1:100000:0"
59 S DIR("A")="Enter the maximum number of the last calls received: "
60 S DIR("?",1)="Enter the maximum number of calls you want from this list."
61 S DIR("?",2)="The calls will be restricted to this number of calls, starting with"
62 S DIR("?",3)="the most recently entered call, up to but not exceeding the number."
63 S DIR("?")="^D HELP^FSCU(.DIR)"
64 S DIR("??")="FSC U1 NOIS"
65 D ^DIR K DIR
66 I $D(DIRUT) Q
67 S LASTN=+Y
68 Q
69 ;
70ASK(LIST) ; $$(list#) -> 1 or 0, on whether to ask for restrictions
71 N APPROX,LIMIT
72 S LIMIT=$P($G(^FSC("LIST",+LIST,0)),U,8),APPROX=$P($G(^(0)),U,9)
73 I 'LIMIT Q 0
74 I LIMIT=-1 Q 1
75 I APPROX,APPROX>LIMIT Q 1
76 Q 0
Note: See TracBrowser for help on using the repository browser.