NIH | National Cancer Institute | NCI Wiki  

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Revised to be consistent.

...

Setting Result Set and Page Size for REST-like API

For a caDSR RESTlike REST-like API:

  • You can expand or limit the result set using the resultCounter parameter. By default, the result set for a RESTlike REST-like call is limited to 1,000 records, with the set number of records appearing per page, either as the default or as a specified page size.
  • To change the maximum number of results returned for a query, add the resultCounter=## parameter to the call. 
  • If your total results are less than the page size, the first page of results contain all the returned items.
  • The resultCounter and pageSize capabilities are available for use in RESTlike REST-like API calls.
  • For REST-like (XML-HTTPS) calls, page size information is cached, so that if you make a call that identifies a particular page size, subsequent calls will also use that same page size, even without the parameter.
  • To change the number of results appearing on each page, include a different pageSize parameter in a call, or clear the cache to return to the default.

...

The following examples find a Data Element data element where Public ID = 62 and Version=6, displaying the basic metadata attributes. 

...

This method can be used to retrieve Data Elements data elements only when you know both the Public ID and Version number. (If you have trouble with the following link in Firefox, copy and paste it into IE.)

...

The following example finds a Data Element data element with Public ID = 62, displaying the basic metadata attributes. Since the version is not known, this query can only be handled via a caDSR REST API query getting all versions.

...

The following example finds a Data Element data element with Public ID = 62, displaying all the metadata associated with the Data Elementdata element's related components, not just the basic attributes. This is handled in the caDSR REST API using a parameter that produces expanded ("heavy") XML.

...

Code Block
https://cadsrapi.cancer.gov/invoke/caDSR/GetXML?query=DataElement[@publicId=62]&returnHeavyXML=true

Example 4 - Find

...

DEC Using Public ID, Display All Associated Data Elements

Find all the Data Elements data elements associated with the Data Element Concept DEC with Public ID = 2178546, displaying the basic metadata of the Data Element Concept DEC and its Data Elementsdata elements.

Legacy Example 4

The URL for the results from the caDSR 4.0 REST API is

...

Code Block
https://cadsrapi.cancer.gov/invoke/caDSR/GetXML?query=DataElement&DataElementConcept[@publicId=2178546]

Example 5 - Find Data Elements Associated with a Particular

...

DEC Public ID and Version

The following example finds only Data Elements data elements associated with Version 2.1 of Data Element Concept DEC with Public ID = 2178546.

...

The following example finds a Form with Public ID = 2392775, displaying all the metadata associated with the Data Elementdata element's related components, not just the basic attributes. This is handled in the caDSR REST API using a parameter that produces expanded ("heavy") XML.

...

Yes. This can be done through any of the caDSR APIs, as well as for restricting to Property or a Value Meaning in the CDEs Enumerated Value Domain.

Example

  1. Retrieve Data Elements data elements with Object Class “Primary” concept named “Blood and Blood Products” (result in HTML).

    Code Block
    https://cadsrapi.nci.nih.gov/cadsrapi4/GetHTML?query=DataElement,DataElementConcept,ObjectClass,ConceptDerivationRule&ComponentConcept[Concept[@preferredName=C19448]][@primaryFlag=Yes]
    

    EXTENSION 1: An extension finds all Data Elements data elements where the concept is used either as a primary OR qualifier concept. This is accomplished by removing last qualifier in the query.

    Code Block
    [@primaryFlag=Yes]

    Removing this criteria in Example 1 returns 104 results instead of 88.

  2. Retrieve Data Elements data elements with Property “Primary” concept named “E-Mail Address”.

    Code Block
    https://cadsrapi.nci.nih.gov/cadsrapi4/GetHTML?query=DataElement,DataElementConcept,Property,ConceptDerivationRule&ComponentConcept[Concept[@longName=E-mail%20Address]][@primaryFlag=Yes]
    

    EXTENSION 2:  To retrieve the next higher order "type" administered items, remove the name of the item(s) before it in the query argument list, for example, to get DECs with E-Mail address as the primary concept, remove "DataElement" (the first item in the query argument list in Example 2).

  3. Retrieve Data Element Concepts DECs with Property “Primary” concept named “E-Mail Address”.

    Code Block
    https://cadsrapi.nci.nih.gov/cadsrapi4/GetHTML?query=DataElementConcept,Property,ConceptDerivationRule&ComponentConcept[Concept[@longName=E-mail%20Address]][@primaryFlag=Yes]
    
  4. Retrieve Data Elements data elements with Value Domain's Value Meaning "Primary" concept code= C19448 (Blood and Blood Products”) (result in XML).

    Code Block
    https://cadsrapi.nci.nih.gov/cadsrapi4/GetXML?query=DataElement,EnumeratedValueDomain,ValueDomainPermissibleValue,PermissibleValue,ValueMeaning,ConceptDerivationRule&ComponentConcept[Concept[@longName=Blood and Blood Products]][@primaryFlag=Yes]