// Look up a schema based on site, histology and an optional discriminator.
        // @param lookup schema lookup input
        // @return a list of StagingSchemaInfo objects
        private List <StagingSchema> getSchemas(SchemaLookup lookup)
        {
            List <StagingSchema> matchedSchemas = new List <StagingSchema>(5);

            String site             = lookup.getInput(StagingData.PRIMARY_SITE_KEY);
            String histology        = lookup.getInput(StagingData.HISTOLOGY_KEY);
            bool   hasDiscriminator = lookup.hasDiscriminator();

            // site or histology must be supplied and they must be valid; I am assuming that all algorithms must have tables that validate
            // both site and histology
            if ((site != null && !isValidSite(site)) || (histology != null && !isValidHistology(histology)))
            {
                return(matchedSchemas);
            }

            // searching on a discriminator is only supported if also searching on site and histology; if ssf25 supplied without either
            // of those fields, return no results
            if (hasDiscriminator && (site == null || (site.Length == 0) || histology == null || (histology.Length == 0)))
            {
                return(matchedSchemas);
            }

            // site or histology must be supplied
            if (site != null || histology != null)
            {
                HashSet <String> lstSchemaIds = getSchemaIds();

                // loop over selection table and match using only the supplied keys
                foreach (String schemaId in lstSchemaIds)
                {
                    StagingSchema schema = (StagingSchema)(getDefinition(schemaId));

                    if (schema.getSchemaSelectionTable() != null)
                    {
                        StagingTable table = (StagingTable)(getTable(schema.getSchemaSelectionTable()));
                        if (table != null && DecisionEngineFuncs.matchTable(table, lookup.getInputs(), lookup.getKeys()) != null)
                        {
                            matchedSchemas.Add(schema);
                        }
                    }
                }
            }

            return(matchedSchemas);
        }