NIH | National Cancer Institute | NCI Wiki  

Contents of this Page

Introduction

This document is a section of the LexEVS 5.x Programmer's Guide.

The LexEVS Data Grid Service is a standard caGrid Data service based on the LexEVS 2009 Model.

For complete documentation on caGrid Data Services, see caGrid Data Service Documentation.

Querying The System

To query the LexEVS Data Grid Service, use the standard caGrid CQL query method to compose queries. See caGrid Data Service API Documentation for more information.

Example LexEVS queries follow.

Query for a Concept with a Specific Code

  • Example: Concept: C12345
    Java Code Snippet
    <CQLQuery xmlns="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
        <Target name="org.LexGrid.concepts.Concept">
            <Attribute name="_entityCode" value="C12345" predicate="EQUAL_TO"/>
        </Target>
    </CQLQuery>
    

Query for a Concept with a Specific Presentation Text

  • Example: A concept with a namespace 'SNOMED Clinical Terms' that contains a Presentation equal to 'Heart'
    Java Code Snippet
    <ns1:CQLQuery xmlns:ns1="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
        <ns1:Target name="org.LexGrid.concepts.Entity">
            <ns1:Group logicRelation="AND">
                <ns1:Association name="org.LexGrid.concepts.Presentation" roleName="_presentationList">
                    <ns1:Group logicRelation="AND">
                        <ns1:Association name="org.LexGrid.commonTypes.Text" roleName="_value">
                            <ns1:Group logicRelation="AND">
                                <ns1:Attribute name="_content" predicate="EQUAL_TO" value="Heart"/>
                            </ns1:Group>
                        </ns1:Association>
                    </ns1:Group>
                </ns1:Association>
                <ns1:Attribute name="_entityCodeNamespace" predicate="EQUAL_TO" value="SNOMED Clinical Terms"/>
            </ns1:Group>
        </ns1:Target>
    </ns1:CQLQuery>
    

Restrict Results to Specific Attributes

  • Example: Retrieve all of the 'localIds' of any 'SupportedAssociation' in the system.
    Java Code Snippet
    <ns1:CQLQuery xmlns:ns1="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
        <ns1:Target name="org.LexGrid.naming.SupportedAssociation"/>
        <ns1:QueryModifier countOnly="false">
            <ns1:DistinctAttribute>_localId</ns1:DistinctAttribute>
        </ns1:QueryModifier>
    </ns1:CQLQuery>