Module Import alias Import alias Import alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad Call AttributeLoad Str attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list NameLoad decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore ListLoad Str Str FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If BoolOpOr CompareIs NameLoad NameLoad CompareLt Call NameLoad NameLoad Num body Return ListLoad If UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign NameStore CompareEq Str SubscriptLoad NameLoad Index Num If NameLoad body Assign NameStore SubscriptLoad NameLoad Slice Num Assign NameStore Call AttributeLoad NameLoad attr Str Num Assign NameStore SubscriptLoad NameLoad Index Num If NameLoad body Assign NameStore Call AttributeLoad Str attr Call AttributeLoad Str attr AttributeLoad NameLoad attr orelse Assign NameStore Str Assign NameStore ListLoad For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad TupleLoad NameLoad body If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num orelse Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad body If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign NameStore IfExp NameLoad Str Str Return IfExp CompareGt Call NameLoad NameLoad Num Call AttributeLoad NameLoad attr NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If BoolOpOr CompareIs NameLoad NameLoad CompareLt Call NameLoad NameLoad Num body Return NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad If NameLoad body Assign NameStore Call AttributeLoad Str attr Call AttributeLoad Str attr AttributeLoad NameLoad attr orelse Assign NameStore Str Assign NameStore ListLoad For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad TupleLoad BinOpAdd BinOpAdd Str NameLoad Str body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list decorator_list If CompareEq Str NameLoad body Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Print Call AttributeLoad Str attr NameLoad NameLoad Assign NameStore Str Print Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Print Call AttributeLoad Str attr NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num
N/A N/A sys N/A os.path N/A logging sqlite SQLite UMLS N/A object N/A N/A  A class for importing UMLS terminologies into an SQLite database.
	 check_database N/A N/A cls N/A N/A N/A  Check if our database is in place and if not, prompts to import it.
		Will raise on errors!
		
		UMLS: (umls.db)
		If missing prompt to use the `umls.sh` script
		 N/A umls_db N/A N/A N/A os path join databases umls.db N/A N/A N/A N/A N/A os path exists umls_db N/A N/A N/A Exception N/A N/A The UMLS database at {} does not exist. Run the import script `databases/umls.sh`. format N/A N/A N/A os path abspath umls_db N/A classmethod N/A UMLSLookup N/A object N/A N/A  UMLS lookup  N/A sqlite None N/A did_check_dbs False N/A preferred_sources N/A "SNOMEDCT" "MTH" __init__ N/A N/A self N/A N/A N/A absolute N/A N/A N/A os path dirname N/A N/A N/A os path realpath __file__ N/A N/A self sqlite N/A N/A SQLite get N/A N/A N/A os path join absolute databases/umls.db N/A lookup_code N/A N/A self cui preferred N/A True N/A N/A  Return a list with triples that contain:
		- name
		- source
		- semantic type
		by looking it up in our "descriptions" database.
		The "preferred" settings has the effect that only names from SNOMED
		(SNOMEDCD) and the Metathesaurus (MTH) will be reported. A lookup in
		our "descriptions" table is much faster than combing through the full
		MRCONSO table.
		
		:returns: A list of triples with (name, sab, sty)
		 N/A N/A N/A cui None N/A N/A len cui 1 N/A N/A N/A N/A N/A N/A UMLSLookup did_check_dbs N/A N/A N/A N/A UMLS check_database N/A N/A UMLSLookup did_check_dbs True N/A negated N/A - N/A cui N/A 0 N/A negated N/A N/A cui N/A cui N/A 1 N/A parts N/A N/A cui split @ 1 N/A lookup_cui N/A parts N/A 0 N/A preferred N/A N/A sql N/A N/A SELECT STR, SAB, STY FROM descriptions WHERE CUI = ? AND SAB IN ({}) format N/A N/A ,  join N/A UMLSLookup preferred_sources N/A N/A sql SELECT STR, SAB, STY FROM descriptions WHERE CUI = ? N/A arr N/A N/A res N/A N/A N/A self sqlite execute sql N/A lookup_cui N/A N/A negated N/A N/A N/A N/A arr append N/A N/A [NEGATED] {} format N/A res N/A 0 N/A res N/A 1 N/A res N/A 2 N/A N/A N/A N/A arr append res N/A arr N/A lookup_code_meaning N/A N/A self cui preferred no_html N/A True True N/A N/A  Return a string (an empty string if the cui is null or not found)
		by looking it up in our "descriptions" database.
		The "preferred" settings has the effect that only names from SNOMED
		(SNOMEDCD) and the Metathesaurus (MTH) will be reported. A lookup in
		our "descriptions" table is much faster than combing through the full
		MRCONSO table.
		 N/A names N/A N/A res N/A N/A self lookup_code cui preferred N/A N/A no_html N/A N/A N/A N/A names append N/A N/A {} ({})  [{}] format N/A res N/A 0 N/A res N/A 1 N/A res N/A 2 N/A N/A N/A N/A names append N/A N/A {} (<span style="color:#090;">{}</span>: {}) format N/A res N/A 0 N/A res N/A 1 N/A res N/A 2 N/A comp N/A no_html ,  <br/>
 N/A N/A N/A N/A len names 0 N/A N/A comp join names N/A lookup_code_for_name N/A N/A self name preferred N/A True N/A N/A  Tries to find a good concept code for the given concept name.
		
		Uses our indexed `descriptions` table.
		
		:returns: A list of triples with (cui, sab, sty)
		 N/A N/A N/A name None N/A N/A len name 1 N/A N/A None N/A N/A N/A UMLSLookup did_check_dbs N/A N/A N/A N/A UMLS check_database N/A N/A UMLSLookup did_check_dbs True N/A preferred N/A N/A sql N/A N/A SELECT CUI, SAB, STY FROM descriptions WHERE STR LIKE ? AND SAB IN ({}) format N/A N/A ,  join N/A UMLSLookup preferred_sources N/A N/A sql SELECT CUI, SAB, STY FROM descriptions WHERE STR LIKE ? N/A arr N/A N/A res N/A N/A N/A self sqlite execute sql N/A N/A N/A % name % N/A N/A N/A N/A arr append res N/A arr N/A N/A N/A N/A __main__ __name__ N/A N/A N/A N/A UMLS check_database N/A look N/A UMLSLookup N/A code C0002962 N/A meaning N/A N/A look lookup_code_meaning code N/A N/A N/A UMLS code "{0}":  {1} format code meaning N/A name Pulmonary Arterial Hypertension N/A N/A N/A Search for "{}" returns: format name N/A codes N/A N/A look lookup_code_for_name name N/A cd codes N/A N/A N/A N/A {}:  {} format cd N/A N/A look lookup_code_meaning N/A cd N/A 0