Get Concept Model Rules
Overview
The SNOMED CT concept model is the set of rules that determines the permitted sets of relationships between particular types of concepts.
Notes
The concept model specifies the attributes that can be applied to concepts in particular domains and the ranges of permitted values for each attribute. There are additional rules on the cardinality and grouping of particular types of relationships.
Concept model rules are represented in a machine readable form by the members of the following four reference set types:
MRCM Domain Reference Set
Each row in this reference set defines a concept model domain. Each domain is a set of concepts which the concept model permits to be defined or refined, using a particular set of attributes and ranges.
MRCM Attribute Domain Reference Set
Each row in this reference set specifies an concept model attribute that can be used to represent a characteristic of the meaning of a concept or the nature of a refinement.
MRCM Attribute Range Reference Set
Each row in this reference set defines a concept model range that defines a set of values that the concept model permits to be applied to a specific attribute.
MRCM Module Scope Reference Set
The members of this reference set specify the set of MRCM reference sets that should be applied to concepts a specified SNOMED CT module.
For full details of these reference set and the ways in which the rules are represented in these reference sets, refer to the SNOMED CT Machine Readable Concept Model (MRCM) specification and guide.
Requirements and Options
Access to concept model rules is required to support a range of different practical uses including those identified in the 'Interdependencies' section on this page. The general techniques for accessing the data are the same as those for other references sets. However, interpretation of the data requires access to related data in each of the MRCM reference set types. To illustrate this the requirements are listed in the table below and service examples are presented in a logical interrelated order.
Services Required
Get the refsetId of specific type of MRCM reference set applicable to concepts in an identified module
SNOMED CT Edition and Version
The conceptId representing the moduleId
The MRCM reference set type (mrcmDomain, mrcmAttributeDomain or mrcmAttributeRange)
The identifier of the specific MRCM reference set applicable to concept in the specified module.
Client applications do not require access to this data. However, it is required as an internal service to enable other MRCM services.
Get the domain or set of domains that include a specified concept
SNOMED CT Edition and Version
The conceptId for which the domains are to be identified.
An indication of whether domains applicable to proximal primitive definitions are to be included.
The identifiers of the domains to which the identified concept belongs.
Client applications do not require access to this data. However, it is required as an internal service to enable the service service following MRCM services.
Get the set of attribute rules applicable to an identified concept
SNOMED CT Edition and Version The conceptId for which the attribute rules are to be identified.
An indication of whether domains applicable to proximal primitive definitions are to be included. Content type option - one of the following concept identifiers: - 723593002|All new precoordinated SNOMED CT content| - 723594008|All precoordinated SNOMED CT content| - 723595009|All postcoordinated SNOMED CT content|
Each rule should include the content of all additional data columns in the MRCM Attribute Domain reference set. The selected set of attribute domain rules.
Get the range of values applicable to a specified attribute
SNOMED CT Edition and Version The attributeId for which values are to be identified. Content type options (see previous service) The id of the concept to which the attribute is being applied (or the moduleId of the module to which concept belongs) are also required unless provided by internal services.
Each rule should include the content of all the additional data columns in the MRCM Attribute Range reference set.
Interdependencies
Required By
Other Services
Validate Concept Definitions and Expressions
Depends On
Service Examples
The Snowstorm and FHIR examples are presented in plain text and URL encoded versions. Always use the "Encoded URL" when testing the example service requests. The plain text version is included to aid readability but using this version in a service request may result in errors. These errors result from characters that have to be encoded as they are not permitted in a URL (see IETF RFC1738).
Snowstorm API
Get the set of reference sets applicable to concepts in an identified module
This service is supported internally and used by the services below. The relevant data is also directly accessible at the API using the general service used to access refset members as described in Get Data from a Reference Set.
[snowstorm]/snomed-ct/[branchPath]/members?referenceSet=[MrcmModuleScopeRefsetId]&referencedComponentId=[moduleId]&active=true
For example
[snowstorm]/snomed-ct/MAIN/2020-01-31/members?referenceSet=723563008&referencedComponentId=900000000000207008&active=true
Encoded URL
[snowstorm]/snomed-ct/MAIN%2F2020-01-31/members?referenceSet=723563008&referencedComponentId=900000000000207008&active=true
JSON representation of three refset members each of which refers to one of the MRCM reference sets for concepts in the specified module.
The MRCM reference set references is represented by the additionalFields. mrcmRuleRefsetId property.
Get the domain or set of domains that include a specified concept
This service is supported internally and used by the services below. However, it is not directly accessible at the API.
Get the set of attributes applicable to a concept in a specified domain or set of domains
[snowstorm]/snomed-ct/mrcm/[branchPath]/domain-attributes?parentIds=427019001&proximalPrimitiveModeling=%5Btrue%7Cfalse%5D&contentType=%5Bcontent-type%5D%09
For example
[snowstorm]/snomed-ct/mrcm/MAIN/2020-01-31/domain-attributes?parentIds=427019001&proximalPrimitiveModeling=false&contentType=POSTCOORDINATED
Encoded URL
[snowstorm]/snomed-ct/mrcm/MAIN%2F2020-01-31/domain-attributes?parentIds=427019001&proximalPrimitiveModeling=false&contentType=POSTCOORDINATED
Returns a JSON representation of data related to each for the attributes applicable to specified concept.
The data returned is filtered so it only includes data relevant to in the specified contentType.
The data returned includes information from all the columns in the Attribute Domain reference set.
It also includes terms associated with the attribute.
The contentTypeId and ruleStrengthId are represented by human readable tokenized strings rather than the conceptId.
Get the range of values applicable to a specified attribute
Snowstorm does not provide a specific service for returning the attribute range constraint applicable to a concept model attribute. However, it does support access to the relevant data in two ways. Firstly the general service for access to refset members as (see 4.10 Get Data from a Reference Set) can be as illustrated here. Additionally, the Snowstorm service shown in the next row provides a way to carry out a search that is constrained to the permitted set of values for an attribute.
[snowstorm]/snomed-ct/[branchPath]/members?referenceSet=[MrcmAttributeRangeRefsetId]&referencedComponentId=[attributeId]&active=true&contentType=[contentType]
For example
[snowstorm]/snomed-ct/MAIN/2020-01-31/members?referenceSet=723562003&referencedComponentId=260870009&active=true&contentType=POSTCOORDINATED
Encoded URL
[snowstorm]/snomed-ct/MAIN%2F2020-01-31/members?referenceSet=723562003&referencedComponentId=260870009&active=true&contentType=POSTCOORDINATED
Returns a JSON representation of data related to the specified attribute range.
The range data is returned in the following properties of the additionalFields object:
rangeConstraint
attributeRule
contentTypeId
ruleStrengthId
Find values that are within the range or a specified attribute
[snowstorm]/snomed-ct/mrcm/[branchPath]/attribute-values/260870009?contentType=POSTCOORDINATED&termPrefix=[searchTerm]
For example
[snowstorm]/snomed-ct/mrcm/MAIN/2020-01-31/attribute-values/260870009?contentType=POSTCOORDINATED&termPrefix=urg
Encoded URL
[snowstorm]/snomed-ct/mrcm/MAIN%2F2020-01-31/attribute-values/260870009?contentType=POSTCOORDINATED&termPrefix=urg
Returns a JSON representation of the search results constrained by the rangeConstraint.
The data returned is in the same form as documented in the Find Concepts section.
FHIR API
Get concept model rules
N/A
No FHIR terminology services are available to provide detailed information about SNOMED CT concept model rules.
MySQL Example Database
Get the set of reference sets applicable to concepts in an identified module
SELECT mrcmRuleRefsetId,refsetType FROM snap_refset_mrcmmodulescope m JOIN config_refsets r ON r.refsetId=m.mrcmRuleRefsetId WHERE active=1 AND refsetId=723563008 AND referenceComponentId=[moduleId];
For example to get the MRCM refsetIds for 900000000000207008 | SNOMED CT core module|
SELECT mrcmRuleRefsetId,refsetType FROM snap_refset_mrcmmodulescope m JOIN config_refsets r ON r.refsetId=m.mrcmRuleRefsetId WHERE active=1 AND m.refsetId=723563008 AND referencedComponentId=900000000000207008
Alternative approach to get refsetId for a specific MRCM refset for a specific module 900000000000207008 | SNOMED CT core module|
The refsetIds and reference set types of the three MRCM references sets that apply to the specified module.
Get the refsetId of specific type of MRCM reference set applicable to concepts in an identified module
SELECT getMrcmRefsetId([moduleId],[refsetType]);
The MRCM refsetType can be specified either by a single letter (D, A or R) or the full name (mrcmDomain, mrcmAttributeDomain or mrcmAttributeRange).
The first example illustrates use of the full name while the others use the abbreviated style.
SELECT getMrcmRefsetId(900000000000207008,"mrcmDomain");
SELECT getMrcmRefsetId(900000000000207008,"A");
SELECT getMrcmRefsetId(900000000000207008,"R");
Each function call returns a single refsetId.
Get the domain or set of domains that include a specified concept
CALL getMrcmDomains([conceptId],[proxPrim],@domainId, @domainList);
-- Following line shows the results
SELECT @domainId,@domainList;
Example 1. Get the domains that include the concept 71341001 | Bone structure of femur|
CALL getMrcmDomains(71341001,0,@domainId, @domainList);
-- Following line shows the results
SELECT @domainId, @domainList;
Example 2. Get the domains that include the concept 241075002 | Plain X-ray of femur|
CALL getMrcmDomains(241075002,0,@domainId, @domainList);
-- Following line shows the results
SELECT @domainId, @domainList;
Example 3. Get the proximal primitive domains that include the concept 241075002 | Plain X-ray of femur|
CALL getMrcmDomains(241075002,1,@domainId, @domainList);
-- Following line shows the results
SELECT @domainId, @domainList;
This procedure returns two values.
domainId - the most specific domain that includes the specified concept.
domainList - a comma separated list of all the domains that include the specified concept.
Example 1 returns the following set of domains:
domainId: 723264001
domainList: 123037004,91723000,723264001
Example 2 returns the following set of domains
domainId: 386053000
domainList: 71388002,386053000
Example 3 returns the following set of proximal primitive domains
domainList: 71388002,386053000,387713003,433590000
Get the set of attributes applicable to a concept in a specified domain or set of domains
CALL getMrcmAttributeRanges([conceptId],[proxPrim],[contentTypeKey],@ruleSetKey);
-- Following statement shows the attribute ids and terms
SELECT DISTINCT `attributeId`,`term`
FROM `config_mrcmrulesets` `c`
JOIN `snap_pref` `p` ON `c`.`attributeId`=`p`.`conceptId`
WHERE `rulesetKey`=@rulesetKey;
Example 1. Get the attributes applicable to the concept 71341001 | Bone structure of femur| when using postcoordination
CALL getMrcmAttributeRanges(71341001,0,'pos',@ruleSetKey);
-- Following statement shows the attribute ids and terms
SELECT DISTINCT `attributeId`,`term`
FROM `config_mrcmrulesets` `c`
JOIN `snap_pref` `p` ON `c`.`attributeId`=`p`.`conceptId`
WHERE `rulesetKey`=@rulesetKey;
Example 2. Get the attributes and attribute constraints applicable to the concept 71341001 | Bone structure of femur| when using postcoordination.
CALL getMrcmAttributeRanges(71341001,0,'pos',@ruleSetKey);
-- Following statement shows the attribute ids and terms
SELECT `attributeId`,`grouped`, `attributeCardinality`,
`attributeInGroupCardinality`, `attributeContentTypeId`,
`attributeRuleStrengthId`, `rangeConstraint`,
`rangeContentTypeId`, `rangeRuleStrengthId`
FROM `config_mrcmrulesets` WHERE `rulesetKey`=@rulesetKey;CALL getMrcmDomains(241075002,0,@domainId, @domainList);
-- Following line shows the results
SELECT @domainId, @domainList;
The getMrcmAttributeRanges procedure generates rows in the config_mrcmrulesets table. It returns a rulesetKey which can be used to query the generated rows. These rows contain not only the attributes but also range constraints.
Both examples get the attributes applicable to the same concept but the results returned by the select queries vary in content.
Example 1 returns the attributeId and preferred terms for each attribute applicable to the specified concept in the context specified by the proximal primitive and content type settings.
Example 2 returns all valid combinations of attributes and attribute range constraints applicable to the specified concept specified in the context specified by the proximal primitive and content type settings.
Get the range of values applicable to a specified attribute
As noted above, the getMrcmAttributeRanges procedure returns the attribute ranges of all attributes applicable to a concept. However, it is also possible to return the attribute range for specific attribute.
SET @attributeId=[attributeId];
SET @contentTypeIdList=[contentTypeIdList];
SET @moduleId=[moduleId];
SELECT `rangeConstraint`, `contentTypeId`, `ruleStrengthId`
FROM `snap_refset_mrcmattributerange`
WHERE `refsetId`= getMrcmRefsetId(@moduleId,"R");
AND `r`.`active`=1
AND FIND_IN_SET(`r`.`contentTypeId`,@contentTypeIdList)>0;
Example. Get all the attribute range constraints applicable to the concept 71341001 | Bone structure of femur| when using postcoordination
SET @attributeId=260870009;
SET @contentTypeIdList="723596005,723594008";
SET @moduleId=900000000000207008;
SELECT `rangeConstraint`, `contentTypeId`, `ruleStrengthId`
FROM `snap_refset_mrcmattributerange`
WHERE `refsetId`= getMrcmRefsetId(@moduleId,"R") AND `referencedComponentId`=@attributeId AND `active`=1 AND FIND_IN_SET(`contentTypeId`,@contentTypeIdList)>0;
Returns the rangeConstraint for the attribute and the the contentTypeId and ruleStrengthId. In some cases more than one row may be returned where there are rules with different strengths or applicable to different subsumed contentTypes.
Notes
Language and/or dialect should be specified if the service returns terms associated with referenced concepts.
In the Snowstorm service requests [snowstorm] should be replaced by the URL to the Snowstorm server endpoint.
In the FHIR service requests [fhir] should be replaced by the URL to the FHIR terminology server endpoint. FHIR® is a registered trademarks of HL7 (www.hl7.org).
The SNOMED CT MySQL example database is not designed as a terminology server and is not intended for use in a live system . It is referenced in this guide as an illustration that some readers may find helpful. For more information about the SNOMED CT example database see the SNOMED CT - SQL Practical Guide. For instructions on how to build the example database refer to Appendix A: Building the SNOMED CT Example Database.
Last updated