diff --git a/healthcareio/x12/__init__.py b/healthcareio/x12/__init__.py index 3c8e692..5f49cca 100644 --- a/healthcareio/x12/__init__.py +++ b/healthcareio/x12/__init__.py @@ -122,8 +122,15 @@ class Formatters : def suppress (self,value): return 'N/A' def date(self,value): + value = value if type(value) != list else "-".join(value) if len(value) > 8 or '-' in value: - value = value.split('-')[0] + # + # This is the case of a thru date i.e the first part should be provided in a 435 entry + # + fdate = "-".join([value[:8][:4],value[:8][4:6],value[:8][6:8]]) + tdate = "-".join([value[9:][:4],value[9:][4:6],value[9:][6:8]]) + + return {"from":fdate,"to":tdate} if len(value) == 8 : year = value[:4] diff --git a/setup.py b/setup.py index 0cb3a4d..a4021d4 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ import sys def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() args = { - "name":"healthcareio","version":"1.6.4.2", + "name":"healthcareio","version":"1.6.4.3", "author":"Vanderbilt University Medical Center", "author_email":"steve.l.nyemba@vumc.org", "include_package_data":True,