docker
Steve L. Nyemba 4 years ago
parent d890f0e6b2
commit a75ed6eb94

@ -367,10 +367,12 @@ class Parser (Process):
try: try:
file = open(filename.strip(),errors='ignore') file = open(filename.strip(),errors='ignore')
INITIAL_ROWS = list(islice(file,4)) #.readlines(4) INITIAL_ROWS = list(islice(file,4)) #.readlines(4)
_code = "unknown"
if len(INITIAL_ROWS) == 1 : if len(INITIAL_ROWS) == 1 :
file = INITIAL_ROWS[0].split('~') file = INITIAL_ROWS[0].split('~')
INITIAL_ROWS = file[:4] 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' section = 'CLM' if INITIAL_ROWS[1].split('*')[1] == 'HC' else 'CLP'
_code = '837' if section == 'CLM' else '835' _code = '837' if section == 'CLM' else '835'
DEFAULT_VALUE = self.get.default_value(INITIAL_ROWS,_code) DEFAULT_VALUE = self.get.default_value(INITIAL_ROWS,_code)
@ -421,8 +423,8 @@ class Parser (Process):
# x12_file = open(filename.strip(),errors='ignore').read().split('\n') # x12_file = open(filename.strip(),errors='ignore').read().split('\n')
except Exception as e: except Exception as e:
logs.append ({"parse":"claims" if _code == '837' else 'remits',"completed":False,"name":filename,"msg":e.args[0]}) logs.append ({"parse":_code,"completed":False,"name":filename,"msg":e.args[0]})
return [],logs,_code return [],logs,None
rate = 0 if len(claims) == 0 else (1 + index)/len(claims) rate = 0 if len(claims) == 0 else (1 + index)/len(claims)
logs.append ({"parse":"claims" if _code == '837' else 'remits',"completed":True,"name":filename,"rate":rate}) logs.append ({"parse":"claims" if _code == '837' else 'remits',"completed":True,"name":filename,"rate":rate})

Loading…
Cancel
Save