If the LOINC Ontology has been loaded in a relational database using a model that complies with the RF2 specification for tables and column names, the content can be accessed using SQL queries in line with the examples below. To Set up SNOMED CT in a relational database, please follow the guidance and instructions provided in the SQL Practical Guide.
Service Name | SQL Query 6 | Result |
Get all members of the reference set The reference set used in this example is: 635111010000100 |Logical Observation Identifiers Names and Codes Orderable Reference Set (foundation metadata concept)| | SELECT referencedComponentId FROM snap_refset_simple WHERE active=1 AND refsetId=[refsetId]; for example SELECT referencedComponentId FROM snap_refset_simple WHERE active=1 AND refsetId=635111010000100; | Returns the ids of all the concepts or descriptions that are the members of the reference set. |
Test if a concept is a member of the reference set The concept used in this example is: | SELECT count(referencedComponentId) FROM snap_refset_simple WHERE active=1 AND refsetId=[refsetId] AND referencedComponentId=[candidateComponentId]; for example SELECT count(referencedComponentId) FROM snap_refset_simple WHERE active=1 AND refsetId=635111010000100 AND referencedComponentId=141951010000102; | Returns:
|