examples/galena/lib/galena/seed.rb
def populate
      galena = CaTissue::Institution.new(:name => 'Galena University')

      addr = CaTissue::Address.new(
        :city => 'Galena', :state => 'Illinois', :country => 'United States', :zipCode => '37544',
        :street => '411 Basin St', :phoneNumber => '311-555-5555')

      dept = CaTissue::Department.new(:name => 'Pathology')

      crg = CaTissue::CancerResearchGroup.new(:name => 'Don Thomas Cancer Center')

      coord = CaTissue::User.new(
        :email_address => 'corey.nator@galena.edu',
        :last_name => 'Nator', :first_name => 'Corey', :address => addr.copy,
        :institution => galena, :department => dept, :cancer_research_group => crg)

      @hospital = CaTissue::Site.new(
          :site_type => CaTissue::Site::SiteType::COLLECTION, :name => 'Galena Hospital', 
          :address => addr.copy, :coordinator => coord)

      @tissue_bank = CaTissue::Site.new(
          :site_type => CaTissue::Site::SiteType::REPOSITORY, :name => 'Galena Tissue Bank', 
          :address => addr.copy, :coordinator => coord)

      pi = CaTissue::User.new(
        :email_address => 'vesta.gator@galena.edu',
        :last_name => 'Gator', :first_name => 'Vesta', :address => addr.copy,
        :institution => galena, :department => dept, :cancer_research_group => crg)

      @surgeon = CaTissue::User.new(
        :email_address => 'serge.on@galena.edu',
        :first_name => 'Serge', :last_name => 'On', :address => addr.copy,
        :institution => galena, :department => dept, :cancer_research_group => crg)

      @protocol = CaTissue::CollectionProtocol.new(:title => 'Galena Migration', 
        :principal_investigator => pi, :sites => [@tissue_bank])

      # CPE has default 1.0 event point and label
      cpe = CaTissue::CollectionProtocolEvent.new(
        :collection_protocol => @protocol,
        :event_point => 1.0
      )
      
      # The sole specimen requirement. Setting the requirement collection_event attribute to a CPE automatically
      # sets the CPE requirement inverse attribute in caRuby.
      CaTissue::TissueSpecimenRequirement.new(:collection_event => cpe, :specimen_type => 'Fixed Tissue')

      # the storage container type hierarchy
      @freezer_type = CaTissue::StorageType.new(
        :name => 'Galena Freezer',
        :columns => 10, :rows => 1,
        :column_label => 'Rack'
      )
      rack_type = CaTissue::StorageType.new(:name => 'Galena Rack', :columns => 10, :rows => 10)
      @box_type = CaTissue::StorageType.new(:name => 'Galena Box', :columns => 10, :rows => 10)
      @freezer_type << rack_type
      rack_type << @box_type
      @box_type << 'Tissue'
      
      # the example tissue box
      @box = @box_type.new_container(:name => 'Galena Box 1')
    end
def populate
      galena = CaTissue::Institution.new(:name => 'Galena University')

      addr = CaTissue::Address.new(
        :city => 'Galena', :state => 'Illinois', :country => 'United States', :zipCode => '37544',
        :street => '411 Basin St', :phoneNumber => '311-555-5555')

      dept = CaTissue::Department.new(:name => 'Pathology')

      crg = CaTissue::CancerResearchGroup.new(:name => 'Don Thomas Cancer Center')

      coord = CaTissue::User.new(
        :email_address => 'corey.nator@galena.edu',
        :last_name => 'Nator', :first_name => 'Corey', :address => addr.copy,
        :institution => galena, :department => dept, :cancer_research_group => crg)

      @hospital = CaTissue::Site.new(
          :site_type => CaTissue::Site::SiteType::COLLECTION, :name => 'Galena Hospital', 
          :address => addr.copy, :coordinator => coord)

      @tissue_bank = CaTissue::Site.new(
          :site_type => CaTissue::Site::SiteType::REPOSITORY, :name => 'Galena Tissue Bank', 
          :address => addr.copy, :coordinator => coord)

      pi = CaTissue::User.new(
        :email_address => 'vesta.gator@galena.edu',
        :last_name => 'Gator', :first_name => 'Vesta', :address => addr.copy,
        :institution => galena, :department => dept, :cancer_research_group => crg)

      @surgeon = CaTissue::User.new(
        :email_address => 'serge.on@galena.edu',
        :first_name => 'Serge', :last_name => 'On', :address => addr.copy,
        :institution => galena, :department => dept, :cancer_research_group => crg)

      @protocol = CaTissue::CollectionProtocol.new(:title => 'Galena Migration', 
        :principal_investigator => pi, :sites => [@tissue_bank])

      # CPE has default 1.0 event point and label
      cpe = CaTissue::CollectionProtocolEvent.new(
        :collection_protocol => @protocol,
        :event_point => 1.0
      )
      
      # The sole specimen requirement. Setting the requirement collection_event attribute to a CPE automatically
      # sets the CPE requirement inverse attribute in caRuby.
      CaTissue::TissueSpecimenRequirement.new(:collection_event => cpe, :specimen_type => 'Fixed Tissue')

      # the storage container type hierarchy
      @freezer_type = CaTissue::StorageType.new(
        :name => 'Galena Freezer',
        :columns => 10, :rows => 1,
        :column_label => 'Rack'
      )
      rack_type = CaTissue::StorageType.new(:name => 'Galena Rack', :columns => 10, :rows => 10)
      @box_type = CaTissue::StorageType.new(:name => 'Galena Box', :columns => 10, :rows => 10)
      @freezer_type << rack_type
      rack_type << @box_type
      @box_type << 'Tissue'
      
      # the example tissue box
      @box = @box_type.new_container(:name => 'Galena Box 1')
    end
def populate galena = CaTissue :: Institution . new ( :name => 'Galena University' ) addr = CaTissue :: Address . new ( :city => 'Galena' , :state => 'Illinois' , :country => 'United States' , :zipCode => '37544' , :street => '411 Basin St' , :phoneNumber => '311-555-5555' ) dept = CaTissue :: Department . new ( :name => 'Pathology' ) crg = CaTissue :: CancerResearchGroup . new ( :name => 'Don Thomas Cancer Center' ) coord = CaTissue :: User . new ( :email_address => 'corey.nator@galena.edu' , :last_name => 'Nator' , :first_name => 'Corey' , :address => addr . copy , :institution => galena , :department => dept , :cancer_research_group => crg ) @hospital = CaTissue :: Site . new ( :site_type => CaTissue :: Site :: SiteType :: COLLECTION , :name => 'Galena Hospital' , :address => addr . copy , :coordinator => coord ) @tissue_bank = CaTissue :: Site . new ( :site_type => CaTissue :: Site :: SiteType :: REPOSITORY , :name => 'Galena Tissue Bank' , :address => addr . copy , :coordinator => coord ) pi = CaTissue :: User . new ( :email_address => 'vesta.gator@galena.edu' , :last_name => 'Gator' , :first_name => 'Vesta' , :address => addr . copy , :institution => galena , :department => dept , :cancer_research_group => crg ) @surgeon = CaTissue :: User . new ( :email_address => 'serge.on@galena.edu' , :first_name => 'Serge' , :last_name => 'On' , :address => addr . copy , :institution => galena , :department => dept , :cancer_research_group => crg ) @protocol = CaTissue :: CollectionProtocol . new ( :title => 'Galena Migration' , :principal_investigator => pi , :sites => [ @tissue_bank ] ) # CPE has default 1.0 event point and label cpe = CaTissue :: CollectionProtocolEvent . new ( :collection_protocol => @protocol , :event_point => 1.0 ) # The sole specimen requirement. Setting the requirement collection_event attribute to a CPE automatically # sets the CPE requirement inverse attribute in caRuby. CaTissue :: TissueSpecimenRequirement . new ( :collection_event => cpe , :specimen_type => 'Fixed Tissue' ) # the storage container type hierarchy @freezer_type = CaTissue :: StorageType . new ( :name => 'Galena Freezer' , :columns => 10 , :rows => 1 , :column_label => 'Rack' ) rack_type = CaTissue :: StorageType . new ( :name => 'Galena Rack' , :columns => 10 , :rows => 10 ) @box_type = CaTissue :: StorageType . new ( :name => 'Galena Box' , :columns => 10 , :rows => 10 ) @freezer_type << rack_type rack_type << @box_type @box_type << 'Tissue' # the example tissue box @box = @box_type . new_container ( :name => 'Galena Box 1' ) end
Sets the Galena example Defaults attributes to new objects.
Sets the Galena example Defaults attributes to new objects .