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

FSCLMPMQ.m

Go to the documentation of this file.
FSCLMPMQ ;SLC/STAFF-NOIS List Manager Protocol Modify Query ;4/22/94  11:04
 ;;1.1;NOIS;;Sep 06, 1998
 ;
QDESC(ARRAY,DESC,CRITERIA) ; from FSCLDU, FSCLMPMS
 N COND,DEFINE,DESCNT,EXT,FCOND,FLD,FLDNAME,LCOND,LINE,OPER,PAREN,STEP,VALNAME,VALUE,X K CRITERIA,DESC
 S DEFINE=0,DESC(0)="List: "_FSCLNAME
 S PAREN="closed",(DESCNT,FCOND,LINE)=0,STEP=1 F  S LINE=$O(ARRAY(LINE)) Q:LINE<1  D
 .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)
 .S OPER=$S(OPER="A":"Add",OPER="R":"Remove",OPER="S":"Select",1:"")
 .S EXT=$S(EXT="A":"and",EXT="O":"or",1:"")
 .S FLDNAME=$P(^FSC("FLD",+FLD,0),U)
 .S COND=$P(^FSC("COND",+COND,0),U,2)
 .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))
 .I $L(VALUE),"FW"[$E($P(^FSC("FLD",+FLD,0),U,3)) S VALNAME=""""_VALUE_""""
 .I $L(OPER),$D(CRITERIA) D
 ..S $P(CRITERIA(0),U,2)=STEP
 ..I PAREN="open" S CRITERIA(STEP,FCOND,0)=CRITERIA(STEP,FCOND,0)_")"
 ..D DESC^FSCQD(.DESCNT,.CRITERIA)
 ..K CRITERIA
 ..S CRITERIA(0)=OPER_"^^0"
 ..S FCOND=0,PAREN="closed",STEP=1
 .I $L(OPER),'$D(CRITERIA) S CRITERIA(0)=OPER_"^^0"
 .I EXT="or" D
 ..S STEP=STEP+1,FCOND=0
 ..I PAREN="closed" S PAREN="ready"
 ..I PAREN="open" S PAREN="closed",LCOND=CRITERIA(STEP-1),CRITERIA(STEP-1,LCOND,1)=CRITERIA(STEP-1,LCOND,1)_")"
 .I EXT="and",PAREN="ready" S PAREN="open",CRITERIA(STEP,FCOND,0)="("_CRITERIA(STEP,FCOND,0)
 .S FCOND=FCOND+1
 .S CRITERIA(STEP)=FCOND
 .S CRITERIA(STEP,FCOND)=FLD_U_COND_U_VALUE
 .S CRITERIA(STEP,FCOND,0)=FLDNAME_" "_COND_$S($L(VALNAME):" "_VALNAME,1:"")
 .S CRITERIA(STEP,FCOND,1)=EXT
 I PAREN="open" S CRITERIA(STEP,FCOND,0)=CRITERIA(STEP,FCOND,0)_")"
 S $P(CRITERIA(0),U,2)=STEP
 I $D(CRITERIA) D DESC^FSCQD(.DESCNT,.CRITERIA)
 S DESC(0)=$P(DESC(0)," (MODIFIED)")
 Q