documentation:laertes_etl
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| documentation:laertes_etl [2015/05/26 18:18] – [Step 1] lee | documentation:laertes_etl [2015/06/23 10:58] (current) – lee | ||
|---|---|---|---|
| Line 33: | Line 33: | ||
| This model decouples the data sources from the various copies of the | This model decouples the data sources from the various copies of the | ||
| sources that might have been processed in many different ways. It also | sources that might have been processed in many different ways. It also | ||
| - | decouples what can be said about and evidence item (i.e., the semantic | + | decouples what can be said about an evidence item (i.e., the semantic |
| tags) from the information artifact. All of this allows for greater | tags) from the information artifact. All of this allows for greater | ||
| flexibility with respect to inclusion of sources and | flexibility with respect to inclusion of sources and | ||
| Line 173: | Line 173: | ||
| ==== “Terminology-mappings” directory ==== | ==== “Terminology-mappings” directory ==== | ||
| - | This directory contains a number of data sets used to ultimately | + | This directory contains a number of data sets ultimately |
| ==== ETL Process | ==== ETL Process | ||
| Line 186: | Line 186: | ||
| Ensure that all of the prerequisite hardware, DBMSs and the URL Shortener service have been deployed. | Ensure that all of the prerequisite hardware, DBMSs and the URL Shortener service have been deployed. | ||
| - | ==== Step 1 ==== | + | ==== EU SPC ADR data feed ==== |
| European Union Adverse Drug Reactions from Summary of Product Characteristics (EU SPC) Database Import | European Union Adverse Drug Reactions from Summary of Product Characteristics (EU SPC) Database Import | ||
| === Overview === | === Overview === | ||
| - | * Download, the EU SPC datasets | + | * Download, the EU SPC data sets (see data sources table) |
| - | * Convert | + | * Run python scripts to convert |
| * Load the RDF ntriple graph data into the Virtuoso database | * Load the RDF ntriple graph data into the Virtuoso database | ||
| - | * Use the Virtuoso | + | * Manually run Virtuoso SPARQL query to export |
| - | * Load the export file into the PostgreSQL public schema database | + | * Manually load the annotation URIs into the URL Shortener MySQL database using the MySQL command line client |
| + | * Run Python script to load the export file into the PostgreSQL public schema database | ||
| === Details === | === Details === | ||
| Line 201: | Line 202: | ||
| The details for this data feed are documented and maintained here: | The details for this data feed are documented and maintained here: | ||
| https:// | https:// | ||
| - | ==== Step 2 ==== | ||
| - | |||
| - | === Overview === | ||
| - | |||
| - | Download, the SNOMED datasets from the website. Decompress the gzipped files. Run the ETL script to create the staging tables schema and load the datasets. | ||
| - | |||
| - | === Notes === | ||
| - | |||
| - | * step 14 of load_stage.sql: | ||
| - | < | ||
| - | alter table concept_stage modify | ||
| - | </ | ||
| - | |||
| - | The international SNOMED-CT and the UK SNOMED-CT will be loaded into separate staging tables and then unioned together | ||
| - | |||
| - | === Details === | ||
| - | |||
| - | - Run create_source_tables.sql | ||
| - | - Download the international SNOMED file SnomedCT_Release_INT_YYYYMMDD.zip from http:// | ||
| - | - Extract the release date from the file name. | ||
| - | - Extract the following files from the folder: | ||
| - | * SnomedCT_Release_INT_YYYYMMDD\RF2Release\Full\Terminology: | ||
| - | * sct2_Concept_Full_INT_YYYYMMDD.txt | ||
| - | * sct2_Description_Full-en_INT_YYYYMMDD.txt | ||
| - | * sct2_Relationship_Full_INT_YYYYMMDD.txt Remove date from file name. | ||
| - | - Load them into SCT2_CONCEPT_FULL_INT, | ||
| - | - Download the British SNOMED file SNOMEDCT2_XX.0.0_YYYYMMDD000001.zip from https:// | ||
| - | - Extract the release date from the file name. | ||
| - | - Extract the following files from the folder SnomedCT2_GB1000000_YYYYMMDD\RF2Release\Full\Terminology into a working folder: | ||
| - | *sct2_Concept_Full_GB1000000_YYYYMMDD.txt | ||
| - | * sct2_Description_Full-en-GB_GB1000000_YYYYMMDD.txt | ||
| - | * sct2_Description_Full-en-GB_GB1000000_YYYYMMDD.txt Remove date from file name. | ||
| - | - Load them into SCT2_CONCEPT_FULL_UK, | ||
| - | - Extract der2_cRefset_AssociationReferenceFull_INT_YYYYMMDD.txt from SnomedCT_Release_INT_YYYYMMDD\RF2Release\Full\Refset\Content and der2_cRefset_AssociationReferenceFull_GB1000000_YYYYMMDD.txt from SnomedCT2_GB1000000_YYYYMMDD\RF2Release\Full\Refset\Content Remove date from file name. | ||
| - | - Load them into der2_cRefset_AssRefFull_INT and der2_cRefset_AssRefFull_UK. (rename the data files to remove any YYYYMMDD suffix so they match the file names in the ctl files) | ||
| - | |||
| - | Staging table load statements | ||
| - | |||
| - | < | ||
| - | sqlldr PRODV5/< | ||
| - | sqlldr PRODV5/< | ||
| - | sqlldr PRODV5/< | ||
| - | sqlldr PRODV5/< | ||
| - | sqlldr PRODV5/< | ||
| - | sqlldr PRODV5/< | ||
| - | sqlldr PRODV5/< | ||
| - | sqlldr PRODV5/< | ||
| - | </ | ||
| - | |||
| - | - Run load_stage.sql | ||
| - | - Run generic_update.sql (from working directory) | ||
| - | ==== Step 3 ==== | + | ==== PUBMED / MEDLINE data feed ==== |
| + | MEDLINE records for indexed literature reporting adverse drug events | ||
| === Overview === | === Overview === | ||
| - | Download, the RxNorm datasets from the website. Decompress | + | * Download, the PUBMED/ |
| - | + | * Run python scripts to convert | |
| - | === Notes === | + | * Load the RDF ntriple graph data into the Virtuoso |
| - | Update | + | * Manually |
| - | + | * Manually run Virtuoso SPARQL query to export | |
| - | This ETL step processes RxNorm, ATC, NDFRT, VA Product , VA Class and ATC vocabularies. | + | * Run Python |
| - | + | ||
| - | At step 15 of create_source_tables.sql you must run the generic_update_sql | + | |
| === Details === | === Details === | ||
| - | - Run create_source_tables.sql | + | The details for this data feed are documented and maintained here: |
| - | - Download RxNorm_full_MMDDYYYY.zip from http://www.nlm.nih.gov/research/umls/rxnorm/docs/rxnormfiles.html | + | https://github.com/OHDSI/KnowledgeBase/tree/master/LAERTES/ |
| - | - Extract and load into the tables from the folder rrf. Use the control files of the same name RXNATOMARCHIVE RXNCONSO RXNCUI RXNCUICHANGES RXNDOC RXNREL RXNSAB RXNSAT RXNSTY | + | ==== SPLICER SPL data feed ==== |
| - | - Run load_stage.sql | + | SPLICER Natural Language Processing extracted Adverse Drug Events from FDA Structured Product Labels (SPLs) |
| - | - Run generic_update.sql (from working directory) | + | |
| - | + | ||
| - | ==== Step 4 ==== | + | |
| === Overview === | === Overview === | ||
| - | Download the HCPCS datasets from the website. Decompress the gzipped files. | + | * Download the SPLICER data sets (see data sources table) |
| - | + | * Run python scripts | |
| - | === Notes === | + | * Load the RDF ntriple graph data into the Virtuoso database |
| - | + | * Manually | |
| - | load_stage.sql Steps 9 and 10 are completely manual – a select statement | + | * Manually run Virtuoso SPARQL query to export |
| + | * Run Python script to load the export | ||
| === Details === | === Details === | ||
| - | - Run create_source_tables.sql | + | The details for this data feed are documented and maintained here: |
| - | - Download the latest file http://www.cms.gov/Medicare/Coding/HCPCSReleaseCodeSets/Alpha-Numeric-HCPCS.html, | + | https://github.com/OHDSI/KnowledgeBase/tree/master/LAERTES/SPLICER |
| - | - Extract HCPCYYYY_CONTR_ANWEB_v2.xlsx | + | ==== SemMED data feed ==== |
| - | - Open the above file in excel and export a csv file (with double quoted fields) called HCPC2015_CONTR_ANWEB_v2.csv for loading into ANWEB_V2 staging table. | + | The Semantic MEDLINE Database is a repository of semantic predications (subject-predicate-object triples) extracted by SemRep, a semantic interpreter of biomedical text. |
| - | - Load the file data into ANWEB_V2. Use the control files of the same name. | + | |
| - | - Run load_stage.sql | + | |
| - | - Run generic_update.sql (from working directory) | + | |
| - | + | ||
| - | Staging table load statements | + | |
| - | + | ||
| - | < | + | |
| - | sqlldr PRODV5/< | + | |
| - | </code> | + | |
| - | + | ||
| - | + | ||
| - | ==== Step 5 ==== | + | |
| === Overview === | === Overview === | ||
| - | Download, the ICD9CM datasets. Decompress | + | * Download the SemMED Database MySQL data dump file (see data sources table) |
| + | * Load the MySQL database dump file into a MySQL database (this typically takes hours to load) | ||
| + | * Run python scripts to convert | ||
| + | * Load the RDF ntriple graph data into the Virtuoso database | ||
| + | * Manually load the annotation URIs into the URL Shortener MySQL database using the MySQL command line client | ||
| + | * Manually run Virtuoso SPARQL query to export | ||
| + | * Run Python script to load the export file into the PostgreSQL public schema database | ||
| === Details === | === Details === | ||
| - | - Run create_source_tables.sql | + | The details |
| - | - Download from ICD-9-CM-vXX-master-descriptions.zip from http:// | + | https:// |
| - | - Extract CMSXX_DESC_LONG_DX.txt and CMSXX_DESC_SHORT_DX.txt | + | |
| - | - Load them into CMS_DESC_LONG_DX and CMS_DESC_SHORT_DX. Use the control files of the same name. | + | |
| - | - Run load_stage.sql | + | |
| - | - Run generic_update.sql (from working directory) | + | |
| - | + | ||
| - | Staging table load statements | + | |
| - | < | + | |
| - | sqlldr PRODV5/< | + | |
| - | sqlldr PRODV5/< | + | |
| - | </ | + | |
| - | + | ||
| - | ==== Step 6 ==== | + | |
| - | + | ||
| - | === Overview === | + | |
| - | + | ||
| - | Download, the ICD9Proc datasets. Decompress the gzipped files. Run the ETL script to create the staging tables schema and load the datasets. | + | |
| - | + | ||
| - | === Notes === | + | |
| - | + | ||
| - | load_stage.sql Steps 8 and 9 are completely manual – a select statement to generate the set of Medical Coder rows which need to be exported as a file called ' | + | |
| - | + | ||
| - | - Run create_source_tables.sql | + | |
| - | - Download from ICD-9-CM-vXX-master-descriptions.zip from http:// | + | |
| - | - Extract CMSXX_DESC_LONG_SG.txt and CMSXX_DESC_SHORT_SG.txt | + | |
| - | - Load them into CMS_DESC_LONG_SG and CMS_DESC_SHORT_SG. Use the control files of the same name. | + | |
| - | - Run load_stage.sql | + | |
| - | - Run generic_update.sql (from working directory) | + | |
| - | + | ||
| - | Staging table load statements | + | |
| - | + | ||
| - | < | + | |
| - | sqlldr PRODV5/< | + | |
| - | </ | + | |
| - | + | ||
| - | ==== Step 7 ==== | + | |
| - | + | ||
| - | === Overview === | + | |
| - | + | ||
| - | Download, the LOINC datasets. Decompress the gzipped files. Run the ETL script to create the staging tables schema and load the datasets. | + | |
| - | + | ||
| - | === Notes === | + | |
| - | + | ||
| - | Add the missing create table statement | + | |
| - | < | + | |
| - | CREATE TABLE LOINC_HIERARCHY | + | |
| - | ( | + | |
| - | PATH_TO_ROOT | + | |
| - | SEQUENCE NUMBER(38, | + | |
| - | IMMEDIATE_PARENT VARCHAR2(255), | + | |
| - | CODE VARCHAR2(255), | + | |
| - | CODE_TEXT VARCHAR2(255) | + | |
| - | ); | + | |
| - | + | ||
| - | + | ||
| - | CREATE TABLE LOINC | + | |
| - | ( | + | |
| - | LOINC_NUM | + | |
| - | COMPONENT | + | |
| - | PROPERTY | + | |
| - | TIME_ASPCT | + | |
| - | SYSTEM | + | |
| - | SCALE_TYP | + | |
| - | METHOD_TYP | + | |
| - | CLASS VARCHAR2(20), | + | |
| - | SOURCE | + | |
| - | DATE_LAST_CHANGED | + | |
| - | CHNG_TYPE | + | |
| - | COMMENTS | + | |
| - | STATUS | + | |
| - | CONSUMER_NAME | + | |
| - | MOLAR_MASS | + | |
| - | CLASSTYPE | + | |
| - | FORMULA | + | |
| - | SPECIES | + | |
| - | EXMPL_ANSWERS | + | |
| - | ACSSYM | + | |
| - | BASE_NAME | + | |
| - | NAACCR_ID | + | |
| - | CODE_TABLE | + | |
| - | SURVEY_QUEST_TEXT | + | |
| - | SURVEY_QUEST_SRC | + | |
| - | UNITSREQUIRED | + | |
| - | SUBMITTED_UNITS | + | |
| - | RELATEDNAMES2 | + | |
| - | SHORTNAME | + | |
| - | ORDER_OBS | + | |
| - | CDISC_COMMON_TESTS | + | |
| - | HL7_FIELD_SUBFIELD_ID | + | |
| - | EXTERNAL_COPYRIGHT_NOTICE | + | |
| - | EXAMPLE_UNITS | + | |
| - | LONG_COMMON_NAME | + | |
| - | HL7_V2_DATATYPE | + | |
| - | HL7_V3_DATATYPE | + | |
| - | CURATED_RANGE_AND_UNITS | + | |
| - | DOCUMENT_SECTION | + | |
| - | EXAMPLE_UCUM_UNITS | + | |
| - | EXAMPLE_SI_UCUM_UNITS | + | |
| - | STATUS_REASON | + | |
| - | STATUS_TEXT | + | |
| - | CHANGE_REASON_PUBLIC | + | |
| - | COMMON_TEST_RANK | + | |
| - | COMMON_ORDER_RANK | + | |
| - | COMMON_SI_TEST_RANK | + | |
| - | HL7_ATTACHMENT_STRUCTURE | + | |
| - | ); | + | |
| - | </ | + | |
| - | + | ||
| - | === Details === | + | |
| - | + | ||
| - | - Run create_source_tables.sql | + | |
| - | - Download full set (http:// | + | |
| - | - Extract loinc.csv, map_to.csv, source_organization.csv and LOINC_250_MULTI-AXIAL_HIERARCHY.CSV | + | |
| - | - Load them into LOINC, MAP_TO, SOURCE_ORGANIZATION and LOINC_HIERARCHY. Use the control files of the same name. | + | |
| - | - Load LOINC Answers - Load LOINC_XXX_SELECTED_FORMS.zip from http:// | + | |
| - | - Open LOINC_XXX_SELECTED_FORMS.xlsx and load worksheet " | + | |
| - | - Open loinc_class.csv and load it into table loinc_class | + | |
| - | - Run load_stage.sql | + | |
| - | - Run generic_update.sql (from working directory) | + | |
| - | + | ||
| - | Staging table load statements | + | |
| - | < | + | |
| - | sqlldr PRODV5< | + | |
| - | sqlldr PRODV5/< | + | |
| - | sqlldr PRODV5/< | + | |
| - | sqlldr PRODV5/< | + | |
| - | sqlldr PRODV5/< | + | |
| - | sqlldr PRODV5/< | + | |
| - | </ | + | |
| - | ==== Step 8 ==== | + | |
| - | + | ||
| - | === Overview === | + | |
| - | + | ||
| - | Download, the MEDDRA datasets. Decompress the gzipped files. Run the ETL script to create the staging tables schema and load the datasets. | + | |
| - | + | ||
| - | You must have a MedDRA license to download the data set. The processing of this data set follows the same approach as the other data feeds. | + | |
| - | + | ||
| - | === Details === | + | |
| - | + | ||
| - | - Run create_source_tables.sql | + | |
| - | - Download the current Meddra from https:// | + | |
| - | - Extract and load into the tables from the folder " | + | |
| - | - Run load_stage.sql | + | |
| - | - Run generic_update.sql (from working directory) | + | |
| - | + | ||
| - | ==== Step 9 ==== | + | |
| - | + | ||
| - | === overview === | + | |
| - | + | ||
| - | Download, the NDC-SPL datasets. Decompress the gzipped files. Run the ETL script to create the staging tables schema and load the datasets. | + | |
| - | + | ||
| - | === Notes === | + | |
| - | + | ||
| - | This data feed loads the NDC vocabulary and the SPL vocabularies. | + | |
| - | + | ||
| - | === Details === | + | |
| - | + | ||
| - | - Run create_source_tables.sql | + | |
| - | - Download NDC code distrbution file Open the site http:// | + | |
| - | - Download the latest NDC Database File. | + | |
| - | - Extract the product.txt file. | + | |
| - | - Load product.txt into PRODUCT using control file of the same name | + | |
| - | - Run load_stage.sql | + | |
| - | - Run generic_update.sql (from working directory) | + | |
| - | + | ||
| - | Staging table load statements | + | |
| - | + | ||
| - | < | + | |
| - | sqlldr PRODV5/< | + | |
| - | </ | + | |
| - | + | ||
| - | ==== Step 10 ==== | + | |
| - | + | ||
| - | === Overview === | + | |
| - | + | ||
| - | Download, the READ code datasets. Decompress the gzipped files. Run the ETL script to create the staging tables schema and load the datasets. | + | |
| - | + | ||
| - | === Details === | + | |
| - | + | ||
| - | - Run create_source_tables.sql | + | |
| - | - Download Read V2 (CTV2) code distrbution file from the site https:// | + | |
| - | - Download the latest release xx. | + | |
| - | - Extract the nhs_readv2_xxxxx\V2\Unified\Keyv2.all file. | + | |
| - | - Download Read V2 (CTV2) code to SNOMED CT mapping file nhs_datamigration_VV.0.0_YYYYMMDD000001.zip from https:// | + | |
| - | - Download the latest release xx. | + | |
| - | - Extract nhs_datamigration_xxxxx\Mapping Tables\Updated\Clinically Assured\rcsctmap2_uk_YYYYMMDD000001.txt | + | |
| - | - Load Keyv2.all and rcsctmap2_uk_YYYYMMDD000001.txt into KEYV2 and RCSCTMAP2_UK using control files of the same name | + | |
| - | - Run load_stage.sql | + | |
| - | - Run generic_update.sql (from working directory) | + | |
| - | + | ||
| - | staging table load statements | + | |
| - | + | ||
| - | < | + | |
| - | sqlldr PRODV5/< | + | |
| - | sqlldr PRODV5/< | + | |
| - | </ | + | |
| - | + | ||
| - | ==== Step 11 ==== | + | |
| - | + | ||
| - | === Overview === | + | |
| - | + | ||
| - | In the final_assembly directory, run the two SQL scripts to populate the concept_ancestor and drug_strength tables. | + | |
| - | + | ||
| - | === Details === | + | |
| - | + | ||
| - | - Run concept_ancestor.sql | + | |
| - | - Run drug_strength.sql | + | |
| - | + | ||
| - | ==== Step 12 ==== | + | |
| - | + | ||
| - | === Overview === | + | |
| - | + | ||
| - | In the " | + | |
| - | + | ||
| - | === Note === | + | |
| - | + | ||
| - | These scripts | + | |
| - | + | ||
| - | - Run manual_changes.sql | + | |
| - | - Run manual_changes_15-Mar-2015.sql | + | |
| - | + | ||
| - | ==== Step 13 ==== | + | |
| - | + | ||
| - | === Overview === | + | |
| - | + | ||
| - | In the " | + | |
| - | + | ||
| - | === Notes === | + | |
| - | + | ||
| - | The v4 tables and the v5 tables should already exist and be populated with data. The prodv4 user should have been granted read access to the prodv5 schema tables. | + | |
| - | + | ||
| - | === Details === | + | |
| - | + | ||
| - | - FYI. V4 schema is here: https:// | + | |
| - | - run v5-to-v4.sql to update the prodv4 tables with the new data from the prodv5 tables | + | |
documentation/laertes_etl.1432664297.txt.gz · Last modified: by lee
