# 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.

{% hint style="info" %}
**Notes**

* An *attribute* is assigned a value (attribute value pair) when used in the definition of a concept or in a postcoordinated expression.

* The *attributes* that can be used in *definitions* or *refinements* are represented by a concepts that are subtypes of the concept 410662002 | Concept model attribute (attribute)| .

* The SNOMED CT concept model specifies:
  * The concept model domains which each specific *attribute* can be applied; and
  * The concept model range of values that can be applied to each specific *attribute*.
    {% endhint %}

* 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.

{% hint style="info" %}
Client applications do not require access to this data. However, it is required as an internal service to enable other MRCM services.
{% endhint %}

#### Services Required

| Service Name and Status                                                                                    | Input                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Output                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ---------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Get the refsetId of specific type of MRCM reference set applicable to concepts in an identified module** | <p>SNOMED CT Edition and Version</p><p>The conceptId representing the moduleId</p><p>The MRCM reference set type (mrcmDomain, mrcmAttributeDomain or mrcmAttributeRange)</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | <p>The identifier of the specific MRCM reference set applicable to concept in the specified module.</p><div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p>Client applications do not require access to this data. However, it is required as an internal service to enable other MRCM services.</p></div>                                                                                                                                                                                         |
| **Get the domain or set of domains that include a specified concept**                                      | <p>SNOMED CT Edition and Version</p><p>The conceptId for which the domains are to be identified.</p><p>An indication of whether domains applicable to proximal primitive definitions are to be included.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>The conceptId can be used to get the required moduleId and then, using the service above, the appropriate MRCM Domain reference set can be identified.</p><p>The general process for identifying the domains that include a specified concept is as follows:</p><ul><li>Identify the top-level domain that subsumes the concept.</li><li>Identify each of the domains that is a child or descendant of that top level domain.</li><li><p>The concept is included the top-level domain that subsumes the concept and any of its child and descendant domains that which have expression constraints to which it conforms.</p><ul><li><p>The expression constraint tested depends proximal primitive indicator value</p><ul><li>False: Conformance with the domainConstraint is required.</li><li>True: Conformance with the proximalPrimitiveConstraint is required.</li></ul></li></ul></li></ul></div> | <p>The identifiers of the domains to which the identified concept belongs.</p><div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p>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.</p></div>                                                                                                                                                                                          |
| **Get the set of attribute rules applicable to an identified concept**                                     | <p>SNOMED CT Edition and Version The conceptId for which the attribute rules are to be identified.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>The required internal services above are used to identify the domains that include the concept.</p></div><p>An indication of whether domains applicable to proximal primitive definitions are to be included. Content type option - one of the following concept identifiers:<br>- 723593002</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | All new precoordinated SNOMED CT content                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | <p>Each rule should include the content of all the additional data columns in the MRCM Attribute Range reference set.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>The selected set of attribute domain rules. Conformance with the rangeConstraint expression is determined by applying the expression constraint to a specific value. The rangeConstraint can also be used filter the range of permitted refinements to the value of that attribute in postcoordinated expression.</p></div> |

## Interdependencies

### Required By

* Other Services
  * [Validate Concept Definitions and Expressions](https://github.com/SNOMED-Documents/snomed-terminology-services-guide/blob/main/4%20terminology-service-types/broken-reference/README.md)
  * [Test Expression Subsumption](https://docs.snomed.org/snomed-ct-practical-guides/snomed-ct-terminology-services-guide/4-terminology-service-types/4.15-test-expression-subsumption)
* Use Cases
  * [EHR Data Entry](https://docs.snomed.org/snomed-ct-practical-guides/snomed-ct-terminology-services-guide/3-terminology-service-use-cases/support-ehr-data-entry)
  * [EHR Data Entry Design](https://docs.snomed.org/snomed-ct-practical-guides/snomed-ct-terminology-services-guide/3-terminology-service-use-cases/display-ehr-data)
  * [EHR Reporting and Analytics](https://docs.snomed.org/snomed-ct-practical-guides/snomed-ct-terminology-services-guide/3-terminology-service-use-cases/ehr-reporting-and-analytics)
  * [Support Terminology Authoring and Review](https://docs.snomed.org/snomed-ct-practical-guides/snomed-ct-terminology-services-guide/3-terminology-service-use-cases/support-terminology-authoring-and-review)

### Depends On

* [Select Edition and Version](https://docs.snomed.org/snomed-ct-practical-guides/snomed-ct-terminology-services-guide/4-terminology-service-types/4.1-select-edition-and-version)
* [Get a Concept, Description or Relationship](https://docs.snomed.org/snomed-ct-practical-guides/snomed-ct-terminology-services-guide/4-terminology-service-types/4.2-get-a-concept-description-or-relationship)
* [Get Definition of a Concept](https://docs.snomed.org/snomed-ct-practical-guides/snomed-ct-terminology-services-guide/4-terminology-service-types/4.4-get-definition-of-a-concept)
* [Get and Test Concept Subtypes and Supertypes](https://docs.snomed.org/snomed-ct-practical-guides/snomed-ct-terminology-services-guide/4-terminology-service-types/4.5-get-and-test-concept-subtypes-and-supertypes)
* [Get and Test Reference Set Membership](https://docs.snomed.org/snomed-ct-practical-guides/snomed-ct-terminology-services-guide/4-terminology-service-types/4.6-get-and-test-reference-set-membership)
* [Validate and Apply Expression Constraints](https://docs.snomed.org/snomed-ct-practical-guides/snomed-ct-terminology-services-guide/4-terminology-service-types/4.7-validate-and-apply-expression-constraints)
* [Get Data from a Reference Set](https://docs.snomed.org/snomed-ct-practical-guides/snomed-ct-terminology-services-guide/4-terminology-service-types/4.10-get-data-from-a-reference-set)

## 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](https://www.ietf.org/rfc/rfc1738.txt)).

#### Snowstorm API

<table><thead><tr><th>Service Name</th><th>API Call 2</th><th>Result</th></tr></thead><tbody><tr><td><strong>Get the set of reference sets applicable to concepts in an identified module</strong></td><td><p>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<a href="4.10-get-data-from-a-reference-set"> Get Data from a Reference Set</a>.</p><pre data-overflow="wrap"><code>[snowstorm]/snomed-ct/[branchPath]/members?referenceSet=[MrcmModuleScopeRefsetId]&#x26;referencedComponentId=[moduleId]&#x26;active=true
</code></pre><p>For example</p><pre data-overflow="wrap"><code>[snowstorm]/snomed-ct/MAIN/2020-01-31/members?referenceSet=723563008&#x26;referencedComponentId=900000000000207008&#x26;active=true
</code></pre><hr><p><em>Encoded URL</em></p><pre data-overflow="wrap"><code>[snowstorm]/snomed-ct/MAIN%2F2020-01-31/members?referenceSet=723563008&#x26;amp;amp;referencedComponentId=900000000000207008&#x26;amp;active=true
</code></pre></td><td><p>JSON representation of three refset members each of which refers to one of the MRCM reference sets for concepts in the specified module.</p><ul><li>The MRCM reference set references is represented by the additionalFields. mrcmRuleRefsetId property.</li></ul></td></tr><tr><td><strong>Get the domain or set of domains that include a specified concept</strong></td><td>This service is supported internally and used by the services below. However, it is not directly accessible at the API.</td><td></td></tr><tr><td><strong>Get the set of attributes applicable to a concept in a specified domain or set of domains</strong></td><td><pre data-overflow="wrap"><code>[snowstorm]/snomed-ct/mrcm/[branchPath]/domain-attributes?parentIds=427019001&#x26;amp;amp;proximalPrimitiveModeling=%5Btrue%7Cfalse%5D&#x26;amp;contentType=%5Bcontent-type%5D%09
</code></pre><p>For example</p><pre data-overflow="wrap"><code>[snowstorm]/snomed-ct/mrcm/MAIN/2020-01-31/domain-attributes?parentIds=427019001&#x26;proximalPrimitiveModeling=false&#x26;contentType=POSTCOORDINATED
</code></pre><hr><p><em>Encoded URL</em></p><pre data-overflow="wrap"><code>[snowstorm]/snomed-ct/mrcm/MAIN%2F2020-01-31/domain-attributes?parentIds=427019001&#x26;amp;amp;proximalPrimitiveModeling=false&#x26;amp;contentType=POSTCOORDINATED
</code></pre></td><td><p>Returns a JSON representation of data related to each for the attributes applicable to specified concept.</p><p>The data returned is filtered so it only includes data relevant to in the specified contentType.</p><p>The data returned includes information from all the columns in the Attribute Domain reference set.</p><ul><li>It also includes terms associated with the attribute.</li><li>The contentTypeId and ruleStrengthId are represented by human readable tokenized strings rather than the conceptId.</li></ul></td></tr><tr><td><strong>Get the range of values applicable to a specified attribute</strong></td><td><p>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 <a href="https://confluence.ihtsdotools.org/display/DOCTSG/4.10+Get+Data+from+a+Reference+Set">4.10 Get Data from a Reference Set</a>) 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.</p><pre data-overflow="wrap"><code>[snowstorm]/snomed-ct/[branchPath]/members?referenceSet=[MrcmAttributeRangeRefsetId]&#x26;referencedComponentId=[attributeId]&#x26;active=true&#x26;contentType=[contentType]
</code></pre><p>For example</p><pre data-overflow="wrap"><code>[snowstorm]/snomed-ct/MAIN/2020-01-31/members?referenceSet=723562003&#x26;referencedComponentId=260870009&#x26;active=true&#x26;contentType=POSTCOORDINATED
</code></pre><hr><p><em>Encoded URL</em></p><pre data-overflow="wrap"><code>[snowstorm]/snomed-ct/MAIN%2F2020-01-31/members?referenceSet=723562003&#x26;amp;amp;amp;referencedComponentId=260870009&#x26;amp;amp;active=true&#x26;amp;contentType=POSTCOORDINATED
</code></pre></td><td><p>Returns a JSON representation of data related to the specified attribute range.</p><p>The range data is returned in the following properties of the additionalFields object:</p><ul><li>rangeConstraint</li><li>attributeRule</li><li>contentTypeId</li><li>ruleStrengthId</li></ul></td></tr><tr><td><strong>Find values that are within the range or a specified attribute</strong></td><td><pre data-overflow="wrap"><code>[snowstorm]/snomed-ct/mrcm/[branchPath]/attribute-values/260870009?contentType=POSTCOORDINATED&#x26;termPrefix=[searchTerm]
</code></pre><p>For example</p><pre data-overflow="wrap"><code>[snowstorm]/snomed-ct/mrcm/MAIN/2020-01-31/attribute-values/260870009?contentType=POSTCOORDINATED&#x26;termPrefix=urg
</code></pre><hr><p><em>Encoded URL</em></p><pre data-overflow="wrap"><code>[snowstorm]/snomed-ct/mrcm/MAIN%2F2020-01-31/attribute-values/260870009?contentType=POSTCOORDINATED&#x26;amp;termPrefix=urg
</code></pre></td><td><p>Returns a JSON representation of the search results constrained by the rangeConstraint.</p><ul><li>The data returned is in the same form as documented in the <a href="4.8-find-concepts">Find Concepts </a>section.</li></ul></td></tr></tbody></table>

#### FHIR API

| Service Name            | API Call 3 | Result                                                                                                          |
| ----------------------- | ---------- | --------------------------------------------------------------------------------------------------------------- |
| 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

<table><thead><tr><th>Service Name</th><th>SQL Query</th><th>Result</th></tr></thead><tbody><tr><td><strong>Get the set of reference sets applicable to concepts in an identified module</strong></td><td><pre class="language-sql" data-overflow="wrap"><code class="lang-sql"><strong>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];
</strong></code></pre><p>For example to get the MRCM refsetIds for <a href="http://snomed.info/id/900000000000207008">900000000000207008 | SNOMED CT core module|</a></p><pre class="language-sql" data-overflow="wrap"><code class="lang-sql">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
</code></pre><p>Alternative approach to get refsetId for a specific MRCM refset for a specific module <a href="http://snomed.info/id/900000000000207008">900000000000207008 | SNOMED CT core module|</a></p></td><td>The refsetIds and reference set types of the three MRCM references sets that apply to the specified module.</td></tr><tr><td><strong>Get the refsetId of specific type of MRCM reference set applicable to concepts in an identified module</strong></td><td><pre class="language-sql" data-overflow="wrap"><code class="lang-sql">SELECT getMrcmRefsetId([moduleId],[refsetType]);
</code></pre><p>The MRCM refsetType can be specified either by a single letter (D, A or R) or the full name (mrcm<strong>D</strong>omain, mrcm<strong>A</strong>ttributeDomain or mrcmAttribute<strong>R</strong>ange).</p><p>The first example illustrates use of the full name while the others use the abbreviated style.</p><pre class="language-sql" data-overflow="wrap"><code class="lang-sql">SELECT getMrcmRefsetId(900000000000207008,"mrcmDomain");
SELECT getMrcmRefsetId(900000000000207008,"A");
SELECT getMrcmRefsetId(900000000000207008,"R");
</code></pre></td><td><p>Each function call returns a single refsetId.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>The other MRCM services described below use this function to determine which reference set to use to access domain, attribute and range constraint information.</p></div></td></tr><tr><td><strong>Get the domain or set of domains that include a specified concept</strong></td><td><pre class="language-sql" data-overflow="wrap"><code class="lang-sql">CALL getMrcmDomains([conceptId],[proxPrim],@domainId, @domainList);
-- Following line shows the results
SELECT @domainId,@domainList;
</code></pre><p><strong>Example 1</strong>. Get the domains that include the concept <a href="http://snomed.info/id/71341001">71341001 | Bone structure of femur|</a></p><pre class="language-sql" data-overflow="wrap"><code class="lang-sql">CALL getMrcmDomains(71341001,0,@domainId, @domainList);
-- Following line shows the results
SELECT @domainId, @domainList;
</code></pre><p><strong>Example 2</strong>. Get the domains that include the concept <a href="http://snomed.info/id/241075002">241075002 | Plain X-ray of femur|</a></p><pre class="language-sql" data-overflow="wrap"><code class="lang-sql">CALL getMrcmDomains(241075002,0,@domainId, @domainList);
-- Following line shows the results
SELECT @domainId, @domainList;
</code></pre><p><strong>Example 3</strong>. Get the proximal primitive domains that include the concept <a href="http://snomed.info/id/241075002">241075002 | Plain X-ray of femur|</a></p><pre class="language-sql" data-overflow="wrap"><code class="lang-sql">CALL getMrcmDomains(241075002,1,@domainId, @domainList);
-- Following line shows the results
SELECT @domainId, @domainList;
</code></pre></td><td><p>This procedure returns two values.</p><ul><li>domainId - the most specific domain that includes the specified concept.</li><li>domainList - a comma separated list of all the domains that include the specified concept.</li></ul><p><strong>Example 1 returns the following set of domains:</strong></p><ul><li><strong>domainId</strong>: 723264001</li><li><p><strong>domainList</strong>: 123037004,91723000,723264001</p><ul><li><a href="http://snomed.info/id/123037004">123037004 | Body structure|</a></li><li><a href="http://snomed.info/id/91723000">91723000 | Anatomical structure|</a></li><li><a href="http://snomed.info/id/723264001">723264001 | Lateralizable body structure reference set|</a></li></ul></li></ul><p><strong>Example 2 returns the following set of domains</strong></p><ul><li><strong>domainId</strong>: 386053000</li><li><p><strong>domainList:</strong> 71388002,386053000</p><ul><li><a href="http://snomed.info/id/71388002">71388002 | Procedure|</a></li><li><a href="http://snomed.info/id/386053000">386053000 | Evaluation procedure|</a></li></ul></li></ul><p><strong>Example 3 returns the following set of proximal primitive domains</strong></p><ul><li><strong>domainList:</strong> 71388002,386053000,387713003,433590000</li><li><a href="http://snomed.info/id/71388002">71388002 | Procedure|</a></li><li><a href="http://snomed.info/id/386053000">386053000 | Evaluation procedure|</a></li><li><a href="http://snomed.info/id/387713003">387713003 | Surgical procedure|</a></li><li><a href="http://snomed.info/id/433590000">433590000 | Administration of substance via specific route|</a></li></ul><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>The procedure adds also adds a row to the config_resultsets table for each of the domains. This makes it easier for the services below to access to look up the attribute and range constraints for the set of domains applicable to a specified concept.</p></div></td></tr><tr><td><strong>Get the set of attributes applicable to a concept in a specified domain or set of domains</strong></td><td><pre class="language-sql" data-overflow="wrap"><code class="lang-sql">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;
</code></pre><p><strong>Example 1</strong>. Get the attributes applicable to the concept <a href="http://snomed.info/id/71341001">71341001 | Bone structure of femur|</a> when using postcoordination</p><pre class="language-sql" data-overflow="wrap"><code class="lang-sql">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;
</code></pre><p><strong>Example 2</strong>. Get the attributes and attribute constraints applicable to the concept <a href="http://snomed.info/id/71341001">71341001 | Bone structure of femur|</a> when using postcoordination.</p><pre class="language-sql" data-overflow="wrap"><code class="lang-sql">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;
</code></pre></td><td><p>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.<br></p><p>Both examples get the attributes applicable to the same concept but the results returned by the select queries vary in content.</p><p><br><strong>Example 1</strong> 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.<br></p><p><strong>Example 2</strong> 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.</p></td></tr><tr><td><strong>Get the range of values applicable to a specified attribute</strong></td><td><p>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.</p><pre class="language-sql" data-overflow="wrap"><code class="lang-sql">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;
</code></pre><p>Example. Get all the attribute range constraints applicable to the concept <a href="http://snomed.info/id/71341001">71341001 | Bone structure of femur|</a> when using postcoordination</p><pre class="language-sql" data-overflow="wrap"><code class="lang-sql">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;
</code></pre></td><td>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.</td></tr></tbody></table>

***

**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](http://www.hl7.org/) ([www.hl7.org](http://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](https://app.gitbook.com/o/h8Z6qGxuQrzM9vbx5bPT/s/LnTo62BQeQSW6tBNKv0T/). For instructions on how to build the example database refer to [Appendix A: Building the SNOMED CT Example Database](https://app.gitbook.com/s/LnTo62BQeQSW6tBNKv0T/appendix-a-building-the-snomed-ct-example-database).

<a href="https://docs.google.com/forms/d/e/1FAIpQLScTmbZIf0UEQwYDkY27EEWBkaiYkHSbR0_9DmFrMLXoQLyL7Q/viewform?usp=pp_url&#x26;entry.1767247133=SNOMED+Terminology+Services+Guide&#x26;entry.670899847=Get%20Concept%20Model%20Rules" class="button primary">Provide Feedback</a>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.snomed.org/snomed-ct-practical-guides/snomed-ct-terminology-services-guide/4-terminology-service-types/4.13-get-concept-model-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
