sayan801 / pyccda

A Python library for CCDA XML files. Part of the BlueButton health information liberation initiative.
1 stars 0 forks source link

Test various CCDA files #4

Open sayan801 opened 7 years ago

sayan801 commented 7 years ago

https://github.com/sayan801/sample_ccdas

sayan801 commented 7 years ago

Vitera - Vitera_CCDA_SMART_Sample.xml

sayan801 commented 7 years ago

../testdata/Patient-540.xml

======================================================================
ERROR: test_sample_ccda_files (__main__.CcdaDocumentTestCase)
Test all sample CCDA files in the testdata directory.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "ccda_test.py", line 33, in test_sample_ccda_files
    self._test_to_message(fp)
  File "ccda_test.py", line 22, in _test_to_message
    ccda_message = ccda_doc.to_message()
  File "/home/chandra/code/pyccda/pyccda/ccda.py", line 231, in to_message
    doc.demographics.dob = self._tree.get_dob()
  File "/home/chandra/code/pyccda/pyccda/ccda.py", line 90, in get_dob
    return datetime.datetime.strptime(val, '%Y%M%d')
  File "/usr/lib/python2.7/_strptime.py", line 335, in _strptime
    data_string[found.end():])
ValueError: unconverted data remains: 010000
soumik-technicise commented 7 years ago

../testdata/170.314(b)(1)InPt_Discharge Summary CED Type.xml

../testdata/170.314(b)(2)InPt_Discharge Summary CED Type.xml

Traceback (most recent call last): File "technicise.py", line 7, in print ccda.to_csv() File "/home/technicise4/Documents/Pythoncode/pyccda-master/pyccda/ccda.py", line 176, in to_csv message = self.to_message() File "/home/technicise4/Documents/Pythoncode/pyccda-master/pyccda/ccda.py", line 314, in to_message procedure.date = CcdaTree.get_date_from_effective_time(entry) File "/home/technicise4/Documents/Pythoncode/pyccda-master/pyccda/ccda.py", line 139, in get_date_from_effective_time return cls.get_date_from_value(val) File "/home/technicise4/Documents/Pythoncode/pyccda-master/pyccda/ccda.py", line 147, in get_date_from_value return datetime.datetime.strptime(val, datetime_format) UnboundLocalError: local variable 'datetime_format' referenced before assignment

sayan801 commented 7 years ago

../testdata/C-CDA_101822_20130617114349_Williams_John.xml

======================================================================
ERROR: test_sample_ccda_files (__main__.CcdaDocumentTestCase)
Test all sample CCDA files in the testdata directory.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "ccda_test.py", line 35, in test_sample_ccda_files
    self._test_to_message(fp)
  File "ccda_test.py", line 22, in _test_to_message
    ccda_message = ccda_doc.to_message()
  File "/home/chandra/code/pyccda/pyccda/ccda.py", line 244, in to_message
    **self._tree.get_birthplace())
  File "/home/chandra/code/pyccda/pyccda/ccda.py", line 123, in get_birthplace
    'city': _get_val(addr_node, 'city'),
  File "/home/chandra/code/pyccda/pyccda/ccda.py", line 86, in _get_value_of_child_by_tag_name
    return parent_node.getElementsByTagName(tag_name)[0].firstChild.nodeValue
AttributeError: 'NoneType' object has no attribute 'nodeValue'

----------------------------------------------------------------------
sayan801 commented 7 years ago

../testdata/UD.sample.xml --- start---- 71

======================================================================
ERROR: test_sample_ccda_files (__main__.CcdaDocumentTestCase)
Test all sample CCDA files in the testdata directory.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "ccda_test.py", line 35, in test_sample_ccda_files
    self._test_to_message(fp)
  File "ccda_test.py", line 22, in _test_to_message
    ccda_message = ccda_doc.to_message()
  File "/home/chandra/code/pyccda/pyccda/ccda.py", line 271, in to_message
    lab_parent = self._tree.get_entries_by_template(Root.LAB)[0]
IndexError: list index out of range

----------------------------------------------------------------------
Ran 1 test in 3.757s

FAILED (errors=1)
soumik-technicise commented 7 years ago

../testdata/AdamEveryman-ReferralSummary.xml

Traceback (most recent call last):
  File "technicise.py", line 7, in <module>
    print ccda.to_csv()
  File "/home/technicise4/Documents/Pythoncode/pyccda-master/pyccda/ccda.py", line 176, in to_csv
    message = self.to_message()
  File "/home/technicise4/Documents/Pythoncode/pyccda-master/pyccda/ccda.py", line 228, in to_message
    immunization.date = CcdaTree.get_date_from_effective_time(entry)
  File "/home/technicise4/Documents/Pythoncode/pyccda-master/pyccda/ccda.py", line 139, in get_date_from_effective_time
    return cls.get_date_from_value(val)
  File "/home/technicise4/Documents/Pythoncode/pyccda-master/pyccda/ccda.py", line 147, in get_date_from_value
    return datetime.datetime.strptime(val, datetime_format)
UnboundLocalError: local variable 'datetime_format' referenced before assignment
sayan801 commented 7 years ago

../testdata/LMR2TEST.xml

======================================================================
ERROR: test_sample_ccda_files (__main__.CcdaDocumentTestCase)
Test all sample CCDA files in the testdata directory.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "ccda_test.py", line 35, in test_sample_ccda_files
    self._test_to_message(fp)
  File "ccda_test.py", line 22, in _test_to_message
    ccda_message = ccda_doc.to_message()
  File "/home/chandra/code/pyccda/pyccda/ccda.py", line 373, in to_message
    vital_result.value = long(float(value_node.getAttribute('value')))
ValueError: could not convert string to float: 

----------------------------------------------------------------------
Ran 1 test in 4.333s

FAILED (errors=1)