loinc2hpo Documentation

Loinc2hpo is a Java library designed to convert the findings of laboratory tests to HPO codes. For instance, if the test is LOINC 26515-7 Platelets [#/volume] in Blood and the outcome of the test is an abnormally low value, then we can infer the Human Phenotype Ontology (HPO) term Thrombocytopenia HP:0001873.

The goal of this library is to encode EHR (Electronic Health Record) laboratory data using HPO terms to extend the kinds of analysis that can be performed. Laboratory results can be leveraged as phenotypic features for analysis.


The library currently has three modules.


This library contains the core functionality. It imports the annotation file from the loinc2hpoAnnotation repository (loinc2hpo-annotations.tsv), and for any combination of LOINC Id (laboratory test) and outcome, it finds the appropriate HPO term if one exists. We use set of internal codes to represent lab outcomes.




Low (below normal range). Used for quantitative tests (Qn).


High (above normal range). Used for quantitative tests (Qn).


Normal (within normal range). Used for quantitative tests (Qn).


Negative (not present, a normal result). Used for ordinal tests (Ord)


Positive (present, an abnormal result). Used for ordinal tests (Ord)


Nominal (an abnormal result). Used for nominal tests (Nom)


This library provides an interface that extracts LOINC-encoded data from FHIR - Fast Healthcare Interoperability Resources data. Specifically, it provides an interface that takes a FHIR Observation and attempts to extract a LOINC code and an outcome; if successful, these are passed to the core loinc2hpo module to get the corresponding HPO term.


This is a command-line interface tool that can be used to obtain descriptive statistics or perform quality control of the input files.


GitHub repo

The source code of Loinc2hpo can be found at GitHub: https://github.com/monarch-initiative/loinc2hpo


Peter Robinson peter.robinson@jax.org

The Jackson Laboratory 10 Discovery Drive Farmington, CT USA

Xingmin Aaron Zhang kingmanzhang@gmail.com


We have developed a JavaFX application to curate loinc2hpo data. This app is not needed to use the library, but may be of interest to potential contributors: https://github.com/pnrobinson/loinc2hpoMiner.