Back to top

Local Data Management REST interface

Query

Create a new query

POST/requests

Create a new query based on a xml file.

Request
HideShow
Headers
Content-Type: application/xml
Body
<?xml version="1.0" encoding="UTF-8"?>
<View>
    <Query id="12345678">
        <Where>
            <And>
                <Gt>
                    <Attribute>
                        <MdrKey>urn:mdr:dataelement:311:1</MdrKey>
                        <Value>Tue, 01 Oct 2013 08:12:31 GMT</Value>
                    </Attribute>
                </Gt>
                <Leq>
                    <Attribute>
                        <MdrKey>urn:mdr:dataelement:312:1</MdrKey>
                        <Value>Tue, 08 Oct 2013 04:00:00 GMT</Value>
                    </Attribute>
                </Leq>
            </And>
        </Where>
    </Query>
    <ViewFields>
        <MdrKey>urn:mdr:dataelement:4:1</MdrKey>
        ...
        <MdrKey>urn:mdr:dataelement:62:1</MdrKey>
        ...
        <MdrKey>urn:mdr:dataelement:87:1</MdrKey>
    </ViewFields>
</View>
Response  201
HideShow
Headers
Location: /requests/123
Response  400

Retrieve the query statistics

GET/requests/{requestid}/stats

Retrieve the statistics for a query identified by its ID

Parameters
HideShow
requestid
string (required) Example: 123

the ID of the request

Request
HideShow
Headers
Content-Type: application/xml
Response  200
HideShow
Body
<?xml version="1.0" encoding="UTF-8"?>
<queryResultStatistic>
  <requestId>123</requestId>
  <numberOfPages>66</numberOfPages>
  <totalSize>653</totalSize>
</queryResultStatistic>
Response  422
HideShow
Body
<?xml version="1.0" encoding="UTF-8"?>
<Error errorCode="100" xmlns="http://schema.samply.de/ccp/Error">
    <Description>Query contained unknown MDR-Keys</Description>
    <MdrKey>urn:mdr:dataelement:17:1</MdrKey>
    <MdrKey>urn:mdr:dataelement:33:1</MdrKey>
</Error>

Retrieve the query result

GET/requests/{requestid}/result{?page}

Retrieve the statistics for a query identified by its ID

Parameters
HideShow
requestid
string (required) Example: 123

the ID of the request

page
string (required) Example: 1

The page number

Request
HideShow
Headers
Content-Type: application/xml
Response  200
HideShow
Body
<?xml version="1.0" encoding="UTF-8"?>
<QueryResult>
    <Patient id="dktk_patient_0004">
        <Case id="dktk_case_0101">
            <Container id="2343254" designation="Diagnosis">
                <Attribute>
                    <MdrKey>urn:mdr:dataelement:4:1</MdrKey>
                    <Value>Male Phenotype</Value>
                </Attribute>
            </Container>
            <Attribute>
                <MdrKey>urn:mdr:dataelement:62:1</MdrKey>
                <Value>No</Value>
            </Attribute>
        </Case>
        <Sample id="dktk_sample_12221">
            <Attribute>
                <MdrKey>urn:mdr:dataelement:85:1</MdrKey>
                <Value>foobar</Value>
            </Attribute>
            <Attribute>
                <MdrKey>urn:mdr:dataelement:87:1</MdrKey>
                <Value>793087672</Value>
            </Attribute>
            <Attribute>
                <MdrKey>urn:mdr:dataelement:89:1</MdrKey>
                <Value>27.08.2009</Value>
            </Attribute>
        </Sample>
    </Patient>
</QueryResult>
Response  202

Generated by aglio on 11 Sep 2015