Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double definiton of write_snomed_mapping() #1470

Closed
DimitriPapadopoulos opened this issue Aug 8, 2021 · 2 comments
Closed

Double definiton of write_snomed_mapping() #1470

DimitriPapadopoulos opened this issue Aug 8, 2021 · 2 comments

Comments

@DimitriPapadopoulos
Copy link
Contributor

Describe the bug

Function write_snomed_mapping() is defined twice:

  • def write_snomed_mapping(snomed_codes):
    with open("_snomed_dict.py", 'w', encoding="UTF8") as f_concepts:
    lines = (DOC_LINES +
    ['# Dict with scheme designator keys; value format is:\n',
    '# {concept_id1: snomed_id1, concept_id2: ...}\n',
    '# or\n',
    '# {snomed_id1: concept_id1, snomed_id2: ...}\n',
    '\n',
    ]
    )
    f_concepts.writelines(lines)
    f_concepts.write("mapping = {}\n") # start with empty dict
    f_concepts.write("\nmapping['{}'] = {{\n".format('SCT'))
    for sct, srt, meaning in snomed_codes:
    f_concepts.write(" '{}': '{}',\n".format(sct, srt))
    f_concepts.write("}\n")
    f_concepts.write("\nmapping['{}'] = {{\n".format('SRT'))
    for sct, srt, meaning in snomed_codes:
    f_concepts.write(" '{}': '{}',\n".format(srt, sct))
    f_concepts.write("}")
  • def write_snomed_mapping(snomed_codes):
    with open("_snomed_dict.py", 'w', encoding="UTF8") as f_concepts:
    lines = (DOC_LINES +
    ['# Dict with scheme designator keys; value format is:\n',
    '# {concept_id1: snomed_id1, concept_id2: ...}\n',
    '# or\n',
    '# {snomed_id1: concept_id1, snomed_id2: ...}\n',
    '\n',
    ]
    )
    f_concepts.writelines(lines)
    f_concepts.write("mapping = {}\n") # start with empty dict
    f_concepts.write("\nmapping['{}'] = {{\n".format('SCT'))
    for sct, srt, meaning in snomed_codes:
    f_concepts.write(" '{}': '{}',\n".format(sct, srt))
    f_concepts.write("}\n")
    f_concepts.write("\nmapping['{}'] = {{\n".format('SRT'))
    for sct, srt, meaning in snomed_codes:
    f_concepts.write(" '{}': '{}',\n".format(srt, sct))
    f_concepts.write("}")

Expected behavior

Unless I'm missing the reason, a single definition should be enough. Hard to tell which one to keep, both have been introduced in #824.

@DimitriPapadopoulos DimitriPapadopoulos changed the title Double definiton of write_snomed_mapping'() Double definiton of write_snomed_mapping() Aug 8, 2021
@scaramallion
Copy link
Member

Closed by #1493

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants