bug fix, procedure code processing
This commit is contained in:
parent
52fc7e4b0f
commit
086d08906f
|
@ -56,10 +56,12 @@ class Formatters :
|
|||
|
||||
for row_value in row.replace('~','').split(sep) :
|
||||
|
||||
if '>' in row_value :
|
||||
if row_value.startswith('HC') or row_value.startswith('AD'):
|
||||
if '>' in row_value and not row_value.startswith('HC'):
|
||||
# if row_value.startswith('HC') or row_value.startswith('AD'):
|
||||
if row_value.startswith('AD'):
|
||||
|
||||
value += row_value.split('>')[:2]
|
||||
pass
|
||||
else:
|
||||
|
||||
value += row_value.split('>') if row.startswith('CLM') is False else [row_value]
|
||||
|
@ -159,17 +161,20 @@ class Formatters :
|
|||
|
||||
|
||||
def procedure(self,value):
|
||||
for xchar in [':','<','|'] :
|
||||
|
||||
for xchar in [':','<','|','>'] :
|
||||
|
||||
if xchar in value and len(value.split(xchar)) > 1 :
|
||||
#_value = {"type":value.split(':')[0].strip(),"code":value.split(':')[1].strip()}
|
||||
_value = {"type":value.split(xchar)[0].strip(),"code":value.split(xchar)[1].strip()}
|
||||
if value.split(xchar) >= 3 :
|
||||
|
||||
if len(value.split(xchar)) >2 :
|
||||
_value['modifier'] = value.split(xchar)[2]
|
||||
break
|
||||
else:
|
||||
_value = str(value)
|
||||
return _value
|
||||
def diagnosis(self,alue):
|
||||
def diagnosis(self,value):
|
||||
|
||||
return [ {"code":item[2], "type":item[1]} for item in value if len(item) > 1]
|
||||
def pos(self,value):
|
||||
|
@ -221,7 +226,6 @@ class Parser (Process):
|
|||
files = os.listdir(_path)
|
||||
if files :
|
||||
fullname = os.sep.join([_path,files[0]])
|
||||
|
||||
_config = json.loads ( (open(fullname)).read() )
|
||||
return _config
|
||||
|
||||
|
@ -258,6 +262,7 @@ class Parser (Process):
|
|||
if config['cast'][key] in ['float','int'] :
|
||||
value = eval(config['cast'][key])(value)
|
||||
elif hasattr(handler,config['cast'][key]):
|
||||
|
||||
pointer = getattr(handler,config['cast'][key])
|
||||
value = pointer(value)
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue