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

FSCRPCL.m

Go to the documentation of this file.
FSCRPCL ;SLC/STAFF-NOIS RPC List ;9/6/98  22:00
 ;;1.1;NOIS;;Sep 06, 1998
LIST(IN,OUT) ; from FSCRPX (RPCListCalls)
 N INPUT,LIMITDFM,LIMITDTO,LIMITNUM,LIST0,LISTINDX,LISTNUM,MAX
 S INPUT=$G(^TMP("FSCRPC",$J,"INPUT",1))
 S LISTNUM=+INPUT,LISTINDX=+$P(INPUT,U,2),LIMITNUM=+$P(INPUT,U,3),LIMITDFM=+$P(INPUT,U,4),LIMITDTO=+$P(INPUT,U,5)
 S LIST0=$G(^FSC("LIST",LISTNUM,0))
 I '$L(LIST0) Q
 S MAX=$$MAX
 D KILLLIST
 D MRU^FSCMR(DUZ,LISTNUM,LISTINDX)
 I $E(LIST0,1,4)="MRE:" D MR("MRE",LISTINDX,LIMITNUM,LIMITDTO,LIMITDFM)
 E  I $E(LIST0,1,4)="MRA:" D MR("MRA",LISTINDX,LIMITNUM,LIMITDTO,LIMITDFM)
 E  I $L($P(LIST0,U,4)) D INDEX(LIST0,MAX,LISTINDX,LIMITNUM,LIMITDTO,LIMITDFM)
 E  I $P(LIST0,U,3)="M" D MANUAL(MAX,LISTNUM,LIMITNUM,LIMITDTO,LIMITDFM)
 E  D OTHER(MAX,LISTNUM,LIMITNUM,LIMITDTO,LIMITDFM)
 Q
 ;
MR(NODE,LISTINDX,LIMITNUM,LIMITDTO,LIMITDFM) ;
 N CALL,DATEO,LNUM,TIME
 S LNUM=0
 I LIMITNUM D
 .S TIME="" F  S TIME=$O(^FSCD(NODE,"AUTC",LISTINDX,TIME)) Q:TIME=""  D  I LNUM'<LIMITNUM Q
 ..S CALL=0 F  S CALL=$O(^FSCD(NODE,"AUTC",LISTINDX,TIME,CALL)) Q:CALL<1  D SETUP(CALL,.LNUM) I LNUM'<LIMITNUM Q
 E  I LIMITDTO!LIMITDFM D
 .S TIME="" F  S TIME=$O(^FSCD(NODE,"AUTC",LISTINDX,TIME)) Q:TIME=""  D
 ..S CALL=0 F  S CALL=$O(^FSCD(NODE,"AUTC",LISTINDX,TIME,CALL)) Q:CALL<1  D
 ...S DATE0=$P(^FSCD("CALL",CALL,0),U,3)
 ...I DATEO<LIMITDFM Q
 ...I DATEO>LIMITDTO Q
 ...D SETUP(CALL,.LNUM)
 E  D
 .S TIME="" F  S TIME=$O(^FSCD(NODE,"AUTC",LISTINDX,TIME)) Q:TIME=""  D
 ..S CALL=0 F  S CALL=$O(^FSCD(NODE,"AUTC",LISTINDX,TIME,CALL)) Q:CALL<1  D SETUP(CALL,.LNUM)
 Q
 ;
INDEX(LIST0,MAX,LISTINDX,LIMITNUM,LIMITDTO,LIMITDFM) ;
 N CALL,DATEO,LNUM,SOURCE
 S LNUM=0
 S SOURCE="^FSCD(""CALL"","_$P(LIST0,U,4)_$S(LISTINDX:","_LISTINDX,1:"")_")"
 I LIMITNUM D
 .S CALL="A" F  S CALL=$O(@SOURCE@(CALL),-1) Q:CALL<1  D SETUP(CALL,.LNUM) Q:LNUM'<LIMITNUM  Q:LNUM'<MAX
 E  I LIMITDTO!LIMITDFM D
 .S CALL="A" F  S CALL=$O(@SOURCE@(CALL),-1) Q:CALL<1  D  Q:LNUM'<MAX
 ..S DATEO=$P(^FSCD("CALL",CALL,0),U,3)
 ..I DATEO<LIMITDFM Q
 ..I DATEO>LIMITDTO Q
 ..D SETUP(CALL,.LNUM)
 E  D
 .S CALL="A" F  S CALL=$O(@SOURCE@(CALL),-1) Q:CALL<1  D SETUP(CALL,.LNUM) Q:LNUM'<MAX
 Q
 ;
MANUAL(MAX,LISTNUM,LIMITNUM,LIMITDTO,LIMITDFM) ;
 N CALL,DATEO,LNUM
 K ^TMP("FSC LIST",$J)
 S LNUM=0
 D MANUAL^FSCLP(LISTNUM)
 I LIMITNUM D
 .S CALL="A" F  S CALL=$O(^TMP("FSC LIST",$J,CALL),-1) Q:CALL<1  D SETUP(CALL,.LNUM) Q:LNUM'<LIMITNUM  Q:LNUM'<MAX
 E  I LIMITDTO!LIMITDFM D
 .S CALL="A" F  S CALL=$O(^TMP("FSC LIST",$J,CALL),-1) Q:CALL<1  D  Q:LNUM'<MAX
 ..S DATEO=$P(^FSCD("CALL",CALL,0),U,3)
 ..I DATEO<LIMITDFM Q
 ..I DATEO>LIMITDTO Q
 ..D SETUP(CALL,.LNUM)
 E  D
 .S CALL="A" F  S CALL=$O(^TMP("FSC LIST",$J,CALL),-1) Q:CALL<1  D SETUP(CALL,.LNUM) Q:LNUM'<MAX
 K ^TMP("FSC LIST",$J)
 Q
 ;
OTHER(MAX,LISTNUM,LIMITNUM,LIMITDTO,LIMITDFM) ;
 N CALL,DATEO,LISTCALL,LNUM
 S LNUM=0
 I LIMITNUM D
 .S LISTCALL="A" F  S LISTCALL=$O(^FSCD("LISTS","L",LISTNUM,LISTCALL),-1) Q:LISTCALL<1  S CALL=+$G(^FSCD("LISTS",LISTCALL,0)) D SETUP(CALL,.LNUM) Q:LNUM'<LIMITNUM  Q:LNUM'<MAX
 E  I LIMITDTO!LIMITDFM D
 .S LISTCALL="A" F  S LISTCALL=$O(^FSCD("LISTS","L",LISTNUM,LISTCALL),-1) Q:LISTCALL<1  D  Q:LNUM'<MAX
 ..S CALL=+$G(^FSCD("LISTS",LISTCALL,0))
 ..S DATEO=$P(^FSCD("CALL",CALL,0),U,3)
 ..I DATEO<LIMITDFM Q
 ..I DATEO>LIMITDTO Q
 ..D SETUP(CALL,.LNUM)
 E  D
 .S LISTCALL="A" F  S LISTCALL=$O(^FSCD("LISTS","L",LISTNUM,LISTCALL),-1) Q:LISTCALL<1  S CALL=+$G(^FSCD("LISTS",LISTCALL,0)) D SETUP(CALL,.LNUM) Q:LNUM'<MAX
 Q
 ;
SETUP(CALL,LNUM) ;
 S LNUM=LNUM+1
 S (^TMP("FSC CURRENT LIST",$J,LNUM+1000),^TMP("FSCRPC",$J,"OUTPUT",LNUM))=CALL_U_$$SHORT^FSCRPXUS(CALL,DUZ)
 S ^TMP("FSC CURRENT LIST",$J,"C",CALL)=LNUM+1000
 Q
 ;
MAX() ; $$ -> max number of calls to return
 I $P($G(^FSC("PARAM",1,2)),U,2) Q +$P(^(2),U,2)
 Q 1000
 ;
CLEAR(IN,OUT) ; from FSCRPX (RPCClearList)
 D KILLLIST
 Q
 ;
KILLLIST ; from FSCRPCLO
 K ^TMP("FSC CURRENT LIST",$J)
 Q