in src/ui/ui.py [0:0]
def _visualize_drug_info(self):
"""Dispaly drug information in the disambiguation output.
Args:
None
Returns:
None
"""
# get dictionary of selected text
entity_dict = [
d
for d in self.proc_entities["DRUG"]
if d["Text"] == self.mapped_drug_category.value
][0]
# output text
lines = ["\t\t\t TEXT: {}".format(entity_dict["Text"])]
lines.append("\t\t\tDISAMBIGUATED TO: {}\n".format(entity_dict["Query-arg"]))
lines.append("INFERRED OPTIONS")
lines.append(" Score\tRxNorm Code \tName\n")
for i, d in enumerate(entity_dict["Options"], 1):
lines.append(
"{}. ({:.3f})\t {:7d} \t{}".format(
i, d["Score"], int(d["Code"]), d["Description"]
)
)
text = "\n".join(lines)
# display
self._display_name_info(text)