/// <summary> /// Returns drug information based on the name of the drug /// </summary> /// <param name="dnValue">The name of the drug</param> /// <param name="cs">The code system in which the drug name has meaning</param> /// <param name="lang">The language in which the response should be returned</param> /// <param name="objAppErr">The application error object</param> /// <returns></returns> public static XElement getDrugInfoByName(string dnValue, DICodeSystem cs, Language lang) { XElement result = null; string url = MedlinePlusConnectBaseURL + "?mainSearchCriteria.v.cs=" + getDICodeSystemValue(cs); url += "&mainSearchCriteria.v.dn=" + HttpUtility.UrlEncode(dnValue); url += "&informationRecipient.languageCode.c=" + getLanguageValue(lang); try { result = XElement.Load(url); } catch (Exception ex) { } return(result); }
public static string getDICodeSystemValue(DICodeSystem dicv) { string DICodeSystemValue = ""; switch (dicv) { case DICodeSystem.NDC: DICodeSystemValue = "2.16.840.1.113883.6.69"; break; case DICodeSystem.RXCUI: DICodeSystemValue = "2.16.840.1.113883.6.88"; break; default: DICodeSystemValue = "2.16.840.1.113883.6.88"; break; } return(DICodeSystemValue); }