2023-05-18 14:22:48 +00:00
|
|
|
"""
|
2023-09-11 16:40:26 +00:00
|
|
|
This file serves as the interface (so to speak) to the x12 parser, plugin interface, We implement default plugins that will handle parsing,
|
|
|
|
In addition to the allow custom plugins to be written/loaded and these will be given priority over the default ones+6+++++++++++++++++++++++++++++++++++++++++++++++++
|
2023-05-18 14:22:48 +00:00
|
|
|
@TODO:
|
|
|
|
- How to write custom plugin
|
|
|
|
- Provide interface for meta-data (expected)
|
|
|
|
- Support configuration specification
|
|
|
|
"""
|
|
|
|
import os
|
2023-11-21 18:56:35 +00:00
|
|
|
import sys
|
|
|
|
# from . import common
|
|
|
|
# from . import header
|
|
|
|
# from . import body
|
|
|
|
import importlib as IL
|
|
|
|
# import imp
|
|
|
|
from .. import parser
|
|
|
|
# from .claims import *
|
|
|
|
# from .remits import *
|
|
|
|
# EDI = body.BODY
|
|
|
|
# X12Handler = body.BODY
|
|
|
|
from healthcareio.x12.plugins.default import claims
|
|
|
|
from healthcareio.x12.plugins.default import remits
|
|
|
|
# import .remits
|
2023-05-18 14:22:48 +00:00
|
|
|
|
2023-11-21 18:56:35 +00:00
|
|
|
@parser(element='ISA',x12='837',field='header', map={15:'mode',12:'version',9:'date',10:'time'})
|
|
|
|
def ISA(**_args):
|
|
|
|
"""
|
|
|
|
:row raw {x12} row
|
|
|
|
:data parsed data
|
|
|
|
:meta elements containing map {index:field_name}
|
|
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
@parser(element='GS', map={1:'type',2:'sender',3:'receiver',4:'date',5:'time',8:'version'},field='receiver')
|
|
|
|
def GS(**_args):
|
|
|
|
pass
|
|
|
|
|
|
|
|
@parser(element='ST', x12='837', field='header', map={1:'x12',2:'control_number'})
|
|
|
|
def ST(**_args):
|
|
|
|
"""
|
|
|
|
:row raw {x12} row
|
|
|
|
:data parsed data
|
|
|
|
:meta elements containing map {index:field_name}
|
|
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
@parser(element='BHT',field='header',map={3:'app_id',4:'date',5:'time',6:'type'})
|
|
|
|
def BHT (**_args):
|
|
|
|
"""
|
|
|
|
:row raw {x12} row
|
|
|
|
:data parsed data
|
|
|
|
:meta elements containing map {index:field_name}
|
|
|
|
"""
|
2023-05-18 14:22:48 +00:00
|
|
|
pass
|