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

FSCRPCOG.m

Go to the documentation of this file.
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