source: FOIAVistA/trunk/r/NOIS-FSC/FSCUX.m@ 1800

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

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1FSCUX ;SLC/STAFF-NOIS Utilities Expand ;8/25/94 16:17
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4EXPAND(CHOICE,OK,DEFAULT) ; from FSCLMPC, FSCLMPD, FSCOPT, FSCRPTS
5 N CNT,DIC,Y K DIC,Y S OK=1
6 S CHOICE=$S($L($G(DEFAULT)):DEFAULT,1:"BRIEF")
7 D LOOKUP^FSCULOOK("FTYPE",.CHOICE,"AEMOQZ",.OK,"I '$P(^(0),U,6)")
8 I $D(DUOUT)!$D(DTOUT) S OK=0,CHOICE=$G(CHOICE) Q
9 D OTHER(.CHOICE,.OK)
10 Q
11 ;
12OTHER(CHOICE,OK) ; from FSCRPTS
13 N CNT,D,DIC,FIELD,FORMAT,TYPE,Y K DIC,Y S OK=1
14 S CHOICE=$P(CHOICE,U,2),TYPE=CHOICE(0)
15 D
16 .I $P(TYPE,U,2)="EXECUTE" D Q
17 ..D LOOKUP^FSCULOOK("FORMAT",.FORMAT,"AEMOQ",.OK,"I $D(^(1))")
18 ..S CHOICE("F")=FORMAT,FORMAT=+FORMAT
19 ..I OK D
20 ...S CNT=0 F S CNT=$O(^FSC("FORMAT",FORMAT,2,CNT)) Q:CNT<1 S FIELD=+^(CNT,0) D
21 ....S CHOICE(CNT)=^FSC("FLD",FIELD,0)
22 .I $P(TYPE,U,3) D Q
23 ..D LOOKUP^FSCULOOK("FORMAT",.FORMAT,"AEMOQ",.OK)
24 ..S FORMAT=+FORMAT
25 ..I OK D
26 ...S CNT=0 F S CNT=$O(^FSC("FORMAT",FORMAT,2,CNT)) Q:CNT<1 S FIELD=+^(CNT,0) D
27 ....S CHOICE(CNT)=^FSC("FLD",FIELD,0)
28 .I $P(TYPE,U,5) D Q
29 ..S DIC=7107.2,DIC(0)="AEMOQZ",DIC("A")="Select Field: "
30 ..F CNT=1:1 D ^DIC Q:Y<1 S CHOICE(CNT)=Y(0)
31 ..K DIC
32 .I $P(TYPE,U,2)="FM" D Q
33 ..S DIC="^DIPT(",DIC(0)="AEOQ",DIC("A")="Select Print Template: ",D="F7100"
34 ..D IX^DIC K DIC S:Y<0 OK=0
35 ..S CHOICE("T")="["_$P(Y,U,2)_"]"
36 I $P(TYPE,U,2)="STAT" D
37 .N DIC,Y K CHOICE("COLLATE"),DIC,Y,^TMP("FSC STATS",$J)
38 .I '$O(CHOICE(0)) S OK=0 W !,"No fields selected.",$C(7),! H 1 Q
39 .I '$O(CHOICE(1)) Q
40 .S DIC=7107.2,DIC(0)="AEMOQZ",DIC("A")="(Optional) Select a Field to Collate your fields with: "
41 .D ^DIC K DIC Q:Y<1
42 .S CNT=0 F S CNT=$O(CHOICE(CNT)) Q:CNT<1 I Y(0)=CHOICE(CNT) S CHOICE("COLLATE")=CNT
43 .I '$D(CHOICE("COLLATE")) S CNT=1+$O(CHOICE("A"),-1),CHOICE(CNT)=Y(0),CHOICE("COLLATE")=CNT
44 I $P(TYPE,U,2)="EXTRACT" S CHOICE("E")=""
45 S CHOICE=$$CHOICE($P(TYPE,U,2))
46 Q
47 ;
48CHOICE(CHOICE) ; $$(choice) -> single letter
49 Q $S(CHOICE="BRIEF":"B",CHOICE="DETAIL":"D",CHOICE="STAT":"S",CHOICE="FIELD":"C",CHOICE="FORMAT":"C",CHOICE="FM":"FM",1:"F")
Note: See TracBrowser for help on using the repository browser.