|
|
|
@ -36,17 +36,20 @@ import requests
|
|
|
|
|
import time
|
|
|
|
|
|
|
|
|
|
PATH = os.sep.join([os.environ.get('HOME'),'.healthcareio','config.json'])
|
|
|
|
|
CONFIG = json.loads((open(PATH)).read())
|
|
|
|
|
|
|
|
|
|
STORE_URI = 'http://healthcareio.the-phi.com/store/healthcareio'
|
|
|
|
|
#
|
|
|
|
|
# let us see if we have any custom configurations ...
|
|
|
|
|
|
|
|
|
|
PATH = os.sep.join([os.environ.get('HOME'),'.healthcareio','custom'])
|
|
|
|
|
CONFIG = {}
|
|
|
|
|
CUSTOM_CONFIG = {}
|
|
|
|
|
if os.path.exists(PATH) and os.listdir(PATH) :
|
|
|
|
|
CONFIG = json.loads((open(PATH)).read())
|
|
|
|
|
PATH = os.sep.join([PATH,os.listdir(PATH)[0]])
|
|
|
|
|
CUSTOM_CONFIG = json.loads((open(PATH)).read())
|
|
|
|
|
|
|
|
|
|
_args = dict(CONFIG['store'],**{'type':'mongo.MongoReader'})
|
|
|
|
|
# _args = dict(CONFIG['store'],**{'type':'mongo.MongoReader'})
|
|
|
|
|
|
|
|
|
|
def get_field_names (_map,label):
|
|
|
|
|
fields = list(_map.keys())
|
|
|
|
@ -182,6 +185,18 @@ class Factory:
|
|
|
|
|
:param type EDI type to be processed i.e 835 or 837
|
|
|
|
|
:param write_store target data-store (redshift, mariadb,mongodb ...)
|
|
|
|
|
"""
|
|
|
|
|
global PATH
|
|
|
|
|
global CONFIG
|
|
|
|
|
global CUSTOM_CONFIG
|
|
|
|
|
PATH = os.sep.join([os.environ.get('HOME'),'.healthcareio','config.json'])
|
|
|
|
|
if os.path.exists(PATH):
|
|
|
|
|
CONFIG = json.loads((open(PATH)).read())
|
|
|
|
|
CUSTOM_PATH = os.sep.join([os.environ.get('HOME'),'.healthcareio','custom'])
|
|
|
|
|
if os.path.exists(CUSTOM_PATH) and os.listdir(CUSTOM_PATH) :
|
|
|
|
|
|
|
|
|
|
CUSTOM_PATH = os.sep.join([CUSTOM_PATH,os.listdir(CUSTOM_PATH)[0]])
|
|
|
|
|
CUSTOM_CONFIG = json.loads((open(CUSTOM_PATH)).read())
|
|
|
|
|
|
|
|
|
|
_features = Factory.license(email=CONFIG['owner'])
|
|
|
|
|
store = copy.deepcopy(CONFIG['store'])
|
|
|
|
|
store['type']='mongo.MongoReader'
|
|
|
|
|