The following topics are included in this page.
Using the API, developers can allow an application to connect to caDSR and search the database. The API is available at the Domain Class Browser. The caDSR REST-like (XML-HTTP) API and CDE Browser provide access to, and a means of linking to, caDSR metadata through a standard internet browser.
getHTML
to getXML
.You cannot enter multiple |
For a caDSR RESTlike API:
resultCounter
parameter. By default, the result set for a RESTlike 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.resultCounter=##
parameter to the call. resultCounter
and pageSize
capabilities are available for use in RESTlike API calls.pageSize
parameter in a call, or clear the cache to return to the default.The following example is how to set the result set and page size.
http://cadsrapi.nci.nih.gov/cadsrapi41/GetXML?query=gov.nih.nci.cadsr.domain.Form&gov.nih.nci.cadsr.domain.Form[@workflowStatusName=RELEASED]&startIndex=0&pageSize=30&resultCounter=300 |
You can also add the startIndex
parameter to indicate which record should be the first on the page. This means you can alter a query to return the second or third page of results. Generally speaking, however, the startIndex
parameter is "zero based" - you start at zero and subsequent pages begin with a startIndex
of the next result page. Using the above query as an example, the second page of the results would show startIndex=31
, because the page size is 30.
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 |
Given a data element, you can retrieve the corresponding EVS concept codes for the values in a Value Domain.
If there is a data element with longName My DE
and the permissible values are Never
, Former
, Current
, etc. and the CDE Browser shows the code for Never
as C70543, Former
as C0750523, and Current
as C25471, your application can navigate the objects starting at the value domain and work to the corresponding code."
For example
My DE
) has a getValueDomainPermissibleValueCollectionF
)Former
)Former
has only a Primary Concept)Concept Object
)C0750523
).To search for data elements using a common EVS concept code or name, but restrict the results to only Primary concepts in the CDE object class, refer to the following the examples.
Retrieve data elements with object class, Primary, and concept, Blood and Blood Products (result in HTML).
http://cadsrapi.nci.nih.gov/cadsrapi40/GetHTML?query=DataElement,DataElementConcept,ObjectClass,ConceptDerivationRule&ComponentConcept[Concept[@preferredName=C19448]][@primaryFlag=Yes] |
EXTENSION 1: Additionally, you can find all data elements where the concept is used either as a primary OR qualifier concept. This is accomplished by removing the last qualifier in the query. Removing this criteria in Example 1 returns 104 results instead of 88.
[@primaryFlag=Yes] |
Retrieve data elements with property Primary, and concept, E-Mail Address.
http://cadsrapi.nci.nih.gov/cadsrapi40/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 Data Element Concepts (DECs) with E-Mail address as the primary concept, remove DataElement (the first item in the query argument list in Example 2):
Retrieve DECs with property Primary, and concept E-Mail Address.
http://cadsrapi.nci.nih.gov/cadsrapi40/GetHTML?query=DataElementConcept,Property,ConceptDerivationRule&ComponentConcept[Concept[@longName=E-mail%20Address]][@primaryFlag=Yes] |
Retrieve data elements with value domain's value meaning Primary concept code= C19448 (Blood and Blood Products”) (result in XML).
http://cadsrapi.nci.nih.gov/cadsrapi40/GetXML?query=DataElement,EnumeratedValueDomain,ValueDomainPermissibleValue,PermissibleValue,ValueMeaning,ConceptDerivationRule&ComponentConcept[Concept[@longName=Blood and Blood Products]][@primaryFlag=Yes] |
Find a Data Element where Public Id = 2178693 and Version=2.1 and display the basic metadata attributes.
Either the CDE Browser or the caDSR REST API can be used to satisfy this query and results from both are shown below.
Example 1a Results Displayed in the CDE Browser
This method can be used to retrieve Data Elements only when you know both the Public ID and Version number. (If you have trouble with the following link in Firefox, cut and paste it into IE.)
https://cdebrowser.nci.nih.gov/CDEBrowser/search?dataElementDetails=9/&cdeId=2178693&version=2.1&PageId=DataElementsGroup&queryDE=yes&FirstTimer=yes |
Or alternatively
http://freestyle.nci.nih.gov/freestyle/do/cdebrowser?publicId=2178693&version=2.1 |
Sample CDE Browser Output from Example 1
Example 1b Results Displayed in XML
The URL for the results from the caDSR 4.1 REST API is:
http://cadsrapi.nci.nih.gov/cadsrapi41/GetXML?query=DataElement[@publicId=2178693][@version=2.1] |
Find a Data Element with Public Id = 2178693, display the basic metadata attributes, version is not known.
Since the version is not known, this query can only be handled via a caDSR REST API query getting all versions.
The URL for the results from the caDSR 4.1 REST API is:
http://cadsrapi.nci.nih.gov/cadsrapi41/GetXML?query=DataElement[@publicId=2178693] |
Sample caDSR REST API XML Output from Example 2
Or the query can retrieve only the latest version
http://cadsrapi.nci.nih.gov/cadsrapi41/GetXML?query=DataElement[@publicId=2178693][@latestVersionIndicator=Yes] |
Find a Data Element with Public Id = 2178693, display all the metadata associated with the Data 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.
The URL for the results from the caDSR 4.1 REST API is:
http://cadsrapi.nci.nih.gov/cadsrapi41/GetXML?query=DataElement&DataElement[@publicId=2178693]&returnHeavyXML=true |
Sample caDSR REST XML Output from Example 3 with "Heavy" XML
Find all the Data Elements associated with the Data Element Concept with Public Id = 2178546, display the basic metadata of the Data Element Concept and its Data Elements.
The URL for the results from the caDSR 4.0 REST API is:
http://cadsrapi.nci.nih.gov/cadsrapi41/GetXML?query=DataElement&DataElementConcept[@publicId=2178546] |
Find only Data Elements associated with VERSION 2.1 of Data Element Concept with Public Id = 2178546.
The URL for the results from the caDSR 4.1 REST API is:
http://cadsrapi.nci.nih.gov/cadsrapi41/GetXML?query=DataElement&DataElementConcept[@publicId=2178546][@version=2.1] |
Sample caDSR REST XML Output from Example 4 and 5
Find a Form where Public Id = 2392775 and Version=1.0 and display the basic metadata attributes.
Either the Form Builder or the caDSR 4.1 REST-like API can be used to satisfy this query and results from both are shown below.
This method can be used to retrieve Forms only when you know both the Public ID and Version number. (If you have trouble with the following link in Firefox, cut and paste it into IE.)
The URL for the results from the caDSR 4.1 REST API is:
http://cadsrapi.nci.nih.gov/cadsrapi41/GetXML?query=Form[@publicId=2392775][@version=1.0] |
Find a Form with Public Id = 2392775, display the basic metadata attributes, version is not known.
Since the version is not known, this query can only be handled via a caDSR REST API query.
The URL for the results from the caDSR 4.1 REST API is:
http://cadsrapi.nci.nih.gov/cadsrapi41/GetXML?query=Form[@publicId=2392775] |
Find a Form with Public Id = 2392775, display all the metadata associated with the Data 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.
The URL for the results from the caDSR 4.1 REST API is:
http://cadsrapi.nci.nih.gov/cadsrapi41/GetXML?query=Form&Form[@publicId=2392775]&returnHeavyXML=true |
Find all the Forms associated with the CDE with Public Id = 2183364, Version 1.0, display the basic metadata of the Form.
The URL for the results from the caDSR 4.1 REST API is:
http://cadsrapi.nci.nih.gov/cadsrapi41/GetXML?query=Form&Module&Question&DataElement[@publicId=2183364][@version=1.0] |
Get all the modules for form with publicID = 2392775.
The URL for the results from the caDSR 4.1 REST API is:
http://cadsrapi.nci.nih.gov/cadsrapi41/GetXML?query=gov.nih.nci.cadsr.domain.Module&gov.nih.nci.cadsr.domain.Form[@version=1.0][@publicID=2392775] |
Get all the questions for module with publicID = 2392777 and version = 1.0.
The URL for the results from the caDSR 4.1 REST API is:
http://cadsrapi.nci.nih.gov/cadsrapi41/GetXML?query=gov.nih.nci.cadsr.domain.Question&gov.nih.nci.cadsr.domain.Module[@version=1.0][@publicID=2392777] |
Get all the data elements for question with publicID = 2392779 and version = 1.0.
The URL for the results from the caDSR 4.1 REST API is:
http://cadsrapi.nci.nih.gov/cadsrapi41/GetXML?query=gov.nih.nci.cadsr.domain.DataElement&gov.nih.nci.cadsr.domain.Question[@version=1.0][@publicID=2392779] |
Get all Administered Components for ClassSchemeClassSchemeItem with ID = A55C551C-1866-5ED1-E034-080020C9C0E0
This will retrieve all AC's and sort them according to type (Form, DE, DEC, etc.)
The URL for the results from the caDSR 4.1 REST API is:
http://cadsrapi.nci.nih.gov/cadsrapi41/GetXML?query=AdministeredComponent,AdministeredComponentClassSchemeItem,ClassSchemeClassSchemeItem&ClassSchemeClassSchemeItem[@ID=A55C551C-1866-5ED1-E034-080020C9C0E0] |
Get all ClassSchemeClassSchemeItem for ClassificationSchemeItem with longName starting with 2014r1
and ClassificationScheme with preferredName starting with NMDP
Note, the association can be specified either through using square brackets '[]' or by using the backslash '\'
however, association within the square brackets cannot have further associations as attributes.
The URL for the results from the caDSR 4.1 REST API is:
http://cadsrapi.nci.nih.gov/cadsrapi41/GetHTML?query=ClassSchemeClassSchemeItem&ClassSchemeClassSchemeItem[ClassificationScheme[@preferredName=NMDP*]]\ClassificationSchemeItem[@longName=2014r1*] |
The Examples 15-17 below show retrieving Data Elements using either the Concept Code or the Concept Name where the concept is the Primary Concept of the related caDSR item. In these examples, results are are returned in HTML. All URL's are using the caDSR 4.1 REST API:
This example shows the use of either the Concept Code (C19448) or the Concept Name "Blood and Blood Products". Results are identical from these two calls, both are returned in HTML.
http://cadsrapi.nci.nih.gov/cadsrapi41/GetHTML?query=DataElement,DataElementConcept,ObjectClass,ConceptDerivationRule&ComponentConcept[Concept[@preferredName=C19448]][@primaryFlag=Yes] http://cadsrapi.nci.nih.gov/cadsrapi41/GetHTML?query=DataElement,DataElementConcept,ObjectClass,ConceptDerivationRule&ComponentConcept[Concept[@longName=Blood and Blood Products]][@primaryFlag=Yes] |
http://cadsrapi.nci.nih.gov/cadsrapi41/GetHTML?query=DataElement,DataElementConcept,Property,ConceptDerivationRule&ComponentConcept[Concept[@preferredName=C42775]][@primaryFlag=Yes] http://cadsrapi.nci.nih.gov/cadsrapi41/GetHTML?query=DataElement,DataElementConcept,Property,ConceptDerivationRule&ComponentConcept[Concept[@longName=E-mail%20Address]][@primaryFlag=Yes] |
http://cadsrapi.nci.nih.gov/cadsrapi41 /GetHTML?query=DataElement,EnumeratedValueDomain,ValueDomainPermissibleValue,PermissibleValue,ValueMeaning,ConceptDerivationRule&ComponentConcept[Concept[@preferredName=C19448]][@primaryFlag=Yes] http://cadsrapi.nci.nih.gov/cadsrapi41 /GetHTML?query=DataElement,EnumeratedValueDomain,ValueDomainPermissibleValue,PermissibleValue,ValueMeaning,ConceptDerivationRule&ComponentConcept[Concept[@longName=Blood and Blood Products]][@primaryFlag=Yes] |
http://cadsrapi.nci.nih.gov/cadsrapi41/GetHTML?query=PermissibleValue,ValueDomainPermissibleValue,EnumeratedValueDomain,ValueDomain&DataElement[@publicID=106][@version=5.1] http://cadsrapi.nci.nih.gov/cadsrapi41/GetHTML?query=PermissibleValue,ValueDomainPermissibleValue,EnumeratedValueDomain,ValueDomain&DataElement[@publicID=106][@latestVersionIndicator=Yes] |
http://cadsrapi.nci.nih.gov/cadsrapi41/GetHTML?query=Concept[@preferredName=C42614] |
Answer: Yes. This can be done through any of the caDSR 4.0 APIs as well as for restricting to Property or a Value Meaning in the CDEs Enumerated Value Domain.
Examples:
1. Retrieve Data Elements with Object Class “Primary” concept named “Blood and Blood Products” (result in HTML)
http://cadsrapi.nci.nih.gov/cadsrapi40/GetHTML?query=DataElement,DataElementConcept,ObjectClass,ConceptDerivationRule&ComponentConcept[Concept[@preferredName=C19448]][@primaryFlag=Yes] |
EXTENSION 1: An extension of this use case is to find all Data Elements where the concept is used either as a primary OR qualifier concept. This is accomplished by removing last qualifier in the query:
[@primaryFlag=Yes] |
Removing this criteria in Example 1 returns 104 results instead of 88.
2. Retrieve Data Elements with Property “Primary” concept named “E-Mail Address”
http://cadsrapi.nci.nih.gov/cadsrapi40/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: i.e. to get DECs with E-Mail address as primary concept, remove "DataElement" (the first item in the query argument list in Example 2):
Retrieve Data Element Concepts with Property “Primary” concept named “E-Mail Address”
http://cadsrapi.nci.nih.gov/cadsrapi40/GetHTML?query=DataElementConcept,Property,ConceptDerivationRule&ComponentConcept[Concept[@longName=E-mail%20Address]][@primaryFlag=Yes] |
3. Retrieve Data Elements with Value Domain's Value Meaning "Primary" concept code= C19448 (Blood and Blood Products”) (result in XML)
http://cadsrapi.nci.nih.gov/cadsrapi40/GetXML?query=DataElement,EnumeratedValueDomain,ValueDomainPermissibleValue,PermissibleValue,ValueMeaning,ConceptDerivationRule&ComponentConcept[Concept[@longName=Blood and Blood Products]][@primaryFlag=Yes] |