User:Zysun
--2008
CREATE TABLE Q2014_SHR_997781_01pp_herang_1_2008 SELECT distinct pat_id FROM IMS201312.CLAIMS WHERE from_dt BETWEEN '2008-01-01' AND '2008-12-31' AND (
A.diag_admit = '2776' OR
A.diag1 = '2776' OR A.diag2 = '2776' OR A.diag3 = '2776' OR A.diag4 = '2776' OR A.diag5 = '2776' OR A.diag6 = '2776' OR A.diag7 = '2776' OR A.diag8 = '2776' OR A.diag9 = '2776' OR A.diag10 = '2776' OR A.diag11 = '2776' );
SELECT '1_2008' AS STEP, COUNT(distinct pat_id) FROM Q2014_SHR_997781_01pp_herang_1_2008; --
Hereditary Angioedema AND Firazyr-------------------------------------------
--2008
CREATE TABLE Q2014_SHR_997781_01pp_herang_2_2008 SELECT distinct A.pat_id FROM IMS201312.CLAIMS A, Q2014_SHR_997781_01pp_herang_1_2008 B WHERE A.pat_id=B.pat_id AND A.from_dt BETWEEN '2008-01-01' AND '2008-12-31' AND A.NDC IN ('54092070202', '54092070203');
SELECT '2_2008' AS STEP, COUNT(distinct pat_id) FROM Q2014_SHR_997781_01pp_herang_2_2008; --
Hereditary Angioedema AND Cinryze-------------------------------------------
--2008
CREATE TABLE Q2014_SHR_997781_01pp_herang_3_2008 SELECT distinct A.pat_id FROM IMS201312.CLAIMS A, Q2014_SHR_997781_01pp_herang_1_2008 B WHERE A.pat_id=B.pat_id AND A.from_dt BETWEEN '2008-01-01' AND '2008-12-31' AND A.NDC = '42227008105';
SELECT '3_2008' AS STEP, COUNT(distinct pat_id) FROM Q2014_SHR_997781_01pp_herang_3_2008; --
Hereditary Angioedema AND Firazyr AND Cinryze-------------------------------------------
--2008
CREATE TABLE Q2014_SHR_997781_01pp_herang_4_2008 SELECT distinct A.pat_id FROM IMS201312.CLAIMS A, Q2014_SHR_997781_01pp_herang_2_2008 B WHERE A.pat_id=B.pat_id AND A.from_dt BETWEEN '2008-01-01' AND '2008-12-31' AND A.NDC = '42227008105';
SELECT '4_2008' AS STEP, COUNT(distinct pat_id) FROM Q2014_SHR_997781_01pp_herang_4_2008; --