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

FSCQO.m

Go to the documentation of this file.
FSCQO ;SLC/STAFF-NOIS Query Optimize ;1/11/98  18:46
 ;;1.1;NOIS;;Sep 06, 1998
 ;
OPTIMIZE(CRITERIA) ; from FSCQS, FSCRPCQ
 ; ***needs algorithm to assign order to steps in fconds
 N STEP,FCOND,FIELD,SOPT,FOPT
 S STEP=0 F  S STEP=$O(CRITERIA(STEP)) Q:STEP<1  D
 .S SOPT=STEP,CRITERIA("O",SOPT)=STEP
 .S FCOND="" F  S FCOND=$O(CRITERIA(STEP,FCOND)) Q:FCOND=""  S FIELD=$P(CRITERIA(STEP,FCOND),U) D
 ..S FOPT=FCOND
 ..S CRITERIA("F",FIELD)=$P(^FSC("FLD",FIELD,0),U,3,6)
 ..S CRITERIA("O",SOPT,FOPT)=FCOND_U_$G(^FSC("FLD",FIELD,2))
 Q