Sets and classes: Difference between revisions

From Discovery Data Service
Jump to navigation Jump to search
No edit summary
Line 67: Line 67:


Value set expressions are often referred to as expression constraints. In [https://confluence.ihtsdotools.org/display/DOCECL/Expression+Constraint+Language+-+Specification+and+Guide Snomed-CT expression constraint language] is essentially the same grammar as the Discovery value set class expression. 
Value set expressions are often referred to as expression constraints. In [https://confluence.ihtsdotools.org/display/DOCECL/Expression+Constraint+Language+-+Specification+and+Guide Snomed-CT expression constraint language] is essentially the same grammar as the Discovery value set class expression. 
 


== Value set transitive closure ==
== Value set transitive closure ==

Revision as of 12:25, 16 May 2020

A value set definition, and it's run time counterpart- value set transitive closure  , is a set of class expressions collected together for a particular business purpose.

There are a range of purposes for a value set. Examples range from defining a data set according to a set of recorded concepts, indicating the expected range of a property in a health record, or testing the presence of a feature in a patient record. 

Value sets are one of the main 4 packages within the common information model:

IM Package Value set.jpg


Value set class and language

A value set class is best conceptualised in UML terms as a package whose elements are class expressions.

All value sets and the class expressions use concepts from the semantic ontology and the following shows the relationship between the two.

Value set class.png

A value set class definition looks very much like a semantic ontology class expression,  in that it uses similar grammar and syntax. In fact a value set can also be defined in OWL2 language.

In this example a non hospital face to face consultation value set is defined as

"is a type of GP consultation value set, and has members which are (on premise encounters, excluding hospital outpatients)

Discovery syntax

{ "iri": ":VSET_NonHospFaceToFace",
  "name": ":face to face consultations excluding hospital outpatients",
	  "SubClassOf": [{
		 "Intersection": [
		    { "Class": ":VSET_GPConsultations" },
		    { "ObjectSome":{
                        "Property": ":CM_hasMember",
                        "Intersection": [
                        {"Class": ":CM_OnPremiseEncounter"},
                        {"Negation": { "Class": ":DM_HospitalOpdEntry"}}]}}]}]}}


OWL2 functional syntax

SubClassOf(:VSET_EncFaceToFaceOnPrem
   ObjectIntersectionOf(:VSET_GPConsultations 
          ObjectSomeValuesFrom(:CM_hasMember 
              ObjectIntersectionOf(:CM_OnPremiseEncounter :ObjectComplementOf(:DM_HospOpdEntry))))


The difference is mostly in how they are used. Members of the value set set may or may not shared similar properties and therefore may be semantically diverse.  Nevertheless the class expression members of the value set are class expressions with semantic meaning, because each member is used to define a set of concepts by applying a subsumption test to each of the ontology concepts and the target record concepts.

To put this another way, a value set has members, and each member of the value set is a set of members subsumed by that member!

From the above, it can be seen that value set definition expressions may use complex class expressions. In some cases this expression may already be part of a class definition. For example in the above case, a pre-coordinated named class "Home visit" would be a subclass of a Consultation with the care setting of home. Whether expressions in value sets are complex and simple depend entirely on convenience. However, value set editorial policy would encourage value set authors to use pre-defined classes as the ontology is the best place for these to be maintained.

Value set member expression vs ontology expression

The two are seemingly identical and often the same in terms of syntax. However, a value set expression is used in a different way when used for subsumption testing of the concepts in the ontology.

When using the value set at run time to undertake subsumption testing of other concepts,  the ontology query uses a closed world assumption  when handling negation. In a pure OWL2 ontology, which uses the open world assumption, an expression that uses exclusion will often return no subsumed concept. This is because in the open world, it may be undecidable whether a particular concepts should be excluded or not, unless the ontology author had specifically made sure that the concept was disjoint or negated by some other logic.

Value set expressions are often referred to as expression constraints. In Snomed-CT expression constraint language is essentially the same grammar as the Discovery value set class expression. 

Value set transitive closure

For those operating large scale queries using relational databases, it could be normal practice to use a value set transitive closure table, or list.

The value set generator API supports the means by which a value set definition can return a set of all known concepts in the ontology that are  subsumed by the defintion.