SNOMED Documentation Search


 Other Documents
Skip to end of metadata
Go to start of metadata

Current Version - Under Revision

A terminology server should enable a client application to rapidly find the current version of any Relationship or set of Relationships by any of the following criteria:

Once a Relationship has been found the client application should be able to read the values of any of the properties of that Relationship :

Using and traversing Relationships

The defining Relationships of a concept can be shown by following the relevant concept identifier and displaying the relevant terms as showing in .

/* sv_relationship is a snapshot view of the relationship file */

/* sv_pref is a snapshot of descriptions filtered to preferred term */

SELECT `r`.`typeId` AS `type_id`,`typ`.`term` AS `type_term`

,`r`.`destinationId` AS `dest_id`,`dest`.`term` AS `dest_term`

,`r`.`relationshipGroup` AS `relationshipGroup`

FROM (((`sv_relationship` `r`

JOIN `sv_pref` `src`

ON ((`r`.`sourceId` = `src`.`conceptId`)))

JOIN `sv_pref` `typ`

ON ((`r`.`typeId` = `typ`.`conceptId`)))

JOIN `sv_pref` `dest`

ON ((`r`.`destinationId` = `dest`.`conceptId`)))

WHERE ((`r`.`active` = 1)

AND (`r`.`characteristicTypeId` = 900000000000006009)

AND (`r`.`sourceId` = [some-concept-id])));

Figure 39. Showing the defining Relationships of a concept

A simplification of the defining Relationship query can be used to return the supertype parent concepts as shown in .

/* sv_relationship is a snapshot view of the relationship file */

/* sv_pref is a snapshot of descriptions filtered to preferred term */

SELECT `r`.`destinationId` AS `id`,`d`.`term` AS `term`,`r`.`sourceId` AS `conceptId`

FROM (`sv_relationship` `r`

JOIN `sv_pref` `d`

ON ((`r`.`destinationId` = `d`.`conceptId`)))

WHERE ((`r`.`active` = 1)

AND (`r`.`typeId` = 116680003)

AND (`r`.`sourceId` = [some-concept-id])));

Figure 40. Showing the supertype parents of a concept

By swapping the sourceId and destinationId from the previous example the subtype children of the concept can be displayed as shown in .

/* sv_relationship is a snapshot view of the relationship file */

/* sv_pref is a snapshot of descriptions filtered to preferred term */

SELECT `r`.`sourceId` AS `id`,`d`.`term` AS `term`,`r`.`destinationId` AS `conceptId`

FROM (`sv_relationship` `r`

JOIN `sv_pref` `d`

ON ((`r`.`sourceId` = `d`.`conceptId`)))

WHERE ((`r`.`active` = 1)

AND (`r`.`typeId` = 116680003)

AND (`r`.`destinationId` = [some-concept-id])));

Figure 41. Showing the subtype children of a concept


Feedback