REST Examples

Overview

Documents the examples provided in the code to demonstrate use of the REST APIs.

NOTE: this is a placeholder page with basic information and will be fleshed out soon.

Examples Module

The project has a top-level "examples" module that presents simple calls to the API (based on Java clients) for demonstrating how to ask and answer common questions of the terminology server.  The following examples are currently provided:

  • Find Codes by String Query

    • Demonstrates finding SNOMEDCT_US codes using search strings and paging parameters
    • Demonstrates finding MSH codes using search strings and paging parameters
  • Find Concepts by String Query

    • Demonstrates finding SNOMEDCT_US concepts using search strings and paging parameters
    • Demonstrates finding UMLS concepts using search strings and paging parameters
  • Find Descriptors by String Query

    • Demonstrates finding MSH descriptors using search strings and paging parameters
  • Get Code by Terminology Id

    • Demonstrates getting a SNOMEDCT_US code by terminology id
    • Demonstrates getting a MSH code by terminology id
  • Get Concept by Terminology Id

    • Demonstrates getting a SNOMEDCT_US concept by terminology id
    • Demonstrates getting a UMLS concept by CUI
  • Get Concept Deep Relationships

    • Demonstrates retrieving UMLS "deep" concept relationships using paging parameters

  • Get Concept Relationships

    • Demonstrates retrieving SNOMEDCT_US concept relationships using paging parameters
    • Demonstrates retrieving UMLS concept relationships using paging parameters

  • Get Descriptor by Terminology Id

    • Demonstrates getting a MSH descriptor by terminology id

  • Get Descriptor Relationships

    • Demonstrates retrieving MSH descriptor relationships using paging parameters

Running the Examples

These examples can be run through Maven by specifying a run.config.umls parameter.  For example

cd ~/code/examples
mvn install -DskipTests=true -Drun.config.umls=/home/ec2-tomcat/config/config.properties

NOTE: the base.url specified in the "config.properties" file must be actually running a deployed server (and thus REST APIs) for this call to work. 

As an alternative, individual classes within the test framework can be run as Junit run configurations within Eclipse. For example:

If using this approach, the "Arguments" tab must specify a -Drun.config.umls setting, just like the command line call does.