Ejemplo n.º 1
0
def packInfo(record):
    addressKList = []
    name = record[4]
    npi = record[6]
    facilityId = record[0]
    totalPhysicians = record[15]
    if record[7] != None:
        addr = Address(record[7],
                       record[8] + ' ' + record[9],
                       record[10],
                       record[11],
                       record[12],
                       record[14],
                       msg='BillingAddress')
    else:
        addr = None
    addressKList.append(addr)
    conn = npidb.getConnection()
    addrs = npidb.gatFacilityAddress(conn, facilityId)
    for atuple in addrs:
        addressKList.append(
            Address(atuple[0],
                    atuple[1] + " " + atuple[2],
                    atuple[3],
                    atuple[4],
                    atuple[5],
                    msg='FacilityAddress'))
    return (facilityId, name, npi, addressKList, totalPhysicians)
Ejemplo n.º 2
0
    def testSearchAddrOrig(self):
        conn = npidb.getConnection()

        anAddr = Address('2615 NE LOOP 286', '', 'PARIS', 'TX', '75460')
        r = npidb.searchAddrInOrig(conn, anAddr)
        self.assertTrue(len(r) > 0)
        ra = r[0]

        anAddr = Address("601 CHATHAM MEDICAL PARK", "", "ELKIN", "NC",
                         "28621")
        r = npidb.searchAddrInOrig(conn, anAddr)
        self.assertTrue(len(r) == 0)
        print(ra)
Ejemplo n.º 3
0
def packInfo(record):
    addressKList = []
    name = record[4]
    npi = record[6]
    facilityId = record[0]
    if record[7] != None:
        addr = Address(record[7], record[8] + ' ' + record[9], record[10],
                       record[11], record[12], record[14])
    else:
        addr = None
    addressKList.append(addr)
    conn = npidb.getConnection()
    addrs = npidb.gatFacilityAddress(conn, facilityId)
    for atuple in addrs:
        addressKList.append(
            Address(atuple[0], atuple[1] + " " + atuple[2], atuple[3],
                    atuple[4], atuple[5]))
    return (name, npi, addressKList)
Ejemplo n.º 4
0
 def testnpidb2(self):
     l = [('92625', 'CA', 'CORONA DEL MAR')]
     r = npidb.searchNameByMZSC(npidb.getConnection(), l)
     self.assertTrue(len(r) > 0)
     for row in r:
         print(row)
Ejemplo n.º 5
0
 def testnpidb(self):
     r = npidb.fetchBlank(npidb.getConnection(), '', 100)
     self.assertTrue(len(r) > 0)
     self.assertEqual(100, len(r))
     '''
Ejemplo n.º 6
0
 def testConn(self):
     conn = npidb.getConnection()
     self.assertIsNotNone(conn)
     pass
Ejemplo n.º 7
0

def readAddrFrom(row):
    a1 = row[indexs[0] - 1].upper()
    a2 = row[indexs[1] - 1].upper()
    c = row[indexs[2] - 1].upper()
    s = row[indexs[3] - 1].upper()
    z = row[indexs[4] - 1].upper()
    return USMailAddress.Address(a1, a2, c, s, z)


if __name__ == '__main__':
    #vf = open(verifiedFile, 'w');
    #nvf = open(nopassFile, 'w');
    #nvf.write('' + '\n');
    conn = npidb.getConnection()
    lineCount = 0
    with io.open(addressFile, 'r', encoding='utf-8') as csvfile:
        spamreader = csv.reader(csvfile, delimiter=',', quotechar='"')
        statReport = Reporter(spamreader, ['3.1', '3.4'])
        statReport.lineBegin = beginline

        for row in spamreader:

            if spamreader.line_num <= beginline:
                continue
            if spamreader.line_num > endline:
                break
            print(spamreader.line_num, beginline, endline)
            #print (row);
            #print row[indexOfZip - 1], row[indexOfState -1], row[indexOfCity - 1], row[indexOfAddr2 - 1], row[indexOfAddr1 - 1]