public class NihNdfrtServiceProxy extends java.lang.Object implements NdfrtService
NdfrtService backed by the live NIH services.
http://rxnav.nlm.nih.gov/NdfrtAPIs.html#
Created by Michael Ramirez (michael@pillfill.com) on 7/17/15.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
URL_ALL_CONCEPTS_TEMPLATE |
static java.lang.String |
URL_ALL_TEMPLATE |
static java.lang.String |
URL_ASSOCIATION_TEMPLATE |
static java.lang.String |
URL_BASE |
static java.lang.String |
URL_CHILDREN_TEMPLATE |
static java.lang.String |
URL_EPCC_TEMPLATE |
static java.lang.String |
URL_ID_TEMPLATE |
static java.lang.String |
URL_PARENTS_TEMPLATE |
static java.lang.String |
URL_PROPERTY_TEMPLATE |
static java.lang.String |
URL_REVERSE_ROLE_TEMPLATE |
static java.lang.String |
URL_ROLE_TEMPLATE |
static java.lang.String |
URL_SEARCH_NAME_TEMPLATE |
static java.lang.String |
URL_SEARCH_PROPERTY_TEMPLATE |
static java.lang.String |
URL_VA_TEMPLATE |
static java.lang.String |
URL_VAMEMBER_TEMPLATE |
static java.lang.String |
URL_VERSION |
| Constructor and Description |
|---|
NihNdfrtServiceProxy() |
| Modifier and Type | Method and Description |
|---|---|
GroupConceptResponse |
findConceptsByID(IdTypeNames idType,
java.lang.String idString)
Find the concepts from a given identifier.
|
GroupConceptResponse |
findConceptsByName(java.lang.String conceptName,
KindNames kindName)
Get the concept identfier given a concept name and kind.
|
void |
getAllConceptsByKind(java.util.List<KindNames> kinds,
ConceptHandler handler)
Gnarly stream parsing of concept list.
|
FullConceptResponse |
getAllInfo(java.lang.String nui)
This resource returns concept information for a specified concept.
|
GroupConceptResponse |
getChildConcepts(java.lang.String nui,
java.lang.Boolean transitive)
Get the child concepts of a specified concept
http://rxnav.nlm.nih.gov/NdfrtAPIs.html#uLink=Ndfrt_REST_getChildConcepts
|
GroupPropertyResponse |
getConceptProperties(java.lang.String nui,
PropertyNames propertyName)
Get the property values for a specified concept and property
http://rxnav.nlm.nih.gov/NdfrtAPIs.html#uLink=Ndfrt_REST_getConceptProperties
|
GroupConceptResponse |
getConceptsByProperty(PropertyNames propertyName,
java.lang.String propertyValue)
Get the concepts that contain the specified property name and value
http://rxnav.nlm.nih.gov/NdfrtAPIs.html#uLink=Ndfrt_REST_getConceptsByProperty
|
GroupConceptResponse |
getEPCClassOfConcept(java.lang.String nui)
Get the FDA Established Pharmacologic classes (EPC) for a specified drug.
|
VersionResponse |
getNdfrtVersion()
Get the date for the last update of the underlying NDFRT data
|
GroupConceptResponse |
getParentConcepts(java.lang.String nui,
java.lang.Boolean transitive)
Get the parent concepts of a specified concept
http://rxnav.nlm.nih.gov/NdfrtAPIs.html#uLink=Ndfrt_REST_getParentConcepts
|
GroupAssociationResponse |
getRelatedConceptsByAssociation(java.lang.String nui,
AssociationNames assocName)
Get the associations for a specified concept
|
GroupConceptResponse |
getRelatedConceptsByReverseRole(java.lang.String nui,
RoleNames roleName,
java.lang.Boolean transitive)
Get the concepts related to the specified object concept by role.
|
GroupConceptResponse |
getRelatedConceptsByRole(java.lang.String nui,
RoleNames roleName,
java.lang.Boolean transitive)
Get the concepts related to the specified concept by role.
|
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) |
GroupConceptResponse |
getVAClassMembers(java.lang.String nui)
Get the members of a VA class
|
ConceptListResponse |
getVAClassOfConcept(java.lang.String nui)
Get the VA class of a specified concept
|
public static final java.lang.String URL_BASE
public static final java.lang.String URL_ALL_CONCEPTS_TEMPLATE
public static final java.lang.String URL_ID_TEMPLATE
public static final java.lang.String URL_SEARCH_NAME_TEMPLATE
public static final java.lang.String URL_ALL_TEMPLATE
public static final java.lang.String URL_CHILDREN_TEMPLATE
public static final java.lang.String URL_PARENTS_TEMPLATE
public static final java.lang.String URL_SEARCH_PROPERTY_TEMPLATE
public static final java.lang.String URL_PROPERTY_TEMPLATE
public static final java.lang.String URL_REVERSE_ROLE_TEMPLATE
public static final java.lang.String URL_ROLE_TEMPLATE
public static final java.lang.String URL_ASSOCIATION_TEMPLATE
public static final java.lang.String URL_EPCC_TEMPLATE
public static final java.lang.String URL_VAMEMBER_TEMPLATE
public static final java.lang.String URL_VA_TEMPLATE
public static final java.lang.String URL_VERSION
public GroupConceptResponse findConceptsByID(IdTypeNames idType, java.lang.String idString) throws java.io.IOException
NdfrtServicefindConceptsByID in interface NdfrtServiceidType - - the type of identifier. See /typeList for valid identifier types.idString - - the value of the identifierjava.io.IOExceptionpublic FullConceptResponse getAllInfo(java.lang.String nui) throws java.io.IOException
NdfrtServicegetAllInfo in interface NdfrtServicenui - - the ndfrt identifier for the conceptjava.io.IOExceptionpublic GroupConceptResponse findConceptsByName(java.lang.String conceptName, KindNames kindName) throws java.io.IOException
NdfrtServicefindConceptsByName in interface NdfrtServiceconceptName - - the name of the conceptkindName - - (optional) the kind value. If not specified, all kinds are returned. See getKindList for valid values.java.io.IOExceptionpublic GroupConceptResponse getChildConcepts(java.lang.String nui, java.lang.Boolean transitive) throws java.io.IOException
NdfrtServicegetChildConcepts in interface NdfrtServicenui - the NDF-RT identifiertransitive - (optional, default: false) if false, then only direct child concepts are returned. If true, return all descendant concepts.java.io.IOException - if errors occur communicating with the servicepublic GroupConceptResponse getParentConcepts(java.lang.String nui, java.lang.Boolean transitive) throws java.io.IOException
NdfrtServicegetParentConcepts in interface NdfrtServicenui - the NDF-RT identifiertransitive - (optional, default: false) if false, then only direct child concepts are returned. If true, return all ancestor concepts.java.io.IOException - if errors occur communicating with the servicepublic GroupPropertyResponse getConceptProperties(java.lang.String nui, PropertyNames propertyName) throws java.io.IOException
NdfrtServicegetConceptProperties in interface NdfrtServicenui - the NDF-RT identifierpropertyName - (optional) the property name. If not specified, all concept properties are returned. See /propertyList example for valid property namesjava.io.IOException - if errors occur communicating with the servicepublic GroupConceptResponse getConceptsByProperty(PropertyNames propertyName, java.lang.String propertyValue) throws java.io.IOException
NdfrtServicegetConceptsByProperty in interface NdfrtServicepropertyName - name of the property. See /propertyList example for valid property names.propertyValue - the property valuejava.io.IOException - if errors occur communicating with the servicepublic GroupConceptResponse getRelatedConceptsByReverseRole(java.lang.String nui, RoleNames roleName, java.lang.Boolean transitive) throws java.io.IOException
NdfrtServicegetRelatedConceptsByReverseRole in interface NdfrtServicenui - the NDF-RT identifier of the object of the roleroleName - the role. See /roleList example for valid role names.transitive - (default:false) if false, then only the concepts directly associated with the role are returned.
If true, the concepts directly associated with the role along with the descendants of these
concepts are returned.java.io.IOExceptionpublic GroupConceptResponse getRelatedConceptsByRole(java.lang.String nui, RoleNames roleName, java.lang.Boolean transitive) throws java.io.IOException
NdfrtServiceNdfrtService.getRelatedConceptsByReverseRole(java.lang.String, com.apothesource.pillfill.rxnorm.datamodel.ndf.RoleNames, java.lang.Boolean) allows the reverse direction, by specifying the object and the role. In
the example above, this means finding the drugs that "may_treat" "Arteriosclerosis".getRelatedConceptsByRole in interface NdfrtServicenui - the NDF-RT identifier of the object of the roleroleName - the role. See /roleList example for valid role names.transitive - (default:false) if false, then only the concepts directly associated with the role are returned.
If true, the concepts directly associated with the role and the descendants of these concepts
are returned.java.io.IOExceptionpublic GroupAssociationResponse getRelatedConceptsByAssociation(java.lang.String nui, AssociationNames assocName) throws java.io.IOException
NdfrtServicegetRelatedConceptsByAssociation in interface NdfrtServicenui - the NDF-RT concept identifierassocName - (optional) the association name. If not specified, then all associations are returned for the concept.
See getAssociationList for valid values.java.io.IOExceptionpublic GroupConceptResponse getEPCClassOfConcept(java.lang.String nui) throws java.io.IOException
NdfrtServicegetEPCClassOfConcept in interface NdfrtServicenui - the NDF-RT identifierjava.io.IOExceptionpublic GroupConceptResponse getVAClassMembers(java.lang.String nui) throws java.io.IOException
NdfrtServicegetVAClassMembers in interface NdfrtServicenui - the NDF-RT identifierjava.io.IOExceptionpublic ConceptListResponse getVAClassOfConcept(java.lang.String nui) throws java.io.IOException
NdfrtServicegetVAClassOfConcept in interface NdfrtServicenui - the NDF-RT identifier. The identifier must be for a concept that is a VA product (Level = "VA Product")java.io.IOExceptionpublic VersionResponse getNdfrtVersion() throws java.io.IOException
NdfrtServicegetNdfrtVersion in interface NdfrtServicejava.io.IOExceptionpublic void getAllConceptsByKind(java.util.List<KindNames> kinds, ConceptHandler handler)
getAllConceptsByKind in interface NdfrtServicekinds - one or more Kind identifiers. See /kindList example for valid values.handler - A handler to receive concepts as they are retrieved (to minimize memory overhead vs. a single list object)protected <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