 	AND c.valid_end_date = TO_DATE('20991231', 'YYYYMMDD') -- not already deprecated
 	AND c.vocabulary_id IN ('CPT4', 'HCPCS', 'ICD9Proc', 'ICD10PCS'); /*new rule for these vocabularies: http://forums.ohdsi.org/t/proposal-to-keep-outdated-standard-concepts-active-and-standard/3695/22 and AVOF-981*/
 
-	--11. Add new concepts from concept_stage
+	--10. Add new concepts from concept_stage
 	--Create sequence after last valid one
 	DO $$
 	DECLARE

	SET concept_name = REPLACE(concept_name, '–', '-')
	WHERE concept_name LIKE '%–%';

	--8. Clearing the synonym_name
	--Remove double spaces, carriage return, newline, vertical tab and form feed
	UPDATE concept_synonym_stage
	SET synonym_name = REGEXP_REPLACE(synonym_name, '[[:cntrl:]]+', ' ', 'g')

	WHERE cs.valid_end_date = TO_DATE ('20991231', 'YYYYMMDD')
	AND cs.invalid_reason IS NOT NULL;

	--4. Update concept_id in concept_stage from concept for existing concepts
	UPDATE concept_stage cs
		SET concept_id = c.concept_id
	FROM concept c
	WHERE cs.concept_code = c.concept_code
		AND cs.vocabulary_id = c.vocabulary_id;

	--5. Analysing
	ANALYSE concept_stage;
	ANALYSE concept_relationship_stage;

	--6. Clearing the concept_name
	--Remove double spaces, carriage return, newline, vertical tab and form feed
	UPDATE concept_stage
	SET concept_name = REGEXP_REPLACE(concept_name, '[[:cntrl:]]+', ' ', 'g')
