def do_pharm_prod(drug_qid, brand_rxnorm, emea, url, brand_name):
# write info on the pharmaceutical product page
ref = create_ref_statement(emea, url)
# has active substance
s = [wdi_core.WDItemID(drug_qid, 'P3781', references=[ref])]
# instance of
s.append(wdi_core.WDItemID('Q28885102', 'P31', references=[ref])) # pharmaceutical product
s.append(wdi_core.WDItemID('Q169336', 'P31', references=[ref])) # chemical mixture
# emea
s.append(wdi_core.WDExternalID(emea, 'P3637', references=[ref]))
if not pd.isnull(brand_rxnorm):
s.append(wdi_core.WDExternalID(str(int(brand_rxnorm)), "P3345"))
item = wdi_core.WDItemEngine(item_name=brand_name, data=s, domain="drugs", append_value=['P3781'])
item.set_label(brand_name)
if item.get_description() == '':
item.set_description("pharmaceutical product")
wdi_helpers.try_write(item, emea, 'P3637', login, edit_summary="add 'active ingredient'")
return item.wd_item_id
评论列表
文章目录