FSCRPCOG ;SLC/STAFF-NOIS RPC Other Graph ;6/15/98 23:46
;;1.1;NOIS;;Sep 06, 1998
;
GRAPH(IN,OUT) ; from FSCRPX (RPCGraph)
N CALL,CNT,EVALUE,FIELD,FLD,IEN,NODE,NPIECE,PFIELDS,PIECE,SVALUE,TOTAL,TYPE,VALUE,VCNT,ZERO K ^TMP("FSC STATS",$J),^TMP("FSC STATS ALPHA",$J)
S FIELD=+$G(^TMP("FSCRPC",$J,"INPUT",1))
S ZERO=$G(^FSC("FLD",FIELD,0))
S NPIECE=$P(ZERO,U,4),FLD=$P(ZERO,U,8),TYPE=$P(ZERO,U,3)
S (CNT,TOTAL)=0
I TYPE="W" D
.S CALL=0 F S CALL=$O(^TMP("FSC CURRENT LIST",$J,"C",CALL)) Q:CALL<1 D
..S TOTAL=TOTAL+1
..I FLD=.65 D Q
...S IEN=+$G(^FSCD("CALL USER","AUC",DUZ,CALL))
...I 'IEN Q
...S CNT=CNT+1
...S ^("<entry>")=1+$G(^TMP("FSC STATS",$J,"<entry>"))
..I '$O(^FSCD("CALL",CALL,FLD,0)) Q
..S CNT=CNT+1
..S ^("<entry>")=1+$G(^TMP("FSC STATS",$J,"<entry>"))
I TYPE'="W" Q:'$L(NPIECE) Q:'FLD D
.S NODE=$P(NPIECE,";"),PIECE=+$P(NPIECE,";",2)
.I 'PIECE Q
.I NODE["7100.6," S PFIELDS=1,NODE=+$P(NODE,",",2)
.E S PFIELDS=0,NODE=+NODE
.S CALL=0 F S CALL=$O(^TMP("FSC CURRENT LIST",$J,"C",CALL)) Q:CALL<1 D
..S TOTAL=TOTAL+1
..I PFIELDS D Q
...S IEN=+$G(^FSCD("CALL USER","AUC",DUZ,CALL))
...I 'IEN Q
...S VALUE=$P($G(^FSCD("CALL USER",IEN,NODE)),U,PIECE)
...I $L(VALUE) D
....S CNT=CNT+1
....S ^(VALUE)=1+$G(^TMP("FSC STATS",$J,VALUE))
..S VALUE=$P($G(^FSCD("CALL",CALL,NODE)),U,PIECE)
..I $L(VALUE) D
...S CNT=CNT+1
...S ^(VALUE)=1+$G(^TMP("FSC STATS",$J,VALUE))
S VALUE="" F S VALUE=$O(^TMP("FSC STATS",$J,VALUE)) Q:VALUE="" S VCNT=+^(VALUE) D
.D
..I TYPE="F" S (EVALUE,SVALUE)=VALUE Q
..I TYPE="N" S (EVALUE,SVALUE)=+VALUE Q
..I TYPE="W" S (EVALUE,SVALUE)=VALUE Q
..I TYPE="D" S SVALUE=+VALUE,EVALUE=$$FMTE^XLFDT(VALUE) Q
..S (EVALUE,SVALUE)=$$VALUE^FSCGET(VALUE,7100,FLD)
.I SVALUE="" S SVALUE=" "
.I TOTAL S ^TMP("FSC STATS ALPHA",$J,SVALUE)=VALUE_U_EVALUE_U_VCNT_U_$J(VCNT/TOTAL*100,0,0)_U_$J(VCNT/CNT*100,0,0)
I TOTAL S ^TMP("FSC STATS ALPHA",$J,"{no entry}")="<no entry>^<no entry>^"_(TOTAL-CNT)_U_$J(TOTAL-CNT/TOTAL*100,0,0)_"^0"
S CNT=0
S VALUE="" F S VALUE=$O(^TMP("FSC STATS ALPHA",$J,VALUE)) Q:VALUE="" S LINE=^(VALUE) D
.S CNT=CNT+1
.S ^TMP("FSCRPC",$J,"OUTPUT",CNT)=LINE
K ^TMP("FSC STATS",$J),^TMP("FSC STATS ALPHA",$J)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFSCRPCOG 2256 printed Dec 13, 2024@02:19:39 Page 2
FSCRPCOG ;SLC/STAFF-NOIS RPC Other Graph ;6/15/98 23:46
+1 ;;1.1;NOIS;;Sep 06, 1998
+2 ;
GRAPH(IN,OUT) ; from FSCRPX (RPCGraph)
+1 NEW CALL,CNT,EVALUE,FIELD,FLD,IEN,NODE,NPIECE,PFIELDS,PIECE,SVALUE,TOTAL,TYPE,VALUE,VCNT,ZERO
KILL ^TMP("FSC STATS",$JOB),^TMP("FSC STATS ALPHA",$JOB)
+2 SET FIELD=+$GET(^TMP("FSCRPC",$JOB,"INPUT",1))
+3 SET ZERO=$GET(^FSC("FLD",FIELD,0))
+4 SET NPIECE=$PIECE(ZERO,U,4)
SET FLD=$PIECE(ZERO,U,8)
SET TYPE=$PIECE(ZERO,U,3)
+5 SET (CNT,TOTAL)=0
+6 IF TYPE="W"
Begin DoDot:1
+7 SET CALL=0
FOR
SET CALL=$ORDER(^TMP("FSC CURRENT LIST",$JOB,"C",CALL))
if CALL<1
QUIT
Begin DoDot:2
+8 SET TOTAL=TOTAL+1
+9 IF FLD=.65
Begin DoDot:3
+10 SET IEN=+$GET(^FSCD("CALL USER","AUC",DUZ,CALL))
+11 IF 'IEN
QUIT
+12 SET CNT=CNT+1
+13 SET ^("<entry>")=1+$GET(^TMP("FSC STATS",$JOB,"<entry>"))
End DoDot:3
QUIT
+14 IF '$ORDER(^FSCD("CALL",CALL,FLD,0))
QUIT
+15 SET CNT=CNT+1
+16 SET ^("<entry>")=1+$GET(^TMP("FSC STATS",$JOB,"<entry>"))
End DoDot:2
End DoDot:1
+17 IF TYPE'="W"
if '$LENGTH(NPIECE)
QUIT
if 'FLD
QUIT
Begin DoDot:1
+18 SET NODE=$PIECE(NPIECE,";")
SET PIECE=+$PIECE(NPIECE,";",2)
+19 IF 'PIECE
QUIT
+20 IF NODE["7100.6,"
SET PFIELDS=1
SET NODE=+$PIECE(NODE,",",2)
+21 IF '$TEST
SET PFIELDS=0
SET NODE=+NODE
+22 SET CALL=0
FOR
SET CALL=$ORDER(^TMP("FSC CURRENT LIST",$JOB,"C",CALL))
if CALL<1
QUIT
Begin DoDot:2
+23 SET TOTAL=TOTAL+1
+24 IF PFIELDS
Begin DoDot:3
+25 SET IEN=+$GET(^FSCD("CALL USER","AUC",DUZ,CALL))
+26 IF 'IEN
QUIT
+27 SET VALUE=$PIECE($GET(^FSCD("CALL USER",IEN,NODE)),U,PIECE)
+28 IF $LENGTH(VALUE)
Begin DoDot:4
+29 SET CNT=CNT+1
+30 SET ^(VALUE)=1+$GET(^TMP("FSC STATS",$JOB,VALUE))
End DoDot:4
End DoDot:3
QUIT
+31 SET VALUE=$PIECE($GET(^FSCD("CALL",CALL,NODE)),U,PIECE)
+32 IF $LENGTH(VALUE)
Begin DoDot:3
+33 SET CNT=CNT+1
+34 SET ^(VALUE)=1+$GET(^TMP("FSC STATS",$JOB,VALUE))
End DoDot:3
End DoDot:2
End DoDot:1
+35 SET VALUE=""
FOR
SET VALUE=$ORDER(^TMP("FSC STATS",$JOB,VALUE))
if VALUE=""
QUIT
SET VCNT=+^(VALUE)
Begin DoDot:1
+36 Begin DoDot:2
+37 IF TYPE="F"
SET (EVALUE,SVALUE)=VALUE
QUIT
+38 IF TYPE="N"
SET (EVALUE,SVALUE)=+VALUE
QUIT
+39 IF TYPE="W"
SET (EVALUE,SVALUE)=VALUE
QUIT
+40 IF TYPE="D"
SET SVALUE=+VALUE
SET EVALUE=$$FMTE^XLFDT(VALUE)
QUIT
+41 SET (EVALUE,SVALUE)=$$VALUE^FSCGET(VALUE,7100,FLD)
End DoDot:2
+42 IF SVALUE=""
SET SVALUE=" "
+43 IF TOTAL
SET ^TMP("FSC STATS ALPHA",$JOB,SVALUE)=VALUE_U_EVALUE_U_VCNT_U_$JUSTIFY(VCNT/TOTAL*100,0,0)_U_$JUSTIFY(VCNT/CNT*100,0,0)
End DoDot:1
+44 IF TOTAL
SET ^TMP("FSC STATS ALPHA",$JOB,"{no entry}")="<no entry>^<no entry>^"_(TOTAL-CNT)_U_$JUSTIFY(TOTAL-CNT/TOTAL*100,0,0)_"^0"
+45 SET CNT=0
+46 SET VALUE=""
FOR
SET VALUE=$ORDER(^TMP("FSC STATS ALPHA",$JOB,VALUE))
if VALUE=""
QUIT
SET LINE=^(VALUE)
Begin DoDot:1
+47 SET CNT=CNT+1
+48 SET ^TMP("FSCRPC",$JOB,"OUTPUT",CNT)=LINE
End DoDot:1
+49 KILL ^TMP("FSC STATS",$JOB),^TMP("FSC STATS ALPHA",$JOB)
+50 QUIT