Exemplo n.º 1
0
    def test_cls_added_when_filled(self):
        """Add filled CLS form to IVP and FVP."""
        record = make_filled_record()

        ipacket = packet.Packet()
        clsform.add_cls(record, ipacket, ivp_forms)
        self.assertEqual(len(ipacket), 1, "Expected packet to have CLS")

        fpacket = packet.Packet()
        clsform.add_cls(record, fpacket, fvp_forms)
        self.assertEqual(len(fpacket), 1, "Expected packet to have CLS")
Exemplo n.º 2
0
    def test_partial_cls_raises_error(self):
        """Partially completed CLS should raise an exception."""
        record = make_filled_record()
        record['eng_preferred_language'] = ' '  # Make form partially complete.

        ipacket = packet.Packet()
        with self.assertRaises(Exception):
            clsform.add_cls(record, ipacket, ivp_forms)

        fpacket = packet.Packet()
        with self.assertRaises(Exception):
            clsform.add_cls(record, fpacket, fvp_forms)
Exemplo n.º 3
0
    def test_cls_form_marked_complete(self):
        """If the completed CLS form is not marked complete, raise."""
        record = make_filled_record()
        record['form_cls_linguistic_history_of_subject_complete'] = '0 or 1'

        ipacket = packet.Packet()
        with self.assertRaises(Exception):
            clsform.add_cls(record, ipacket, ivp_forms)

        fpacket = packet.Packet()
        with self.assertRaises(Exception):
            clsform.add_cls(record, fpacket, fvp_forms)
Exemplo n.º 4
0
    def test_cls_blank_not_added_to_ivp(self):
        """Don't add blank CLS form to IVP."""
        record = make_blank_record()
        record['hispanic'] = '1'  # Subject is Hispanic/Latino.

        ipacket = packet.Packet()
        clsform.add_cls(record, ipacket, ivp_forms)
        self.assertEqual(len(ipacket), 0, "Expected packet to be empty")

        fpacket = packet.Packet()
        clsform.add_cls(record, fpacket, fvp_forms)
        self.assertEqual(len(fpacket), 0, "Expected packet to be empty")
Exemplo n.º 5
0
    def test_cls_proficiency_must_be_100(self):
        """Language proficiency percentages must sum to 100."""
        record = make_filled_record()
        record['eng_percentage_english'] = '20'
        record['eng_percentage_spanish'] = '9001'

        ipacket = packet.Packet()
        with self.assertRaises(Exception):
            clsform.add_cls(record, ipacket, ivp_forms)

        fpacket = packet.Packet()
        with self.assertRaises(Exception):
            clsform.add_cls(record, fpacket, fvp_forms)
Exemplo n.º 6
0
    def test_check_cls_date(self):
        """
        Having a CLS with a visit date before June 1, 2017 raises an exception.
        """
        record = make_filled_record()
        record['visityr'] = '2016'

        ipacket = packet.Packet()
        with self.assertRaises(Exception):
            clsform.add_cls(record, ipacket, ivp_forms)

        fpacket = packet.Packet()
        with self.assertRaises(Exception):
            clsform.add_cls(record, fpacket, fvp_forms)
Exemplo n.º 7
0
def build_uds3_fvp_form(record):
    """ Converts REDCap CSV data into a packet (list of FVP Form objects) """
    packet = fvp_packet.Packet()

    # Set up the forms
    add_z1_or_z1x(record, packet)
    add_a1(record, packet)
    if record['fu_a2_sub'] == '1' or record['fu_a2sub'] == '1':
        add_a2(record, packet)
    if record['fu_a3_sub'] == '1' or record['fu_a3sub'] == '1':
        add_a3(record, packet)
    if record['fu_a4_sub'] == '1' or record['fu_a4sub'] == '1':
        add_a4(record, packet)
    if record['fu_b1_sub'] == '1' or record['fu_b1sub'] == '1':
        add_b1(record, packet)
    add_b4(record, packet)
    if record['fu_b5_sub'] == '1' or record['fu_b5sub'] == '1':
        add_b5(record, packet)
    if record['fu_b6_sub'] == '1' or record['fu_b6sub'] == '1':
        add_b6(record, packet)
    if record['fu_b7_sub'] == '1' or record['fu_b7sub'] == '1':
        add_b7(record, packet)
    add_b8(record, packet)
    add_b9(record, packet)
    add_c1s_or_c2(record, packet)
    add_d1(record, packet)
    add_d2(record, packet)
    clsform.add_cls(record, packet, fvp_forms)
    update_header(record, packet)

    return packet
Exemplo n.º 8
0
    def test_cls_not_added_if_not_hispanic(self):
        """
        Do not add Form CLS if the subject is not Hispanic/Latino.

        https://www.alz.washington.edu/NONMEMBER/UDS/DOCS/VER3/CLS/CLS_en.pdf
        """
        record = make_blank_record()
        record['hispanic'] = '0'  # Subject is not Hispanic/Latino.

        ipacket = packet.Packet()
        clsform.add_cls(record, ipacket, ivp_forms)
        self.assertEqual(len(ipacket), 0, "Expected packet to be empty")

        fpacket = packet.Packet()
        clsform.add_cls(record, fpacket, fvp_forms)
        self.assertEqual(len(fpacket), 0, "Expected packet to be empty")
Exemplo n.º 9
0
def build_uds3_csf_form(record):
    """ Converts REDCap CSV data into a packet (list of CSF Module objects) """
    packet = csf_packet.Packet()

    # Set up the forms.
    eE2 = csf_forms.FormEE2()
    eE2.CSFABETA = record['csfabeta']
    eE2.CSFABmo  = record['csfabmo']
    eE2.CSFABDY  = record['csfabdy']
    eE2.CSFABYr  = record['csfabyr']
    eE2.CSFABmD  = record['csfabmd']
    eE2.CSFABmDX = record['csfabmdx']
    eE2.CSFPTAU  = record['csfptau']
    eE2.CSFPTmo  = record['csfptmo']
    eE2.CSFPTDY  = record['csfptdy']
    eE2.CSFPTYr  = record['csfptyr']
    eE2.CSFPTmD  = record['csfptmd']
    eE2.CSFPTmDX = record['csfptmdx']
    eE2.CSFTTAU  = record['csfttau']
    eE2.CSFTTmo  = record['csfttmo']
    eE2.CSFTTDY  = record['csfttdy']
    eE2.CSFTTYr  = record['csfttyr']
    eE2.CSFTTmD  = record['csfttmd']
    eE2.CSFTTmDX = record['csfttmdx']
    packet.append(eE2)

    update_header(record, packet)
    return packet
Exemplo n.º 10
0
    def test_m1_blank_if_discont(self):
        ''' If discontinued should be blank '''
        packet = m_packet.Packet()
        m = m_form.FormM()
        # record[]= data
        m.DISCONT = '1'
        m.DECEASED = '0'
        m.CHANGEMO = '02'
        m.CHANGEDY = '28'
        m.CHANGEYR = '2008'
        m.PROTOCOL = '2'
        m.ACONSENT = '0'
        m.RECOGIM = '0'
        m.REPHYILL = '0'
        m.REREFUSE = '0'
        m.RENAVAIL = '0'
        m.RENURSE = '0'
        m.REJOIN = '0'
        m.FTLDDISC = '0'
        m.FTLDREAS = '0'
        m.FTLDREAX = '0'
        packet.append(m)
        blanks.set_zeros_to_blanks(packet)

        self.assertEqual(packet['RENURSE'], '')
        self.assertEqual(packet['RECOGIM'], '')
        self.assertEqual(packet['REPHYILL'], '')
        self.assertEqual(packet['REREFUSE'], '')
        self.assertEqual(packet['RENAVAIL'], '')
        self.assertEqual(packet['FTLDDISC'], '')
        self.assertEqual(packet['AUTOPSY'], '')
        self.assertEqual(packet['FTLDREAS'], '')
Exemplo n.º 11
0
    def test_partial_cls_has_warning(self):
        """Partially completed CLS should create a warning."""    
        record = make_filled_record()   
        record['eng_preferred_language'] = ' '  # Make form partially complete. 

        ipacket = packet.Packet()
        itrap = StringIO()
        clsform.add_cls(record, ipacket, ivp_forms, itrap)
        assert itrap.getvalue() == "[WARNING] CLS form is incomplete for PTID: unknown\n"
        itrap.close()

        fpacket = packet.Packet()
        ftrap = StringIO()
        clsform.add_cls(record, fpacket, fvp_forms, ftrap)
        assert ftrap.getvalue() == "[WARNING] CLS form is incomplete for PTID: unknown\n"
        ftrap.close()
Exemplo n.º 12
0
    def test_cls_proficiency_not_100_has_warning(self):    
        """If language proficiency percentages do not add to 100, create a warning.""" 
        record = make_filled_record()   
        record['eng_percentage_english'] = '20' 
        record['eng_percentage_spanish'] = '91'   

        ipacket = packet.Packet()
        itrap = StringIO()
        clsform.add_cls(record, ipacket, ivp_forms, itrap)
        assert itrap.getvalue() == "[WARNING] language proficiency percentages do not equal 100 for PTID : unknown\n"
        itrap.close()

        fpacket = packet.Packet()
        ftrap = StringIO()
        clsform.add_cls(record, ipacket, ivp_forms, ftrap)
        assert ftrap.getvalue() == "[WARNING] language proficiency percentages do not equal 100 for PTID : unknown\n"
        ftrap.close()
Exemplo n.º 13
0
    def test_z1x_added_to_fvp_when_filled(self):
        """ If header is from after April 2, 2018, the Z1X form should be added """
        record = make_blank_fvp()
        record['visityr'] = '2019'
        record['fu_langa1'] = '1'
        record['fu_clssub'] = '1'

        fpacket = packet.Packet()
        fvp_builder.add_z1_or_z1x(record, fpacket)
        self.assertEqual(fpacket['LANGA1'], '1')
Exemplo n.º 14
0
    def test_c1s_added_to_ivp_when_filled(self):
        """ If header is from before October 23, 2017, the C1S form should be added """
        record = make_blank_ivp()
        record['visityr'] = '2016'
        record['c1s_1a_mmseloc'] = '1'
        record['c1s_11a_cogstat'] = '1'

        ipacket = packet.Packet()
        ivp_builder.add_c1s_or_c2(record, ipacket)
        self.assertEqual(ipacket['MMSELOC'], '1')
Exemplo n.º 15
0
    def test_c2_added_to_fvp_when_filled(self):
        """ If header is from after October 23, 2017, the C2 form should be added """
        record = make_blank_fvp()
        record['visityr'] = '2018'
        record['fu_mocacomp'] = '1'
        record['fu_cogstat_c2'] = '1'

        fpacket = packet.Packet()
        fvp_builder.add_c1s_or_c2(record, fpacket)
        self.assertEqual(fpacket['MOCACOMP'], '1')
Exemplo n.º 16
0
    def test_c2_blank_not_added_to_fvp(self):
        """ When the C2 form is blank, there should be an error """
        record = make_blank_fvp()
        record['visityr'] = '2018'
        record['fu_mmsecomp'] = '1'
        record['fu_cogstat'] = '1'

        fpacket = packet.Packet()
        self.assertRaises(Exception, fvp_builder.add_c1s_or_c2, record,
                          fpacket)
Exemplo n.º 17
0
    def test_c1s_blank_not_added_to_ivp(self):
        """ When the C1S form is blank, there should be an error """
        record = make_blank_ivp()
        record['visityr'] = '2016'
        record['mocacomp'] = '1'
        record['cogstat_c2'] = '1'

        ipacket = packet.Packet()
        self.assertRaises(Exception, ivp_builder.add_c1s_or_c2, record,
                          ipacket)
Exemplo n.º 18
0
    def test_c1s_added_to_ivp_when_filled(self):
        """ When the first and last record of the C1S is filled, the C1S form should be added """
        record = make_blank_ivp()
        record['visityr'] = '2016'
        record['c1s_1a_mmseloc'] = '1'
        record['c1s_11a_cogstat'] = '1'

        ipacket = packet.Packet()
        ivp_builder.add_c1s_or_c2(record, ipacket)
        self.assertEqual(ipacket['MMSELOC'], '1')
Exemplo n.º 19
0
    def test_c2_added_to_fvp_when_filled(self):
        """ When the first and last record of the C2 is filled, the C2 form should be added """
        record = make_blank_fvp()
        record['visityr'] = '2018'
        record['fu_mocacomp'] = '1'
        record['fu_cogstat_c2'] = '1'

        fpacket = packet.Packet()
        fvp_builder.add_c1s_or_c2(record, fpacket)
        self.assertEqual(fpacket['MOCACOMP'], '1')
Exemplo n.º 20
0
    def test_z1_added_to_ivp_when_filled(self):
        """ If header is from before April 2, 2018, the Z1 form should be added """
        record = make_blank_ivp()
        record['visityr'] = '2016'
        record['a2sub'] = '1'
        record['b7comm'] = '1'

        ipacket = packet.Packet()
        ivp_builder.add_z1_or_z1x(record, ipacket)
        self.assertEqual(ipacket['A2SUB'], '1')
Exemplo n.º 21
0
def build_uds3_m_form(record):
    """ Converts REDCap CSV data into a packet (list of M Form objects) """
    packet = m_packet.Packet()
    m = m_form.FormM()
    m.CHANGEMO = parse_date(record['m1_1'], 'M')
    m.CHANGEDY = parse_date(record['m1_1'], 'D')
    m.CHANGEYR = parse_date(record['m1_1'], 'Y')
    m.PROTOCOL = record['m1_2a']
    m.ACONSENT = record['m1_2a1']
    m.RECOGIM = record['m1_2b___1']
    m.REPHYILL = record['m1_2b___2']
    m.REREFUSE = record['m1_2b___3']
    m.RENAVAIL = record['m1_2b___4']
    m.RENURSE = record['m1_2b___5']
    m.NURSEMO = parse_date(record['m1_2b1'], 'M')
    m.NURSEDY = parse_date(record['m1_2b1'], 'D')
    m.NURSEYR = parse_date(record['m1_2b1'], 'Y')
    m.REJOIN = record['m1_2b___6']
    m.FTLDDISC = record['m1_3']
    m.FTLDREAS = record['m1_3a']
    m.FTLDREAx = record[
        'm1_3a1']  # Note :  May need to add testing for {',",&,%} to remove
    m.DECEASED = subject_deceased(record['m1_4'])
    m.DISCONT = subject_discont(record['m1_4'])
    m.DEATHMO = parse_date(record['m1_5a'], 'M')
    m.DEATHDY = parse_date(record['m1_5a'], 'D')
    m.DEATHYR = parse_date(record['m1_5a'], 'Y')
    m.AUTOPSY = record['m1_5b']
    m.DISCMO = parse_date(record['m1_6a'], 'M')
    m.DISCDAY = parse_date(record['m1_6a'], 'D')
    m.DISCYR = parse_date(record['m1_6a'], 'Y')
    m.DROPREAS = record['m1_6b']
    packet.append(m)

    update_header(record, packet)
    return packet
Exemplo n.º 22
0
def build_uds3_ftld_ivp_form(record: dict):
    ''' Converts REDCap CSV data into a packet (list of IVP Form objects) '''
    packet = ftld_ivp_packet.Packet()

    # Set up the forms..........

    # This form cannot precede March 1, 2015.
    if not (int(record['visityr']) > 2015) or \
        (int(record['visityr']) == 2015 and int(record['visitmo']) > 3) or \
            (int(record['visityr']) == 2015 and int(record['visitmo']) == 3
                and int(record['visitday']) >= 1):
        raise ValueError('Form date cannot precede March 1, 2015.')

    Z1X = ftld_ivp_forms.FormZ1X()
    Z1X.LANGA1 = record['langa1']
    Z1X.LANGA2 = record['langa2']
    Z1X.A2SUB = record['a2sub']
    Z1X.A2NOT = record['a2not']
    Z1X.LANGA3 = record['langa3']
    Z1X.A3SUB = record['a3sub']
    Z1X.A3NOT = record['a3not']
    Z1X.LANGA4 = record['langa4']
    Z1X.A4SUB = record['a4sub']
    Z1X.A4NOT = record['a4not']
    Z1X.LANGA5 = record['langa5']
    Z1X.LANGB1 = record['langb1']
    Z1X.B1SUB = record['b1sub']
    Z1X.B1NOT = record['b1not']
    Z1X.LANGB4 = record['langb4']
    Z1X.LANGB5 = record['langb5']
    Z1X.B5SUB = record['b5sub']
    Z1X.B5NOT = record['b5not']
    Z1X.LANGB6 = record['langb6']
    Z1X.B6SUB = record['b6sub']
    Z1X.B6NOT = record['b6not']
    Z1X.LANGB7 = record['langb7']
    Z1X.B7SUB = record['b7sub']
    Z1X.B7NOT = record['b7not']
    Z1X.LANGB8 = record['langb8']
    Z1X.LANGB9 = record['langb9']
    Z1X.LANGC2 = record['langc2']
    Z1X.LANGD1 = record['langd1']
    Z1X.LANGD2 = record['langd2']
    Z1X.LANGA3A = record['langa3a']
    Z1X.FTDA3AFS = record['ftda3afs']
    Z1X.FTDA3AFR = record['ftda3afr']
    Z1X.LANGB3F = record['langb3f']
    Z1X.LANGB9F = record['langb9f']
    Z1X.LANGC1F = record['langc1f']
    Z1X.LANGC2F = record['langc2f']
    Z1X.LANGC3F = record['langc3f']
    Z1X.LANGC4F = record['langc4f']
    Z1X.FTDC4FS = record['ftdc4fs']
    Z1X.FTDC4FR = record['ftdc4fr']
    Z1X.LANGC5F = record['langc5f']
    Z1X.FTDC5FS = record['ftdc5fs']
    Z1X.FTDC5FR = record['ftdc5fr']
    Z1X.LANGC6F = record['langc6f']
    Z1X.FTDC6FS = record['ftdc6fs']
    Z1X.FTDC6FR = record['ftdc6fr']
    Z1X.LANGE2F = record['lange2f']
    Z1X.LANGE3F = record['lange3f']
    Z1X.LANGCLS = record['langcls']
    Z1X.CLSSUB = record['clssub']
    packet.append(Z1X)

    A3a = ftld_ivp_forms.FormA3a()
    A3a.FTDRELCO = record['ftdrelco']
    A3a.FTDSIBBY = record['ftdsibby']
    A3a.FTDChDBY = record['ftdchdby']
    A3a.FTDSTORE = record['ftdstore']
    A3a.FTDSLEAR = record['ftdslear']
    A3a.FTDCOMME = record['ftdcomme']
    packet.append(A3a)

    B3F = ftld_ivp_forms.FormB3F()
    B3F.FTDLTFAS = record['ftdltfas']
    B3F.FTDLIMB = record['ftdlimb']
    B3F.FTDBULB = record['ftdbulb']
    B3F.FTDGSEV = record['ftdgsev']
    B3F.FTDGSEVX = record['ftdgsevx']
    B3F.FTDGTYP = record['ftdgtyp']
    B3F.FTDGTYPG = record['ftdgtypg']
    B3F.FTDGTYPX = record['ftdgtypx']
    packet.append(B3F)

    B9F = ftld_ivp_forms.FormB9F()
    B9F.FTDPPASL = record['ftdppasl']
    B9F.FTDPPAPO = record['ftdppapo']
    B9F.FTDPPAIW = record['ftdppaiw']
    B9F.FTDPPASW = record['ftdppasw']
    B9F.FTDPPAPK = record['ftdppapk']
    B9F.FTDPPAGS = record['ftdppags']
    B9F.FTDPPAEh = record['ftdppaeh']
    B9F.FTDPPACS = record['ftdppacs']
    B9F.FTDPPASS = record['ftdppass']
    B9F.FTDPPASR = record['ftdppasr']
    B9F.FTDPPASD = record['ftdppasd']
    B9F.FTDCPPA = record['ftdcppa']
    B9F.FTDCPPAS = record['ftdcppas']
    B9F.FTDBVCLN = record['ftdbvcln']
    B9F.FTDBVDIS = record['ftdbvdis']
    B9F.FTDBVAPA = record['ftdbvapa']
    B9F.FTDBVLOS = record['ftdbvlos']
    B9F.FTDBVRIT = record['ftdbvrit']
    B9F.FTDBVhYP = record['ftdbvhyp']
    B9F.FTDBVNEU = record['ftdbvneu']
    B9F.FTDBVIDL = record['ftdbvidl']
    B9F.FTDBVFT = record['ftdbvft']
    B9F.FTDEMGPV = record['ftdemgpv']
    B9F.FTDEMGPY = record['ftdemgpy']
    B9F.FTDEMGMN = record['ftdemgmn']
    B9F.FTDPABVF = record['ftdpabvf']
    packet.append(B9F)

    C1F = ftld_ivp_forms.FormC1F()
    C1F.FTDWORRC = record['ftdworrc']
    C1F.FTDWORRS = record['ftdworrs']
    C1F.FTDWORRR = record['ftdworrr']
    C1F.FTDWORIC = record['ftdworic']
    C1F.FTDWORIS = record['ftdworis']
    C1F.FTDWORIR = record['ftdworir']
    C1F.FTDWORIP = record['ftdworip']
    C1F.FTDSEMMT = record['ftdsemmt']
    C1F.FTDSEMAA = record['ftdsemaa']
    C1F.FTDSEMTA = record['ftdsemta']
    C1F.FTDSEMSU = record['ftdsemsu']
    C1F.FTDANASW = record['ftdanasw']
    C1F.FTDANAOW = record['ftdanaow']
    C1F.FTDANATS = record['ftdanats']
    C1F.FTDSENAS = record['ftdsenas']
    C1F.FTDSENOS = record['ftdsenos']
    C1F.FTDSENSR = record['ftdsensr']
    C1F.FTDSENPR = record['ftdsenpr']
    C1F.FTDNOUNC = record['ftdnounc']
    C1F.FTDVERBC = record['ftdverbc']
    C1F.FTDRATIO = record['ftdratio']
    C1F.FTDREAAS = record['ftdreaas']
    C1F.FTDREAOS = record['ftdreaos']
    C1F.FTDREASR = record['ftdreasr']
    C1F.FTDREAPR = record['ftdreapr']
    packet.append(C1F)

    C2F = ftld_ivp_forms.FormC2F()
    C2F.FTDCPC2F = record['ftdcpc2f']
    C2F.FTDhAIRD = record['ftdhaird']
    C2F.FTDSPIT = record['ftdspit']
    C2F.FTDNOSE = record['ftdnose']
    C2F.FTDCOAGE = record['ftdcoage']
    C2F.FTDCRY = record['ftdcry']
    C2F.FTDCUT = record['ftdcut']
    C2F.FTDYTRIP = record['ftdytrip']
    C2F.FTDEATP = record['ftdeatp']
    C2F.FTDTELLA = record['ftdtella']
    C2F.FTDOPIN = record['ftdopin']
    C2F.FTDLAUGh = record['ftdlaugh']
    C2F.FTDShIRT = record['ftdshirt']
    C2F.FTDKEEPM = record['ftdkeepm']
    C2F.FTDPICKN = record['ftdpickn']
    C2F.FTDOVER = record['ftdover']
    C2F.FTDEATR = record['ftdeatr']
    C2F.FTDhAIRL = record['ftdhairl']
    C2F.FTDShIRW = record['ftdshirw']
    C2F.FTDMOVE = record['ftdmove']
    C2F.FTDhUGS = record['ftdhugs']
    C2F.FTDLOUD = record['ftdloud']
    C2F.FTDLOST = record['ftdlost']
    C2F.FTDSNTOT = record['ftdsntot']
    C2F.FTDSNTBS = record['ftdsntbs']
    C2F.FTDSNTOS = record['ftdsntos']
    C2F.FTDSNRAT = record['ftdsnrat']
    packet.append(C2F)

    C3F = ftld_ivp_forms.FormC3F()
    C3F.FTDSELF = record['ftdself']
    C3F.FTDBADLY = record['ftdbadly']
    C3F.FTDDEPR = record['ftddepr']
    C3F.FTDEMOTD = record['ftdemotd']
    C3F.FTDLSELF = record['ftdlself']
    C3F.FTDDISR = record['ftddisr']
    C3F.FTDBELCh = record['ftdbelch']
    C3F.FTDGIGG = record['ftdgigg']
    C3F.FTDPRIV = record['ftdpriv']
    C3F.FTDNEGAT = record['ftdnegat']
    C3F.FTDECOMM = record['ftdecomm']
    C3F.FTDINAPJ = record['ftdinapj']
    C3F.FTDFAILA = record['ftdfaila']
    C3F.FTDRESIS = record['ftdresis']
    C3F.FTDINTER = record['ftdinter']
    C3F.FTDVERBA = record['ftdverba']
    C3F.FTDPhYSI = record['ftdphysi']
    C3F.FTDTOPIC = record['ftdtopic']
    C3F.FTDPROTO = record['ftdproto']
    C3F.FTDPREO = record['ftdpreo']
    C3F.FTDFINI = record['ftdfini']
    C3F.FTDACTED = record['ftdacted']
    C3F.FTDABS = record['ftdabs']
    C3F.FTDFEEDB = record['ftdfeedb']
    C3F.FTDFRUST = record['ftdfrust']
    C3F.FTDANXI = record['ftdanxi']
    C3F.FTDNERVO = record['ftdnervo']
    C3F.FTDNDIAG = record['ftdndiag']
    C3F.FTDSTIMB = record['ftdstimb']
    C3F.FTDSTIME = record['ftdstime']
    C3F.FTDOBJEC = record['ftdobjec']
    C3F.FTDCIRCU = record['ftdcircu']
    C3F.FTDPERSE = record['ftdperse']
    C3F.FTDREPEA = record['ftdrepea']
    C3F.FTDANECD = record['ftdanecd']
    C3F.FTDDINIT = record['ftddinit']
    C3F.FTDDELAY = record['ftddelay']
    C3F.FTDADDVE = record['ftdaddve']
    C3F.FTDFLUCT = record['ftdfluct']
    C3F.FTDLOSTT = record['ftdlostt']
    C3F.FTDREPRU = record['ftdrepru']
    C3F.FTDTRAIN = record['ftdtrain']
    C3F.FTDDISCL = record['ftddiscl']
    C3F.FTDSPONT = record['ftdspont']
    C3F.FTDSPONR = record['ftdsponr']
    C3F.FTDSTOOD = record['ftdstood']
    C3F.FTDTOUCh = record['ftdtouch']
    C3F.FTDDSOCI = record['ftddsoci']
    C3F.FTDEXAGG = record['ftdexagg']
    C3F.FTDSBTOT = record['ftdsbtot']
    C3F.FTDSBCTO = record['ftdsbcto']
    C3F.FTDLENGT = record['ftdlengt']
    packet.append(C3F)

    C4F = ftld_ivp_forms.FormC4F()
    C4F.FTDCPC4F = record['ftdcpc4f']
    C4F.FTDWORKU = record['ftdworku']
    C4F.FTDMIST = record['ftdmist']
    C4F.FTDCRIT = record['ftdcrit']
    C4F.FTDWORR = record['ftdworr']
    C4F.FTDBAD = record['ftdbad']
    C4F.FTDPOOR = record['ftdpoor']
    C4F.FTDFFEAR = record['ftdffear']
    C4F.FTDBIST = record['ftdbist']
    packet.append(C4F)

    C5F = ftld_ivp_forms.FormC5F()
    C5F.FTDCPC5F = record['ftdcpc5f']
    C5F.FTDINSEX = record['ftdinsex']
    C5F.FTDINFMO = record['ftdinfmo']
    C5F.FTDINFYR = record['ftdinfyr']
    C5F.FTDINFRE = record['ftdinfre']
    C5F.FTDFEEL = record['ftdfeel']
    C5F.FTDDIFF = record['ftddiff']
    C5F.FTDSORR = record['ftdsorr']
    C5F.FTDSIDE = record['ftdside']
    C5F.FTDADVAN = record['ftdadvan']
    C5F.FTDIMAG = record['ftdimag']
    C5F.FTDMISF = record['ftdmisf']
    C5F.FTDWASTE = record['ftdwaste']
    C5F.FTDPITY = record['ftdpity']
    C5F.FTDQTOUC = record['ftdqtouc']
    C5F.FTDSIDES = record['ftdsides']
    C5F.FTDSOFTh = record['ftdsofth']
    C5F.FTDUPSET = record['ftdupset']
    C5F.FTDCRITI = record['ftdcriti']
    C5F.FTDIRIEC = record['ftdiriec']
    C5F.FTDIRIPT = record['ftdiript']
    packet.append(C5F)

    C6F = ftld_ivp_forms.FormC6F()
    C6F.FTDCPC6F = record['ftdcpc6f']
    C6F.FTDALTER = record['ftdalter']
    C6F.FTDEMOT = record['ftdemot']
    C6F.FTDACROS = record['ftdacros']
    C6F.FTDCONV = record['ftdconv']
    C6F.FTDINTUI = record['ftdintui']
    C6F.FTDJOKE = record['ftdjoke']
    C6F.FTDIMAGP = record['ftdimagp']
    C6F.FTDINAPP = record['ftdinapp']
    C6F.FTDChBEh = record['ftdchbeh']
    C6F.FTDADBEh = record['ftdadbeh']
    C6F.FTDLYING = record['ftdlying']
    C6F.FTDGOODF = record['ftdgoodf']
    C6F.FTDREGUL = record['ftdregul']
    C6F.FTDSMSCR = record['ftdsmscr']
    C6F.FTDSPSCR = record['ftdspscr']
    C6F.FTDRSMST = record['ftdrsmst']
    packet.append(C6F)

    E2F = ftld_ivp_forms.FormE2F()
    E2F.FTDSMRI = record['ftdsmri']
    E2F.FTDSMMO = record['ftdsmmo']
    E2F.FTDSMDY = record['ftdsmdy']
    E2F.FTDSMYR = record['ftdsmyr']
    E2F.FTDSMDIC = record['ftdsmdic']
    E2F.FTDSMDIS = record['ftdsmdis']
    E2F.FTDSMADN = record['ftdsmadn']
    E2F.FTDSMADV = record['ftdsmadv']
    E2F.FTDSMMAN = record['ftdsmman']
    E2F.FTDSMMAO = record['ftdsmmao']
    E2F.FTDSMMAM = record['ftdsmmam']
    E2F.FTDSMFS = record['ftdsmfs']
    E2F.FTDSMFSO = record['ftdsmfso']
    E2F.FTDSMQU = record['ftdsmqu']
    E2F.FTDFDGPT = record['ftdfdgpt']
    E2F.FTDFPMO = record['ftdfpmo']
    E2F.FTDFPDY = record['ftdfpdy']
    E2F.FTDFPYR = record['ftdfpyr']
    E2F.FTDFDDIC = record['ftdfddic']
    E2F.FTDFDDID = record['ftdfddid']
    E2F.FTDFDADN = record['ftdfdadn']
    E2F.FTDFDADV = record['ftdfdadv']
    E2F.FTDFDMAN = record['ftdfdman']
    E2F.FTDFDMAO = record['ftdfdmao']
    E2F.FTDFDMAM = record['ftdfdmam']
    E2F.FTDFDQU = record['ftdfdqu']
    E2F.FTDAMYPT = record['ftdamypt']
    E2F.FTDAMMO = record['ftdammo']
    E2F.FTDAMDY = record['ftdamdy']
    E2F.FTDAMYR = record['ftdamyr']
    E2F.FTDAMDIC = record['ftdamdic']
    E2F.FTDAMDID = record['ftdamdid']
    E2F.FTDAMLIG = record['ftdamlig']
    E2F.FTDAMLIO = record['ftdamlio']
    E2F.FTDAMADN = record['ftdamadn']
    E2F.FTDAMADV = record['ftdamadv']
    E2F.FTDAMMAN = record['ftdamman']
    E2F.FTDAMMAO = record['ftdammao']
    E2F.FTDAMMAM = record['ftdammam']
    E2F.FTDAMQU = record['ftdamqu']
    E2F.FTDOThER = record['ftdother']
    E2F.FTDOTDOP = record['ftdotdop']
    E2F.FTDOTSER = record['ftdotser']
    E2F.FTDOTChO = record['ftdotcho']
    E2F.FTDOTANO = record['ftdotano']
    E2F.FTDOTANS = record['ftdotans']
    packet.append(E2F)

    E3F = ftld_ivp_forms.FormE3F()
    E3F.FTDIDIAG = record['ftdidiag']
    E3F.FTDSMRIO = record['ftdsmrio']
    E3F.FTDMRIFA = record['ftdmrifa']
    E3F.FTDMRIRF = record['ftdmrirf']
    E3F.FTDMRILF = record['ftdmrilf']
    E3F.FTDMRIRT = record['ftdmrirt']
    E3F.FTDMRILT = record['ftdmrilt']
    E3F.FTDMRIRM = record['ftdmrirm']
    E3F.FTDMRILM = record['ftdmrilm']
    E3F.FTDMRIRP = record['ftdmrirp']
    E3F.FTDMRILP = record['ftdmrilp']
    E3F.FTDMRIRB = record['ftdmrirb']
    E3F.FTDMRILB = record['ftdmrilb']
    E3F.FTDMRIOB = record['ftdmriob']
    E3F.FTDMRIOS = record['ftdmrios']
    E3F.FTDFDGPE = record['ftdfdgpe']
    E3F.FTDFDGFh = record['ftdfdgfh']
    E3F.FTDFDGRF = record['ftdfdgrf']
    E3F.FTDFDGLF = record['ftdfdglf']
    E3F.FTDFDGRT = record['ftdfdgrt']
    E3F.FTDFDGLT = record['ftdfdglt']
    E3F.FTDFDGRM = record['ftdfdgrm']
    E3F.FTDFDGLM = record['ftdfdglm']
    E3F.FTDFDGRP = record['ftdfdgrp']
    E3F.FTDFDGLP = record['ftdfdglp']
    E3F.FTDFDGRB = record['ftdfdgrb']
    E3F.FTDFDGLB = record['ftdfdglb']
    E3F.FTDFDGOA = record['ftdfdgoa']
    E3F.FTDFDGOS = record['ftdfdgos']
    E3F.FTDAMYP = record['ftdamyp']
    E3F.FTDAMYVI = record['ftdamyvi']
    E3F.FTDAMYRF = record['ftdamyrf']
    E3F.FTDAMYLF = record['ftdamylf']
    E3F.FTDAMYRT = record['ftdamyrt']
    E3F.FTDAMYLT = record['ftdamylt']
    E3F.FTDAMYRM = record['ftdamyrm']
    E3F.FTDAMYLM = record['ftdamylm']
    E3F.FTDAMYRP = record['ftdamyrp']
    E3F.FTDAMYLP = record['ftdamylp']
    E3F.FTDAMYRB = record['ftdamyrb']
    E3F.FTDAMYLB = record['ftdamylb']
    E3F.FTDAMYOA = record['ftdamyoa']
    E3F.FTDAMYOS = record['ftdamyos']
    E3F.FTDCBFSP = record['ftdcbfsp']
    E3F.FTDCBFVI = record['ftdcbfvi']
    E3F.FTDCBFRF = record['ftdcbfrf']
    E3F.FTDCBFLF = record['ftdcbflf']
    E3F.FTDCBFRT = record['ftdcbfrt']
    E3F.FTDCBFLT = record['ftdcbflt']
    E3F.FTDCBFRM = record['ftdcbfrm']
    E3F.FTDCBFLM = record['ftdcbflm']
    E3F.FTDCBFRP = record['ftdcbfrp']
    E3F.FTDCBFLP = record['ftdcbflp']
    E3F.FTDCBFRB = record['ftdcbfrb']
    E3F.FTDCBFLB = record['ftdcbflb']
    E3F.FTDCBFOA = record['ftdcbfoa']
    E3F.FTDCBFOS = record['ftdcbfos']
    E3F.FTDOThI = record['ftdothi']
    E3F.FTDOThIS = record['ftdothis']
    packet.append(E3F)

    update_header(record, packet)
    return packet
Exemplo n.º 23
0
def build_uds3_ivp_form(record):
    """ Converts REDCap CSV data into a packet (list of IVP Form objects) """
    packet = ivp_packet.Packet()

    # Set up us the forms
    a1 = ivp_forms.FormA1()
    a1.REASON = record['reason']
    a1.REFERSC = record['refersc']
    a1.LEARNED = record['learned']
    a1.PRESTAT = record['prestat']
    a1.PRESPART = record['prespart']
    a1.SOURCENW = record['source']
    a1.BIRTHMO = record['birthmo']
    a1.BIRTHYR = record['birthyr']
    a1.SEX = record['sex']
    a1.HISPANIC = record['hispanic']
    a1.HISPOR = record['hispor']
    a1.HISPORX = record['hisporx']
    a1.RACE = record['race']
    a1.RACEX = record['racex']
    a1.RACESEC = record['racesec']
    a1.RACESECX = record['racesecx']
    a1.RACETER = record['raceter']
    a1.RACETERX = record['raceterx']
    a1.PRIMLANG = record['primlang']
    a1.PRIMLANX = record['primlanx']
    a1.EDUC = record['educ']
    a1.MARISTAT = record['maristat']
    a1.LIVSITUA = record['livsitua']
    a1.INDEPEND = record['independ']
    a1.RESIDENC = record['residenc']
    a1.ZIP = record['zip']
    a1.HANDED = record['handed']
    packet.append(a1)

    a2 = ivp_forms.FormA2()
    a2.INBIRMO = record['inbirmo']
    a2.INBIRYR = record['inbiryr']
    a2.INSEX = record['insex']
    a2.INHISP = record['inhisp']
    a2.INHISPOR = record['inhispor']
    a2.INHISPOX = record['inhispox']
    a2.INRACE = record['inrace']
    a2.INRACEX = record['inracex']
    a2.INRASEC = record['inrasec']
    a2.INRASECX = record['inrasecx']
    a2.INRATER = record['inrater']
    a2.INRATERX = record['inraterx']
    a2.INEDUC = record['ineduc']
    a2.INRELTO = record['inrelto']
    a2.INKNOWN = record['inknown']
    a2.INLIVWTH = record['inlivwth']
    a2.INVISITS = record['invisits']
    a2.INCALLS = record['incalls']
    a2.INRELY = record['inrely']
    packet.append(a2)

    a3 = ivp_forms.FormA3()
    a3.AFFFAMM = record['afffamm']
    a3.FADMUT = record['fadmut']
    a3.FADMUTX = record['fadmutx']
    a3.FADMUSO = record['fadmuso']
    a3.FADMUSOX = record['fadmusox']
    a3.FFTDMUT = record['fftdmut']
    a3.FFTDMUTX = record['fftdmutx']
    a3.FFTDMUSO = record['fftdmuso']
    a3.FFTDMUSX = record['fftdmusx']
    a3.FOTHMUT = record['fothmut']
    a3.FOTHMUTX = record['fothmutx']
    a3.FOTHMUSO = record['fothmuso']
    a3.FOTHMUSX = record['fothmusx']
    a3.MOMMOB = record['mommob']
    a3.MOMYOB = record['momyob']
    a3.MOMDAGE = record['momdage']
    a3.MOMNEUR = record['momneur']
    a3.MOMPRDX = record['momprdx']
    a3.MOMMOE = record['mommoe']
    a3.MOMAGEO = record['momageo']
    a3.DADMOB = record['dadmob']
    a3.DADYOB = record['dadyob']
    a3.DADDAGE = record['daddage']
    a3.DADNEUR = record['dadneur']
    a3.DADPRDX = record['dadprdx']
    a3.DADMOE = record['dadmoe']
    a3.DADAGEO = record['dadageo']
    a3.SIBS = record['sibs']
    a3.SIB1MOB = record['sib1mob']
    a3.SIB1YOB = record['sib1yob']
    a3.SIB1AGD = record['sib1agd']
    a3.SIB1NEU = record['sib1neu']
    a3.SIB1PDX = record['sib1pdx']
    a3.SIB1MOE = record['sib1moe']
    a3.SIB1AGO = record['sib1ago']
    a3.SIB2MOB = record['sib2mob']
    a3.SIB2YOB = record['sib2yob']
    a3.SIB2AGD = record['sib2agd']
    a3.SIB2NEU = record['sib2neu']
    a3.SIB2PDX = record['sib2pdx']
    a3.SIB2MOE = record['sib2moe']
    a3.SIB2AGO = record['sib2ago']
    a3.SIB3MOB = record['sib3mob']
    a3.SIB3YOB = record['sib3yob']
    a3.SIB3AGD = record['sib3agd']
    a3.SIB3NEU = record['sib3neu']
    a3.SIB3PDX = record['sib3pdx']
    a3.SIB3MOE = record['sib3moe']
    a3.SIB3AGO = record['sib3ago']
    a3.SIB4MOB = record['sib4mob']
    a3.SIB4YOB = record['sib4yob']
    a3.SIB4AGD = record['sib4agd']
    a3.SIB4NEU = record['sib4neu']
    a3.SIB4PDX = record['sib4pdx']
    a3.SIB4MOE = record['sib4moe']
    a3.SIB4AGO = record['sib4ago']
    a3.SIB5MOB = record['sib5mob']
    a3.SIB5YOB = record['sib5yob']
    a3.SIB5AGD = record['sib5agd']
    a3.SIB5NEU = record['sib5neu']
    a3.SIB5PDX = record['sib5pdx']
    a3.SIB5MOE = record['sib5moe']
    a3.SIB5AGO = record['sib5ago']
    a3.SIB6MOB = record['sib6mob']
    a3.SIB6YOB = record['sib6yob']
    a3.SIB6AGD = record['sib6agd']
    a3.SIB6NEU = record['sib6neu']
    a3.SIB6PDX = record['sib6pdx']
    a3.SIB6MOE = record['sib6moe']
    a3.SIB6AGO = record['sib6ago']
    a3.SIB7MOB = record['sib7mob']
    a3.SIB7YOB = record['sib7yob']
    a3.SIB7AGD = record['sib7agd']
    a3.SIB7NEU = record['sib7neu']
    a3.SIB7PDX = record['sib7pdx']
    a3.SIB7MOE = record['sib7moe']
    a3.SIB7AGO = record['sib7ago']
    a3.SIB8MOB = record['sib8mob']
    a3.SIB8YOB = record['sib8yob']
    a3.SIB8AGD = record['sib8agd']
    a3.SIB8NEU = record['sib8neu']
    a3.SIB8PDX = record['sib8pdx']
    a3.SIB8MOE = record['sib8moe']
    a3.SIB8AGO = record['sib8ago']
    a3.SIB9MOB = record['sib9mob']
    a3.SIB9YOB = record['sib9yob']
    a3.SIB9AGD = record['sib9agd']
    a3.SIB9NEU = record['sib9neu']
    a3.SIB9PDX = record['sib9pdx']
    a3.SIB9MOE = record['sib9moe']
    a3.SIB9AGO = record['sib9ago']
    a3.SIB10MOB = record['sib10mob']
    a3.SIB10YOB = record['sib10yob']
    a3.SIB10AGD = record['sib10agd']
    a3.SIB10NEU = record['sib10neu']
    a3.SIB10PDX = record['sib10pdx']
    a3.SIB10MOE = record['sib10moe']
    a3.SIB10AGO = record['sib10ago']
    a3.SIB11MOB = record['sib11mob']
    a3.SIB11YOB = record['sib11yob']
    a3.SIB11AGD = record['sib11agd']
    a3.SIB11NEU = record['sib11neu']
    a3.SIB11PDX = record['sib11pdx']
    a3.SIB11MOE = record['sib11moe']
    a3.SIB11AGO = record['sib11ago']
    a3.SIB12MOB = record['sib12mob']
    a3.SIB12YOB = record['sib12yob']
    a3.SIB12AGD = record['sib12agd']
    a3.SIB12NEU = record['sib12neu']
    a3.SIB12PDX = record['sib12pdx']
    a3.SIB12MOE = record['sib12moe']
    a3.SIB12AGO = record['sib12ago']
    a3.SIB13MOB = record['sib13mob']
    a3.SIB13YOB = record['sib13yob']
    a3.SIB13AGD = record['sib13agd']
    a3.SIB13NEU = record['sib13neu']
    a3.SIB13PDX = record['sib13pdx']
    a3.SIB13MOE = record['sib13moe']
    a3.SIB13AGO = record['sib13ago']
    a3.SIB14MOB = record['sib14mob']
    a3.SIB14YOB = record['sib14yob']
    a3.SIB14AGD = record['sib14agd']
    a3.SIB14NEU = record['sib14neu']
    a3.SIB14PDX = record['sib14pdx']
    a3.SIB14MOE = record['sib14moe']
    a3.SIB14AGO = record['sib14ago']
    a3.SIB15MOB = record['sib15mob']
    a3.SIB15YOB = record['sib15yob']
    a3.SIB15AGD = record['sib15agd']
    a3.SIB15NEU = record['sib15neu']
    a3.SIB15PDX = record['sib15pdx']
    a3.SIB15MOE = record['sib15moe']
    a3.SIB15AGO = record['sib15ago']
    a3.SIB16MOB = record['sib16mob']
    a3.SIB16YOB = record['sib16yob']
    a3.SIB16AGD = record['sib16agd']
    a3.SIB16NEU = record['sib16neu']
    a3.SIB16PDX = record['sib16pdx']
    a3.SIB16MOE = record['sib16moe']
    a3.SIB16AGO = record['sib16ago']
    a3.SIB17MOB = record['sib17mob']
    a3.SIB17YOB = record['sib17yob']
    a3.SIB17AGD = record['sib17agd']
    a3.SIB17NEU = record['sib17neu']
    a3.SIB17PDX = record['sib17pdx']
    a3.SIB17MOE = record['sib17moe']
    a3.SIB17AGO = record['sib17ago']
    a3.SIB18MOB = record['sib18mob']
    a3.SIB18YOB = record['sib18yob']
    a3.SIB18AGD = record['sib18agd']
    a3.SIB18NEU = record['sib18neu']
    a3.SIB18PDX = record['sib18pdx']
    a3.SIB18MOE = record['sib18moe']
    a3.SIB18AGO = record['sib18ago']
    a3.SIB19MOB = record['sib19mob']
    a3.SIB19YOB = record['sib19yob']
    a3.SIB19AGD = record['sib19agd']
    a3.SIB19NEU = record['sib19neu']
    a3.SIB19PDX = record['sib19pdx']
    a3.SIB19MOE = record['sib19moe']
    a3.SIB19AGO = record['sib19ago']
    a3.SIB20MOB = record['sib20mob']
    a3.SIB20YOB = record['sib20yob']
    a3.SIB20AGD = record['sib20agd']
    a3.SIB20NEU = record['sib20neu']
    a3.SIB20PDX = record['sib20pdx']
    a3.SIB20MOE = record['sib20moe']
    a3.SIB20AGO = record['sib20ago']
    a3.KIDS = record['kids']
    a3.KID1MOB = record['kid1mob']
    a3.KID1YOB = record['kid1yob']
    a3.KID1AGD = record['kid1agd']
    a3.KID1NEU = record['kid1neu']
    a3.KID1PDX = record['kid1pdx']
    a3.KID1MOE = record['kid1moe']
    a3.KID1AGO = record['kid1ago']
    a3.KID2MOB = record['kid2mob']
    a3.KID2YOB = record['kid2yob']
    a3.KID2AGD = record['kid2agd']
    a3.KID2NEU = record['kid2neu']
    a3.KID2PDX = record['kid2pdx']
    a3.KID2MOE = record['kid2moe']
    a3.KID2AGO = record['kid2ago']
    a3.KID3MOB = record['kid3mob']
    a3.KID3YOB = record['kid3yob']
    a3.KID3AGD = record['kid3agd']
    a3.KID3NEU = record['kid3neu']
    a3.KID3PDX = record['kid3pdx']
    a3.KID3MOE = record['kid3moe']
    a3.KID3AGO = record['kid3ago']
    a3.KID4MOB = record['kid4mob']
    a3.KID4YOB = record['kid4yob']
    a3.KID4AGD = record['kid4agd']
    a3.KID4NEU = record['kid4neu']
    a3.KID4PDX = record['kid4pdx']
    a3.KID4MOE = record['kid4moe']
    a3.KID4AGO = record['kid4ago']
    a3.KID5MOB = record['kid5mob']
    a3.KID5YOB = record['kid5yob']
    a3.KID5AGD = record['kid5agd']
    a3.KID5NEU = record['kid5neu']
    a3.KID5PDX = record['kid5pdx']
    a3.KID5MOE = record['kid5moe']
    a3.KID5AGO = record['kid5ago']
    a3.KID6MOB = record['kid6mob']
    a3.KID6YOB = record['kid6yob']
    a3.KID6AGD = record['kid6agd']
    a3.KID6NEU = record['kid6neu']
    a3.KID6PDX = record['kid6pdx']
    a3.KID6MOE = record['kid6moe']
    a3.KID6AGO = record['kid6ago']
    a3.KID7MOB = record['kid7mob']
    a3.KID7YOB = record['kid7yob']
    a3.KID7AGD = record['kid7agd']
    a3.KID7NEU = record['kid7neu']
    a3.KID7PDX = record['kid7pdx']
    a3.KID7MOE = record['kid7moe']
    a3.KID7AGO = record['kid7ago']
    a3.KID8MOB = record['kid8mob']
    a3.KID8YOB = record['kid8yob']
    a3.KID8AGD = record['kid8agd']
    a3.KID8NEU = record['kid8neu']
    a3.KID8PDX = record['kid8pdx']
    a3.KID8MOE = record['kid8moe']
    a3.KID8AGO = record['kid8ago']
    a3.KID9MOB = record['kid9mob']
    a3.KID9YOB = record['kid9yob']
    a3.KID9AGD = record['kid9agd']
    a3.KID9NEU = record['kid9neu']
    a3.KID9PDX = record['kid9pdx']
    a3.KID9MOE = record['kid9moe']
    a3.KID9AGO = record['kid9ago']
    a3.KID10MOB = record['kid10mob']
    a3.KID10YOB = record['kid10yob']
    a3.KID10AGD = record['kid10agd']
    a3.KID10NEU = record['kid10neu']
    a3.KID10PDX = record['kid10pdx']
    a3.KID10MOE = record['kid10moe']
    a3.KID10AGO = record['kid10ago']
    a3.KID11MOB = record['kid11mob']
    a3.KID11YOB = record['kid11yob']
    a3.KID11AGD = record['kid11agd']
    a3.KID11NEU = record['kid11neu']
    a3.KID11PDX = record['kid11pdx']
    a3.KID11MOE = record['kid11moe']
    a3.KID11AGO = record['kid11ago']
    a3.KID12MOB = record['kid12mob']
    a3.KID12YOB = record['kid12yob']
    a3.KID12AGD = record['kid12agd']
    a3.KID12NEU = record['kid12neu']
    a3.KID12PDX = record['kid12pdx']
    a3.KID12MOE = record['kid12moe']
    a3.KID12AGO = record['kid12ago']
    a3.KID13MOB = record['kid13mob']
    a3.KID13YOB = record['kid13yob']
    a3.KID13AGD = record['kid13agd']
    a3.KID13NEU = record['kid13neu']
    a3.KID13PDX = record['kid13pdx']
    a3.KID13MOE = record['kid13moe']
    a3.KID13AGO = record['kid13ago']
    a3.KID14MOB = record['kid14mob']
    a3.KID14YOB = record['kid14yob']
    a3.KID14AGD = record['kid14agd']
    a3.KID14NEU = record['kid14neu']
    a3.KID14PDX = record['kid14pdx']
    a3.KID14MOE = record['kid14moe']
    a3.KID14AGO = record['kid14ago']
    a3.KID15MOB = record['kid15mob']
    a3.KID15YOB = record['kid15yob']
    a3.KID15AGD = record['kid15agd']
    a3.KID15NEU = record['kid15neu']
    a3.KID15PDX = record['kid15pdx']
    a3.KID15MOE = record['kid15moe']
    a3.KID15AGO = record['kid15ago']
    packet.append(a3)

    # Form A4D and A4G are special in that our REDCap implementation (IVP A4)
    # combines them by asking if the subject is taking any medications (which
    # corresponds to A4G.ANYMEDS), then has 50 fields to specify each
    # medication used, which we turn each one into a FormA4D object.
    a4g = ivp_forms.FormA4G()
    a4g.ANYMEDS = record['anymeds']
    packet.append(a4g)

    if a4g.ANYMEDS == 1:
        for i in range(1, 51):
            key = 'drugid_' + str(i)
            if record[key]:
                a4d = ivp_forms.FormA4D()
                a4d.DRUGID = record[key]
                packet.append(a4d)

    a5 = ivp_forms.FormA5()
    a5.TOBAC30 = record['tobac30']
    a5.TOBAC100 = record['tobac100']
    a5.SMOKYRS = record['smokyrs']
    a5.PACKSPER = record['packsper']
    a5.QUITSMOK = record['quitsmok']
    a5.ALCOCCAS = record['alcoccas']
    a5.ALCFREQ = record['alcfreq']
    a5.CVHATT = record['cvhatt']
    a5.HATTMULT = record['hattmult']
    a5.HATTYEAR = record['hattyear']
    a5.CVAFIB = record['cvafib']
    a5.CVANGIO = record['cvangio']
    a5.CVBYPASS = record['cvbypass']
    a5.CVPACDEF = record['cvpacdef']
    a5.CVCHF = record['cvchf']
    a5.CVANGINA = record['cvangina']
    a5.CVHVALVE = record['cvhvalve']
    a5.CVOTHR = record['cvothr']
    a5.CVOTHRX = record['cvothrx']
    a5.CBSTROKE = record['cbstroke']
    a5.STROKMUL = record['strokmul']
    a5.STROKYR = record['strokyr']
    a5.CBTIA = record['cbtia']
    a5.TIAMULT = record['tiamult']
    a5.TIAYEAR = record['tiayear']
    a5.PD = record['pd']
    a5.PDYR = record['pdyr']
    a5.PDOTHR = record['pdothr']
    a5.PDOTHRYR = record['pdothryr']
    a5.SEIZURES = record['seizures']
    a5.TBI = record['tbi']
    a5.TBIBRIEF = record['tbibrief']
    a5.TBIEXTEN = record['tbiexten']
    a5.TBIWOLOS = record['tbiwolos']
    a5.TBIYEAR = record['tbiyear']
    a5.DIABETES = record['diabetes']
    a5.DIABTYPE = record['diabtype']
    a5.HYPERTEN = record['hyperten']
    a5.HYPERCHO = record['hypercho']
    a5.B12DEF = record['b12def']
    a5.THYROID = record['thyroid']
    a5.ARTHRIT = record['arthrit']
    a5.ARTHTYPE = record['arthtype']
    a5.ARTHTYPX = record['arthtypx']
    a5.ARTHUPEX = record['arthupex']
    a5.ARTHLOEX = record['arthloex']
    a5.ARTHSPIN = record['arthspin']
    a5.ARTHUNK = record['arthunk']
    a5.INCONTU = record['incontu']
    a5.INCONTF = record['incontf']
    a5.APNEA = record['apnea']
    a5.RBD = record['rbd']
    a5.INSOMN = record['insomn']
    a5.OTHSLEEP = record['othsleep']
    a5.OTHSLEEX = record['othsleex']
    a5.ALCOHOL = record['alcohol']
    a5.ABUSOTHR = record['abusothr']
    a5.ABUSX = record['abusx']
    a5.PTSD = record['ptsd']
    a5.BIPOLAR = record['bipolar']
    a5.SCHIZ = record['schiz']
    a5.DEP2YRS = record['dep2yrs']
    a5.DEPOTHR = record['depothr']
    a5.ANXIETY = record['anxiety']
    a5.OCD = record['ocd']
    a5.NPSYDEV = record['npsydev']
    a5.PSYCDIS = record['psycdis']
    a5.PSYCDISX = record['psycdisx']
    packet.append(a5)

    b1 = ivp_forms.FormB1()
    b1.HEIGHT = record['height']
    b1.WEIGHT = record['weight']
    b1.BPSYS = record['bpsys']
    b1.BPDIAS = record['bpdias']
    b1.HRATE = record['hrate']
    b1.VISION = record['vision']
    b1.VISCORR = record['viscorr']
    b1.VISWCORR = record['viswcorr']
    b1.HEARING = record['hearing']
    b1.HEARAID = record['hearaid']
    b1.HEARWAID = record['hearwaid']
    packet.append(b1)

    b4 = ivp_forms.FormB4()
    b4.MEMORY = record['memory']
    b4.ORIENT = record['orient']
    b4.JUDGMENT = record['judgment']
    b4.COMMUN = record['commun']
    b4.HOMEHOBB = record['homehobb']
    b4.PERSCARE = record['perscare']
    b4.CDRSUM = record['cdrsum']
    b4.CDRGLOB = record['cdrglob']
    b4.COMPORT = record['comport']
    b4.CDRLANG = record['cdrlang']
    packet.append(b4)

    b5 = ivp_forms.FormB5()
    b5.NPIQINF = record['npiqinf']
    b5.NPIQINFX = record['npiqinfx']
    b5.DEL = record['del']
    b5.DELSEV = record['delsev']
    b5.HALL = record['hall']
    b5.HALLSEV = record['hallsev']
    b5.AGIT = record['agit']
    b5.AGITSEV = record['agitsev']
    b5.DEPD = record['depd']
    b5.DEPDSEV = record['depdsev']
    b5.ANX = record['anx']
    b5.ANXSEV = record['anxsev']
    b5.ELAT = record['elat']
    b5.ELATSEV = record['elatsev']
    b5.APA = record['apa']
    b5.APASEV = record['apasev']
    b5.DISN = record['disn']
    b5.DISNSEV = record['disnsev']
    b5.IRR = record['irr']
    b5.IRRSEV = record['irrsev']
    b5.MOT = record['mot']
    b5.MOTSEV = record['motsev']
    b5.NITE = record['nite']
    b5.NITESEV = record['nitesev']
    b5.APP = record['app']
    b5.APPSEV = record['appsev']
    packet.append(b5)

    b6 = ivp_forms.FormB6()
    b6.NOGDS = record['nogds']
    b6.SATIS = record['satis']
    b6.DROPACT = record['dropact']
    b6.EMPTY = record['empty']
    b6.BORED = record['bored']
    b6.SPIRITS = record['spirits']
    b6.AFRAID = record['afraid']
    b6.HAPPY = record['happy']
    b6.HELPLESS = record['helpless']
    b6.STAYHOME = record['stayhome']
    b6.MEMPROB = record['memprob']
    b6.WONDRFUL = record['wondrful']
    b6.WRTHLESS = record['wrthless']
    b6.ENERGY = record['energy']
    b6.HOPELESS = record['hopeless']
    b6.BETTER = record['better']
    b6.GDS = record['gds']
    packet.append(b6)

    b7 = ivp_forms.FormB7()
    b7.BILLS = record['bills']
    b7.TAXES = record['taxes']
    b7.SHOPPING = record['shopping']
    b7.GAMES = record['games']
    b7.STOVE = record['stove']
    b7.MEALPREP = record['mealprep']
    b7.EVENTS = record['events']
    b7.PAYATTN = record['payattn']
    b7.REMDATES = record['remdates']
    b7.TRAVEL = record['travel']
    packet.append(b7)

    b8 = ivp_forms.FormB8()
    b8.NORMEXAM = record['normexam']
    b8.PARKSIGN = record['parksign']
    b8.RESTTRL = record['resttrl']
    b8.SLOWINGL = record['slowingl']
    b8.RIGIDL = record['rigidl']
    b8.RESTTRR = record['resttrr']
    b8.SLOWINGR = record['slowingr']
    b8.RIGIDR = record['rigidr']
    b8.BRADY = record['brady']
    b8.PARKGAIT = record['parkgait']
    b8.POSTINST = record['postinst']
    b8.CVDSIGNS = record['cvdsigns']
    b8.CORTDEF = record['cortdef']
    b8.SIVDFIND = record['sivdfind']
    b8.CVDMOTL = record['cvdmotl']
    b8.CORTVISL = record['cortvisl']
    b8.SOMATL = record['somatl']
    b8.CVDMOTR = record['cvdmotr']
    b8.CORTVISR = record['cortvisr']
    b8.SOMATR = record['somatr']
    b8.POSTCORT = record['postcort']
    b8.PSPCBS = record['pspcbs']
    b8.EYEPSP = record['eyepsp']
    b8.DYSPSP = record['dyspsp']
    b8.AXIALPSP = record['axialpsp']
    b8.GAITPSP = record['gaitpsp']
    b8.APRAXSP = record['apraxsp']
    b8.APRAXL = record['apraxl']
    b8.CORTSENL = record['cortsenl']
    b8.ATAXL = record['ataxl']
    b8.ALIENLML = record['alienlml']
    b8.DYSTONL = record['dystonl']
    b8.MYOCLLT = record['myocllt']
    b8.APRAXR = record['apraxr']
    b8.CORTSENR = record['cortsenr']
    b8.ATAXR = record['ataxr']
    b8.ALIENLMR = record['alienlmr']
    b8.DYSTONR = record['dystonr']
    b8.MYOCLRT = record['myoclrt']
    b8.ALSFIND = record['alsfind']
    b8.GAITNPH = record['gaitnph']
    b8.OTHNEUR = record['otherneur']
    b8.OTHNEURX = record['otherneurx']
    packet.append(b8)

    b9 = ivp_forms.FormB9()
    b9.DECSUB = record['decsub']
    b9.DECIN = record['decin']
    b9.DECCLCOG = record['decclcog']
    b9.COGMEM = record['cogmem']
    b9.COGORI = record['cogori']
    b9.COGJUDG = record['cogjudg']
    b9.COGLANG = record['coglang']
    b9.COGVIS = record['cogvis']
    b9.COGATTN = record['cogattn']
    b9.COGFLUC = record['cogfluc']
    b9.COGFLAGO = record['cogflago']
    b9.COGOTHR = record['cogothr']
    b9.COGOTHRX = record['cogothrx']
    b9.COGFPRED = record['cogfpred']
    b9.COGFPREX = record['cogfprex']
    b9.COGMODE = record['cogmode']
    b9.COGMODEX = record['cogmodex']
    b9.DECAGE = record['decage']
    b9.DECCLBE = record['decclbe']
    b9.BEAPATHY = record['beapathy']
    b9.BEDEP = record['bedep']
    b9.BEVHALL = record['bevhall']
    b9.BEVWELL = record['bevwell']
    b9.BEVHAGO = record['bevhago']
    b9.BEAHALL = record['beahall']
    b9.BEDEL = record['bedel']
    b9.BEDISIN = record['bedisin']
    b9.BEIRRIT = record['beirrit']
    b9.BEAGIT = record['beagit']
    b9.BEPERCH = record['beperch']
    b9.BEREM = record['berem']
    b9.BEREMAGO = record['beremago']
    b9.BEANX = record['beanx']
    b9.BEOTHR = record['beothr']
    b9.BEOTHRX = record['beothrx']
    b9.BEFPRED = record['befpred']
    b9.BEFPREDX = record['befpredx']
    b9.BEMODE = record['bemode']
    b9.BEMODEX = record['bemodex']
    b9.BEAGE = record['beage']
    b9.DECCLMOT = record['decclmot']
    b9.MOGAIT = record['mogait']
    b9.MOFALLS = record['mofalls']
    b9.MOTREM = record['motrem']
    b9.MOSLOW = record['moslow']
    b9.MOFRST = record['mofrst']
    b9.MOMODE = record['momode']
    b9.MOMODEX = record['momodex']
    b9.MOMOPARK = record['momopark']
    b9.PARKAGE = record['parkage']
    b9.MOMOALS = record['momoals']
    b9.ALSAGE = record['alsage']
    b9.MOAGE = record['moage']
    b9.COURSE = record['course']
    b9.FRSTCHG = record['frstchg']
    b9.LBDEVAL = record['lbdeval']
    b9.FTLDEVAL = record['ftldeval']
    packet.append(b9)

    # Among C1S and C2 forms, one must be filled, one must be empty.
    isC1SNotBlank = '0' + (record['c1s_1a_mmseloc'] and record['c1s_1a_mmseloc'].strip()) \
                or (record['c1s_11a_cogstat'] and record['c1s_11a_cogstat'].strip())
    isC2NotBlank = '0' + (record['mocacomp'] and record['mocacomp'].strip()) \
                or (record['cogstat_c2'] and record['cogstat_c2'].strip())

    condition = int(isC1SNotBlank) + int(isC2NotBlank)

    if (condition != 1):
        ptid = record['ptid']
        message = "Could not parse packet as " + (
            "both" if condition > 1 else "neither") + " c1s/c2 forms has data"
        message = message + " PTID : " + ("unknown" if not ptid else ptid)
        raise Exception(message)

    if (isC1SNotBlank):
        addC1S(record, packet)
    else:
        addC2(record, packet)

    d1 = ivp_forms.FormD1()
    d1.DXMETHOD = record['dxmethod']
    d1.NORMCOG = record['normcog']
    d1.DEMENTED = record['demented']
    d1.AMNDEM = record['amndem']
    d1.PCA = record['pca']
    d1.PPASYN = record['ppasyn']
    d1.PPASYNT = record['ppasynt']
    d1.FTDSYN = record['ftdsyn']
    d1.LBDSYN = record['lbdsyn']
    d1.NAMNDEM = record['namndem']
    d1.MCIAMEM = record['mciamem']
    d1.MCIAPLUS = record['mciaplus']
    d1.MCIAPLAN = record['mciaplan']
    d1.MCIAPATT = record['mciapatt']
    d1.MCIAPEX = record['mciapex']
    d1.MCIAPVIS = record['mciapvis']
    d1.MCINON1 = record['mcinon1']
    d1.MCIN1LAN = record['mcin1lan']
    d1.MCIN1ATT = record['mcin1att']
    d1.MCIN1EX = record['mcin1ex']
    d1.MCIN1VIS = record['mcin1vis']
    d1.MCINON2 = record['mcinon2']
    d1.MCIN2LAN = record['mcin2lan']
    d1.MCIN2ATT = record['mcin2att']
    d1.MCIN2EX = record['mcin2ex']
    d1.MCIN2VIS = record['mcin2vis']
    d1.IMPNOMCI = record['impnomci']
    d1.AMYLPET = record['amylpet']
    d1.AMYLCSF = record['amylcsf']
    d1.FDGAD = record['fdgad']
    d1.HIPPATR = record['hippatr']
    d1.TAUPETAD = record['taupetad']
    d1.CSFTAU = record['csftau']
    d1.FDGFTLD = record['fdgftld']
    d1.TPETFTLD = record['tpetftld']
    d1.MRFTLD = record['mrftld']
    d1.DATSCAN = record['datscan']
    d1.OTHBIOM = record['othbiom']
    d1.OTHBIOMX = record['othbiomx']
    d1.IMAGLINF = record['imaglinf']
    d1.IMAGLAC = record['imaglac']
    d1.IMAGMACH = record['imagmach']
    d1.IMAGMICH = record['imagmich']
    d1.IMAGMWMH = record['imagmwmh']
    d1.IMAGEWMH = record['imagewmh']
    d1.ADMUT = record['admut']
    d1.FTLDMUT = record['ftldmut']
    d1.OTHMUT = record['othmut']
    d1.OTHMUTX = record['othmutx']
    d1.ALZDIS = record['alzdis']
    d1.ALZDISIF = record['alzdisif']
    d1.LBDIS = record['lbdis']
    d1.LBDIF = record['lbdif']
    d1.PARK = record['park']
    d1.MSA = record['msa']
    d1.MSAIF = record['msaif']
    d1.PSP = record['psp']
    d1.PSPIF = record['pspif']
    d1.CORT = record['cort']
    d1.CORTIF = record['cortif']
    d1.FTLDMO = record['ftldmo']
    d1.FTLDMOIF = record['ftldmoif']
    d1.FTLDNOS = record['ftldnos']
    d1.FTLDNOIF = record['ftldnoif']
    d1.FTLDSUBT = record['ftldsubt']
    d1.FTLDSUBX = record['ftldsubx']
    d1.CVD = record['cvd']
    d1.CVDIF = record['cvdif']
    d1.PREVSTK = record['prevstk']
    d1.STROKDEC = record['strokedec']
    d1.STKIMAG = record['stkimag']
    d1.INFNETW = record['infnetw']
    d1.INFWMH = record['infwmh']
    d1.ESSTREM = record['esstrem']
    d1.ESSTREIF = record['esstreif']
    d1.DOWNS = record['downs']
    d1.DOWNSIF = record['downsif']
    d1.HUNT = record['hunt']
    d1.HUNTIF = record['huntif']
    d1.PRION = record['prion']
    d1.PRIONIF = record['prionif']
    d1.BRNINJ = record['brninj']
    d1.BRNINJIF = record['brninjif']
    d1.BRNINCTE = record['brnincte']
    d1.HYCEPH = record['hyceph']
    d1.HYCEPHIF = record['hycephif']
    d1.EPILEP = record['epilep']
    d1.EPILEPIF = record['epilepif']
    d1.NEOP = record['neop']
    d1.NEOPIF = record['neopif']
    d1.NEOPSTAT = record['neopstat']
    d1.HIV = record['hiv']
    d1.HIVIF = record['hivif']
    d1.OTHCOG = record['othcog']
    d1.OTHCOGIF = record['othcogif']
    d1.OTHCOGX = record['othcogx']
    d1.DEP = record['dep']
    d1.DEPIF = record['depif']
    d1.DEPTREAT = record['deptreat']
    d1.BIPOLDX = record['bipoldx']
    d1.BIPOLDIF = record['bipoldif']
    d1.SCHIZOP = record['schizop']
    d1.SCHIZOIF = record['schizoif']
    d1.ANXIET = record['anxiet']
    d1.ANXIETIF = record['anxietif']
    d1.DELIR = record['delir']
    d1.DELIRIF = record['delirif']
    d1.PTSDDX = record['ptsddx']
    d1.PTSDDXIF = record['ptsddxif']
    d1.OTHPSY = record['othpsy']
    d1.OTHPSYIF = record['othpsyif']
    d1.OTHPSYX = record['othpsyx']
    d1.ALCDEM = record['alcdem']
    d1.ALCDEMIF = record['alcdemif']
    d1.ALCABUSE = record['alcabuse']
    d1.IMPSUB = record['impsub']
    d1.IMPSUBIF = record['impsubif']
    d1.DYSILL = record['dysill']
    d1.DYSILLIF = record['dysillif']
    d1.MEDS = record['meds']
    d1.MEDSIF = record['medsif']
    d1.COGOTH = record['cogoth']
    d1.COGOTHIF = record['cogothif']
    d1.COGOTHX = record['cogothx']
    d1.COGOTH2 = record['cogoth2']
    d1.COGOTH2F = record['cogoth2f']
    d1.COGOTH2X = record['cogoth2x']
    d1.COGOTH3 = record['cogoth3']
    d1.COGOTH3F = record['cogoth3f']
    d1.COGOTH3X = record['cogoth3x']
    packet.append(d1)

    d2 = ivp_forms.FormD2()
    d2.CANCER = record['cancer']
    d2.CANCSITE = record['cancsite']
    d2.DIABET = record['diabet']
    d2.MYOINF = record['myoinf']
    d2.CONGHRT = record['conghrt']
    d2.AFIBRILL = record['afibrill']
    d2.HYPERT = record['hypert']
    d2.ANGINA = record['angina']
    d2.HYPCHOL = record['hypchol']
    d2.VB12DEF = record['vb12def']
    d2.THYDIS = record['thydis']
    d2.ARTH = record['arth']
    d2.ARTYPE = record['artype']
    d2.ARTYPEX = record['artypex']
    d2.ARTUPEX = record['artupex']
    d2.ARTLOEX = record['artloex']
    d2.ARTSPIN = record['artspin']
    d2.ARTUNKN = record['artunkn']

    d2.URINEINC = record['urineinc']
    d2.BOWLINC = record['bowlinc']
    d2.SLEEPAP = record['sleepap']
    d2.REMDIS = record['remdis']
    d2.HYPOSOM = record['hyposom']
    d2.SLEEPOTH = record['sleepoth']
    d2.SLEEPOTX = record['sleepotx']
    d2.ANGIOCP = record['angiocp']
    d2.ANGIOPCI = record['angiopci']
    d2.PACEMAKE = record['pacemake']
    d2.HVALVE = record['hvalve']
    d2.ANTIENC = record['antienc']
    d2.ANTIENCX = record['antiencx']
    d2.OTHCOND = record['othcond']
    d2.OTHCONDX = record['othcondx']
    packet.append(d2)

    z1 = ivp_forms.FormZ1()
    # Forms A1, A5, B4, B8, B9, C2, D1, and D2 are all REQUIRED.
    # Fields a1sub, a5sub1, b4sub1, b8sub1, b9sub1, c2sub1, d1sub1, and d2sub1
    # are just section separators.

    z1.A2SUB = record['a2sub']
    z1.A2NOT = record['a2not']
    z1.A2COMM = record['a2comm']
    z1.A3SUB = record['a3sub']
    z1.A3NOT = record['a3not']
    z1.A3COMM = record['a3comm']
    z1.A4SUB = record['a4sub']
    z1.A4NOT = record['a4not']
    z1.A4COMM = record['a4comm']
    z1.B1SUB = record['b1sub']
    z1.B1NOT = record['b1not']
    z1.B1COMM = record['b1comm']
    z1.B5SUB = record['b5sub']
    z1.B5NOT = record['b5not']
    z1.B5COMM = record['b5comm']
    z1.B6SUB = record['b6sub']
    z1.B6NOT = record['b6not']
    z1.B6COMM = record['b6comm']
    z1.B7SUB = record['b7sub']
    z1.B7NOT = record['b7not']
    z1.B7COMM = record['b7comm']
    packet.insert(0, z1)

    update_header(record, packet)
    return packet
Exemplo n.º 24
0
def build_uds3_tfp_form(record):
    """ Converts REDCap CSV data into a packet (list of TFP Form objects) """
    packet = tfp_packet.Packet()

    # Set up the forms
    add_z1_or_z1x(record, packet)

    t1 = tfp_forms.FormT1()
    t1.TELCOG = record['telcog']
    t1.TELILL = record['telill']
    t1.TELHOME = record['telhome']
    t1.TELREFU = record['telrefu']
    t1.TELOTHR = record['telothr']
    t1.TELOTHRX = record['telothrx']
    t1.TELINPER = record['telinper']
    t1.TELMILE = record['telmile']
    packet.append(t1)

    a1 = tfp_forms.FormA1()
    a1.BIRTHMO = record['tele_birthmo']
    a1.BIRTHYR = record['tele_birthyr']
    a1.MARISTAT = record['tele_maristat']
    a1.SEX = record['tele_sex']
    a1.LIVSITUA = record['tele_livsitua']
    a1.INDEPEND = record['tele_independ']
    a1.RESIDENC = record['tele_residenc']
    a1.ZIP = record['tele_zip']
    packet.append(a1)

    a2 = tfp_forms.FormA2()
    a2.INBIRMO = record['tele_inbirmo']
    a2.INBIRYR = record['tele_inbiryr']
    a2.INSEX = record['tele_insex']
    a2.NEWINF = record['tele_newinf']
    a2.INHISP = record['tele_inhisp']
    a2.INHISPOR = record['tele_inhispor']
    a2.INHISPOX = record['tele_inhispox']
    a2.INRACE = record['tele_inrace']
    a2.INRACEX = record['tele_inracex']
    a2.INRASEC = record['tele_inrasec']
    a2.INRASECX = record['tele_inrasecx']
    a2.INRATER = record['tele_inrater']
    a2.INRATERX = record['tele_inraterx']
    a2.INEDUC = record['tele_ineduc']
    a2.INRELTO = record['tele_inrelto']
    a2.INKNOWN = record['tele_inknown']
    a2.INLIVWTH = record['tele_inlivwth']
    a2.INVISITS = record['tele_invisits']
    a2.INCALLS = record['tele_incalls']
    a2.INRELY = record['tele_inrely']
    packet.append(a2)

    a3 = tfp_forms.FormA3()
    a3.NWINFMUT = record['tele_nwinfmut']
    a3.FADMUT = record['tele_fadmut']
    a3.FADMUTX = record['tele_fadmutx']
    a3.FADMUSO = record['tele_fadmuso']
    a3.FADMUSOX = record['tele_fadmusox']
    a3.FFTDMUT = record['tele_fftdmut']
    a3.FFTDMUTX = record['tele_fftdmutx']
    a3.FFTDMUSO = record['tele_fftdmuso']
    a3.FFTDMUSX = record['tele_fftdmusx']
    a3.FOTHMUT = record['tele_fothmut']
    a3.FOTHMUTX = record['tele_fothmutx']
    a3.FOTHMUSO = record['tele_fothmuso']
    a3.FOTHMUSX = record['tele_fothmusx']
    a3.NWINFPAR = record['tele_nwinfpar']
    a3.MOMMOB = record['tele_mommob']
    a3.MOMYOB = record['tele_momyob']
    a3.MOMDAGE = record['tele_momdage']
    a3.MOMNEUR = record['tele_momneur']
    a3.MOMPRDX = record['tele_momprdx']
    a3.MOMMOE = record['tele_mommoe']
    a3.MOMAGEO = record['tele_momageo']
    a3.DADMOB = record['tele_dadmob']
    a3.DADYOB = record['tele_dadyob']
    a3.DADDAGE = record['tele_daddage']
    a3.DADNEUR = record['tele_dadneur']
    a3.DADPRDX = record['tele_dadprdx']
    a3.DADMOE = record['tele_dadmoe']
    a3.DADAGEO = record['tele_dadageo']
    a3.SIBS = record['tele_sibs']  # check to see how many sibs
    a3.NWINFSIB = record['tele_nwinfsib']
    a3.SIB1MOB = record['tele_sib1mob']
    a3.SIB1YOB = record['tele_sib1yob']
    a3.SIB1AGD = record['tele_sib1agd']
    a3.SIB1NEU = record['tele_sib1neu']
    a3.SIB1PDX = record['tele_sib1pdx']
    a3.SIB1MOE = record['tele_sib1moe']
    a3.SIB1AGO = record['tele_sib1ago']
    a3.SIB2MOB = record['tele_sib2mob']
    a3.SIB2YOB = record['tele_sib2yob']
    a3.SIB2AGD = record['tele_sib2agd']
    a3.SIB2NEU = record['tele_sib2neu']
    a3.SIB2PDX = record['tele_sib2pdx']
    a3.SIB2MOE = record['tele_sib2moe']
    a3.SIB2AGO = record['tele_sib2ago']
    a3.SIB3MOB = record['tele_sib3mob']
    a3.SIB3YOB = record['tele_sib3yob']
    a3.SIB3AGD = record['tele_sib3agd']
    a3.SIB3NEU = record['tele_sib3neu']
    a3.SIB3PDX = record['tele_sib3pdx']
    a3.SIB3MOE = record['tele_sib3moe']
    a3.SIB3AGO = record['tele_sib3ago']
    a3.SIB4MOB = record['tele_sib4mob']
    a3.SIB4YOB = record['tele_sib4yob']
    a3.SIB4AGD = record['tele_sib4agd']
    a3.SIB4NEU = record['tele_sib4neu']
    a3.SIB4PDX = record['tele_sib4pdx']
    a3.SIB4MOE = record['tele_sib4moe']
    a3.SIB4AGO = record['tele_sib4ago']
    a3.SIB5MOB = record['tele_sib5mob']
    a3.SIB5YOB = record['tele_sib5yob']
    a3.SIB5AGD = record['tele_sib5agd']
    a3.SIB5NEU = record['tele_sib5neu']
    a3.SIB5PDX = record['tele_sib5pdx']
    a3.SIB5MOE = record['tele_sib5moe']
    a3.SIB5AGO = record['tele_sib5ago']
    a3.SIB6MOB = record['tele_sib6mob']
    a3.SIB6YOB = record['tele_sib6yob']
    a3.SIB6AGD = record['tele_sib6agd']
    a3.SIB6NEU = record['tele_sib6neu']
    a3.SIB6PDX = record['tele_sib6pdx']
    a3.SIB6MOE = record['tele_sib6moe']
    a3.SIB6AGO = record['tele_sib6ago']
    a3.SIB7MOB = record['tele_sib7mob']
    a3.SIB7YOB = record['tele_sib7yob']
    a3.SIB7AGD = record['tele_sib7agd']
    a3.SIB7NEU = record['tele_sib7neu']
    a3.SIB7PDX = record['tele_sib7pdx']
    a3.SIB7MOE = record['tele_sib7moe']
    a3.SIB7AGO = record['tele_sib7ago']
    a3.SIB8MOB = record['tele_sib8mob']
    a3.SIB8YOB = record['tele_sib8yob']
    a3.SIB8AGD = record['tele_sib8agd']
    a3.SIB8NEU = record['tele_sib8neu']
    a3.SIB8PDX = record['tele_sib8pdx']
    a3.SIB8MOE = record['tele_sib8moe']
    a3.SIB8AGO = record['tele_sib8ago']
    a3.SIB9MOB = record['tele_sib9mob']
    a3.SIB9YOB = record['tele_sib9yob']
    a3.SIB9AGD = record['tele_sib9agd']
    a3.SIB9NEU = record['tele_sib9neu']
    a3.SIB9PDX = record['tele_sib9pdx']
    a3.SIB9MOE = record['tele_sib9moe']
    a3.SIB9AGO = record['tele_sib9ago']
    a3.SIB10MOB = record['tele_sib10mob']
    a3.SIB10YOB = record['tele_sib10yob']
    a3.SIB10AGD = record['tele_sib10agd']
    a3.SIB10NEU = record['tele_sib10neu']
    a3.SIB10PDX = record['tele_sib10pdx']
    a3.SIB10MOE = record['tele_sib10moe']
    a3.SIB10AGO = record['tele_sib10ago']
    a3.SIB11MOB = record['tele_sib11mob']
    a3.SIB11YOB = record['tele_sib11yob']
    a3.SIB11AGD = record['tele_sib11agd']
    a3.SIB11NEU = record['tele_sib11neu']
    a3.SIB11PDX = record['tele_sib11pdx']
    a3.SIB11MOE = record['tele_sib11moe']
    a3.SIB11AGO = record['tele_sib11ago']
    a3.SIB12MOB = record['tele_sib12mob']
    a3.SIB12YOB = record['tele_sib12yob']
    a3.SIB12AGD = record['tele_sib12agd']
    a3.SIB12NEU = record['tele_sib12neu']
    a3.SIB12PDX = record['tele_sib12pdx']
    a3.SIB12MOE = record['tele_sib12moe']
    a3.SIB12AGO = record['tele_sib12ago']
    a3.SIB13MOB = record['tele_sib13mob']
    a3.SIB13YOB = record['tele_sib13yob']
    a3.SIB13AGD = record['tele_sib13agd']
    a3.SIB13NEU = record['tele_sib13neu']
    a3.SIB13PDX = record['tele_sib13pdx']
    a3.SIB13MOE = record['tele_sib13moe']
    a3.SIB13AGO = record['tele_sib13ago']
    a3.SIB14MOB = record['tele_sib14mob']
    a3.SIB14YOB = record['tele_sib14yob']
    a3.SIB14AGD = record['tele_sib14agd']
    a3.SIB14NEU = record['tele_sib14neu']
    a3.SIB14PDX = record['tele_sib14pdx']
    a3.SIB14MOE = record['tele_sib14moe']
    a3.SIB14AGO = record['tele_sib14ago']
    a3.SIB15MOB = record['tele_sib15mob']
    a3.SIB15YOB = record['tele_sib15yob']
    a3.SIB15AGD = record['tele_sib15agd']
    a3.SIB15NEU = record['tele_sib15neu']
    a3.SIB15PDX = record['tele_sib15pdx']
    a3.SIB15MOE = record['tele_sib15moe']
    a3.SIB15AGO = record['tele_sib15ago']
    a3.SIB16MOB = record['tele_sib16mob']
    a3.SIB16YOB = record['tele_sib16yob']
    a3.SIB16AGD = record['tele_sib16agd']
    a3.SIB16NEU = record['tele_sib16neu']
    a3.SIB16PDX = record['tele_sib16pdx']
    a3.SIB16MOE = record['tele_sib16moe']
    a3.SIB16AGO = record['tele_sib16ago']
    a3.SIB17MOB = record['tele_sib17mob']
    a3.SIB17YOB = record['tele_sib17yob']
    a3.SIB17AGD = record['tele_sib17agd']
    a3.SIB17NEU = record['tele_sib17neu']
    a3.SIB17PDX = record['tele_sib17pdx']
    a3.SIB17MOE = record['tele_sib17moe']
    a3.SIB17AGO = record['tele_sib17ago']
    a3.SIB18MOB = record['tele_sib18mob']
    a3.SIB18YOB = record['tele_sib18yob']
    a3.SIB18AGD = record['tele_sib18agd']
    a3.SIB18NEU = record['tele_sib18neu']
    a3.SIB18PDX = record['tele_sib18pdx']
    a3.SIB18MOE = record['tele_sib18moe']
    a3.SIB18AGO = record['tele_sib18ago']
    a3.SIB19MOB = record['tele_sib19mob']
    a3.SIB19YOB = record['tele_sib19yob']
    a3.SIB19AGD = record['tele_sib19agd']
    a3.SIB19NEU = record['tele_sib19neu']
    a3.SIB19PDX = record['tele_sib19pdx']
    a3.SIB19MOE = record['tele_sib19moe']
    a3.SIB19AGO = record['tele_sib19ago']
    a3.SIB20MOB = record['tele_sib20mob']
    a3.SIB20YOB = record['tele_sib20yob']
    a3.SIB20AGD = record['tele_sib20agd']
    a3.SIB20NEU = record['tele_sib20neu']
    a3.SIB20PDX = record['tele_sib20pdx']
    a3.SIB20MOE = record['tele_sib20moe']
    a3.SIB20AGO = record['tele_sib20ago']
    a3.KIDS = record['tele_kids']  # check to see number of kids ?
    a3.NWINFKID = record['tele_nwinfkid']
    a3.KID1MOB = record['tele_kid1mob']
    a3.KID1YOB = record['tele_kid1yob']
    a3.KID1AGD = record['tele_kid1agd']
    a3.KID1NEU = record['tele_kid1neu']
    a3.KID1PDX = record['tele_kid1pdx']
    a3.KID1MOE = record['tele_kid1moe']
    a3.KID1AGO = record['tele_kid1ago']
    a3.KID2MOB = record['tele_kid2mob']
    a3.KID2YOB = record['tele_kid2yob']
    a3.KID2AGD = record['tele_kid2agd']
    a3.KID2NEU = record['tele_kid2neu']
    a3.KID2PDX = record['tele_kid2pdx']
    a3.KID2MOE = record['tele_kid2moe']
    a3.KID2AGO = record['tele_kid2ago']
    a3.KID3MOB = record['tele_kid3mob']
    a3.KID3YOB = record['tele_kid3yob']
    a3.KID3AGD = record['tele_kid3agd']
    a3.KID3NEU = record['tele_kid3neu']
    a3.KID3PDX = record['tele_kid3pdx']
    a3.KID3MOE = record['tele_kid3moe']
    a3.KID3AGO = record['tele_kid3ago']
    a3.KID4MOB = record['tele_kid4mob']
    a3.KID4YOB = record['tele_kid4yob']
    a3.KID4AGD = record['tele_kid4agd']
    a3.KID4NEU = record['tele_kid4neu']
    a3.KID4PDX = record['tele_kid4pdx']
    a3.KID4MOE = record['tele_kid4moe']
    a3.KID4AGO = record['tele_kid4ago']
    a3.KID5MOB = record['tele_kid5mob']
    a3.KID5YOB = record['tele_kid5yob']
    a3.KID5AGD = record['tele_kid5agd']
    a3.KID5NEU = record['tele_kid5neu']
    a3.KID5PDX = record['tele_kid5pdx']
    a3.KID5MOE = record['tele_kid5moe']
    a3.KID5AGO = record['tele_kid5ago']
    a3.KID6MOB = record['tele_kid6mob']
    a3.KID6YOB = record['tele_kid6yob']
    a3.KID6AGD = record['tele_kid6agd']
    a3.KID6NEU = record['tele_kid6neu']
    a3.KID6PDX = record['tele_kid6pdx']
    a3.KID6MOE = record['tele_kid6moe']
    a3.KID6AGO = record['tele_kid6ago']
    a3.KID7MOB = record['tele_kid7mob']
    a3.KID7YOB = record['tele_kid7yob']
    a3.KID7AGD = record['tele_kid7agd']
    a3.KID7NEU = record['tele_kid7neu']
    a3.KID7PDX = record['tele_kid7pdx']
    a3.KID7MOE = record['tele_kid7moe']
    a3.KID7AGO = record['tele_kid7ago']
    a3.KID8MOB = record['tele_kid8mob']
    a3.KID8YOB = record['tele_kid8yob']
    a3.KID8AGD = record['tele_kid8agd']
    a3.KID8NEU = record['tele_kid8neu']
    a3.KID8PDX = record['tele_kid8pdx']
    a3.KID8MOE = record['tele_kid8moe']
    a3.KID8AGO = record['tele_kid8ago']
    a3.KID9MOB = record['tele_kid9mob']
    a3.KID9YOB = record['tele_kid9yob']
    a3.KID9AGD = record['tele_kid9agd']  # telekidagd
    a3.KID9NEU = record['tele_kid9neu']
    a3.KID9PDX = record['tele_kid9pdx']
    a3.KID9MOE = record['tele_kid9moe']
    a3.KID9AGO = record['tele_kid9ago']
    a3.KID10MOB = record['tele_kid10mob']
    a3.KID10YOB = record['tele_kid10yob']
    a3.KID10AGD = record['tele_kid10agd']
    a3.KID10NEU = record['tele_kid10neu']
    a3.KID10PDX = record['tele_kid10pdx']
    a3.KID10MOE = record['tele_kid10moe']
    a3.KID10AGO = record['tele_kid10ago']
    a3.KID11MOB = record['tele_kid11mob']
    a3.KID11YOB = record['tele_kid11yob']
    a3.KID11AGD = record['tele_kid11agd']
    a3.KID11NEU = record['tele_kid11neu']
    a3.KID11PDX = record['tele_kid11pdx']
    a3.KID11MOE = record['tele_kid11moe']
    a3.KID11AGO = record['tele_kid11ago']
    a3.KID12MOB = record['tele_kid12mob']
    a3.KID12YOB = record['tele_kid12yob']
    a3.KID12AGD = record['tele_kid12agd']
    a3.KID12NEU = record['tele_kid12neu']
    a3.KID12PDX = record['tele_kid12pdx']
    a3.KID12MOE = record['tele_kid12moe']
    a3.KID12AGO = record['tele_kid12ago']
    a3.KID13MOB = record['tele_kid13mob']
    a3.KID13YOB = record['tele_kid13yob']
    a3.KID13AGD = record['tele_kid13agd']
    a3.KID13NEU = record['tele_kid13neu']
    a3.KID13PDX = record['tele_kid13pdx']
    a3.KID13MOE = record['tele_kid13moe']
    a3.KID13AGO = record['tele_kid13ago']
    a3.KID14MOB = record['tele_kid14mob']
    a3.KID14YOB = record['tele_kid14yob']
    a3.KID14AGD = record['tele_kid14agd']
    a3.KID14NEU = record['tele_kid14neu']
    a3.KID14PDX = record['tele_kid14pdx']
    a3.KID14MOE = record['tele_kid14moe']
    a3.KID14AGO = record['tele_kid14ago']
    a3.KID15MOB = record['tele_kid15mob']
    a3.KID15YOB = record['tele_kid15yob']
    a3.KID15AGD = record['tele_kid15agd']
    a3.KID15NEU = record['tele_kid15neu']
    a3.KID15PDX = record['tele_kid15pdx']
    a3.KID15MOE = record['tele_kid15moe']
    a3.KID15AGO = record['tele_kid15ago']
    packet.append(a3)

    # Form A4D and A4G are special in that our REDCap implementation (IVP A4)
    # combines them by asking if the subject is taking any medications (which
    # corresponds to A4G.ANYMEDS), then has 50 fields to specify each
    # medication used, which we turn each one into a FormA4D object.
    a4g = tfp_forms.FormA4G()
    a4g.ANYMEDS = record['tele_anymeds']
    packet.append(a4g)

    if a4g.ANYMEDS == 1:
        for i in range(1, 51):
            key = 'tele_drugid_' + str(i)
            if record[key]:
                a4d = tfp_forms.FormA4D()
                a4d.DRUGID = record[key]
                packet.append(a4d)

    b4 = tfp_forms.FormB4()
    b4.MEMORY = record['tele_memory']
    b4.ORIENT = record['tele_orient']
    b4.JUDGMENT = record['tele_judgment']
    b4.COMMUN = record['tele_commun']
    b4.HOMEHOBB = record['tele_homehobb']
    b4.PERSCARE = record['tele_perscare']
    b4.CDRSUM = record['tele_cdrsum']
    b4.CDRGLOB = record['tele_cdrglob']
    b4.COMPORT = record['tele_comport']
    b4.CDRLANG = record['tele_cdrlang']
    packet.append(b4)

    b5 = tfp_forms.FormB5()
    b5.NPIQINF = record['tele_npiqinf']
    b5.NPIQINFX = record['tele_npiqinfx']
    b5.DEL = record['tele_del']
    b5.DELSEV = record['tele_delsev']
    b5.HALL = record['tele_hall']
    b5.HALLSEV = record['tele_hallsev']
    b5.AGIT = record['tele_agit']
    b5.AGITSEV = record['tele_agitsev']
    b5.DEPD = record['tele_depd']
    b5.DEPDSEV = record['tele_depdsev']
    b5.ANX = record['tele_anx']
    b5.ANXSEV = record['tele_anxsev']
    b5.ELAT = record['tele_elat']
    b5.ELATSEV = record['tele_elatsev']
    b5.APA = record['tele_apa']
    b5.APASEV = record['tele_apasev']
    b5.DISN = record['tele_disn']
    b5.DISNSEV = record['tele_disnsev']
    b5.IRR = record['tele_irr']
    b5.IRRSEV = record['tele_irrsev']
    b5.MOT = record['tele_mot']
    b5.MOTSEV = record['tele_motsev']
    b5.NITE = record['tele_nite']
    b5.NITESEV = record['tele_nitesev']
    b5.APP = record['tele_app']
    b5.APPSEV = record['tele_appsev']
    packet.append(b5)

    b7 = tfp_forms.FormB7()
    b7.BILLS = record['tele_bills']
    b7.TAXES = record['tele_taxes']
    b7.SHOPPING = record['tele_shopping']
    b7.GAMES = record['tele_games']
    b7.STOVE = record['tele_stove']
    b7.MEALPREP = record['tele_mealprep']
    b7.EVENTS = record['tele_events']
    b7.PAYATTN = record['tele_payattn']
    b7.REMDATES = record['tele_remdates']
    b7.TRAVEL = record['tele_travel']
    packet.append(b7)

    b9 = tfp_forms.FormB9()
    b9.DECSUB = record['tele_decsub']
    b9.DECIN = record['tele_decin']
    b9.DECCLCOG = record['tele_decclcog']
    b9.COGMEM = record['tele_cogmem']
    b9.COGORI = record['tele_cogori']
    b9.COGJUDG = record['tele_cogjudg']
    b9.COGLANG = record['tele_coglang']
    b9.COGVIS = record['tele_cogvis']
    b9.COGATTN = record['tele_cogattn']
    b9.COGFLUC = record['tele_cogfluc']
    b9.COGFLAGO = record['tele_cogflago']
    b9.COGOTHR = record['tele_cogothr']
    b9.COGOTHRX = record['tele_cogothrx']
    b9.COGFPRED = record['tele_cogfpred']
    b9.COGFPREX = record['tele_cogfprex']
    b9.COGMODE = record['tele_cogmode']
    b9.COGMODEX = record['tele_cogmodex']
    b9.DECAGE = record['tele_decage']
    b9.DECCLBE = record['tele_decclbe']
    b9.BEAPATHY = record['tele_beapathy']
    b9.BEDEP = record['tele_bedep']
    b9.BEVHALL = record['tele_bevhall']
    b9.BEVWELL = record['tele_bevwell']
    b9.BEVHAGO = record['tele_bevhago']
    b9.BEAHALL = record['tele_beahall']
    b9.BEDEL = record['tele_bedel']
    b9.BEDISIN = record['tele_bedisin']
    b9.BEIRRIT = record['tele_beirrit']
    b9.BEAGIT = record['tele_beagit']
    b9.BEPERCH = record['tele_beperch']
    b9.BEREM = record['tele_berem']
    b9.BEREMAGO = record['tele_beremago']
    b9.BEANX = record['tele_beanx']
    b9.BEOTHR = record['tele_beothr']
    b9.BEOTHRX = record['tele_beothrx']
    b9.BEFPRED = record['tele_befpred']
    b9.BEFPREDX = record['tele_befpredx']
    b9.BEMODE = record['tele_bemode']
    b9.BEMODEX = record['tele_bemodex']
    b9.BEAGE = record['tele_beage']
    b9.DECCLMOT = record['tele_decclmot']
    b9.MOGAIT = record['tele_mogait']
    b9.MOFALLS = record['tele_mofalls']
    b9.MOTREM = record['tele_motrem']
    b9.MOSLOW = record['tele_moslow']
    b9.MOFRST = record['tele_mofrst']
    b9.MOMODE = record['tele_momode']
    b9.MOMODEX = record['tele_momodex']
    b9.MOMOPARK = record['tele_momopark']
    b9.PARKAGE = record['tele_parkage']
    b9.MOMOALS = record['tele_momoals']
    b9.ALSAGE = record['tele_alsage']
    b9.MOAGE = record['tele_moage']
    b9.COURSE = record['tele_course']
    b9.FRSTCHG = record['tele_frstchg']
    b9.LBDEVAL = record['tele_lbdeval']
    b9.FTLDEVAL = record['tele_ftldeval']
    packet.append(b9)

    d1 = tfp_forms.FormD1()
    d1.DXMETHOD = record['tele_dxmethod']
    d1.NORMCOG = record['tele_normcog']
    d1.DEMENTED = record['tele_demented']
    d1.AMNDEM = record['tele_amndem']
    d1.PCA = record['tele_pca']
    d1.PPASYN = record['tele_ppasyn']
    d1.PPASYNT = record['tele_ppasynt']
    d1.FTDSYN = record['tele_ftdsyn']
    d1.LBDSYN = record['tele_lbdsyn']
    d1.NAMNDEM = record['tele_namndem']
    d1.MCIAMEM = record['tele_mciamem']
    d1.MCIAPLUS = record['tele_mciaplus']
    d1.MCIAPLAN = record['tele_mciaplan']
    d1.MCIAPATT = record['tele_mciapatt']
    d1.MCIAPEX = record['tele_mciapex']
    d1.MCIAPVIS = record['tele_mciapvis']
    d1.MCINON1 = record['tele_mcinon1']
    d1.MCIN1LAN = record['tele_mcin1lan']
    d1.MCIN1ATT = record['tele_mcin1att']
    d1.MCIN1EX = record['tele_mcin1ex']
    d1.MCIN1VIS = record['tele_mcin1vis']
    d1.MCINON2 = record['tele_mcinon2']
    d1.MCIN2LAN = record['tele_mcin2lan']
    d1.MCIN2ATT = record['tele_mcin2att']
    d1.MCIN2EX = record['tele_mcin2ex']
    d1.MCIN2VIS = record['tele_mcin2vis']
    d1.IMPNOMCI = record['tele_impnomci']
    d1.AMYLPET = record['tele_amylpet']
    d1.AMYLCSF = record['tele_amylcsf']
    d1.FDGAD = record['tele_fdgad']
    d1.HIPPATR = record['tele_hippatr']
    d1.TAUPETAD = record['tele_taupetad']
    d1.CSFTAU = record['tele_csftau']
    d1.FDGFTLD = record['tele_fdgftld']
    d1.TPETFTLD = record['tele_tpetftld']
    d1.MRFTLD = record['tele_mrftld']
    d1.DATSCAN = record['tele_datscan']
    d1.OTHBIOM = record['tele_othbiom']
    d1.OTHBIOMX = record['tele_othbiomx']
    d1.IMAGLINF = record['tele_imaglinf']
    d1.IMAGLAC = record['tele_imaglac']
    d1.IMAGMACH = record['tele_imagmach']
    d1.IMAGMICH = record['tele_imagmich']
    d1.IMAGMWMH = record['tele_imagmwmh']
    d1.IMAGEWMH = record['tele_imagewmh']
    d1.ADMUT = record['tele_admut']
    d1.FTLDMUT = record['tele_ftldmut']
    d1.OTHMUT = record['tele_othmut']
    d1.OTHMUTX = record['tele_othmutx']
    d1.ALZDIS = record['tele_alzdis']
    d1.ALZDISIF = record['tele_alzdisif']
    d1.LBDIS = record['tele_lbdis']
    d1.LBDIF = record['tele_lbdif']
    d1.PARK = record['tele_park']
    d1.MSA = record['tele_msa']
    d1.MSAIF = record['tele_msaif']
    d1.PSP = record['tele_psp']
    d1.PSPIF = record['tele_pspif']
    d1.CORT = record['tele_cort']
    d1.CORTIF = record['tele_cortif']
    d1.FTLDMO = record['tele_ftldmo']
    d1.FTLDMOIF = record['tele_ftldmoif']
    d1.FTLDNOS = record['tele_ftldnos']
    d1.FTLDNOIF = record['tele_ftldnoif']
    d1.FTLDSUBT = record['tele_ftldsubt']
    d1.FTLDSUBX = record['tele_ftldsubx']
    d1.CVD = record['tele_cvd']
    d1.CVDIF = record['tele_cvdif']
    d1.PREVSTK = record['tele_prevstk']
    d1.STROKDEC = record['tele_strokedec']
    d1.STKIMAG = record['tele_stkimag']
    d1.INFNETW = record['tele_infnetw']
    d1.INFWMH = record['tele_infwmh']
    d1.ESSTREM = record['tele_esstrem']
    d1.ESSTREIF = record['tele_esstreif']
    d1.DOWNS = record['tele_downs']
    d1.DOWNSIF = record['tele_downsif']
    d1.HUNT = record['tele_hunt']
    d1.HUNTIF = record['tele_huntif']
    d1.PRION = record['tele_prion']
    d1.PRIONIF = record['tele_prionif']
    d1.BRNINJ = record['tele_brninj']
    d1.BRNINJIF = record['tele_brninjif']
    d1.BRNINCTE = record['tele_brnincte']
    d1.HYCEPH = record['tele_hyceph']
    d1.HYCEPHIF = record['tele_hycephif']
    d1.EPILEP = record['tele_epilep']
    d1.EPILEPIF = record['tele_epilepif']
    d1.NEOP = record['tele_neop']
    d1.NEOPIF = record['tele_neopif']
    d1.NEOPSTAT = record['tele_neopstat']
    d1.HIV = record['tele_hiv']
    d1.HIVIF = record['tele_hivif']
    d1.OTHCOG = record['tele_othcog']
    d1.OTHCOGIF = record['tele_othcogif']
    d1.OTHCOGX = record['tele_othcogx']
    d1.DEP = record['tele_dep']
    d1.DEPIF = record['tele_depif']
    d1.DEPTREAT = record['tele_deptreat']
    d1.BIPOLDX = record['tele_bipoldx']
    d1.BIPOLDIF = record['tele_bipoldif']
    d1.SCHIZOP = record['tele_schizop']
    d1.SCHIZOIF = record['tele_schizoif']
    d1.ANXIET = record['tele_anxiet']
    d1.ANXIETIF = record['tele_anxietif']
    d1.DELIR = record['tele_delir']
    d1.DELIRIF = record['tele_delirif']
    d1.PTSDDX = record['tele_ptsddx']
    d1.PTSDDXIF = record['tele_ptsddxif']
    d1.OTHPSY = record['tele_othpsy']
    d1.OTHPSYIF = record['tele_othpsyif']
    d1.OTHPSYX = record['tele_othpsyx']
    d1.ALCDEM = record['tele_alcdem']
    d1.ALCDEMIF = record['tele_alcdemif']
    d1.ALCABUSE = record['tele_alcabuse']
    d1.IMPSUB = record['tele_impsub']
    d1.IMPSUBIF = record['tele_impsubif']
    d1.DYSILL = record['tele_dysill']
    d1.DYSILLIF = record['tele_dysillif']
    d1.MEDS = record['tele_meds']
    d1.MEDSIF = record['tele_medsif']
    d1.COGOTH = record['tele_cogoth']
    d1.COGOTHIF = record['tele_cogothif']
    d1.COGOTHX = record['tele_cogothx']
    d1.COGOTH2 = record['tele_cogoth2']
    d1.COGOTH2F = record['tele_cogoth2f']
    d1.COGOTH2X = record['tele_cogoth2x']
    d1.COGOTH3 = record['tele_cogoth3']
    d1.COGOTH3F = record['tele_cogoth3f']
    d1.COGOTH3X = record['tele_cogoth3x']
    packet.append(d1)

    d2 = tfp_forms.FormD2()
    d2.CANCER = record['tele_cancer']
    d2.CANCSITE = record['tele_cancsite']
    d2.DIABET = record['tele_diabet']
    d2.MYOINF = record['tele_myoinf']
    d2.CONGHRT = record['tele_conghrt']
    d2.AFIBRILL = record['tele_afibrill']
    d2.HYPERT = record['tele_hypert']
    d2.ANGINA = record['tele_angina']
    d2.HYPCHOL = record['tele_hypchol']
    d2.VB12DEF = record['tele_vb12def']
    d2.THYDIS = record['tele_thydis']
    d2.ARTH = record['tele_arth']
    d2.ARTYPE = record['tele_artype']
    d2.ARTYPEX = record['tele_artypex']
    d2.ARTUPEX = record['tele_artupex']
    d2.ARTLOEX = record['tele_artloex']
    d2.ARTSPIN = record['tele_artspin']
    d2.ARTUNKN = record['tele_artunkn']
    d2.URINEINC = record['tele_urineinc']
    d2.BOWLINC = record['tele_bowlinc']
    d2.SLEEPAP = record['tele_sleepap']
    d2.REMDIS = record['tele_remdis']
    d2.HYPOSOM = record['tele_hyposom']
    d2.SLEEPOTH = record['tele_sleepoth']
    d2.SLEEPOTX = record['tele_sleepotx']
    d2.ANGIOCP = record['tele_angiocp']
    d2.ANGIOPCI = record['tele_angiopci']
    d2.PACEMAKE = record['tele_pacemake']
    d2.HVALVE = record['tele_hvalve']
    d2.ANTIENC = record['tele_antienc']
    d2.ANTIENCX = record['tele_antiencx']
    d2.OTHCOND = record['tele_othcond']
    d2.OTHCONDX = record['tele_othcondx']
    packet.append(d2)

    update_header(record, packet)
    return packet
Exemplo n.º 25
0
def build_uds3_fvp_form(record):
    """ Converts REDCap CSV data into a packet (list of FVP Form objects) """
    packet = fvp_packet.Packet()

    #Set up the forms.
    a1 = fvp_forms.FormA1()
    a1.BIRTHMO = record['fu_birthmo']
    a1.BIRTHYR = record['fu_birthyr']
    a1.MARISTAT = record['fu_maristat']
    a1.SEX = record['fu_sex']
    a1.LIVSITUA = record['fu_livsitua']
    a1.INDEPEND = record['fu_independ']
    a1.RESIDENC = record['fu_residenc']
    a1.ZIP = record['fu_zip']
    packet.append(a1)

    a2 = fvp_forms.FormA2()
    a2.INBIRMO = record['fu_inbirmo']
    a2.INBIRYR = record['fu_inbiryr']
    a2.INSEX = record['fu_insex']
    a2.NEWINF = record['fu_newinf']
    a2.INHISP = record['fu_inhisp']
    a2.INHISPOR = record['fu_inhispor']
    a2.INHISPOX = record['fu_inhispox']
    a2.INRACE = record['fu_inrace']
    a2.INRACEX = record['fu_inracex']
    a2.INRASEC = record['fu_inrasec']
    a2.INRASECX = record['fu_inrasecx']
    a2.INRATER = record['fu_inrater']
    a2.INRATERX = record['fu_inraterx']
    a2.INEDUC = record['fu_ineduc']
    a2.INRELTO = record['fu_inrelto']
    a2.INKNOWN = record['fu_inknown']
    a2.INLIVWTH = record['fu_inlivwth']
    a2.INVISITS = record['fu_invisits']
    a2.INCALLS = record['fu_incalls']
    a2.INRELY = record['fu_inrely']
    packet.append(a2)

    a3 = fvp_forms.FormA3()
    a3.NWINFMUT = record['fu_nwinfmut']
    a3.FADMUT = record['fu_fadmut']
    a3.FADMUTX = record['fu_fadmutx']
    a3.FADMUSO = record['fu_fadmuso']
    a3.FADMUSOX = record['fu_fadmusox']
    a3.FFTDMUT = record['fu_fftdmut']
    a3.FFTDMUTX = record['fu_fftdmutx']
    a3.FFTDMUSO = record['fu_fftdmuso']
    a3.FFTDMUSX = record['fu_fftdmusx']
    a3.FOTHMUT = record['fu_fothmut']
    a3.FOTHMUTX = record['fu_fothmutx']
    a3.FOTHMUSO = record['fu_fothmuso']
    a3.FOTHMUSX = record['fu_fothmusx']
    a3.NWINFPAR = record['fu_nwinfpar']
    a3.MOMMOB = record['fu_mommob']
    a3.MOMYOB = record['fu_momyob']
    a3.MOMDAGE = record['fu_momdage']
    a3.MOMNEUR = record['fu_momneur']
    a3.MOMPRDX = record['fu_momprdx']
    a3.MOMMOE = record['fu_mommoe']
    a3.MOMAGEO = record['fu_momageo']
    a3.DADMOB = record['fu_dadmob']
    a3.DADYOB = record['fu_dadyob']
    a3.DADDAGE = record['fu_daddage']
    a3.DADNEUR = record['fu_dadneur']
    a3.DADPRDX = record['fu_dadprdx']
    a3.DADMOE = record['fu_dadmoe']
    a3.DADAGEO = record['fu_dadageo']
    a3.SIBS = record['fu_sibs']
    a3.NWINFSIB = record['fu_nwinfsib']
    a3.SIB1MOB = record['fu_sib1mob']
    a3.SIB1YOB = record['fu_sib1yob']
    a3.SIB1AGD = record['fu_sib1agd']
    a3.SIB1NEU = record['fu_sib1neu']
    a3.SIB1PDX = record['fu_sib1pdx']
    a3.SIB1MOE = record['fu_sib1moe']
    a3.SIB1AGO = record['fu_sib1ago']
    a3.SIB2MOB = record['fu_sib2mob']
    a3.SIB2YOB = record['fu_sib2yob']
    a3.SIB2AGD = record['fu_sib2agd']
    a3.SIB2NEU = record['fu_sib2neu']
    a3.SIB2PDX = record['fu_sib2pdx']
    a3.SIB2MOE = record['fu_sib2moe']
    a3.SIB2AGO = record['fu_sib2ago']
    a3.SIB3MOB = record['fu_sib3mob']
    a3.SIB3YOB = record['fu_sib3yob']
    a3.SIB3AGD = record['fu_sib3agd']
    a3.SIB3NEU = record['fu_sib3neu']
    a3.SIB3PDX = record['fu_sib3pdx']
    a3.SIB3MOE = record['fu_sib3moe']
    a3.SIB3AGO = record['fu_sib3ago']
    a3.SIB4MOB = record['fu_sib4mob']
    a3.SIB4YOB = record['fu_sib4yob']
    a3.SIB4AGD = record['fu_sib4agd']
    a3.SIB4NEU = record['fu_sib4neu']
    a3.SIB4PDX = record['fu_sib4pdx']
    a3.SIB4MOE = record['fu_sib4moe']
    a3.SIB4AGO = record['fu_sib4ago']
    a3.SIB5MOB = record['fu_sib5mob']
    a3.SIB5YOB = record['fu_sib5yob']
    a3.SIB5AGD = record['fu_sib5agd']
    a3.SIB5NEU = record['fu_sib5neu']
    a3.SIB5PDX = record['fu_sib5pdx']
    a3.SIB5MOE = record['fu_sib5moe']
    a3.SIB5AGO = record['fu_sib5ago']
    a3.SIB6MOB = record['fu_sib6mob']
    a3.SIB6YOB = record['fu_sib6yob']
    a3.SIB6AGD = record['fu_sib6agd']
    a3.SIB6NEU = record['fu_sib6neu']
    a3.SIB6PDX = record['fu_sib6pdx']
    a3.SIB6MOE = record['fu_sib6moe']
    a3.SIB6AGO = record['fu_sib6ago']
    a3.SIB7MOB = record['fu_sib7mob']
    a3.SIB7YOB = record['fu_sib7yob']
    a3.SIB7AGD = record['fu_sib7agd']
    a3.SIB7NEU = record['fu_sib7neu']
    a3.SIB7PDX = record['fu_sib7pdx']
    a3.SIB7MOE = record['fu_sib7moe']
    a3.SIB7AGO = record['fu_sib7ago']
    a3.SIB8MOB = record['fu_sib8mob']
    a3.SIB8YOB = record['fu_sib8yob']
    a3.SIB8AGD = record['fu_sib8agd']
    a3.SIB8NEU = record['fu_sib8neu']
    a3.SIB8PDX = record['fu_sib8pdx']
    a3.SIB8MOE = record['fu_sib8moe']
    a3.SIB8AGO = record['fu_sib8ago']
    a3.SIB9MOB = record['fu_sib9mob']
    a3.SIB9YOB = record['fu_sib9yob']
    a3.SIB9AGD = record['fu_sib9agd']
    a3.SIB9NEU = record['fu_sib9neu']
    a3.SIB9PDX = record['fu_sib9pdx']
    a3.SIB9MOE = record['fu_sib9moe']
    a3.SIB9AGO = record['fu_sib9ago']
    a3.SIB10MOB = record['fu_sib10mob']
    a3.SIB10YOB = record['fu_sib10yob']
    a3.SIB10AGD = record['fu_sib10agd']
    a3.SIB10NEU = record['fu_sib10neu']
    a3.SIB10PDX = record['fu_sib10pdx']
    a3.SIB10MOE = record['fu_sib10moe']
    a3.SIB10AGO = record['fu_sib10ago']
    a3.SIB11MOB = record['fu_sib11mob']
    a3.SIB11YOB = record['fu_sib11yob']
    a3.SIB11AGD = record['fu_sib11agd']
    a3.SIB11NEU = record['fu_sib11neu']
    a3.SIB11PDX = record['fu_sib11pdx']
    a3.SIB11MOE = record['fu_sib11moe']
    a3.SIB11AGO = record['fu_sib11ago']
    a3.SIB12MOB = record['fu_sib12mob']
    a3.SIB12YOB = record['fu_sib12yob']
    a3.SIB12AGD = record['fu_sib12agd']
    a3.SIB12NEU = record['fu_sib12neu']
    a3.SIB12PDX = record['fu_sib12pdx']
    a3.SIB12MOE = record['fu_sib12moe']
    a3.SIB12AGO = record['fu_sib12ago']
    a3.SIB13MOB = record['fu_sib13mob']
    a3.SIB13YOB = record['fu_sib13yob']
    a3.SIB13AGD = record['fu_sib13agd']
    a3.SIB13NEU = record['fu_sib13neu']
    a3.SIB13PDX = record['fu_sib13pdx']
    a3.SIB13MOE = record['fu_sib13moe']
    a3.SIB13AGO = record['fu_sib13ago']
    a3.SIB14MOB = record['fu_sib14mob']
    a3.SIB14YOB = record['fu_sib14yob']
    a3.SIB14AGD = record['fu_sib14agd']
    a3.SIB14NEU = record['fu_sib14neu']
    a3.SIB14PDX = record['fu_sib14pdx']
    a3.SIB14MOE = record['fu_sib14moe']
    a3.SIB14AGO = record['fu_sib14ago']
    a3.SIB15MOB = record['fu_sib15mob']
    a3.SIB15YOB = record['fu_sib15yob']
    a3.SIB15AGD = record['fu_sib15agd']
    a3.SIB15NEU = record['fu_sib15neu']
    a3.SIB15PDX = record['fu_sib15pdx']
    a3.SIB15MOE = record['fu_sib15moe']
    a3.SIB15AGO = record['fu_sib15ago']
    a3.SIB16MOB = record['fu_sib16mob']
    a3.SIB16YOB = record['fu_sib16yob']
    a3.SIB16AGD = record['fu_sib16agd']
    a3.SIB16NEU = record['fu_sib16neu']
    a3.SIB16PDX = record['fu_sib16pdx']
    a3.SIB16MOE = record['fu_sib16moe']
    a3.SIB16AGO = record['fu_sib16ago']
    a3.SIB17MOB = record['fu_sib17mob']
    a3.SIB17YOB = record['fu_sib17yob']
    a3.SIB17AGD = record['fu_sib17agd']
    a3.SIB17NEU = record['fu_sib17neu']
    a3.SIB17PDX = record['fusib17pdx']
    a3.SIB17MOE = record['fu_sib17moe']
    a3.SIB17AGO = record['fu_sib17ago']
    a3.SIB18MOB = record['fu_sib18mob']
    a3.SIB18YOB = record['fu_sib18yob']
    a3.SIB18AGD = record['fu_sib18agd']
    a3.SIB18NEU = record['fu_sib18neu']
    a3.SIB18PDX = record['fu_sib18pdx']
    a3.SIB18MOE = record['fu_sib18moe']
    a3.SIB18AGO = record['fu_sib18ago']
    a3.SIB19MOB = record['fu_sib19mob']
    a3.SIB19YOB = record['fu_sib19yob']
    a3.SIB19AGD = record['fu_sib19agd']
    a3.SIB19NEU = record['fu_sib19neu']
    a3.SIB19PDX = record['fu_sib19pdx']
    a3.SIB19MOE = record['fu_sib19moe']
    a3.SIB19AGO = record['fu_sib19ago']
    a3.SIB20MOB = record['fu_sib20mob']
    a3.SIB20YOB = record['fu_sib20yob']
    a3.SIB20AGD = record['fu_sib20agd']
    a3.SIB20NEU = record['fu_sib20neu']
    a3.SIB20PDX = record['fu_sib20pdx']
    a3.SIB20MOE = record['fu_sib20moe']
    a3.SIB20AGO = record['fu_sib20ago']
    a3.KIDS = record['fu_kids']
    a3.NWINFKID = record['fu_nwinfkid']
    a3.KID1MOB = record['fu_kid1mob']
    a3.KID1YOB = record['fu_kid1yob']
    a3.KID1AGD = record['fu_kid1agd']
    a3.KID1NEU = record['fu_kid1neu']
    a3.KID1PDX = record['fu_kid1pdx']
    a3.KID1MOE = record['fu_kid1moe']
    a3.KID1AGO = record['fu_kid1ago']
    a3.KID2MOB = record['fu_kid2mob']
    a3.KID2YOB = record['fu_kid2yob']
    a3.KID2AGD = record['fu_kid2agd']
    a3.KID2NEU = record['fu_kid2neu']
    a3.KID2PDX = record['fu_kid2pdx']
    a3.KID2MOE = record['fu_kid2moe']
    a3.KID2AGO = record['fu_kid2ago']
    a3.KID3MOB = record['fu_kid3mob']
    a3.KID3YOB = record['fu_kid3yob']
    a3.KID3AGD = record['fu_kid3agd']
    a3.KID3NEU = record['fu_kid3neu']
    a3.KID3PDX = record['fu_kid3pdx']
    a3.KID3MOE = record['fu_kid3moe']
    a3.KID3AGO = record['fu_kid3ago']
    a3.KID4MOB = record['fu_kid4mob']
    a3.KID4YOB = record['fu_kid4yob']
    a3.KID4AGD = record['fu_kid4agd']
    a3.KID4NEU = record['fu_kid4neu']
    a3.KID4PDX = record['fu_kid4pdx']
    a3.KID4MOE = record['fu_kid4moe']
    a3.KID4AGO = record['fu_kid4ago']
    a3.KID5MOB = record['fu_kid5mob']
    a3.KID5YOB = record['fu_kid5yob']
    a3.KID5AGD = record['fu_kid5agd']
    a3.KID5NEU = record['fu_kid5neu']
    a3.KID5PDX = record['fu_kid5pdx']
    a3.KID5MOE = record['fu_kid5moe']
    a3.KID5AGO = record['fu_kid5ago']
    a3.KID6MOB = record['fu_kid6mob']
    a3.KID6YOB = record['fu_kid6yob']
    a3.KID6AGD = record['fu_kid6agd']
    a3.KID6NEU = record['fu_kid6neu']
    a3.KID6PDX = record['fu_kid6pdx']
    a3.KID6MOE = record['fu_kid6moe']
    a3.KID6AGO = record['fu_kid6ago']
    a3.KID7MOB = record['fu_kid7mob']
    a3.KID7YOB = record['fu_kid7yob']
    a3.KID7AGD = record['fu_kid7agd']
    a3.KID7NEU = record['fu_kid7neu']
    a3.KID7PDX = record['fu_kid7pdx']
    a3.KID7MOE = record['fu_kid7moe']
    a3.KID7AGO = record['fu_kid7ago']
    a3.KID8MOB = record['fu_kid8mob']
    a3.KID8YOB = record['fu_kid8yob']
    a3.KID8AGD = record['fu_kid8agd']
    a3.KID8NEU = record['fu_kid8neu']
    a3.KID8PDX = record['fu_kid8pdx']
    a3.KID8MOE = record['fu_kid8moe']
    a3.KID8AGO = record['fu_kid8ago']
    a3.KID9MOB = record['fu_kid9mob']
    a3.KID9YOB = record['fu_kid9yob']
    a3.KID9AGD = record['fukid9agd']
    a3.KID9NEU = record['fu_kid9neu']
    a3.KID9PDX = record['fu_kid9pdx']
    a3.KID9MOE = record['fu_kid9moe']
    a3.KID9AGO = record['fu_kid9ago']
    a3.KID10MOB = record['fu_kid10mob']
    a3.KID10YOB = record['fu_kid10yob']
    a3.KID10AGD = record['fu_kid10agd']
    a3.KID10NEU = record['fu_kid10neu']
    a3.KID10PDX = record['fu_kid10pdx']
    a3.KID10MOE = record['fu_kid10moe']
    a3.KID10AGO = record['fu_kid10ago']
    a3.KID11MOB = record['fu_kid11mob']
    a3.KID11YOB = record['fu_kid11yob']
    a3.KID11AGD = record['fu_kid11agd']
    a3.KID11NEU = record['fu_kid11neu']
    a3.KID11PDX = record['fu_kid11pdx']
    a3.KID11MOE = record['fu_kid11moe']
    a3.KID11AGO = record['fu_kid11ago']
    a3.KID12MOB = record['fu_kid12mob']
    a3.KID12YOB = record['fu_kid12yob']
    a3.KID12AGD = record['fu_kid12agd']
    a3.KID12NEU = record['fu_kid12neu']
    a3.KID12PDX = record['fu_kid12pdx']
    a3.KID12MOE = record['fu_kid12moe']
    a3.KID12AGO = record['fu_kid12ago']
    a3.KID13MOB = record['fu_kid13mob']
    a3.KID13YOB = record['fu_kid13yob']
    a3.KID13AGD = record['fu_kid13agd']
    a3.KID13NEU = record['fu_kid13neu']
    a3.KID13PDX = record['fu_kid13pdx']
    a3.KID13MOE = record['fu_kid13moe']
    a3.KID13AGO = record['fu_kid13ago']
    a3.KID14MOB = record['fu_kid14mob']
    a3.KID14YOB = record['fu_kid14yob']
    a3.KID14AGD = record['fu_kid14agd']
    a3.KID14NEU = record['fu_kid14neu']
    a3.KID14PDX = record['fu_kid14pdx']
    a3.KID14MOE = record['fu_kid14moe']
    a3.KID14AGO = record['fu_kid14ago']
    a3.KID15MOB = record['fu_kid15mob']
    a3.KID15YOB = record['fu_kid15yob']
    a3.KID15AGD = record['fu_kid15agd']
    a3.KID15NEU = record['fu_kid15neu']
    a3.KID15PDX = record['fu_kid15pdx']
    a3.KID15MOE = record['fu_kid15moe']
    a3.KID15AGO = record['fu_kid15ago']
    packet.append(a3)

    # Form A4D and A4G are special in that our REDCap implementation (FVP A4)
    # combines them by asking if the subject is taking any medications (which
    # corresponds to A4G.ANYMEDS), then has 50 fields to specify each
    # medication used, which we turn each one into a FormA4D object.
    a4g = fvp_forms.FormA4G()
    a4g.ANYMEDS = record['fu_anymeds']
    packet.append(a4g)

    for i in range(1, 51):
        key = 'fu_drugid_' + str(i)
        if record[key]:
            a4d = fvp_forms.FormA4D()
            a4d.DRUGID = record[key]
            packet.append(a4d)

    b1 = fvp_forms.FormB1()
    b1.HEIGHT = record['fu_height']
    b1.WEIGHT = record['fu_weight']
    b1.BPSYS = record['fu_bpsys']
    b1.BPDIAS = record['fu_bpdias']
    b1.HRATE = record['fu_hrate']
    b1.VISION = record['fu_vision']
    b1.VISCORR = record['fu_viscorr']
    b1.VISWCORR = record['fu_viswcorr']
    b1.HEARING = record['fu_hearing']
    b1.HEARAID = record['fu_hearaid']
    b1.HEARWAID = record['fu_hearwaid']
    packet.append(b1)

    b4 = fvp_forms.FormB4()
    b4.MEMORY = record['fu_memory']
    b4.ORIENT = record['fu_orient']
    b4.JUDGMENT = record['fu_judgment']
    b4.COMMUN = record['fu_commun']
    b4.HOMEHOBB = record['fu_homehobb']
    b4.PERSCARE = record['fu_perscare']
    b4.CDRSUM = record['fu_cdrsum']
    b4.CDRGLOB = record['fu_cdrglob']
    b4.COMPORT = record['fu_comport']
    b4.CDRLANG = record['fu_cdrlang']
    packet.append(b4)

    b5 = fvp_forms.FormB5()
    b5.NPIQINF = record['fu_npiqinf']
    b5.NPIQINFX = record['fu_npiqinfx']
    b5.DEL = record['fu_del']
    b5.DELSEV = record['fu_delsev']
    b5.HALL = record['fu_hall']
    b5.HALLSEV = record['fu_hallsev']
    b5.AGIT = record['fu_agit']
    b5.AGITSEV = record['fu_agitsev']
    b5.DEPD = record['fu_depd']
    b5.DEPDSEV = record['fu_depdsev']
    b5.ANX = record['fu_anx']
    b5.ANXSEV = record['fu_anxsev']
    b5.ELAT = record['fu_elat']
    b5.ELATSEV = record['fu_elatsev']
    b5.APA = record['fu_apa']
    b5.APASEV = record['fu_apasev']
    b5.DISN = record['fu_disn']
    b5.DISNSEV = record['fu_disnsev']
    b5.IRR = record['fu_irr']
    b5.IRRSEV = record['fu_irrsev']
    b5.MOT = record['fu_mot']
    b5.MOTSEV = record['fu_motsev']
    b5.NITE = record['fu_nite']
    b5.NITESEV = record['fu_nitesev']
    b5.APP = record['fu_app']
    b5.APPSEV = record['fu_appsev']
    packet.append(b5)

    b6 = fvp_forms.FormB6()
    b6.NOGDS = record['fu_nogds']
    b6.SATIS = record['fu_satis']
    b6.DROPACT = record['fu_dropact']
    b6.EMPTY = record['fu_empty']
    b6.BORED = record['fu_bored']
    b6.SPIRITS = record['fu_spirits']
    b6.AFRAID = record['fu_afraid']
    b6.HAPPY = record['fu_happy']
    b6.HELPLESS = record['fu_helpless']
    b6.STAYHOME = record['fu_stayhome']
    b6.MEMPROB = record['fu_memprob']
    b6.WONDRFUL = record['fu_wondrful']
    b6.WRTHLESS = record['fu_wrthless']
    b6.ENERGY = record['fu_energy']
    b6.HOPELESS = record['fu_hopeless']
    b6.BETTER = record['fu_better']
    b6.GDS = record['fu_gds']
    packet.append(b6)

    b7 = fvp_forms.FormB7()
    b7.BILLS = record['fu_bills']
    b7.TAXES = record['fu_taxes']
    b7.SHOPPING = record['fu_shopping']
    b7.GAMES = record['fu_games']
    b7.STOVE = record['fu_stove']
    b7.MEALPREP = record['fu_mealprep']
    b7.EVENTS = record['fu_events']
    b7.PAYATTN = record['fu_payattn']
    b7.REMDATES = record['fu_remdates']
    b7.TRAVEL = record['fu_travel']
    packet.append(b7)

    b8 = fvp_forms.FormB8()
    b8.NORMEXAM = record['fu_normexam']
    b8.PARKSIGN = record['fu_parksign']
    b8.RESTTRL = record['fu_resttrl']
    b8.RESTTRR = record['fu_resttrr']
    b8.SLOWINGL = record['fu_slowingl']
    b8.SLOWINGR = record['fu_slowingr']
    b8.RIGIDL = record['fu_rigidl']
    b8.RIGIDR = record['fu_rigidr']
    b8.BRADY = record['fu_brady']
    b8.PARKGAIT = record['fu_parkgait']
    b8.POSTINST = record['fu_postinst']
    b8.CVDSIGNS = record['fu_cvdsigns']
    b8.CORTDEF = record['fu_cortdef']
    b8.SIVDFIND = record['fu_sivdfind']
    b8.CVDMOTL = record['fu_cvdmotl']
    b8.CVDMOTR = record['fu_cvdmotr']
    b8.CORTVISL = record['fu_cortvisl']
    b8.CORTVISR = record['fu_cortvisr']
    b8.SOMATL = record['fu_somatl']
    b8.SOMATR = record['fu_somatr']
    b8.POSTCORT = record['fu_postcort']
    b8.PSPCBS = record['fu_pspcbs']
    b8.EYEPSP = record['fu_eyepsp']
    b8.DYSPSP = record['fu_dyspsp']
    b8.AXIALPSP = record['fu_axialpsp']
    b8.GAITPSP = record['fu_gaitpsp']
    b8.APRAXSP = record['fu_apraxsp']
    b8.APRAXL = record['fu_apraxl']
    b8.APRAXR = record['fu_apraxr']
    b8.CORTSENL = record['fu_cortsenl']
    b8.CORTSENR = record['fu_cortsenr']
    b8.ATAXL = record['fu_ataxl']
    b8.ATAXR = record['fu_ataxr']
    b8.ALIENLML = record['fu_alienlml']
    b8.ALIENLMR = record['fu_alienlmr']
    b8.DYSTONL = record['fu_dystonl']
    b8.DYSTONR = record['fu_dystonr']
    b8.ALSFIND = record['fu_alsfind']
    b8.GAITNPH = record['fu_gaitnph']
    b8.OTHNEUR = record['fu_othneur']
    b8.OTHNEURX = record['fu_othneurx']
    packet.append(b8)

    b9 = fvp_forms.FormB9()
    b9.DECSUB = record['fu_decsub']
    b9.DECIN = record['fu_decin']
    b9.DECCLCOG = record['fu_decclcog']
    b9.COGMEM = record['fu_cogmem']
    b9.COGORI = record['fu_cogori']
    b9.COGJUDG = record['fu_cogjudg']
    b9.COGLANG = record['fu_coglang']
    b9.COGVIS = record['fu_cogvis']
    b9.COGATTN = record['fu_cogattn']
    b9.COGFLUC = record['fu_cogfluc']
    b9.COGFLAGO = record['fu_cogflago']
    b9.COGOTHR = record['fu_cogothr']
    b9.COGOTHRX = record['fu_cogothrx']
    b9.COGFPRED = record['fu_cogfpred']
    b9.COGFPREX = record['fu_cogfprex']
    b9.COGMODE = record['fu_cogmode']
    b9.COGMODEX = record['fu_cogmodex']
    b9.DECAGE = record['fu_decage']
    b9.DECCLBE = record['fu_decclbe']
    b9.BEAPATHY = record['fu_beapathy']
    b9.BEDEP = record['fu_bedep']
    b9.BEVHALL = record['fu_bevhall']
    b9.BEVWELL = record['fu_bevwell']
    b9.BEVHAGO = record['fu_bevhago']
    b9.BEAHALL = record['fu_beahall']
    b9.BEDEL = record['fu_bedel']
    b9.BEDISIN = record['fu_bedisin']
    b9.BEIRRIT = record['fu_beirrit']
    b9.BEAGIT = record['fu_beagit']
    b9.BEPERCH = record['fu_beperch']
    b9.BEREM = record['fu_berem']
    b9.BEREMAGO = record['fu_beremago']
    b9.BEANX = record['fu_beanx']
    b9.BEOTHR = record['fu_beothr']
    b9.BEOTHRX = record['fu_beothrx']
    b9.BEFPRED = record['fu_befpred']
    b9.BEFPREDX = record['fu_befpredx']
    b9.BEMODE = record['fu_bemode']
    b9.BEMODEX = record['fu_bemodex']
    b9.BEAGE = record['fu_beage']
    b9.DECCLMOT = record['fu_decclmot']
    b9.MOGAIT = record['fu_mogait']
    b9.MOFALLS = record['fu_mofalls']
    b9.MOTREM = record['fu_motrem']
    b9.MOSLOW = record['fu_moslow']
    b9.MOFRST = record['fu_mofrst']
    b9.MOMODE = record['fu_momode']
    b9.MOMODEX = record['fu_momodex']
    b9.MOMOPARK = record['fu_momopark']
    b9.PARKAGE = record['fu_parkage']
    b9.MOMOALS = record['fu_momoals']
    b9.ALSAGE = record['fu_alsage']
    b9.MOAGE = record['fu_moage']
    b9.COURSE = record['fu_course']
    b9.FRSTCHG = record['fu_frstchg']
    b9.LBDEVAL = record['fu_lbdeval']
    b9.FTLDEVAL = record['fu_ftldeval']
    packet.append(b9)

    # Among C1 and C2 forms, one must be filled, one must be empty.

    isC1NotBlank = 0
    isC2NotBlank = 0

    if (len(record['fu_mmseloc'].strip()) != 0
            or len(record['fu_cogstat'].strip()) != 0):
        isC1NotBlank = 1

    if (len(record['fu_mocacomp'].strip()) != 0
            or len(record['fu_cogstat_c2'].strip()) != 0):
        isC2NotBlank = 1

    condition = isC1NotBlank + isC2NotBlank

    if (condition != 1):
        ptid = record['ptid']
        message = "Could not parse packet as " + (
            "both" if condition > 1 else "neither") + " c1/c2 forms has data"
        message = message + " for PTID : " + ("unknown" if not ptid else ptid)
        raise Exception(message)

    if (int(isC1NotBlank)):
        add_redcap_C1_alz_C1S(record, packet)
    else:
        addC2(record, packet)

    cls_form = fvp_forms.FormCLS()
    cls_form.APREFLAN = record['eng_preferred_language']
    cls_form.AYRSPAN = record['eng_years_speak_spanish']
    cls_form.AYRENGL = record['eng_years_speak_english']
    cls_form.APCSPAN = record['eng_percentage_spanish']
    cls_form.APCENGL = record['eng_percentage_english']
    cls_form.ASPKSPAN = record['eng_proficiency_spanish']
    cls_form.AREASPAN = record['eng_proficiency_read_spanish']
    cls_form.AWRISPAN = record['eng_proficiency_write_spanish']
    cls_form.AUNDSPAN = record['eng_proficiency_oral_spanish']
    cls_form.ASPKENGL = record['eng_proficiency_speak_english']
    cls_form.AREAENGL = record['eng_proficiency_read_english']
    cls_form.AWRIENGL = record['eng_proficiency_write_english']
    cls_form.AUNDENGL = record['eng_proficiency_oral_english']
    packet.append(cls_form)

    if ['fu_clslang'] == 1:  #Yes, CLS filled out
        if len(record['eng_percentage_spanish'].strip()) == 0:
            pct_spn = 0
        else:
            pct_spn = int(record['eng_percentage_spanish'])

        if len(record['eng_percentage_english'].strip()) == 0:
            pct_eng = 0
        else:
            pct_eng = int(record['eng_percentage_english'])

        post_cls = True
        if (record['visityr'] < '2017') or (record['visityr'] == '2017'
                                            and record['visitmo'] < '6'):
            post_cls = False

        bad_pct = False
        if (pct_eng + pct_spn) != 100:
            bad_pct = True

        if (post_cls and bad_pct):
            ptid = record['ptid']
            message = "Could not parse packet as language proficiency percentages do not equal 100"
            message = message + " for PTID : " + ("unknown"
                                                  if not ptid else ptid)
            raise Exception(message)

        if not post_cls and (pct_spn != 0 or pct_eng != 0):
            ptid = record['ptid']
            message = "Could not parse packet as CLS forms should not be in packets from before June 1, 2017"
            message = message + " for PTID : " + ("unknown"
                                                  if not ptid else ptid)
            raise Exception(message)

    d1 = fvp_forms.FormD1()
    d1.DXMETHOD = record['fu_dxmethod']
    d1.NORMCOG = record['fu_normcog']
    d1.DEMENTED = record['fu_demented']
    d1.AMNDEM = record['fu_amndem']
    d1.PCA = record['fu_pca']
    d1.PPASYN = record['fu_ppasyn']
    d1.PPASYNT = record['fu_ppasynt']
    d1.FTDSYN = record['fu_ftdsyn']
    d1.LBDSYN = record['fu_lbdsyn']
    d1.NAMNDEM = record['fu_namndem']
    d1.MCIAMEM = record['fu_mciamem']
    d1.MCIAPLUS = record['fu_mciaplus']
    d1.MCIAPLAN = record['fu_mciaplan']
    d1.MCIAPATT = record['fu_mciapatt']
    d1.MCIAPEX = record['fu_mciapex']
    d1.MCIAPVIS = record['fu_mciapvis']
    d1.MCINON1 = record['fu_mcinon1']
    d1.MCIN1LAN = record['fu_mcin1lan']
    d1.MCIN1ATT = record['fu_mcin1att']
    d1.MCIN1EX = record['fu_mcin1ex']
    d1.MCIN1VIS = record['fu_mcin1vis']
    d1.MCINON2 = record['fu_mcinon2']
    d1.MCIN2LAN = record['fu_mcin2lan']
    d1.MCIN2ATT = record['fu_mcin2att']
    d1.MCIN2EX = record['fu_mcin2ex']
    d1.MCIN2VIS = record['fu_mcin2vis']
    d1.IMPNOMCI = record['fu_impnomci']
    d1.AMYLPET = record['fu_amylpet']
    d1.AMYLCSF = record['fu_amylcsf']
    d1.FDGAD = record['fu_fdgad']
    d1.HIPPATR = record['fu_hippatr']
    d1.TAUPETAD = record['fu_taupetad']
    d1.CSFTAU = record['fu_csftau']
    d1.FDGFTLD = record['fu_fdgftld']
    d1.TPETFTLD = record['fu_tpetftld']
    d1.MRFTLD = record['fu_mrftld']
    d1.DATSCAN = record['fu_datscan']
    d1.OTHBIOM = record['fu_othbiom']
    d1.OTHBIOMX = record['fu_othbiomx']
    d1.IMAGLINF = record['fu_imaglinf']
    d1.IMAGLAC = record['fu_imaglac']
    d1.IMAGMACH = record['fu_imagmach']
    d1.IMAGMICH = record['fu_imagmich']
    d1.IMAGMWMH = record['fu_imagmwmh']
    d1.IMAGEWMH = record['fu_imagewmh']
    d1.ADMUT = record['fu_admut']
    d1.FTLDMUT = record['fu_ftldmut']
    d1.OTHMUT = record['fu_othmut']
    d1.OTHMUTX = record['fu_othmutx']
    d1.ALZDIS = record['fu_alzdis']
    d1.ALZDISIF = record['fu_alzdisif']
    d1.LBDIS = record['fu_lbdis']
    d1.LBDIF = record['fu_lbdif']
    d1.PARK = record['fu_park']
    d1.MSA = record['fu_msa']
    d1.MSAIF = record['fu_msaif']
    d1.PSP = record['fu_psp']
    d1.PSPIF = record['fu_pspif']
    d1.CORT = record['fu_cort']
    d1.CORTIF = record['fu_cortif']
    d1.FTLDMO = record['fu_ftldmo']
    d1.FTLDMOIF = record['fu_ftldmoif']
    d1.FTLDNOS = record['fu_ftldnos']
    d1.FTLDNOIF = record['fu_ftldnoif']
    d1.FTLDSUBT = record['fu_ftldsubt']
    d1.FTLDSUBX = record['fu_ftldsubx']
    d1.CVD = record['fu_cvd']
    d1.CVDIF = record['fu_cvdif']
    d1.PREVSTK = record['fu_prevstk']
    d1.STROKDEC = record['fu_strokdec']
    d1.STKIMAG = record['fu_stkimag']
    d1.INFNETW = record['fu_infnetw']
    d1.INFWMH = record['fu_infwmh']
    d1.ESSTREM = record['fu_esstrem']
    d1.ESSTREIF = record['fu_esstreif']
    d1.DOWNS = record['fu_downs']
    d1.DOWNSIF = record['fu_downsif']
    d1.HUNT = record['fu_hunt']
    d1.HUNTIF = record['fu_huntif']
    d1.PRION = record['fu_prion']
    d1.PRIONIF = record['fu_prionif']
    d1.BRNINJ = record['fu_brninj']
    d1.BRNINJIF = record['fu_brninjif']
    d1.BRNINCTE = record['fu_brnincte']
    d1.HYCEPH = record['fu_hyceph']
    d1.HYCEPHIF = record['fu_hycephif']
    d1.EPILEP = record['fu_epilep']
    d1.EPILEPIF = record['fu_epilepif']
    d1.NEOP = record['fu_neop']
    d1.NEOPIF = record['fu_neopif']
    d1.NEOPSTAT = record['fu_neopstat']
    d1.HIV = record['fu_hiv']
    d1.HIVIF = record['fu_hivif']
    d1.OTHCOG = record['fu_othcog']
    d1.OTHCOGIF = record['fu_othcogif']
    d1.OTHCOGX = record['fu_othcogx']
    d1.DEP = record['fu_dep']
    d1.DEPIF = record['fu_depif']
    d1.DEPTREAT = record['fu_deptreat']
    d1.BIPOLDX = record['fu_bipoldx']
    d1.BIPOLDIF = record['fu_bipoldif']
    d1.SCHIZOP = record['fu_schizop']
    d1.SCHIZOIF = record['fu_schizoif']
    d1.ANXIET = record['fu_anxiet']
    d1.ANXIETIF = record['fu_anxietif']
    d1.DELIR = record['fu_delir']
    d1.DELIRIF = record['fu_delirif']
    d1.PTSDDX = record['fu_ptsddx']
    d1.PTSDDXIF = record['fu_ptsddxif']
    d1.OTHPSY = record['fu_othpsy']
    d1.OTHPSYIF = record['fu_othpsyif']
    d1.OTHPSYX = record['fu_othpsyx']
    d1.ALCDEM = record['fu_alcdem']
    d1.ALCDEMIF = record['fu_alcdemif']
    d1.ALCABUSE = record['fu_alcabuse']
    d1.IMPSUB = record['fu_impsub']
    d1.IMPSUBIF = record['fu_impsubif']
    d1.DYSILL = record['fu_dysill']
    d1.DYSILLIF = record['fu_dysillif']
    d1.MEDS = record['fu_meds']
    d1.MEDSIF = record['fu_medsif']
    d1.COGOTH = record['fu_cogoth']
    d1.COGOTHIF = record['fu_cogothif']
    d1.COGOTHX = record['fu_cogothx']
    d1.COGOTH2 = record['fu_cogoth2']
    d1.COGOTH2F = record['fu_cogoth2f']
    d1.COGOTH2X = record['fu_cogoth2x']
    d1.COGOTH3 = record['fu_cogoth3']
    d1.COGOTH3F = record['fu_cogoth3f']
    d1.COGOTH3X = record['fu_cogoth3x']
    packet.append(d1)

    d2 = fvp_forms.FormD2()
    d2.CANCER = record['fu_cancer']
    d2.CANCSITE = record['fu_cancsite']
    d2.DIABET = record['fu_diabet']
    d2.MYOINF = record['fu_myoinf']
    d2.CONGHRT = record['fu_conghrt']
    d2.AFIBRILL = record['fu_afibrill']
    d2.HYPERT = record['fu_hypert']
    d2.ANGINA = record['fu_angina']
    d2.HYPCHOL = record['fu_hypchol']
    d2.VB12DEF = record['fu_vb12def']
    d2.THYDIS = record['fu_thydis']
    d2.ARTH = record['fu_arth']
    d2.ARTYPE = record['fu_artype']
    d2.ARTYPEX = record['fu_artypex']
    d2.ARTUPEX = record['fu_artupex']
    d2.ARTLOEX = record['fu_artloex']
    d2.ARTSPIN = record['fu_artspin']
    d2.ARTUNKN = record['fu_artunkn']
    d2.URINEINC = record['fu_urineinc']
    d2.BOWLINC = record['fu_bowlinc']
    d2.SLEEPAP = record['fu_sleepap']
    d2.REMDIS = record['fu_remdis']
    d2.HYPOSOM = record['fu_hyposom']
    d2.SLEEPOTH = record['fu_sleepoth']
    d2.SLEEPOTX = record['fu_sleepotx']
    d2.ANGIOCP = record['fu_angiocp']
    d2.ANGIOPCI = record['fu_angiopci']
    d2.PACEMAKE = record['fu_pacemake']
    d2.HVALVE = record['fu_hvalve']
    d2.ANTIENC = record['fu_antienc']
    d2.ANTIENCX = record['fu_antiencx']
    d2.OTHCOND = record['fu_othcond']
    d2.OTHCONDX = record['fu_othcondx']
    packet.append(d2)

    Z1_has_data = 0

    Z1X_has_data = 0

    if (len(record['fu_a2sub'].strip()) != 0
            or len(record['fu_b7sub'].strip()) != 0):
        Z1_has_data = 1

    if (len(record['fu_a1lang'].strip()) != 0
            or len(record['fu_clssubmitted'].strip()) != 0):
        Z1X_has_data = 1

    condition = Z1X_has_data + Z1_has_data

    if (condition != 1):
        ptid = record['ptid']
        message = "Could not parse packet as " + (
            "both" if condition > 1 else "neither") + " Z1X/Z1 forms has data "
        message = message + "for PTID : " + ("unknown" if not ptid else ptid)
        raise Exception(message)

    if (int(Z1_has_data)):
        addZ1(record, packet)
    else:
        addZ1X(record, packet)

    update_header(record, packet)
    return packet
Exemplo n.º 26
0
def build_uds3_np_form(record):
    packet = np_packet.Packet()
    np = np_forms.FormNP()
    np.NPFORMMO = record['npformmo']
    np.NPFORMDY = record['npformdy']
    np.NPFORMYR = record['npformyr']
    np.NPID = record['npid']
    np.NPSEX = record['npsex']
    np.NPDAGE = record['npdage']
    np.NPDODMO = record['npdodmo']
    np.NPDODDY = record['npdoddy']
    np.NPDODYR = record['npdodyr']
    np.NPPMIH = record['nppmih']
    np.NPFIX = record['npfix']
    np.NPFIXX = record['npfixx']
    np.NPWBRWT = record['npwbrwt']
    np.NPWBRF = record['npwbrf']
    np.NPGRCCA = record['npgrcca']
    np.NPGRLA = record['npgrla']
    np.NPGRHA = record['npgrha']
    np.NPGRSNH = record['npgrsnh']
    np.NPGRLCH = record['npgrlch']
    np.NPAVAS = record['npavas']
    np.NPTAN = record['nptan']
    np.NPTANX = record['nptanx']
    np.NPABAN = record['npaban']
    np.NPABANX = record['npabanx']
    np.NPASAN = record['npasan']
    np.NPASANX = record['npasanx']
    np.NPTDPAN = record['nptdpan']
    np.NPTDPANX = record['nptdpanx']
    np.NPHISMB = record['nphismb']
    np.NPHISG = record['nphisg']
    np.NPHISSS = record['nphisss']
    np.NPHIST = record['nphist']
    np.NPHISO = record['nphiso']
    np.NPHISOX = record['nphisox']
    np.NPTHAL = record['npthal']
    np.NPBRAAK = record['npbraak']
    np.NPNEUR = record['npneur']
    np.NPADNC = record['npadnc']
    np.NPDIFF = record['npdiff']
    np.NPAMY = record['npamy']
    np.NPINF = record['npinf']
    np.NPINF1A = record['npinf1a']
    np.NPINF1B = record['npinf1b']
    np.NPINF1D = record['npinf1d']
    np.NPINF1F = record['npinf1f']
    np.NPINF2A = record['npinf2a']
    np.NPINF2B = record['npinf2b']
    np.NPINF2D = record['npinf2d']
    np.NPINF2F = record['npinf2f']
    np.NPINF3A = record['npinf3a']
    np.NPINF3B = record['npinf3b']
    np.NPINF3D = record['npinf3d']
    np.NPINF3F = record['npinf3f']
    np.NPINF4A = record['npinf4a']
    np.NPINF4B = record['npinf4b']
    np.NPINF4D = record['npinf4d']
    np.NPINF4F = record['npinf4f']
    np.NPHEMO = record['nphemo']
    np.NPHEMO1 = record['nphemo1']
    np.NPHEMO2 = record['nphemo2']
    np.NPHEMO3 = record['nphemo3']
    np.NPOLD = record['npold']
    np.NPOLD1 = record['npold1']
    np.NPOLD2 = record['npold2']
    np.NPOLD3 = record['npold3']
    np.NPOLD4 = record['npold4']
    np.NPOLDD = record['npoldd']
    np.NPOLDD1 = record['npoldd1']
    np.NPOLDD2 = record['npoldd2']
    np.NPOLDD3 = record['npoldd3']
    np.NPOLDD4 = record['npoldd4']
    np.NPARTER = record['nparter']
    np.NPWMR = record['npwmr']
    np.NPPATH = record['nppath']
    np.NPNEC = record['npnec']
    np.NPPATH2 = record['nppath2']
    np.NPPATH3 = record['nppath3']
    np.NPPATH4 = record['nppath4']
    np.NPPATH5 = record['nppath5']
    np.NPPATH6 = record['nppath6']
    np.NPPATH7 = record['nppath7']
    np.NPPATH8 = record['nppath8']
    np.NPPATH9 = record['nppath9']
    np.NPPATH10 = record['nppath10']
    np.NPPATH11 = record['nppath11']
    np.NPPATHO = record['nppatho']
    np.NPPATHOX = record['nppathox']
    np.NPLBOD = record['nplbod']
    np.NPNLOSS = record['npnloss']
    np.NPHIPSCL = record['nphipscl']
    np.NPTDPA = record['nptdpa']
    np.NPTDPB = record['nptdpb']
    np.NPTDPC = record['nptdpc']
    np.NPTDPD = record['nptdpd']
    np.NPTDPE = record['nptdpe']
    np.NPFTDTAU = record['npftdtau']
    np.NPPICK = record['nppick']
    np.NPFTDT2 = record['npftdt2']
    np.NPCORT = record['npcort']
    np.NPPROG = record['npprog']
    np.NPFTDT5 = record['npftdt5']
    np.NPFTDT6 = record['npftdt6']
    np.NPFTDT7 = record['npftdt7']
    np.NPFTDT8 = record['npftdt8']
    np.NPFTDT9 = record['npftdt9']
    np.NPFTDT10 = record['npftdt10']
    np.NPFTDTDP = record['npftdtdp']
    np.NPALSMND = record['npalsmnd']
    np.NPOFTD = record['npoftd']
    np.NPOFTD1 = record['npoftd1']
    np.NPOFTD2 = record['npoftd2']
    np.NPOFTD3 = record['npoftd3']
    np.NPOFTD4 = record['npoftd4']
    np.NPOFTD5 = record['npoftd5']
    np.NPPDXA = record['nppdxa']
    np.NPPDXB = record['nppdxb']
    np.NPPDXC = record['nppdxc']
    np.NPPDXD = record['nppdxd']
    np.NPPDXE = record['nppdxe']
    np.NPPDXF = record['nppdxf']
    np.NPPDXG = record['nppdxg']
    np.NPPDXH = record['nppdxh']
    np.NPPDXI = record['nppdxi']
    np.NPPDXJ = record['nppdxj']
    np.NPPDXK = record['nppdxk']
    np.NPPDXL = record['nppdxl']
    np.NPPDXM = record['nppdxm']
    np.NPPDXN = record['nppdxn']
    np.NPPDXO = record['nppdxo']
    np.NPPDXP = record['nppdxp']
    np.NPPDXQ = record['nppdxq']
    np.NPPDXR = record['nppdxr']
    np.NPPDXRX = record['nppdxrx']
    np.NPPDXS = record['nppdxs']
    np.NPPDXSX = record['nppdxsx']
    np.NPPDXT = record['nppdxt']
    np.NPPDXTX = record['nppdxtx']
    np.NPBNKA = record['npbnka']
    np.NPBNKB = record['npbnkb']
    np.NPBNKC = record['npbnkc']
    np.NPBNKD = record['npbnkd']
    np.NPBNKE = record['npbnke']
    np.NPBNKF = record['npbnkf']
    np.NPBNKG = record['npbnkg']
    np.NPFAUT = record['npfaut']
    np.NPFAUT1 = record['npfaut1']
    np.NPFAUT2 = record['npfaut2']
    np.NPFAUT3 = record['npfaut3']
    np.NPFAUT4 = record['npfaut4']
    packet.append(np)

    update_header(record, packet)
    return packet
Exemplo n.º 27
0
def build_uds3_lbd_fvp_form(record):
    ''' Converts REDCap CSV data into a packet (list of FVP Form objects) '''
    packet = lbd_fvp_packet.Packet()

    # Set up the forms..........

    # This form cannot precede June 1, 2017.
    if not (int(record['visityr']) > 2017) or \
            (int(record['visityr']) == 2017 and int(record['visitmo']) > 6) \
            or (int(record['visityr']) == 2017 and int(record['visitmo']) == 6
                and int(record['visitday']) >= 1):
        raise ValueError('Visit date cannot precede June 1, 2017.')

    B1L = lbd_fvp_forms.FormB1L()
    B1L.LBSSALIV = record['fu_LBSSALIV'.lower()]
    B1L.LBSSWALL = record['fu_lBSSWALL'.lower()]
    B1L.LBSINSeX = record['fu_LBSINSeX'.lower()]
    B1L.LBSPrSeX = record['fu_LBSPrSeX'.lower()]
    B1L.LBSWeIGH = record['fu_LBSWeIGH'.lower()]
    B1L.LBSSMeLL = record['fu_LBSSMeLL'.lower()]
    B1L.LBSSWeAt = record['fu_LBSSWeAT'.lower()]
    B1L.LBStoLCD = record['fu_LBStoLCD'.lower()]
    B1L.LBStoLHt = record['fu_LBStoLHt'.lower()]
    B1L.LBSDBVIS = record['fu_LBSDBVIS'.lower()]
    B1L.LBSCoNSt = record['fu_LBSCoNST'.lower()]
    B1L.LBSHDStL = record['fu_LBSHDStL'.lower()]
    B1L.LBSLSStL = record['fu_LBSLSStL'.lower()]
    B1L.LBSUBLAD = record['fu_LBSUBLAD'.lower()]
    B1L.LBSUStrM = record['fu_LBSUStrM'.lower()]
    B1L.LBSUPASS = record['fu_LBSUPASS'.lower()]
    B1L.LBSDZStU = record['fu_LBSDZStU'.lower()]
    B1L.LBSDZStN = record['fu_LBSDZStN'.lower()]
    B1L.LBSFAINt = record['fu_LBSFAINt'.lower()]
    B1L.LBSPSyM  = record['fu_LBSPSyM'.lower()]
    B1L.LBPSyAGe = record['fu_LBPSyAGe'.lower()]
    B1L.LBSSUPSy = record['fu_LBSSUPSy'.lower()]
    B1L.LBSSUPDI = record['fu_LBSSUPDI'.lower()]
    B1L.LBSSUPHt = record['fu_LBSSUPHt'.lower()]
    B1L.LBSStNSy = record['fu_LBSStNSy'.lower()]
    B1L.LBSStNDI = record['fu_LBSStNDI'.lower()]
    B1L.LBSStNHt = record['fu_LBSStNHt'.lower()]
    B1L.LBSAGerM = record['fu_LBSAGerM'.lower()]
    B1L.LBSAGeSM = record['fu_LBSAGeSM'.lower()]
    B1L.LBSAGeGt = record['fu_LBSAGeGt'.lower()]
    B1L.LBSAGeFL = record['fu_LBSAGeFL'.lower()]
    B1L.LBSAGetr = record['fu_LBSAGetr'.lower()]
    B1L.LBSAGeBr = record['fu_LBSAGeBr'.lower()]
    B1L.LBSSCLAU = record['fu_LBSSCLAU'.lower()]
    B1L.LBSSCLVr = record['fu_LBSSCLVr'.lower()]
    B1L.LBSSCLot = record['fu_LBSSCLot'.lower()]
    B1L.LBSSCor  = record['fu_LBSSCor'.lower()]
    packet.append(B1L)

    B2L = lbd_fvp_forms.FormB2L()
    B2L.LBUDSPCH = record['fu_LBUDSPCH'.lower()]
    B2L.LBUDSALV = record['fu_LBUDSALV'.lower()]
    B2L.LBUDSWAL = record['fu_LBUDSWAL'.lower()]
    B2L.LBUWrIte = record['fu_LBUWrIte'.lower()]
    B2L.LBUDFooD = record['fu_LBUDFooD'.lower()]
    B2L.LBUDreSS = record['fu_LBUDreSS'.lower()]
    B2L.LBUDHyGN = record['fu_LBUDHyGN'.lower()]
    B2L.LBUDtUrN = record['fu_LBUDtUrN'.lower()]
    B2L.LBUDFALL = record['fu_LBUDFALL'.lower()]
    B2L.LBUDFrZ  = record['fu_LBUDFrZ'.lower()]
    B2L.LBUDWALK = record['fu_LBUDWALK'.lower()]
    B2L.LBUDtreM = record['fu_LBUDtreM'.lower()]
    B2L.LBUDSeNS = record['fu_LBUDSeNS'.lower()]
    packet.append(B2L)

    B3L = lbd_fvp_forms.FormB3L()
    B3L.LBUMSPCH = record['fu_LBUMSPCH'.lower()]
    B3L.LBUMSPCX = record['fu_LBUMSPCX'.lower()]
    B3L.LBUMFACe = record['fu_LBUMFACe'.lower()]
    B3L.LBUMFACX = record['fu_LBUMFACX'.lower()]
    B3L.LBUMtrFA = record['fu_LBUMtrFA'.lower()]
    B3L.LBUtrFAX = record['fu_LBUtrFAX'.lower()]
    B3L.LBUMtrrH = record['fu_LBUMtrrH'.lower()]
    B3L.LBUtrrHX = record['fu_LBUtrrHX'.lower()]
    B3L.LBUMtrLH = record['fu_LBUMtrLH'.lower()]
    B3L.LBUtrLHX = record['fu_LBUtrLHX'.lower()]
    B3L.LBUMtrrF = record['fu_LBUMtrrF'.lower()]
    B3L.LBUtrrFX = record['fu_LBUtrrFX'.lower()]
    B3L.LBUMtrLF = record['fu_LBUMtrLF'.lower()]
    B3L.LBUtrLFX = record['fu_LBUtrLFX'.lower()]
    B3L.LBUMAtrH = record['fu_LBUMAtrH'.lower()]
    B3L.LBUAtrHX = record['fu_LBUAtrHX'.lower()]
    B3L.LBUMAtLH = record['fu_LBUMAtLH'.lower()]
    B3L.LBUAtLHX = record['fu_LBUAtLHX'.lower()]
    B3L.LBUMrGNK = record['fu_LBUMrGNK'.lower()]
    B3L.LBUrGNKX = record['fu_LBUrGNKX'.lower()]
    B3L.LBUMrGrU = record['fu_LBUMrGrU'.lower()]
    B3L.LBUrGrUX = record['fu_LBUrGrUX'.lower()]
    B3L.LBUMrGLU = record['fu_LBUMrGLU'.lower()]
    B3L.LBUrGLUX = record['fu_LBUrGLUX'.lower()]
    B3L.LBUMrGrL = record['fu_LBUMrGrL'.lower()]
    B3L.LBUrGrLX = record['fu_LBUrGrLX'.lower()]
    B3L.LBUMrGLL = record['fu_LBUMrGLL'.lower()]
    B3L.LBUrGLLX = record['fu_LBUrGLLX'.lower()]
    B3L.LBUMFtrH = record['fu_LBUMFtrH'.lower()]
    B3L.LBUFtrHX = record['fu_LBUFtrHX'.lower()]
    B3L.LBUMFtLH = record['fu_LBUMFtLH'.lower()]
    B3L.LBUFtLHX = record['fu_LBUFtLHX'.lower()]
    B3L.LBUMHMrH = record['fu_LBUMHMrH'.lower()]
    B3L.LBUHMrHX = record['fu_LBUHMrHX'.lower()]
    B3L.LBUMHMLH = record['fu_LBUMHMLH'.lower()]
    B3L.LBUHMLHX = record['fu_LBUHMLHX'.lower()]
    B3L.LBUMPSrH = record['fu_LBUMPSrH'.lower()]
    B3L.LBUPSrHX = record['fu_LBUPSrHX'.lower()]
    B3L.LBUMPSLH = record['fu_LBUMPSLH'.lower()]
    B3L.LBUPSLHX = record['fu_LBUPSLHX'.lower()]
    B3L.LBUMLGrL = record['fu_LBUMLGrL'.lower()]
    B3L.LBULGrLX = record['fu_LBULGrLX'.lower()]
    B3L.LBUMLGLL = record['fu_LBUMLGLL'.lower()]
    B3L.LBULGLLX = record['fu_LBULGLLX'.lower()]
    B3L.LBUMrISe = record['fu_LBUMrISe'.lower()]
    B3L.LBUMrISX = record['fu_LBUMrISX'.lower()]
    B3L.LBUMPoSt = record['fu_LBUMPoSt'.lower()]
    B3L.LBUMPoSX = record['fu_LBUMPoSX'.lower()]
    B3L.LBUMGAIt = record['fu_LBUMGAIt'.lower()]
    B3L.LBUMGAIX = record['fu_LBUMGAIX'.lower()]
    B3L.LBUPStBL = record['fu_LBUPStBL'.lower()]
    B3L.LBUPStBX = record['fu_LBUPStBX'.lower()]
    B3L.LBUMBrAD = record['fu_LBUMBrAD'.lower()]
    B3L.LBUMBrAX = record['fu_LBUMBrAX'.lower()]
    B3L.LBUMHNyr = record['fu_LBUMHNyr'.lower()]
    B3L.LBUMHNyX = record['fu_LBUMHNyX'.lower()]
    packet.append(B3L)

    B4L = lbd_fvp_forms.FormB4L()
    B4L.LBDeLUS  = record['fu_LBDeLUS'.lower()]
    B4L.LBDHUrt  = record['fu_LBDHUrt'.lower()]
    B4L.LBDSteAL = record['fu_LBDSteAL'.lower()]
    B4L.LBDAFFr  = record['fu_LBDAFFr'.lower()]
    B4L.LBDGUeSt = record['fu_LBDGUeSt'.lower()]
    B4L.LBDIMPoS = record['fu_LBDIMPoS'.lower()]
    B4L.LBDHoMe  = record['fu_LBDHoMe'.lower()]
    B4L.LBDABAND = record['fu_LBDABAND'.lower()]
    B4L.LBDPreS  = record['fu_LBDPreS'.lower()]
    B4L.LBDotHer = record['fu_LBDotHer'.lower()]
    B4L.LBDeLFrQ = record['fu_LBDeLFrQ'.lower()]
    B4L.LBDeLSeV = record['fu_LBDeLSeV'.lower()]
    B4L.LBDeLDSt = record['fu_LBDeLDSt'.lower()]
    B4L.LBHALL   = record['fu_LBHALL'.lower()]
    B4L.LBHVoICe = record['fu_LBHVoICe'.lower()]
    B4L.LBHPeoPL = record['fu_LBHPeoPL'.lower()]
    B4L.LBHNotPr = record['fu_LBHNotPr'.lower()]
    B4L.LBHoDor  = record['fu_LBHoDor'.lower()]
    B4L.LBHFeeL  = record['fu_LBHFeeL'.lower()]
    B4L.LBHtASte = record['fu_LBHtASte'.lower()]
    B4L.LBHotSeN = record['fu_LBHotSeN'.lower()]
    B4L.LBHALFrQ = record['fu_LBHALFrQ'.lower()]
    B4L.LBHALSeV = record['fu_LBHALSeV'.lower()]
    B4L.LBHALDSt = record['fu_LBHALDSt'.lower()]
    B4L.LBANXIet = record['fu_LBANXIet'.lower()]
    B4L.LBANeVNt = record['fu_LBANeVNt'.lower()]
    B4L.LBANreLX = record['fu_LBANreLX'.lower()]
    B4L.LBANBrtH = record['fu_LBANBrtH'.lower()]
    B4L.LBANBUtt = record['fu_LBANBUtt'.lower()]
    B4L.LBANPLAC = record['fu_LBANPLAC'.lower()]
    B4L.LBANSePr = record['fu_LBANSePr'.lower()]
    B4L.LBANotHr = record['fu_LBANotHr'.lower()]
    B4L.LBANXFrQ = record['fu_LBANXFrQ'.lower()]
    B4L.LBANXSeV = record['fu_LBANXSeV'.lower()]
    B4L.LBANXDSt = record['fu_LBANXDSt'.lower()]
    B4L.LBAPAtHy = record['fu_LBAPAtHy'.lower()]
    B4L.LBAPSPNt = record['fu_LBAPSPNt'.lower()]
    B4L.LBAPCoNV = record['fu_LBAPCoNV'.lower()]
    B4L.LBAPAFF  = record['fu_LBAPAFF'.lower()]
    B4L.LBAPCHor = record['fu_LBAPCHor'.lower()]
    B4L.LBAPINt  = record['fu_LBAPINt'.lower()]
    B4L.LBAPFAML = record['fu_LBAPFAML'.lower()]
    B4L.LBAPINtr = record['fu_LBAPINtr'.lower()]
    B4L.LBAPotH  = record['fu_LBAPotH'.lower()]
    B4L.LBAPAFrQ = record['fu_LBAPAFrQ'.lower()]
    B4L.LBAPASeV = record['fu_LBAPASeV'.lower()]
    B4L.LBAPADSt = record['fu_LBAPADSt'.lower()]
    B4L.LBDoPAM  = record['fu_LBDoPAM'.lower()]
    B4L.LBDAGe   = record['fu_LBDAGe'.lower()]
    B4L.LBDDrUG1 = record['fu_LBDDrUG1'.lower()]
    B4L.LBDDoSe1 = record['fu_LBDDoSe1'.lower()]
    B4L.LBDAGe2  = record['fu_LBDAGe2'.lower()]
    B4L.LBDDrUG2 = record['fu_LBDDrUG2'.lower()]
    B4L.LBDDoSe2 = record['fu_LBDDoSe2'.lower()]
    B4L.LBDeLAGe = record['fu_LBDeLAGe'.lower()]
    B4L.LBDeLMeD = record['fu_LBDeLMeD'.lower()]
    B4L.LBDeLMD1 = record['fu_LBDeLMD1'.lower()]
    B4L.LBDeLMD2 = record['fu_LBDeLMD2'.lower()]
    B4L.LBHALAGe = record['fu_LBHALAGe'.lower()]
    B4L.LBHALMeD = record['fu_LBHALMeD'.lower()]
    B4L.LBHALMD1 = record['fu_LBHALMD1'.lower()]
    B4L.LBHALMD2 = record['fu_LBHALMD2'.lower()]
    B4L.LBANXAGe = record['fu_LBANXAGe'.lower()]
    B4L.LBANXMeD = record['fu_LBANXMeD'.lower()]
    B4L.LBANXMD1 = record['fu_LBANXMD1'.lower()]
    B4L.LBANXMD2 = record['fu_LBANXMD2'.lower()]
    B4L.LBAPAAGe = record['fu_LBAPAAGe'.lower()]
    B4L.LBAPAMeD = record['fu_LBAPAMeD'.lower()]
    B4L.LBAPAMD1 = record['fu_LBAPAMD1'.lower()]
    B4L.LBAPAMD2 = record['fu_LBAPAMD2'.lower()]
    packet.append(B4L)

    B5L = lbd_fvp_forms.FormB5L()
    B5L.LBMLtHrG = record['fu_LBMLtHrG'.lower()]
    B5L.LBMSLeeP = record['fu_LBMSLeeP'.lower()]
    B5L.LBMDISrG = record['fu_LBMDISrG'.lower()]
    B5L.LBMStAre = record['fu_LBMStAre'.lower()]
    packet.append(B5L)

    B6L = lbd_fvp_forms.FormB6L()
    B6L.LBSPCGIM = record['fu_LBSPCGIM'.lower()]
    B6L.LBSPDrM  = record['fu_LBSPDrM'.lower()]
    B6L.LBSPyrS  = record['fu_LBSPyrS'.lower()]
    B6L.LBSPMoS  = record['fu_LBSPMoS'.lower()]
    B6L.LBSPINJS = record['fu_LBSPINJS'.lower()]
    B6L.LBSPINJP = record['fu_LBSPINJP'.lower()]
    B6L.LBSPCHAS = record['fu_LBSPCHAS'.lower()]
    B6L.LBSPMoVe = record['fu_LBSPMoVe'.lower()]
    B6L.LBSPLeGS = record['fu_LBSPLeGS'.lower()]
    B6L.LBSPNerV = record['fu_LBSPNerv'.lower()]
    B6L.LBSPUrGL = record['fu_LBSPUrGL'.lower()]
    B6L.LBSPSeNS = record['fu_LBSPSeNS'.lower()]
    B6L.LBSPWorS = record['fu_LBSPWorS'.lower()]
    B6L.LBSPWALK = record['fu_LBSPWALK'.lower()]
    B6L.LBSPAWAK = record['fu_LBSPAWAK'.lower()]
    B6L.LBSPBrtH = record['fu_LBSPBrtH'.lower()]
    B6L.LBSPtrt  = record['fu_LBSPtrt'.lower()]
    B6L.LBSPCrMP = record['fu_LBSPCrMP'.lower()]
    B6L.LBSPALrt = record['fu_LBSPALrt'.lower()]
    packet.append(B6L)

    B7L = lbd_fvp_forms.FormB7L()
    B7L.LBSCLIV  = record['fu_LBSCLIV'.lower()]
    B7L.LBSCSLP  = record['fu_LBSCSLP'.lower()]
    B7L.LBSCBeHV = record['fu_LBSCBeHV'.lower()]
    B7L.LBSCDrM  = record['fu_LBSCDrM'.lower()]
    B7L.LBSCyrS  = record['fu_LBSCyrS'.lower()]
    B7L.LBSCMoS  = record['fu_LBSCMoS'.lower()]
    B7L.LBSCINJS = record['fu_LBSCINJS'.lower()]
    B7L.LBSCINJP = record['fu_LBSCINJP'.lower()]
    B7L.LBSCCHAS = record['fu_LBSCCHAS'.lower()]
    B7L.LBSCMoVe = record['fu_LBSCMoVe'.lower()]
    B7L.LBSCLeGS = record['fu_LBSCLeGS'.lower()]
    B7L.LBSCNerV = record['fu_LBSCNerV'.lower()]
    B7L.LBSCSeNS = record['fu_LBSCSeNS'.lower()]
    B7L.LBSCWorS = record['fu_LBSCWorS'.lower()]
    B7L.LBSCWALK = record['fu_LBSCWALK'.lower()]
    B7L.LBSCAWAK = record['fu_LBSCAWAK'.lower()]
    B7L.LBSCBrtH = record['fu_LBSCBrtH'.lower()]
    B7L.LBSCtrt  = record['fu_LBSCtrt'.lower()]
    B7L.LBSCCrMP = record['fu_LBSCCrMP'.lower()]
    B7L.LBSCALrt = record['fu_LBSCALrt'.lower()]
    packet.append(B7L)

    B8L = lbd_fvp_forms.FormB8L()
    B8L.PACoGIMP = record['fu_PACoGIMP'.lower()]
    B8L.PANSFALL = record['fu_PANSFALL'.lower()]
    B8L.PANSWKoF = record['fu_PANSWKoF'.lower()]
    B8L.PANSLyAW = record['fu_PANSLyAW'.lower()]
    B8L.PANSWKer = record['fu_PANSWKer'.lower()]
    B8L.PANSLttL = record['fu_PANSLttL'.lower()]
    B8L.SCPArAte = record['fu_SCPArAte'.lower()]
    B8L.PADSUNeX = record['fu_PADSUNeX'.lower()]
    B8L.PADSSItP = record['fu_PADSSItP'.lower()]
    B8L.PADSWAtV = record['fu_PADSWAtV'.lower()]
    B8L.PADStALK = record['fu_PADStALK'.lower()]
    B8L.PADSAWDy = record['fu_PADSAWDy'.lower()]
    B8L.PADSFLDy = record['fu_PADSFLDy'.lower()]
    packet.append(B8L)

    B9L = lbd_fvp_forms.FormB9L()
    B9L.CoNSFALL = record['fu_CoNSFALL'.lower()]
    B9L.CoNSWKoF = record['fu_CoNSWKoF'.lower()]
    B9L.CoNSLyAW = record['fu_CoNSLyAW'.lower()]
    B9L.CoNSWKer = record['fu_CoNSWKer'.lower()]
    B9L.CoNSLttL = record['fu_CoNSLttL'.lower()]
    B9L.SCCorAte = record['fu_SCCorAte'.lower()]
    B9L.CoDSUNeX = record['fu_CoDSUNeX'.lower()]
    B9L.CoDSSItP = record['fu_CoDSSItP'.lower()]
    B9L.CoDSWAtV = record['fu_CoDSWAtV'.lower()]
    B9L.CoDStALK = record['fu_CoDStALK'.lower()]
    B9L.CoDSAWDy = record['fu_CoDSAWDy'.lower()]
    B9L.CoDSFLDy = record['fu_CoDSFLDy'.lower()]
    B9L.SCCoFrSt = record['fu_SCCoFrSt'.lower()]
    B9L.SCCoAGeN = record['fu_SCCoAGeN'.lower()]
    B9L.SCCoAGeD = record['fu_SCCoAGeD'.lower()]
    B9L.SCCoCoMP = record['fu_SCCoCoMP'.lower()]
    B9L.SCCoSCVr = record['fu_SCCoSCVr'.lower()]
    B9L.SCCootH  = record['fu_SCCootH'.lower()]
    B9L.SCCoSCor = record['fu_SCCoSCor'.lower()]
    packet.append(B9L)

    C1L = lbd_fvp_forms.FormC1L()
    C1L.LBNSWorD = record['fu_LBNSWorD'.lower()]
    C1L.LBNSCoLr = record['fu_LBNSCoLr'.lower()]
    C1L.LBNSCLWD = record['fu_LBNSCLWD'.lower()]
    C1L.LBNPFACe = record['fu_LBNPFACe'.lower()]
    C1L.LBNPNoIS = record['fu_LBNPNoIS'.lower()]
    C1L.LBNPtCor = record['fu_LBNPtCor'.lower()]
    C1L.LBNPPArD = record['fu_LBNPPArD'.lower()]
    packet.append(C1L)

    D1L = lbd_fvp_forms.FormD1L()
    D1L.LBCDSCoG = record['fu_LBCDSCoG'.lower()]
    D1L.LBCCMeM  = record['fu_LBCCMeM'.lower()]
    D1L.LBCCLANG = record['fu_LBCCLANG'.lower()]
    D1L.LBCCAtt  = record['fu_LBCCAtt'.lower()]
    D1L.LBCCeXDe = record['fu_LBCCeXDe'.lower()]
    D1L.LBCCVIS  = record['fu_LBCCVIS'.lower()]
    D1L.LBCDSMoV = record['fu_LBCDSMoV'.lower()]
    D1L.LBCMBrAD = record['fu_LBCMBrAD'.lower()]
    D1L.LBCMrIGD = record['fu_LBCMrIGD'.lower()]
    D1L.LBCMrtrM = record['fu_LBCMrtrM'.lower()]
    D1L.LBCMPtrM = record['fu_LBCMPtrM'.lower()]
    D1L.LBCMAtrM = record['fu_LBCMAtrM'.lower()]
    D1L.LBCMMyoC = record['fu_LBCMMyoC'.lower()]
    D1L.LBCMGAIt = record['fu_LBCMGAIt'.lower()]
    D1L.LBCMPINS = record['fu_LBCMPINS'.lower()]
    D1L.LBCDSBeV = record['fu_LBCDSBeV'.lower()]
    D1L.LBCBDeP  = record['fu_LBCBDeP'.lower()]
    D1L.LBCBAPA  = record['fu_LBCBAPA'.lower()]
    D1L.LBCBANX  = record['fu_LBCBANX'.lower()]
    D1L.LBCBHALL = record['fu_LBCBHALL'.lower()]
    D1L.LBCBDeL  = record['fu_LBCBDeL'.lower()]
    D1L.LBCDSAUt = record['fu_LBCDSAUt'.lower()]
    D1L.LBCAreM  = record['fu_LBCAreM'.lower()]
    D1L.LBCAAPN  = record['fu_LBCAAPN'.lower()]
    D1L.LBCALGSL = record['fu_LBCALGSL'.lower()]
    D1L.LBCArSLe = record['fu_LBCArSLe'.lower()]
    D1L.LBCADtSL = record['fu_LBCADtSL'.lower()]
    D1L.LBCACGFL = record['fu_LBCACGFL'.lower()]
    D1L.LBCAHyPt = record['fu_LBCAHyPt'.lower()]
    D1L.LBCACoNS = record['fu_LBCACoNS'.lower()]
    D1L.LBCAHyPS = record['fu_LBCAHyPS'.lower()]
    D1L.LBCAFALL = record['fu_LBCAFALL'.lower()]
    D1L.LBCASyNC = record['fu_LBCASyNC'.lower()]
    D1L.LBCASNAP = record['fu_LBCASNAP'.lower()]
    D1L.LBCoGSt  = record['fu_LBCoGSt'.lower()]
    D1L.LBCoGDX  = record['fu_LBCoGDX'.lower()]
    packet.append(D1L)

    E1L = lbd_fvp_forms.FormE1L()
    E1L.LBGNeWGN = record['fu_LBGNeWGN'.lower()]
    E1L.LBGLrrK2 = record['fu_LBGLrrK2'.lower()]
    E1L.LBGLrKiS = record['fu_LBGLrKiS'.lower()]
    E1L.LBGPArK2 = record['fu_LBGPArK2'.lower()]
    E1L.LBGPK2iS = record['fu_LBGPK2iS'.lower()]
    E1L.LBGPArK7 = record['fu_LBGPArK7'.lower()]
    E1L.LBGPK7iS = record['fu_LBGPK7iS'.lower()]
    E1L.LBGPiNK1 = record['fu_LBGPiNK1'.lower()]
    E1L.LBGPNKiS = record['fu_LBGPNKiS'.lower()]
    E1L.LBGSNCA  = record['fu_LBGSNCA'.lower()]
    E1L.LBGSNCiS = record['fu_LBGSNCiS'.lower()]
    E1L.LBGGBA   = record['fu_LBGGBA'.lower()]
    E1L.LBGGBAiS = record['fu_LBGGBAiS'.lower()]
    E1L.LBGotHr  = record['fu_LBGotHr'.lower()]
    E1L.LBGotHiS = record['fu_LBGotHiS'.lower()]
    E1L.LBGotHX  = record['fu_LBGotHX'.lower()]
    packet.append(E1L)

    E2L = lbd_fvp_forms.FormE2L()
    E2L.LBISMrI  = record['fu_LBISMrI'.lower()]
    E2L.LBISMMo  = record['fu_LBISMMo'.lower()]
    E2L.LBISMDy  = record['fu_LBISMDy'.lower()]
    E2L.LBISMyr  = record['fu_LBISMyr'.lower()]
    E2L.LBISMQAV = record['fu_LBISMQAV'.lower()]
    E2L.LBISMHIP = record['fu_LBISMHIP'.lower()]
    E2L.LBISMAVL = record['fu_LBISMAVL'.lower()]
    E2L.LBISMDCM = record['fu_LBISMDCM'.lower()]
    E2L.LBISMFMt = record['fu_LBISMFMt'.lower()]
    E2L.LBISMADN = record['fu_LBISMADN'.lower()]
    E2L.LBISMVer = record['fu_LBISMVer'.lower()]
    E2L.LBISMMAN = record['fu_LBISMMAN'.lower()]
    E2L.LBISMoM  = record['fu_LBISMoM'.lower()]
    E2L.LBISMStr = record['fu_LBISMStr'.lower()]
    E2L.LBISMoS  = record['fu_LBISMoS'.lower()]
    E2L.LBIFPet  = record['fu_LBIFPet'.lower()]
    E2L.LBIFPMo  = record['fu_LBIFPMo'.lower()]
    E2L.LBIFPDy  = record['fu_LBIFPDy'.lower()]
    E2L.LBIFPyr  = record['fu_LBIFPyr'.lower()]
    E2L.LBIFPQAV = record['fu_LBIFPQAV'.lower()]
    E2L.LBIFPoCC = record['fu_LBIFPoCC'.lower()]
    E2L.LBIFPtPP = record['fu_LBIFPtPP'.lower()]
    E2L.LBIFPISL = record['fu_LBIFPISL'.lower()]
    E2L.LBIFPAVL = record['fu_LBIFPAVL'.lower()]
    E2L.LBIFPDCM = record['fu_LBIFPDCM'.lower()]
    E2L.LBIFPFMt = record['fu_LBIFPFMt'.lower()]
    E2L.LBIFPADN = record['fu_LBIFPADN'.lower()]
    E2L.LBIFPVer = record['fu_LBIFPVer'.lower()]
    E2L.LBIFPMAN = record['fu_LBIFPMAN'.lower()]
    E2L.LBIFPoM  = record['fu_LBIFPoM'.lower()]
    E2L.LBIAPet  = record['fu_LBIAPet'.lower()]
    E2L.LBIAPMo  = record['fu_LBIAPMo'.lower()]
    E2L.LBIAPDy  = record['fu_LBIAPDy'.lower()]
    E2L.LBIAPyr  = record['fu_LBIAPyr'.lower()]
    E2L.LBIAPQAV = record['fu_LBIAPQAV'.lower()]
    E2L.LBIAPAVL = record['fu_LBIAPAVL'.lower()]
    E2L.LBIAPDCM = record['fu_LBIAPDCM'.lower()]
    E2L.LBIAPFMt = record['fu_LBIAPFMt'.lower()]
    E2L.LBIAPLIG = record['fu_LBIAPLIG'.lower()]
    E2L.LBIAPoL  = record['fu_LBIAPoL'.lower()]
    E2L.LBIAPADN = record['fu_LBIAPADN'.lower()]
    E2L.LBIAPVer = record['fu_LBIAPVer'.lower()]
    E2L.LBIAPMAN = record['fu_LBIAPMAN'.lower()]
    E2L.LBIAPoM  = record['fu_LBIAPoM'.lower()]
    E2L.LBItPet  = record['fu_LBItPet'.lower()]
    E2L.LBItPMo  = record['fu_LBItPMo'.lower()]
    E2L.LBItPDy  = record['fu_LBItPDy'.lower()]
    E2L.LBItPyr  = record['fu_LBItPyr'.lower()]
    E2L.LBItPQAV = record['fu_LBItPQAV'.lower()]
    E2L.LBItPAVL = record['fu_LBItPAVL'.lower()]
    E2L.LBItPDCM = record['fu_LBItPDCM'.lower()]
    E2L.LBItPFMt = record['fu_LBItPFMt'.lower()]
    E2L.LBItPLIG = record['fu_LBItPLIG'.lower()]
    E2L.LBItPoL  = record['fu_LBItPoL'.lower()]
    E2L.LBItPADN = record['fu_LBItPADN'.lower()]
    E2L.LBItPVer = record['fu_LBItPVer'.lower()]
    E2L.LBItPMAN = record['fu_LBItPMAN'.lower()]
    E2L.LBItPoM  = record['fu_LBItPoM'.lower()]
    E2L.LBIDAtS  = record['fu_LBIDAtS'.lower()]
    E2L.LBIDSMo  = record['fu_LBIDSMo'.lower()]
    E2L.LBIDSDy  = record['fu_LBIDSDy'.lower()]
    E2L.LBIDSyr  = record['fu_LBIDSyr'.lower()]
    E2L.LBIDSQAV = record['fu_LBIDSQAV'.lower()]
    E2L.LBIDSABN = record['fu_LBIDSABN'.lower()]
    packet.append(E2L)

    E3L = lbd_fvp_forms.FormE3L()
    E3L.LBoPoLyS = record['fu_LBoPoLyS'.lower()]
    E3L.LBoPoSMo = record['fu_LBoPoSMo'.lower()]
    E3L.LBoPoSDy = record['fu_LBoPoSDy'.lower()]
    E3L.LBoPoSyr = record['fu_LBoPoSyr'.lower()]
    E3L.LBoPoPoS = record['fu_LBoPoPoS'.lower()]
    E3L.LBoPoAVL = record['fu_LBoPoAVL'.lower()]
    E3L.LBoCMIBG = record['fu_LBoCMIBG'.lower()]
    E3L.LBoCMMo  = record['fu_LBoCMMo'.lower()]
    E3L.LBoCMDy  = record['fu_LBoCMDy'.lower()]
    E3L.LBoCMyr  = record['fu_LBoCMyr'.lower()]
    E3L.LBoCMPoS = record['fu_LBoCMPoS'.lower()]
    E3L.LBoCMAVL = record['fu_LBoCMAVL'.lower()]
    E3L.LBoANoS  = record['fu_LBoANoS'.lower()]
    E3L.LBoANMo  = record['fu_LBoANMo'.lower()]
    E3L.LBoANDy  = record['fu_LBoANDy'.lower()]
    E3L.LBoANyr  = record['fu_LBoANyr'.lower()]
    E3L.LBoANPoS = record['fu_LBoANPoS'.lower()]
    E3L.LBoANAVL = record['fu_LBoANAVL'.lower()]
    E3L.LBoANVer = record['fu_LBoANVer'.lower()]
    E3L.LBoANotH = record['fu_LBoANotH'.lower()]
    E3L.LBoeeG   = record['fu_LBOeeG'.lower()]
    E3L.LBoeGMo  = record['fu_LBoeGMo'.lower()]
    E3L.LBoeGDy  = record['fu_LBoeGDy'.lower()]
    E3L.LBoeGyr  = record['fu_LBoeGyr'.lower()]
    E3L.LBoeGPoS = record['fu_LBoeGPoS'.lower()]
    E3L.LBoeGAVL = record['fu_LBoeGAVL'.lower()]
    E3L.LBoMSLt  = record['fu_LBoMSLt'.lower()]
    E3L.LBoMSMo  = record['fu_LBoMSMo'.lower()]
    E3L.LBoMSDy  = record['fu_LBoMSDy'.lower()]
    E3L.LBoMSyr  = record['fu_LBoMSyr'.lower()]
    E3L.LBoMSPoS = record['fu_LBoMSPoS'.lower()]
    E3L.LBoMSAVL = record['fu_LBoMSAVL'.lower()]
    E3L.LBotILt  = record['fu_LBotILt'.lower()]
    E3L.LBotLMo  = record['fu_LBotLMo'.lower()]
    E3L.LBotLDy  = record['fu_LBotLDY'.lower()]
    E3L.LBotLyr  = record['fu_LBotLyr'.lower()]
    E3L.LBotLPoS = record['fu_LBotLPoS'.lower()]
    E3L.LBotLAVL = record['fu_LBotLAVL'.lower()]
    E3L.LBoQSArt = record['fu_LBoQSArt'.lower()]
    E3L.LBoQSMo  = record['fu_LBoQSMo'.lower()]
    E3L.LBoQSDy  = record['fu_LBoQSDy'.lower()]
    E3L.LBoQSyr  = record['fu_LBoQSyr'.lower()]
    E3L.LBoQSPoS = record['fu_LBoQSPoS'.lower()]
    E3L.LBoSGAVL = record['fu_LBoSGAVL'.lower()]
    E3L.LBotHerM = record['fu_LBotHerM'.lower()]
    E3L.LBotHMo  = record['fu_LBotHMo'.lower()]
    E3L.LBotHDy  = record['fu_LBotHDy'.lower()]
    E3L.LBotHyr  = record['fu_LBotHyr'.lower()]
    E3L.LBotHPoS = record['fu_LBotHPoS'.lower()]
    E3L.LBotHAVL = record['fu_LBotHAVL'.lower()]
    E3L.LBoCGAIt = record['fu_LBoCGAIt'.lower()]
    E3L.LBoCGMo  = record['fu_LBoCGMo'.lower()]
    E3L.LBoCGDy  = record['fu_LBoCGDy'.lower()]
    E3L.LBoCGyr  = record['fu_LBoCGyr'.lower()]
    E3L.LBoCGPoS = record['fu_LBoCGPoS'.lower()]
    E3L.LBoCGAVL = record['fu_LBoCGAVL'.lower()]
    packet.append(E3L)

    update_header(record, packet)
    return packet
Exemplo n.º 28
0
def build_uds3_fvp_form(record):
    """ Converts REDCap CSV data into a packet (list of FVP Form objects) """
    packet = fvp_packet.Packet()

    #Set up the forms.
    a1 = fvp_forms.FormA1()
    a1.BIRTHMO   = record['fu_birthmo']
    a1.BIRTHYR   = record['fu_birthyr']
    a1.MARISTAT  = record['fu_maristat']
    a1.SEX       = record['fu_sex']
    a1.LIVSITUA  = record['fu_livsitua']
    a1.INDEPEND  = record['fu_independ']
    a1.RESIDENC  = record['fu_residenc']
    a1.ZIP       = record['fu_zip']
    packet.append(a1)

    a2 = fvp_forms.FormA2()
    a2.INBIRMO   = record['fu_inbirmo']
    a2.INBIRYR   = record['fu_inbiryr']
    a2.INSEX     = record['fu_insex']
    a2.NEWINF    = record['fu_newinf']
    a2.INHISP    = record['fu_inhisp']
    a2.INHISPOR  = record['fu_inhispor']
    a2.INHISPOX  = record['fu_inhispox']
    a2.INRACE    = record['fu_inrace']
    a2.INRACEX   = record['fu_inracex']
    a2.INRASEC   = record['fu_inrasec']
    a2.INRASECX  = record['fu_inrasecx']
    a2.INRATER   = record['fu_inrater']
    a2.INRATERX  = record['fu_inraterx']
    a2.INEDUC    = record['fu_ineduc']
    a2.INRELTO   = record['fu_inrelto']
    a2.INKNOWN   = record['fu_inknown']
    a2.INLIVWTH  = record['fu_inlivwth']
    a2.INVISITS  = record['fu_invisits']
    a2.INCALLS   = record['fu_incalls']
    a2.INRELY    = record['fu_inrely']
    packet.append(a2)
    
    a3 = fvp_forms.FormA3()
    a3.NWINFMUT  = record['fu_nwinfmut']
    a3.FADMUT    = record['fu_fadmut']
    a3.FADMUTX   = record['fu_fadmutx']
    a3.FADMUSO   = record['fu_fadmuso']
    a3.FADMUSOX  = record['fu_fadmusox']
    a3.FFTDMUT   = record['fu_fftdmut']
    a3.FFTDMUTX  = record['fu_fftdmutx']
    a3.FFTDMUSO  = record['fu_fftdmuso']
    a3.FFTDMUSX  = record['fu_fftdmusx']
    a3.FOTHMUT   = record['fu_fothmut']
    a3.FOTHMUTX  = record['fu_fothmutx']
    a3.FOTHMUSO  = record['fu_fothmuso']
    a3.FOTHMUSX  = record['fu_fothmusx']
    a3.NWINFPAR  = record['fu_nwinfpar']
    a3.MOMMOB    = record['fu_mommob']
    a3.MOMYOB    = record['fu_momyob']
    a3.MOMDAGE   = record['fu_momdage']
    a3.MOMNEUR   = record['fu_momneur']
    a3.MOMPRDX   = record['fu_momprdx']
    a3.MOMMOE    = record['fu_mommoe']
    a3.MOMAGEO   = record['fu_momageo']
    a3.DADMOB    = record['fu_dadmob']
    a3.DADYOB    = record['fu_dadyob']
    a3.DADDAGE   = record['fu_daddage']
    a3.DADNEUR   = record['fu_dadneur']
    a3.DADPRDX   = record['fu_dadprdx']
    a3.DADMOE    = record['fu_dadmoe']
    a3.DADAGEO   = record['fu_dadageo']
    a3.SIBS      = record['fu_sibs']
    a3.NWINFSIB  = record['fu_nwinfsib']
    a3.SIB1MOB   = record['fu_sib1mob']
    a3.SIB1YOB   = record['fu_sib1yob']
    a3.SIB1AGD   = record['fu_sib1agd']
    a3.SIB1NEU   = record['fu_sib1neu']
    a3.SIB1PDX   = record['fu_sib1pdx']
    a3.SIB1MOE   = record['fu_sib1moe']
    a3.SIB1AGO   = record['fu_sib1ago']
    a3.SIB2MOB   = record['fu_sib2mob']
    a3.SIB2YOB   = record['fu_sib2yob']
    a3.SIB2AGD   = record['fu_sib2agd']
    a3.SIB2NEU   = record['fu_sib2neu']
    a3.SIB2PDX   = record['fu_sib2pdx']
    a3.SIB2MOE   = record['fu_sib2moe']
    a3.SIB2AGO   = record['fu_sib2ago']
    a3.SIB3MOB   = record['fu_sib3mob']
    a3.SIB3YOB   = record['fu_sib3yob']
    a3.SIB3AGD   = record['fu_sib3agd']
    a3.SIB3NEU   = record['fu_sib3neu']
    a3.SIB3PDX   = record['fu_sib3pdx']
    a3.SIB3MOE   = record['fu_sib3moe']
    a3.SIB3AGO   = record['fu_sib3ago']
    a3.SIB4MOB   = record['fu_sib4mob']
    a3.SIB4YOB   = record['fu_sib4yob']
    a3.SIB4AGD   = record['fu_sib4agd']
    a3.SIB4NEU   = record['fu_sib4neu']
    a3.SIB4PDX   = record['fu_sib4pdx']
    a3.SIB4MOE   = record['fu_sib4moe']
    a3.SIB4AGO   = record['fu_sib4ago']
    a3.SIB5MOB   = record['fu_sib5mob']
    a3.SIB5YOB   = record['fu_sib5yob']
    a3.SIB5AGD   = record['fu_sib5agd']
    a3.SIB5NEU   = record['fu_sib5neu']
    a3.SIB5PDX   = record['fu_sib5pdx']
    a3.SIB5MOE   = record['fu_sib5moe']
    a3.SIB5AGO   = record['fu_sib5ago']
    a3.SIB6MOB   = record['fu_sib6mob']
    a3.SIB6YOB   = record['fu_sib6yob']
    a3.SIB6AGD   = record['fu_sib6agd']
    a3.SIB6NEU   = record['fu_sib6neu']
    a3.SIB6PDX   = record['fu_sib6pdx']
    a3.SIB6MOE   = record['fu_sib6moe']
    a3.SIB6AGO   = record['fu_sib6ago']
    a3.SIB7MOB   = record['fu_sib7mob']
    a3.SIB7YOB   = record['fu_sib7yob']
    a3.SIB7AGD   = record['fu_sib7agd']
    a3.SIB7NEU   = record['fu_sib7neu']
    a3.SIB7PDX   = record['fu_sib7pdx']
    a3.SIB7MOE   = record['fu_sib7moe']
    a3.SIB7AGO   = record['fu_sib7ago']
    a3.SIB8MOB   = record['fu_sib8mob']
    a3.SIB8YOB   = record['fu_sib8yob']
    a3.SIB8AGD   = record['fu_sib8agd']
    a3.SIB8NEU   = record['fu_sib8neu']
    a3.SIB8PDX   = record['fu_sib8pdx']
    a3.SIB8MOE   = record['fu_sib8moe']
    a3.SIB8AGO   = record['fu_sib8ago']
    a3.SIB9MOB   = record['fu_sib9mob']
    a3.SIB9YOB   = record['fu_sib9yob']
    a3.SIB9AGD   = record['fu_sib9agd']
    a3.SIB9NEU   = record['fu_sib9neu']
    a3.SIB9PDX   = record['fu_sib9pdx']
    a3.SIB9MOE   = record['fu_sib9moe']
    a3.SIB9AGO   = record['fu_sib9ago']
    a3.SIB10MOB  = record['fu_sib10mob']
    a3.SIB10YOB  = record['fu_sib10yob']
    a3.SIB10AGD  = record['fu_sib10agd']
    a3.SIB10NEU  = record['fu_sib10neu']
    a3.SIB10PDX  = record['fu_sib10pdx']
    a3.SIB10MOE  = record['fu_sib10moe']
    a3.SIB10AGO  = record['fu_sib10ago']
    a3.SIB11MOB  = record['fu_sib11mob']
    a3.SIB11YOB  = record['fu_sib11yob']
    a3.SIB11AGD  = record['fu_sib11agd']
    a3.SIB11NEU  = record['fu_sib11neu']
    a3.SIB11PDX  = record['fu_sib11pdx']
    a3.SIB11MOE  = record['fu_sib11moe']
    a3.SIB11AGO  = record['fu_sib11ago']
    a3.SIB12MOB  = record['fu_sib12mob']
    a3.SIB12YOB  = record['fu_sib12yob']
    a3.SIB12AGD  = record['fu_sib12agd']
    a3.SIB12NEU  = record['fu_sib12neu']
    a3.SIB12PDX  = record['fu_sib12pdx']
    a3.SIB12MOE  = record['fu_sib12moe']
    a3.SIB12AGO  = record['fu_sib12ago']
    a3.SIB13MOB  = record['fu_sib13mob']
    a3.SIB13YOB  = record['fu_sib13yob']
    a3.SIB13AGD  = record['fu_sib13agd']
    a3.SIB13NEU  = record['fu_sib13neu']
    a3.SIB13PDX  = record['fu_sib13pdx']
    a3.SIB13MOE  = record['fu_sib13moe']
    a3.SIB13AGO  = record['fu_sib13ago']
    a3.SIB14MOB  = record['fu_sib14mob']
    a3.SIB14YOB  = record['fu_sib14yob']
    a3.SIB14AGD  = record['fu_sib14agd']
    a3.SIB14NEU  = record['fu_sib14neu']
    a3.SIB14PDX  = record['fu_sib14pdx']
    a3.SIB14MOE  = record['fu_sib14moe']
    a3.SIB14AGO  = record['fu_sib14ago']
    a3.SIB15MOB  = record['fu_sib15mob']
    a3.SIB15YOB  = record['fu_sib15yob']
    a3.SIB15AGD  = record['fu_sib15agd']
    a3.SIB15NEU  = record['fu_sib15neu']
    a3.SIB15PDX  = record['fu_sib15pdx']
    a3.SIB15MOE  = record['fu_sib15moe']
    a3.SIB15AGO  = record['fu_sib15ago']
    a3.SIB16MOB  = record['fu_sib16mob']
    a3.SIB16YOB  = record['fu_sib16yob']
    a3.SIB16AGD  = record['fu_sib16agd']
    a3.SIB16NEU  = record['fu_sib16neu']
    a3.SIB16PDX  = record['fu_sib16pdx']
    a3.SIB16MOE  = record['fu_sib16moe']
    a3.SIB16AGO  = record['fu_sib16ago']
    a3.SIB17MOB  = record['fu_sib17mob']
    a3.SIB17YOB  = record['fu_sib17yob']
    a3.SIB17AGD  = record['fu_sib17agd']
    a3.SIB17NEU  = record['fu_sib17neu']
    a3.SIB17PDX  = record['fu_sib17pdx'] #TODO - listed as fusib17pdx
    a3.SIB17MOE  = record['fu_sib17moe']
    a3.SIB17AGO  = record['fu_sib17ago']
    a3.SIB18MOB  = record['fu_sib18mob']
    a3.SIB18YOB  = record['fu_sib18yob']
    a3.SIB18AGD  = record['fu_sib18agd']
    a3.SIB18NEU  = record['fu_sib18neu']
    a3.SIB18PDX  = record['fu_sib18pdx']
    a3.SIB18MOE  = record['fu_sib18moe']
    a3.SIB18AGO  = record['fu_sib18ago']
    a3.SIB19MOB  = record['fu_sib19mob']
    a3.SIB19YOB  = record['fu_sib19yob']
    a3.SIB19AGD  = record['fu_sib19agd']
    a3.SIB19NEU  = record['fu_sib19neu']
    a3.SIB19PDX  = record['fu_sib19pdx']
    a3.SIB19MOE  = record['fu_sib19moe']
    a3.SIB19AGO  = record['fu_sib19ago']
    a3.SIB20MOB  = record['fu_sib20mob']
    a3.SIB20YOB  = record['fu_sib20yob']
    a3.SIB20AGD  = record['fu_sib20agd']
    a3.SIB20NEU  = record['fu_sib20neu']
    a3.SIB20PDX  = record['fu_sib20pdx']
    a3.SIB20MOE  = record['fu_sib20moe']
    a3.SIB20AGO  = record['fu_sib20ago']
    a3.KIDS      = record['fu_kids']
    a3.NWINFKID  = record['fu_nwinfkid']
    a3.KID1MOB   = record['fu_kid1mob']
    a3.KID1YOB   = record['fu_kid1yob']
    a3.KID1AGD   = record['fu_kid1agd']
    a3.KID1NEU   = record['fu_kid1neu']
    a3.KID1PDX   = record['fu_kid1pdx']
    a3.KID1MOE   = record['fu_kid1moe']
    a3.KID1AGO   = record['fu_kid1ago']
    a3.KID2MOB   = record['fu_kid2mob']
    a3.KID2YOB   = record['fu_kid2yob']
    a3.KID2AGD   = record['fu_kid2agd']
    a3.KID2NEU   = record['fu_kid2neu']
    a3.KID2PDX   = record['fu_kid2pdx']
    a3.KID2MOE   = record['fu_kid2moe']
    a3.KID2AGO   = record['fu_kid2ago']
    a3.KID3MOB   = record['fu_kid3mob']
    a3.KID3YOB   = record['fu_kid3yob']
    a3.KID3AGD   = record['fu_kid3agd']
    a3.KID3NEU   = record['fu_kid3neu']
    a3.KID3PDX   = record['fu_kid3pdx']
    a3.KID3MOE   = record['fu_kid3moe']
    a3.KID3AGO   = record['fu_kid3ago']
    a3.KID4MOB   = record['fu_kid4mob']
    a3.KID4YOB   = record['fu_kid4yob']
    a3.KID4AGD   = record['fu_kid4agd']
    a3.KID4NEU   = record['fu_kid4neu']
    a3.KID4PDX   = record['fu_kid4pdx']
    a3.KID4MOE   = record['fu_kid4moe']
    a3.KID4AGO   = record['fu_kid4ago']
    a3.KID5MOB   = record['fu_kid5mob']
    a3.KID5YOB   = record['fu_kid5yob']
    a3.KID5AGD   = record['fu_kid5agd']
    a3.KID5NEU   = record['fu_kid5neu']
    a3.KID5PDX   = record['fu_kid5pdx']
    a3.KID5MOE   = record['fu_kid5moe']
    a3.KID5AGO   = record['fu_kid5ago']
    a3.KID6MOB   = record['fu_kid6mob']
    a3.KID6YOB   = record['fu_kid6yob']
    a3.KID6AGD   = record['fu_kid6agd']
    a3.KID6NEU   = record['fu_kid6neu']
    a3.KID6PDX   = record['fu_kid6pdx']
    a3.KID6MOE   = record['fu_kid6moe']
    a3.KID6AGO   = record['fu_kid6ago']
    a3.KID7MOB   = record['fu_kid7mob']
    a3.KID7YOB   = record['fu_kid7yob']
    a3.KID7AGD   = record['fu_kid7agd']
    a3.KID7NEU   = record['fu_kid7neu']
    a3.KID7PDX   = record['fu_kid7pdx']
    a3.KID7MOE   = record['fu_kid7moe']
    a3.KID7AGO   = record['fu_kid7ago']
    a3.KID8MOB   = record['fu_kid8mob']
    a3.KID8YOB   = record['fu_kid8yob']
    a3.KID8AGD   = record['fu_kid8agd']
    a3.KID8NEU   = record['fu_kid8neu']
    a3.KID8PDX   = record['fu_kid8pdx']
    a3.KID8MOE   = record['fu_kid8moe']
    a3.KID8AGO   = record['fu_kid8ago']
    a3.KID9MOB   = record['fu_kid9mob']
    a3.KID9YOB   = record['fu_kid9yob']
    a3.KID9AGD   = record['fu_kid9agd'] #TODO -> listed as fukid9agd in redcap
    a3.KID9NEU   = record['fu_kid9neu']
    a3.KID9PDX   = record['fu_kid9pdx']
    a3.KID9MOE   = record['fu_kid9moe']
    a3.KID9AGO   = record['fu_kid9ago']
    a3.KID10MOB  = record['fu_kid10mob']
    a3.KID10YOB  = record['fu_kid10yob']
    a3.KID10AGD  = record['fu_kid10agd']
    a3.KID10NEU  = record['fu_kid10neu']
    a3.KID10PDX  = record['fu_kid10pdx']
    a3.KID10MOE  = record['fu_kid10moe']
    a3.KID10AGO  = record['fu_kid10ago']
    a3.KID11MOB  = record['fu_kid11mob']
    a3.KID11YOB  = record['fu_kid11yob']
    a3.KID11AGD  = record['fu_kid11agd']
    a3.KID11NEU  = record['fu_kid11neu']
    a3.KID11PDX  = record['fu_kid11pdx']
    a3.KID11MOE  = record['fu_kid11moe']
    a3.KID11AGO  = record['fu_kid11ago']
    a3.KID12MOB  = record['fu_kid12mob']
    a3.KID12YOB  = record['fu_kid12yob']
    a3.KID12AGD  = record['fu_kid12agd']
    a3.KID12NEU  = record['fu_kid12neu']
    a3.KID12PDX  = record['fu_kid12pdx']
    a3.KID12MOE  = record['fu_kid12moe']
    a3.KID12AGO  = record['fu_kid12ago']
    a3.KID13MOB  = record['fu_kid13mob']
    a3.KID13YOB  = record['fu_kid13yob']
    a3.KID13AGD  = record['fu_kid13agd']
    a3.KID13NEU  = record['fu_kid13neu']
    a3.KID13PDX  = record['fu_kid13pdx']
    a3.KID13MOE  = record['fu_kid13moe']
    a3.KID13AGO  = record['fu_kid13ago']
    a3.KID14MOB  = record['fu_kid14mob']
    a3.KID14YOB  = record['fu_kid14yob']
    a3.KID14AGD  = record['fu_kid14agd']
    a3.KID14NEU  = record['fu_kid14neu']
    a3.KID14PDX  = record['fu_kid14pdx']
    a3.KID14MOE  = record['fu_kid14moe']
    a3.KID14AGO  = record['fu_kid14ago']
    a3.KID15MOB  = record['fu_kid15mob']
    a3.KID15YOB  = record['fu_kid15yob']
    a3.KID15AGD  = record['fu_kid15agd']
    a3.KID15NEU  = record['fu_kid15neu']
    a3.KID15PDX  = record['fu_kid15pdx']
    a3.KID15MOE  = record['fu_kid15moe']
    a3.KID15AGO  = record['fu_kid15ago']
    packet.append(a3)


    a4d = fvp_forms.FormA4D()
    a4d.DRUGID    = record['fu_drugid'] #TODO fu_drugid_1 to fu_drugid_31 are listed but fu_drugid is not present.
    packet.append(a4d)


    a4g = fvp_forms.FormA4G()
    a4g.ANYMEDS   = record['fu_anymeds']
    packet.append(a4g)


    b1 = fvp_forms.FormB1()
    b1.HEIGHT    = record['fu_height']
    b1.WEIGHT    = record['fu_weight']
    b1.BPSYS     = record['fu_bpsys']
    b1.BPDIAS    = record['fu_bpdias']
    b1.HRATE     = record['fu_hrate']
    b1.VISION    = record['fu_vision']
    b1.VISCORR   = record['fu_viscorr']
    b1.VISWCORR  = record['fu_viswcorr']
    b1.HEARING   = record['fu_hearing']
    b1.HEARAID   = record['fu_hearaid']
    b1.HEARWAID  = record['fu_hearwaid']
    packet.append(b1)


    b4 = fvp_forms.FormB4()
    b4.MEMORY    = record['fu_memory']
    b4.ORIENT    = record['fu_orient']
    b4.JUDGMENT  = record['fu_judgment']
    b4.COMMUN    = record['fu_commun']
    b4.HOMEHOBB  = record['fu_homehobb']
    b4.PERSCARE  = record['fu_perscare']
    b4.CDRSUM    = record['fu_cdrsum']
    b4.CDRGLOB   = record['fu_cdrglob']
    b4.COMPORT   = record['fu_comport']
    b4.CDRLANG   = record['fu_cdrlang']
    packet.append(b4)


    b5 = fvp_forms.FormB5()
    b5.NPIQINF   = record['fu_npiqinf']
    b5.NPIQINFX  = record['fu_npiqinfx']
    b5.DEL       = record['fu_del']
    b5.DELSEV    = record['fu_delsev']
    b5.HALL      = record['fu_hall']
    b5.HALLSEV   = record['fu_hallsev']
    b5.AGIT      = record['fu_agit']
    b5.AGITSEV   = record['fu_agitsev']
    b5.DEPD      = record['fu_depd']
    b5.DEPDSEV   = record['fu_depdsev']
    b5.ANX       = record['fu_anx']
    b5.ANXSEV    = record['fu_anxsev']
    b5.ELAT      = record['fu_elat']
    b5.ELATSEV   = record['fu_elatsev']
    b5.APA       = record['fu_apa']
    b5.APASEV    = record['fu_apasev']
    b5.DISN      = record['fu_disn']
    b5.DISNSEV   = record['fu_disnsev']
    b5.IRR       = record['fu_irr']
    b5.IRRSEV    = record['fu_irrsev']
    b5.MOT       = record['fu_mot']
    b5.MOTSEV    = record['fu_motsev']
    b5.NITE      = record['fu_nite']
    b5.NITESEV   = record['fu_nitesev']
    b5.APP       = record['fu_app']
    b5.APPSEV    = record['fu_appsev']
    packet.append(b5)


    b6 = fvp_forms.FormB6()
    b6.NOGDS     = record['fu_nogds']
    b6.SATIS     = record['fu_satis']
    b6.DROPACT   = record['fu_dropact']
    b6.EMPTY     = record['fu_empty']
    b6.BORED     = record['fu_bored']
    b6.SPIRITS   = record['fu_spirits']
    b6.AFRAID    = record['fu_afraid']
    b6.HAPPY     = record['fu_happy']
    b6.HELPLESS  = record['fu_helpless']
    b6.STAYHOME  = record['fu_stayhome']
    b6.MEMPROB   = record['fu_memprob']
    b6.WONDRFUL  = record['fu_wondrful']
    b6.WRTHLESS  = record['fu_wrthless']
    b6.ENERGY    = record['fu_energy']
    b6.HOPELESS  = record['fu_hopeless']
    b6.BETTER    = record['fu_better']
    b6.GDS       = record['fu_gds']
    packet.append(b6)


    b7 = fvp_forms.FormB7()
    b7.BILLS     = record['fu_bills']
    b7.TAXES     = record['fu_taxes']
    b7.SHOPPING  = record['fu_shopping']
    b7.GAMES     = record['fu_games']
    b7.STOVE     = record['fu_stove']
    b7.MEALPREP  = record['fu_mealprep']
    b7.EVENTS    = record['fu_events']
    b7.PAYATTN   = record['fu_payattn']
    b7.REMDATES  = record['fu_remdates']
    b7.TRAVEL    = record['fu_travel']
    packet.append(b7)


    b8 = fvp_forms.FormB8()
    b8.NORMEXAM  = record['fu_normexam']
    b8.PARKSIGN  = record['fu_parksign']
    b8.RESTTRL   = record['fu_resttrl']
    b8.RESTTRR   = record['fu_resttrr']
    b8.SLOWINGL  = record['fu_slowingl']
    b8.SLOWINGR  = record['fu_slowingr']
    b8.RIGIDL    = record['fu_rigidl']
    b8.RIGIDR    = record['fu_rigidr']
    b8.BRADY     = record['fu_brady']
    b8.PARKGAIT  = record['fu_parkgait']
    b8.POSTINST  = record['fu_postinst']
    b8.CVDSIGNS  = record['fu_cvdsigns']
    b8.CORTDEF   = record['fu_cortdef']
    b8.GAITAPRA  = record['fu_gaitapra'] #TODO is this fu_sivdfind (in the same position) ?
    b8.CVDMOTL   = record['fu_cvdmotl']
    b8.CVDMOTR   = record['fu_cvdmotr']
    b8.CORTVISL  = record['fu_cortvisl']
    b8.CORTVISR  = record['fu_cortvisr']
    b8.SOMATL    = record['fu_somatl']
    b8.SOMATR    = record['fu_somatr']
    b8.CVDATAXL  = record['fu_cvdataxl'] #TODO not present
    b8.CVDATAXR  = record['fu_cvdataxr'] #TODO not present
    b8.POSTCORT  = record['fu_postcort']
    b8.PSPCBS    = record['fu_pspcbs']
    b8.EYEPSP    = record['fu_eyepsp']
    b8.DYSPSP    = record['fu_dyspsp']
    b8.AXIALPSP  = record['fu_axialpsp']
    b8.GAITPSP   = record['fu_gaitpsp']
    b8.APRAXSP   = record['fu_apraxsp']
    b8.APRAXL    = record['fu_apraxl']
    b8.APRAXR    = record['fu_apraxr']
    b8.CORTSENL  = record['fu_cortsenl']
    b8.CORTSENR  = record['fu_cortsenr']
    b8.ATAXL     = record['fu_ataxl']
    b8.ATAXR     = record['fu_ataxr']
    b8.ALIENLML  = record['fu_alienlml']
    b8.ALIENLMR  = record['fu_alienlmr']
    b8.DYSTONL   = record['fu_dystonl']
    b8.DYSTONR   = record['fu_dystonr']
    b8.ALSFIND   = record['fu_alsfind']
    b8.GAITNPH   = record['fu_gaitnph']
    b8.OTHNEUR   = record['fu_othneur'] #TODO Typo? fu_otherneur
    b8.OTHNEURX  = record['fu_othneurx'] #TODO Typo? fu_otherneur
    packet.append(b8)


    b9 = fvp_forms.FormB9()
    b9.DECSUB    = record['fu_decsub']
    b9.DECIN     = record['fu_decin']
    b9.DECCLCOG  = record['fu_decclcog']
    b9.COGMEM    = record['fu_cogmem']
    b9.COGORI    = record['fu_cogori']
    b9.COGJUDG   = record['fu_cogjudg']
    b9.COGLANG   = record['fu_coglang']
    b9.COGVIS    = record['fu_cogvis']
    b9.COGATTN   = record['fu_cogattn']
    b9.COGFLUC   = record['fu_cogfluc']
    b9.COGFLAGO  = record['fu_cogflago']
    b9.COGOTHR   = record['fu_cogothr']
    b9.COGOTHRX  = record['fu_cogothrx']
    b9.COGFPRED  = record['fu_cogfpred']
    b9.COGFPREX  = record['fu_cogfprex']
    b9.COGMODE   = record['fu_cogmode']
    b9.COGMODEX  = record['fu_cogmodex']
    b9.DECAGE    = record['fu_decage']
    b9.DECCLBE   = record['fu_decclbe']
    b9.BEAPATHY  = record['fu_beapathy']
    b9.BEDEP     = record['fu_bedep']
    b9.BEVHALL   = record['fu_bevhall']
    b9.BEVWELL   = record['fu_bevwell']
    b9.BEVHAGO   = record['fu_bevhago']
    b9.BEAHALL   = record['fu_beahall']
    b9.BEDEL     = record['fu_bedel']
    b9.BEDISIN   = record['fu_bedisin']
    b9.BEIRRIT   = record['fu_beirrit']
    b9.BEAGIT    = record['fu_beagit']
    b9.BEPERCH   = record['fu_beperch']
    b9.BEREM     = record['fu_berem']
    b9.BEREMAGO  = record['fu_beremago']
    b9.BEANX     = record['fu_beanx']
    b9.BEOTHR    = record['fu_beothr']
    b9.BEOTHRX   = record['fu_beothrx']
    b9.BEFPRED   = record['fu_befpred']
    b9.BEFPREDX  = record['fu_befpredx']
    b9.BEMODE    = record['fu_bemode']
    b9.BEMODEX   = record['fu_bemodex']
    b9.BEAGE     = record['fu_beage']
    b9.DECCLMOT  = record['fu_decclmot']
    b9.MOGAIT    = record['fu_mogait']
    b9.MOFALLS   = record['fu_mofalls']
    b9.MOTREM    = record['fu_motrem']
    b9.MOSLOW    = record['fu_moslow']
    b9.MOFRST    = record['fu_mofrst']
    b9.MOMODE    = record['fu_momode']
    b9.MOMODEX   = record['fu_momodex']
    b9.MOMOPARK  = record['fu_momopark']
    b9.PARKAGE   = record['fu_parkage']
    b9.MOMOALS   = record['fu_momoals']
    b9.ALSAGE    = record['fu_alsage']
    b9.MOAGE     = record['fu_moage']
    b9.COURSE    = record['fu_course']
    b9.FRSTCHG   = record['fu_frstchg']
    b9.LBDEVAL   = record['fu_lbdeval']
    b9.FTLDEVAL  = record['fu_ftldeval']
    packet.append(b9)


    c1 = fvp_forms.FormC1()
    c1.MMSECOMP  = record['fu_mmsecomp']
    c1.MMSEREAS  = record['fu_mmsereas']
    c1.MMSELOC   = record['fu_mmseloc']
    c1.MMSELAN   = record['fu_mmselan']
    c1.MMSELANX  = record['fu_mmselanx']
    c1.MMSEVIS   = record['fu_mmsevis']
    c1.MMSEHEAR  = record['fu_mmsehear']
    c1.MMSEORDA  = record['fu_mmseorda']
    c1.MMSEORLO  = record['fu_mmseorlo']
    c1.PENTAGON  = record['fu_pentagon']
    c1.MMSE      = record['fu_mmse']
    c1.NPSYCLOC  = record['fu_npsycloc']
    c1.NPSYLAN   = record['fu_npsylan']
    c1.NPSYLANX  = record['fu_npsylanx']
    c1.LOGIMO    = record['fu_logimo']
    c1.LOGIPREV  = record['fu_logiprev']
    c1.LOGIMEM   = record['fu_logimem']
    c1.UDSBENTC  = record['fu_udsbentc']
    c1.DIGIF     = record['fu_digif']
    c1.DIGIFLEN  = record['fu_digiflen']
    c1.DIGIB     = record['fu_digib']
    c1.DIGIBLEN  = record['fu_digiblen']
    c1.ANIMALS   = record['fu_animals']
    c1.VEG       = record['fu_veg']
    c1.TRAILA    = record['fu_traila']
    c1.TRAILARR  = record['fu_trailarr']
    c1.TRAILALI  = record['fu_trailali']
    c1.TRAILB    = record['fu_trailb']
    c1.TRAILBRR  = record['fu_trailbrr']
    c1.TRAILBLI  = record['fu_trailbli']
    c1.MEMUNITS  = record['fu_memunits']
    c1.MEMTIME   = record['fu_memtime']
    c1.UDSBENTD  = record['fu_udsbentd']
    c1.UDSBENRS  = record['fu_udsbenrs']
    c1.BOSTON    = record['fu_boston']
    c1.UDSVERFC  = record['fu_udsverfc']
    c1.UDSVERFN  = record['fu_udsverfn']
    c1.UDSVERNF  = record['fu_udsvernf']
    c1.UDSVERLC  = record['fu_udsverlc']
    c1.UDSVERLR  = record['fu_udsverlr']
    c1.UDSVERLN  = record['fu_udsverln']
    c1.UDSVERTN  = record['fu_udsvertn']
    c1.UDSVERTE  = record['fu_udsverte']
    c1.UDSVERTI  = record['fu_udsverti']
    c1.COGSTAT   = record['fu_cogstat']
    packet.append(c1)


    c2 = fvp_forms.FormC2()
    c2.MOCACOMP  = record['fu_mocacomp']
    c2.MOCAREAS  = record['fu_mocareas']
    c2.MOCALOC   = record['fu_mocaloc']
    c2.MOCALAN   = record['fu_mocalan']
    c2.MOCALANX  = record['fu_mocalanx']
    c2.MOCAVIS   = record['fu_mocavis']
    c2.MOCAHEAR  = record['fu_mocahear']
    c2.MOCATOTS  = record['fu_mocatots']
    c2.MOCATRAI  = record['fu_mocatrai']
    c2.MOCACUBE  = record['fu_mocacube']
    c2.MOCACLOC  = record['fu_mocacloc']
    c2.MOCACLON  = record['fu_mocaclon']
    c2.MOCACLOH  = record['fu_mocacloh']
    c2.MOCANAMI  = record['fu_mocanami']
    c2.MOCAREGI  = record['fu_mocaregi']
    c2.MOCADIGI  = record['fu_mocadigi']
    c2.MOCALETT  = record['fu_mocalett']
    c2.MOCASER7  = record['fu_mocaser7']
    c2.MOCAREPE  = record['fu_mocarepe']
    c2.MOCAFLUE  = record['fu_mocaflue']
    c2.MOCAABST  = record['fu_mocaabst']
    c2.MOCARECN  = record['fu_mocarecn']
    c2.MOCARECC  = record['fu_mocarecc']
    c2.MOCARECR  = record['fu_mocarecr']
    c2.MOCAORDT  = record['fu_mocaordt']
    c2.MOCAORMO  = record['fu_mocaormo']
    c2.MOCAORYR  = record['fu_mocaoryr']
    c2.MOCAORDY  = record['fu_mocaordy']
    c2.MOCAORPL  = record['fu_mocaorpl']
    c2.MOCAORCT  = record['fu_mocaorct']
    c2.NPSYCLOC  = record['fu_npsycloc']
    c2.NPSYLAN   = record['fu_npsylan']
    c2.NPSYLANX  = record['fu_npsylanx']
    c2.CRAFTVRS  = record['fu_craftvrs']
    c2.CRAFTURS  = record['fu_crafturs']
    c2.UDSBENTC  = record['fu_udsbentc']
    c2.DIGFORCT  = record['fu_digforct']
    c2.DIGFORSL  = record['fu_digforsl']
    c2.DIGBACCT  = record['fu_digbacct']
    c2.DIGBACLS  = record['fu_digbacls']
    c2.ANIMALS   = record['fu_animals']
    c2.VEG       = record['fu_veg']
    c2.TRAILA    = record['fu_traila']
    c2.TRAILARR  = record['fu_trailarr']
    c2.TRAILALI  = record['fu_trailali']
    c2.TRAILB    = record['fu_trailb']
    c2.TRAILBRR  = record['fu_trailbrr']
    c2.TRAILBLI  = record['fu_trailbli']
    c2.CRAFTDVR  = record['fu_craftdvr']
    c2.CRAFTDRE  = record['fu_craftdre']
    c2.CRAFTDTI  = record['fu_craftdti']
    c2.CRAFTCUE  = record['fu_craftcue']
    c2.UDSBENTD  = record['fu_udsbentd']
    c2.UDSBENRS  = record['fu_udsbenrs']
    c2.MINTTOTS  = record['fu_minttots']
    c2.MINTTOTW  = record['fu_minttotw']
    c2.MINTSCNG  = record['fu_mintscng']
    c2.MINTSCNC  = record['fu_mintscnc']
    c2.MINTPCNG  = record['fu_mintpcng']
    c2.MINTPCNC  = record['fu_mintpcnc']
    c2.UDSVERFC  = record['fu_udsverfc']
    c2.UDSVERFN  = record['fu_udsverfn']
    c2.UDSVERNF  = record['fu_udsvernf']
    c2.UDSVERLC  = record['fu_udsverlc']
    c2.UDSVERLR  = record['fu_udsverlr']
    c2.UDSVERLN  = record['fu_udsverln']
    c2.UDSVERTN  = record['fu_udsvertn']
    c2.UDSVERTE  = record['fu_udsverte']
    c2.UDSVERTI  = record['fu_udsverti']
    c2.COGSTAT   = record['fu_cogstat']
    packet.append(c2)


    d1 = fvp_forms.FormD1()
    d1.DXMETHOD  = record['fu_dxmethod']
    d1.NORMCOG   = record['fu_normcog']
    d1.DEMENTED  = record['fu_demented']
    d1.AMNDEM    = record['fu_amndem']
    d1.PCA       = record['fu_pca']
    d1.PPASYN    = record['fu_ppasyn']
    d1.PPASYNT   = record['fu_ppasynt']
    d1.FTDSYN    = record['fu_ftdsyn']
    d1.LBDSYN    = record['fu_lbdsyn']
    d1.NAMNDEM   = record['fu_namndem']
    d1.MCIAMEM   = record['fu_mciamem']
    d1.MCIAPLUS  = record['fu_mciaplus']
    d1.MCIAPLAN  = record['fu_mciaplan']
    d1.MCIAPATT  = record['fu_mciapatt']
    d1.MCIAPEX   = record['fu_mciapex']
    d1.MCIAPVIS  = record['fu_mciapvis']
    d1.MCINON1   = record['fu_mcinon1']
    d1.MCIN1LAN  = record['fu_mcin1lan']
    d1.MCIN1ATT  = record['fu_mcin1att']
    d1.MCIN1EX   = record['fu_mcin1ex']
    d1.MCIN1VIS  = record['fu_mcin1vis']
    d1.MCINON2   = record['fu_mcinon2']
    d1.MCIN2LAN  = record['fu_mcin2lan']
    d1.MCIN2ATT  = record['fu_mcin2att']
    d1.MCIN2EX   = record['fu_mcin2ex']
    d1.MCIN2VIS  = record['fu_mcin2vis']
    d1.IMPNOMCI  = record['fu_impnomci']
    d1.AMYLPET   = record['fu_amylpet']
    d1.AMYLCSF   = record['fu_amylcsf']
    d1.FDGAD     = record['fu_fdgad']
    d1.HIPPATR   = record['fu_hippatr']
    d1.TAUPETAD  = record['fu_taupetad']
    d1.CSFTAU    = record['fu_csftau']
    d1.FDGFTLD   = record['fu_fdgftld']
    d1.TPETFTLD  = record['fu_tpetftld']
    d1.MRFTLD    = record['fu_mrftld']
    d1.DATSCAN   = record['fu_datscan']
    d1.OTHBIOM   = record['fu_othbiom']
    d1.OTHBIOMX  = record['fu_othbiomx']
    d1.IMAGLINF  = record['fu_imaglinf']
    d1.IMAGLAC   = record['fu_imaglac']
    d1.IMAGMACH  = record['fu_imagmach']
    d1.IMAGMICH  = record['fu_imagmich']
    d1.IMAGMWMH  = record['fu_imagmwmh']
    d1.IMAGEWMH  = record['fu_imagewmh']
    d1.ADMUT     = record['fu_admut']
    d1.FTLDMUT   = record['fu_ftldmut']
    d1.OTHMUT    = record['fu_othmut']
    d1.OTHMUTX   = record['fu_othmutx']
    d1.ALZDIS    = record['fu_alzdis']
    d1.ALZDISIF  = record['fu_alzdisif']
    d1.LBDIS     = record['fu_lbdis']
    d1.LBDIF     = record['fu_lbdif']
    d1.PARK      = record['fu_park']
    d1.MSA       = record['fu_msa']
    d1.MSAIF     = record['fu_msaif']
    d1.PSP       = record['fu_psp']
    d1.PSPIF     = record['fu_pspif']
    d1.CORT      = record['fu_cort']
    d1.CORTIF    = record['fu_cortif']
    d1.FTLDMO    = record['fu_ftldmo']
    d1.FTLDMOIF  = record['fu_ftldmoif']
    d1.FTLDNOS   = record['fu_ftldnos']
    d1.FTLDNOIF  = record['fu_ftldnoif']
    d1.FTLDSUBT  = record['fu_ftldsubt']
    d1.FTLDSUBX  = record['fu_ftldsubx']
    d1.CVD       = record['fu_cvd']
    d1.CVDIF     = record['fu_cvdif']
    d1.PREVSTK   = record['fu_prevstk']
    d1.STROKCOG  = record['fu_strokcog'] #TODO Are both same? fu_strokedec in same position
    d1.STKIMAG   = record['fu_stkimag']
    d1.INFNETW   = record['fu_infnetw']
    d1.INFWMH    = record['fu_infwmh']
    d1.ESSTREM   = record['fu_esstrem']
    d1.ESSTREIF  = record['fu_esstreif']
    d1.DOWNS     = record['fu_downs']
    d1.DOWNSIF   = record['fu_downsif']
    d1.HUNT      = record['fu_hunt']
    d1.HUNTIF    = record['fu_huntif']
    d1.PRION     = record['fu_prion']
    d1.PRIONIF   = record['fu_prionif']
    d1.BRNINJ    = record['fu_brninj']
    d1.BRNINJIF  = record['fu_brninjif']
    d1.BRNINCTE  = record['fu_brnincte']
    d1.HYCEPH    = record['fu_hyceph']
    d1.HYCEPHIF  = record['fu_hycephif']
    d1.EPILEP    = record['fu_epilep']
    d1.EPILEPIF  = record['fu_epilepif']
    d1.NEOP      = record['fu_neop']
    d1.NEOPIF    = record['fu_neopif']
    d1.NEOPSTAT  = record['fu_neopstat']
    d1.HIV       = record['fu_hiv']
    d1.HIVIF     = record['fu_hivif']
    d1.OTHCOG    = record['fu_othcog']
    d1.OTHCOGIF  = record['fu_othcogif']
    d1.OTHCOGX   = record['fu_othcogx']
    d1.DEP       = record['fu_dep']
    d1.DEPIF     = record['fu_depif']
    d1.DEPTREAT  = record['fu_deptreat']
    d1.BIPOLDX   = record['fu_bipoldx']
    d1.BIPOLDIF  = record['fu_bipoldif']
    d1.SCHIZOP   = record['fu_schizop']
    d1.SCHIZOIF  = record['fu_schizoif']
    d1.ANXIET    = record['fu_anxiet']
    d1.ANXIETIF  = record['fu_anxietif']
    d1.DELIR     = record['fu_delir']
    d1.DELIRIF   = record['fu_delirif']
    d1.PTSDDX    = record['fu_ptsddx']
    d1.PTSDDXIF  = record['fu_ptsddxif']
    d1.OTHPSY    = record['fu_othpsy']
    d1.OTHPSYIF  = record['fu_othpsyif']
    d1.OTHPSYX   = record['fu_othpsyx']
    d1.ALCDEM    = record['fu_alcdem']
    d1.ALCDEMIF  = record['fu_alcdemif']
    d1.ALCABUSE  = record['fu_alcabuse']
    d1.IMPSUB    = record['fu_impsub']
    d1.IMPSUBIF  = record['fu_impsubif']
    d1.DYSILL    = record['fu_dysill']
    d1.DYSILLIF  = record['fu_dysillif']
    d1.MEDS      = record['fu_meds']
    d1.MEDSIF    = record['fu_medsif']
    d1.COGOTH    = record['fu_cogoth']
    d1.COGOTHIF  = record['fu_cogothif']
    d1.COGOTHX   = record['fu_cogothx']
    d1.COGOTH2   = record['fu_cogoth2']
    d1.COGOTH2F  = record['fu_cogoth2f']
    d1.COGOTH2X  = record['fu_cogoth2x']
    d1.COGOTH3   = record['fu_cogoth3']
    d1.COGOTH3F  = record['fu_cogoth3f']
    d1.COGOTH3X  = record['fu_cogoth3x']
    packet.append(d1)


    d2 = fvp_forms.FormD2()
    d2.CANCER    = record['fu_cancer']
    d2.CANCSITE  = record['fu_cancsite']
    d2.CANCACT   = record['fu_cancact'] #TODO Not present in redcap form
    d2.DIABET    = record['fu_diabet']
    d2.MYOINF    = record['fu_myoinf']
    d2.CONGHRT   = record['fu_conghrt']
    d2.AFIBRILL  = record['fu_afibrill']
    d2.HYPERT    = record['fu_hypert']
    d2.ANGINA    = record['fu_angina']
    d2.HYPCHOL   = record['fu_hypchol']
    d2.VB12DEF   = record['fu_vb12def']
    d2.THYDIS    = record['fu_thydis']
    d2.ARTH      = record['fu_arth']
    d2.ARTYPE    = record['fu_artype']
    d2.ARTYPEX   = record['fu_artypex']
    d2.ARTUPEX   = record['fu_artupex']
    d2.ARTLOEX   = record['fu_artloex']
    d2.ARTSPIN   = record['fu_artspin']
    d2.ARTUNKN   = record['fu_artunkn']
    d2.URINEINC  = record['fu_urineinc']
    d2.BOWLINC   = record['fu_bowlinc']
    d2.SLEEPAP   = record['fu_sleepap']
    d2.REMDIS    = record['fu_remdis']
    d2.HYPOSOM   = record['fu_hyposom']
    d2.SLEEPOTH  = record['fu_sleepoth']
    d2.SLEEPOTX  = record['fu_sleepotx']
    d2.ANGIOCP   = record['fu_angiocp']
    d2.ANGIOPCI  = record['fu_angiopci']
    d2.PACEMAKE  = record['fu_pacemake']
    d2.HVALVE    = record['fu_hvalve']
    d2.OTHCOND   = record['fu_othcond']
    d2.OTHCONDX  = record['fu_othcondx']
    packet.append(d2)


    z1 = fvp_forms.FormZ1()
    z1.A2SUB     = record['fu_a2sub']
    z1.A2NOT     = record['fu_a2not']
    z1.A2COMM    = record['fu_a2comm']
    z1.A3SUB     = record['fu_a3sub']
    z1.A3NOT     = record['fu_a3not']
    z1.A3COMM    = record['fu_a3comm']
    z1.A4SUB     = record['fu_a4sub']
    z1.A4NOT     = record['fu_a4not']
    z1.A4COMM    = record['fu_a4comm']
    z1.B1SUB     = record['fu_b1sub']
    z1.B1NOT     = record['fu_b1not']
    z1.B1COMM    = record['fu_b1comm']
    z1.B5SUB     = record['fu_b5sub']
    z1.B5NOT     = record['fu_b5not']
    z1.B5COMM    = record['fu_b5comm']
    z1.B6SUB     = record['fu_b6sub']
    z1.B6NOT     = record['fu_b6not']
    z1.B6COMM    = record['fu_b6comm']
    z1.B7SUB     = record['fu_b7sub']
    z1.B7NOT     = record['fu_b7not']
    z1.B7COMM    = record['fu_b7comm']
    packet.append(z1)

    update_header(record, packet)
    return packet