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
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCRPCL 4004 printed Dec 13, 2024@02:19:30 Page 2
FSCRPCL ;SLC/STAFF-NOIS RPC List ;9/6/98 22:00
+1 ;;1.1;NOIS;;Sep 06, 1998
LIST(IN,OUT) ; from FSCRPX (RPCListCalls)
+1 NEW INPUT,LIMITDFM,LIMITDTO,LIMITNUM,LIST0,LISTINDX,LISTNUM,MAX
+2 SET INPUT=$GET(^TMP("FSCRPC",$JOB,"INPUT",1))
+3 SET LISTNUM=+INPUT
SET LISTINDX=+$PIECE(INPUT,U,2)
SET LIMITNUM=+$PIECE(INPUT,U,3)
SET LIMITDFM=+$PIECE(INPUT,U,4)
SET LIMITDTO=+$PIECE(INPUT,U,5)
+4 SET LIST0=$GET(^FSC("LIST",LISTNUM,0))
+5 IF '$LENGTH(LIST0)
QUIT
+6 SET MAX=$$MAX
+7 DO KILLLIST
+8 DO MRU^FSCMR(DUZ,LISTNUM,LISTINDX)
+9 IF $EXTRACT(LIST0,1,4)="MRE:"
DO MR("MRE",LISTINDX,LIMITNUM,LIMITDTO,LIMITDFM)
+10 IF '$TEST
IF $EXTRACT(LIST0,1,4)="MRA:"
DO MR("MRA",LISTINDX,LIMITNUM,LIMITDTO,LIMITDFM)
+11 IF '$TEST
IF $LENGTH($PIECE(LIST0,U,4))
DO INDEX(LIST0,MAX,LISTINDX,LIMITNUM,LIMITDTO,LIMITDFM)
+12 IF '$TEST
IF $PIECE(LIST0,U,3)="M"
DO MANUAL(MAX,LISTNUM,LIMITNUM,LIMITDTO,LIMITDFM)
+13 IF '$TEST
DO OTHER(MAX,LISTNUM,LIMITNUM,LIMITDTO,LIMITDFM)
+14 QUIT
+15 ;
MR(NODE,LISTINDX,LIMITNUM,LIMITDTO,LIMITDFM) ;
+1 NEW CALL,DATEO,LNUM,TIME
+2 SET LNUM=0
+3 IF LIMITNUM
Begin DoDot:1
+4 SET TIME=""
FOR
SET TIME=$ORDER(^FSCD(NODE,"AUTC",LISTINDX,TIME))
if TIME=""
QUIT
Begin DoDot:2
+5 SET CALL=0
FOR
SET CALL=$ORDER(^FSCD(NODE,"AUTC",LISTINDX,TIME,CALL))
if CALL<1
QUIT
DO SETUP(CALL,.LNUM)
IF LNUM'<LIMITNUM
QUIT
End DoDot:2
IF LNUM'<LIMITNUM
QUIT
End DoDot:1
+6 IF '$TEST
IF LIMITDTO!LIMITDFM
Begin DoDot:1
+7 SET TIME=""
FOR
SET TIME=$ORDER(^FSCD(NODE,"AUTC",LISTINDX,TIME))
if TIME=""
QUIT
Begin DoDot:2
+8 SET CALL=0
FOR
SET CALL=$ORDER(^FSCD(NODE,"AUTC",LISTINDX,TIME,CALL))
if CALL<1
QUIT
Begin DoDot:3
+9 SET DATE0=$PIECE(^FSCD("CALL",CALL,0),U,3)
+10 IF DATEO<LIMITDFM
QUIT
+11 IF DATEO>LIMITDTO
QUIT
+12 DO SETUP(CALL,.LNUM)
End DoDot:3
End DoDot:2
End DoDot:1
+13 IF '$TEST
Begin DoDot:1
+14 SET TIME=""
FOR
SET TIME=$ORDER(^FSCD(NODE,"AUTC",LISTINDX,TIME))
if TIME=""
QUIT
Begin DoDot:2
+15 SET CALL=0
FOR
SET CALL=$ORDER(^FSCD(NODE,"AUTC",LISTINDX,TIME,CALL))
if CALL<1
QUIT
DO SETUP(CALL,.LNUM)
End DoDot:2
End DoDot:1
+16 QUIT
+17 ;
INDEX(LIST0,MAX,LISTINDX,LIMITNUM,LIMITDTO,LIMITDFM) ;
+1 NEW CALL,DATEO,LNUM,SOURCE
+2 SET LNUM=0
+3 SET SOURCE="^FSCD(""CALL"","_$PIECE(LIST0,U,4)_$SELECT(LISTINDX:","_LISTINDX,1:"")_")"
+4 IF LIMITNUM
Begin DoDot:1
+5 SET CALL="A"
FOR
SET CALL=$ORDER(@SOURCE@(CALL),-1)
if CALL<1
QUIT
DO SETUP(CALL,.LNUM)
if LNUM'<LIMITNUM
QUIT
if LNUM'<MAX
QUIT
End DoDot:1
+6 IF '$TEST
IF LIMITDTO!LIMITDFM
Begin DoDot:1
+7 SET CALL="A"
FOR
SET CALL=$ORDER(@SOURCE@(CALL),-1)
if CALL<1
QUIT
Begin DoDot:2
+8 SET DATEO=$PIECE(^FSCD("CALL",CALL,0),U,3)
+9 IF DATEO<LIMITDFM
QUIT
+10 IF DATEO>LIMITDTO
QUIT
+11 DO SETUP(CALL,.LNUM)
End DoDot:2
if LNUM'<MAX
QUIT
End DoDot:1
+12 IF '$TEST
Begin DoDot:1
+13 SET CALL="A"
FOR
SET CALL=$ORDER(@SOURCE@(CALL),-1)
if CALL<1
QUIT
DO SETUP(CALL,.LNUM)
if LNUM'<MAX
QUIT
End DoDot:1
+14 QUIT
+15 ;
MANUAL(MAX,LISTNUM,LIMITNUM,LIMITDTO,LIMITDFM) ;
+1 NEW CALL,DATEO,LNUM
+2 KILL ^TMP("FSC LIST",$JOB)
+3 SET LNUM=0
+4 DO MANUAL^FSCLP(LISTNUM)
+5 IF LIMITNUM
Begin DoDot:1
+6 SET CALL="A"
FOR
SET CALL=$ORDER(^TMP("FSC LIST",$JOB,CALL),-1)
if CALL<1
QUIT
DO SETUP(CALL,.LNUM)
if LNUM'<LIMITNUM
QUIT
if LNUM'<MAX
QUIT
End DoDot:1
+7 IF '$TEST
IF LIMITDTO!LIMITDFM
Begin DoDot:1
+8 SET CALL="A"
FOR
SET CALL=$ORDER(^TMP("FSC LIST",$JOB,CALL),-1)
if CALL<1
QUIT
Begin DoDot:2
+9 SET DATEO=$PIECE(^FSCD("CALL",CALL,0),U,3)
+10 IF DATEO<LIMITDFM
QUIT
+11 IF DATEO>LIMITDTO
QUIT
+12 DO SETUP(CALL,.LNUM)
End DoDot:2
if LNUM'<MAX
QUIT
End DoDot:1
+13 IF '$TEST
Begin DoDot:1
+14 SET CALL="A"
FOR
SET CALL=$ORDER(^TMP("FSC LIST",$JOB,CALL),-1)
if CALL<1
QUIT
DO SETUP(CALL,.LNUM)
if LNUM'<MAX
QUIT
End DoDot:1
+15 KILL ^TMP("FSC LIST",$JOB)
+16 QUIT
+17 ;
OTHER(MAX,LISTNUM,LIMITNUM,LIMITDTO,LIMITDFM) ;
+1 NEW CALL,DATEO,LISTCALL,LNUM
+2 SET LNUM=0
+3 IF LIMITNUM
Begin DoDot:1
+4 SET LISTCALL="A"
FOR
SET LISTCALL=$ORDER(^FSCD("LISTS","L",LISTNUM,LISTCALL),-1)
if LISTCALL<1
QUIT
SET CALL=+$GET(^FSCD("LISTS",LISTCALL,0))
DO SETUP(CALL,.LNUM)
if LNUM'<LIMITNUM
QUIT
if LNUM'<MAX
QUIT
End DoDot:1
+5 IF '$TEST
IF LIMITDTO!LIMITDFM
Begin DoDot:1
+6 SET LISTCALL="A"
FOR
SET LISTCALL=$ORDER(^FSCD("LISTS","L",LISTNUM,LISTCALL),-1)
if LISTCALL<1
QUIT
Begin DoDot:2
+7 SET CALL=+$GET(^FSCD("LISTS",LISTCALL,0))
+8 SET DATEO=$PIECE(^FSCD("CALL",CALL,0),U,3)
+9 IF DATEO<LIMITDFM
QUIT
+10 IF DATEO>LIMITDTO
QUIT
+11 DO SETUP(CALL,.LNUM)
End DoDot:2
if LNUM'<MAX
QUIT
End DoDot:1
+12 IF '$TEST
Begin DoDot:1
+13 SET LISTCALL="A"
FOR
SET LISTCALL=$ORDER(^FSCD("LISTS","L",LISTNUM,LISTCALL),-1)
if LISTCALL<1
QUIT
SET CALL=+$GET(^FSCD("LISTS",LISTCALL,0))
DO SETUP(CALL,.LNUM)
if LNUM'<MAX
QUIT
End DoDot:1
+14 QUIT
+15 ;
SETUP(CALL,LNUM) ;
+1 SET LNUM=LNUM+1
+2 SET (^TMP("FSC CURRENT LIST",$JOB,LNUM+1000),^TMP("FSCRPC",$JOB,"OUTPUT",LNUM))=CALL_U_$$SHORT^FSCRPXUS(CALL,DUZ)
+3 SET ^TMP("FSC CURRENT LIST",$JOB,"C",CALL)=LNUM+1000
+4 QUIT
+5 ;
MAX() ; $$ -> max number of calls to return
+1 IF $PIECE($GET(^FSC("PARAM",1,2)),U,2)
QUIT +$PIECE(^(2),U,2)
+2 QUIT 1000
+3 ;
CLEAR(IN,OUT) ; from FSCRPX (RPCClearList)
+1 DO KILLLIST
+2 QUIT
+3 ;
KILLLIST ; from FSCRPCLO
+1 KILL ^TMP("FSC CURRENT LIST",$JOB)
+2 QUIT