Skip to content
Open

Bbv #16

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
f933d79
add q2-q4 2017 files
leeevans May 15, 2018
b21d477
add latest 2017 source files
leeevans May 25, 2018
1042e64
correct file paths
leeevans May 25, 2018
101a9ef
add latest reference data files
leeevans May 25, 2018
d6c929b
added a comment with the new URLs needed for downloading FAERS
boycer May 9, 2019
120346a
added a comment with the new URLs needed for downloading FAERS
boycer May 9, 2019
1b4dbe9
added a comment with the new URLs needed for downloading LAERS
boycer May 9, 2019
0ca05e3
added a comment with the new URLs needed for downloading LAERS
boycer May 9, 2019
3e9b897
Update download_current_files_from_faers.sh
bas172 May 9, 2019
e4d46de
Update download_current_files_from_faers.sh
bas172 May 9, 2019
93e4751
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
bas172 May 9, 2019
dd70e71
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
bas172 May 9, 2019
f81f023
Update download_legacy_files_from_faers.sh
matthew-gray May 10, 2019
d687a0b
Update download_legacy_files_from_faers.sh
matthew-gray May 10, 2019
8cb1358
Update download_current_files_from_faers.sh
matthew-gray May 10, 2019
9ecd521
Update download_current_files_from_faers.sh
matthew-gray May 10, 2019
9968798
Update download_current_files_from_faers.sh
matthew-gray May 10, 2019
cc78d64
Update download_current_files_from_faers.sh
matthew-gray May 10, 2019
3ef2361
Update download_current_files_from_faers.sh
matthew-gray May 13, 2019
95c91af
Update download_current_files_from_faers.sh
matthew-gray May 13, 2019
946c6ef
modifications to get the country code and eu drug name loaded
boycer May 13, 2019
9e8e82c
modifications to get the country code and eu drug name loaded
boycer May 13, 2019
f8e1ea2
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
boycer May 13, 2019
645ac12
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
boycer May 13, 2019
07eb1c9
fixing demo drug indi
matthew-gray May 13, 2019
f567ce1
fixing demo drug indi
matthew-gray May 13, 2019
6cec7bc
added 18Q1 to 19Q1 to files
bas172 May 13, 2019
1996203
added 18Q1 to 19Q1 to files
bas172 May 13, 2019
5ca9457
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
bas172 May 13, 2019
c184ec8
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
bas172 May 13, 2019
3e50d58
temporarily storing drug mapping progress
boycer May 24, 2019
da2704c
temporarily storing drug mapping progress
boycer May 24, 2019
f817b5b
ran metamap over a pharmacist-filtered set of drugs
boycer May 25, 2019
e3856e2
ran metamap over a pharmacist-filtered set of drugs
boycer May 25, 2019
94e2d66
first round drug mapping completed
boycer Jun 5, 2019
f9675f4
first round drug mapping completed
boycer Jun 5, 2019
c6f0027
adding the parsed metamap output for the >300K unmapped drugs
boycer Jun 7, 2019
201e137
adding the parsed metamap output for the >300K unmapped drugs
boycer Jun 7, 2019
04be0ee
README
boycer Jun 7, 2019
de33c58
README
boycer Jun 7, 2019
187a76d
added the complete file with unmapped drugs
boycer Jun 7, 2019
9742d7c
added the complete file with unmapped drugs
boycer Jun 7, 2019
a47d323
added jupyter notebook for initial clustering of unmapped drugs
boycer Sep 25, 2019
aa3a1b5
added jupyter notebook for initial clustering of unmapped drugs
boycer Sep 25, 2019
ad96e35
moving the clustering folder to a new match-unmapped-strings
rkboyce Oct 10, 2019
9fc9c82
moving the clustering folder to a new match-unmapped-strings
rkboyce Oct 10, 2019
64db9e5
moving the clustering folder to a new match-unmapped-strings
rkboyce Oct 10, 2019
c664325
moving the clustering folder to a new match-unmapped-strings
rkboyce Oct 10, 2019
d9b18f1
moving the clustering folder to a new match-unmapped-strings
rkboyce Oct 10, 2019
b1285f3
moving the clustering folder to a new match-unmapped-strings
rkboyce Oct 10, 2019
bc06f70
moving the clustering folder to a new match-unmapped-strings
rkboyce Oct 10, 2019
28c25c2
moving the clustering folder to a new match-unmapped-strings
rkboyce Oct 10, 2019
4396273
changed needed to create all tables and run the statistics
boycer Oct 10, 2019
aeb3cb4
changed needed to create all tables and run the statistics
boycer Oct 10, 2019
41b1248
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
boycer Oct 10, 2019
b2028f6
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
boycer Oct 10, 2019
61aead9
removing an uneeded file
rkboyce Oct 10, 2019
a099bfb
removing an uneeded file
rkboyce Oct 10, 2019
d43d823
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
rkboyce Oct 10, 2019
66c2015
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
rkboyce Oct 10, 2019
94f3b3f
added ability to query a list of drug strings
rkboyce Oct 10, 2019
740715c
added ability to query a list of drug strings
rkboyce Oct 10, 2019
d83ece0
Adding an example of pulling humira reports from both standardized an…
boycer Oct 13, 2019
b560bec
Adding an example of pulling humira reports from both standardized an…
boycer Oct 13, 2019
f600365
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
boycer Oct 13, 2019
9362ec3
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
boycer Oct 13, 2019
46aa711
changed file open to use codes with utf-8
rkboyce Oct 26, 2019
319e97f
changed file open to use codes with utf-8
rkboyce Oct 26, 2019
ad7808c
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
rkboyce Oct 26, 2019
d9b46a0
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
rkboyce Oct 26, 2019
a7f8b06
small bug fixes
rkboyce Nov 27, 2019
d575208
small bug fixes
rkboyce Nov 27, 2019
196e268
adding some files before push
boycer Jan 7, 2020
96a91dc
adding some files before push
boycer Jan 7, 2020
c0db932
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
boycer Jan 7, 2020
7cf9ee1
corrected standard deviation
rkboyce Jan 7, 2020
cd6d436
corrected standard deviation
rkboyce Jan 7, 2020
0d29662
Update example-report-extract.sql
rkboyce Oct 31, 2020
abba2ee
Update example-report-extract.sql
rkboyce Oct 31, 2020
c8c3a8c
bring in data from 2019 Q2 through 2020 Q2
rkboyce Nov 11, 2020
909d303
bring in data from 2019 Q2 through 2020 Q2
rkboyce Nov 11, 2020
e45a20a
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
rkboyce Nov 11, 2020
5627b49
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
rkboyce Nov 11, 2020
3f3e4c9
Q3 2020 update with log
rkboyce Nov 26, 2020
643b82a
Q3 2020 update with log
rkboyce Nov 26, 2020
ae845ff
adding an example with tizanidine and cipro
rkboyce Nov 26, 2020
8e947e8
adding an example with tizanidine and cipro
rkboyce Nov 26, 2020
2181d26
adding items from recent update
rkboyce Dec 2, 2020
e4e87c3
adding items from recent update
rkboyce Dec 2, 2020
5901684
adding items from recent update
rkboyce Dec 2, 2020
f5c6a22
adding items from recent update
rkboyce Dec 2, 2020
e0d9de8
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
boycer Dec 2, 2020
2b89a9c
added a more interesting example
rkboyce Dec 14, 2020
7b8dfb9
added a more interesting example
rkboyce Dec 14, 2020
6b85204
file rearrangement
rkboyce Dec 14, 2020
bddcb0e
file rearrangement
rkboyce Dec 14, 2020
13426cc
added an updated example of report export
boycer Feb 24, 2021
8756977
fixing merge issue
boycer Feb 24, 2021
384769d
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
boycer Feb 24, 2021
898ea0d
updating tiz example
boycer Feb 24, 2021
4d68356
added scripts from the first test of adding NPs the CEM
rkboyce May 29, 2021
eb4a439
Merge branch 'master' of https://github.com/dbmi-pitt/faersdbstats
rkboyce May 29, 2021
3893256
added new tables to do PV using natural product common names. These a…
rkboyce Aug 5, 2021
6b89efc
added script from late august NP signal run using exact string matches
rkboyce Aug 20, 2021
e0d7e0b
let there be schemas
wolfderby Jan 29, 2022
6a4f17a
Skip Orange Book Data Load/COPY
wolfderby Jan 29, 2022
51b5275
Relocate country data and skip load/COPY
wolfderby Jan 29, 2022
7aa113d
moved to /data
wolfderby Jan 29, 2022
82e0219
config for orange book download
wolfderby Jan 29, 2022
eebc2fe
curl orange book data
wolfderby Jan 29, 2022
e9f1fc6
Pentaho Config File
wolfderby Jan 29, 2022
0b98bdf
Merge branch 'bbv' of https://github.com/dbmi-pitt/faersdbstats into bbv
wolfderby Jan 29, 2022
d0c24f3
aws config
wolfderby Jan 29, 2022
5f2bf35
orange book download and unzip
wolfderby Jan 30, 2022
586878b
orange book download job
wolfderby Jan 30, 2022
de3d7b1
moved the configs
wolfderby Jan 31, 2022
fd5f45c
moved /data up one level next to repo location
wolfderby Mar 11, 2022
f71a3d1
latest .gitignore
wolfderby Mar 11, 2022
74049d1
orange_book jobs
wolfderby Mar 11, 2022
b3ee99b
set up env vars in pentaho 4 debugging steps/trans
wolfderby Mar 11, 2022
0437841
one job to rule them all
wolfderby Mar 11, 2022
69bfd91
country code (spits into s3 /data)
wolfderby Mar 11, 2022
fb49828
demo(graphic) data
wolfderby Mar 11, 2022
00ad6a7
load_* > create_* (comments out /COPY)
wolfderby Mar 11, 2022
43f4433
drug data
wolfderby Mar 11, 2022
be63398
oops forgot a country code file
wolfderby Mar 11, 2022
6c8c90d
eu drug
wolfderby Mar 11, 2022
afda86f
housekeeping
wolfderby Mar 11, 2022
cf378ee
move orangebook data to data_setup on s3
wolfderby Mar 11, 2022
1d75baf
move country code data to data_setup
wolfderby Mar 11, 2022
138b797
move eu drug data to _setup
wolfderby Mar 11, 2022
b5ac108
latest changes
rkboyce May 18, 2022
c620fd9
fix variable substitution
rkboyce May 23, 2022
1d41c99
s3_data_download improved error reporting
rkboyce May 24, 2022
1c5a0e7
few notes added and set up aws cred
rkboyce May 24, 2022
befd9fa
7 domains and faers_or_laers
rkboyce May 26, 2022
d863ceb
domain transform is good
rkboyce May 26, 2022
fefe191
staging_vocabulary > vocabulary
rkboyce May 26, 2022
4907f64
standard and oursource schemas tbd
rkboyce May 26, 2022
7834d4e
notes
rkboyce May 27, 2022
f85c46c
set job vars scope back to valid in jvm n other
rkboyce May 27, 2022
0fc55a9
usagi_transform needs data linked still
rkboyce May 27, 2022
4ad648b
pentaho log table creation statement
rkboyce Jun 1, 2022
6a2063f
added current issues note
rkboyce Jun 6, 2022
9999dbe
updated FAERSDBSTATS_REPO_LOCATION
wolfderby Jun 6, 2022
68c53e2
faers meta 2020 Q1 passed
wolfderby Jun 6, 2022
ed3d669
faers and laers tests passed
wolfderby Jun 8, 2022
7c71cdd
s3 data dl laers worthy
wolfderby Jun 9, 2022
3a80c62
logging improvement attempts
wolfderby Jun 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
config/pentaho.config
config/aws.config
config/pentaho.config
config.config
faers.config
Binary file added FAERS-schema-doc-2020-ASC_NTS.pdf
Binary file not shown.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ Standardize FDA LAERS database and FAERS database drugs, indications, reactions
and generate the unique case report counts and safety signal statistics

See the documentation folder for more information.

Dependencies:
Postgres 9.1+ (create table if not exists)
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
137 changes: 137 additions & 0 deletions documentation/FAERS-humira-example-2019.csv

Large diffs are not rendered by default.

Binary file not shown.
180 changes: 180 additions & 0 deletions documentation/example-report-extract.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
-- Example of pulling reports for tizanidine



/*
python3 getDrugNameMatches.py -d 1 -s 'tizanidine|TIZANIDINE HYDROCHLORIDE|Zanaflex|ZANAFLEX (tizanidine hcl)|ZANAFLEX (tizanidine hydrochloride)|ZANAFLEX (tizanidine hcl 4mg) tablet|TERNELIN|SIRDALUD' -f drugs-unmapped-June2019.csv > /tmp/tizanidine-likely-mispelled.txt

Searching for string matches to TIZANIDINE|TIZANIDINE HYDROCHLORIDE|ZANAFLEX|ZANAFLEX (TIZANIDINE HCL)|ZANAFLEX (TIZANIDINE HYDROCHLORIDE)|ZANAFLEX (TIZANIDINE HCL 4MG) TABLET|TERNELIN|SIRDALUD using input file drugs-unmapped-June2019.csv and 1 allowed character replacements.
Input file drugs-unmapped-June2019.csv has 356124 lines.

NOTE: There is a record that has no pipes - assuming end of file. Total number of lines processed: 356123. Total lines in file:356124


Total length of unmapped drug strings input from the file (removing duplicates): 356108

NOTE: these drug strings could not be processed because they contain more than one pipe symbol. These will need to be corrected BOTH in the database and in the input file:
"CELECOXIB;IBUPROFEN|NAPROXEN;PLA(IBUPROFEN)"|2
"PROACTIV CLEANSER 2.5% BENZOYL PEROXIED GUTHY|RENKER"|2
"|LISINOPRIL"|1
"CELECOXIB;IBUPROFEN|NAPROXEN;PLACEBO"|1
"|METOPROLOL"|1
"ATORVASTATIN | LOVASTATIN| YEAST EXTRACT FROM MONASCUS PURPUREUS"|1
"|ATENOLOL"|1
"|SIMVAST ATIN"|1
"|SPIRONOLACTONE"|1
"|MONTELUKAST"|1
"CADD SOLIS |V PUMP"|1
"FARXIGA(DAPAG|IFLOZIN PROPANEDIOL) 5 MG TABLET"|1

MATCH RESULTS:
BIZANIDINE
CANAFLEX
DIZANIDINE
FANAFLEX
LANAFLEX
LIZANIDINE
PIZANIDINE
RIZANIDINE
SANAFLEX
SIDALUD
SIDALUD (SIRDALUD)
SIRADALUD
SIRALUD
SIRALUD 2
SIRDALUD (TIZANDINE HYDROCHLORIDE)
SIRDALUD (TYIZANIDINE HYDROCHLORIDE)
SIRDALUD /00740702/ (SIRDALUD - TIZANADINE HYDROCHLORIDE) 2MG (NOT SPE
SIRDALUD /00740702/ (SIRDALUD - TIZANDINE HYDROCHLORIDE) (NOT SPECIFIE
SIRDALUD/00740702/(SIRDALUD TIZANADINE HYDROCHLORIDE)
SIRDALUL
SIRDALUT
TANAFLEX
TAZANIDINE
TAZANIDINE 4MG 2X/DAY
TAZANIDINE HYDROCHLORIDE (TAZANIDINE HYDROCHLORIDE)
TERNALIN
TERNELIN (TERNELIN - TIZANADINE HYDROCHLORIDE)
TERNELIN (TIAZANIDINE HYDROCHLORIDE)
TERNELLIN
THIZANIDINE HCL
TIANIDINE 4 MG
TIAZANIDINE (TIAZANIDINE)
TICANIDINE
TIDANIDINE
TIDANIDINE HYDROCHLORIDE
TIIZANIDINE
TINZANIDINE
TINZANIDINE HYDROCHLORIDE
TIRANIDINE
TISANIDINE
TITANIDINE
TIVANIDINE
TIVANIDINE HCL
TIXANIDINE
TIZAMIDINE
TIZANADINE 4 MG
TIZANADINE HCL
TIZANADINE HCL (UNKNOWN)
TIZANADINE HYDROCHLORIDE
TIZANDIDINE
TIZANDINE 4MG
TIZANDINE 8MG
TIZANDINE HYDROCHLORIDE
TIZANDINE HYDROCHLORIDE (TIZANDINE HYDROCHLORIDE)
TIZANEDINE
TIZANICINE
TIZANIDANE
TIZANIDENE
TIZANIDIE
TIZANIDIN ACTAVIS
TIZANIDIN EOLAPATADINE
TIZANIDIN TEVA 2MG
TIZANIDINE HYDROCHLORIDE (TIZANADINE HYDROCHLORIDE)
TIZANIDINE HYDROCHLORIDE (TIZANTIDINE HYDROCHLORIDE)
TIZANIDINEM
TIZANIDINI HYDROCLORIDUM
TIZANIDINIE
TIZANINDINE
TIZANISINE
TIZANITINE HCL
TIZANNIDINE (ZARAFLEX)
TIZANOIDINE
TIZANTIDINE
TIZATIDINE
TIZENIDINE
TIZENIDINE (UNKNOWN)
TIZIANIDINE
TIZIANIDINE HCL
TIZINIDINE
TIZNIDINE
TIZONIDINE
TRIZANIDINE
TRIZANIDINE HCL
TYZANIDINE
TYZANIDINE MUSCLE RELAXANT
TZANIDINE
XANAFLEX
XANAFLEX 4MG UNKNOWN
XANAFLEX MUSCLE RELAXER
ZAMAFLEX
ZANAFIEX
ZANAFLAX
ZANAFLAX (NOS)
ZANAFLEX (TIZADNIDINE HYDROCHLORIDE)
ZANAFLEX (TIZANDIDINE HYDROCHLORIDE)
ZANAFLEX (TIZANIDFINE HYDROCHLORIDE) (TIZANIDINE HYDROCHLORDIE)
ZANAFLEX (TYZANIDINE HYDROCHLORIDE)
ZANAFLEZ
ZANAFLUX
ZANALLEX
ZANAPLEX
ZANASLEX
ZANEFLEX
ZANFLEX
ZANIFLEX
ZANNAFLEX
ZANOFLEX
ZANTAFLEX
ZEANAFLEX
ZENAFLEX
ZONAFLEX

*/




-- Query the standardized drug - outcome count tables using the drug concept ids for all reports involving tizanidine and 1 character name variations
with tizSpecific as (
select distinct drug.caseid
from faers.drug drug
where drug.drugname ilike '%tizanidine%'
or upper(drug.drugname) in ('BIZANIDINE','CANAFLEX','DIZANIDINE','FANAFLEX','LANAFLEX','LIZANIDINE','PIZANIDINE','RIZANIDINE','SANAFLEX','SIDALUD','SIDALUD (SIRDALUD)','SIRADALUD','SIRALUD','SIRALUD 2','SIRDALUD (TIZANDINE HYDROCHLORIDE)','SIRDALUD (TYIZANIDINE HYDROCHLORIDE)','SIRDALUD /00740702/ (SIRDALUD - TIZANADINE HYDROCHLORIDE) 2MG (NOT SPE','SIRDALUD /00740702/ (SIRDALUD - TIZANDINE HYDROCHLORIDE) (NOT SPECIFIE','SIRDALUD/00740702/(SIRDALUD TIZANADINE HYDROCHLORIDE)','SIRDALUL','SIRDALUT','TANAFLEX','TAZANIDINE','TAZANIDINE 4MG 2X/DAY','TAZANIDINE HYDROCHLORIDE (TAZANIDINE HYDROCHLORIDE)','TERNALIN','TERNELIN (TERNELIN - TIZANADINE HYDROCHLORIDE)','TERNELIN (TIAZANIDINE HYDROCHLORIDE)','TERNELLIN','THIZANIDINE HCL','TIANIDINE 4 MG','TIAZANIDINE (TIAZANIDINE)','TICANIDINE','TIDANIDINE','TIDANIDINE HYDROCHLORIDE','TIIZANIDINE','TINZANIDINE','TINZANIDINE HYDROCHLORIDE','TIRANIDINE','TISANIDINE','TITANIDINE','TIVANIDINE','TIVANIDINE HCL','TIXANIDINE','TIZAMIDINE','TIZANADINE 4 MG','TIZANADINE HCL','TIZANADINE HCL (UNKNOWN)','TIZANADINE HYDROCHLORIDE','TIZANDIDINE','TIZANDINE 4MG','TIZANDINE 8MG','TIZANDINE HYDROCHLORIDE','TIZANDINE HYDROCHLORIDE (TIZANDINE HYDROCHLORIDE)','TIZANEDINE','TIZANICINE','TIZANIDANE','TIZANIDENE','TIZANIDIE','TIZANIDIN ACTAVIS','TIZANIDIN EOLAPATADINE','TIZANIDIN TEVA 2MG','TIZANIDINE HYDROCHLORIDE (TIZANADINE HYDROCHLORIDE)','TIZANIDINE HYDROCHLORIDE (TIZANTIDINE HYDROCHLORIDE)','TIZANIDINEM','TIZANIDINI HYDROCLORIDUM','TIZANIDINIE','TIZANINDINE','TIZANISINE','TIZANITINE HCL','TIZANNIDINE (ZARAFLEX)','TIZANOIDINE','TIZANTIDINE','TIZATIDINE','TIZENIDINE','TIZENIDINE (UNKNOWN)','TIZIANIDINE','TIZIANIDINE HCL','TIZINIDINE','TIZNIDINE','TIZONIDINE','TRIZANIDINE','TRIZANIDINE HCL','TYZANIDINE','TYZANIDINE MUSCLE RELAXANT','TZANIDINE','XANAFLEX','XANAFLEX 4MG UNKNOWN','XANAFLEX MUSCLE RELAXER','ZAMAFLEX','ZANAFIEX','ZANAFLAX','ZANAFLAX (NOS)','ZANAFLEX (TIZADNIDINE HYDROCHLORIDE)','ZANAFLEX (TIZANDIDINE HYDROCHLORIDE)','ZANAFLEX (TIZANIDFINE HYDROCHLORIDE) (TIZANIDINE HYDROCHLORDIE)','ZANAFLEX (TYZANIDINE HYDROCHLORIDE)','ZANAFLEZ','ZANAFLUX','ZANALLEX','ZANAPLEX','ZANASLEX','ZANEFLEX','ZANFLEX','ZANIFLEX','ZANNAFLEX','ZANOFLEX','ZANTAFLEX','ZEANAFLEX','ZENAFLEX','ZONAFLEX')
), standardSummary as (
select cd.concept_name standard_drug_name,
co.concept_name standard_outcome_name,
sdod.*
from faers.standard_drug_outcome_drilldown sdod inner join tizSpecific on sdod.caseid = tizSpecific.caseid
inner join staging_vocabulary.concept cd on sdod.drug_concept_id = cd.concept_id
inner join staging_vocabulary.concept co on sdod.outcome_concept_id = co.concept_id
)
select drug.primaryid, drug.caseid, drug.drug_seq, drug.role_cod, drug.drugname, drug.prod_ai, drug.val_vbm, drug.route, drug.dose_vbm, drug.cum_dose_chr, drug.cum_dose_unit, drug.dechal, drug.rechal, drug.lot_num, drug.exp_dt, drug.nda_num, drug.dose_amt, drug.dose_unit, drug.dose_form, drug.dose_freq, drug.filename,
string_agg(distinct standardSummary.drug_concept_id::text, ';') drug_concept_id, string_agg(distinct standardSummary.standard_drug_name, ';') standard_drug_name,
string_agg(distinct standardSummary.standard_outcome_name, ';') standard_outcome_name, string_agg(distinct standardSummary.outcome_concept_id::text, ';') outcome_concept_id, string_agg(distinct standardSummary.snomed_outcome_concept_id::text, ';') snomed_outcome_concept_id,
string_agg(distinct scoc.outc_code, ';') standard_outcome_code, string_agg(distinct scoc.snomed_concept_id::text, ';') standard_outcome_snomed,
demo.caseversion, demo.i_f_code, demo.event_dt, demo.mfr_dt, demo.init_fda_dt, demo.fda_dt, demo.rept_cod, demo.auth_num, demo.mfr_num, demo.mfr_sndr, demo.lit_ref, demo.age, demo.age_cod, demo.age_grp, demo.sex, demo.e_sub, demo.wt, demo.wt_cod, demo.rept_dt, demo.to_mfr, demo.occp_cod, demo.reporter_country, demo.occr_country, demo.filename,
indi.indi_drug_seq, indi.indi_pt, indi.filename,
rpsr.rpsr_cod, rpsr.filename
from faers.drug drug inner join standardSummary on drug.primaryid = standardSummary.primaryid
inner join faers.demo demo on demo.primaryid = standardSummary.primaryid
left outer join faers.standard_case_outcome_category scoc on scoc.primaryid = standardSummary.primaryid
left outer join faers.indi indi on indi.primaryid = standardSummary.primaryid and indi.indi_drug_seq = drug.drug_seq
left outer join faers.rpsr rpsr on rpsr.primaryid = standardSummary.primaryid
GROUP BY drug.primaryid, drug.caseid, drug.drug_seq, drug.role_cod, drug.drugname, drug.prod_ai, drug.val_vbm, drug.route, drug.dose_vbm, drug.cum_dose_chr, drug.cum_dose_unit, drug.dechal, drug.rechal, drug.lot_num, drug.exp_dt, drug.nda_num, drug.dose_amt, drug.dose_unit, drug.dose_form, drug.dose_freq, drug.filename,
demo.caseversion, demo.i_f_code, demo.event_dt, demo.mfr_dt, demo.init_fda_dt, demo.fda_dt, demo.rept_cod, demo.auth_num, demo.mfr_num, demo.mfr_sndr, demo.lit_ref, demo.age, demo.age_cod, demo.age_grp, demo.sex, demo.e_sub, demo.wt, demo.wt_cod, demo.rept_dt, demo.to_mfr, demo.occp_cod, demo.reporter_country, demo.occr_country, demo.filename,
indi.indi_drug_seq, indi.indi_pt, indi.filename,
rpsr.rpsr_cod, rpsr.filename
ORDER BY drug.primaryid, drug.drug_seq
;

12 changes: 12 additions & 0 deletions documentation/example-signal-query.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set search_path to faers;
with signals as (
select *
from standard_drug_outcome_statistics
where case_count >= 10
and prr > 3.0
limit 100
)
select c1.concept_name, c2.concept_name, signals.*
from staging_vocabulary.concept c1 inner join signals on signals.drug_concept_id = c1.concept_id
inner join staging_vocabulary.concept c2 on signals.outcome_concept_id = c2.concept_id
;
Binary file not shown.
Binary file not shown.
Loading