The XML4Pharma Application Server

XML4Pharma LOINC Web Services


We have developed a good number of RESTful Web Services for use with LOINC, the universal code system for medical lab tests, measurements, and observations.

Latest LOINC version implemented: 2.58 (2016-12-21)

The following RESTful LOINC web services are currently available:


  • Get LOINC Name from LOINC code
  • When a LOINC code (e.g. "1751-7") is submitted the LOINC name is returned. In the example case the response is: "Albumin:MCnc:Pt:Ser/Plas:Qn" meaning:
    Albumin mass concentration as a point in time in serum/plasma, quantitative.
    URL: http://www.xml4pharmaserver.com:8080/LOINCService/rest/LOINCName/{LOINC-Code}
    Example: http://www.xml4pharmaserver.com:8080/LOINCService/rest/LOINCName/1751-7


  • Get LOINC long name from LOINC code
  • When a LOINC code (e.g. "1751-7") is submitted the LOINC Long Name is returned. In the example case the response is: "Albumin [Mass/volume] in Serum or Plasma"
    URL: http://www.xml4pharmaserver.com:8080/LOINCService/rest/LOINCLongName/{LOINC-Code}
    Example: http://www.xml4pharmaserver.com:8080/LOINCService/rest/LOINCLongName/1751-7


  • Get example UCUM units for LOINC code
  • When a LOINC code (e.g. "1751-7") is submitted the example UCUM unit is returned. This corresponds to the unit in which the results are usually reported for this lab test. In the example case the response is: "g/dL"
    URL: http://www.xml4pharmaserver.com:8080/LOINCService/rest/LOINCExampleUCUMUnits/{LOINC-Code}
    Example: http://www.xml4pharmaserver.com:8080/LOINCService/rest/LOINCExampleUCUMUnits/1751-7


  • Get molar mass for LOINC code
  • When a LOINC code (e.g. "2339-0" for "Glucose:MCnc:Pt:Bld:Qn") is submitted the molar mass '180.2' of the component (Glucose) is returned. This can enormously help converting values between two (otherwise equal) tests where one test reports the resuls using moles (SCnc: substance concentration) and the other using mass (MCnc) or vice versa.
    For example, LOINC test "15074-8" ("Glucose:SCnc:Pt:Bld:Qn") only differs with LOINC code "2339-0" in that the results are expressed as molar concentration instead of mass concentration.
    URL: http://www.xml4pharmaserver.com:8080/LOINCService/rest/LOINCMolarMass/{LOINC-Code}
    Example: http://www.xml4pharmaserver.com:8080/LOINCService/rest/LOINCMolarMass/15074-8

    Remark that this service uses an older version of the LOINC database, as molecular masses are (unfortunately) not present anymore in version 2.58.


  • Get molar mass for LOINC component
  • Similar as for the previous service, when a LOINC component (e.g. "Cyclohexane") is submitted the molar mass '84.161' of the component is returned. This can enormously help converting values between two (otherwise equal) tests where one test reports the resuls using moles (SCnc: substance concentration) and the other using mass (MCnc).
    The component is searched for in the LOINC database in a case-insensitive way.
    URL: http://www.xml4pharmaserver.com:8080/LOINCService/rest/LOINCMolarMassForComponent/{component}
    Example: http://www.xml4pharmaserver.com:8080/LOINCService/rest/LOINCMolarMassForComponent/cyclohexane

    Remark that this service uses an older version of the LOINC database, as molecular masses are (unfortunately) not present anymore in version 2.58.


  • Get similar/related tests for given test by LOINC code
  • This service provides a detailed list of tests which are similar (or related) to a given test as provided by the LOINC code.
    The list is sorted by:

    URL: http://www.xml4pharmaserver.com:8080/LOINCService/rest/LOINCSimilarTest/{LOINC-Code}
    Example: http://www.xml4pharmaserver.com:8080/LOINCService/rest/LOINCSimilarTest/1751-7
    providing all tests that are similar/related to the test "Albumin [Mass/volume] in Serum or Plasma" (LOINC code 1751-7).


    Depending whether your (applications) HTTP request asks for XML, JSON or text, you will get the information back as XML, JSON or just a single string.
    The XML returned by the service "get LOINC name from LOINC code" has the following structure (example):

    and for the service "get LOINC long name from LOINC code:

    For the service "Get similar/related tests for given test by LOINC code", here is an example of the output:

    As one can see, the first test in the list (2862-1) only differs by the method, which is "by electrophoresis"


    Most of these services have been implemented in the Smart Dataset-XML Viewer, but you can of course use them in any software application that you want using RESTful web services.
    Also see our blogs at blogspot

    If you have any suggestions for other web services which have to do with LOINC, UCUM, CDISC and CDISC Controlled Terminology, please let us know.

    Courtesy of XML4Pharma - last update: June 2017