source: WorldVistAEHR/trunk/r/NOIS-FSC/FSCLMPQR.m@ 619

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

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1FSCLMPQR ;SLC/STAFF-NOIS List Manager Protocol Query Remove ;1/13/98 13:06
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4REMOVE ; from FSCLMP
5 I '^TMP("FSC LIST CALLS",$J) W !,$C(7),"You can't delete from an empty list." H 2 Q
6 N DIR,SELECT,X,Y K DIR
7 S DIR(0)="SAMO^S:Selected Calls;L:Lists;Q:Query;A:All Calls"
8 S DIR("A")="Remove using: " W !,"(S)elected Calls, (L)ists, (Q)uery, (A)ll Calls"
9 S DIR("?",1)="Enter S to a remove selected calls from the last."
10 S DIR("?",2)="Enter L to remove calls from the list that are on selected lists."
11 S DIR("?",3)="Enter Q to remove calls from the list using a specific criteria."
12 S DIR("?",4)="Enter A to remove all calls on the list."
13 S DIR("?",5)="Note: changing a list does not change what is stored on the list."
14 S DIR("?",6)="When a list is changed it appears as (MODIFIED)."
15 S DIR("?",7)="Enter '^' to exit without changing the list or '??' for more help."
16 S DIR("?")="^D HELP^FSCU(.DIR)"
17 S DIR("??")="FSC U1 NOIS"
18 D ^DIR K DIR
19 S SELECT=Y
20 D
21 .I SELECT="S" D Q
22 ..N CALL,CHOICE,DEFAULT,LNUM,OK
23 ..K ^TMP("FSC SELECT",$J,"RVALUES")
24 ..S CHOICE="1-"_+@VALMAR,DEFAULT="" D SELECT^FSCUL(CHOICE,"",DEFAULT,"RVALUES",.OK)
25 ..I '$O(^TMP("FSC SELECT",$J,"RVALUES",0)) Q
26 ..W !
27 ..S LNUM=0 F S LNUM=$O(^TMP("FSC LIST CALLS",$J,"IDX",LNUM)) Q:LNUM<1 S CALL=+$O(^TMP("FSC LIST CALLS",$J,"ICX",+$O(^(LNUM,0)),0)) D
28 ...S ^TMP("FSC MERGE",$J,LNUM,CALL)=""
29 ..K ^TMP("FSC LIST CALLS",$J)
30 ..S (LNUM,VALMCNT)=0 F S LNUM=$O(^TMP("FSC MERGE",$J,LNUM)) Q:LNUM<1 S CALL=$O(^(LNUM,0)) D
31 ...I '$D(^TMP("FSC SELECT",$J,"RVALUES",LNUM)) D SETUP^FSCLMPQU(.VALMCNT,CALL)
32 ..D COUNT^FSCLMPQU(VALMCNT)
33 ..K ^TMP("FSC MERGE",$J),^TMP("FSC SELECT",$J,"RVALUES")
34 .I SELECT="A" D Q
35 ..K ^TMP("FSC LIST CALLS",$J)
36 ..S ^TMP("FSC LIST CALLS",$J)="0^0"
37 ..D HDR^FSCLMPQU
38 .I SELECT="L" D Q
39 ..N CALL,CALLX,LIMITS,LINDX,LISTNUM,LISTS,LNAME,LNUM,OK,TIME K LIMITS,LISTS
40 ..D LIST^FSCLMPQU(.LISTS,.LIMITS,.OK)
41 ..I '$O(LISTS(0)) Q
42 ..W !
43 ..S LNUM=0 F S LNUM=$O(^TMP("FSC LIST CALLS",$J,"ICX",LNUM)) Q:LNUM<1 S CALL=+$O(^(LNUM,0)) D
44 ...S ^TMP("FSC MERGE",$J,LNUM,CALL)=""
45 ..K ^TMP("FSC LIST CALLS",$J)
46 ..S (LNUM,VALMCNT)=0 F S LNUM=$O(^TMP("FSC MERGE",$J,LNUM)) Q:LNUM<1 S CALL=$O(^(LNUM,0)) D I $D(VALMQUIT) Q
47 ...S OK=1,LISTNUM=0 F S LISTNUM=$O(LISTS(LISTNUM)) Q:LISTNUM<1 D I 'OK Q
48 ....S LNAME=$P(^FSC("LIST",+$P(LISTNUM,"."),0),U),LINDX=+$P(LISTNUM,".",2)
49 ....I LNAME="MRE:" D Q
50 .....S TIME="" F S TIME=$O(^FSCD("MRE","AUTC",LINDX,TIME)) Q:TIME="" D Q:'OK
51 ......S CALLX=0 F S CALLX=$O(^FSCD("MRE","AUTC",LINDX,TIME,CALLX)) Q:CALLX<1 I CALLX=CALL S OK=0 Q
52 ....I LNAME="MRA:" D Q
53 .....S TIME="" F S TIME=$O(^FSCD("MRA","AUTC",LINDX,TIME)) Q:TIME="" D Q:'OK
54 ......S CALLX=0 F S CALLX=$O(^FSCD("MRA","AUTC",LINDX,TIME,CALLX)) Q:CALLX<1 I CALLX=CALL S OK=0 Q
55 ....I $D(@LISTS(LISTNUM)@(CALL)) D CHECK(CALL,LISTS(LISTNUM),LIMITS(LISTNUM),.OK)
56 ...I OK D SETUP^FSCLMPQU(.VALMCNT,CALL) I (VALMCNT#10)=0 D CHECK^FSCLML(.VALMQUIT) I $D(VALMQUIT) S VALMBCK="Q" Q
57 ..D COUNT^FSCLMPQU(VALMCNT)
58 ..K ^TMP("FSC MERGE",$J)
59 .I SELECT="Q" D Q
60 ..D QUERY^FSCLMPQU("Remove")
61 I '$D(VALMQUIT) D EMPTY^FSCLMPQU
62 S VALMBG=1
63 Q
64 ;
65CHECK(CALL,LIST,LIMIT,OK) ;
66 N CNT,DATEO,NUM
67 I 'LIMIT S OK=0 Q
68 S OK=1
69 I $P(LIMIT,U,2) D Q
70 .S CNT=0,NUM="A" F S NUM=$O(@LIST@(NUM),-1) Q:NUM<1 S CNT=CNT+1 I NUM=CALL S:CNT'>$P(LIMIT,U,2) OK=0 Q
71 S DATEO=$P(^FSCD("CALL",CALL,0),U,3)
72 I DATEO'<$P(LIMIT,U,3),DATEO'>$P(LIMIT,U,4) S OK=0
73 Q
Note: See TracBrowser for help on using the repository browser.