 		'Concept replaces'
 		)
 JOIN concept b ON b.concept_id = concept_id_2
-WHERE (a.vocabulary_id = 'ICD9Proc' AND b.vocabulary_id = 'SNOMED' OR a.vocabulary_id = 'SNOMED' AND b.vocabulary_id = 'ICD9Proc')
+WHERE (
+		a.vocabulary_id = 'ICD9Proc'
+		AND b.vocabulary_id = 'SNOMED'
+		OR a.vocabulary_id = 'SNOMED'
+		AND b.vocabulary_id = 'ICD9Proc'
+		)
 	AND NOT EXISTS (
 		SELECT 1
 		FROM concept_relationship_stage crs_int

WHERE cs.concept_code = crs.concept_code_1
	AND cs.vocabulary_id = crs.vocabulary_id_1
	AND crs.relationship_id = 'Maps to'
	AND crs.invalid_reason IS NULL;
	b.concept_code,
	a.vocabulary_id,
	b.vocabulary_id,
	r.relationship_id,
	r.valid_start_date,
	CURRENT_DATE,
	'D'
