RadLex API

From MircWiki
Revision as of 21:34, 25 February 2007 by Johnpaulett (talk | contribs)
Jump to navigation Jump to search

Warning: This documentation is currently being updated to reflect version 2 of the servlet. Changes should be be official

RadLex Term Browser

1 XML API

File get* Parameters Currently Implemented Details Return Format
getTermById radlexID Yes Return a single term with its ID = radlexID <term>
getChildren

radlexID<br> [relationType]

Yes Returns all terms that have that radlexID as a parent and are related to the parent via the relationType. If no e relationtype is present, all children of that radlexID will be returned. <children>
getTree

baseID<br> relationType<br> [radlexID]

Yes Returns all links starting with the baseID as the root term related via the relationType. If no radlexID is present only a single layer of children below the baseID term will be returned. If radlexID is present, all nodes that will create the structure from the baseID term to the radlexID term are given—this is “filled” out with all the children of the nodes. That is, if baseID = A and radlexID = a1, and A has children a, b, c, d, and a has children a1, a2, a3. The links of all of A’s children will be given, followed by all of a’s children.
The baseID is also linked to its parent—the true root term for the ontology will be have an id=“ROOT”.
<links>
search

query<br> [returnType]

Yes Performs a search based upon the query parameter. returnType can equal “reduced” or “full”. If “reduced”, only matching radlexID’s and term name’s will be returned. If “full”, the full term structure will be returned for each match <terms> (Reduced)
getRelationTypes   Yes Returns a list of all the currently supported relationTypes. (See Relation Types below) <relationTypes>
  • HTTP post is redirected to get

2 Relation Types

  • preferred
  • isa
  • partof
  • branchof
  • segmentof
  • tributaryof
  • continuouswith
  • containedin
  • memberof
  • synonymof


3 Error Codes

id meaning
1 Radlex ID is not valid
2 Radlex ID could not be found
3 Relationship type is not valid
4 Database connection error
5 Insufficient http get parameters.
6 No search results matching query


4 XML Documents Structure

4.1 <error> Format

<program>
  <error id="2">Radlex ID could not be found</error>
</program>


4.2 <term> Format

<term id="RID2">
  <name>Thorax</name>
  <definition>A definition</definition>
  <comment>A comment</comment>
  <source>Chest Committee</source>
  <dateCreated></dateCreated>
  <termStatus></termStatus>
  <versionNumber>Chest Committee</versionNumber>
  <acr id="A44445">Chest</acr>
  <snomed id="SN44545">Chest</snomed>
  <umls id="CUI4545848">Thorax</umls>
  <parents>
    <parent id="RID1" relationType="partof" preferred="1">Anatomical Terms</parent>
  </parents>
  <children>
    <child id="RID3" relationType="partof" preferred="1">Lungs</child>
  </children>
</term>

4.3 <terms> Reduced Format

<terms>
  <term id="RID2">
    <name>Thorax</name>
  </term>
  …
</terms>

4.4 <terms> Full Format

<terms>
  <term id="RID2">
  <name>Thorax</name>
  <definition>A definition</definition>
  <comment>A comment</comment>
  <source>Chest Committee</source>
  <acr id="A44445">Chest</acr>
  <snomed id="SN44545">SNChest</snomed>
  <umls id="CUI4545848">Thorax</umls>
    <parents><parent id="RID1" relationType="partof" preferred="1">Anatomical Terms</parent>
  </parents>
  <children>
    <child id="RID3" relationType="partof" preferred="1">Lungs</child>
  </children>
  </term>
  …
</terms>

4.5 <links> Format

<links>
  <link parent="RID0" id="RID1" relationType="partof" preferred="1">Anatomical Terms</link>
  <link parent="RID1" id="RID5" relationType="isa" preferred="1">Legs</link>
  <link parent="RID1" id="RID4" relationType="partof" preferred="1">Abdomen</link>
  <link parent="RID1" id="RID2" relationType="partof" preferred="1">Thorax</link>
  …
</links>

4.6 <children> Format

<children parent="RID2">
  <child id="RID3" relationType="partof" preferred="1">Lungs</child>
  …
</children>

4.7 <relationTypes> Format

<relationTypes>
  <relationType>preferred</relationType>
  <relationType>isa</relationType>
  <relationType>partof</relationType>
  <relationType>tributaryof</relationType>
  <relationType>branchof</relationType>
  <relationType>segmentof</relationType>
  <relationType>continuouswith</relationType>
  <relationType>containedin</relationType>
  <relationType>memberof</relationType>
</relationTypes>

5 API Description

5.1 search

URI: http://radlex.org/search
Parameters: query - a string of the term, ID, or phrase to search for

Utilizes 3 types of search:

  1. If the query matches "^RID([0-9]+)$", a search for that radlexID is performed, which should yield 0 or 1 results. If 1 result is found, the search exits and returns that one value.
  2. If the query has fewer than 4 characters, the database is queried via several LIKE statements. The 4 character minimum is a result of MySQL's Fulltext Search default limit. The query will return all, if any, matches and exit the search.
  3. If the search has not already been exited, a MySQL Fulltext Search will be initiated on the database. This is the preferred method, as it uses MySQL's native natural language search (MySQL Documentation).