source: FOIAVistA/trunk/r/NOIS-FSC/FSCLMPMQ.m@ 757

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

initial load of FOIAVistA 6/30/08 version

File size: 1.8 KB
Line 
1FSCLMPMQ ;SLC/STAFF-NOIS List Manager Protocol Modify Query ;4/22/94 11:04
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4QDESC(ARRAY,DESC,CRITERIA) ; from FSCLDU, FSCLMPMS
5 N COND,DEFINE,DESCNT,EXT,FCOND,FLD,FLDNAME,LCOND,LINE,OPER,PAREN,STEP,VALNAME,VALUE,X K CRITERIA,DESC
6 S DEFINE=0,DESC(0)="List: "_FSCLNAME
7 S PAREN="closed",(DESCNT,FCOND,LINE)=0,STEP=1 F S LINE=$O(ARRAY(LINE)) Q:LINE<1 D
8 .S X=ARRAY(LINE),OPER=$P(X,U,2),EXT=$P(X,U,3),FLD=$P(X,U,4),COND=$P(X,U,5),VALUE=$P(X,U,6)
9 .S OPER=$S(OPER="A":"Add",OPER="R":"Remove",OPER="S":"Select",1:"")
10 .S EXT=$S(EXT="A":"and",EXT="O":"or",1:"")
11 .S FLDNAME=$P(^FSC("FLD",+FLD,0),U)
12 .S COND=$P(^FSC("COND",+COND,0),U,2)
13 .S VALNAME=VALUE I $P(^FSC("FLD",+FLD,0),U,8),"DNP"[$E($P(^(0),U,3)) S VALNAME=$$VALUE^FSCGET(VALUE,7100,+$P(^(0),U,8))
14 .I $L(VALUE),"FW"[$E($P(^FSC("FLD",+FLD,0),U,3)) S VALNAME=""""_VALUE_""""
15 .I $L(OPER),$D(CRITERIA) D
16 ..S $P(CRITERIA(0),U,2)=STEP
17 ..I PAREN="open" S CRITERIA(STEP,FCOND,0)=CRITERIA(STEP,FCOND,0)_")"
18 ..D DESC^FSCQD(.DESCNT,.CRITERIA)
19 ..K CRITERIA
20 ..S CRITERIA(0)=OPER_"^^0"
21 ..S FCOND=0,PAREN="closed",STEP=1
22 .I $L(OPER),'$D(CRITERIA) S CRITERIA(0)=OPER_"^^0"
23 .I EXT="or" D
24 ..S STEP=STEP+1,FCOND=0
25 ..I PAREN="closed" S PAREN="ready"
26 ..I PAREN="open" S PAREN="closed",LCOND=CRITERIA(STEP-1),CRITERIA(STEP-1,LCOND,1)=CRITERIA(STEP-1,LCOND,1)_")"
27 .I EXT="and",PAREN="ready" S PAREN="open",CRITERIA(STEP,FCOND,0)="("_CRITERIA(STEP,FCOND,0)
28 .S FCOND=FCOND+1
29 .S CRITERIA(STEP)=FCOND
30 .S CRITERIA(STEP,FCOND)=FLD_U_COND_U_VALUE
31 .S CRITERIA(STEP,FCOND,0)=FLDNAME_" "_COND_$S($L(VALNAME):" "_VALNAME,1:"")
32 .S CRITERIA(STEP,FCOND,1)=EXT
33 I PAREN="open" S CRITERIA(STEP,FCOND,0)=CRITERIA(STEP,FCOND,0)_")"
34 S $P(CRITERIA(0),U,2)=STEP
35 I $D(CRITERIA) D DESC^FSCQD(.DESCNT,.CRITERIA)
36 S DESC(0)=$P(DESC(0)," (MODIFIED)")
37 Q
Note: See TracBrowser for help on using the repository browser.