Class: Import::ParticipantImportFileParser

  • Object
show all
Defined in:


Parses an excel file or csv full of participants and their associated demographics

Constant Summary collapse

    field: 'name',
    alias: ['name', 'full name'],
    type: :field,
    required: true,
    parser: :standard,
    description: 'The full name of the participant, with spaces.'
    field: 'email',
    alias: ['email', 'e-mail', 'email address', 'emailaddress'],
    type: :field,
    parser: :email,
    unique: true,
    description: 'The email of the participant'
    field: 'locale',
    alias: ['locale', 'preferred_language', 'preferred language', 'language', 'preferredlanguage', 'default language'],
    type: :field,
    parser: :language,
    description: "Language of the participant, values must be one of the following codes: #{ { |locale| locale['id'] }.join(', ')}"
    field: 'external_id',
    alias: ['external_id', 'external id', 'externalid', 'unique id', 'unique_id'],
    type: :field,
    parser: :standard,
    unique: true,
    description: 'Label a participant with an identifier for an external system. Can be used to reconnect the participant during future imports or bulk operations.'
    field: 'note',
    alias: %w[notes note],
    type: :field,
    parser: :standard,
    description: 'Any notes on the participant.'
    field: nil,
    alias: [],
    type: :non_exclusive_demographic,
    parser: :non_exclusive_demographic,
    description: "Non-exclusive demographics are equivalent to a checkbox input in an online form. In excel, these can be spread across columns. The header must match the pattern 'Category Name::Demographic Name' (without the quotes) - to further our online form analogy, the category (everything before the '::' in the header pattern) is the checkbox question text, and the demographic (everything after the '::' in the pattern) is equivalent to the checkbox options. Any cell value not 'No' or '0' (without quotes) will be assigned the demographic referenced in the header."
    field: nil,
    alias: [],
    type: :exclusive_demographic,
    parser: :exclusive_demographic,
    description: 'Exclusive demographics are mutually exclusive assignments, equivalent to a radio input in an online form. Any header that does not match a field or a non-exclusive demographic is considered an exclusive demographic.'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ ParticipantImportFileParser

Returns a new instance of ParticipantImportFileParser.

Instance Attribute Details






Class Method Details


Instance Method Details