   JOIN vocabulary v ON c.vocabulary_id = v.vocabulary_id -- valid_start_date
   WHERE c.vocabulary_id = 'LOINC' AND c.standard_concept = 'C' and c.invalid_reason is null
   AND d.vocabulary_id = 'SNOMED' AND d.invalid_reason IS NULL
+  AND attributeid in ('246093002', '704319004', '704327008', '718497002') --  'Component', 'Inheres in' (Component-like),  'Direct site' (System-like), 'Inherent location'  (Component-like)
+/* Excluded attributeIDs:
+Process output - reduplicate a Component
+Process agent - link from a LOINCComponent to a possible SNOMED System, useless in mapping ('Kidney structure')
+Property type - links from a LOINC Component to a possible SNOMED Property (useless, non-SNOMED logic)
+Technique - link from a LOINC Component to SNOMED Technique (useless, non-SNOMED logic)
+Characterizes - senseless 'Excretory process' */
 ;
-
+				 
 -- 14.2 Build relationships between LOINC Measurements and respective SNOMED attributes given by the table of 'sources.scccrefset_expressionassociation_int'
 -- Note, that some suggested by LOINC relationship_ids ('Characterizes', 'Units', 'Relative to', 'Process agent' 'Inherent location') are useless in the context of a mapping to SNOMED.
 INSERT INTO concept_relationship_stage

END $_$;
	

-- At the end, the three tables concept_stage, concept_relationship_stage and concept_synonym_stage should be ready to be fed into the generic_update.sql script
FROM sources.loinc_forms -- Panel containing table
WHERE loinc <> parentloinc;-- to exclude cases when parents and children are represented by the same concepts

--14.1 Build 'LOINC - SNOMED eq' relationships between LOINC Attributes and SNOMED Attributes (as long as LOINC Parts are classification, we cannot not use 'Maps to') 
INSERT INTO concept_relationship_stage (
	concept_code_1,
	concept_code_2,
