Class: DemographicCategory

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
PgSearch
Defined in:
api/app/models/demographic_category.rb

Overview

A category of information about a subject

  • [String] name
  • [Integer] created_by_id
  • [Datetime] created_at
  • [Datetime] updated_at
  • [Integer] sensory_test_id
  • [Integer] company_id, null: false
  • [Integer] source_id - when a test category is created by selecting a company-wide "global" category (i.e. has a NULL sensory_test_id), it receives a source_id pointing to its originator, useful for syncing study-level data back up to the subject
  • [Boolean] exclusive, default: true, null: false
  • [Integer] category_type, default: 0
  • [Datetime] age_date

Category Types

  • user_defined - just a name
  • age - represents age ranges, for example 1-10, 11-20, 21-30, which a subject then matches based on their date_of_birth
  • household_size - represents household member count ranges, for example 1-2, 3-4, 5-20, which a subject then matches based on their household's subject count.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#subject_countObject

Instance Method Details

#calculate_age(dob) ⇒ Object

#process_demographics(current_user, all_demographics, demographic_category) ⇒ Object

#range?Boolean

Returns:

  • (Boolean)

#reassign_range_demographicsObject