lib/catissue/domain/specimen_collection_group.rb
def default_receiver
      cep = collection_event_parameters
      cltr = cep.user if cep
      return cltr if cltr
      cp = collection_protocol || return
      rcv = cp.coordinators.first
      return rcv if rcv or cp.fetched?
      # Try to fetch the CP coordinator 
      return cp.coordinators.first if cp.find
      # CP does not exist; add the CP defaults and retry
      cp.add_defaults
      cp.coordinators.first
    end
def default_receiver
      cep = collection_event_parameters
      cltr = cep.user if cep
      return cltr if cltr
      cp = collection_protocol || return
      rcv = cp.coordinators.first
      return rcv if rcv or cp.fetched?
      # Try to fetch the CP coordinator 
      return cp.coordinators.first if cp.find
      # CP does not exist; add the CP defaults and retry
      cp.add_defaults
      cp.coordinators.first
    end
def default_receiver cep = collection_event_parameters cltr = cep . user if cep return cltr if cltr cp = collection_protocol || return rcv = cp . coordinators . first return rcv if rcv or cp . fetched? # Try to fetch the CP coordinator  return cp . coordinators . first if cp . find # CP does not exist; add the CP defaults and retry cp . add_defaults cp . coordinators . first end
Returns the collection protocol coordinator. Fetches the CP if necessary and possible.
 Adds defaults to the CP if necessary, which sets a default coordinator if possible.

 @return [CaTissue::User] the default receiver
Returns the collection protocol coordinator . Fetches the CP if necessary and possible . Adds defaults to the CP if necessary which sets a default coordinator if possible .