class BQRaceSchema(BQSchema):
    """
  Participant race information
  """
    race = BQField('race', BQFieldTypeEnum.STRING, BQFieldModeEnum.NULLABLE)
    race_id = BQField('race_id', BQFieldTypeEnum.INTEGER,
                      BQFieldModeEnum.NULLABLE)
class BQGenderSchema(BQSchema):
    """
  Participant gender information
  """
    gender = BQField('gender', BQFieldTypeEnum.STRING,
                     BQFieldModeEnum.NULLABLE)
    gender_id = BQField('gender_id', BQFieldTypeEnum.INTEGER,
                        BQFieldModeEnum.NULLABLE)
Ejemplo n.º 3
0
class BQPDRPhysicalMeasurements(BQSchema):
    """
  PDR Participant Physical Measurements
  """
    pm_status = BQField('pm_status', BQFieldTypeEnum.STRING,
                        BQFieldModeEnum.NULLABLE)
    pm_status_id = BQField('pm_status_id', BQFieldTypeEnum.INTEGER,
                           BQFieldModeEnum.NULLABLE)
    pm_finalized = BQField('pm_finalized', BQFieldTypeEnum.DATETIME,
                           BQFieldModeEnum.NULLABLE)
class BQTestNestedSchema(BQSchema):

    int_field = BQField('int_field', BQFieldTypeEnum.INTEGER,
                        BQFieldModeEnum.NULLABLE)
    str_field = BQField('str_field', BQFieldTypeEnum.STRING,
                        BQFieldModeEnum.NULLABLE)
    enum_field = BQField('enum_field',
                         BQFieldTypeEnum.INTEGER,
                         BQFieldModeEnum.NULLABLE,
                         fld_enum=BQTestEnum)
Ejemplo n.º 5
0
class BQPDRBiospecimenSchema(BQSchema):
    """
  PDR Summary of Biobank Orders and Tests
  """
    biosp_status = BQField('biosp_status', BQFieldTypeEnum.STRING,
                           BQFieldModeEnum.NULLABLE)
    biosp_status_id = BQField('biosp_status_id', BQFieldTypeEnum.INTEGER,
                              BQFieldModeEnum.NULLABLE)
    biosp_order_time = BQField('biosp_order_time', BQFieldTypeEnum.DATETIME,
                               BQFieldModeEnum.NULLABLE)
    biosp_isolate_dna = BQField('biosp_isolate_dna', BQFieldTypeEnum.INTEGER,
                                BQFieldModeEnum.NULLABLE)
class BQConsentSchema(BQSchema):
    """
  Store participant consent information
  """
    consent = BQField('consent', BQFieldTypeEnum.STRING,
                      BQFieldModeEnum.NULLABLE)
    consent_id = BQField('consent_id', BQFieldTypeEnum.INTEGER,
                         BQFieldModeEnum.NULLABLE)
    consent_date = BQField('consent_date', BQFieldTypeEnum.DATE,
                           BQFieldModeEnum.NULLABLE)
    consent_value = BQField('consent_value', BQFieldTypeEnum.STRING,
                            BQFieldModeEnum.NULLABLE)
    consent_value_id = BQField('consent_value_id', BQFieldTypeEnum.INTEGER,
                               BQFieldModeEnum.NULLABLE)
class BQAddressSchema(BQSchema):
    """
  Represents a street address schema.
  Note: Do not use camelCase for property names. Property names must exactly match BQ
        field names.
  """
    addr_type = BQField('addr_type',
                        BQFieldTypeEnum.STRING,
                        BQFieldModeEnum.REQUIRED,
                        fld_enum=BQStreetAddressTypeEnum)
    addr_type_id = BQField('addr_type_id',
                           BQFieldTypeEnum.INTEGER,
                           BQFieldModeEnum.REQUIRED,
                           fld_enum=BQStreetAddressTypeEnum)
    addr_street_address_1 = BQField('addr_street_address_1',
                                    BQFieldTypeEnum.STRING,
                                    BQFieldModeEnum.NULLABLE)
    addr_street_address_2 = BQField('addr_street_address_2',
                                    BQFieldTypeEnum.STRING,
                                    BQFieldModeEnum.NULLABLE)
    addr_city = BQField('addr_city', BQFieldTypeEnum.STRING,
                        BQFieldModeEnum.NULLABLE)
    addr_state = BQField('addr_state', BQFieldTypeEnum.STRING,
                         BQFieldModeEnum.NULLABLE)
    addr_country = BQField('addr_country', BQFieldTypeEnum.STRING,
                           BQFieldModeEnum.NULLABLE)
    addr_zip = BQField('addr_zip', BQFieldTypeEnum.STRING,
                       BQFieldModeEnum.NULLABLE)
Ejemplo n.º 8
0
class BQHPOSchema(BQSchema):

    id = BQField('id', BQFieldTypeEnum.INTEGER, BQFieldModeEnum.REQUIRED)
    created = BQField('created', BQFieldTypeEnum.DATETIME,
                      BQFieldModeEnum.REQUIRED)
    modified = BQField('modified', BQFieldTypeEnum.DATETIME,
                       BQFieldModeEnum.REQUIRED)

    hpo_id = BQField('hpo_id', BQFieldTypeEnum.INTEGER,
                     BQFieldModeEnum.REQUIRED)
    name = BQField('name', BQFieldTypeEnum.STRING, BQFieldModeEnum.NULLABLE)
    display_name = BQField('display_name', BQFieldTypeEnum.STRING,
                           BQFieldModeEnum.NULLABLE)
    organization_type = BQField('organization_type',
                                BQFieldTypeEnum.INTEGER,
                                BQFieldModeEnum.NULLABLE,
                                fld_enum=BQOrganizationTypeEnum)
    is_obsolete = BQField('is_obsolete',
                          BQFieldTypeEnum.INTEGER,
                          BQFieldModeEnum.NULLABLE,
                          fld_enum=BQObsoleteStatusEnum)
class BQOrganizationSchema(BQSchema):

    id = BQField('id', BQFieldTypeEnum.INTEGER, BQFieldModeEnum.REQUIRED)
    created = BQField('created', BQFieldTypeEnum.DATETIME,
                      BQFieldModeEnum.REQUIRED)
    modified = BQField('modified', BQFieldTypeEnum.DATETIME,
                       BQFieldModeEnum.REQUIRED)

    # Foreign key to awardee/hpo this organization belongs to.
    hpo_id = BQField('hpo_id', BQFieldTypeEnum.INTEGER,
                     BQFieldModeEnum.NULLABLE)
    organization_id = BQField('organization_id', BQFieldTypeEnum.INTEGER,
                              BQFieldModeEnum.REQUIRED)
    # External ID for the organization, e.g. WISC_MADISON
    external_id = BQField('external_id', BQFieldTypeEnum.STRING,
                          BQFieldModeEnum.REQUIRED)
    # Human readable display name for the organization, e.g. University of Wisconsin, Madison
    display_name = BQField('display_name', BQFieldTypeEnum.STRING,
                           BQFieldModeEnum.NULLABLE)
    is_obsolete = BQField('is_obsolete',
                          BQFieldTypeEnum.INTEGER,
                          BQFieldModeEnum.NULLABLE,
                          fld_enum=BQObsoleteStatusEnum)
class BQModuleStatusSchema(BQSchema):
    """
  Store information about modules submitted
  """
    mod_module = BQField('mod_module', BQFieldTypeEnum.STRING,
                         BQFieldModeEnum.NULLABLE)
    mod_baseline_module = BQField('mod_baseline_module',
                                  BQFieldTypeEnum.INTEGER,
                                  BQFieldModeEnum.NULLABLE)
    mod_authored = BQField('mod_authored', BQFieldTypeEnum.STRING,
                           BQFieldModeEnum.NULLABLE)
    mod_created = BQField('mod_created', BQFieldTypeEnum.STRING,
                          BQFieldModeEnum.NULLABLE)
    mod_language = BQField('mod_language', BQFieldTypeEnum.STRING,
                           BQFieldModeEnum.NULLABLE)
    mod_status = BQField('mod_status',
                         BQFieldTypeEnum.STRING,
                         BQFieldModeEnum.NULLABLE,
                         fld_enum=BQModuleStatusEnum)
    mod_status_id = BQField('mod_status_id',
                            BQFieldTypeEnum.INTEGER,
                            BQFieldModeEnum.NULLABLE,
                            fld_enum=BQModuleStatusEnum)
class BQTestSchema(BQSchema):

    descr = BQField('descr', BQFieldTypeEnum.STRING, BQFieldModeEnum.REQUIRED)
    timestamp = BQField('timestamp', BQFieldTypeEnum.DATETIME,
                        BQFieldModeEnum.REQUIRED)
    nested = BQRecordField('nested', BQTestNestedSchema)
Ejemplo n.º 12
0
class BQSiteSchema(BQSchema):

    id = BQField('id', BQFieldTypeEnum.INTEGER, BQFieldModeEnum.REQUIRED)
    created = BQField('created', BQFieldTypeEnum.DATETIME,
                      BQFieldModeEnum.REQUIRED)
    modified = BQField('modified', BQFieldTypeEnum.DATETIME,
                       BQFieldModeEnum.REQUIRED)

    hpo_id = BQField('hpo_id', BQFieldTypeEnum.INTEGER,
                     BQFieldModeEnum.NULLABLE)
    organization_id = BQField('organization_id', BQFieldTypeEnum.INTEGER,
                              BQFieldModeEnum.NULLABLE)

    site_id = BQField('site_id', BQFieldTypeEnum.INTEGER,
                      BQFieldModeEnum.REQUIRED)
    site_name = BQField('site_name', BQFieldTypeEnum.STRING,
                        BQFieldModeEnum.NULLABLE)
    # The Google group for the site; this is a unique key used externally.
    google_group = BQField('google_group', BQFieldTypeEnum.STRING,
                           BQFieldModeEnum.NULLABLE)
    mayolink_client_number = BQField('mayolink_client_number',
                                     BQFieldTypeEnum.INTEGER,
                                     BQFieldModeEnum.NULLABLE)

    site_status = BQField('site_status',
                          BQFieldTypeEnum.INTEGER,
                          BQFieldModeEnum.NULLABLE,
                          fld_enum=BQSiteStatus)
    enrolling_status = BQField('enrolling_status',
                               BQFieldTypeEnum.INTEGER,
                               BQFieldModeEnum.NULLABLE,
                               fld_enum=BQEnrollingStatus)
    digital_scheduling_status = BQField('digital_scheduling_status',
                                        BQFieldTypeEnum.INTEGER,
                                        BQFieldModeEnum.NULLABLE,
                                        fld_enum=BQDigitalSchedulingStatus)

    schedule_instructions = BQField('schedule_instructions',
                                    BQFieldTypeEnum.STRING,
                                    BQFieldModeEnum.NULLABLE)
    schedule_instructions_es = BQField('schedule_instructions_es',
                                       BQFieldTypeEnum.STRING,
                                       BQFieldModeEnum.NULLABLE)
    launch_date = BQField('launch_date', BQFieldTypeEnum.DATE,
                          BQFieldModeEnum.NULLABLE)
    notes = BQField('notes', BQFieldTypeEnum.STRING, BQFieldModeEnum.NULLABLE)
    notes_es = BQField('notes_es', BQFieldTypeEnum.STRING,
                       BQFieldModeEnum.NULLABLE)
    latitude = BQField('latitude', BQFieldTypeEnum.FLOAT,
                       BQFieldModeEnum.NULLABLE)
    longitude = BQField('longitude', BQFieldTypeEnum.FLOAT,
                        BQFieldModeEnum.NULLABLE)
    time_zone_id = BQField('time_zone_id', BQFieldTypeEnum.STRING,
                           BQFieldModeEnum.NULLABLE)
    directions = BQField('directions', BQFieldTypeEnum.STRING,
                         BQFieldModeEnum.NULLABLE)
    physical_location_name = BQField('physical_location_name',
                                     BQFieldTypeEnum.STRING,
                                     BQFieldModeEnum.NULLABLE)
    address_1 = BQField('address_1', BQFieldTypeEnum.STRING,
                        BQFieldModeEnum.NULLABLE)
    address_2 = BQField('address_2', BQFieldTypeEnum.STRING,
                        BQFieldModeEnum.NULLABLE)
    city = BQField('city', BQFieldTypeEnum.STRING, BQFieldModeEnum.NULLABLE)
    state = BQField('state', BQFieldTypeEnum.STRING, BQFieldModeEnum.NULLABLE)
    zip_code = BQField('zip_code', BQFieldTypeEnum.STRING,
                       BQFieldModeEnum.NULLABLE)
    phone_number = BQField('phone_number', BQFieldTypeEnum.STRING,
                           BQFieldModeEnum.NULLABLE)
    admin_emails = BQField('admin_emails', BQFieldTypeEnum.STRING,
                           BQFieldModeEnum.NULLABLE)
    link = BQField('link', BQFieldTypeEnum.STRING, BQFieldModeEnum.NULLABLE)
    is_obsolete = BQField('is_obsolete',
                          BQFieldTypeEnum.INTEGER,
                          BQFieldModeEnum.NULLABLE,
                          fld_enum=BQObsoleteStatusEnum)
class BQBiobankSampleSchema(BQSchema):
    """
  Biobank sample information
  """
    bbs_test = BQField('bbs_test', BQFieldTypeEnum.STRING,
                       BQFieldModeEnum.NULLABLE)
    bbs_baseline_test = BQField('bbs_baseline_test', BQFieldTypeEnum.INTEGER,
                                BQFieldModeEnum.NULLABLE)
    bbs_dna_test = BQField('bbs_dna_test', BQFieldTypeEnum.INTEGER,
                           BQFieldModeEnum.NULLABLE)
    bbs_collected = BQField('bbs_collected', BQFieldTypeEnum.DATETIME,
                            BQFieldModeEnum.NULLABLE)
    bbs_processed = BQField('bbs_processed', BQFieldTypeEnum.DATETIME,
                            BQFieldModeEnum.NULLABLE)
    bbs_finalized = BQField('bbs_finalized', BQFieldTypeEnum.DATETIME,
                            BQFieldModeEnum.NULLABLE)
    bbs_created = BQField('bbs_created', BQFieldTypeEnum.DATETIME,
                          BQFieldModeEnum.NULLABLE)
    bbs_confirmed = BQField('bbs_confirmed', BQFieldTypeEnum.DATETIME,
                            BQFieldModeEnum.NULLABLE)
    bbs_status = BQField('bbs_status', BQFieldTypeEnum.STRING,
                         BQFieldModeEnum.NULLABLE)
    bbs_status_id = BQField('bbs_status_id', BQFieldTypeEnum.INTEGER,
                            BQFieldModeEnum.NULLABLE)
    bbs_disposed = BQField('bbs_disposed', BQFieldTypeEnum.DATETIME,
                           BQFieldModeEnum.NULLABLE)
    bbs_disposed_reason = BQField('bbs_disposed_reason',
                                  BQFieldTypeEnum.STRING,
                                  BQFieldModeEnum.NULLABLE)
    bbs_disposed_reason_id = BQField('bbs_disposed_reason_id',
                                     BQFieldTypeEnum.INTEGER,
                                     BQFieldModeEnum.NULLABLE)
Ejemplo n.º 14
0
class BQPDRParticipantSummarySchema(BQSchema):
    """
  A subset of participant summary for PDR that does not contain PII.
  Note: !!! If you add fields here, remember to add them to the View as well. !!!
  Note: Do not use camelCase for property names. Property names must exactly match BQ
        field names.
  """
    id = BQField('id', BQFieldTypeEnum.INTEGER, BQFieldModeEnum.REQUIRED)
    created = BQField('created', BQFieldTypeEnum.DATETIME,
                      BQFieldModeEnum.REQUIRED)
    modified = BQField('modified', BQFieldTypeEnum.DATETIME,
                       BQFieldModeEnum.REQUIRED)

    participant_id = BQField('participant_id', BQFieldTypeEnum.INTEGER,
                             BQFieldModeEnum.REQUIRED)
    addr_city = BQField('addr_city', BQFieldTypeEnum.STRING,
                        BQFieldModeEnum.NULLABLE)
    addr_state = BQField('addr_state', BQFieldTypeEnum.STRING,
                         BQFieldModeEnum.NULLABLE)
    addr_zip = BQField('addr_zip', BQFieldTypeEnum.STRING,
                       BQFieldModeEnum.NULLABLE)

    is_ghost_id = BQField('is_ghost_id', BQFieldTypeEnum.INTEGER,
                          BQFieldModeEnum.REQUIRED)

    sign_up_time = BQField('sign_up_time', BQFieldTypeEnum.DATETIME,
                           BQFieldModeEnum.NULLABLE)
    enrollment_status = BQField('enrollment_status', BQFieldTypeEnum.STRING,
                                BQFieldModeEnum.NULLABLE)
    enrollment_status_id = BQField('enrollment_status_id',
                                   BQFieldTypeEnum.INTEGER,
                                   BQFieldModeEnum.NULLABLE)
    enrollment_member = BQField('enrollment_member', BQFieldTypeEnum.DATETIME,
                                BQFieldModeEnum.NULLABLE)
    enrollment_core_ordered = BQField('enrollment_core_ordered',
                                      BQFieldTypeEnum.DATETIME,
                                      BQFieldModeEnum.NULLABLE)
    enrollment_core_stored = BQField('enrollment_core_stored',
                                     BQFieldTypeEnum.DATETIME,
                                     BQFieldModeEnum.NULLABLE)

    ehr_status = BQField('ehr_status', BQFieldTypeEnum.STRING,
                         BQFieldModeEnum.NULLABLE)
    ehr_status_id = BQField('ehr_status_id', BQFieldTypeEnum.INTEGER,
                            BQFieldModeEnum.NULLABLE)
    ehr_receipt = BQField('ehr_receipt', BQFieldTypeEnum.DATETIME,
                          BQFieldModeEnum.NULLABLE)
    ehr_update = BQField('ehr_update', BQFieldTypeEnum.DATETIME,
                         BQFieldModeEnum.NULLABLE)

    withdrawal_status = BQField('withdrawal_status', BQFieldTypeEnum.STRING,
                                BQFieldModeEnum.NULLABLE)
    withdrawal_status_id = BQField('withdrawal_status_id',
                                   BQFieldTypeEnum.INTEGER,
                                   BQFieldModeEnum.NULLABLE)
    withdrawal_time = BQField('withdrawal_time', BQFieldTypeEnum.DATETIME,
                              BQFieldModeEnum.NULLABLE)
    withdrawal_authored = BQField('withdrawal_authored',
                                  BQFieldTypeEnum.DATETIME,
                                  BQFieldModeEnum.NULLABLE)
    withdrawal_reason = BQField('withdrawal_reason', BQFieldTypeEnum.STRING,
                                BQFieldModeEnum.NULLABLE)
    withdrawal_reason_id = BQField('withdrawal_reason_id',
                                   BQFieldTypeEnum.INTEGER,
                                   BQFieldModeEnum.NULLABLE)
    withdrawal_reason_justification = BQField(
        'withdrawal_reason_justification', BQFieldTypeEnum.STRING,
        BQFieldModeEnum.NULLABLE)

    hpo = BQField('hpo', BQFieldTypeEnum.STRING, BQFieldModeEnum.REQUIRED)
    hpo_id = BQField('hpo_id', BQFieldTypeEnum.INTEGER,
                     BQFieldModeEnum.REQUIRED)
    organization = BQField('organization', BQFieldTypeEnum.STRING,
                           BQFieldModeEnum.NULLABLE)
    organization_id = BQField('organization_id', BQFieldTypeEnum.INTEGER,
                              BQFieldModeEnum.NULLABLE)
    site = BQField('site', BQFieldTypeEnum.STRING, BQFieldModeEnum.NULLABLE)
    site_id = BQField('site_id', BQFieldTypeEnum.INTEGER,
                      BQFieldModeEnum.NULLABLE)

    date_of_birth = BQField('date_of_birth', BQFieldTypeEnum.DATE,
                            BQFieldModeEnum.NULLABLE)
    primary_language = BQField('primary_language', BQFieldTypeEnum.STRING,
                               BQFieldModeEnum.NULLABLE)

    education = BQField('education', BQFieldTypeEnum.STRING,
                        BQFieldModeEnum.NULLABLE)
    education_id = BQField('education_id', BQFieldTypeEnum.INTEGER,
                           BQFieldModeEnum.NULLABLE)
    income = BQField('income', BQFieldTypeEnum.STRING,
                     BQFieldModeEnum.NULLABLE)
    income_id = BQField('income_id', BQFieldTypeEnum.INTEGER,
                        BQFieldModeEnum.NULLABLE)

    sex = BQField('sex', BQFieldTypeEnum.STRING, BQFieldModeEnum.NULLABLE)
    sex_id = BQField('sex_id', BQFieldTypeEnum.INTEGER,
                     BQFieldModeEnum.NULLABLE)

    pm = BQRecordField('pm', schema=BQPDRPhysicalMeasurements)

    races = BQRecordField('races', schema=BQRaceSchema)
    genders = BQRecordField('genders', schema=BQGenderSchema)
    modules = BQRecordField('modules', schema=BQModuleStatusSchema)
    consents = BQRecordField('consents', schema=BQConsentSchema)

    biospec = BQRecordField('biospec', schema=BQPDRBiospecimenSchema)

    ubr_sex = BQField('ubr_sex', BQFieldTypeEnum.INTEGER,
                      BQFieldModeEnum.NULLABLE)
    ubr_sexual_orientation = BQField('ubr_sexual_orientation',
                                     BQFieldTypeEnum.INTEGER,
                                     BQFieldModeEnum.NULLABLE)
    ubr_gender_identity = BQField('ubr_gender_identity',
                                  BQFieldTypeEnum.INTEGER,
                                  BQFieldModeEnum.NULLABLE)
    ubr_ethnicity = BQField('ubr_ethnicity', BQFieldTypeEnum.INTEGER,
                            BQFieldModeEnum.NULLABLE)
    ubr_geography = BQField('ubr_geography', BQFieldTypeEnum.INTEGER,
                            BQFieldModeEnum.NULLABLE)
    ubr_education = BQField('ubr_education', BQFieldTypeEnum.INTEGER,
                            BQFieldModeEnum.NULLABLE)
    ubr_income = BQField('ubr_income', BQFieldTypeEnum.INTEGER,
                         BQFieldModeEnum.NULLABLE)
    ubr_sexual_gender_minority = BQField('ubr_sexual_gender_minority',
                                         BQFieldTypeEnum.INTEGER,
                                         BQFieldModeEnum.NULLABLE)
    ubr_overall = BQField('ubr_overall', BQFieldTypeEnum.INTEGER,
                          BQFieldModeEnum.NULLABLE)
class BQBiobankOrderSchema(BQSchema):
    """
  Biobank order information
  """
    bbo_biobank_order_id = BQField('bbo_biobank_order_id',
                                   BQFieldTypeEnum.STRING,
                                   BQFieldModeEnum.NULLABLE)
    bbo_created = BQField('bbo_created', BQFieldTypeEnum.DATETIME,
                          BQFieldModeEnum.NULLABLE)
    bbo_status = BQField('bbo_status', BQFieldTypeEnum.STRING,
                         BQFieldModeEnum.NULLABLE)
    bbo_status_id = BQField('bbo_status_id', BQFieldTypeEnum.INTEGER,
                            BQFieldModeEnum.NULLABLE)
    bbo_dv_order = BQField('bbo_dv_order', BQFieldTypeEnum.INTEGER,
                           BQFieldModeEnum.NULLABLE)
    bbo_collected_site = BQField('bbo_collected_site', BQFieldTypeEnum.STRING,
                                 BQFieldModeEnum.NULLABLE)
    bbo_collected_site_id = BQField('bbo_collected_site_id',
                                    BQFieldTypeEnum.INTEGER,
                                    BQFieldModeEnum.NULLABLE)
    bbo_processed_site = BQField('bbo_processed_site', BQFieldTypeEnum.STRING,
                                 BQFieldModeEnum.NULLABLE)
    bbo_processed_site_id = BQField('bbo_processed_site_id',
                                    BQFieldTypeEnum.INTEGER,
                                    BQFieldModeEnum.NULLABLE)
    bbo_finalized_site = BQField('bbo_finalized_site', BQFieldTypeEnum.STRING,
                                 BQFieldModeEnum.NULLABLE)
    bbo_finalized_site_id = BQField('bbo_finalized_site_id',
                                    BQFieldTypeEnum.INTEGER,
                                    BQFieldModeEnum.NULLABLE)
    bbo_samples = BQRecordField('bbo_samples', schema=BQBiobankSampleSchema)
class BQParticipantSummarySchema(BQSchema):
    """
  Note: Do not use camelCase for property names. Property names must exactly match BQ
        field names.
  """
    id = BQField('id', BQFieldTypeEnum.INTEGER, BQFieldModeEnum.REQUIRED)
    created = BQField('created', BQFieldTypeEnum.DATETIME,
                      BQFieldModeEnum.REQUIRED)
    modified = BQField('modified', BQFieldTypeEnum.DATETIME,
                       BQFieldModeEnum.REQUIRED)

    last_modified = BQField('last_modified', BQFieldTypeEnum.DATETIME,
                            BQFieldModeEnum.REQUIRED)

    participant_id = BQField('participant_id', BQFieldTypeEnum.INTEGER,
                             BQFieldModeEnum.REQUIRED)
    biobank_id = BQField('biobank_id', BQFieldTypeEnum.INTEGER,
                         BQFieldModeEnum.REQUIRED)

    first_name = BQField('first_name', BQFieldTypeEnum.STRING,
                         BQFieldModeEnum.NULLABLE)
    middle_name = BQField('middle_name', BQFieldTypeEnum.STRING,
                          BQFieldModeEnum.NULLABLE)
    last_name = BQField('last_name', BQFieldTypeEnum.STRING,
                        BQFieldModeEnum.NULLABLE)

    is_ghost_id = BQField('is_ghost_id', BQFieldTypeEnum.INTEGER,
                          BQFieldModeEnum.REQUIRED)

    sign_up_time = BQField('sign_up_time', BQFieldTypeEnum.DATETIME,
                           BQFieldModeEnum.NULLABLE)
    enrollment_status = BQField('enrollment_status', BQFieldTypeEnum.STRING,
                                BQFieldModeEnum.NULLABLE)
    enrollment_status_id = BQField('enrollment_status_id',
                                   BQFieldTypeEnum.INTEGER,
                                   BQFieldModeEnum.NULLABLE)
    enrollment_member = BQField('enrollment_member', BQFieldTypeEnum.DATETIME,
                                BQFieldModeEnum.NULLABLE)
    enrollment_core_ordered = BQField('enrollment_core_ordered',
                                      BQFieldTypeEnum.DATETIME,
                                      BQFieldModeEnum.NULLABLE)
    enrollment_core_stored = BQField('enrollment_core_stored',
                                     BQFieldTypeEnum.DATETIME,
                                     BQFieldModeEnum.NULLABLE)

    ehr_status = BQField('ehr_status', BQFieldTypeEnum.STRING,
                         BQFieldModeEnum.NULLABLE)
    ehr_status_id = BQField('ehr_status_id', BQFieldTypeEnum.INTEGER,
                            BQFieldModeEnum.NULLABLE)
    ehr_receipt = BQField('ehr_receipt', BQFieldTypeEnum.DATETIME,
                          BQFieldModeEnum.NULLABLE)
    ehr_update = BQField('ehr_update', BQFieldTypeEnum.DATETIME,
                         BQFieldModeEnum.NULLABLE)

    withdrawal_status = BQField('withdrawal_status', BQFieldTypeEnum.STRING,
                                BQFieldModeEnum.NULLABLE)
    withdrawal_status_id = BQField('withdrawal_status_id',
                                   BQFieldTypeEnum.INTEGER,
                                   BQFieldModeEnum.NULLABLE)
    withdrawal_time = BQField('withdrawal_time', BQFieldTypeEnum.DATETIME,
                              BQFieldModeEnum.NULLABLE)
    withdrawal_authored = BQField('withdrawal_authored',
                                  BQFieldTypeEnum.DATETIME,
                                  BQFieldModeEnum.NULLABLE)
    withdrawal_reason = BQField('withdrawal_reason', BQFieldTypeEnum.STRING,
                                BQFieldModeEnum.NULLABLE)
    withdrawal_reason_id = BQField('withdrawal_reason_id',
                                   BQFieldTypeEnum.INTEGER,
                                   BQFieldModeEnum.NULLABLE)
    withdrawal_reason_justification = BQField(
        'withdrawal_reason_justification', BQFieldTypeEnum.STRING,
        BQFieldModeEnum.NULLABLE)
    suspension_status = BQField('suspension_status', BQFieldTypeEnum.STRING,
                                BQFieldModeEnum.NULLABLE)
    suspension_status_id = BQField('suspension_status_id',
                                   BQFieldTypeEnum.INTEGER,
                                   BQFieldModeEnum.NULLABLE)
    suspension_time = BQField('suspension_time', BQFieldTypeEnum.DATETIME,
                              BQFieldModeEnum.NULLABLE)

    hpo = BQField('hpo', BQFieldTypeEnum.STRING, BQFieldModeEnum.REQUIRED)
    hpo_id = BQField('hpo_id', BQFieldTypeEnum.INTEGER,
                     BQFieldModeEnum.REQUIRED)
    organization = BQField('organization', BQFieldTypeEnum.STRING,
                           BQFieldModeEnum.NULLABLE)
    organization_id = BQField('organization_id', BQFieldTypeEnum.INTEGER,
                              BQFieldModeEnum.NULLABLE)
    site = BQField('site', BQFieldTypeEnum.STRING, BQFieldModeEnum.NULLABLE)
    site_id = BQField('site_id', BQFieldTypeEnum.INTEGER,
                      BQFieldModeEnum.NULLABLE)

    distinct_visits = BQField('distinct_visits', BQFieldTypeEnum.INTEGER,
                              BQFieldModeEnum.NULLABLE)

    date_of_birth = BQField('date_of_birth', BQFieldTypeEnum.DATE,
                            BQFieldModeEnum.NULLABLE)
    primary_language = BQField('primary_language', BQFieldTypeEnum.STRING,
                               BQFieldModeEnum.NULLABLE)

    phone_number = BQField('phone_number', BQFieldTypeEnum.STRING,
                           BQFieldModeEnum.NULLABLE)
    login_phone_number = BQField('login_phone_number', BQFieldTypeEnum.STRING,
                                 BQFieldModeEnum.NULLABLE)
    email = BQField('email', BQFieldTypeEnum.STRING, BQFieldModeEnum.NULLABLE)

    addresses = BQRecordField('addresses', schema=BQAddressSchema)

    education = BQField('education', BQFieldTypeEnum.STRING,
                        BQFieldModeEnum.NULLABLE)
    education_id = BQField('education_id', BQFieldTypeEnum.INTEGER,
                           BQFieldModeEnum.NULLABLE)
    income = BQField('income', BQFieldTypeEnum.STRING,
                     BQFieldModeEnum.NULLABLE)
    income_id = BQField('income_id', BQFieldTypeEnum.INTEGER,
                        BQFieldModeEnum.NULLABLE)

    sex = BQField('sex', BQFieldTypeEnum.STRING, BQFieldModeEnum.NULLABLE)
    sex_id = BQField('sex_id', BQFieldTypeEnum.INTEGER,
                     BQFieldModeEnum.NULLABLE)
    sexual_orientation = BQField('sexual_orientation', BQFieldTypeEnum.STRING,
                                 BQFieldModeEnum.NULLABLE)
    sexual_orientation_id = BQField('sexual_orientation_id',
                                    BQFieldTypeEnum.INTEGER,
                                    BQFieldModeEnum.NULLABLE)

    pm = BQRecordField('pm', schema=BQPhysicalMeasurements)

    races = BQRecordField('races', schema=BQRaceSchema)
    genders = BQRecordField('genders', schema=BQGenderSchema)
    modules = BQRecordField('modules', schema=BQModuleStatusSchema)
    consents = BQRecordField('consents', schema=BQConsentSchema)

    biobank_orders = BQRecordField('biobank_orders',
                                   schema=BQBiobankOrderSchema)
Ejemplo n.º 17
0
class BQCodeSchema(BQSchema):

    id = BQField('id', BQFieldTypeEnum.INTEGER, BQFieldModeEnum.REQUIRED)
    created = BQField('created', BQFieldTypeEnum.DATETIME,
                      BQFieldModeEnum.REQUIRED)
    modified = BQField('modified', BQFieldTypeEnum.DATETIME,
                       BQFieldModeEnum.REQUIRED)

    code_id = BQField('code_id', BQFieldTypeEnum.INTEGER,
                      BQFieldModeEnum.REQUIRED)
    system = BQField('system', BQFieldTypeEnum.STRING,
                     BQFieldModeEnum.NULLABLE)
    value = BQField('value', BQFieldTypeEnum.STRING, BQFieldModeEnum.NULLABLE)
    display = BQField('display', BQFieldTypeEnum.STRING,
                      BQFieldModeEnum.NULLABLE)
    topic = BQField('topic', BQFieldTypeEnum.STRING, BQFieldModeEnum.NULLABLE)
    code_type = BQField('code_type', BQFieldTypeEnum.INTEGER,
                        BQFieldModeEnum.NULLABLE)
    mapped = BQField('mapped', BQFieldTypeEnum.INTEGER,
                     BQFieldModeEnum.NULLABLE)
    code_book_id = BQField('code_book_id', BQFieldTypeEnum.INTEGER,
                           BQFieldModeEnum.NULLABLE)
    parent_id = BQField('parent_id', BQFieldTypeEnum.INTEGER,
                        BQFieldModeEnum.NULLABLE)
    short_value = BQField('short_value', BQFieldTypeEnum.STRING,
                          BQFieldModeEnum.NULLABLE)