|
|
|
@ -277,7 +277,7 @@ class Parser (Process):
|
|
|
|
|
value = {}
|
|
|
|
|
for row in content[:] :
|
|
|
|
|
|
|
|
|
|
row = util.split(row)
|
|
|
|
|
row = util.split(row.replace('\n','').replace('~',''))
|
|
|
|
|
_info = util.get.config(self.config[_code][0],row)
|
|
|
|
|
|
|
|
|
|
if _info :
|
|
|
|
@ -327,7 +327,8 @@ class Parser (Process):
|
|
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
except Exception as e :
|
|
|
|
|
print ('__',e)
|
|
|
|
|
|
|
|
|
|
print ('__',e.args)
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
return value if value else {}
|
|
|
|
@ -373,8 +374,8 @@ class Parser (Process):
|
|
|
|
|
INITIAL_ROWS = file[:4]
|
|
|
|
|
if len(INITIAL_ROWS) < 3 :
|
|
|
|
|
return None,[{"name":filename,"completed":False}],None
|
|
|
|
|
section = 'CLM' if INITIAL_ROWS[1].split('*')[1] == 'HC' else 'CLP'
|
|
|
|
|
_code = '837' if section == 'CLM' else '835'
|
|
|
|
|
section = 'HL' if INITIAL_ROWS[1].split('*')[1] == 'HC' else 'CLP'
|
|
|
|
|
_code = '837' if section == 'HL' else '835'
|
|
|
|
|
DEFAULT_VALUE = self.get.default_value(INITIAL_ROWS,_code)
|
|
|
|
|
DEFAULT_VALUE['name'] = filename.strip()
|
|
|
|
|
#
|
|
|
|
@ -396,13 +397,13 @@ class Parser (Process):
|
|
|
|
|
#
|
|
|
|
|
# process the segment somewhere (create a thread maybe?)
|
|
|
|
|
#
|
|
|
|
|
default_claim = dict({"index":index},**DEFAULT_VALUE)
|
|
|
|
|
# default_claim = dict({"index":index},**DEFAULT_VALUE)
|
|
|
|
|
_claim = self.apply(segment,_code)
|
|
|
|
|
# if _claim['claim_id'] == 'P1080351470' :
|
|
|
|
|
# print (_claim)
|
|
|
|
|
# _claim = dict(DEFAULT_VALUE,**_claim)
|
|
|
|
|
if _claim :
|
|
|
|
|
_claim['index'] = len(claims)
|
|
|
|
|
_claim['index'] = index #len(claims)
|
|
|
|
|
claims.append(dict(DEFAULT_VALUE,**_claim))
|
|
|
|
|
segment = [row]
|
|
|
|
|
index += 1
|
|
|
|
|