bug fix: date formats for 434

This commit is contained in:
Steve Nyemba 2021-05-07 09:56:40 -05:00
parent d20b08e7ee
commit d3fdc7beba
2 changed files with 9 additions and 2 deletions

View File

@ -122,8 +122,15 @@ class Formatters :
def suppress (self,value): def suppress (self,value):
return 'N/A' return 'N/A'
def date(self,value): def date(self,value):
value = value if type(value) != list else "-".join(value)
if len(value) > 8 or '-' in 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 : if len(value) == 8 :
year = value[:4] year = value[:4]

View File

@ -8,7 +8,7 @@ import sys
def read(fname): def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read() return open(os.path.join(os.path.dirname(__file__), fname)).read()
args = { args = {
"name":"healthcareio","version":"1.6.4.2", "name":"healthcareio","version":"1.6.4.3",
"author":"Vanderbilt University Medical Center", "author":"Vanderbilt University Medical Center",
"author_email":"steve.l.nyemba@vumc.org", "author_email":"steve.l.nyemba@vumc.org",
"include_package_data":True, "include_package_data":True,