__init__.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. """
  2. This file serves as the interface (so to speak) to the x12 parser, plugin interface, We implement default plugins that will handle parsing,
  3. In addition to the allow custom plugins to be written/loaded and these will be given priority over the default ones+6+++++++++++++++++++++++++++++++++++++++++++++++++
  4. @TODO:
  5. - How to write custom plugin
  6. - Provide interface for meta-data (expected)
  7. - Support configuration specification
  8. """
  9. import os
  10. import sys
  11. # from . import common
  12. # from . import header
  13. # from . import body
  14. import importlib as IL
  15. # import imp
  16. from .. import parser
  17. # from .claims import *
  18. # from .remits import *
  19. # EDI = body.BODY
  20. # X12Handler = body.BODY
  21. from healthcareio.x12.plugins.default import claims
  22. from healthcareio.x12.plugins.default import remits
  23. # import .remits
  24. @parser(element='ISA',x12='837',field='header', map={15:'mode',12:'version',9:'date',10:'time'})
  25. def ISA(**_args):
  26. """
  27. :row raw {x12} row
  28. :data parsed data
  29. :meta elements containing map {index:field_name}
  30. """
  31. pass
  32. @parser(element='GS', map={1:'type',2:'sender',3:'receiver',4:'date',5:'time',8:'version'},field='receiver')
  33. def GS(**_args):
  34. pass
  35. @parser(element='ST', x12='837', field='header', map={1:'x12',2:'control_number'})
  36. def ST(**_args):
  37. """
  38. :row raw {x12} row
  39. :data parsed data
  40. :meta elements containing map {index:field_name}
  41. """
  42. pass
  43. @parser(element='BHT',field='header',map={3:'app_id',4:'date',5:'time',6:'type'})
  44. def BHT (**_args):
  45. """
  46. :row raw {x12} row
  47. :data parsed data
  48. :meta elements containing map {index:field_name}
  49. """
  50. pass