SNOMED Documentation Search


Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

In addition to the simple examples shown on the previous pages, more advanced expression templates can also be used. On this page we show some examples of expression constraints with multiple replacement slots, multiple cardinality constraints and slot co-dependency constraints.

Multiple Replacement Slots

In many situations, it is useful for an expression template to contain more than one replacement slot. Below are some examples.

Example 1

The following expression template uses three replacement slots to generate an expression that represents a type of procedure. The first slot (named "Procedure") is a placeholder for the focus concept, while the second slot (named "BodySite") is a placeholder for the

Concept
ShowPartsterm
t405813007 |Procedure site - Direct|
, and the third slot (named "Method") is a placeholder for the
Concept
ShowPartsterm
t260686004 |Method|

Scg expression
Borderridge
ShowFormatblock
	[[+ (<71388002 |Procedure|) @Procedure]]:
		{ 405813007 |Procedure site - direct| = [[+ (<91723000 |Anatomical structure|) @BodySite]],
			260686004 |Method| = [[+ (<129264002 |Action (qualifier value)|) @Method]] }

If the slots are populated with the values:

  • Procedure = 
    Concept
    t387713003 |Surgical procedure|
  • BodySite = 
    Concept
    t66754008 |Appendix structure|
  • Method = 
    Concept
    t129304002 |Excision - action|

then the following expression would be generated.

Scg expression
Borderridge
ShowFormatblock
	387713003 |Surgical procedure|: 
		{ 405813007 |Procedure site - direct| = 66754008 |Appendix structure|, 
			260686004 |Method| = 129304002 |Excision - action| }

Example 2 

Another example of an expression template with multiple slots is shown below. This expression template is used to generate expressions that represent the family history of a patient. The template contains two slots - the first slot (named "Finding") is a placeholder for the 

Concept
ShowPartsterm
t404684003 |Clinical finding|
 known to be present in the family member, while the second slot (named "Relationship") is a placeholder for the 
Concept
ShowPartsterm
t408732007 |Subject relationship context|
 of this
Concept
ShowPartsterm
t404684003 |Clinical finding|
.

Scg expression
Borderridge
ShowFormatblock
	243796009 |Situation with explicit context|:
		{ 246090004 |Associated finding| = [[+id (< 404684003 |Clinical finding|) @Finding]],
			408731000 |Temporal context| = 410511007 |Current or past (actual)|,
			408729009 |Finding context| = 410515003 |Known present|,
			408732007 |Subject relationship context|  =  [[+id (<< 444148008 |Person in family of subject|) @Relationship]] }

If the following input data is provided (in which each row represents a separate expression):

FindingRelationship

Concept
t93870000 |Liver cancer|

Concept
t444244000 |Maternal grandmother of subject|

Concept
t57809008 |Myocardial disease|

Concept
t444292000 |Paternal grandfather of subject|

Concept
t46635009 |Diabetes mellitus type 1|

Concept
t444301002 |Mother of subject|

Then the following family history expressions would be generated.

Scg expression
Borderridge
ShowFormatblock
	243796009 |Situation with explicit context|:
		{ 246090004 |Associated finding| = 93870000 |Liver cancer|,
			408731000 |Temporal context| = 410511007 |Current or past (actual)|,
			408729009 |Finding context| = 410515003 |Known present|,
			408732007 |Subject relationship context| = 444244000 |Maternal grandmother of subject| }


Scg expression
Borderridge
ShowFormatblock
	243796009 |Situation with explicit context|:
		{ 246090004 |Associated finding| = 57809008 |Myocardial disease|,
			408731000 |Temporal context| = 410511007 |Current or past (actual)|,
			408729009 |Finding context| = 410515003 |Known present|,
			408732007 |Subject relationship context| = 444292000 |Paternal grandfather of subject| }


Scg expression
Borderridge
ShowFormatblock
	243796009 |Situation with explicit context|:
		{ 246090004 |Associated finding| = 46635009 |Diabetes mellitus type 1|,
			408731000 |Temporal context| = 410511007 |Current or past (actual)|,
			408729009 |Finding context| = 410515003 |Known present|,
			408732007 |Subject relationship context| = 444301002 |Mother of subject| }

Multiple Cardinality Constraints

Expression templates may also use more than one cardinality constraint to indicate the repeatability of different parts of the expression. Below are some examples.

Example 1

The following expression template uses three replacement slots to generate an expression that represents a type of procedure. The first slot (named "Procedure") is a placeholder for the focus concept, while the second slot (named "BodySite") is a placeholder for the 

Concept
ShowPartsterm
t405813007 |Procedure site - Direct|
, and the third slot (named "Method") is a placeholder for the 
Concept
ShowPartsterm
t260686004 |Method|

Scg expression
Borderridge
ShowFormatblock
	[[1..1]] [[+ (<71388002 |Procedure|) @Procedure]] : 
		[[ 1..2 @SMgroup]] { [[1..1]] 405813007 |Procedure site - direct| = [[+ (<91723000 |Anatomical structure|) @BodySite]], 
								[[1..1]] 260686004 |Method| = [[+ (<129264002 |Action (qualifier value)|) @Method]] }

The first cardinality constraint (i.e. 1..1 ) indicates that exactly one value should be populated in the Procedure slot. The second cardinality constraint (i.e. 1..2 ) indicates that it is valid to include either 1 or 2 relationship groups in the resulting expression. The last two cardinality constraints, that appear inside the relationship group, (i.e. 1..1 ) indicate that in each instance of a relationship group, exactly one

Concept
ShowPartsterm
t405813007 |Procedure site - direct|
 value and exactly one
Concept
ShowPartsterm
t260686004 |Method|
 value should be used.

The following input data satisfies these cardinality constraints.

ProcedureSMgroupBodySiteMethod

Concept
t387713003 |Surgical procedure|

1

Concept
t28273000 |Bile duct structure|

Concept
t281615006 |Exploration - action|

2

Concept
t28231008 |Gallbladder structure|

Concept
t129304002 |Excision - action|

Concept
t387713003 |Surgical procedure|

1

Concept
t66754008 |Appendix structure|

Concept
t129304002 |Excision - action|

If the slots are populated with the values above, then the following expressions would be generated.

Scg expression
Borderridge
ShowFormatblock
	387713003 |Surgical procedure|: 
		{ 405813007 |Procedure site - direct| = 28273000 |Bile duct structure|, 260686004 |Method| = 281615006 |Exploration - action| },
		{ 405813007 |Procedure site - direct| = 28231008 |Gallbladder structure|, 260686004 |Method| = 129304002 |Excision - action| }


Scg expression
Borderridge
ShowFormatblock
	387713003 |Surgical procedure|: 
		{ 405813007 |Procedure site - direct| = 66754008 |Appendix structure|, 260686004 |Method| = 129304002 |Excision - action| }

Page break
Example 2

Another example of an expression template with multiple cardinality constraints is shown below. This expression template is used to generate expressions that represent a clinical finding with explicit context.

Scg expression
Borderridge
ShowFormatblock
	[[1..1]] [[+id (<< 413350009 |Finding with explicit context|) @Condition]]:
		[[ 1..2 @AFgroup ]] { [[1..1]] 246090004 |Associated finding| = ( [[+id (<< 404684003 |Clinical finding|) @Finding]]:
					[[0..1 @SSgroup]] { [[0..1]] 246112005 |Severity| = [[+id (< 272141005 |Severities|) @Severity]],
										[[0..1]] 363698007 |Finding site| = [[+id (< 91723000 |Anatomical structure|) @Site]] } ),
							[[1..1]] 408732007 |Subject relationship context| = [[+id (< 444148008 |Person in family of subject|) @Relationship]],
							[[1..1]] 408731000 |Temporal context|  = [[+id (< 410510008 |Temporal context value|) @Time]],
							[[1..1]] 408729009 |Finding context|  = [[+id (< 410514004 |Finding context value|) @Context]] }

The first cardinality constraint (i.e. 1..1 ) indicates that exactly one value should be populated in the Condition slot. The second cardinality constraint (i.e. 1..2 ) indicates that it is valid to include either 1 or 2 relationship groups (named "AFgroup") in the resulting expression. Each AFgroup relationship group must have exactly one

Concept
ShowPartsterm
t246090004 |Associated finding|
, exactly one
Concept
ShowPartsterm
t408732007 |Subject relationship context|
, exactly one
Concept
ShowPartsterm
t408731000 |Temporal context|
 and exactly one
Concept
ShowPartsterm
t408729009 |Finding context|
.  The value of the 
Concept
ShowPartsterm
t246090004 |Associated finding|
 in each AFgroup is an expression, may optionally be refined using a single relationship group named "SSgroup". Each SSgroup optionally has one
Concept
ShowPartsterm
t246112005 |Severity|
 and optionally has one
Concept
ShowPartsterm
t363698007 |Finding site|
. Based on these cardinality constraints, the input data shown in
Caption reference
CapRefIdvalid-input-example-2
CapRefTypeTable
 would be valid.

PDF: Landscape


Caption label
CapIdvalid-input-example-2
CapTypeTable
Valid Input Data for Example 2


ConditionAF groupFindingSeveritySiteRelationshipTimeContext

Concept
LineBreaktrue
t243796009 |Situation with explicit context|

1

Concept
LineBreaktrue
t56265001 |Heart disease|

Concept
LineBreaktrue
t24484000 |Severe|


Concept
LineBreaktrue
t444292000 |Paternal grandfather of subject|

Concept
LineBreaktrue
t410512000 |Current or specified time|

Concept
LineBreaktrue
t410515003 |Known present|

2

Concept
LineBreaktrue
t22298006 |Myocardial infarction|



Concept
LineBreaktrue
t 444292000 |Paternal grandfather of subject|

Concept
LineBreaktrue
t410589000 |All times past|

Concept
LineBreaktrue
t410516002 |Known absent|

Concept
LineBreaktrue
t57177007 |Family history with explicit context|

1

Concept
LineBreaktrue
t363346000 |Cancer|

Concept
LineBreaktrue
t6736007 |Moderate|

Concept
LineBreaktrue
t76752008 |Breast structure|

Concept
LineBreaktrue
t444244000 |Maternal grandmother of subject|

Concept
LineBreaktrue
t410512000 |Current or specified time|

Concept
LineBreaktrue
t410515003 |Known present|

Concept
LineBreaktrue
t160303001 |FH: Diabetes mellitus|

1

Concept
LineBreaktrue
t46635009 |Diabetes mellitus type 1|



Concept
LineBreaktrue
t444301002 |Mother of subject|

Concept
LineBreaktrue
t410512000 |Current or specified time|

Concept
LineBreaktrue
t410515003 |Known present|


If the slots are populated with the values above, then the following expressions would be generated.

Scg expression
Borderridge
ShowFormatblock
	243796009 |Situation with explicit context|:
		{ 246090004 |Associated finding| = (56265001 |Heart disease|: {246112005 |Severity| = 24484000 |Severe|}),
			408732007 |Subject relationship context| = 444292000 |Paternal grandfather of subject|,
			408731000 |Temporal context| = 410511007 |Current or past (actual)|,
			408729009 |Finding context| = 410515003 |Known present| },
		{ 246090004 |Associated finding| = 22298006 |Myocardial infarction|,
			408732007 |Subject relationship context| = 444292000 |Paternal grandfather of subject|,
			408731000 |Temporal context| = 410589000 |All times past|,
			408729009 |Finding context| = 410516002 |Known absent| }


Scg expression
Borderridge
ShowFormatblock
	57177007 |Family history with explicit context|:
		{ 246090004 |Associated finding| = ( 363346000 |Cancer|: 
				{ 246112005 |Severity| = 6736007 |Moderate|, 363698007 |Finding site| = 76752008 |Breast structure| } ),
			408732007 |Subject relationship context| = 444244000 |Maternal grandmother of subject|,
			40873100 |Temporal context| = 410511007 |Current or past (actual)|,
			408729009 |Finding context| = 410515003 |Known present| }


Scg expression
Borderridge
ShowFormatblock
   160303001 |FH: Diabetes mellitus|:
		{ 246090004 |Associated finding| = 46635009 |Diabetes mellitus type 1|,
			40873100 |Temporal context| = 410511007 |Current or past (actual)|,
			408729009 |Finding context| = 410515003 |Known present|,
			408732007 |Subject relationship context| = 444301002 |Mother of subject| }

Please note that when part of an expression is repeated, connectors (e.g. a comma) must be added between the parts during processing. Similarly, when part of an expression is absent then clean up is required (e.g. to remove commas and brackets). For more information on these processing steps, please refer to 7.2. Template Processing.