 from concept_stage
 where
 	concept_class_id = 'ICDO Histology' and
-	(standard_concept is null or standard_concept != 'C') -- not hierarchical
+	concept_code like '%/%' -- not hierarchical
 ;
 -- 12. Populate concept_stage with combinations
 insert into concept_stage (CONCEPT_NAME,DOMAIN_ID,VOCABULARY_ID,CONCEPT_CLASS_ID,STANDARD_CONCEPT,CONCEPT_CODE,VALID_START_DATE,VALID_END_DATE,INVALID_REASON)

	'ICDO3',
	'SNOMED',
	'Maps to',
	TO_DATE ('01.01.1970', 'dd.mm.yyyy'),
	TO_DATE ('31.12.2099', 'dd.mm.yyyy')
from match_blob m
join monorelation o using (i_code)
where

	'ICDO Condition',
	null,
	'NULL-' || concept_code,
	TO_DATE ('20171220', 'yyyymmdd'),
	TO_DATE ('20991231', 'yyyymmdd'),
	null	 
from concept_stage
where
	concept_class_id = 'ICDO Topography' and
	concept_code like '%.%' -- not hierarchical
;
--13. Form stable list of existing precoordinated concepts in SNOMED
drop table if exists snomed_target_prepared
;
--TODO: use source SNOMED files for better filtering
create table snomed_target_prepared as
