pradeepvemulakonda/Snomed

The run_snomed_upload.py script throws an exception

Closed this issue · 4 comments

We tried your run_snomed_upload.py script and it fails with

python run_snomed_upload.py
starting processing snomed zip file ...
start time Wed Feb 10 17:55:57 2016
Found the zip file /home/ronan/SNOMED/archive/SnomedCT_RF1Release_US1000124_20150901.zip and stating processing ...
/home/ronan/SNOMED/archive/SnomedCT_RF1Release_US1000124_20150901.zip
<zipfile.ZipFile object at 0xf85dd0>
<zipfile.ZipFile object at 0xf90a10>
Zip file is extracted into required files
loading descriptions ...
Traceback (most recent call last):
  File "run_snomed_upload.py", line 42, in <module>
    descMap = ld.process()
  File "/data/home/ronan/SNOMED/load/load_desc.py", line 12, in process
    input_file = super().get_files('descfile')
TypeError: super() takes at least 1 argument (0 given)

We modified super() to

super(DescProcessor,self).get_files('descfile')

and now it fails with

File "run_snomed_upload.py", line 42, in <module>
  descMap = ld.process()
File "/data/home/ronan/SNOMED/load/load_desc.py", line 14, in process
  with open(input_file[0], "rt", encoding='utf-8') as tsvin:
TypeError: 'NoneType' object has no attribute '__getitem__'

Earlier in the script, we get "Zip file is extracted into required files". We were expecting they would be placed in snomed_files/snomed per the configuration file. However, this folder is empty.

I was able to run this script on my Mac a month ago. I will run this on my laptop this weekend and will get back to you.

Hi Ronan,

 Please make sure that you are using Python 3 as the executable.
 Also you need to install package py2neo.

The zip file location needs to be modified in the config.ini file to your local path.

Once I made these changes I was able to run the same in my windows system on python 3.5.

Attached a screenshot of the config.ini file contents for your reference.
config-file-py

Sorry for the late reply. Please do revert for any problems.

Thanks. I was able to process SnomedCT with your script with these considerations:

  1. Moved to a different Fedora release
  2. Using Python 3, e.g. python3 command-line
  3. Creating the snomed_files/snomed and results folders with mkdir
  4. Editing neo4j/base_uploader.py, neo4j/snomed_concept_processor.py, neo4j/snomed_concept_synonym_processor.py, and neo4j/snomed_relation_processor.py to call pyneo2.authenticate() to provide the requisite password. Ideally the hostname and password should be in the config.ini file.

Nice to hear. If possible, can you please contribute your changes for providing the requisite password.

Thank you