 
 CREATE INDEX idx_domain_cc
    ON domain_snomed (concept_code);
+   
 
 UPDATE concept_stage c
    SET c.domain_id =



-- 5. Start building domains, preassign all them with "Not assigned"
-- drop table domain_snomed purge;
CREATE TABLE domain_snomed
AS
   SELECT concept_code, CAST ('Not assigned' AS VARCHAR2 (20)) AS domain_id

 WHERE C.VOCABULARY_ID = 'SNOMED';


UPDATE concept_stage c
   SET c.domain_id = 'Route'
 WHERE     concept_code IN ('255560000',
                            '255582007',
                            '258160008',
                            '260540009',
                            '260548002',
                            '264049007',
                            '263887005',
                            '372468001',
                            '72607000',
                            '359540000',
                            '90028008')
       AND C.VOCABULARY_ID = 'SNOMED';

UPDATE concept_stage c
   SET c.domain_id = 'Spec Anatomic Site'
 WHERE concept_class_id = 'Body Structure' AND C.VOCABULARY_ID = 'SNOMED';

UPDATE concept_stage c
   SET c.domain_id = 'Specimen'
 WHERE concept_class_id = 'Specimen' AND C.VOCABULARY_ID = 'SNOMED';

UPDATE concept_stage c
   SET c.domain_id = 'Meas Value Operator'
 WHERE     concept_code IN ('255560000',
                            '255582007',
                            '258160008',
                            '260540009',
                            '260548002',
                            '264049007',
                            '263887005',
                            '372468001',
                            '72607000',
                            '359540000',
                            '90028008')
       AND C.VOCABULARY_ID = 'SNOMED';

UPDATE concept_stage c
   SET c.domain_id = 'Spec Disease Status'
 WHERE     concept_code IN ('21594007', '17621005', '263654008')
       AND C.VOCABULARY_ID = 'SNOMED';

-- 8. Set standard_concept based on domain_id
UPDATE concept_stage c
