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

FSCLMPQA.m

Go to the documentation of this file.
FSCLMPQA ;SLC/STAFF-NOIS List Manager Protocol Query Add ;3/24/98  11:47
 ;;1.1;NOIS;;Sep 06, 1998
 ;
ADD ; from FSCLMP
 N DIR,FSCLIMIT,SELECT,X,Y K DIR
 S VALMCNT=+$P(^TMP("FSC LIST CALLS",$J),U,2) I VALMCNT=0 K ^($J) S ^($J)="0^0"
 S DIR(0)="SAMO^S:Selected Calls;L:Lists;Q:Query;E:Expand"
 S DIR("A")="Add using: " W !,"(S)elected Calls, (L)ists, (Q)uery, (E)xpand"
 S DIR("?",1)="Enter S to add to the list specific calls."
 S DIR("?",2)="Enter L to add to the list calls from other lists."
 S DIR("?",3)="Enter Q to add to the list calls meeting a specific criteria."
 S DIR("?",4)="Enter E to to expand list to all duplicates."
 S DIR("?",5)="Note: changing a list does not change calls stored on the list."
 S DIR("?",6)="When a list is changed it appears as (MODIFIED)."
 S DIR("?",7)="Enter '^' to exit without changing the list or '??' for more help."
 S DIR("?")="^D HELP^FSCU(.DIR)"
 S DIR("??")="FSC U1 NOIS"
 D ^DIR K DIR
 S SELECT=Y
 D
 .I SELECT="E" D  Q
 ..N CALL,PRIMARY,SECOND K ^TMP("FSC MERGE",$J)
 ..M ^TMP("FSC MERGE",$J)=^TMP("FSC LIST CALLS",$J,"CX")
 ..K ^TMP("FSC LIST CALLS",$J)
 ..S ^TMP("FSC LIST CALLS",$J)="0^0"
 ..S VALMCNT=0
 ..S CALL=0 F  S CALL=$O(^TMP("FSC MERGE",$J,CALL)) Q:CALL<1  D
 ...S PRIMARY=+$P($G(^FSCD("CALL",CALL,120)),U,24) I 'PRIMARY Q
 ...S ^TMP("FSC MERGE",$J,"CX",PRIMARY)=""
 ..S CALL=0 F  S CALL=$O(^TMP("FSC MERGE",$J,"CX",CALL)) Q:CALL<1  D
 ...S ^TMP("FSC MERGE",$J,CALL)=""
 ..S CALL=0 F  S CALL=$O(^TMP("FSC MERGE",$J,"CX",CALL)) Q:CALL<1  D
 ...S SECOND=0 F  S SECOND=$O(^FSCD("CALL","APRIMARY",CALL,SECOND)) Q:SECOND<1  D
 ....S ^TMP("FSC MERGE",$J,SECOND)=""
 ..S CALL="A" F  S CALL=$O(^TMP("FSC MERGE",$J,CALL),-1) Q:CALL=""  D
 ...D SETUP^FSCLMPQU(.VALMCNT,CALL)
 ..D COUNT^FSCLMPQU(VALMCNT)
 ..D HDR^FSCLMPQU
 ..K ^TMP("FSC MERGE",$J)
 .I SELECT="S" D  Q
 ..N CALL,CALLS,DIC,Y K CALLS,DIC
 ..S DIC=7100,DIC(0)="AEMOQ",DIC("A")="Select Call: "
 ..F  D ^DIC Q:Y<1  S CALLS(+Y)=""
 ..K DIC
 ..I '$O(CALLS(0)) Q
 ..S CALL=0 F  S CALL=$O(CALLS(CALL)) Q:CALL<1  I '$D(^TMP("FSC LIST CALLS",$J,"CX",CALL)) D SETUP^FSCLMPQU(.VALMCNT,CALL)
 ..D COUNT^FSCLMPQU(VALMCNT)
 .I SELECT="L" D  Q
 ..N CALL,LIMIT,LIMITS,LINDX,LISTNUM,LISTS,LNAME,LNUM,OK,RLIST,TIME K LIMITS,LISTS
 ..D LIST^FSCLMPQU(.LISTS,.LIMITS,.OK)
 ..I 'OK Q
 ..I '$O(LISTS(0)) Q
 ..S LISTNUM=0 F  S LISTNUM=$O(LISTS(LISTNUM)) Q:LISTNUM<1  S RLIST=LISTS(LISTNUM),FSCLIMIT=LIMITS(LISTNUM) D  I $D(VALMQUIT) Q
 ...S LNAME=$P(^FSC("LIST",+$P(LISTNUM,"."),0),U),LINDX=+$P(LISTNUM,".",2)
 ...I LNAME="MRE:" D  Q
 ....S (LIMIT,LNUM)=0,TIME="" F  S TIME=$O(^FSCD("MRE","AUTC",LINDX,TIME)) Q:TIME=""  D  Q:LIMIT
 .....S CALL=0 F  S CALL=$O(^FSCD("MRE","AUTC",LINDX,TIME,CALL)) Q:CALL<1  I '$D(^TMP("FSC LIST CALLS",$J,"CX",CALL)) D CHECK(.VALMCNT,CALL,.LIMIT,.LNUM) Q:LIMIT
 ...I LNAME="MRA:" D  Q
 ....S (LIMIT,LNUM)=0,TIME="" F  S TIME=$O(^FSCD("MRA","AUTC",LINDX,TIME)) Q:TIME=""  D  Q:LIMIT
 .....S CALL=0 F  S CALL=$O(^FSCD("MRA","AUTC",LINDX,TIME,CALL)) Q:CALL<1  I '$D(^TMP("FSC LIST CALLS",$J,"CX",CALL)) D CHECK(.VALMCNT,CALL,.LIMIT,.LNUM) Q:LIMIT
 ...S (LIMIT,LNUM)=0,CALL="A" F  S CALL=$O(@RLIST@(CALL),-1) Q:CALL<1  I '$D(^TMP("FSC LIST CALLS",$J,"CX",CALL)) D CHECK(.VALMCNT,CALL,.LIMIT,.LNUM) Q:LIMIT  I (VALMCNT#10)=0 D CHECK^FSCLML(.VALMQUIT) I $D(VALMQUIT) S VALMBCK="Q" Q
 ..D COUNT^FSCLMPQU(VALMCNT)
 .I SELECT="Q" D  Q
 ..D QUERY^FSCLMPQU("Add")
 I '$D(VALMQUIT) D EMPTY^FSCLMPQU
 S VALMBG=1
 Q
 ;
CHECK(VALMCNT,CALL,LIMIT,LNUM) ;
 N DATEO,LIMITOK
 I $G(FSCLIMIT) S LIMITOK=1 D  Q:'LIMITOK
 .I $P(FSCLIMIT,U,2) S:LNUM'<$P(FSCLIMIT,U,2) LIMIT=1,LIMITOK=0 Q
 .S DATEO=$P(^FSCD("CALL",CALL,0),U,3)
 .I DATEO<$P(FSCLIMIT,U,3) S LIMITOK=0 Q
 .I DATEO>$P(FSCLIMIT,U,4) S LIMITOK=0 Q
 S LNUM=LNUM+1
 D SETUP^FSCLMPQU(.VALMCNT,CALL)
 Q