source: WorldVistAEHR/trunk/r/NOIS-FSC/FSCRPTS.m@ 1365

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

initial load of WorldVistAEHR

File size: 3.2 KB
Line 
1FSCRPTS ;SLC/STAFF-NOIS Report ;1/13/98 16:31
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4REPORTS ; from FSCOPT
5 N CHOICE,CNT,DFORM,DIC,DIR,DISPLAY,FIELD,FIELDS,FORMAT,FSCLIMIT,FSCSTYLE,FSCINDX,FSCSORT,LIST,OK,REPORT,X,Y K DIC,DIR,DFORM,FIELDS,FORMAT,FSCSTYLE
6 S DIR(0)="SAMO^REPORT:REPORT;CUSTOM:CUSTOM",DIR("A")="Select (R)eport or (C)ustom: "
7 S DIR("?",1)="Enter REPORT to select reports (a report is a list with a sort and format)."
8 S DIR("?",2)="Enter CUSTOM to select a list, sort, and format."
9 S DIR("?")="^D HELP^FSCU(.DIR)"
10 S DIR("??")="FSC U1 NOIS"
11 D ^DIR K DIR
12 I $D(DIRUT) Q
13 S CHOICE=Y
14 I CHOICE="REPORT" D
15 .D LOOKUP^FSCULOOK("RPT",.REPORT,"AEMOQ",.OK)
16 .I 'OK Q
17 .D PARTS(+REPORT,.LIST,.FSCSORT,.FORMAT,.DFORM)
18 .Q:'$L(LIST) S FSCLNUM=+LIST,FSCL0=$G(^FSC("LIST",FSCLNUM,0)),FSCLNAME=$P(FSCL0,U)
19 .I $P(FSCL0,U,5) W !,"For the list ",FSCLNAME D INDEX^FSCLM(.FSCLNAME,.FSCINDX,FSCL0) I '$G(FSCINDX) K LIST
20 .S FSCSTYLE=$P(DFORM(0),U,2),FSCSTYLE(0)=DFORM(0),OK=1 D
21 ..I FSCSTYLE="BRIEF" S FSCSTYLE="B" Q
22 ..I FSCSTYLE="DETAIL" S FSCSTYLE="D" Q
23 ..I 'FORMAT S OK=0 Q
24 ..I FSCSTYLE="FM" D Q
25 ...I '$L($P(FORMAT(0),U,3)) S OK=0 Q
26 ...S FSCSTYLE("T")="["_$P(FORMAT(0),U,3)_"]"
27 ..I FSCSTYLE="EXECUTE" S FSCSTYLE("F")=FORMAT_U_$P(FORMAT(0),U)
28 ..I FSCSTYLE="EXTRACT" S FSCSTYLE("E")=""
29 ..S CNT=0 F S CNT=$O(^FSC("FORMAT",FORMAT,2,CNT)) Q:CNT<1 S FIELD=+^(CNT,0),FSCSTYLE(CNT)=^FSC("FLD",FIELD,0)
30 ..S FSCSTYLE=$$CHOICE^FSCUX(FSCSTYLE)
31 .I 'OK D OTHER^FSCUX(.FSCSTYLE,.OK)
32 .S FSCSTYLE=$$STYLE^FSCU(FSCSTYLE)
33 I CHOICE="CUSTOM" D
34 .D LIST^FSCULOOK(.LIST,.FSCLIMIT,.OK)
35 .I 'OK Q
36 .S FSCLNAME=$P(LIST,U,2),FSCLNUM=+LIST,FSCL0=$G(^FSC("LIST",FSCLNUM,0))
37 .I $P(FSCL0,U,5) D INDEX^FSCLM(.FSCLNAME,.FSCINDX,FSCL0) Q:'$G(FSCINDX)
38 .S DIC=7107.6,DIC(0)="AEMOQ",DIC("A")="Select Sort (optional): ",DIC("S")="I $P(^(0),U,2)=""S"""
39 .D ^DIC K DIC
40 .Q:$D(DUOUT) Q:$D(DTOUT)
41 .S FSCSORT=+Y
42 .D EXPAND^FSCUX(.FSCSTYLE,.OK)
43 .I 'OK Q
44 .S FSCSTYLE=$$STYLE^FSCU(FSCSTYLE)
45 Q:'$D(LIST) Q:'$D(FSCSTYLE)
46 S DISPLAY="" I '($D(FSCSTYLE("E"))!$D(FSCSTYLE("T"))) D DISPLAY^FSCRU(.DISPLAY,.OK) I 'OK Q
47 I DISPLAY="DEVICE" D DEV^FSCRU("","^TMP(""FSC LIST"",$J,","DQ^FSCRUDQ","NOIS Report",.OK) Q
48 D SETUP I $D(VALMQUIT) Q
49 D VIEW^FSCLM(VALMAR,"VVALUES",.FSCSTYLE)
50 Q
51 ;
52SETUP ; from FSCOPT, FSCRUDQ
53 N CALLNUM,CNT
54 K VALMQUIT D ENTRY^FSCLML I $D(VALMQUIT) Q
55 S VALMAR="^TMP(""FSC LIST CALLS"",$J)"
56 ;I '^TMP("FSC LIST CALLS",$J) W !,"No calls to View." H 2 Q
57 I $G(FSCSORT) D SETSORT(FSCSORT,.FIELDS),SORT^FSCUS(.FIELDS)
58 I FSCSTYLE="FM" D Q
59 .I '$L($G(FSCSTYLE("T"))) Q
60 .S CNT=0 F S CNT=$O(^TMP("FSC LIST CALLS",$J,"ICX",CNT)) Q:CNT<1 D
61 ..S CALLNUM=0 F S CALLNUM=$O(^TMP("FSC LIST CALLS",$J,"ICX",CNT,CALLNUM)) Q:CALLNUM<1 D TEMP^FSCFORMP
62 K ^TMP("FSC SELECT",$J,"VVALUES") S ^("VVALUES")=1_"-"_VALMCNT
63 F CNT=1:1:VALMCNT S ^TMP("FSC SELECT",$J,"VVALUES",CNT)=""
64 Q
65 ;
66SETSORT(SORT,FIELDS) ;
67 N CNT,FIELD K FIELDS
68 K FIELDS S CNT=0 F S CNT=$O(^FSC("FORMAT",SORT,2,CNT)) Q:CNT<1 S FIELD=^(CNT,0),FIELDS(CNT)=$G(^FSC("FLD",+FIELD,0)) I $P(FIELD,U,8) S FIELDS(CNT,"D")=""
69 Q
70 ;
71PARTS(REPORT,LIST,SORT,FORMAT,DFORM) ;
72 N ZERO
73 S ZERO=$G(^FSC("RPT",+REPORT,0)),LIST=$P(ZERO,U,3),SORT=$P(ZERO,U,5),FORMAT=$P(ZERO,U,4),DFORM=$P(ZERO,U,6)
74 S FORMAT(0)=$G(^FSC("FORMAT",+FORMAT,0)),DFORM(0)=$G(^FSC("FTYPE",+DFORM,0))
75 Q
Note: See TracBrowser for help on using the repository browser.