NIH | National Cancer Institute | NCI Wiki  

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Any Browser window is a REST client. A User can type in the REST command and view the resulting XML or otherwise formatted text. Click on image to expand:

screenshot of XML from REST commandImage Modified

Java

Prerequisite:  Java 1.6.x

...

We recommend using the free community edition of Intellij

Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include
. Download and install the Scala plugin according to the directions. Then follow instructions for creating a Scala project and an object like the following. Change the URL to whatever CTS2 service is available

...

Three code snippets that can stand alone. Two return XML and one returns JSON. Python must be installed on your system. Download the third party library python-rest-client

Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include
. Add python-rest-client to the PYTHONPATH environment variable to your system. Create a python script file and run as above.

...

JavaScript (JQuery and Bootstrap.js)

  • Download JQuery 1.10.x
    Multiexcerpt include
    nopaneltrue
    MultiExcerptNameExitDisclaimer
    PageWithExcerptwikicontent:Exit Disclaimer to Include
    and Bootstrap 3.0.x
    Multiexcerpt include
    nopaneltrue
    MultiExcerptNameExitDisclaimer
    PageWithExcerptwikicontent:Exit Disclaimer to Include
  • Create a CTSRest directory for your files
  • Add directories bootstrap and cts2 to this root
  • Add subdirectories js and css to both directories you've just created
  • Add bootstrap.js to the bootstrap/js directory
  • Add bootstrap.min.css to the bootstrap/css directory
  • Add jquery-1.10.2.js to the cts2/js library
  • Create a codeSystem.js text file and add the following text (adjust the serviceUrl to point to a convenient CTS2 service)

...

DescriptionRESTModel Element Class
Code System Versions<base url>codesystemversions?format=jsonCodeSystemVersionCatalogEntryDirectory
Code System Read
<base url>/codesystem/NCI_Thesaurus/version/10.07e
CodeSystemVersionCatalogEntryMsg
Code System Version Query<base url>/codesystemversions?matchvalue=nci_thesaurus&filtercomponent=resourceName&format=jsonCodeSystemVersionCatalogEntryDirectory
Value Sets<base url>resolvedvaluesets?format=jsonResolvedValueSetDirectory
Value Set Definition Read<base url>/cts2/valueset/CDISC%20ADaM%20Date%20Imputation%20Flag%20Terminology/definition/c38261e5?format=jsonValueSetDefinitionMsg
Value Set Query
<base url>/resolvedvaluesets?matchvalue=imputation&filtercomponent=resourceName&format=json
ResolvedValueSetDirectory
Value Set Entries<base url>/valueset/NICHD Newborn Screening Terminology/definition/4125c982/resolution/1?format=json
IteratableResolvedValueSet
Entities
<base url>/codesystem/NCI_Thesaurus/version/10.10a/entities?format=json
EntityDirectory
Entity Read<base url>/codesystem/NCI_Thesaurus/version/10.10a/entity/C3399?format=jsonEntityDescriptionMsg
Entity Query
          <base url>/codesystem/NCI_Thesaurus/version/10.10a/entities?matchvalue=swelling&format=json
EntityDirectory
Association parents<base url>/codesystem/NCI_Thesaurus/version/10.10a/entity/C3399?format=json

EntityDescriptionMsg
with an instance entity with method calls:

entity.getEntityDescription().getNamedEntity().getParent()

returning an instance of URIAndEntityName[]

Association children
<base url>/codesystem/NCI_Thesaurus/version/10.10a/entity/C3399/children
EntityDirectory
Association subjectOf
<base url>/codesystem/npo/version/TestForMultiNamespace/entity/GO:NPO_1607/subjectof
AssociationDirectory
Association targetOf
<base url>/codesystem/NCI_Thesaurus/version/10.10a/entity/C3399/targetof
AssociationDirectory
Maps
<base url>/mapversions
MapVersionDirectory
Map Version Query<base url>/mapversions?matchvalue=ncit&filtercomponent=resourceSynopsisMapVersionDirectory
Map Version Read
<base url>/map/NCIt_to_ICD9CM_Mapping/version/NCIt_to_ICD9CM_Mapping-1.0
MapVersionDirectory
Map Entities
<base urel>/map/NCIt_to_ICD9CM_Mapping/version/NCIt_to_ICD9CM_Mapping-1.0/entries
MapVersionDirectory
Map Restriction To, From, or Both Role
<base url>/mapversions?codesystem=ICD9CM&codesystemsmaprole=MAP_TO_ROLE
MapVersionDirectory

...

REST Clients can be built on PHP, Perl and C# as well.

examples

Multiexcerpt include
nopaneltrue
MultiExcerptNameExitDisclaimer
PageWithExcerptwikicontent:Exit Disclaimer to Include

Code System

Getting All CodeSystemCatalogVersions Summaries

...