# Path: nacc/uds3/clsform.py
# def add_cls(record, packet, forms, err=sys.stderr):
# 
# Path: nacc/uds3/packet.py
# class Packet(list):
#     def __init__(self):
#     def __getitem__(self, key):
# 
# Path: nacc/uds3/ivp/forms.py
# CURRENT_YEAR = date.today().year
# class FormA4G(nacc.uds3.FieldBag):
# class FormA1(nacc.uds3.FieldBag):
# class FormA2(nacc.uds3.FieldBag):
# class FormA3(nacc.uds3.FieldBag):
# class FormA4D(nacc.uds3.FieldBag):
# class FormA5(nacc.uds3.FieldBag):
# class FormB1(nacc.uds3.FieldBag):
# class FormB4(nacc.uds3.FieldBag):
# class FormB5(nacc.uds3.FieldBag):
# class FormB6(nacc.uds3.FieldBag):
# class FormB7(nacc.uds3.FieldBag):
# class FormB8(nacc.uds3.FieldBag):
# class FormB9(nacc.uds3.FieldBag):
# class FormC1S(nacc.uds3.FieldBag):
# class FormC2(nacc.uds3.FieldBag):
# class FormCLS(nacc.uds3.FieldBag):
# class FormD1(nacc.uds3.FieldBag):
# class FormD2(nacc.uds3.FieldBag):
# class FormZ1(nacc.uds3.FieldBag):
# class FormZ1X(nacc.uds3.FieldBag):
#     def __init__(self):
# def header_fields():
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):


import sys
from nacc.uds3 import clsform
from nacc.uds3 import packet as ivp_packet
from nacc.uds3.ivp import forms as ivp_forms
            'TRAILBLI': 'c1s_7b2_trailbli',
            'WAIS': 'c1s_8a_wais',
            'MEMUNITS': 'c1s_9a_memunits',
            'MEMTIME': 'c1s_9b_memtime',
            'BOSTON': 'c1s_10a_boston',
            'COGSTAT': 'c1s_11a_cogstat'
        }
        for key, value in c1s_field_mapping.items():
            try:
                if record[value].strip():
                    setattr(c1s, key, record[value])
                    c1s_filled_fields += 1
            except KeyError:
                pass
    except KeyError:
        c1s_filled_fields = 0

    # Prefer C2 to C1S
    # If both are blank, use date (C2 after 2017/10/23)
    if c2_filled_fields > 0:
        packet.insert(0, c2)
    elif c1s_filled_fields > 0:
        packet.insert(0, c1s)
    elif (int(record['visityr']) > 2017) or (int(record['visityr']) == 2017 and
          int(record['visitmo']) > 10) or (int(record['visityr']) == 2017 and
          int(record['visitmo']) == 10 and int(record['visitday']) >= 23):
        packet.insert(0, c2)


def add_d1(record, packet):

# Path: nacc/uds3/clsform.py
# def add_cls(record, packet, forms, err=sys.stderr):
# 
# Path: nacc/uds3/packet.py
# class Packet(list):
#     def __init__(self):
#     def __getitem__(self, key):
# 
# Path: nacc/uds3/ivp/forms.py
# CURRENT_YEAR = date.today().year
# class FormA4G(nacc.uds3.FieldBag):
# class FormA1(nacc.uds3.FieldBag):
# class FormA2(nacc.uds3.FieldBag):
# class FormA3(nacc.uds3.FieldBag):
# class FormA4D(nacc.uds3.FieldBag):
# class FormA5(nacc.uds3.FieldBag):
# class FormB1(nacc.uds3.FieldBag):
# class FormB4(nacc.uds3.FieldBag):
# class FormB5(nacc.uds3.FieldBag):
# class FormB6(nacc.uds3.FieldBag):
# class FormB7(nacc.uds3.FieldBag):
# class FormB8(nacc.uds3.FieldBag):
# class FormB9(nacc.uds3.FieldBag):
# class FormC1S(nacc.uds3.FieldBag):
# class FormC2(nacc.uds3.FieldBag):
# class FormCLS(nacc.uds3.FieldBag):
# class FormD1(nacc.uds3.FieldBag):
# class FormD2(nacc.uds3.FieldBag):
# class FormZ1(nacc.uds3.FieldBag):
# class FormZ1X(nacc.uds3.FieldBag):
#     def __init__(self):
# def header_fields():
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):


# Path: nacc/uds3/ivp/builder.py
import sys
from nacc.uds3 import clsform
from nacc.uds3 import packet as ivp_packet
from nacc.uds3.ivp import forms as ivp_forms

            'TRAILBLI': 'c1s_7b2_trailbli',
            'WAIS': 'c1s_8a_wais',
            'MEMUNITS': 'c1s_9a_memunits',
            'MEMTIME': 'c1s_9b_memtime',
            'BOSTON': 'c1s_10a_boston',
            'COGSTAT': 'c1s_11a_cogstat'
        }
        for key, value in c1s_field_mapping.items():
            try:
                if record[value].strip():
                    setattr(c1s, key, record[value])
                    c1s_filled_fields += 1
            except KeyError:
                pass
    except KeyError:
        c1s_filled_fields = 0

    # Prefer C2 to C1S
    # If both are blank, use date (C2 after 2017/10/23)
    if c2_filled_fields > 0:
        packet.insert(0, c2)
    elif c1s_filled_fields > 0:
        packet.insert(0, c1s)
    elif (int(record['visityr']) > 2017) or (int(record['visityr']) == 2017 and
          int(record['visitmo']) > 10) or (int(record['visityr']) == 2017 and
          int(record['visitmo']) == 10 and int(record['visitday']) >= 23):
        packet.insert(0, c2)


def add_d1(record, packet):

    d1 = ivp_forms.FormD1()