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:33] – [Step 3] 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 195: | Line 195: | ||
| * Load the RDF ntriple graph data into the Virtuoso database | * Load the RDF ntriple graph data into the Virtuoso database | ||
| * Manually run Virtuoso SPARQL query to export the drug/hoi combinations along with the adverse event counts into an export file | * Manually run Virtuoso SPARQL query to export the drug/hoi combinations along with the adverse event counts into an export file | ||
| + | * 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 | * Run Python script to load the export file into the PostgreSQL public schema database | ||
| Line 202: | Line 203: | ||
| https:// | https:// | ||
| - | ==== PUBMED/ | + | ==== PUBMED / MEDLINE data feed ==== |
| MEDLINE records for indexed literature reporting adverse drug events | MEDLINE records for indexed literature reporting adverse drug events | ||
| Line 210: | Line 211: | ||
| * Run python scripts to convert the data into RDF ntriple graph data | * Run python scripts to convert the data into RDF ntriple graph data | ||
| * Load the RDF ntriple graph data into the Virtuoso database | * 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 the drug/hoi combinations along with the adverse event counts into an export file | * Manually run Virtuoso SPARQL query to export the drug/hoi combinations along with the adverse event counts into an export file | ||
| * Run Python script to load the export file into the PostgreSQL public schema database | * Run Python script to load the export file into the PostgreSQL public schema database | ||
| Line 217: | Line 219: | ||
| The details for this data feed are documented and maintained here: | The details for this data feed are documented and maintained here: | ||
| https:// | https:// | ||
| - | |||
| ==== SPLICER SPL data feed ==== | ==== SPLICER SPL data feed ==== | ||
| SPLICER Natural Language Processing extracted Adverse Drug Events from FDA Structured Product Labels (SPLs) | SPLICER Natural Language Processing extracted Adverse Drug Events from FDA Structured Product Labels (SPLs) | ||
| Line 226: | Line 227: | ||
| * Run python scripts to convert the data into RDF ntriple graph data | * Run python scripts to convert the data into RDF ntriple graph data | ||
| * Load the RDF ntriple graph data into the Virtuoso database | * 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 the drug/hoi combinations along with the adverse event counts into an export file | * Manually run Virtuoso SPARQL query to export the drug/hoi combinations along with the adverse event counts into an export file | ||
| * Run Python script to load the export file into the PostgreSQL public schema database | * Run Python script to load the export file into the PostgreSQL public schema database | ||
| Line 233: | Line 235: | ||
| The details for this data feed are documented and maintained here: | The details for this data feed are documented and maintained here: | ||
| https:// | https:// | ||
| - | |||
| ==== SemMED data feed ==== | ==== SemMED data feed ==== | ||
| The Semantic MEDLINE Database is a repository of semantic predications (subject-predicate-object triples) extracted by SemRep, a semantic interpreter of biomedical text. | The Semantic MEDLINE Database is a repository of semantic predications (subject-predicate-object triples) extracted by SemRep, a semantic interpreter of biomedical text. | ||
| Line 243: | Line 244: | ||
| * Run python scripts to convert the data into RDF ntriple graph data | * Run python scripts to convert the data into RDF ntriple graph data | ||
| * Load the RDF ntriple graph data into the Virtuoso database | * 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 the drug/hoi combinations along with the adverse event counts into an export file | * Manually run Virtuoso SPARQL query to export the drug/hoi combinations along with the adverse event counts into an export file | ||
| * Run Python script to load the export file into the PostgreSQL public schema database | * Run Python script to load the export file into the PostgreSQL public schema database | ||
| Line 250: | Line 252: | ||
| 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 4 ==== | ||
| - | |||
| - | === Overview === | ||
| - | |||
| - | Download the HCPCS datasets from the website. Decompress the gzipped files. Run the ETL script to create the staging tables schema and load the datasets. | ||
| - | |||
| - | === Notes === | ||
| - | |||
| - | load_stage.sql Steps 9 and 10 are completely manual – a select statement to generate the set of Medical Coder rows which needs to be exported as a file followed by an instruction “Append resulting file from Medical Coder (in concept_relationship_stage format) to concept_relationship_stage”. | ||
| - | |||
| - | === Details === | ||
| - | |||
| - | - Run create_source_tables.sql | ||
| - | - Download the latest file http:// | ||
| - | - Extract HCPCYYYY_CONTR_ANWEB_v2.xlsx | ||
| - | - 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. | ||
| - | - 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/< | ||
| - | </ | ||
| - | |||
| - | |||
| - | ==== Step 5 ==== | ||
| - | |||
| - | === Overview === | ||
| - | |||
| - | Download, the ICD9CM 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 from ICD-9-CM-vXX-master-descriptions.zip from http:// | ||
| - | - 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 for LOINC_HIERARCHY and add missing columns to LOINC_ANSWERS create statement in create_source_tables.sql, | ||
| - | < | ||
| - | 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 are collections of ad-hoc inserts / updates that have been applied over time. Before running each block of sql statements review them against the current V5 vocabulary table values to avoid potential duplicate inserts | ||
| - | |||
| - | - 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.1432665216.txt.gz · Last modified: by lee
