use of org.monarchinitiative.loinc2hpo.exception.MalformedHpoTermIdException in project loinc2hpo by monarch-initiative.
the class FromFile method getHpoTermId.
TermId getHpoTermId(String termString) throws MalformedHpoTermIdException {
logger.trace("getHpoTermId=" + termString);
if (termString.equalsIgnoreCase("NA"))
return null;
int i = termString.indexOf(":");
if (i != 2)
throw new MalformedHpoTermIdException("Malformed HPO String: " + termString);
TermId id = new ImmutableTermId(HPPREFIX, termString.substring(3));
if (ontology.getTermMap().containsKey(id))
return id;
else
throw new MalformedHpoTermIdException("Could not find id " + termString);
}
Aggregations