 BEGIN
 	PERFORM VOCABULARY_PACK.SetLatestUpdate(
 	pVocabularyName			=> 'HemOnc',
-	pVocabularyDate			=> TO_DATE ('20190530', 'yyyymmdd'),
-	pVocabularyVersion		=> 'HemOnc 2019-05-30',
+	pVocabularyDate			=> TO_DATE ('20190829', 'yyyymmdd'),
+	pVocabularyVersion		=> 'HemOnc 2019-08-29',
 	pVocabularyDevSchema	=> 'DEV_HEMONC'
 );
 END $_$;

SELECT NULL AS concept_id,
	concept_name,
	CASE 
		WHEN (
				h.concept_class_id IN (
					'Procedure',
					'Context'
					)
				OR h.concept_name = 'Radiotherapy'
				)
			THEN 'Procedure'
		WHEN h.concept_class_id IN (
				'Regimen',
				'Component',
				'Brand_Name',
				'Component Class',
				'Route',
				'Regimen type'

	) i -- in order not to write the relationship_id case in the last condition, I use subquery
WHERE (
		i.concept_code_1,
		i.vocabulary_id_1,
		i.relationship_id,
		i.concept_code_2,
		i.vocabulary_id_2
		) NOT IN (
		SELECT concept_code_1,
			vocabulary_id_1,
			relationship_id,
			concept_code_2,
			vocabulary_id_2
		FROM concept_relationship_stage
		);

