source: FOIAVistA/trunk/r/NOIS-FSC/FSCFORMX.m@ 1806

Last change on this file since 1806 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 3.1 KB
Line 
1FSCFORMX ;SLC/STAFF-NOIS Format Statistic - Display ;8/25/94 09:06
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4STAT ; from FSCFORMS
5 K ^TMP("FSC STAT FORMAT",$J)
6 S SECTION=1,VTYPE=$S(TYPE["VIEW":"VVALUES",1:"EVALUES")
7 S (CNT,TOTAL)=0 F S CNT=$O(^TMP("FSC SELECT",$J,VTYPE,CNT)) Q:CNT<1 S TOTAL=TOTAL+1
8 I '$D(STYLE("COLLATE")) D
9 .S (CNT,LINE)=0 F S CNT=$O(STYLE(CNT)) Q:CNT<1 S ABBREV=$P(STYLE(CNT),U,7) I $L(ABBREV) D
10 ..S NUMVALUE=$S($P(STYLE(CNT),U,3)="N":1,1:0)
11 ..S LINE=LINE+1
12 ..S COUNT=+$G(^TMP("FSC STATS",$J,ABBREV))
13 ..S LINE=LINE+1,TEXT=$J($P(STYLE(CNT),U,2)_": ",14)_$J(+COUNT,5) ;_$J(COUNT/TOTAL*100\1_"%",8)
14 ..I COUNT,NUMVALUE D
15 ...S NUMTOT=0,NUM="" F S NUM=$O(^TMP("FSC STATS",$J,ABBREV,NUM)) Q:NUM="" S NUMTOT=NUMTOT+(NUM*^(NUM))
16 ...S TEXT=TEXT_" Total: "_NUMTOT_" Ave: "_$J(NUMTOT/COUNT,0,1)
17 ..D SETTEXT^FSCFORMY(SECTION,LINE,2,TEXT)
18 ..S VALUE="" F S VALUE=$O(^TMP("FSC STATS",$J,ABBREV,VALUE)) Q:VALUE="" S NUM=+^(VALUE) D
19 ...S LINE=LINE+1,TEXT=$J(NUM,5)_$J(NUM/TOTAL*100,8,0)_"% "_$S(NUMVALUE:$J(VALUE,5,1),1:VALUE)
20 ...D SETTEXT^FSCFORMY(SECTION,LINE,16,TEXT)
21 I $D(STYLE("COLLATE")) D
22 .S COLLATE=STYLE(STYLE("COLLATE")),CABBREV=$P(COLLATE,U,7) I '$L(CABBREV) Q
23 .S CNUMVAL=$S($P(COLLATE,U,3)="N":1,1:0)
24 .S LINE=1
25 .S CCOUNT=+$G(^TMP("FSC STATS",$J,CABBREV))
26 .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)_"%")
27 .I CCOUNT,CNUMVAL D
28 ..S NUMTOT=0,NUM="" F S NUM=$O(^TMP("FSC STATS",$J,CABBREV,NUM)) Q:NUM="" S NUMTOT=NUMTOT+(NUM*^(NUM))
29 ..S TEXT="Total: "_NUMTOT_" Ave: "_$J(NUMTOT/CCOUNT,0,1) D SETTEXT^FSCFORMY(SECTION,LINE,35,TEXT)
30 .S CVALUE="" F S CVALUE=$O(^TMP("FSC STATS",$J,CABBREV,CVALUE)) Q:CVALUE="" S CNUM=+^(CVALUE) D
31 ..S LINE=LINE+1,TEXT="",$P(TEXT,"-",80)="" D SETTEXT^FSCFORMY(SECTION,LINE,1,TEXT)
32 ..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)_"%")
33 ..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
34 ...S NUMVALUE=$S($P(STYLE(CNT),U,3)="N":1,1:0)
35 ...S COUNT=+$G(^TMP("FSC STATS",$J,CABBREV,CVALUE,ABBREV))
36 ...S LINE=LINE+1 D SETTEXT^FSCFORMY(SECTION,LINE,2,$J($P(STYLE(CNT),U,2)_":",18))
37 ...S TEXT="("_+COUNT_")" D SETTEXT^FSCFORMY(SECTION,LINE,45,$J(TEXT,7))
38 ...I COUNT,NUMVALUE D
39 ....S NUMTOT=0,NUM="" F S NUM=$O(^TMP("FSC STATS",$J,CABBREV,CVALUE,ABBREV,NUM)) Q:NUM="" S NUMTOT=NUMTOT+(NUM*^(NUM))
40 ....S TEXT="Total: "_NUMTOT_" Ave: "_$J(NUMTOT/COUNT,0,1) D SETTEXT^FSCFORMY(SECTION,LINE,53,TEXT)
41 ...S VALUE="" F S VALUE=$O(^TMP("FSC STATS",$J,CABBREV,CVALUE,ABBREV,VALUE)) Q:VALUE="" S NUM=+^(VALUE) D
42 ....S LINE=LINE+1 D SETTEXT^FSCFORMY(SECTION,LINE,20,$S(NUMVALUE:$J(VALUE,5,1),1:VALUE))
43 ....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)_"%")
44 I TYPE["VIEW" D VIEW^FSCFORMY(LISTNUM,CALLNUM,STYLE,.LASTLINE,TYPE) Q
45 D SETUP^FSCFORMY(LISTNUM,CALLNUM,STYLE,.LASTLINE,TYPE)
46 Q
Note: See TracBrowser for help on using the repository browser.