Skip to content

Commit

Permalink
#316 only want definitions from that source
Browse files Browse the repository at this point in the history
  • Loading branch information
ecwood committed Aug 23, 2023
1 parent d006719 commit ae147b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion umls_mysql_to_list_jsonl.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def code_sources(cursor, output):
names_sql_statement = "SELECT con.CODE, con.SAB, GROUP_CONCAT(DISTINCT con.CUI), GROUP_CONCAT(DISTINCT CONCAT(con.TTY, '|', con.ISPREF, '|', con.STR) SEPARATOR '\t') FROM MRCONSO con GROUP BY con.SAB, con.CODE"
extra_info_sql_statement = "SELECT sat.CODE, sat.SAB, GROUP_CONCAT(DISTINCT CONCAT(sat.ATN, '|', REPLACE(sat.ATV, '\t', ' ')) SEPARATOR '\t') FROM MRSAT sat GROUP BY sat.SAB, sat.CODE"
tuis_sql_statement = "SELECT con.CODE, con.SAB, GROUP_CONCAT(DISTINCT sty.TUI) FROM MRCONSO con LEFT JOIN MRSTY sty ON con.CUI = sty.CUI GROUP BY con.SAB, con.CODE"
definitions_sql_statement = "SELECT con.CODE, con.SAB, GROUP_CONCAT(DISTINCT def.DEF SEPARATOR ';') FROM MRCONSO con INNER JOIN MRDEF def on con.CUI=def.CUI GROUP BY con.SAB, con.CODE"
definitions_sql_statement = "SELECT con.CODE, con.SAB, GROUP_CONCAT(DISTINCT def.DEF SEPARATOR ';') FROM MRCONSO con INNER JOIN MRDEF def on con.CUI=def.CUI WHERE con.SAB=def.SAB GROUP BY con.SAB, con.CODE"

cursor.execute(names_sql_statement)
for result in cursor.fetchall():
Expand Down

0 comments on commit ae147b3

Please sign in to comment.