public class NihRxNormServiceProxy extends java.lang.Object implements RxNormService
RxNormService backed by NIH's services
http://rxnav.nlm.nih.gov/RxNormAPIs.html
Created by Michael Ramirez (michael@pillfill.com) on 7/20/15.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
URL_BASE |
static java.lang.String |
URL_FIND_APPROXIMATE_TEMPLATE |
static java.lang.String |
URL_FIND_ID_TEMPLATE |
static java.lang.String |
URL_FIND_NAME_TEMPLATE |
static java.lang.String |
URL_GET_BRAND_ING_TEMPLATE |
static java.lang.String |
URL_GET_NDCS_TEMPLATE |
static java.lang.String |
URL_GET_PROPERTIES_TEMPLATE |
static java.lang.String |
URL_GET_RELATED_BY_REL_TEMPLATE |
static java.lang.String |
URL_GET_RELATED_BY_TYPE_TEMPLATE |
static java.lang.String |
URL_GET_RELATED_TEMPLATE |
| Constructor and Description |
|---|
NihRxNormServiceProxy() |
| Modifier and Type | Method and Description |
|---|---|
IdGroupResponse |
findRxcuiById(IdTypeNames type,
java.lang.String id,
int allSrc)
Search for an identifier from another vocabulary and return the RxCUIs of any concepts which have an RxNorm term as a synonym or have that identifier as an attribute.
|
IdGroupResponse |
findRxcuiByName(java.lang.String name,
int search)
Search for a name in the RxNorm data set and return the RxCUIs of any concepts which have that name as an RxNorm term or as a synonym of an RxNorm term.
|
PropertiesGroupResponse |
getAllProperties(java.lang.String id,
PropCategoryNames propName)
Return the properties for a specified concept.
|
AllRelatedGroupResponse |
getAllRelatedInfo(java.lang.String id)
Get all the related RxNorm concepts for a given RxNorm identifier.
|
ApproximateGroupResponse |
getApproximateMatch(java.lang.String id,
int maxEntries)
Do an approximate match search to determine the strings in the data set that most closely match the search string.
|
BrandGroupResponse |
getMultiIngredBrand(java.util.List<java.lang.String> ingredientIds)
Get the brands that contain all the specified ingredients.
|
NdcsGroupResponse |
getNdcs(java.lang.String id)
Get the National Drug Codes (NDCs) for the RxNorm concept.
|
RelatedGroupResponse |
getRelatedByRelationship(java.lang.String id,
java.util.List<RelationshipNames> rela)
Get the related RxNorm identifiers of an RxNorm concept specified by a relational attribute.
|
RelatedGroupResponse |
getRelatedByType(java.lang.String id,
java.util.List<TTYNames> ttys)
Get the related RxNorm identifiers of an RxNorm concept specified by one or more term types.
|
protected <T> T |
getResponseFromNihServer(java.lang.Class<T> classType,
java.lang.String template,
java.lang.String[] parameters) |
protected <T> T |
getResponseFromNihServer(java.net.URL url,
java.lang.Class<T> classType) |
public static final java.lang.String URL_BASE
public static final java.lang.String URL_FIND_ID_TEMPLATE
public static final java.lang.String URL_FIND_NAME_TEMPLATE
public static final java.lang.String URL_GET_PROPERTIES_TEMPLATE
public static final java.lang.String URL_GET_RELATED_TEMPLATE
public static final java.lang.String URL_FIND_APPROXIMATE_TEMPLATE
public static final java.lang.String URL_GET_RELATED_BY_TYPE_TEMPLATE
public static final java.lang.String URL_GET_RELATED_BY_REL_TEMPLATE
public static final java.lang.String URL_GET_NDCS_TEMPLATE
public static final java.lang.String URL_GET_BRAND_ING_TEMPLATE
public IdGroupResponse findRxcuiById(IdTypeNames type, java.lang.String id, int allSrc) throws java.io.IOException
RxNormServicefindRxcuiById in interface RxNormServicetype - the identifier type. Valid types are listed in the table below:id - the identifierallSrc - an optional field indicating whether all RxCUIs are to be returned. If set to 1, all non-suppressed RxCUIs will be returned, including those which contain no terms from the RxNorm vocabulary. If set to 0 (the default), only RxCUIs which contain a non-suppressed RxNorm vocabulary term will be returned.java.io.IOExceptionpublic IdGroupResponse findRxcuiByName(java.lang.String name, int search) throws java.io.IOException
RxNormServicefindRxcuiByName in interface RxNormServicename - - the search string. This must be specified.search - - a number indicating the type of search to be performed. If set to 0 (the default), exact match search will be performed. If set to 1, a normalized string search will be done. When search = 2, then an exact match search will be done, and if no results are found, a normalized search will be done. For more information on the normalized string search, click here.java.io.IOExceptionpublic PropertiesGroupResponse getAllProperties(java.lang.String id, PropCategoryNames propName) throws java.io.IOException
RxNormServicegetAllProperties in interface RxNormServiceid - The RxCUI ID of the conceptpropName - the property categories for the properties to be returned. This field is required.java.io.IOExceptionpublic AllRelatedGroupResponse getAllRelatedInfo(java.lang.String id) throws java.io.IOException
RxNormServicegetAllRelatedInfo in interface RxNormServiceid - The RxCUI for termjava.io.IOExceptionpublic ApproximateGroupResponse getApproximateMatch(java.lang.String id, int maxEntries) throws java.io.IOException
RxNormServicegetApproximateMatch in interface RxNormServiceid - The term to search formaxEntries - The max number of entries to return (default 10)Candidate concepts that may match the term providedjava.io.IOExceptionpublic RelatedGroupResponse getRelatedByRelationship(java.lang.String id, java.util.List<RelationshipNames> rela) throws java.io.IOException
RxNormServicegetRelatedByRelationship in interface RxNormServiceid - The Rxcui for the termrela - a list of the relationship attribute names such as "tradename_of", "has_form", "isa", etc. This
field is required. See the /relatypes example for the valid relationship attributes.ConceptProperty items related to the identified conceptjava.io.IOExceptionpublic RelatedGroupResponse getRelatedByType(java.lang.String id, java.util.List<TTYNames> ttys) throws java.io.IOException
RxNormServicegetRelatedByType in interface RxNormServiceid - The Rxcui for the termttys - a list of one or more RxNorm term types. This field is required. See the /termtypes example for the
valid term types.ConceptProperty items related to the identified conceptjava.io.IOExceptionpublic NdcsGroupResponse getNdcs(java.lang.String id) throws java.io.IOException
RxNormServicegetNdcs in interface RxNormServiceid - The Rxcui for the termjava.io.IOExceptionpublic BrandGroupResponse getMultiIngredBrand(java.util.List<java.lang.String> ingredientIds) throws java.io.IOException
RxNormServicegetMultiIngredBrand in interface RxNormServiceingredientIds - list of ingredient RxCUIs that the returned brands must contain.java.io.IOExceptionprotected <T> T getResponseFromNihServer(java.lang.Class<T> classType,
java.lang.String template,
java.lang.String[] parameters)
throws java.io.IOException
java.io.IOExceptionprotected <T> T getResponseFromNihServer(java.net.URL url,
java.lang.Class<T> classType)
throws java.io.IOException
java.io.IOException