Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#798 | csv to json converter can handle hier…
Browse files Browse the repository at this point in the history
…archy parent_concept_urls
  • Loading branch information
snyaggarwal committed Jun 11, 2021
1 parent c7f1b04 commit 4b82440
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ocldev/oclcsvtojsonconverter.py
Expand Up @@ -715,6 +715,8 @@ def do_datatype_conversion(self, value, datatype):
return int(value)
elif datatype == 'float':
return float(value)
elif datatype == 'list':
return [v.strip() for v in value.strip('][').split(',')]
return value

def process_auto_concept_reference(self, csv_row, field_def):
Expand Down Expand Up @@ -885,6 +887,7 @@ class OclStandardCsvToJsonConverter(OclCsvToJsonConverter):
{'resource_field': 'retired', 'column': 'retired', 'required': False},
{'resource_field': 'external_id', 'column': 'external_id', 'required': False},
{'resource_field': 'concept_class', 'column': 'concept_class'},
{'resource_field': 'parent_concept_urls', 'column': 'parent_concept_urls', 'default': None, 'datatype': 'list'},
{'resource_field': 'datatype', 'column': 'datatype', 'default': 'None'},
{'resource_field': 'owner', 'column': 'owner_id'},
{'resource_field': 'owner_type', 'column': 'owner_type',
Expand Down

0 comments on commit 4b82440

Please sign in to comment.