header.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. """
  2. This file contains parsing functions for a claim header, the functions are built within class (Object Orientation)
  3. The intent to leverage Object Orientated designs is to easily support multi-processing
  4. """
  5. import numpy as np
  6. import json
  7. # from . im common
  8. from .common import X12DOCUMENT
  9. class HEADER (X12DOCUMENT):
  10. # @staticmethod
  11. def ISA(self,**_args):
  12. _columns = ['mode','version','date','time']
  13. _index = [15,12,9,10]
  14. return self.parse(_columns,_index,**_args)
  15. # @staticmethod
  16. def GS(self,**_args):
  17. """
  18. Expected Element GS
  19. """
  20. _columns = ['type','sender','receiver','date','time','version']
  21. return self.parse(_columns,[1,2,3,4,5,8],**_args)
  22. # @staticmethod
  23. def ST(self,**_args):
  24. """
  25. Expected Element ST
  26. According to {x12} standard ST will take precedence over GS
  27. """
  28. _columns = ['type','control_number','version']
  29. return self.parse(_columns,[1,2,3],**_args)
  30. # @staticmethod
  31. def BHT (self,**_args):
  32. """
  33. Expected Element BHT
  34. This functiion will process header submitted (receiver,claim_type,)
  35. """
  36. _columns= ['app_id','date','time','type']
  37. return self.parse(_columns,[3,4,5,6],**_args)
  38. #
  39. # let us perform this