def autocomplete(attribute, text)
      # Start up the cache if necessary
      @cache ||= Cache.new
      # Compare lower case.
      text_dc = text.downcase
      # The search term is the first word in the text.
      words = text_dc.split(' ')
      term = words.first
      logger.debug { "Scat is matching the cached #{attribute} values which contain #{term}..." }
      # The hash key, e.g. dx:lymphoma.
      key = KEY_PREFIX_HASH[attribute] + term
      # The CVs which match the term.
      cvs = @cache.get_all(key)
      # Load the CVs if necessary.
      cvs = load_controlled_values(attribute, term, key) if cvs.empty?
      # The CVs which match the entire target.
      matched = words.size == 1 ? cvs : cvs.select { |cv| cv.downcase[text_dc] }
      logger.debug { "#{matched.empty? ? 'No' : matched.size} #{attribute} values match '#{text}'." }
      matched.to_json
    end
def autocomplete(attribute, text)
      # Start up the cache if necessary
      @cache ||= Cache.new
      # Compare lower case.
      text_dc = text.downcase
      # The search term is the first word in the text.
      words = text_dc.split(' ')
      term = words.first
      logger.debug { "Scat is matching the cached #{attribute} values which contain #{term}..." }
      # The hash key, e.g. dx:lymphoma.
      key = KEY_PREFIX_HASH[attribute] + term
      # The CVs which match the term.
      cvs = @cache.get_all(key)
      # Load the CVs if necessary.
      cvs = load_controlled_values(attribute, term, key) if cvs.empty?
      # The CVs which match the entire target.
      matched = words.size == 1 ? cvs : cvs.select { |cv| cv.downcase[text_dc] }
      logger.debug { "#{matched.empty? ? 'No' : matched.size} #{attribute} values match '#{text}'." }
      matched.to_json
    end
Fetches controlled caTissue values for the given attribute and value prefix.
 The supported attributes include the following:
 * +:clinical_diagnosis+ (+SpecimenCollectionGroup.clinical_diagnosis+)
 * +:tissue_site+ (+SpecimenCharacteristics.tissue_site+)

 @param [Symbol] attribute the CV attribute
 @param [String] prefix the leading value letters
 @return [String] the JSON representation of the matching values