Download presentation
Presentation is loading. Please wait.
Published byRafe Owens Modified over 6 years ago
1
DROC Request from Cancer CRG Preliminary feasibility query 06/13/2017
University of Iowa
2
Agenda Request Summary Query #1 Query #2 Query #3 Results into Redcap
MSSQL MSSQL example Oracle Query #2 Query #3 Procedures/Dispensing/Prescribing/Lab_result_cm Results into Redcap
3
Request Summary DROC request - prelim feasibility targeted cancer tx-18MAY2017.docx
4
Request Summary ***Goal is to convert this DROC request into SQL each GPC site can use***
5
Request Summary ***Goal is to convert this DROC request into SQL each GPC site can use***
6
Request Summary Query Review Cohort1 Query1 produces Cohort1
All cancer cases from Query2 produces Cohort2 (which is a subset of Cohort1) All cancer cases from (Cohort1) Only breast cancer cases (C500-C509) With a sequence number of “00” Query3 is just pulling requested CDM/NAACCR data regarding Cohort2 Cohort1 Cohort2 Cohort2 CPT/HCPCS NDC RXCUI LOINC PULL
7
Query Assumptions That each site has the ability to run a query that joins both the CDM and i2b2 NAACCR item #400 [PRIMARY_SITE] is stored in i2b2 OBSERVATION_FACT CONCEPT_CD for item #400 [PRIMARY_SITE] is stored in the following format NAACCR:400:C509 or NAACCR|400|C509 NAACCR item #390 [DATE_OF_DIAGNOSIS] is stored in i2b2 OBSERVATION_FACT NAACCR:390 or NAACCR|390 NDC codes are stored as 11 digits in CDM DISPENSING
8
Query #1 For all tumor records in registry tables
Cohort1 For all tumor records in registry tables provide counts of tumors (not patients) as they fall in all possible combinations of GPC site (12 sites) with the following… year of diagnosis from registry tables ( ) and primary ICD-O-3 site code from registry tables (C000 [external upper lip] through C809 [unknown primary site]). Arrange counts in the form of this table shell: CMH Children’s Mercy Hospital, Kansas City, MO IU Indiana University MCRF Marshfield Clinic MCW Medical College of Wisconsin UIOWA The University of Iowa KUMC The University of Kansas Medical Center UMN The University of Minnesota MU The University of Missouri UNMC The University of Nebraska Medical Center UTHSCSA The University of Texas Health Science Center at San Antonio UTSW The University of Texas Southwestern Medical Center WISC The University of Wisconsin - Madison GPC_SITE DX_YEAR TUMOR_SITE TUMOR_CNT UIOWA 2010 C000 111 C001 222 C002 333 Please use these GPC Site abbreviations
9
Query#1 MSSQL i2b2 Tables /*
[SITE_NAME] = GPC site abbreviation. For example , UIOWA [I2B2_OBSERVATION_FACT_TABLE] = The OBSERVATION_FACT table name within your site's i2b2 architecture. For example, i2b2.i2b2.OBSERVATION_FACT [CONCEPT_CD_NAACCR_ITEM_400_PREFIX] = The CONCEPT_CD prefix at your site to identify NAACCR item #400 in your site's i2b2. For example , NAACCR:400: or NAACCR|400| [CONCEPT_CD_NAACCR_ITEM_390] = The CONCEPT_CD at your site to identify NAACCR item #390 in your site's i2b2. For example, NAACCR:390 or NAACCR|390 */ select '[SITE_NAME]' as GPC_SITE, x.DX_YEAR, x.TUMOR_SITE, x.TUMOR_CNT from ( cast(substring(cast(o1.nval_num as varchar),1,4) as int) as DX_YEAR , substring(o2.concept_cd,12,4) as TUMOR_SITE , count(*) as TUMOR_CNT from --o1 is used to qualify on DX_YEAR [I2B2_OBSERVATION_FACT_TABLE] o1 --join to o2 based on the same ENCOUNTER_NUM to qualify on site inner join [I2B2_OBSERVATION_FACT_TABLE] o2 on o1.ENCOUNTER_NUM = o2.encounter_num and o2.concept_cd like '[CONCEPT_CD_NAACCR_ITEM400_PREFIX]%' and substring(o2.concept_cd,12,4) >= 'C000' and substring(o2.concept_cd,12,4) <= 'C809' where o1.concept_cd = '[CONCEPT_CD_NAACCR_ITEM_390]' --convert the nval_num value to a string and grab the first 4 characters to get the year and then convert back to a number for comparison and cast(substring(cast(o1.nval_num as varchar),1,4) as int) >= 2010 and cast(substring(cast(o1.nval_num as varchar),1,4) as int) <= 2016 group by cast(substring(cast(o1.nval_num as varchar),1,4) as int) --DX_YEAR , substring(o2.concept_cd,12,4) --TUMOR_SITE ) x order by GPC_SITE,
10
Query#1 MSSQL i2b2 Tables (example)
/* [SITE_NAME] = GPC site abbreviation. For example , UIOWA [I2B2_OBSERVATION_FACT_TABLE] = The OBSERVATION_FACT table name within your site's i2b2 architecture. For example, i2b2.i2b2.OBSERVATION_FACT [CONCEPT_CD_NAACCR_ITEM_400_PREFIX] = The CONCEPT_CD prefix at your site to identify NAACCR item #400 in your site's i2b2. For example , NAACCR:400: or NAACCR|400| [CONCEPT_CD_NAACCR_ITEM_390] = The CONCEPT_CD at your site to identify NAACCR item #390 in your site's i2b2. For example, NAACCR:390 or NAACCR|390 */ select 'UIOWA' as GPC_SITE, x.DX_YEAR, x.TUMOR_SITE, x.TUMOR_CNT from ( cast(substring(cast(o1.nval_num as varchar),1,4) as int) as DX_YEAR , substring(o2.concept_cd,12,4) as TUMOR_SITE , count(*) as TUMOR_CNT from i2b2.i2b2.OBSERVATION_FACT o1 inner join i2b2.i2b2.OBSERVATION_FACT o2 on o1.ENCOUNTER_NUM = o2.encounter_num and o2.concept_cd like 'NAACCR:400:%' and substring(o2.concept_cd,12,4) >= 'C000' and substring(o2.concept_cd,12,4) <= 'C809' where o1.concept_cd = 'NAACCR:390' and cast(substring(cast(o1.nval_num as varchar),1,4) as int) >= 2010 and cast(substring(cast(o1.nval_num as varchar),1,4) as int) <= 2016 group by cast(substring(cast(o1.nval_num as varchar),1,4) as int) --DX_YEAR , substring(o2.concept_cd,12,4) --TUMOR_SITE )x order by GPC_SITE,
11
Query#1 ORACLE i2b2 Tables
/* [SITE_NAME] = GPC site abbreviation. For example UIOWA [I2B2_OBSERVATION_FACT_TABLE] = The OBSERVATION_FACT table name within your site's i2b2 architecture. For example, i2b2.i2b2.OBSERVATION_FACT [CONCEPT_CD_NAACCR_ITEM_400_PREFIX] = The CONCEPT_CD prefix at your site to identify NAACCR item #400 in your site's i2b2. For example NAACCR:400: or NAACCR|400| [CONCEPT_CD_NAACCR_ITEM_390] = The CONCEPT_CD at your site to identify NAACCR item #390 in your site's i2b2. For example NAACCR:390 or NAACCR|390 */select '[SITE_NAME]' as GPC_SITE, x.DX_YEAR, x.TUMOR_SITE, x.TUMOR_CNT from ( select cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) as DX_YEAR , substr(o2.concept_cd,12,4) as TUMOR_SITE , count(*) as TUMOR_CNT from --o1 is used to qualify on DX_YEAR [I2B2_OBSERVATION_FACT_TABLE] o1 --join to o2 based on the same ENCOUNTER_NUM to qualify on site inner join [I2B2_OBSERVATION_FACT_TABLE] o2 on o1.ENCOUNTER_NUM = o2.encounter_num and o2.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_400_PREFIX]%' and substr(o2.concept_cd,12,4) >= 'C000' and substr(o2.concept_cd,12,4) <= 'C809' where o1.concept_cd = '[CONCEPT_CD_NAACCR_ITEM_390]‘ --convert the nval_num value to a string and grab the first 4 characters to get the year and then convert back to a number for comparison and cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) >= 2010 and cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) <= 2016 group by cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) --DX_YEAR , substr(o2.concept_cd,12,4) --TUMOR_SITE )x order by GPC_SITE,
12
Query #2 Cohort1 Cohort2 2010
13
Query #2 These numbers will be used as “gut-check” for Query3
For all patients W/ a single primary (hospital sequence number 00 from registry tables) Breast cancer tumor (ICD-O-3 Primary Site Code C500-C509 from registry tables) diagnosed between (from registry tables) These numbers will be used as “gut-check” for Query3 Same query outputformat as Query #1 GPC_SITE DX_YEAR TUMOR_SITE TUMOR_CNT UIOWA 2010 C500 111 C501 222 C502 333
14
Query#2 MSSQL i2b2 Tables /* [SITE_NAME] = GPC site abbreviation. For example , UIOWA [I2B2_OBSERVATION_FACT_TABLE] = The OBSERVATION_FACT table name within your site's i2b2 architecture. For example, i2b2.i2b2.OBSERVATION_FACT [CONCEPT_CD_NAACCR_ITEM_400_PREFIX] = The CONCEPT_CD prefix at your site to identify NAACCR item #400 in your site's i2b2. For example , NAACCR:400: or NAACCR|400| [CONCEPT_CD_NAACCR_ITEM_560] = The CONCEPT_CD at your site to identify NAACCR item #560 in your site's i2b2. For example NAACCR:560 or NAACCR|560 [CONCEPT_CD_NAACCR_ITEM_390] = The CONCEPT_CD at your site to identify NAACCR item #390 in your site's i2b2. For example, NAACCR:390 or NAACCR|390 */ select '[SITE_NAME]' as GPC_SITE, x.DX_YEAR, x.TUMOR_SITE, x.TUMOR_CNT from ( cast(substring(cast(o1.nval_num as varchar),1,4) as int) as DX_YEAR , substring(o2.concept_cd,12,4) as TUMOR_SITE , count(*) as TUMOR_CNT from --o1 is used to qualify on DX_YEAR [I2B2_OBSERVATION_FACT_TABLE] o1 --join to o2 based on the same ENCOUNTER_NUM to qualify on site inner join [I2B2_OBSERVATION_FACT_TABLE] o2 on o1.ENCOUNTER_NUM = o2.encounter_num and o2.concept_cd like '[CONCEPT_CD_NAACCR_ITEM400_PREFIX]%' and substring(o2.concept_cd,12,4) >= 'C500‘ and substring(o2.concept_cd,12,4) <= 'C509‘ --o3, qualify on #560 Sequence Number--Hospital of '00' inner join [I2B2_OBSERVATION_FACT_TABLE] o3 on o1.ENCOUNTER_NUM = o3.encounter_num and o3.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_560]' and o3.tval_char = '00' --Single Primary Breast Cancer Tumor where o1.concept_cd = '[CONCEPT_CD_NAACCR_ITEM_390]' --convert the nval_num value to a string and grab the first 4 characters to get the year and then convert back to a number for comparison and cast(substring(cast(o1.nval_num as varchar),1,4) as int) >= 2010 and cast(substring(cast(o1.nval_num as varchar),1,4) as int) <= 2016 group by cast(substring(cast(o1.nval_num as varchar),1,4) as int) --DX_YEAR , substring(o2.concept_cd,12,4) --TUMOR_SITE ) x order by GPC_SITE,
15
Query#2 MSSQL i2b2 Tables (example)
/* [SITE_NAME] = GPC site abbreviation. For example , UIOWA [I2B2_OBSERVATION_FACT_TABLE] = The OBSERVATION_FACT table name within your site's i2b2 architecture. For example, i2b2.i2b2.OBSERVATION_FACT [CONCEPT_CD_NAACCR_ITEM_400_PREFIX] = The CONCEPT_CD prefix at your site to identify NAACCR item #400 in your site's i2b2. For example , NAACCR:400: or NAACCR|400| [CONCEPT_CD_NAACCR_ITEM_560] = The CONCEPT_CD at your site to identify NAACCR item #560 in your site's i2b2. For example NAACCR:560 or NAACCR|560 [CONCEPT_CD_NAACCR_ITEM_390] = The CONCEPT_CD at your site to identify NAACCR item #390 in your site's i2b2. For example, NAACCR:390 or NAACCR|390 */ select 'UIOWA' as GPC_SITE, x.DX_YEAR, x.TUMOR_SITE, x.TUMOR_CNT from ( cast(substring(cast(o1.nval_num as varchar),1,4) as int) as DX_YEAR , substring(o2.concept_cd,12,4) as TUMOR_SITE , count(*) as TUMOR_CNT from i2b2.i2b2.OBSERVATION_FACT o1 inner join i2b2.i2b2.OBSERVATION_FACT o2 on o1.ENCOUNTER_NUM = o2.encounter_num and o2.concept_cd like 'NAACCR:400:%' and substring(o2.concept_cd,12,4) >= 'C500' and substring(o2.concept_cd,12,4) <= 'C509‘ --o3, qualify on #560 Sequence Number--Hospital of '00' inner join i2b2.i2b2.OBSERVATION_FACT o3 on o1.ENCOUNTER_NUM = o3.encounter_num and o3.concept_cd like 'NAACCR:560' and o3.tval_char = '00' --Single Primary Breast Cancer Tumor where o1.concept_cd = 'NAACCR:390' and cast(substring(cast(o1.nval_num as varchar),1,4) as int) >= 2010 and cast(substring(cast(o1.nval_num as varchar),1,4) as int) <= 2016 group by cast(substring(cast(o1.nval_num as varchar),1,4) as int) --DX_YEAR , substring(o2.concept_cd,12,4) --TUMOR_SITE )x order by GPC_SITE,
16
Query#2 ORACLE i2b2 Tables
/* [SITE_NAME] = GPC site abbreviation. For example UIOWA [I2B2_OBSERVATION_FACT_TABLE] = The OBSERVATION_FACT table name within your site's i2b2 architecture. For example, i2b2.i2b2.OBSERVATION_FACT [CONCEPT_CD_NAACCR_ITEM_400_PREFIX] = The CONCEPT_CD prefix at your site to identify NAACCR item #400 in your site's i2b2. For example NAACCR:400: or NAACCR|400| [CONCEPT_CD_NAACCR_ITEM_560] = The CONCEPT_CD at your site to identify NAACCR item #560 in your site's i2b2. For example NAACCR:560 or NAACCR|560 [CONCEPT_CD_NAACCR_ITEM_390] = The CONCEPT_CD at your site to identify NAACCR item #390 in your site's i2b2. For example NAACCR:390 or NAACCR|390 */select '[SITE_NAME]' as GPC_SITE, x.DX_YEAR, x.TUMOR_SITE, x.TUMOR_CNT from ( select cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) as DX_YEAR , substr(o2.concept_cd,12,4) as TUMOR_SITE , count(*) as TUMOR_CNT from --o1 is used to qualify on DX_YEAR [I2B2_OBSERVATION_FACT_TABLE] o1 --join to o2 based on the same ENCOUNTER_NUM to qualify on site inner join [I2B2_OBSERVATION_FACT_TABLE] o2 on o1.ENCOUNTER_NUM = o2.encounter_num and o2.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_400_PREFIX]%' and substr(o2.concept_cd,12,4) >= 'C500' and substr(o2.concept_cd,12,4) <= 'C509‘ --o3, qualify on #560 Sequence Number--Hospital of '00' inner join [I2B2_OBSERVATION_FACT_TABLE] o3 on o1.ENCOUNTER_NUM = o3.encounter_num and o3.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_560]' and o3.tval_char = '00' --Single Primary Breast Cancer Tumor where o1.concept_cd = '[CONCEPT_CD_NAACCR_ITEM_390]' --convert the nval_num value to a string and grab the first 4 characters to get the year and then convert back to a number for comparison and cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) >= 2010 and cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) <= 2016 group by cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) --DX_YEAR , substr(o2.concept_cd,12,4) --TUMOR_SITE )x order by GPC_SITE,
17
Query #3 CPT/HCPCS NDC RXCUI LOINC DX YEAR HER2 COUNTS Cohort2 PULL
18
Query #3 (cont.) Of the patients from Cohort2 Provide counts of medication records for trastuzumab & lapatinib and HER2 test orders and procedures As they fall into all possible combinations of the following variables for specified values only: GPC Site Code Code Type CPT_HCPCS NDC RXNORM CUI LOINC CDM Table PROCEDURES (CPT_HCPCS) DISPENSING (NDC) PRESCRIBING (RXNORM CUI) LAB_RESULT_CM (LOINC) NAACCR DX Year NAACCR HER2 (SSF15)* *Special note re SSF15 The absence of a SSF15 value in NAACCR data should not exclude the patient from these results. For all patients that qualify but don’t have SSF15, just default the value of “BLANK” in as SSF15 and group accordingly CDM NAACCR/i2b2
19
Query #3 (cont.) Arrange counts in the form of this table shell:
gpc_site REDCAP_DATA_ACCESS_GROUP code code_type cdm_table dx_year ssf15 record_cnt patient_cnt UIOWA 8360 CPT_HCPCS PROCEDURES 2010 020 25 20 NDC DISPENSING 000 10 5 224905 RXCUI PRESCRIBING 988 26 21 748855 LOINC LAB_RESULT_CM BLANK 2
20
Query #3 MSSQL i2b2/CDM Tables
CPT/PROCEDURES /* [SITE_NAME] = GPC site abbreviation. For example UIOWA [I2B2_OBSERVATION_FACT_TABLE] = The OBSERVATION_FACT table name within your site's i2b2 architecture. For example, i2b2.i2b2.OBSERVATION_FACT [I2B2_VISIT_TABLE] = The VISIT_DIMENSION table name within your site's i2b2 architecture. For example, i2b2.i2b2.VISIT_DIMENSION [CONCEPT_CD_NAACCR_ITEM_400_PREFIX] = The CONCEPT_CD prefix at your site to identify NAACCR item #400 in your site's i2b2. For example NAACCR:400: or NAACCR|400| [CONCEPT_CD_NAACCR_ITEM_390] = The CONCEPT_CD at your site to identify NAACCR item #390 in your site's i2b2. For example NAACCR:390 or NAACCR|390 [CONCEPT_CD_NAACCR_ITEM_560] = The CONCEPT_CD at your site to identify NAACCR item #560 in your site's i2b2. For example NAACCR:560 or NAACCR|560 [CONCEPT_CD_NAACCR_ITEM_2869] = The CONCEPT_CD at your site to identify NAACCR item #2869 in your site's i2b2. For example NAACCR:2869 or NAACCR|2869 [CDM_PROCEDURES_TABLE_NAME] = The table name of your site's CDM Procedures table. For example, PCORNET.PCORNET.PROCEDURES */ select '[SITE_NAME]' as GPC_SITE, x.CODE, 'CPT_HCPCS' as CODE_TYPE, 'PROCEDURES' as CDM_TABLE, x.DX_YEAR, x.SSF15, x.RECORD_CNT, x.PATIENT_CNT from ( cast(substring(cast(o1.nval_num as varchar),1,4) as int) as DX_YEAR , p.px as CODE , isnull(o4.tval_char,'BLANK') as SSF15 , count(*) as RECORD_CNT , count(distinct p.patid) as PATIENT_CNT from --o1, qualify on #390 diagnosis year between 2010 and 2016 [I2B2_OBSERVATION_FACT_TABLE] o1 --o2, qualify on #400 Primary Site between C000 and C809 inner join [I2B2_OBSERVATION_FACT_TABLE] o2 on o1.ENCOUNTER_NUM = o2.encounter_num and o2.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_400_PREFIX]%' and substring(o2.concept_cd,12,4) >= 'C500' and substring(o2.concept_cd,12,4) <= 'C509' --o3, qualify on #560 Sequence Number--Hospital of '00' inner join [I2B2_OBSERVATION_FACT_TABLE] o3 on o1.ENCOUNTER_NUM = o3.encounter_num and o3.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_560]' and o3.tval_char = '00' --Single Primary Breast Cancer Tumor --04, qualify on #2869 SSF15, aka HER2 left outer join [I2B2_OBSERVATION_FACT_TABLE] o4 on o4.ENCOUNTER_NUM = o1.ENCOUNTER_NUM and o4.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_2869]' --v, join to visit_dimension via encounter_num to get the patient_num to use to join to CDM Procedures table inner join [I2B2_VISIT_TABLE] v on o1.encounter_num = v.encounter_num inner join [CDM_PROCEDURES_TABLE_NAME] p on p.PATID = v.PATIENT_NUM and p.px_type = 'C4' and p.px in ('J9355','88360','88361','88342','88377','89586','83950') --from DROC where o1.concept_cd = '[CONCEPT_CD_NAACCR_ITEM_390]' --[Date of Diagnosis] and cast(substring(cast(o1.nval_num as varchar),1,4) as int) >= 2010 and cast(substring(cast(o1.nval_num as varchar),1,4) as int) <= 2016 group by cast(substring(cast(o1.nval_num as varchar),1,4) as int) --DX_YEAR , p.px --CODE , isnull(o4.tval_char,'BLANK') --SSF15 ) x order by GPC_SITE,
21
Query #3 MSSQL i2b2/CDM Tables (example)
CPT/PROCEDURES /* [SITE_NAME] = GPC site abbreviation. For example UIOWA [I2B2_OBSERVATION_FACT_TABLE] = The OBSERVATION_FACT table name within your site's i2b2 architecture. For example, i2b2.i2b2.OBSERVATION_FACT [I2B2_VISIT_TABLE] = The VISIT_DIMENSION table name within your site's i2b2 architecture. For example, i2b2.i2b2.VISIT_DIMENSION [CONCEPT_CD_NAACCR_ITEM_400_PREFIX] = The CONCEPT_CD prefix at your site to identify NAACCR item #400 in your site's i2b2. For example NAACCR:400: or NAACCR|400| [CONCEPT_CD_NAACCR_ITEM_390] = The CONCEPT_CD at your site to identify NAACCR item #390 in your site's i2b2. For example NAACCR:390 or NAACCR|390 [CONCEPT_CD_NAACCR_ITEM_560] = The CONCEPT_CD at your site to identify NAACCR item #560 in your site's i2b2. For example NAACCR:560 or NAACCR|560 [CONCEPT_CD_NAACCR_ITEM_2869] = The CONCEPT_CD at your site to identify NAACCR item #2869 in your site's i2b2. For example NAACCR:2869 or NAACCR|2869 [CDM_PROCEDURES_TABLE_NAME] = The table name of your site's CDM Procedures table. For example, PCORNET.PCORNET.PROCEDURES */ select 'UIOWA' as GPC_SITE, x.CODE, 'CPT_HCPCS' as CODE_TYPE, 'PROCEDURES' as CDM_TABLE, x.DX_YEAR, x.SSF15, x.RECORD_CNT, x.PATIENT_CNT from ( cast(substring(cast(o1.nval_num as varchar),1,4) as int) as DX_YEAR , p.px as CODE , isnull(o4.tval_char,'BLANK') as SSF15 , count(*) as RECORD_CNT , count(distinct p.patid) as PATIENT_CNT from --o1, qualify on #390 diagnosis year between 2010 and 2016 i2b2.i2b2.OBSERVATION_FACT o1 --o2, qualify on #400 Primary Site between C000 and C809 inner join i2b2.i2b2.OBSERVATION_FACT o2 on o1.ENCOUNTER_NUM = o2.encounter_num and o2.concept_cd like 'NAACCR:400: %' and substring(o2.concept_cd,12,4) >= 'C500' and substring(o2.concept_cd,12,4) <= 'C509' --o3, qualify on #560 Sequence Number--Hospital of '00' inner join i2b2.i2b2.OBSERVATION_FACT o3 on o1.ENCOUNTER_NUM = o3.encounter_num and o3.concept_cd like 'NAACCR:560' and o3.tval_char = '00' --Single Primary Breast Cancer Tumor --04, qualify on #2869 SSF15, aka HER2 left outer join i2b2.i2b2.OBSERVATION_FACT o4 on o4.ENCOUNTER_NUM = o1.ENCOUNTER_NUM and o4.concept_cd like 'NAACCR:2869' --v, join to visit_dimension via encounter_num to get the patient_num to use to join to CDM Procedures table inner join i2b2.i2b2.VISIT_DIMENSION v on o1.encounter_num = v.encounter_num inner join PCORNET.PCORNET.PROCEDURES p on p.PATID = v.PATIENT_NUM and p.px_type = 'C4' and p.px in ('J9355','88360','88361','88342','88377','89586','83950') --from DROC where o1.concept_cd = 'NAACCR:390' --[Date of Diagnosis] and cast(substring(cast(o1.nval_num as varchar),1,4) as int) >= 2010 and cast(substring(cast(o1.nval_num as varchar),1,4) as int) <= 2016 group by cast(substring(cast(o1.nval_num as varchar),1,4) as int) --DX_YEAR , p.px --CODE , isnull(o4.tval_char,'BLANK') --SSF15 ) x order by GPC_SITE,
22
Query #3 Oracle i2b2/CDM Tables
CPT/PROCEDURES /* [SITE_NAME] = GPC site abbreviation. For example UIOWA [I2B2_OBSERVATION_FACT_TABLE] = The OBSERVATION_FACT table name within your site's i2b2 architecture. For example, i2b2.i2b2.OBSERVATION_FACT [I2B2_VISIT_TABLE] = The VISIT_DIMENSION table name within your site's i2b2 architecture. For example, i2b2.i2b2.VISIT_DIMENSION [CONCEPT_CD_NAACCR_ITEM_400_PREFIX] = The CONCEPT_CD prefix at your site to identify NAACCR item #400 in your site's i2b2. For example NAACCR:400: or NAACCR|400| [CONCEPT_CD_NAACCR_ITEM_390] = The CONCEPT_CD at your site to identify NAACCR item #390 in your site's i2b2. For example NAACCR:390 or NAACCR|390 [CONCEPT_CD_NAACCR_ITEM_560] = The CONCEPT_CD at your site to identify NAACCR item #560 in your site's i2b2. For example NAACCR:560 or NAACCR|560 [CONCEPT_CD_NAACCR_ITEM_2869] = The CONCEPT_CD at your site to identify NAACCR item #2869 in your site's i2b2. For example NAACCR:2869 or NAACCR|2869 [CDM_PROCEDURES_TABLE_NAME] = The table name of your site's CDM Procedures table. For example, PCORNET.PCORNET.PROCEDURES */ select '[SITE_NAME]' as GPC_SITE, x.CODE, 'CPT_HCPCS' as CODE_TYPE, 'PROCEDURES' as CDM_TABLE, x.DX_YEAR, x.SSF15, x.RECORD_CNT, x.PATIENT_CNT from ( cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) as DX_YEAR , p.px as CODE , nvl(o4.tval_char,'BLANK') as SSF15 , count(*) as RECORD_CNT , count(distinct p.patid) as PATIENT_CNT from --o1, qualify on #390 diagnosis year between 2010 and 2016 [I2B2_OBSERVATION_FACT_TABLE] o1 --o2, qualify on #400 Primary Site between C000 and C809 inner join [I2B2_OBSERVATION_FACT_TABLE] o2 on o1.ENCOUNTER_NUM = o2.encounter_num and o2.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_400_PREFIX]%' and substr(o2.concept_cd,12,4) >= 'C500' and substr(o2.concept_cd,12,4) <= 'C509' --o3, qualify on #560 Sequence Number--Hospital of '00' inner join [I2B2_OBSERVATION_FACT_TABLE] o3 on o1.ENCOUNTER_NUM = o3.encounter_num and o3.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_560]' and o3.tval_char = '00' --Single Primary Breast Cancer Tumor --04, qualify on #2869 SSF15, aka HER2 left outer join [I2B2_OBSERVATION_FACT_TABLE] o4 on o4.ENCOUNTER_NUM = o1.ENCOUNTER_NUM and o4.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_2869]' --v, join to visit_dimension via encounter_num to get the patient_num to use to join to CDM Procedures table inner join [I2B2_VISIT_TABLE] v on o1.encounter_num = v.encounter_num inner join [CDM_PROCEDURES_TABLE_NAME] p on p.PATID = v.PATIENT_NUM and p.px_type = 'C4' and p.px in ('J9355','88360','88361','88342','88377','89586','83950') --from DROC where o1.concept_cd = '[CONCEPT_CD_NAACCR_ITEM_390]' --[Date of Diagnosis] and cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) >= 2010 and cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) <= 2016 group by cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) --DX_YEAR , p.px --CODE , nvl(o4.tval_char,'BLANK') --SSF15 ) x order by GPC_SITE,
23
Query #3 MSSQL i2b2/CDM Tables
NDC/DISPENSING /* [SITE_NAME] = GPC site abbreviation. For example UIOWA [I2B2_OBSERVATION_FACT_TABLE] = The OBSERVATION_FACT table name within your site's i2b2 architecture. For example, i2b2.i2b2.OBSERVATION_FACT [I2B2_VISIT_TABLE] = The VISIT_DIMENSION table name within your site's i2b2 architecture. For example, i2b2.i2b2.VISIT_DIMENSION [CONCEPT_CD_NAACCR_ITEM_400_PREFIX] = The CONCEPT_CD prefix at your site to identify NAACCR item #400 in your site's i2b2. For example NAACCR:400: or NAACCR|400| [CONCEPT_CD_NAACCR_ITEM_390] = The CONCEPT_CD at your site to identify NAACCR item #390 in your site's i2b2. For example NAACCR:390 or NAACCR|390 [CONCEPT_CD_NAACCR_ITEM_560] = The CONCEPT_CD at your site to identify NAACCR item #560 in your site's i2b2. For example NAACCR:560 or NAACCR|560 [CONCEPT_CD_NAACCR_ITEM_2869] = The CONCEPT_CD at your site to identify NAACCR item #2869 in your site's i2b2. For example NAACCR:2869 or NAACCR|2869 [CDM_DISPENSING_TABLE_NAME] = The table name of your site's CDM Dispensing table. For example, PCORNET.PCORNET.DISPENSING */ select '[SITE_NAME]' as GPC_SITE, x.CODE, ‘NDC' as CODE_TYPE, 'DISPENSING' as CDM_TABLE, x.DX_YEAR, x.SSF15, x.RECORD_CNT, x.PATIENT_CNT from ( cast(substring(cast(o1.nval_num as varchar),1,4) as int) as DX_YEAR , d.ndc as CODE , isnull(o4.tval_char,'BLANK') as SSF15 , count(*) as RECORD_CNT , count(distinct d.patid) as PATIENT_CNT from --o1, qualify on #390 diagnosis year between 2010 and 2016 [I2B2_OBSERVATION_FACT_TABLE] o1 --o2, qualify on #400 Primary Site between C000 and C809 inner join [I2B2_OBSERVATION_FACT_TABLE] o2 on o1.ENCOUNTER_NUM = o2.encounter_num and o2.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_400_PREFIX]%' and substring(o2.concept_cd,12,4) >= 'C500' and substring(o2.concept_cd,12,4) <= 'C509' --o3, qualify on #560 Sequence Number--Hospital of '00' inner join [I2B2_OBSERVATION_FACT_TABLE] o3 on o1.ENCOUNTER_NUM = o3.encounter_num and o3.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_560]' and o3.tval_char = '00' --Single Primary Breast Cancer Tumor --04, qualify on #2869 SSF15, aka HER2 left outer join [I2B2_OBSERVATION_FACT_TABLE] o4 on o4.ENCOUNTER_NUM = o1.ENCOUNTER_NUM and o4.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_2869]‘ --v, join to visit_dimension via encounter_num to get the patient_num to use to join to CDM Procedures table inner join [I2B2_VISIT_TABLE] v on o1.encounter_num = v.encounter_num inner join [CDM_DISPENSING_TABLE_NAME] d on d.PATID = v.PATIENT_NUM and d.ndc in (' ' , ' ' , ' ' , ' ' , ' ' , ' ' )--from DROC where o1.concept_cd = '[CONCEPT_CD_NAACCR_ITEM_390]' --[Date of Diagnosis] and cast(substring(cast(o1.nval_num as varchar),1,4) as int) >= 2010 and cast(substring(cast(o1.nval_num as varchar),1,4) as int) <= 2016 group by cast(substring(cast(o1.nval_num as varchar),1,4) as int) --DX_YEAR , d.ndc --CODE , isnull(o4.tval_char,'BLANK') --SSF15 ) x order by GPC_SITE,
24
Query #3 MSSQL i2b2/CDM Tables (example)
NDC/DISPENSING /* [SITE_NAME] = GPC site abbreviation. For example UIOWA [I2B2_OBSERVATION_FACT_TABLE] = The OBSERVATION_FACT table name within your site's i2b2 architecture. For example, i2b2.i2b2.OBSERVATION_FACT [I2B2_VISIT_TABLE] = The VISIT_DIMENSION table name within your site's i2b2 architecture. For example, i2b2.i2b2.VISIT_DIMENSION [CONCEPT_CD_NAACCR_ITEM_400_PREFIX] = The CONCEPT_CD prefix at your site to identify NAACCR item #400 in your site's i2b2. For example NAACCR:400: or NAACCR|400| [CONCEPT_CD_NAACCR_ITEM_390] = The CONCEPT_CD at your site to identify NAACCR item #390 in your site's i2b2. For example NAACCR:390 or NAACCR|390 [CONCEPT_CD_NAACCR_ITEM_560] = The CONCEPT_CD at your site to identify NAACCR item #560 in your site's i2b2. For example NAACCR:560 or NAACCR|560 [CONCEPT_CD_NAACCR_ITEM_2869] = The CONCEPT_CD at your site to identify NAACCR item #2869 in your site's i2b2. For example NAACCR:2869 or NAACCR|2869 [CDM_DISPENSING_TABLE_NAME] = The table name of your site's CDM Dispensing table. For example, PCORNET.PCORNET.DISPENSING */ select 'UIOWA' as GPC_SITE, x.CODE, ‘NDC' as CODE_TYPE, 'DISPENSING' as CDM_TABLE, x.DX_YEAR, x.SSF15, x.RECORD_CNT, x.PATIENT_CNT from ( cast(substring(cast(o1.nval_num as varchar),1,4) as int) as DX_YEAR , d.ndc as CODE , isnull(o4.tval_char,'BLANK') as SSF15 , count(*) as RECORD_CNT , count(distinct d.patid) as PATIENT_CNT from --o1, qualify on #390 diagnosis year between 2010 and 2016 i2b2.i2b2.OBSERVATION_FACT o1 --o2, qualify on #400 Primary Site between C000 and C809 inner join i2b2.i2b2.OBSERVATION_FACT o2 on o1.ENCOUNTER_NUM = o2.encounter_num and o2.concept_cd like 'NAACCR:400: %' and substring(o2.concept_cd,12,4) >= 'C500' and substring(o2.concept_cd,12,4) <= 'C509' --o3, qualify on #560 Sequence Number--Hospital of '00' inner join i2b2.i2b2.OBSERVATION_FACT o3 on o1.ENCOUNTER_NUM = o3.encounter_num and o3.concept_cd like 'NAACCR:560' and o3.tval_char = '00' --Single Primary Breast Cancer Tumor --04, qualify on #2869 SSF15, aka HER2 left outer join i2b2.i2b2.OBSERVATION_FACT o4 on o4.ENCOUNTER_NUM = o1.ENCOUNTER_NUM and o4.concept_cd like 'NAACCR:2869' --v, join to visit_dimension via encounter_num to get the patient_num to use to join to CDM Procedures table inner join i2b2.i2b2.VISIT_DIMENSION v on o1.encounter_num = v.encounter_num inner join PCORNET.PCORNET.DISPENSING d on d.PATID = v.PATIENT_NUM and d.ndc in (' ' , ' ' , ' ' , ' ' , ' ' , ' ' )--from DROC where o1.concept_cd = 'NAACCR:390' --[Date of Diagnosis] and cast(substring(cast(o1.nval_num as varchar),1,4) as int) >= 2010 and cast(substring(cast(o1.nval_num as varchar),1,4) as int) <= 2016 group by cast(substring(cast(o1.nval_num as varchar),1,4) as int) --DX_YEAR , d.ndc --CODE , isnull(o4.tval_char,'BLANK') --SSF15 ) x order by GPC_SITE,
25
Query #3 Oracle i2b2/CDM Tables
NDC/DISPENSING /* [SITE_NAME] = GPC site abbreviation. For example UIOWA [I2B2_OBSERVATION_FACT_TABLE] = The OBSERVATION_FACT table name within your site's i2b2 architecture. For example, i2b2.i2b2.OBSERVATION_FACT [I2B2_VISIT_TABLE] = The VISIT_DIMENSION table name within your site's i2b2 architecture. For example, i2b2.i2b2.VISIT_DIMENSION [CONCEPT_CD_NAACCR_ITEM_400_PREFIX] = The CONCEPT_CD prefix at your site to identify NAACCR item #400 in your site's i2b2. For example NAACCR:400: or NAACCR|400| [CONCEPT_CD_NAACCR_ITEM_390] = The CONCEPT_CD at your site to identify NAACCR item #390 in your site's i2b2. For example NAACCR:390 or NAACCR|390 [CONCEPT_CD_NAACCR_ITEM_560] = The CONCEPT_CD at your site to identify NAACCR item #560 in your site's i2b2. For example NAACCR:560 or NAACCR|560 [CONCEPT_CD_NAACCR_ITEM_2869] = The CONCEPT_CD at your site to identify NAACCR item #2869 in your site's i2b2. For example NAACCR:2869 or NAACCR|2869 [CDM_DISPENSING_TABLE_NAME] = The table name of your site's CDM Dispensing table. For example, PCORNET.PCORNET.DISPENSING */ select '[SITE_NAME]' as GPC_SITE, x.CODE, ‘NDC' as CODE_TYPE, 'DISPENSING' as CDM_TABLE, x.DX_YEAR, x.SSF15, x.RECORD_CNT, x.PATIENT_CNT from ( cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) as DX_YEAR , d.ndc as CODE , nvl(o4.tval_char,'BLANK') as SSF15 , count(*) as RECORD_CNT , count(distinct d.patid) as PATIENT_CNT from --o1, qualify on #390 diagnosis year between 2010 and 2016 [I2B2_OBSERVATION_FACT_TABLE] o1 --o2, qualify on #400 Primary Site between C000 and C809 inner join [I2B2_OBSERVATION_FACT_TABLE] o2 on o1.ENCOUNTER_NUM = o2.encounter_num and o2.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_400_PREFIX]%' and substr(o2.concept_cd,12,4) >= 'C500' and substr(o2.concept_cd,12,4) <= 'C509' --o3, qualify on #560 Sequence Number--Hospital of '00' inner join [I2B2_OBSERVATION_FACT_TABLE] o3 on o1.ENCOUNTER_NUM = o3.encounter_num and o3.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_560]' and o3.tval_char = '00' --Single Primary Breast Cancer Tumor --04, qualify on #2869 SSF15, aka HER2 left outer join [I2B2_OBSERVATION_FACT_TABLE] o4 on o4.ENCOUNTER_NUM = o1.ENCOUNTER_NUM and o4.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_2869]' --v, join to visit_dimension via encounter_num to get the patient_num to use to join to CDM Procedures table inner join [I2B2_VISIT_TABLE] v on o1.encounter_num = v.encounter_num inner join [CDM_DISPENSING_TABLE_NAME] d on d.PATID = v.PATIENT_NUM and d.ndc in (' ' , ' ' , ' ' , ' ' , ' ' , ' ' )--from DROC where o1.concept_cd = '[CONCEPT_CD_NAACCR_ITEM_390]' --[Date of Diagnosis] and cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) >= 2010 and cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) <= 2016 group by cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) --DX_YEAR , d.ndc --CODE , nvl(o4.tval_char,'BLANK') --SSF15 ) x order by GPC_SITE,
26
Query #3 MSSQL i2b2/CDM Tables
RXCUI/PRESCRIBING /* [SITE_NAME] = GPC site abbreviation. For example UIOWA [I2B2_OBSERVATION_FACT_TABLE] = The OBSERVATION_FACT table name within your site's i2b2 architecture. For example, i2b2.i2b2.OBSERVATION_FACT [I2B2_VISIT_TABLE] = The VISIT_DIMENSION table name within your site's i2b2 architecture. For example, i2b2.i2b2.VISIT_DIMENSION [CONCEPT_CD_NAACCR_ITEM_400_PREFIX] = The CONCEPT_CD prefix at your site to identify NAACCR item #400 in your site's i2b2. For example NAACCR:400: or NAACCR|400| [CONCEPT_CD_NAACCR_ITEM_390] = The CONCEPT_CD at your site to identify NAACCR item #390 in your site's i2b2. For example NAACCR:390 or NAACCR|390 [CONCEPT_CD_NAACCR_ITEM_560] = The CONCEPT_CD at your site to identify NAACCR item #560 in your site's i2b2. For example NAACCR:560 or NAACCR|560 [CONCEPT_CD_NAACCR_ITEM_2869] = The CONCEPT_CD at your site to identify NAACCR item #2869 in your site's i2b2. For example NAACCR:2869 or NAACCR|2869 [CDM_PRESCRIBING_TABLE_NAME] = The table name of your site's CDM PRESCRIBING table. For example, PCORNET.PCORNET.PRESCRIBING */ select '[SITE_NAME]' as GPC_SITE, x.CODE, ‘RXCUI' as CODE_TYPE, 'PRESCRIBING' as CDM_TABLE, x.DX_YEAR, x.SSF15, x.RECORD_CNT, x.PATIENT_CNT from ( cast(substring(cast(o1.nval_num as varchar),1,4) as int) as DX_YEAR , pr.rxnorm_cui as CODE , isnull(o4.tval_char,'BLANK') as SSF15 , count(*) as RECORD_CNT , count(distinct pr.patid) as PATIENT_CNT from --o1, qualify on #390 diagnosis year between 2010 and 2016 [I2B2_OBSERVATION_FACT_TABLE] o1 --o2, qualify on #400 Primary Site between C000 and C809 inner join [I2B2_OBSERVATION_FACT_TABLE] o2 on o1.ENCOUNTER_NUM = o2.encounter_num and o2.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_400_PREFIX]%' and substring(o2.concept_cd,12,4) >= 'C500' and substring(o2.concept_cd,12,4) <= 'C509' --o3, qualify on #560 Sequence Number--Hospital of '00' inner join [I2B2_OBSERVATION_FACT_TABLE] o3 on o1.ENCOUNTER_NUM = o3.encounter_num and o3.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_560]' and o3.tval_char = '00' --Single Primary Breast Cancer Tumor --04, qualify on #2869 SSF15, aka HER2 left outer join [I2B2_OBSERVATION_FACT_TABLE] o4 on o4.ENCOUNTER_NUM = o1.ENCOUNTER_NUM and o4.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_2869]‘ --v, join to visit_dimension via encounter_num to get the patient_num to use to join to CDM Procedures table inner join [I2B2_VISIT_TABLE] v on o1.encounter_num = v.encounter_num inner join [CDM_PRESCRIBING_TABLE_NAME] pr on pr.PATID = v.PATIENT_NUM and pr.rxnorm_cui in ('224905', '672149', '672152','540886', '313448', '672149', '672152', '672149', '313448', ' ', ' ', '806573', '806575') --from DROC where o1.concept_cd = '[CONCEPT_CD_NAACCR_ITEM_390]' --[Date of Diagnosis] and cast(substring(cast(o1.nval_num as varchar),1,4) as int) >= 2010 and cast(substring(cast(o1.nval_num as varchar),1,4) as int) <= 2016 group by cast(substring(cast(o1.nval_num as varchar),1,4) as int) --DX_YEAR , pr.rxnorm_cui --CODE , isnull(o4.tval_char,'BLANK') --SSF15 ) x order by GPC_SITE,
27
Query #3 MSSQL i2b2/CDM Tables (example)
RXCUI/PRESCRIBING /* [SITE_NAME] = GPC site abbreviation. For example UIOWA [I2B2_OBSERVATION_FACT_TABLE] = The OBSERVATION_FACT table name within your site's i2b2 architecture. For example, i2b2.i2b2.OBSERVATION_FACT [I2B2_VISIT_TABLE] = The VISIT_DIMENSION table name within your site's i2b2 architecture. For example, i2b2.i2b2.VISIT_DIMENSION [CONCEPT_CD_NAACCR_ITEM_400_PREFIX] = The CONCEPT_CD prefix at your site to identify NAACCR item #400 in your site's i2b2. For example NAACCR:400: or NAACCR|400| [CONCEPT_CD_NAACCR_ITEM_390] = The CONCEPT_CD at your site to identify NAACCR item #390 in your site's i2b2. For example NAACCR:390 or NAACCR|390 [CONCEPT_CD_NAACCR_ITEM_560] = The CONCEPT_CD at your site to identify NAACCR item #560 in your site's i2b2. For example NAACCR:560 or NAACCR|560 [CONCEPT_CD_NAACCR_ITEM_2869] = The CONCEPT_CD at your site to identify NAACCR item #2869 in your site's i2b2. For example NAACCR:2869 or NAACCR|2869 [CDM_PRESCRIBING_TABLE_NAME] = The table name of your site's CDM PRESCRIBING table. For example, PCORNET.PCORNET.PRESCRIBING */ select 'UIOWA' as GPC_SITE, x.CODE, ‘RXCUI' as CODE_TYPE, 'PRESCRIBING' as CDM_TABLE, x.DX_YEAR, x.SSF15, x.RECORD_CNT, x.PATIENT_CNT from ( cast(substring(cast(o1.nval_num as varchar),1,4) as int) as DX_YEAR , pr.rxnorm_cui as CODE , isnull(o4.tval_char,'BLANK') as SSF15 , count(*) as RECORD_CNT , count(distinct pr.patid) as PATIENT_CNT from --o1, qualify on #390 diagnosis year between 2010 and 2016 i2b2.i2b2.OBSERVATION_FACT o1 --o2, qualify on #400 Primary Site between C000 and C809 inner join i2b2.i2b2.OBSERVATION_FACT o2 on o1.ENCOUNTER_NUM = o2.encounter_num and o2.concept_cd like 'NAACCR:400: %' and substring(o2.concept_cd,12,4) >= 'C500' and substring(o2.concept_cd,12,4) <= 'C509' --o3, qualify on #560 Sequence Number--Hospital of '00' inner join i2b2.i2b2.OBSERVATION_FACT o3 on o1.ENCOUNTER_NUM = o3.encounter_num and o3.concept_cd like 'NAACCR:560' and o3.tval_char = '00' --Single Primary Breast Cancer Tumor --04, qualify on #2869 SSF15, aka HER2 left outer join i2b2.i2b2.OBSERVATION_FACT o4 on o4.ENCOUNTER_NUM = o1.ENCOUNTER_NUM and o4.concept_cd like 'NAACCR:2869' --v, join to visit_dimension via encounter_num to get the patient_num to use to join to CDM Procedures table inner join i2b2.i2b2.VISIT_DIMENSION v on o1.encounter_num = v.encounter_num inner join PCORNET.PCORNET.PRESCRIBING pr on pr.PATID = v.PATIENT_NUM and pr.rxnorm_cui in ('224905', '672149', '672152','540886', '313448', '672149', '672152', '672149', '313448', ' ', ' ', '806573', '806575') --from DROC where o1.concept_cd = 'NAACCR:390' --[Date of Diagnosis] and cast(substring(cast(o1.nval_num as varchar),1,4) as int) >= 2010 and cast(substring(cast(o1.nval_num as varchar),1,4) as int) <= 2016 group by cast(substring(cast(o1.nval_num as varchar),1,4) as int) --DX_YEAR , pr.rxnorm_cui --CODE , isnull(o4.tval_char,'BLANK') --SSF15 ) x order by GPC_SITE,
28
Query #3 Oracle i2b2/CDM Tables
RXCUI/PRESCRIBING /* [SITE_NAME] = GPC site abbreviation. For example UIOWA [I2B2_OBSERVATION_FACT_TABLE] = The OBSERVATION_FACT table name within your site's i2b2 architecture. For example, i2b2.i2b2.OBSERVATION_FACT [I2B2_VISIT_TABLE] = The VISIT_DIMENSION table name within your site's i2b2 architecture. For example, i2b2.i2b2.VISIT_DIMENSION [CONCEPT_CD_NAACCR_ITEM_400_PREFIX] = The CONCEPT_CD prefix at your site to identify NAACCR item #400 in your site's i2b2. For example NAACCR:400: or NAACCR|400| [CONCEPT_CD_NAACCR_ITEM_390] = The CONCEPT_CD at your site to identify NAACCR item #390 in your site's i2b2. For example NAACCR:390 or NAACCR|390 [CONCEPT_CD_NAACCR_ITEM_560] = The CONCEPT_CD at your site to identify NAACCR item #560 in your site's i2b2. For example NAACCR:560 or NAACCR|560 [CONCEPT_CD_NAACCR_ITEM_2869] = The CONCEPT_CD at your site to identify NAACCR item #2869 in your site's i2b2. For example NAACCR:2869 or NAACCR|2869 [CDM_PRESCRIBING_TABLE_NAME] = The table name of your site's CDM PRESCRIBING table. For example, PCORNET.PCORNET.PRESCRIBING */ select '[SITE_NAME]' as GPC_SITE, x.CODE, ‘RXCUI' as CODE_TYPE, 'PRESCRIBING' as CDM_TABLE, x.DX_YEAR, x.SSF15, x.RECORD_CNT, x.PATIENT_CNT from ( cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) as DX_YEAR , pr.rxnorm_cui as CODE , nvl(o4.tval_char,'BLANK') as SSF15 , count(*) as RECORD_CNT , count(distinct pr.patid) as PATIENT_CNT from --o1, qualify on #390 diagnosis year between 2010 and 2016 [I2B2_OBSERVATION_FACT_TABLE] o1 --o2, qualify on #400 Primary Site between C000 and C809 inner join [I2B2_OBSERVATION_FACT_TABLE] o2 on o1.ENCOUNTER_NUM = o2.encounter_num and o2.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_400_PREFIX]%' and substr(o2.concept_cd,12,4) >= 'C500' and substr(o2.concept_cd,12,4) <= 'C509' --o3, qualify on #560 Sequence Number--Hospital of '00' inner join [I2B2_OBSERVATION_FACT_TABLE] o3 on o1.ENCOUNTER_NUM = o3.encounter_num and o3.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_560]' and o3.tval_char = '00' --Single Primary Breast Cancer Tumor --04, qualify on #2869 SSF15, aka HER2 left outer join [I2B2_OBSERVATION_FACT_TABLE] o4 on o4.ENCOUNTER_NUM = o1.ENCOUNTER_NUM and o4.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_2869]' --v, join to visit_dimension via encounter_num to get the patient_num to use to join to CDM Procedures table inner join [I2B2_VISIT_TABLE] v on o1.encounter_num = v.encounter_num inner join [CDM_PRESCRIBING_TABLE_NAME] pr on pr.PATID = v.PATIENT_NUM and pr.rxnorm_cui in ('224905', '672149', '672152','540886', '313448', '672149', '672152', '672149', '313448', ' ', ' ', '806573', '806575') --from DROC where o1.concept_cd = '[CONCEPT_CD_NAACCR_ITEM_390]' --[Date of Diagnosis] and cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) >= 2010 and cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) <= 2016 group by cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) --DX_YEAR , pr.rxnorm_cui --CODE , nvl(o4.tval_char,'BLANK') --SSF15 ) x order by GPC_SITE,
29
Query #3 MSSQL i2b2/CDM Tables
LOINC/LAB_RESULT_CM /* [SITE_NAME] = GPC site abbreviation. For example UIOWA [I2B2_OBSERVATION_FACT_TABLE] = The OBSERVATION_FACT table name within your site's i2b2 architecture. For example, i2b2.i2b2.OBSERVATION_FACT [I2B2_VISIT_TABLE] = The VISIT_DIMENSION table name within your site's i2b2 architecture. For example, i2b2.i2b2.VISIT_DIMENSION [CONCEPT_CD_NAACCR_ITEM_400_PREFIX] = The CONCEPT_CD prefix at your site to identify NAACCR item #400 in your site's i2b2. For example NAACCR:400: or NAACCR|400| [CONCEPT_CD_NAACCR_ITEM_390] = The CONCEPT_CD at your site to identify NAACCR item #390 in your site's i2b2. For example NAACCR:390 or NAACCR|390 [CONCEPT_CD_NAACCR_ITEM_560] = The CONCEPT_CD at your site to identify NAACCR item #560 in your site's i2b2. For example NAACCR:560 or NAACCR|560 [CONCEPT_CD_NAACCR_ITEM_2869] = The CONCEPT_CD at your site to identify NAACCR item #2869 in your site's i2b2. For example NAACCR:2869 or NAACCR|2869 [CDM_LAB_RESULT_CM_TABLE_NAME] = The table name of your site's CDM LAB_RESULT_CM table. For example, PCORNET.PCORNET.LAB_RESULT_CM */ select '[SITE_NAME]' as GPC_SITE, x.CODE, 'LOINC' as CODE_TYPE, 'LAB_RESULT_CM' as CDM_TABLE, x.DX_YEAR, x.SSF15, x.RECORD_CNT, x.PATIENT_CNT from ( cast(substring(cast(o1.nval_num as varchar),1,4) as int) as DX_YEAR , lab.lab_loinc as CODE , isnull(o4.tval_char,'BLANK') as SSF15 , count(*) as RECORD_CNT , count(distinct lab.patid) as PATIENT_CNT from --o1, qualify on #390 diagnosis year between 2010 and 2016 [I2B2_OBSERVATION_FACT_TABLE] o1 --o2, qualify on #400 Primary Site between C000 and C809 inner join [I2B2_OBSERVATION_FACT_TABLE] o2 on o1.ENCOUNTER_NUM = o2.encounter_num and o2.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_400_PREFIX]%' and substring(o2.concept_cd,12,4) >= 'C500' and substring(o2.concept_cd,12,4) <= 'C509' --o3, qualify on #560 Sequence Number--Hospital of '00' inner join [I2B2_OBSERVATION_FACT_TABLE] o3 on o1.ENCOUNTER_NUM = o3.encounter_num and o3.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_560]' and o3.tval_char = '00' --Single Primary Breast Cancer Tumor --04, qualify on #2869 SSF15, aka HER2 left outer join [I2B2_OBSERVATION_FACT_TABLE] o4 on o4.ENCOUNTER_NUM = o1.ENCOUNTER_NUM and o4.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_2869]‘ --v, join to visit_dimension via encounter_num to get the patient_num to use to join to CDM Procedures table inner join [I2B2_VISIT_TABLE] v on o1.encounter_num = v.encounter_num inner join [CDM_LAB_RESULT_CM_TABLE_NAME] lab on lab.PATID = v.PATIENT_NUM and lab.lab_loinc in (' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ') --from DROC where o1.concept_cd = '[CONCEPT_CD_NAACCR_ITEM_390]' --[Date of Diagnosis] and cast(substring(cast(o1.nval_num as varchar),1,4) as int) >= 2010 and cast(substring(cast(o1.nval_num as varchar),1,4) as int) <= 2016 group by cast(substring(cast(o1.nval_num as varchar),1,4) as int) --DX_YEAR , lab.lab_loinc --CODE , isnull(o4.tval_char,'BLANK') --SSF15 ) x order by GPC_SITE,
30
Query #3 MSSQL i2b2/CDM Tables (example)
LOINC/LAB_RESULT_CM /* [SITE_NAME] = GPC site abbreviation. For example UIOWA [I2B2_OBSERVATION_FACT_TABLE] = The OBSERVATION_FACT table name within your site's i2b2 architecture. For example, i2b2.i2b2.OBSERVATION_FACT [I2B2_VISIT_TABLE] = The VISIT_DIMENSION table name within your site's i2b2 architecture. For example, i2b2.i2b2.VISIT_DIMENSION [CONCEPT_CD_NAACCR_ITEM_400_PREFIX] = The CONCEPT_CD prefix at your site to identify NAACCR item #400 in your site's i2b2. For example NAACCR:400: or NAACCR|400| [CONCEPT_CD_NAACCR_ITEM_390] = The CONCEPT_CD at your site to identify NAACCR item #390 in your site's i2b2. For example NAACCR:390 or NAACCR|390 [CONCEPT_CD_NAACCR_ITEM_560] = The CONCEPT_CD at your site to identify NAACCR item #560 in your site's i2b2. For example NAACCR:560 or NAACCR|560 [CONCEPT_CD_NAACCR_ITEM_2869] = The CONCEPT_CD at your site to identify NAACCR item #2869 in your site's i2b2. For example NAACCR:2869 or NAACCR|2869 [CDM_LAB_RESULT_CM_TABLE_NAME] = The table name of your site's CDM LAB_RESULT_CM table. For example, PCORNET.PCORNET.LAB_RESULT_CM */ select 'UIOWA' as GPC_SITE, x.CODE, 'LOINC' as CODE_TYPE, 'LAB_RESULT_CM' as CDM_TABLE x.DX_YEAR, x.SSF15, x.RECORD_CNT, x.PATIENT_CNT from ( cast(substring(cast(o1.nval_num as varchar),1,4) as int) as DX_YEAR , lab.lab_loinc as CODE , isnull(o4.tval_char,'BLANK') as SSF15 , count(*) as RECORD_CNT , count(distinct lab.patid) as PATIENT_CNT from --o1, qualify on #390 diagnosis year between 2010 and 2016 i2b2.i2b2.OBSERVATION_FACT o1 --o2, qualify on #400 Primary Site between C000 and C809 inner join i2b2.i2b2.OBSERVATION_FACT o2 on o1.ENCOUNTER_NUM = o2.encounter_num and o2.concept_cd like 'NAACCR:400: %' and substring(o2.concept_cd,12,4) >= 'C500' and substring(o2.concept_cd,12,4) <= 'C509' --o3, qualify on #560 Sequence Number--Hospital of '00' inner join i2b2.i2b2.OBSERVATION_FACT o3 on o1.ENCOUNTER_NUM = o3.encounter_num and o3.concept_cd like 'NAACCR:560' and o3.tval_char = '00' --Single Primary Breast Cancer Tumor --04, qualify on #2869 SSF15, aka HER2 left outer join i2b2.i2b2.OBSERVATION_FACT o4 on o4.ENCOUNTER_NUM = o1.ENCOUNTER_NUM and o4.concept_cd like 'NAACCR:2869' --v, join to visit_dimension via encounter_num to get the patient_num to use to join to CDM Procedures table inner join i2b2.i2b2.VISIT_DIMENSION v on o1.encounter_num = v.encounter_num inner join PCORNET.PCORNET.LAB_RESULT_CM lab on lab.PATID = v.PATIENT_NUM and lab.lab_loinc in (' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ') --from DROC where o1.concept_cd = 'NAACCR:390' --[Date of Diagnosis] and cast(substring(cast(o1.nval_num as varchar),1,4) as int) >= 2010 and cast(substring(cast(o1.nval_num as varchar),1,4) as int) <= 2016 group by cast(substring(cast(o1.nval_num as varchar),1,4) as int) --DX_YEAR , pr.rxnorm_cui --CODE , isnull(o4.tval_char,'BLANK') --SSF15 ) x order by GPC_SITE,
31
Query #3 Oracle i2b2/CDM Tables
LOINC/LAB_RESULT_CM /* [SITE_NAME] = GPC site abbreviation. For example UIOWA [I2B2_OBSERVATION_FACT_TABLE] = The OBSERVATION_FACT table name within your site's i2b2 architecture. For example, i2b2.i2b2.OBSERVATION_FACT [I2B2_VISIT_TABLE] = The VISIT_DIMENSION table name within your site's i2b2 architecture. For example, i2b2.i2b2.VISIT_DIMENSION [CONCEPT_CD_NAACCR_ITEM_400_PREFIX] = The CONCEPT_CD prefix at your site to identify NAACCR item #400 in your site's i2b2. For example NAACCR:400: or NAACCR|400| [CONCEPT_CD_NAACCR_ITEM_390] = The CONCEPT_CD at your site to identify NAACCR item #390 in your site's i2b2. For example NAACCR:390 or NAACCR|390 [CONCEPT_CD_NAACCR_ITEM_560] = The CONCEPT_CD at your site to identify NAACCR item #560 in your site's i2b2. For example NAACCR:560 or NAACCR|560 [CONCEPT_CD_NAACCR_ITEM_2869] = The CONCEPT_CD at your site to identify NAACCR item #2869 in your site's i2b2. For example NAACCR:2869 or NAACCR|2869 [CDM_LAB_RESULT_CM_TABLE_NAME] = The table name of your site's CDM LAB_RESULT_CM table. For example, PCORNET.PCORNET.LAB_RESULT_CM */ select '[SITE_NAME]' as GPC_SITE, x.CODE, 'LOINC' as CODE_TYPE, 'LAB_RESULT_CM' as CDM_TABLE x.DX_YEAR, x.SSF15, x.RECORD_CNT, x.PATIENT_CNT from ( cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) as DX_YEAR , lab.lab_loinc as CODE , nvl(o4.tval_char,'BLANK') as SSF15 , count(*) as RECORD_CNT , count(distinct lab.patid) as PATIENT_CNT from --o1, qualify on #390 diagnosis year between 2010 and 2016 [I2B2_OBSERVATION_FACT_TABLE] o1 --o2, qualify on #400 Primary Site between C000 and C809 inner join [I2B2_OBSERVATION_FACT_TABLE] o2 on o1.ENCOUNTER_NUM = o2.encounter_num and o2.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_400_PREFIX]%' and substr(o2.concept_cd,12,4) >= 'C500' and substr(o2.concept_cd,12,4) <= 'C509' --o3, qualify on #560 Sequence Number--Hospital of '00' inner join [I2B2_OBSERVATION_FACT_TABLE] o3 on o1.ENCOUNTER_NUM = o3.encounter_num and o3.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_560]' and o3.tval_char = '00' --Single Primary Breast Cancer Tumor --04, qualify on #2869 SSF15, aka HER2 left outer join [I2B2_OBSERVATION_FACT_TABLE] o4 on o4.ENCOUNTER_NUM = o1.ENCOUNTER_NUM and o4.concept_cd like '[CONCEPT_CD_NAACCR_ITEM_2869]' --v, join to visit_dimension via encounter_num to get the patient_num to use to join to CDM Procedures table inner join [I2B2_VISIT_TABLE] v on o1.encounter_num = v.encounter_num inner join [CDM_LAB_RESULT_CM_TABLE_NAME] lab on lab.PATID = v.PATIENT_NUM and lab.lab_loinc in (' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ') --from DROC where o1.concept_cd = '[CONCEPT_CD_NAACCR_ITEM_390]' --[Date of Diagnosis] and cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) >= 2010 and cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) <= 2016 group by cast(substr(to_char(o1.nval_num(1)),1,4) as number(10)) --DX_YEAR , lab.lab_loinc --CODE , nvl(o4.tval_char,'BLANK') --SSF15 ) x order by GPC_SITE,
32
Results into Redcap Query#1
Getting Started Download the Query1 import template Download the Query1 import template example Open up the Query1 import template and copy/paste your Query1 results Add a unique record_id for each row of data Format should be [GPC_SITE]_r# (For example, UIOWA_r1, UIOWA_r2, … , UIOWA_r1254 Save your Query1 import template with your data.
33
Results into Redcap Query#1 (cont.)
Log into GPC RedCap and go to “My Projects” Click on “Cancer CRG DROP Query1” Click on “Data Import Tool” Mimic the settings below and browse for your Query1 template and click “Upload File” As long as you do not have any errors, please go ahead and click the “Import Data” button.
34
Results into Redcap Query#2
Getting Started Download the Query2 import template Download the Query2 import template example Open up the Query2 import template and copy/paste your Query2 results Add a unique record_id for each row of data Format should be [GPC_SITE]_r# (For example, UIOWA_r1, UIOWA_r2, … , UIOWA_r558 Save your Query2 import template with your data.
35
Results into Redcap Query#2 (cont.)
Log into GPC RedCap and go to “My Projects” Click on “Cancer CRG DROP Query2” Click on “Data Import Tool” Mimic the settings below and browse for your Query2 template and click “Upload File” As long as you do not have any errors, please go ahead and click the “Import Data” button.
36
Results into Redcap Query#3
Getting Started Download the Query3 import template Download the Query3 import template example Open up the Query3 import template and copy/paste your combined query results from PROCEDURES, DISPENSING, PRESCRIBING, and LAB_RESULT_CM. ***Please Remove the “-” from LOINC codes*** Add a unique record_id for each row of data Format should be [GPC_SITE]_r# (For example, UIOWA_r1, UIOWA_r2, … , UIOWA_3539 Save your Query3 import template with your data.
37
Results into Redcap Query#3 (cont.)
Log into GPC RedCap and go to “My Projects” Click on “Cancer CRG DROP Query3” Click on “Data Import Tool” Mimic the settings below and browse for your Query3 template and click “Upload File” As long as you do not have any errors, please go ahead and click the “Import Data” button.
38
Questions Nicholas C. Smith MS Senior Database Architect
Institute for Clinical & Translational Science The University of Iowa 255 MRF Phone:
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.