         'Clinical Observation',
         'S',
         field_id,
-       to_date(debut, 'dd.mm.yyyy'),     --Should we take debut (pros: like reuse NDC?), version (more actual info) or just 1970?
+       to_date(debut, 'dd.mm.yyyy'),     --TODO: Should we take debut (pros: like reuse NDC?), version (more actual info) or just 1970?
        to_date('20991231','yyyymmdd')
 FROM field f;
 
 --5: Insert questions to concept_synonym_stage
---TODO: Find out what to do with synonyms (questions)
+INSERT INTO concept_synonym_stage
+(synonym_concept_id,
+ synonym_name,
+ synonym_concept_code,
+ synonym_vocabulary_id,
+ language_concept_id)
+
+SELECT NULL,
+       vocabulary_pack.CutConceptSynonymName(trim(regexp_replace(regexp_replace(notes, '<.*>|(You can select more than one answer)', ' ', 'g'), '\s{2,}|\.$', '', 'g'))) AS synonym_name,
+       field_id AS synonym_concept_code,
+       'uk_biobank',
+       4180186
+FROM field
+WHERE notes IS NOT NULL
+AND notes != ''
+AND (notes != title OR notes != concat(title, '.'))
+AND notes not ilike 'ACE touchscreen question%'
+AND notes not ilike 'Question asked%'
+AND notes != '.'
+
+;
+
+
+INSERT INTO concept_synonym_stage
+(synonym_concept_id,
+ synonym_name,
+ synonym_concept_code,
+ synonym_vocabulary_id,
+ language_concept_id)
+
+SELECT NULL,
+       vocabulary_pack.CutConceptSynonymName(substring(notes, '"(.*)"')) AS synonym_name,
+       field_id AS synonym_concept_code,
+       'uk_biobank',
+       4180186
+FROM field
+WHERE notes IS NOT NULL
+AND notes != ''
+AND (notes != title OR notes != concat(title, '.'))
+AND (notes ilike 'ACE touchscreen question%' OR notes ilike 'Question asked%')
+AND notes != '.'
+;
 
 --6: Insert answers to concept_stage
 INSERT INTO concept_stage

WHERE encoding_id NOT IN (19 /*ICD10*/, 87 /*ICD9 or ICD9CM?*/, 240 /*OPCS4*/)
;

--7: Turn some answers to Non-Standard ones
--TODO: Deduplication of answers

--8: Building hierarchy for questions
--Hierarchy between Classification concepts


--TODO: Add concept_class_id to the concept and concept_class tables (functions)
--TODO: Add vocabulary_id to the concept and vocabulary tables (functions)

--0 Temp code (to be removed)
/*
