Entity subtype attribute: Difference between revisions

From Discovery Data Service
Jump to navigation Jump to search
No edit summary
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:


 Within the ontology, a data model entity may be a subclass of another data model entity, which means that it is a more specialised class than its super entity. The entity will also have a number of business purpose specific attributes which tend to relate to the meaning of the entity but are defined according to the healthcare business they are used in.
Within the ontology, a data model entity may be a subclass of another data model entity, which means that the sub-entity is a more specialised class than its super entity. The sub-entity will have a number of business purpose specific attributes, defined according to the healthcare business they are used in.


When implementing a data model entity in a relational or graph database, it is extremely unlikely that an implementor would create one table or one node type per entity. There would be potentially thousands, many of which would have identical properties and thus breach basic relational normalisation rules. Even where entities have slightly different attributes, it is unlikely that an additional table would be produced for each. More likely some form of extension capability such as a key value pair would be used.
When implementing a data model entity in a relational or graph database, it is extremely unlikely that an implementer would create one table or one node type per entity. There would be potentially thousands, many of which would have identical properties and thus breach basic relational normalisation rules. Even where entities have slightly different attributes, it is unlikely that an additional table would be produced for each. More likely some form of extension capability such as a key value pair or triple table would be used.


A solution must be found the problem of data model logical entities versus database tables or node types.
Implementers would probably create a few high level tables to which many scores of sub-entities would map. A solution must be found the problem of  sub-classing in the data model versus database tables or node types.
 
Implementors would probably create a few high level tables to which many scores of sub-entities would map.
 
A question then arises as to how implementors would indicate the data model entity’s sub type so that business logic and query can be sure of entities that must be examined and the attributes they can query.


Consider the following intuitive statements.
Consider the following intuitive statements.
Line 16: Line 12:
2.       A blood pressure recording is a type of observation.
2.       A blood pressure recording is a type of observation.


To indicate the sub type, most implementors would implement a field that dictated the type or code a ‘type field’ or ‘code field’ as FHIR does.  To apply this a special mapping property type ‘Entity sub Type property’ is defined in the ontology.
To indicate the sub type, most implementers would implement a field that dictated the type or code a ‘type field’ or ‘code field’ as FHIR does.  To apply this a special mapping property type ‘Sub Type property’ is defined in the data map.


This can be relied on to drive business logic when populating or querying a record. In the above example, the following would be stored in the actual record entry:
This can be relied on to drive business logic when populating or querying a record. In the above example, the following could be stored in the actual record entry:


to the above statements the following could be found in the data model/ schema map.
 
<pre>{
} "DataModelEntity":"DM_Encounter",
 
  "SchemaEntity":"encounter",


    "EntitySubType":{
{| border="1" cellpadding="1" cellspacing="1" style="width: 500px;"
&nbsp;          "Property":"DM_type",  // The entity sub type field of encounter table is “type”
|-
            "Class":"DM_Encounter"    // the subtype must be a subtype of encounter}},
| '''Table'''
| '''Field'''
| '''Value'''
|-
| Encounter
| type
| Accident and emergency
|-
| Observation
| type
| Blood pressure
|}


{"DataModelEntity":"DM_Observation",
The following could be found in the IN to schema map.
        "SchemaEntity":"observation",
<syntaxhighlight lang="json">
        "EntitySubType":{
{"Mapping": [
&nbsp;                      "Property":"DM_type",   // The entity sub type field of observation table is “type”
      {
&nbsp;                      "Class":"DM_Observation" the type value must be a subtype of observation}</pre>
        "IMSource": {
          "IMClass": ":DM_Encounter"
        },
        "DBTarget": {
          "Schema":"Compass_version1",
          "Table": "encounter",
          "SubTypeField": "type" } }}
</syntaxhighlight>


This is in effect a tautology as it says that an encounter table has a type field whose value is an encounter!
This is in effect a tautology as it says that an encounter table has a type field whose value is an encounter!
This appears to be a self-referencing or reflexive property. However, when used at run time the value uses a concept as a value of the type property:
Table&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Field&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Value
Encounter&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Accident and emergency attendance
Observation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Blood pressure


On other words, the implementation map can make full use of the entity sub type hierarchy when mapping and searching the records,&nbsp; knowing that subtypes are indicated using the mapped ‘Entity Type property’, and&nbsp; can deduce the pattern of the data to be processed.
On other words, the implementation map can make full use of the entity sub type hierarchy when mapping and searching the records,&nbsp; knowing that subtypes are indicated using the mapped ‘Entity Type property’, and&nbsp; can deduce the pattern of the data to be processed.


In the blood pressure example, the data model would probably be authored as follows
In the blood pressure example, the data model would probably be authored as follows:
 
<pre style="color:#8e44ad;"> {Entity:[{
Entity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Attribute&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Range&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cardinality
          "IRI": "DM_Obs_SystolicBloodPressure",
 
        "Relationship":[ {
Systolic blood pressure&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; is component&nbsp;of&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Blood pressure&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0:1
            "IRI"="RM_isSubcomponentOf",
 
            "Range": "DM_Obs_BloodPressure" } },
Diastolic blood pressure&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; is component&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Blood pressure&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0:1
          {
          "IRI":"DM_Obs_DiastolicBloodPressure",
          "Relationship": {
            "IRI"="RM_isSubcomponenttOf",
            "Range": "DM_Obs_BloodPressure" } }]}
</pre>


And because ‘is component of ’ had an inverse property axiom which states the inverse property of ‘has component’, the following is automatically calculated:
And because ‘is component of ’ had an inverse property axiom which states the inverse property of ‘has component’, the following is automatically calculated:
<pre style="color:#8e44ad;"> {Entity:[{
          "IRI": "DM_Obs_BloodPressure",
        "Relationship": [{
            "IRI"="RM_hasSubcomponent",
            "Range": "DM_Obs_SystolicBloodPressure" },
            {
            "IRI"="RM_hasSubcomponent",
            "Range": "DM_Obs_Diastolic_BloodPressure" } }]}
</pre>


Entity&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Attribute&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Range&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cardinality
Within the ontology the “Blood pressure” observation has a display algorithm property used to indicate that a blood pressure has a special way of being displayed.
 
Blood pressure&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; has component&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Systolic blood pressure 0:*
 
Blood pressure&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; has component&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Diastolic blood pressure 0:*
 
&nbsp;
 
Within the data model the “Blood pressure” observation has a display algorithm property used to indicate that a blood pressure has a special way of being displayed.


Consequently the business logic can rely on the concept of blood pressure in the type property to display the blood pressure’s two parts in a special way e.g. 120/80.
Consequently the business logic can rely on the concept of blood pressure in the type property to display the blood pressure’s two parts in a special way e.g. 120/80.

Latest revision as of 15:46, 26 May 2020

Within the ontology, a data model entity may be a subclass of another data model entity, which means that the sub-entity is a more specialised class than its super entity. The sub-entity will have a number of business purpose specific attributes, defined according to the healthcare business they are used in.

When implementing a data model entity in a relational or graph database, it is extremely unlikely that an implementer would create one table or one node type per entity. There would be potentially thousands, many of which would have identical properties and thus breach basic relational normalisation rules. Even where entities have slightly different attributes, it is unlikely that an additional table would be produced for each. More likely some form of extension capability such as a key value pair or triple table would be used.

Implementers would probably create a few high level tables to which many scores of sub-entities would map. A solution must be found the problem of  sub-classing in the data model versus database tables or node types.

Consider the following intuitive statements.

1.       An accident and emergency attendance is a type of health event.

2.       A blood pressure recording is a type of observation.

To indicate the sub type, most implementers would implement a field that dictated the type or code a ‘type field’ or ‘code field’ as FHIR does.  To apply this a special mapping property type ‘Sub Type property’ is defined in the data map.

This can be relied on to drive business logic when populating or querying a record. In the above example, the following could be stored in the actual record entry:

 

Table Field Value
Encounter type Accident and emergency
Observation type Blood pressure

The following could be found in the IN to schema map.

{"Mapping": [
      {
        "IMSource": {
          "IMClass": ":DM_Encounter"
        },
        "DBTarget": {
          "Schema":"Compass_version1",
          "Table": "encounter",
          "SubTypeField": "type" } }}

This is in effect a tautology as it says that an encounter table has a type field whose value is an encounter!

On other words, the implementation map can make full use of the entity sub type hierarchy when mapping and searching the records,  knowing that subtypes are indicated using the mapped ‘Entity Type property’, and  can deduce the pattern of the data to be processed.

In the blood pressure example, the data model would probably be authored as follows:

 {Entity:[{
          "IRI": "DM_Obs_SystolicBloodPressure",
         "Relationship":[ {
             "IRI"="RM_isSubcomponentOf",
             "Range": "DM_Obs_BloodPressure" } },
           {
           "IRI":"DM_Obs_DiastolicBloodPressure",
           "Relationship": {
             "IRI"="RM_isSubcomponenttOf",
             "Range": "DM_Obs_BloodPressure" } }]}

And because ‘is component of ’ had an inverse property axiom which states the inverse property of ‘has component’, the following is automatically calculated:

 {Entity:[{
          "IRI": "DM_Obs_BloodPressure",
         "Relationship": [{
             "IRI"="RM_hasSubcomponent",
             "Range": "DM_Obs_SystolicBloodPressure" },
             { 
             "IRI"="RM_hasSubcomponent",
             "Range": "DM_Obs_Diastolic_BloodPressure" } }]}

Within the ontology the “Blood pressure” observation has a display algorithm property used to indicate that a blood pressure has a special way of being displayed.

Consequently the business logic can rely on the concept of blood pressure in the type property to display the blood pressure’s two parts in a special way e.g. 120/80.

 

 

 

)