            WHERE ds.drug_concept_code = d.drug_concept_code;
 COMMIT;
 
---13 Fix solid forms with denominator
+--12 Fix solid forms with denominator
 UPDATE ds_stage
    SET amount_unit = numerator_unit,
        amount_value = numerator_value,

              FROM drug_concept_stage
             WHERE source_concept_class_id = 'Marketed Product')
   SELECT dc.concept_code, dc2.concept_code
     FROM dc JOIN drug_concept_stage dc2 ON dc.concept_name LIKE '% ' || LOWER (dc2.concept_name) AND dc2.concept_class_id = 'Supplier';
COMMIT;

--26.2 ???
DELETE FROM internal_relationship_stage
 WHERE (concept_code_1, concept_code_2) IN 
    (SELECT b2.concept_code_1, b2.concept_code_2

			  WHERE dc.concept_class_id = 'Drug Product' AND dc.concept_name LIKE '%Pack%[%]%')
	SELECT t.concept_code, dc2.concept_code
	  FROM t JOIN drug_concept_stage dc2 ON dc2.concept_name = REGEXP_REPLACE (t.concept_name, '.* Pack .*\[(.*)\]', '\1') 
	  AND dc2.concept_class_id = 'Brand Name'
	  WHERE  t.concept_code NOT IN (SELECT concept_code_1 FROM internal_relationship_stage JOIN drug_concept_stage ON concept_code=concept_code_2 AND concept_class_id = 'Brand Name' );
COMMIT;

--24.1 Add missing suppliers
INSERT /*+ APPEND */ INTO  internal_relationship_stage
   WITH dc
        AS (SELECT /*+ materialize */
