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

FSCFORMX.m

Go to the documentation of this file.
FSCFORMX ;SLC/STAFF-NOIS Format Statistic - Display ;8/25/94  09:06
 ;;1.1;NOIS;;Sep 06, 1998
 ;
STAT ; from FSCFORMS
 K ^TMP("FSC STAT FORMAT",$J)
 S SECTION=1,VTYPE=$S(TYPE["VIEW":"VVALUES",1:"EVALUES")
 S (CNT,TOTAL)=0 F  S CNT=$O(^TMP("FSC SELECT",$J,VTYPE,CNT)) Q:CNT<1  S TOTAL=TOTAL+1
 I '$D(STYLE("COLLATE")) D
 .S (CNT,LINE)=0 F  S CNT=$O(STYLE(CNT)) Q:CNT<1  S ABBREV=$P(STYLE(CNT),U,7) I $L(ABBREV) D
 ..S NUMVALUE=$S($P(STYLE(CNT),U,3)="N":1,1:0)
 ..S LINE=LINE+1
 ..S COUNT=+$G(^TMP("FSC STATS",$J,ABBREV))
 ..S LINE=LINE+1,TEXT=$J($P(STYLE(CNT),U,2)_": ",14)_$J(+COUNT,5) ;_$J(COUNT/TOTAL*100\1_"%",8)
 ..I COUNT,NUMVALUE D
 ...S NUMTOT=0,NUM="" F  S NUM=$O(^TMP("FSC STATS",$J,ABBREV,NUM)) Q:NUM=""  S NUMTOT=NUMTOT+(NUM*^(NUM))
 ...S TEXT=TEXT_"     Total: "_NUMTOT_"     Ave: "_$J(NUMTOT/COUNT,0,1)
 ..D SETTEXT^FSCFORMY(SECTION,LINE,2,TEXT)
 ..S VALUE="" F  S VALUE=$O(^TMP("FSC STATS",$J,ABBREV,VALUE)) Q:VALUE=""  S NUM=+^(VALUE) D
 ...S LINE=LINE+1,TEXT=$J(NUM,5)_$J(NUM/TOTAL*100,8,0)_"%  "_$S(NUMVALUE:$J(VALUE,5,1),1:VALUE)
 ...D SETTEXT^FSCFORMY(SECTION,LINE,16,TEXT)
 I $D(STYLE("COLLATE")) D
 .S COLLATE=STYLE(STYLE("COLLATE")),CABBREV=$P(COLLATE,U,7) I '$L(CABBREV) Q
 .S CNUMVAL=$S($P(COLLATE,U,3)="N":1,1:0)
 .S LINE=1
 .S CCOUNT=+$G(^TMP("FSC STATS",$J,CABBREV))
 .S LINE=LINE+1 D SETTEXT^FSCFORMY(SECTION,LINE,2,"Collated by "_$J($P(COLLATE,U,2)_": ",4)) D SETTEXT^FSCFORMY(SECTION,LINE,65,$J(+CCOUNT,5)_$J(+CCOUNT/TOTAL*100,8,0)_"%")
 .I CCOUNT,CNUMVAL D
 ..S NUMTOT=0,NUM="" F  S NUM=$O(^TMP("FSC STATS",$J,CABBREV,NUM)) Q:NUM=""  S NUMTOT=NUMTOT+(NUM*^(NUM))
 ..S TEXT="Total: "_NUMTOT_"     Ave: "_$J(NUMTOT/CCOUNT,0,1) D SETTEXT^FSCFORMY(SECTION,LINE,35,TEXT)
 .S CVALUE="" F  S CVALUE=$O(^TMP("FSC STATS",$J,CABBREV,CVALUE)) Q:CVALUE=""  S CNUM=+^(CVALUE) D
 ..S LINE=LINE+1,TEXT="",$P(TEXT,"-",80)="" D SETTEXT^FSCFORMY(SECTION,LINE,1,TEXT)
 ..S LINE=LINE+1 D SETTEXT^FSCFORMY(SECTION,LINE,2,$S(CNUMVAL:$J(CVALUE,5,1),1:CVALUE)) D SETTEXT^FSCFORMY(SECTION,LINE,65,$J(CNUM,5)_$J(CNUM/TOTAL*100,8,0)_"%")
 ..S CNT=0 F  S CNT=$O(STYLE(CNT)) Q:CNT<1  I STYLE("COLLATE")'=CNT S ABBREV=$P(STYLE(CNT),U,7) I $L(ABBREV) D
 ...S NUMVALUE=$S($P(STYLE(CNT),U,3)="N":1,1:0)
 ...S COUNT=+$G(^TMP("FSC STATS",$J,CABBREV,CVALUE,ABBREV))
 ...S LINE=LINE+1 D SETTEXT^FSCFORMY(SECTION,LINE,2,$J($P(STYLE(CNT),U,2)_":",18))
 ...S TEXT="("_+COUNT_")" D SETTEXT^FSCFORMY(SECTION,LINE,45,$J(TEXT,7))
 ...I COUNT,NUMVALUE D
 ....S NUMTOT=0,NUM="" F  S NUM=$O(^TMP("FSC STATS",$J,CABBREV,CVALUE,ABBREV,NUM)) Q:NUM=""  S NUMTOT=NUMTOT+(NUM*^(NUM))
 ....S TEXT="Total: "_NUMTOT_"     Ave: "_$J(NUMTOT/COUNT,0,1) D SETTEXT^FSCFORMY(SECTION,LINE,53,TEXT)
 ...S VALUE="" F  S VALUE=$O(^TMP("FSC STATS",$J,CABBREV,CVALUE,ABBREV,VALUE)) Q:VALUE=""  S NUM=+^(VALUE) D
 ....S LINE=LINE+1 D SETTEXT^FSCFORMY(SECTION,LINE,20,$S(NUMVALUE:$J(VALUE,5,1),1:VALUE))
 ....S TEXT=$S(COUNT'=CNUM:"("_$J(NUM/COUNT*100,0,0)_"%)",1:"") D SETTEXT^FSCFORMY(SECTION,LINE,45,$J(TEXT,7)_$J(NUM/CNUM*100,8,0)_"%") D SETTEXT^FSCFORMY(SECTION,LINE,65,$J(NUM,5)_$J(NUM/TOTAL*100,8,0)_"%")
 I TYPE["VIEW" D VIEW^FSCFORMY(LISTNUM,CALLNUM,STYLE,.LASTLINE,TYPE) Q
 D SETUP^FSCFORMY(LISTNUM,CALLNUM,STYLE,.LASTLINE,TYPE)
 Q