__init___.py 980 B

12345678910111213141516171819202122232425262728293031
  1. """"
  2. This module is designed to perform exports to a relational data stores
  3. Note that the There are two possible methods to perform relational exports
  4. """
  5. import transport
  6. from transport import providers
  7. import healthcareio.x12.plugins
  8. #
  9. # We start by loading all the plugins
  10. def primary_key (**_args) :
  11. _plugins = _args['plugins']
  12. for key in _plugins :
  13. # _lpointers =
  14. def init (**_args):
  15. if 'path' in _args :
  16. _path = _args['path']
  17. _plugins,_parents = healthcareio.x12.plugins.instance(path=_path)
  18. else:
  19. _plugins,_parents = healthcareio.x12.plugins.instance()
  20. for key in _plugins :
  21. _lpointers = _plugins[key]
  22. _foreign = {}
  23. _table = {}
  24. for _pointer in _lpointers :
  25. _meta = _pointer.meta
  26. if 'map' in _meta :
  27. _attr = list(_meta['map'].values())
  28. if 'field' in _meta :
  29. _name = _meta['field']
  30. _foreign[_name] = _attr