diff --git a/src/org/ohdsi/rabbitInAHat/RabbitInAHatMain.java b/src/org/ohdsi/rabbitInAHat/RabbitInAHatMain.java index b12e696e..f15ca2da 100644 --- a/src/org/ohdsi/rabbitInAHat/RabbitInAHatMain.java +++ b/src/org/ohdsi/rabbitInAHat/RabbitInAHatMain.java @@ -70,39 +70,40 @@ */ public class RabbitInAHatMain implements ResizeListener, ActionListener { - public final static String ACTION_CMD_SAVE = "Save"; - public final static String ACTION_CMD_SAVE_AS = "Save As"; - public final static String ACTION_CMD_OPEN_ETL_SPECS = "Open ETL Specs"; - public final static String ACTION_CMD_OPEN_SCAN_REPORT = "Open Scan Report"; - public final static String ACTION_CMD_GENERATE_ETL_DOCUMENT = "Generate ETL Document"; - public final static String ACTION_CMD_GENERATE_TEST_FRAMEWORK = "Generate ETL Test Framework"; - public final static String ACTION_CMD_DISCARD_COUNTS = "Discard Value Counts"; - public final static String ACTION_CMD_FILTER = "Filter"; - public final static String ACTION_CMD_MAKE_MAPPING = "Make Mappings"; - public final static String ACTION_CMD_REMOVE_MAPPING = "Remove Mappings"; - public final static String ACTION_CMD_SET_TARGET_V4 = "CDM v4"; - public final static String ACTION_CMD_SET_TARGET_V5 = "CDM v5.0.0"; - public final static String ACTION_CMD_SET_TARGET_V501 = "CDM v5.0.1"; - public final static String ACTION_CMD_SET_TARGET_V510 = "CDM v5.1.0"; - public final static String ACTION_CMD_SET_TARGET_V520 = "CDM v5.2.0"; - public final static String ACTION_CMD_SET_TARGET_V530 = "CDM v5.3.0"; - public final static String ACTION_ADD_STEM_TABLE = "Add stem table"; - public final static String ACTION_CMD_SET_TARGET_CUSTOM = "Load Custom..."; - public final static String ACTION_CMD_MARK_COMPLETED = "Mark Highlighted As Complete"; - public final static String ACTION_CMD_UNMARK_COMPLETED = "Mark Highlighted As Incomplete"; - public final static String ACTION_CMD_HELP = "Open help Wiki"; - - public final static String WIKI_URL = "http://www.ohdsi.org/web/wiki/doku.php?id=documentation:software:whiterabbit#rabbit-in-a-hat"; - private final static FileFilter FILE_FILTER_GZ = new FileNameExtensionFilter("GZIP Files (*.gz)", "gz"); - private final static FileFilter FILE_FILTER_JSON = new FileNameExtensionFilter("JSON Files (*.json)", "json"); - private final static FileFilter FILE_FILTER_DOCX = new FileNameExtensionFilter("Microsoft Word documents (*.docx)", "docx"); - private final static FileFilter FILE_FILTER_CSV = new FileNameExtensionFilter("Text Files (*.csv)", "csv"); - private final static FileFilter FILE_FILTER_R = new FileNameExtensionFilter("R script (*.r)", "r"); - private final static FileFilter FILE_FILTER_XLSX = new FileNameExtensionFilter("XLSX files (*.xlsx)", "xlsx"); - - public final static String DBMS_SQLSERVER = "SQL Server"; - public final static String DBMS_REDSHIFT = "Redshift"; - + public final static String ACTION_CMD_SAVE = "Save"; + public final static String ACTION_CMD_SAVE_AS = "Save As"; + public final static String ACTION_CMD_OPEN_ETL_SPECS = "Open ETL Specs"; + public final static String ACTION_CMD_OPEN_SCAN_REPORT = "Open Scan Report"; + public final static String ACTION_CMD_GENERATE_ETL_DOCUMENT = "Generate ETL Document"; + public final static String ACTION_CMD_GENERATE_TEST_FRAMEWORK = "Generate ETL Test Framework"; + public final static String ACTION_CMD_DISCARD_COUNTS = "Discard Value Counts"; + public final static String ACTION_CMD_FILTER = "Filter"; + public final static String ACTION_CMD_MAKE_MAPPING = "Make Mappings"; + public final static String ACTION_CMD_REMOVE_MAPPING = "Remove Mappings"; + public final static String ACTION_CMD_SET_TARGET_V4 = "CDM v4"; + public final static String ACTION_CMD_SET_TARGET_V5 = "CDM v5.0.0"; + public final static String ACTION_CMD_SET_TARGET_V501 = "CDM v5.0.1"; + public final static String ACTION_CMD_SET_TARGET_V510 = "CDM v5.1.0"; + public final static String ACTION_CMD_SET_TARGET_V520 = "CDM v5.2.0"; + public final static String ACTION_CMD_SET_TARGET_V530 = "CDM v5.3.0"; + public final static String ACTION_CMD_SET_TARGET_V531 = "CDM v5.3.1"; + public final static String ACTION_ADD_STEM_TABLE = "Add stem table"; + public final static String ACTION_CMD_SET_TARGET_CUSTOM = "Load Custom..."; + public final static String ACTION_CMD_MARK_COMPLETED = "Mark Highlighted As Complete"; + public final static String ACTION_CMD_UNMARK_COMPLETED = "Mark Highlighted As Incomplete"; + public final static String ACTION_CMD_HELP = "Open help Wiki"; + + public final static String WIKI_URL = "http://www.ohdsi.org/web/wiki/doku.php?id=documentation:software:whiterabbit#rabbit-in-a-hat"; + private final static FileFilter FILE_FILTER_GZ = new FileNameExtensionFilter("GZIP Files (*.gz)", "gz"); + private final static FileFilter FILE_FILTER_JSON = new FileNameExtensionFilter("JSON Files (*.json)", "json"); + private final static FileFilter FILE_FILTER_DOCX = new FileNameExtensionFilter("Microsoft Word documents (*.docx)", "docx"); + private final static FileFilter FILE_FILTER_CSV = new FileNameExtensionFilter("Text Files (*.csv)", "csv"); + private final static FileFilter FILE_FILTER_R = new FileNameExtensionFilter("R script (*.r)", "r"); + private final static FileFilter FILE_FILTER_XLSX = new FileNameExtensionFilter("XLSX files (*.xlsx)", "xlsx"); + + public final static String DBMS_SQLSERVER = "SQL Server"; + public final static String DBMS_REDSHIFT = "Redshift"; + private JFrame frame; private JScrollPane scrollPane1; private JScrollPane scrollPane2; @@ -110,7 +111,6 @@ public class RabbitInAHatMain implements ResizeListener, ActionListener { private MappingPanel fieldMappingPanel; private DetailsPanel detailsPanel; private JSplitPane tableFieldSplitPane; - private JFileChooser chooser; public static void main(String[] args) { @@ -137,7 +137,7 @@ public void windowClosing(WindowEvent e) { frame.setJMenuBar(createMenuBar()); ETL etl = new ETL(); - etl.setTargetDatabase(Database.generateCDMModel(CDMVersion.CDMV530)); + etl.setTargetDatabase(Database.generateCDMModel(CDMVersion.CDMV531)); ObjectExchange.etl = etl; @@ -177,9 +177,12 @@ public void windowClosing(WindowEvent e) { frame.setExtendedState(java.awt.Frame.MAXIMIZED_BOTH); frame.setVisible(true); - if (args.length > 0) { + if (args.length == 1) { doOpenSpecs(args[0]); } + if (args.length > 1 && args[0].equals("-folder")) { + chooser = new JFileChooser(args[1]); + } } private void loadIcons(JFrame f) { @@ -280,37 +283,44 @@ private JMenuBar createMenuBar() { targetCDMV510.addActionListener(this); targetCDMV510.setActionCommand(ACTION_CMD_SET_TARGET_V510); setTarget.add(targetCDMV510); - + JRadioButtonMenuItem targetCDMV520 = new JRadioButtonMenuItem(ACTION_CMD_SET_TARGET_V520); targetCDMV520.addActionListener(this); targetCDMV520.setActionCommand(ACTION_CMD_SET_TARGET_V520); setTarget.add(targetCDMV520); - JRadioButtonMenuItem targetCDMV530 = new JRadioButtonMenuItem(ACTION_CMD_SET_TARGET_V530, true); + JRadioButtonMenuItem targetCDMV530 = new JRadioButtonMenuItem(ACTION_CMD_SET_TARGET_V530); targetCDMV530.addActionListener(this); targetCDMV530.setActionCommand(ACTION_CMD_SET_TARGET_V530); setTarget.add(targetCDMV530); + JRadioButtonMenuItem targetCDMV531 = new JRadioButtonMenuItem(ACTION_CMD_SET_TARGET_V531, true); + targetCDMV531.addActionListener(this); + targetCDMV531.setActionCommand(ACTION_CMD_SET_TARGET_V531); + setTarget.add(targetCDMV531); + JRadioButtonMenuItem loadTarget = new JRadioButtonMenuItem(ACTION_CMD_SET_TARGET_CUSTOM); loadTarget.addActionListener(this); loadTarget.setActionCommand(ACTION_CMD_SET_TARGET_CUSTOM); setTarget.add(loadTarget); editMenu.add(setTarget); - + ButtonGroup targetGroup = new ButtonGroup(); targetGroup.add(targetCDMV4); targetGroup.add(targetCDMV5); targetGroup.add(targetCDMV501); targetGroup.add(targetCDMV510); targetGroup.add(targetCDMV520); + targetGroup.add(targetCDMV530); + targetGroup.add(targetCDMV531); targetGroup.add(loadTarget); JMenuItem addStemTable = new JMenuItem(ACTION_ADD_STEM_TABLE); addStemTable.addActionListener(this); addStemTable.setActionCommand(ACTION_ADD_STEM_TABLE); editMenu.add(addStemTable); - + JMenu arrowMenu = new JMenu("Arrows"); menuBar.add(arrowMenu); @@ -456,10 +466,13 @@ public void actionPerformed(ActionEvent event) { break; case ACTION_CMD_SET_TARGET_V520: doSetTargetCDM(CDMVersion.CDMV520); - break; + break; case ACTION_CMD_SET_TARGET_V530: doSetTargetCDM(CDMVersion.CDMV530); - break; + break; + case ACTION_CMD_SET_TARGET_V531: + doSetTargetCDM(CDMVersion.CDMV531); + break; case ACTION_CMD_SET_TARGET_CUSTOM: doSetTargetCustom(chooseOpenPath(FILE_FILTER_CSV)); break; @@ -484,27 +497,7 @@ private void doAddStemTable() { ObjectExchange.etl = etl; tableMappingPanel.setMapping(etl.getTableToTableMapping()); } - -// private DbType chooseDbmsVendor() -// { -// Object[] vendors = {DBMS_SQLSERVER, DBMS_REDSHIFT}; -// String vendor = (String)JOptionPane.showInputDialog( -// frame, -// "Pick database vendor:", -// "Database vendor", -// JOptionPane.QUESTION_MESSAGE, -// null, -// vendors, -// DBMS_SQLSERVER); -// -// DbType dbms = DbType.MSSQL; -// if (vendor != null) { -// if (vendor.equals(vendors[1])) -// dbms = DbType.REDSHIFT; -// } -// return dbms; -// } - + private void doGenerateTestFramework(String filename) { if (filename != null) { frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); diff --git a/src/org/ohdsi/rabbitInAHat/dataModel/CDMV5.3.1.csv b/src/org/ohdsi/rabbitInAHat/dataModel/CDMV5.3.1.csv new file mode 100644 index 00000000..bc05babb --- /dev/null +++ b/src/org/ohdsi/rabbitInAHat/dataModel/CDMV5.3.1.csv @@ -0,0 +1,347 @@ +field,required,type,description,table,schema +condition_occurrence_id,Yes,INTEGER,A unique identifier for each Condition Occurrence event.,condition_occurrence,cdm +person_id,Yes,INTEGER,A foreign key identifier to the Person who is experiencing the condition. The demographic details of that Person are stored in the PERSON table.,condition_occurrence,cdm +condition_concept_id,Yes,INTEGER,A foreign key that refers to a Standard Condition Concept identifier in the Standardized Vocabularies.,condition_occurrence,cdm +condition_start_date,Yes,DATE,The date when the instance of the Condition is recorded.,condition_occurrence,cdm +condition_start_datetime,No,DATETIME,The date and time when the instance of the Condition is recorded.,condition_occurrence,cdm +condition_end_date,No,DATE,The date when the instance of the Condition is considered to have ended.,condition_occurrence,cdm +condition_end_datetime,No,DATE,The date when the instance of the Condition is considered to have ended.,condition_occurrence,cdm +condition_type_concept_id,Yes,INTEGER,"A foreign key to the predefined Concept identifier in the Standardized Vocabularies reflecting the source data from which the condition was recorded, the level of standardization, and the type of occurrence.",condition_occurrence,cdm +stop_reason,No,VARCHAR(20),"The reason that the condition was no longer present, as indicated in the source data.",condition_occurrence,cdm +provider_id,No,INTEGER,A foreign key to the Provider in the PROVIDER table who was responsible for capturing (diagnosing) the Condition.,condition_occurrence,cdm +visit_occurrence_id,No,INTEGER,A foreign key to the visit in the VISIT_OCCURRENCE table during which the Condition was determined (diagnosed).,condition_occurrence,cdm +visit_detail_id,No,INTEGER,A foreign key to the visit in the VISIT_DETAIL table during which the Condition was determined (diagnosed).,condition_occurrence,cdm +condition_source_value,No,VARCHAR(50),The source code for the condition as it appears in the source data. This code is mapped to a standard condition concept in the Standardized Vocabularies and the original code is stored here for reference.,condition_occurrence,cdm +condition_source_concept_id,No,INTEGER,A foreign key to a Condition Concept that refers to the code used in the source.,condition_occurrence,cdm +condition_status_source_value,No,VARCHAR(50),The source code for the condition status as it appears in the source data.,condition_occurrence,cdm +condition_status_concept_id,No,INTEGER,A foreign key to the predefined Concept in the Standard Vocabulary reflecting the condition status,condition_occurrence,cdm +person_id,Yes,INTEGER,A foreign key identifier to the deceased person. The demographic details of that person are stored in the person table.,death,cdm +death_date,Yes,DATE,"The date the person was deceased. If the precise date including day or month is not known or not allowed, December is used as the default month, and the last day of the month the default day.",death,cdm +death_datetime,No,DATETIME,"The date and time the person was deceased. If the precise date including day or month is not known or not allowed, December is used as the default month, and the last day of the month the default day.",death,cdm +death_type_concept_id,Yes,INTEGER,A foreign key referring to the predefined concept identifier in the Standardized Vocabularies reflecting how the death was represented in the source data.,death,cdm +cause_concept_id,No,INTEGER,A foreign key referring to a standard concept identifier in the Standardized Vocabularies for conditions.,death,cdm +cause_source_value,No,VARCHAR(50),"The source code for the cause of death as it appears in the source data. This code is mapped to a standard concept in the Standardized Vocabularies and the original code is, stored here for reference.",death,cdm +cause_source_concept_id,No,INTEGER,"A foreign key to the concept that refers to the code used in the source. Note, this variable name is abbreviated to ensure it will be allowable across database platforms.",death,cdm +device_exposure_id,Yes,INTEGER,A system-generated unique identifier for each Device Exposure.,device_exposure,cdm +person_id,Yes,INTEGER,A foreign key identifier to the Person who is subjected to the Device. The demographic details of that person are stored in the Person table.,device_exposure,cdm +device_concept_id,Yes,INTEGER,A foreign key that refers to a Standard Concept identifier in the Standardized Vocabularies for the Device concept.,device_exposure,cdm +device_exposure_start_date,Yes,DATE,The date the Device or supply was applied or used.,device_exposure,cdm +device_exposure_start_datetime,No,DATETIME,The date and time the Device or supply was applied or used.,device_exposure,cdm +device_exposure_end_date,No,DATE,The date the Device or supply was removed from use.,device_exposure,cdm +device_exposure_end_datetime,No,DATETIME,The date and time the Device or supply was removed from use.,device_exposure,cdm +device_type_concept_id,Yes,INTEGER,A foreign key to the predefined Concept identifier in the Standardized Vocabularies reflecting the type of Device Exposure recorded. It indicates how the Device Exposure was represented in the source data.,device_exposure,cdm +unique_device_id,No,VARCHAR(50),A UDI or equivalent identifying the instance of the Device used in the Person.,device_exposure,cdm +quantity,No,INTEGER,The number of individual Devices used for the exposure.,device_exposure,cdm +provider_id,No,INTEGER,A foreign key to the provider in the PROVIDER table who initiated of administered the Device.,device_exposure,cdm +visit_occurrence_id,No,INTEGER,A foreign key to the visit in the VISIT_OCCURRENCE table during which the device was used.,device_exposure,cdm +visit_detail_id,No,INTEGER,A foreign key to the visit detail in the VISIT_DETAIL table during which the Drug Exposure was initiated.,device_exposure,cdm +device_source_value,No,VARCHAR(50),The source code for the Device as it appears in the source data. This code is mapped to a standard Device Concept in the Standardized Vocabularies and the original code is stored here for reference.,device_exposure,cdm +device_source_concept_id,No,INTEGER,A foreign key to a Device Concept that refers to the code used in the source.,device_exposure,cdm +drug_exposure_id,Yes,INTEGER,A system-generated unique identifier for each Drug utilization event.,drug_exposure,cdm +person_id,Yes,INTEGER,A foreign key identifier to the person who is subjected to the Drug. The demographic details of that person are stored in the person table.,drug_exposure,cdm +drug_concept_id,Yes,INTEGER,A foreign key that refers to a Standard Concept identifier in the Standardized Vocabularies for the Drug concept.,drug_exposure,cdm +drug_exposure_start_date,Yes,DATE,"The start date for the current instance of Drug utilization. Valid entries include a start date of a prescription, the date a prescription was filled, or the date on which a Drug administration procedure was recorded.",drug_exposure,cdm +drug_exposure_start_datetime,No,DATETIME,"The start date and time for the current instance of Drug utilization. Valid entries include a start date of a prescription, the date a prescription was filled, or the date on which a Drug administration procedure was recorded.",drug_exposure,cdm +drug_exposure_end_date,Yes,DATE,The end date for the current instance of Drug utilization. It is not available from all sources.,drug_exposure,cdm +drug_exposure_end_datetime,No,DATETIME,The end date and time for the current instance of Drug utilization. It is not available from all sources.,drug_exposure,cdm +verbatim_end_date,No,DATE,The known end date of a drug_exposure as provided by the source,drug_exposure,cdm +drug_type_concept_id,Yes,INTEGER,A foreign key to the predefined Concept identifier in the Standardized Vocabularies reflecting the type of Drug Exposure recorded. It indicates how the Drug Exposure was represented in the source data.,drug_exposure,cdm +stop_reason,No,VARCHAR(20),"The reason the Drug was stopped. Reasons include regimen completed, changed, removed, etc.",drug_exposure,cdm +refills,No,INTEGER,"The number of refills after the initial prescription. The initial prescription is not counted, values start with 0.",drug_exposure,cdm +quantity,No,FLOAT,The quantity of drug as recorded in the original prescription or dispensing record.,drug_exposure,cdm +days_supply,No,INTEGER,The number of days of supply of the medication as recorded in the original prescription or dispensing record.,drug_exposure,cdm +sig,No,VARCHAR(MAX),"The directions (""signetur"") on the Drug prescription as recorded in the original prescription (and printed on the container) or dispensing record.",drug_exposure,cdm +route_concept_id,No,INTEGER,A foreign key to a predefined concept in the Standardized Vocabularies reflecting the route of administration.,drug_exposure,cdm +lot_number,No,VARCHAR(50),An identifier assigned to a particular quantity or lot of Drug product from the manufacturer.,drug_exposure,cdm +provider_id,No,INTEGER,A foreign key to the provider in the PROVIDER table who initiated (prescribed or administered) the Drug Exposure.,drug_exposure,cdm +visit_occurrence_id,No,INTEGER,A foreign key to the Visit in the VISIT_OCCURRENCE table during which the Drug Exposure was initiated.,drug_exposure,cdm +visit_detail_id,No,INTEGER,A foreign key to the Visit Detail in the VISIT_DETAIL table during which the Drug Exposure was initiated.,drug_exposure,cdm +drug_source_value,No,VARCHAR(50),"The source code for the Drug as it appears in the source data. This code is mapped to a Standard Drug concept in the Standardized Vocabularies and the original code is, stored here for reference.",drug_exposure,cdm +drug_source_concept_id,No,INTEGER,A foreign key to a Drug Concept that refers to the code used in the source.,drug_exposure,cdm +route_source_value,No,VARCHAR(50),The information about the route of administration as detailed in the source.,drug_exposure,cdm +dose_unit_source_value,No,VARCHAR(50),The information about the dose unit as detailed in the source.,drug_exposure,cdm +domain_concept_id_1,Yes,INTEGER,"The concept representing the domain of fact one, from which the corresponding table can be inferred.",fact_relationship,cdm +fact_id_1,Yes,INTEGER,The unique identifier in the table corresponding to the domain of fact one.,fact_relationship,cdm +domain_concept_id_2,Yes,INTEGER,"The concept representing the domain of fact two, from which the corresponding table can be inferred.",fact_relationship,cdm +fact_id_2,Yes,INTEGER,The unique identifier in the table corresponding to the domain of fact two.,fact_relationship,cdm +relationship_concept_id,Yes,INTEGER,A foreign key to a Standard Concept ID of relationship in the Standardized Vocabularies.,fact_relationship,cdm +measurement_id,Yes,INTEGER,A unique identifier for each Measurement.,measurement,cdm +person_id,Yes,INTEGER,A foreign key identifier to the Person about whom the measurement was recorded. The demographic details of that Person are stored in the PERSON table.,measurement,cdm +measurement_concept_id,Yes,INTEGER,A foreign key to the standard measurement concept identifier in the Standardized Vocabularies.,measurement,cdm +measurement_date,Yes,DATE,The date of the Measurement.,measurement,cdm +measurement_datetime,No,DATETIME,"The date and time of the Measurement. Some database systems don't have a datatype of time. To accomodate all temporal analyses, datatype datetime can be used (combining measurement_date and measurement_time [forum discussion](http://forums.ohdsi.org/t/date-time-and-datetime-problem-and-the-world-of-hours-and-1day/314))",measurement,cdm +measurement_time,No,VARCHAR(10),The time of the Measurement. This is present for backwards compatibility and will deprecated in an upcoming version,measurement,cdm +measurement_type_concept_id,Yes,INTEGER,A foreign key to the predefined Concept in the Standardized Vocabularies reflecting the provenance from where the Measurement record was recorded.,measurement,cdm +operator_concept_id,No,INTEGER,"A foreign key identifier to the predefined Concept in the Standardized Vocabularies reflecting the mathematical operator that is applied to the value_as_number. Operators are <, <=, =, >=, >.",measurement,cdm +value_as_number,No,FLOAT,A Measurement result where the result is expressed as a numeric value.,measurement,cdm +value_as_concept_id,No,INTEGER,"A foreign key to a Measurement result represented as a Concept from the Standardized Vocabularies (e.g., positive/negative, present/absent, low/high, etc.).",measurement,cdm +unit_concept_id,No,INTEGER,A foreign key to a Standard Concept ID of Measurement Units in the Standardized Vocabularies.,measurement,cdm +range_low,No,FLOAT,The lower limit of the normal range of the Measurement result. The lower range is assumed to be of the same unit of measure as the Measurement value.,measurement,cdm +range_high,No,FLOAT,The upper limit of the normal range of the Measurement. The upper range is assumed to be of the same unit of measure as the Measurement value.,measurement,cdm +provider_id,No,INTEGER,A foreign key to the provider in the PROVIDER table who was responsible for initiating or obtaining the measurement.,measurement,cdm +visit_occurrence_id,No,INTEGER,A foreign key to the Visit in the VISIT_OCCURRENCE table during which the Measurement was recorded.,measurement,cdm +visit_detail_id,No,INTEGER,A foreign key to the Visit Detail in the VISIT_DETAIL table during which the Measurement was recorded.,measurement,cdm +measurement_source_value,No,VARCHAR(50),The Measurement name as it appears in the source data. This code is mapped to a Standard Concept in the Standardized Vocabularies and the original code is stored here for reference.,measurement,cdm +measurement_source_concept_id,No,INTEGER,A foreign key to a Concept in the Standard Vocabularies that refers to the code used in the source.,measurement,cdm +unit_source_value,No,VARCHAR(50),The source code for the unit as it appears in the source data. This code is mapped to a standard unit concept in the Standardized Vocabularies and the original code is stored here for reference.,measurement,cdm +value_source_value,No,VARCHAR(50),The source value associated with the content of the value_as_number or value_as_concept_id as stored in the source data.,measurement,cdm +note_id,Yes,INTEGER,A unique identifier for each note.,note,cdm +person_id,Yes,INTEGER,A foreign key identifier to the Person about whom the Note was recorded. The demographic details of that Person are stored in the PERSON table.,note,cdm +note_date,Yes,DATE,The date the note was recorded.,note,cdm +note_datetime,No,DATETIME,The date and time the note was recorded.,note,cdm +note_type_concept_id,Yes,INTEGER,"A foreign key to the predefined Concept in the Standardized Vocabularies reflecting the type, origin or provenance of the Note.",note,cdm +note_class_concept_id,Yes,INTEGER,A foreign key to the predefined Concept in the Standardized Vocabularies reflecting the HL7 LOINC Document Type Vocabulary classification of the note.,note,cdm +note_title,No,VARCHAR(250),The title of the Note as it appears in the source.,note,cdm +note_text,Yes,VARCHAR(MAX),The content of the Note.,note,cdm +encoding_concept_id,Yes,INTEGER,A foreign key to the predefined Concept in the Standardized Vocabularies reflecting the note character encoding type,note,cdm +language_concept_id,Yes,INTEGER,A foreign key to the predefined Concept in the Standardized Vocabularies reflecting the language of the note,note,cdm +provider_id,No,INTEGER,A foreign key to the Provider in the PROVIDER table who took the Note.,note,cdm +visit_occurrence_id,No,INTEGER,A foreign key to the Visit in the VISIT_OCCURRENCE table when the Note was taken.,note,cdm +visit_detail_id,No,INTEGER,A foreign key to the Visit in the VISIT_DETAIL table when the Note was taken.,note,cdm +note_source_value,No,VARCHAR(50),The source value associated with the origin of the Note,note,cdm +note_nlp_id,Yes,INTEGER,A unique identifier for each term extracted from a Note.,note_nlp,cdm +note_id,Yes,INTEGER,A foreign key to the note table note the term was extracted from.,note_nlp,cdm +section_concept_id,No,INTEGER,A foreign key to the predefined concept in the standardized vocabularies representing the section of the extracted term.,note_nlp,cdm +snippet,No,VARCHAR(250),A small window of text surrounding the term.,note_nlp,cdm +offset,No,VARCHAR(50),Character offset of the extracted term in the input note.,note_nlp,cdm +lexical_variant,Yes,VARCHAR(250),Raw text extracted from the NLP tool.,note_nlp,cdm +note_nlp_concept_id,No,INTEGER,A foreign key to the predefined concept in the standardized vocabularies reflecting the normalized concept for the extracted term. Domain of the term is represented as part of the concept table.,note_nlp,cdm +note_nlp_source_concept_id,No,INTEGER,A foreign key to a concept that refers to the code in the source vocabulary used by the NLP system,note_nlp,cdm +nlp_system,No,VARCHAR(250),Name and version of the NLP system that extracted the term.useful for data provenance.,note_nlp,cdm +nlp_date,Yes,DATE,The date of the note processing.useful for data provenance.,note_nlp,cdm +nlp_datetime,No,DATETIME,The date and time of the note processing. Useful for data provenance.,note_nlp,cdm +term_exists,No,VARCHAR(1),A summary modifier that signifies presence or absence of the term for a given patient. Useful for quick querying.,note_nlp,cdm +term_temporal,No,VARCHAR(50),An optional time modifier associated with the extracted term. (For now “past” or “present” only). Standardize it later.,note_nlp,cdm +term_modifiers,No,VARCHAR(2000),"A compact description of all the modifiers of the specific term extracted by the NLP system. (e.g. “son has rash” ? “negated=no,subject=family, certainty=undef,conditional=false,general=false”).",note_nlp,cdm +observation_id,Yes,INTEGER,A unique identifier for each observation.,observation,cdm +person_id,Yes,INTEGER,A foreign key identifier to the Person about whom the observation was recorded. The demographic details of that Person are stored in the PERSON table.,observation,cdm +observation_concept_id,Yes,INTEGER,A foreign key to the standard observation concept identifier in the Standardized Vocabularies.,observation,cdm +observation_date,Yes,DATE,The date of the observation.,observation,cdm +observation_datetime,No,DATETIME,The date and time of the observation.,observation,cdm +observation_type_concept_id,Yes,INTEGER,A foreign key to the predefined concept identifier in the Standardized Vocabularies reflecting the type of the observation.,observation,cdm +value_as_number,No,FLOAT,The observation result stored as a number. This is applicable to observations where the result is expressed as a numeric value.,observation,cdm +value_as_string,No,VARCHAR(60),The observation result stored as a string. This is applicable to observations where the result is expressed as verbatim text.,observation,cdm +value_as_concept_id,No,INTEGER,"A foreign key to an observation result stored as a Concept ID. This is applicable to observations where the result can be expressed as a Standard Concept from the Standardized Vocabularies (e.g., positive/negative, present/absent, low/high, etc.).",observation,cdm +qualifier_concept_id,No,INTEGER,"A foreign key to a Standard Concept ID for a qualifier (e.g., severity of drug-drug interaction alert)",observation,cdm +unit_concept_id,No,INTEGER,A foreign key to a Standard Concept ID of measurement units in the Standardized Vocabularies.,observation,cdm +provider_id,No,INTEGER,A foreign key to the provider in the PROVIDER table who was responsible for making the observation.,observation,cdm +visit_occurrence_id,No,INTEGER,A foreign key to the visit in the VISIT_OCCURRENCE table during which the observation was recorded.,observation,cdm +visit_detail_id,No,INTEGER,A foreign key to the visit in the VISIT_DETAIL table during which the observation was recorded.,observation,cdm +observation_source_value,No,VARCHAR(50),"The observation code as it appears in the source data. This code is mapped to a Standard Concept in the Standardized Vocabularies and the original code is, stored here for reference.",observation,cdm +observation_source_concept_id,No,INTEGER,A foreign key to a Concept that refers to the code used in the source.,observation,cdm +unit_source_value,No,VARCHAR(50),"The source code for the unit as it appears in the source data. This code is mapped to a standard unit concept in the Standardized Vocabularies and the original code is, stored here for reference.",observation,cdm +qualifier_source_value,No,VARCHAR(50),The source value associated with a qualifier to characterize the observation,observation,cdm +observation_period_id,Yes,INTEGER,A unique identifier for each observation period.,observation_period,cdm +person_id,Yes,INTEGER,A foreign key identifier to the person for whom the observation period is defined. The demographic details of that person are stored in the person table.,observation_period,cdm +observation_period_start_date,Yes,DATE,The start date of the observation period for which data are available from the data source.,observation_period,cdm +observation_period_end_date,Yes,DATE,The end date of the observation period for which data are available from the data source.,observation_period,cdm +period_type_concept_id,Yes,INTEGER,A foreign key identifier to the predefined concept in the Standardized Vocabularies reflecting the source of the observation period information,observation_period,cdm +person_id,Yes,INTEGER,A unique identifier for each person.,person,cdm +gender_concept_id,Yes,INTEGER,A foreign key that refers to an identifier in the CONCEPT table for the unique gender of the person.,person,cdm +year_of_birth,Yes,INTEGER,"The year of birth of the person. For data sources with date of birth, the year is extracted. For data sources where the year of birth is not available, the approximate year of birth is derived based on any age group categorization available.",person,cdm +month_of_birth,No,INTEGER,"The month of birth of the person. For data sources that provide the precise date of birth, the month is extracted and stored in this field.",person,cdm +day_of_birth,No,INTEGER,"The day of the month of birth of the person. For data sources that provide the precise date of birth, the day is extracted and stored in this field.",person,cdm +birth_datetime,No,DATETIME,The date and time of birth of the person.,person,cdm +race_concept_id,Yes,INTEGER,A foreign key that refers to an identifier in the CONCEPT table for the unique race of the person.,person,cdm +ethnicity_concept_id,Yes,INTEGER,A foreign key that refers to the standard concept identifier in the Standardized Vocabularies for the ethnicity of the person.,person,cdm +location_id,No,INTEGER,"A foreign key to the place of residency for the person in the location table, where the detailed address information is stored.",person,cdm +provider_id,No,INTEGER,A foreign key to the primary care provider the person is seeing in the provider table.,person,cdm +care_site_id,No,INTEGER,"A foreign key to the site of primary care in the care_site table, where the details of the care site are stored.",person,cdm +person_source_value,No,VARCHAR(50),An (encrypted) key derived from the person identifier in the source data. This is necessary when a use case requires a link back to the person data at the source dataset.,person,cdm +gender_source_value,No,VARCHAR(50),The source code for the gender of the person as it appears in the source data. The person’s gender is mapped to a standard gender concept in the Standardized Vocabularies; the original value is stored here for reference.,person,cdm +gender_source_concept_id,No,INTEGER,A foreign key to the gender concept that refers to the code used in the source.,person,cdm +race_source_value,No,VARCHAR(50),The source code for the race of the person as it appears in the source data. The person race is mapped to a standard race concept in the Standardized Vocabularies and the original value is stored here for reference.,person,cdm +race_source_concept_id,No,INTEGER,A foreign key to the race concept that refers to the code used in the source.,person,cdm +ethnicity_source_value,No,VARCHAR(50),"The source code for the ethnicity of the person as it appears in the source data. The person ethnicity is mapped to a standard ethnicity concept in the Standardized Vocabularies and the original code is, stored here for reference.",person,cdm +ethnicity_source_concept_id,No,INTEGER,A foreign key to the ethnicity concept that refers to the code used in the source.,person,cdm +procedure_occurrence_id,Yes,INTEGER,A system-generated unique identifier for each Procedure Occurrence.,procedure_occurrence,cdm +person_id,Yes,INTEGER,A foreign key identifier to the Person who is subjected to the Procedure. The demographic details of that Person are stored in the PERSON table.,procedure_occurrence,cdm +procedure_concept_id,Yes,INTEGER,A foreign key that refers to a standard procedure Concept identifier in the Standardized Vocabularies.,procedure_occurrence,cdm +procedure_date,Yes,DATE,The date on which the Procedure was performed.,procedure_occurrence,cdm +procedure_datetime,No,DATETIME,The date and time on which the Procedure was performed.,procedure_occurrence,cdm +procedure_type_concept_id,Yes,INTEGER,A foreign key to the predefined Concept identifier in the Standardized Vocabularies reflecting the type of source data from which the procedure record is derived.,procedure_occurrence,cdm +modifier_concept_id,No,INTEGER,A foreign key to a Standard Concept identifier for a modifier to the Procedure (e.g. bilateral),procedure_occurrence,cdm +quantity,No,INTEGER,The quantity of procedures ordered or administered.,procedure_occurrence,cdm +provider_id,No,INTEGER,A foreign key to the provider in the PROVIDER table who was responsible for carrying out the procedure.,procedure_occurrence,cdm +visit_occurrence_id,No,INTEGER,A foreign key to the Visit in the VISIT_OCCURRENCE table during which the Procedure was carried out.,procedure_occurrence,cdm +visit_detail_id,No,INTEGER,A foreign key to the Visit Detail in the VISIT_DETAIL table during which the Procedure was carried out.,procedure_occurrence,cdm +procedure_source_value,No,VARCHAR(50),"The source code for the Procedure as it appears in the source data. This code is mapped to a standard procedure Concept in the Standardized Vocabularies and the original code is, stored here for reference. Procedure source codes are typically ICD-9-Proc, CPT-4, HCPCS or OPCS-4 codes.",procedure_occurrence,cdm +procedure_source_concept_id,No,INTEGER,A foreign key to a Procedure Concept that refers to the code used in the source.,procedure_occurrence,cdm +modifier_source_value,No,VARCHAR(50),The source code for the qualifier as it appears in the source data.,procedure_occurrence,cdm +specimen_id,Yes,INTEGER,A unique identifier for each specimen.,specimen,cdm +person_id,Yes,INTEGER,A foreign key identifier to the Person for whom the Specimen is recorded.,specimen,cdm +specimen_concept_id,Yes,INTEGER,A foreign key referring to a Standard Concept identifier in the Standardized Vocabularies for the Specimen.,specimen,cdm +specimen_type_concept_id,Yes,INTEGER,A foreign key referring to the Concept identifier in the Standardized Vocabularies reflecting the system of record from which the Specimen was represented in the source data.,specimen,cdm +specimen_date,Yes,DATE,The date the specimen was obtained from the Person.,specimen,cdm +specimen_datetime,No,DATETIME,The date and time on the date when the Specimen was obtained from the person.,specimen,cdm +quantity,No,FLOAT,The amount of specimen collection from the person during the sampling procedure.,specimen,cdm +unit_concept_id,No,INTEGER,A foreign key to a Standard Concept identifier for the Unit associated with the numeric quantity of the Specimen collection.,specimen,cdm +anatomic_site_concept_id,No,INTEGER,A foreign key to a Standard Concept identifier for the anatomic location of specimen collection.,specimen,cdm +disease_status_concept_id,No,INTEGER,A foreign key to a Standard Concept identifier for the Disease Status of specimen collection.,specimen,cdm +specimen_source_id,No,VARCHAR(50),The Specimen identifier as it appears in the source data.,specimen,cdm +specimen_source_value,No,VARCHAR(50),"The Specimen value as it appears in the source data. This value is mapped to a Standard Concept in the Standardized Vocabularies and the original code is, stored here for reference.",specimen,cdm +unit_source_value,No,VARCHAR(50),The information about the Unit as detailed in the source.,specimen,cdm +anatomic_site_source_value,No,VARCHAR(50),The information about the anatomic site as detailed in the source.,specimen,cdm +disease_status_source_value,No,VARCHAR(50),The information about the disease status as detailed in the source.,specimen,cdm +visit_detail_id,Yes,INTEGER,A unique identifier for each Person's visit or encounter at a healthcare provider.,visit_detail,cdm +person_id,Yes,INTEGER,A foreign key identifier to the Person for whom the visit is recorded. The demographic details of that Person are stored in the PERSON table.,visit_detail,cdm +visit_concept_id,Yes,INTEGER,A foreign key that refers to a visit Concept identifier in the Standardized Vocabularies.,visit_detail,cdm +visit_start_date,Yes,DATE,The start date of the visit.,visit_detail,cdm +visit_start_datetime,No,DATETIME,The date and time of the visit started.,visit_detail,cdm +visit_end_date,Yes,DATE,The end date of the visit. If this is a one-day visit the end date should match the start date.,visit_detail,cdm +visit_end_datetime,No,DATETIME,The date and time of the visit end.,visit_detail,cdm +visit_type_concept_id,Yes,INTEGER,A foreign key to the predefined Concept identifier in the Standardized Vocabularies reflecting the type of source data from which the visit record is derived.,visit_detail,cdm +provider_id,No,INTEGER,A foreign key to the provider in the provider table who was associated with the visit.,visit_detail,cdm +care_site_id,No,INTEGER,A foreign key to the care site in the care site table that was visited.,visit_detail,cdm +visit_source_value,No,STRING(50),The source code for the visit as it appears in the source data.,visit_detail,cdm +visit_source_concept_id,No,INTEGER,A foreign key to a Concept that refers to the code used in the source.,visit_detail,cdm +admitting_source_value,No,VARCHAR(50),The source code for the admitting source as it appears in the source data.,visit_detail,cdm +admitting_source_concept_id,No,INTEGER,A foreign key to the predefined concept in the Place of Service Vocabulary reflecting the admitting source for a visit.,visit_detail,cdm +discharge_to_source_value,No,VARCHAR(50),The source code for the discharge disposition as it appears in the source data.,visit_detail,cdm +discharge_to_concept_id,No,INTEGER,A foreign key to the predefined concept in the Place of Service Vocabulary reflecting the discharge disposition for a visit.,visit_detail,cdm +preceding_visit_detail_id,No,INTEGER,A foreign key to the VISIT_DETAIL table of the visit immediately preceding this visit,visit_detail,cdm +visit_detail_parent_id,No,INTEGER,A foreign key to the VISIT_DETAIL table record to represent the immediate parent visit-detail record.,visit_detail,cdm +visit_occurrence_id,Yes,INTEGER,"A foreign key that refers to the record in the VISIT_OCCURRENCE table. This is a required field, because for every visit_detail is a child of visit_occurrence and cannot exist without a corresponding parent record in visit_occurrence.",visit_detail,cdm +visit_occurrence_id,Yes,INTEGER,A unique identifier for each Person's visit or encounter at a healthcare provider.,visit_occurrence,cdm +person_id,Yes,INTEGER,A foreign key identifier to the Person for whom the visit is recorded. The demographic details of that Person are stored in the PERSON table.,visit_occurrence,cdm +visit_concept_id,Yes,INTEGER,A foreign key that refers to a visit Concept identifier in the Standardized Vocabularies.,visit_occurrence,cdm +visit_start_date,Yes,DATE,The start date of the visit.,visit_occurrence,cdm +visit_start_datetime,No,DATETIME,The date and time of the visit started.,visit_occurrence,cdm +visit_end_date,Yes,DATE,The end date of the visit. If this is a one-day visit the end date should match the start date.,visit_occurrence,cdm +visit_end_datetime,No,DATETIME,The date and time of the visit end.,visit_occurrence,cdm +visit_type_concept_id,Yes,INTEGER,A foreign key to the predefined Concept identifier in the Standardized Vocabularies reflecting the type of source data from which the visit record is derived.,visit_occurrence,cdm +provider_id,No,INTEGER,A foreign key to the provider in the provider table who was associated with the visit.,visit_occurrence,cdm +care_site_id,No,INTEGER,A foreign key to the care site in the care site table that was visited.,visit_occurrence,cdm +visit_source_value,No,VARCHAR(50),The source code for the visit as it appears in the source data.,visit_occurrence,cdm +visit_source_concept_id,No,INTEGER,A foreign key to a Concept that refers to the code used in the source.,visit_occurrence,cdm +admitting_source_concept_id,No,INTEGER,A foreign key to the predefined concept in the Place of Service Vocabulary reflecting the admitting source for a visit.,visit_occurrence,cdm +admitting_source_value,No,VARCHAR(50),The source code for the admitting source as it appears in the source data.,visit_occurrence,cdm +discharge_to_concept_id,No,INTEGER,A foreign key to the predefined concept in the Place of Service Vocabulary reflecting the discharge disposition for a visit.,visit_occurrence,cdm +discharge_to_source_value,No,VARCHAR(50),The source code for the discharge disposition as it appears in the source data.,visit_occurrence,cdm +preceding_visit_occurrence_id,No,INTEGER,A foreign key to the VISIT_OCCURRENCE table of the visit immediately preceding this visit,visit_occurrence,cdm +cohort_definition_id,Yes,INTEGER,A foreign key to a record in the COHORT_DEFINITION table containing relevant Cohort Definition information.,cohort,results +subject_id,Yes,INTEGER,"A foreign key to the subject in the cohort. These could be referring to records in the PERSON, PROVIDER, VISIT_OCCURRENCE table.",cohort,results +cohort_start_date,Yes,DATE,"The date when the Cohort Definition criteria for the Person, Provider or Visit first match.",cohort,results +cohort_end_date,Yes,DATE,"The date when the Cohort Definition criteria for the Person, Provider or Visit no longer match or the Cohort membership was terminated.",cohort,results +cohort_definition_id,Yes,INTEGER,A foreign key to a record in the [COHORT_DEFINITION](https://github.com/OHDSI/CommonDataModel/wiki/COHORT_DEFINITION) table containing relevant Cohort Definition information.,cohort_attribute,results +subject_id,Yes,INTEGER,"A foreign key to the subject in the Cohort. These could be referring to records in the PERSON, PROVIDER, VISIT_OCCURRENCE table.",cohort_attribute,results +cohort_start_date,Yes,DATE,"The date when the Cohort Definition criteria for the Person, Provider or Visit first match.",cohort_attribute,results +cohort_end_date,Yes,DATE,"The date when the Cohort Definition criteria for the Person, Provider or Visit no longer match or the Cohort membership was terminated.",cohort_attribute,results +attribute_definition_id,Yes,INTEGER,A foreign key to a record in the [ATTRIBUTE_DEFINITION](https://github.com/OHDSI/CommonDataModel/wiki/ATTRIBUTE_DEFINITION) table containing relevant Attribute Definition information.,cohort_attribute,results +value_as_number,No,FLOAT,The attribute result stored as a number. This is applicable to attributes where the result is expressed as a numeric value.,cohort_attribute,results +value_as_concept_id,No,INTEGER,The attribute result stored as a Concept ID. This is applicable to attributes where the result is expressed as a categorical value.,cohort_attribute,results +condition_era_id,Yes,INTEGER,A unique identifier for each Condition Era.,condition_era,cdm +person_id,Yes,INTEGER,A foreign key identifier to the Person who is experiencing the Condition during the Condition Era. The demographic details of that Person are stored in the PERSON table.,condition_era,cdm +condition_concept_id,Yes,INTEGER,A foreign key that refers to a standard Condition Concept identifier in the Standardized Vocabularies.,condition_era,cdm +condition_era_start_date,Yes,DATE,The start date for the Condition Era constructed from the individual instances of Condition Occurrences. It is the start date of the very first chronologically recorded instance of the condition.,condition_era,cdm +condition_era_end_date,Yes,DATE,The end date for the Condition Era constructed from the individual instances of Condition Occurrences. It is the end date of the final continuously recorded instance of the Condition.,condition_era,cdm +condition_occurrence_count,No,INTEGER,The number of individual Condition Occurrences used to construct the condition era.,condition_era,cdm +dose_era_id,Yes,INTEGER,A unique identifier for each Dose Era.,dose_era,cdm +person_id,Yes,INTEGER,A foreign key identifier to the Person who is subjected to the drug during the drug era. The demographic details of that Person are stored in the PERSON table.,dose_era,cdm +drug_concept_id,Yes,INTEGER,A foreign key that refers to a Standard Concept identifier in the Standardized Vocabularies for the active Ingredient Concept.,dose_era,cdm +unit_concept_id,Yes,INTEGER,A foreign key that refers to a Standard Concept identifier in the Standardized Vocabularies for the unit concept.,dose_era,cdm +dose_value,Yes,FLOAT,The numeric value of the dose.,dose_era,cdm +dose_era_start_date,Yes,DATE,The start date for the drug era constructed from the individual instances of drug exposures. It is the start date of the very first chronologically recorded instance of utilization of a drug.,dose_era,cdm +dose_era_end_date,Yes,DATE,The end date for the drug era constructed from the individual instance of drug exposures. It is the end date of the final continuously recorded instance of utilization of a drug.,dose_era,cdm +drug_era_id,Yes,INTEGER,A unique identifier for each Drug Era.,drug_era,cdm +person_id,Yes,INTEGER,A foreign key identifier to the Person who is subjected to the Drug during the fDrug Era. The demographic details of that Person are stored in the PERSON table.,drug_era,cdm +drug_concept_id,Yes,INTEGER,A foreign key that refers to a Standard Concept identifier in the Standardized Vocabularies for the Ingredient Concept.,drug_era,cdm +drug_era_start_date,Yes,DATE,The start date for the Drug Era constructed from the individual instances of Drug Exposures. It is the start date of the very first chronologically recorded instance of conutilization of a Drug.,drug_era,cdm +drug_era_end_date,Yes,DATE,The end date for the drug era constructed from the individual instance of drug exposures. It is the end date of the final continuously recorded instance of utilization of a drug.,drug_era,cdm +drug_exposure_count,No,INTEGER,The number of individual Drug Exposure occurrences used to construct the Drug Era.,drug_era,cdm +gap_days,No,INTEGER,The number of days that are not covered by DRUG_EXPOSURE records that were used to make up the era record.,drug_era,cdm +cost_id,Yes,INTEGER,A unique identifier for each COST record.,cost,cdm +cost_event_id,Yes,INTEGER,"A foreign key identifier to the event (e.g. Measurement, Procedure, Visit, Drug Exposure, etc) record for which cost data are recorded.",cost,cdm +cost_domain_id,Yes,VARCHAR(20),"The concept representing the domain of the cost event, from which the corresponding table can be inferred that contains the entity for which cost information is recorded.",cost,cdm +cost_type_concept_id,Yes,INTEGER,"A foreign key identifier to a concept in the CONCEPT table for the provenance or the source of the COST data: Calculated from insurance claim information, provider revenue, calculated from cost-to-charge ratio, reported from accounting database, etc.",cost,cdm +currency_concept_id,No,INTEGER,"A foreign key identifier to the concept representing the 3-letter code used to delineate international currencies, such as USD for US Dollar.",cost,cdm +total_charge,No,FLOAT,"The total amount charged by some provider of goods or services (e.g. hospital, physician pharmacy, dme provider) to payers (insurance companies, the patient).",cost,cdm +total_cost,No,FLOAT,The cost incurred by the provider of goods or services.,cost,cdm +total_paid,No,FLOAT,The total amount actually paid from all payers for goods or services of the provider.,cost,cdm +paid_by_payer,No,FLOAT,The amount paid by the Payer for the goods or services.,cost,cdm +paid_by_patient,No,FLOAT,The total amount paid by the Person as a share of the expenses.,cost,cdm +paid_patient_copay,No,FLOAT,The amount paid by the Person as a fixed contribution to the expenses.,cost,cdm +paid_patient_coinsurance,No,FLOAT,"The amount paid by the Person as a joint assumption of risk. Typically, this is a percentage of the expenses defined by the Payer Plan after the Person's deductible is exceeded.",cost,cdm +paid_patient_deductible,No,FLOAT,The amount paid by the Person that is counted toward the deductible defined by the Payer Plan. paid_patient_deductible does contribute to the paid_by_patient variable.,cost,cdm +paid_by_primary,No,FLOAT,The amount paid by a primary Payer through the coordination of benefits.,cost,cdm +paid_ingredient_cost,No,FLOAT,"The amount paid by the Payer to a pharmacy for the drug, excluding the amount paid for dispensing the drug. paid_ingredient_cost contributes to the paid_by_payer field if this field is populated with a nonzero value.",cost,cdm +paid_dispensing_fee,No,FLOAT,"The amount paid by the Payer to a pharmacy for dispensing a drug, excluding the amount paid for the drug ingredient. paid_dispensing_fee contributes to the paid_by_payer field if this field is populated with a nonzero value.",cost,cdm +payer_plan_period_id,No,INTEGER,"A foreign key to the PAYER_PLAN_PERIOD table, where the details of the Payer, Plan and Family are stored. Record the payer_plan_id that relates to the payer who contributed to the paid_by_payer field.",cost,cdm +amount_allowed,No,FLOAT,The contracted amount agreed between the payer and provider.,cost,cdm +revenue_code_concept_id,No,INTEGER,A foreign key referring to a Standard Concept ID in the Standardized Vocabularies for Revenue codes.,cost,cdm +revenue_code_source_value,No,VARCHAR(50),"The source code for the Revenue code as it appears in the source data, stored here for reference.",cost,cdm +drg_concept_id,No,INTEGER,A foreign key to the predefined concept in the DRG Vocabulary reflecting the DRG for a visit.,cost,cdm +drg_source_value,No,VARCHAR(3),The 3-digit DRG source code as it appears in the source data.,cost,cdm +payer_plan_period_id,Yes,INTEGER,"A identifier for each unique combination of payer, sponsor, plan, family code and time span.",payer_plan_period,cdm +person_id,Yes,INTEGER,A foreign key identifier to the Person covered by the payer. The demographic details of that Person are stored in the PERSON table.,payer_plan_period,cdm +payer_plan_period_start_date,Yes,DATE,The start date of the payer plan period.,payer_plan_period,cdm +payer_plan_period_end_date,Yes,DATE,The end date of the payer plan period.,payer_plan_period,cdm +payer_concept_id,No,INTEGER,A foreign key that refers to a Standard Payer concept identifiers in the Standardized Vocabularies,payer_plan_period,cdm +payer_source_value,No,VARCHAR(50),The source code for the payer as it appears in the source data.,payer_plan_period,cdm +payer_source_concept_id,No,INTEGER,A foreign key to a payer concept that refers to the code used in the source.,payer_plan_period,cdm +plan_concept_id,No,INTEGER,A foreign key that refers to a Standard plan that represents the health benefit plan in the Standardized Vocabularies,payer_plan_period,cdm +plan_source_value,No,VARCHAR(50),The source code for the Person's health benefit plan as it appears in the source data.,payer_plan_period,cdm +plan_source_concept_id,No,INTEGER,A foreign key to a plan concept that refers to the code used in the source.,payer_plan_period,cdm +sponsor_concept_id,No,INTEGER,A foreign key that refers to a Standard plan that represents the sponsor in the Standardized Vocabularies,payer_plan_period,cdm +sponsor_source_value,No,VARCHAR(50),The source code for the Person's sponsor of the health plan as it appears in the source data.,payer_plan_period,cdm +sponsor_source_concept_id*,No,INTEGER,A foreign key to a sponsor concept that refers to the code used in the source.,payer_plan_period,cdm +family_source_value,No,VARCHAR(50),The source code for the Person's family as it appears in the source data.,payer_plan_period,cdm +stop_reason_concept_id,No,INTEGER,A foreign key that refers to a Standard termination reason that represents the reason for the termination in the Standardized Vocabularies.,payer_plan_period,cdm +stop_reason_source_value,No,VARCHAR(50),The reason for stop-coverage of the record.,payer_plan_period,cdm +stop_reason_source_concept_id,No,INTEGER,A foreign key to a stop-coverage concept that refers to the code used in the source.,payer_plan_period,cdm +care_site_id,Yes,INTEGER,A unique identifier for each Care Site.,care_site,cdm +care_site_name,No,VARCHAR(255),The verbatim description or name of the Care Site as in data source,care_site,cdm +place_of_service_concept_id,No,INTEGER,A foreign key that refers to a Place of Service Concept ID in the Standardized Vocabularies.,care_site,cdm +location_id,No,INTEGER,"A foreign key to the geographic Location in the LOCATION table, where the detailed address information is stored.",care_site,cdm +care_site_source_value,No,VARCHAR(50),"The identifier for the Care Site in the source data, stored here for reference.",care_site,cdm +place_of_service_source_value,No,VARCHAR(50),"The source code for the Place of Service as it appears in the source data, stored here for reference.",care_site,cdm +location_id,Yes,INTEGER,A unique identifier for each geographic location.,location,cdm +address_1,No,VARCHAR(50),"The address field 1, typically used for the street address, as it appears in the source data.",location,cdm +address_2,No,VARCHAR(50),"The address field 2, typically used for additional detail such as buildings, suites, floors, as it appears in the source data.",location,cdm +city,No,VARCHAR(50),The city field as it appears in the source data.,location,cdm +state,No,VARCHAR(2),The state field as it appears in the source data.,location,cdm +zip,No,VARCHAR(9),The zip or postal code.,location,cdm +county,No,VARCHAR(20),The county.,location,cdm +location_source_value,No,VARCHAR(50),The verbatim information that is used to uniquely identify the location as it appears in the source data.,location,cdm +provider_id,Yes,INTEGER,A unique identifier for each Provider.,provider,cdm +provider_name,No,VARCHAR(255),A description of the Provider.,provider,cdm +npi,No,VARCHAR(20),The National Provider Identifier (NPI) of the provider.,provider,cdm +dea,No,VARCHAR(20),The Drug Enforcement Administration (DEA) number of the provider.,provider,cdm +specialty_concept_id,No,INTEGER,A foreign key to a Standard Specialty Concept ID in the Standardized Vocabularies.,provider,cdm +care_site_id,No,INTEGER,A foreign key to the main Care Site where the provider is practicing.,provider,cdm +year_of_birth,No,INTEGER,The year of birth of the Provider.,provider,cdm +gender_concept_id,No,INTEGER,The gender of the Provider.,provider,cdm +provider_source_value,No,VARCHAR(50),"The identifier used for the Provider in the source data, stored here for reference.",provider,cdm +specialty_source_value,No,VARCHAR(50),"The source code for the Provider specialty as it appears in the source data, stored here for reference.",provider,cdm +specialty_source_concept_id,No,INTEGER,A foreign key to a Concept that refers to the code used in the source.,provider,cdm +gender_source_value,No,VARCHAR(50),"The gender code for the Provider as it appears in the source data, stored here for reference.",provider,cdm +gender_source_concept_id,No,INTEGER,A foreign key to a Concept that refers to the code used in the source.,provider,cdm +cdm_source_name,Yes,VARCHAR(255),The full name of the source,cdm_source,cdm +cdm_source_abbreviation,No,VARCHAR(25),An abbreviation of the name,cdm_source,cdm +cdm_holder,No,VARCHAR(255),The name of the organization responsible for the development of the CDM instance,cdm_source,cdm +source_description,No,CLOB,A description of the source data origin and purpose for collection. The description may contain a summary of the period of time that is expected to be covered by this dataset.,cdm_source,cdm +source_documentation_reference,No,VARCHAR(255),URL or other external reference to location of source documentation,cdm_source,cdm +cdm_etl_reference,No,VARCHAR(255),URL or other external reference to location of ETL specification documentation and ETL source code,cdm_source,cdm +source_release_date,No,DATE,"The date for which the source data are most current, such as the last day of data capture",cdm_source,cdm +cdm_release_date,No,DATE,The date when the CDM was instantiated,cdm_source,cdm +cdm_version,No,VARCHAR(10),The version of CDM used,cdm_source,cdm +vocabulary_version,No,VARCHAR(20),The version of the vocabulary used,cdm_source,cdm +metadata_concept_id,Yes,INTEGER,A foreign key that refers to a Standard Metadata Concept identifier in the Standardized Vocabularies.,metadata,cdm +metadata_type_concept_id,Yes,INTEGER,A foreign key that refers to a Standard Type Concept identifier in the Standardized Vocabularies.,metadata,cdm +name,Yes,VARCHAR(250),The name of the Concept stored in metadata_concept_id or a description of the data being stored.,metadata,cdm +value_as_string,No,NVARCHAR,The metadata value stored as a string.,metadata,cdm +value_as_concept_id,No,INTEGER,A foreign key to a metadata value stored as a Concept ID.,metadata,cdm +metadata date,No,DATE,The date associated with the metadata,metadata,cdm +metadata_datetime,No,DATETIME,The date and time associated with the metadata,metadata,cdm +attribute_definition_id,Yes,INTEGER,A unique identifier for each Attribute.,attribute_definition,cdm +attribute_name,Yes,VARCHAR(255),A short description of the Attribute.,attribute_definition,cdm +attribute_description,No,VARCHAR(MAX),A complete description of the Attribute definition,attribute_definition,cdm +attribute_type_concept_id,Yes,INTEGER,Type defining what kind of Attribute Definition the record represents and how the syntax may be executed,attribute_definition,cdm +attribute_syntax,No,VARCHAR(MAX),Syntax or code to operationalize the Attribute definition,attribute_definition,cdm +cohort_definition_id,Yes,INTEGER,A unique identifier for each Cohort.,cohort_definition,cdm +cohort_definition_name,Yes,VARCHAR(255),A short description of the Cohort.,cohort_definition,cdm +cohort_definition_description,No,VARCHAR(MAX),A complete description of the Cohort definition,cohort_definition,cdm +definition_type_concept_id,Yes,INTEGER,Type defining what kind of Cohort Definition the record represents and how the syntax may be executed,cohort_definition,cdm +cohort_definition_syntax,No,VARCHAR(MAX),Syntax or code to operationalize the Cohort definition,cohort_definition,cdm +subject_concept_id,Yes,INTEGER,"A foreign key to the Concept to which defines the domain of subjects that are members of the cohort (e.g., Person, Provider, Visit).",cohort_definition,cdm +cohort_initiation_date,No,DATE,A date to indicate when the Cohort was initiated in the COHORT table,cohort_definition,cdm diff --git a/src/org/ohdsi/rabbitInAHat/dataModel/Database.java b/src/org/ohdsi/rabbitInAHat/dataModel/Database.java index a5985bf1..d595f2d0 100644 --- a/src/org/ohdsi/rabbitInAHat/dataModel/Database.java +++ b/src/org/ohdsi/rabbitInAHat/dataModel/Database.java @@ -35,7 +35,7 @@ public class Database implements Serializable { public enum CDMVersion { - CDMV4("CDMV4.csv"), CDMV5("CDMV5.csv"), CDMV501("CDMV5.0.1.csv"), CDMV510("CDMV5.1.0.csv"), CDMV520("CDMV5.2.0.csv"), CDMV530("CDMV5.3.0.csv"); + CDMV4("CDMV4.csv"), CDMV5("CDMV5.csv"), CDMV501("CDMV5.0.1.csv"), CDMV510("CDMV5.1.0.csv"), CDMV520("CDMV5.2.0.csv"), CDMV530("CDMV5.3.0.csv"), CDMV531("CDMV5.3.1.csv"); private final String fileName; @@ -78,7 +78,7 @@ public static Database generateModelFromCSV(InputStream stream, String dbName) { Map nameToTable = new HashMap(); try { - + for (CSVRecord row : CSVFormat.RFC4180.withHeader().parse(new InputStreamReader(stream))) { String tableNameColumn; String fieldNameColumn; @@ -119,12 +119,12 @@ public static Database generateModelFromCSV(InputStream stream, String dbName) { } catch (IOException e) { throw new RuntimeException(e.getMessage()); } -// Collections.sort(database.tables, new Comparator() { -// -// @Override -// public int compare(Table o1, Table o2) { -// return o1.getName().compareTo(o2.getName()); -// }}); + // Collections.sort(database.tables, new Comparator
() { + // + // @Override + // public int compare(Table o1, Table o2) { + // return o1.getName().compareTo(o2.getName()); + // }}); return database; } diff --git a/src/org/ohdsi/rabbitInAHat/dataModel/StemTableAdd.java b/src/org/ohdsi/rabbitInAHat/dataModel/StemTableAdd.java index b79adf28..8b5b21c2 100644 --- a/src/org/ohdsi/rabbitInAHat/dataModel/StemTableAdd.java +++ b/src/org/ohdsi/rabbitInAHat/dataModel/StemTableAdd.java @@ -30,6 +30,9 @@ public static void addStemTable(ETL etl) { } else if (targetDatabase.getDbName().toLowerCase().equals("cdmv5.3.0")) { tableStream = StemTableAdd.class.getResourceAsStream("StemTableV5.3.0.csv"); mappingStream = StemTableAdd.class.getResourceAsStream("StemTableDefaultMappingV5.3.0.csv"); + } else if (targetDatabase.getDbName().toLowerCase().equals("cdmv5.3.1")) { + tableStream = StemTableAdd.class.getResourceAsStream("StemTableV5.3.1.csv"); + mappingStream = StemTableAdd.class.getResourceAsStream("StemTableDefaultMappingV5.3.1.csv"); } else { JOptionPane.showMessageDialog(null, "No stem table definition available for " + targetDatabase.getDbName(), "Error", JOptionPane.ERROR_MESSAGE); return; diff --git a/src/org/ohdsi/rabbitInAHat/dataModel/StemTableDefaultMappingV5.3.1.csv b/src/org/ohdsi/rabbitInAHat/dataModel/StemTableDefaultMappingV5.3.1.csv new file mode 100644 index 00000000..83782349 --- /dev/null +++ b/src/org/ohdsi/rabbitInAHat/dataModel/StemTableDefaultMappingV5.3.1.csv @@ -0,0 +1,114 @@ +SOURCE_TABLE,SOURCE_FIELD,TARGET_TABLE,TARGET_FIELD +STEM_TABLE,PERSON_ID,CONDITION_OCCURRENCE,PERSON_ID +STEM_TABLE,VISIT_OCCURRENCE_ID,CONDITION_OCCURRENCE,VISIT_OCCURRENCE_ID +STEM_TABLE,PROVIDER_ID,CONDITION_OCCURRENCE,PROVIDER_ID +STEM_TABLE,ID,CONDITION_OCCURRENCE,CONDITION_OCCURRENCE_ID +STEM_TABLE,CONCEPT_ID,CONDITION_OCCURRENCE,CONDITION_CONCEPT_ID +STEM_TABLE,SOURCE_VALUE,CONDITION_OCCURRENCE,CONDITION_SOURCE_VALUE +STEM_TABLE,SOURCE_CONCEPT_ID,CONDITION_OCCURRENCE,CONDITION_SOURCE_CONCEPT_ID +STEM_TABLE,TYPE_CONCEPT_ID,CONDITION_OCCURRENCE,CONDITION_TYPE_CONCEPT_ID +STEM_TABLE,START_DATE,CONDITION_OCCURRENCE,CONDITION_START_DATE +STEM_TABLE,START_DATETIME,CONDITION_OCCURRENCE,CONDITION_START_DATETIME +STEM_TABLE,END_DATE,CONDITION_OCCURRENCE,CONDITION_END_DATE +STEM_TABLE,END_DATETIME,CONDITION_OCCURRENCE,CONDITION_END_DATETIME +STEM_TABLE,STOP_REASON,CONDITION_OCCURRENCE,STOP_REASON +STEM_TABLE,CONDITION_STATUS_SOURCE_VALUE,CONDITION_OCCURRENCE,CONDITION_STATUS_SOURCE_VALUE +STEM_TABLE,CONDITION_STATUS_CONCEPT_ID,CONDITION_OCCURRENCE,CONDITION_STATUS_CONCEPT_ID +STEM_TABLE,PERSON_ID,DRUG_EXPOSURE,PERSON_ID +STEM_TABLE,ID,DRUG_EXPOSURE,DRUG_EXPOSURE_ID +STEM_TABLE,CONCEPT_ID,DRUG_EXPOSURE,DRUG_CONCEPT_ID +STEM_TABLE,START_DATE,DRUG_EXPOSURE,DRUG_EXPOSURE_START_DATE +STEM_TABLE,START_DATETIME,DRUG_EXPOSURE,DRUG_EXPOSURE_START_DATETIME +STEM_TABLE,END_DATE,DRUG_EXPOSURE,DRUG_EXPOSURE_END_DATE +STEM_TABLE,END_DATETIME,DRUG_EXPOSURE,DRUG_EXPOSURE_END_DATETIME +STEM_TABLE,TYPE_CONCEPT_ID,DRUG_EXPOSURE,DRUG_TYPE_CONCEPT_ID +STEM_TABLE,STOP_REASON,DRUG_EXPOSURE,STOP_REASON +STEM_TABLE,REFILLS,DRUG_EXPOSURE,REFILLS +STEM_TABLE,QUANTITY,DRUG_EXPOSURE,QUANTITY +STEM_TABLE,DAYS_SUPPLY,DRUG_EXPOSURE,DAYS_SUPPLY +STEM_TABLE,SIG,DRUG_EXPOSURE,SIG +STEM_TABLE,ROUTE_CONCEPT_ID,DRUG_EXPOSURE,ROUTE_CONCEPT_ID +STEM_TABLE,LOT_NUMBER,DRUG_EXPOSURE,LOT_NUMBER +STEM_TABLE,PROVIDER_ID,DRUG_EXPOSURE,PROVIDER_ID +STEM_TABLE,VISIT_OCCURRENCE_ID,DRUG_EXPOSURE,VISIT_OCCURRENCE_ID +STEM_TABLE,SOURCE_VALUE,DRUG_EXPOSURE,DRUG_SOURCE_VALUE +STEM_TABLE,SOURCE_CONCEPT_ID,DRUG_EXPOSURE,DRUG_SOURCE_CONCEPT_ID +STEM_TABLE,ROUTE_SOURCE_VALUE,DRUG_EXPOSURE,ROUTE_SOURCE_VALUE +STEM_TABLE,DOSE_UNIT_SOURCE_VALUE,DRUG_EXPOSURE,DOSE_UNIT_SOURCE_VALUE +STEM_TABLE,PERSON_ID,DEVICE_EXPOSURE,PERSON_ID +STEM_TABLE,ID,DEVICE_EXPOSURE,DEVICE_EXPOSURE_ID +STEM_TABLE,CONCEPT_ID,DEVICE_EXPOSURE,DEVICE_CONCEPT_ID +STEM_TABLE,START_DATE,DEVICE_EXPOSURE,DEVICE_EXPOSURE_START_DATE +STEM_TABLE,START_DATETIME,DEVICE_EXPOSURE,DEVICE_EXPOSURE_START_DATETIME +STEM_TABLE,END_DATE,DEVICE_EXPOSURE,DEVICE_EXPOSURE_END_DATE +STEM_TABLE,END_DATETIME,DEVICE_EXPOSURE,DEVICE_EXPOSURE_END_DATETIME +STEM_TABLE,TYPE_CONCEPT_ID,DEVICE_EXPOSURE,DEVICE_TYPE_CONCEPT_ID +STEM_TABLE,UNIQUE_DEVICE_ID,DEVICE_EXPOSURE,UNIQUE_DEVICE_ID +STEM_TABLE,QUANTITY,DEVICE_EXPOSURE,QUANTITY +STEM_TABLE,PROVIDER_ID,DEVICE_EXPOSURE,PROVIDER_ID +STEM_TABLE,VISIT_OCCURRENCE_ID,DEVICE_EXPOSURE,VISIT_OCCURRENCE_ID +STEM_TABLE,SOURCE_VALUE,DEVICE_EXPOSURE,DEVICE_SOURCE_VALUE +STEM_TABLE,SOURCE_CONCEPT_ID,DEVICE_EXPOSURE,DEVICE_SOURCE_CONCEPT_ID +STEM_TABLE,PERSON_ID,MEASUREMENT,PERSON_ID +STEM_TABLE,ID,MEASUREMENT,MEASUREMENT_ID +STEM_TABLE,CONCEPT_ID,MEASUREMENT,MEASUREMENT_CONCEPT_ID +STEM_TABLE,START_DATE,MEASUREMENT,MEASUREMENT_DATE +STEM_TABLE,START_DATETIME,MEASUREMENT,MEASUREMENT_DATETIME +STEM_TABLE,TYPE_CONCEPT_ID,MEASUREMENT,MEASUREMENT_TYPE_CONCEPT_ID +STEM_TABLE,OPERATOR_CONCEPT_ID,MEASUREMENT,OPERATOR_CONCEPT_ID +STEM_TABLE,VALUE_AS_NUMBER,MEASUREMENT,VALUE_AS_NUMBER +STEM_TABLE,VALUE_AS_CONCEPT_ID,MEASUREMENT,VALUE_AS_CONCEPT_ID +STEM_TABLE,UNIT_CONCEPT_ID,MEASUREMENT,UNIT_CONCEPT_ID +STEM_TABLE,RANGE_LOW,MEASUREMENT,RANGE_LOW +STEM_TABLE,RANGE_HIGH,MEASUREMENT,RANGE_HIGH +STEM_TABLE,PROVIDER_ID,MEASUREMENT,PROVIDER_ID +STEM_TABLE,VISIT_OCCURRENCE_ID,MEASUREMENT,VISIT_OCCURRENCE_ID +STEM_TABLE,SOURCE_VALUE,MEASUREMENT,MEAUSREMENT_SOURCE_VALUE +STEM_TABLE,SOURCE_CONCEPT_ID,MEASUREMENT,MEASUREMENT_SOURCE_CONCEPT_ID +STEM_TABLE,UNIT_SOURCE_VALUE,MEASUREMENT,UNIT_SOURCE_VALUE +STEM_TABLE,VALUE_SOURCE_VALUE,MEASUREMENT,VALUE_SOURCE_VALUE +STEM_TABLE,PERSON_ID,OBSERVATION,PERSON_ID +STEM_TABLE,ID,OBSERVATION,OBSERVATION_ID +STEM_TABLE,CONCEPT_ID,OBSERVATION,OBSERVATION_CONCEPT_ID +STEM_TABLE,START_DATE,OBSERVATION,OBSERVATION_DATE +STEM_TABLE,START_DATETIME,OBSERVATION,OBSERVATION_DATETIME +STEM_TABLE,TYPE_CONCEPT_ID,OBSERVATION,OBSERVATION_TYPE_CONCEPT_ID +STEM_TABLE,VALUE_AS_NUMBER,OBSERVATION,VALUE_AS_NUMBER +STEM_TABLE,VALUE_AS_STRING,OBSERVATION,VALUE_AS_STRING +STEM_TABLE,VALUE_AS_CONCEPT_ID,OBSERVATION,VALUE_AS_CONCEPT_ID +STEM_TABLE,QUALIFIER_CONCEPT_ID,OBSERVATION,QUALIFIER_CONCEPT_ID +STEM_TABLE,UNIT_CONCEPT_ID,OBSERVATION,UNIT_CONCEPT_ID +STEM_TABLE,PROVIDER_ID,OBSERVATION,PROVIDER_ID +STEM_TABLE,VISIT_OCCURRENCE_ID,OBSERVATION,VISIT_OCCURRENCE_ID +STEM_TABLE,SOURCE_VALUE,OBSERVATION,OBSERVATION_SOURCE_VALUE +STEM_TABLE,SOURCE_CONCEPT_ID,OBSERVATION,OBSERVATION_SOURCE_CONCEPT_ID +STEM_TABLE,UNIT_SOURCE_VALUE,OBSERVATION,UNIT_SOURCE_VALUE +STEM_TABLE,QUALIFIER_SOURCE_VALUE,OBSERVATION,QUALIFIER_SOURCE_VALUE +STEM_TABLE,PERSON_ID,PROCEDURE_OCCURRENCE,PERSON_ID +STEM_TABLE,ID,PROCEDURE_OCCURRENCE,PROCEDURE_OCCURRENCE_ID +STEM_TABLE,CONCEPT_ID,PROCEDURE_OCCURRENCE,PROCEDURE_CONCEPT_ID +STEM_TABLE,START_DATE,PROCEDURE_OCCURRENCE,PROCEDURE_DATE +STEM_TABLE,START_DATETIME,PROCEDURE_OCCURRENCE,PROCEDURE_DATETIME +STEM_TABLE,TYPE_CONCEPT_ID,PROCEDURE_OCCURRENCE,PROCEDURE_TYPE_CONCEPT_ID +STEM_TABLE,MODIFIER_CONCEPT_ID,PROCEDURE_OCCURRENCE,MODIFIER_CONCEPT_ID +STEM_TABLE,QUANTITY,PROCEDURE_OCCURRENCE,QUANTITY +STEM_TABLE,PROVIDER_ID,PROCEDURE_OCCURRENCE,PROVIDER_ID +STEM_TABLE,VISIT_OCCURRENCE_ID,PROCEDURE_OCCURRENCE,VISIT_OCCURRENCE_ID +STEM_TABLE,SOURCE_VALUE,PROCEDURE_OCCURRENCE,PROCEDURE_SOURCE_VALUE +STEM_TABLE,SOURCE_CONCEPT_ID,PROCEDURE_OCCURRENCE,PROCEDURE_SOURCE_CONCEPT_ID +STEM_TABLE,MODIFIER_SOURCE_VALUE,PROCEDURE_OCCURRENCE,MODIFIER_SOURCE_VALUE +STEM_TABLE,PERSON_ID,SPECIMEN,PERSON_ID +STEM_TABLE,ID,SPECIMEN,SPECIMEN_ID +STEM_TABLE,CONCEPT_ID,SPECIMEN,SPECIMEN_CONCEPT_ID +STEM_TABLE,TYPE_CONCEPT_ID,SPECIMEN,SPECIMEN_TYPE_CONCEPT_ID +STEM_TABLE,START_DATE,SPECIMEN,SPECIMEN_DATE +STEM_TABLE,START_DATETIME,SPECIMEN,SPECIMEN_DATETIME +STEM_TABLE,QUANTITY,SPECIMEN,QUANTITY +STEM_TABLE,UNIT_CONCEPT_ID,SPECIMEN,UNIT_CONCEPT_ID +STEM_TABLE,ANATOMIC_SITE_CONCEPT_ID,SPECIMEN,ANATOMIC_SITE_CONCEPT_ID +STEM_TABLE,DISEASE_STATUS_CONCEPT_ID,SPECIMEN,DISEASE_STATUS_CONCEPT_ID +STEM_TABLE,SPECIMEN_SOURCE_ID,SPECIMEN,SPECIMEN_SOURCE_ID +STEM_TABLE,SOURCE_VALUE,SPECIMEN,SPECIMEN_SOURCE_VALUE +STEM_TABLE,UNIT_SOURCE_VALUE,SPECIMEN,UNIT_SOURCE_VALUE +STEM_TABLE,ANATOMIC_SITE_SOURCE_VALUE,SPECIMEN,ANATOMIC_SITE_SOURCE_VALUE +STEM_TABLE,DISEASE_STATUS_SOURCE_VALUE,SPECIMEN,DISEASE_STATUS_SOURCE_VALUE diff --git a/src/org/ohdsi/rabbitInAHat/dataModel/StemTableV5.3.1.csv b/src/org/ohdsi/rabbitInAHat/dataModel/StemTableV5.3.1.csv new file mode 100644 index 00000000..5526c3d2 --- /dev/null +++ b/src/org/ohdsi/rabbitInAHat/dataModel/StemTableV5.3.1.csv @@ -0,0 +1,44 @@ +TABLE_NAME,COLUMN_NAME,IS_NULLABLE,DATA_TYPE,DESCRIPTION +STEM_TABLE,DOMAIN_ID,NO,CHARACTER VARYING,A foreign key idenfifying the domain this event belongs to. The domain drives the target CDM table this event will be recorded in. If one is not set specify a default domain. +STEM_TABLE,PERSON_ID,NO,INTEGER,A foreign key identifier to the Person. The demographic details of that Person are stored in the PERSON table. +STEM_TABLE,VISIT_OCCURRENCE_ID,YES,INTEGER,A foreign key to the visit in the VISIT table. +STEM_TABLE,PROVIDER_ID,YES,INTEGER,A foreign key to the Provider in the PROVIDER table who was responsible for capturing this event. +STEM_TABLE,ID,NO,INTEGER,A unique identifier for identifying the event. +STEM_TABLE,CONCEPT_ID,NO,INTEGER,A foreign key that refers to a Standard Condition Concept identifier in the Standardized Vocabularies. +STEM_TABLE,SOURCE_VALUE,YES,CHARACTER VARYING,The source code for the Concept as it appears in the source data. This code is mapped to a Standard Concept in the Standardized Vocabularies and the original code is stored here for reference. +STEM_TABLE,SOURCE_CONCEPT_ID,YES,INTEGER,A foreign key to a Concept that refers to the code used in the source. +STEM_TABLE,TYPE_CONCEPT_ID,NO,INTEGER,"A foreign key to the predefined Concept identifier in the Standardized Vocabularies reflecting the source data from which the event was recorded, the level of standardization, and the type of occurrence." +STEM_TABLE,START_DATE,NO,DATE,The start date of the event. +STEM_TABLE,START_DATETIME,YES,DATETIME,The start datetime of the event. +STEM_TABLE,END_DATE,YES,DATE,The end date of the event. +STEM_TABLE,END_DATETIME,YES,DATETIME,The end datetime of the event. +,VERBATIM_END_DATE,YES,DATE,The verbatim end date (not derived) of the event. +STEM_TABLE,DAYS_SUPPLY,YES,INTEGER,The number of days of supply of the medication as recorded in the original prescription or dispensing record. +STEM_TABLE,DOSE_UNIT_SOURCE_VALUE,YES,CHARACTER VARYING,The information about the dose unit as detailed in the source. +STEM_TABLE,LOT_NUMBER,YES,CHARACTER VARYING,An identifier assigned to a particular quantity or lot of Drug product from the manufacturer. +STEM_TABLE,MODIFIER_CONCEPT_ID,YES,INTEGER,A foreign key to a Standard Concept identifier for a modifier to the Procedure (e.g. bilateral) +STEM_TABLE,OPERATOR_CONCEPT_ID,YES,INTEGER,"A foreign key identifier to the predefined Concept in the Standardized Vocabularies reflecting the mathematical operator that is applied to the value_as_number. Operators are <, ?, =, ?, >." +STEM_TABLE,MODIFIER_CONCEPT_ID,YES,INTEGER,"A foreign key to a Standard Concept ID for a modifier (e.g., severity of drug-drug interaction alert)" +STEM_TABLE,MODIFIER_SOURCE_VALUE,YES,CHARACTER VARYING,The source code for the modifier as it appears in the source data. +STEM_TABLE,QUANTITY,YES,INTEGER,The number of individual Devices/Procedures/Drugs used for the exposure. +STEM_TABLE,RANGE_HIGH,YES,FLOAT,The upper limit of the normal range of the Measurement. The upper range is assumed to be of the same unit of measure as the Measurement value. +STEM_TABLE,RANGE_LOW,YES,FLOAT,The lower limit of the normal range of the Measurement result. The lower range is assumed to be of the same unit of measure as the Measurement value. +STEM_TABLE,REFILLS,YES,INTEGER,"The number of refills after the initial prescription. The initial prescription is not counted, values start with 0." +STEM_TABLE,ROUTE_CONCEPT_ID,YES,INTEGER,A foreign key to a predefined concept in the Standardized Vocabularies reflecting the route of administration. +STEM_TABLE,ROUTE_SOURCE_VALUE,YES,CHARACTER VARYING,The information about the route of administration as detailed in the source. +STEM_TABLE,SIG,YES,CHARACTER VARYING,The directions (signetur) on the Drug prescription as recorded in the original prescription (and printed on the container) or dispensing record. +STEM_TABLE,STOP_REASON,YES,CHARACTER VARYING,"The reason that the condition was no longer present or the drug exposure stopped, as indicated in the source data." +STEM_TABLE,UNIQUE_DEVICE_ID,YES,CHARACTER VARYING,A UDI or equivalent identifying the instance of the Device used in the Person. +STEM_TABLE,UNIT_CONCEPT_ID,YES,INTEGER,A foreign key to a predefined concept in the Standardized Vocabularies reflecting the unit the effective_drug_dose/measurement/observation/specimen value is expressed. +STEM_TABLE,UNIT_SOURCE_VALUE,YES,CHARACTER VARYING,The source code for the unit as it appears in the source data. This code is mapped to a standard unit concept in the Standardized Vocabularies and the original code is stored here for reference. +STEM_TABLE,VALUE_AS_CONCEPT_ID,YES,INTEGER,"A foreign key to a result represented as a Concept from the Standardized Vocabularies (e.g., positive/negative, present/absent, low/high, etc.)." +STEM_TABLE,VALUE_AS_NUMBER,YES,DECIMAL,A result where the result is expressed as a numeric value. +STEM_TABLE,VALUE_AS_STRING,YES,CHARACTER VARYING,The result stored as a string. This is applicable where the result is expressed as verbatim text. +STEM_TABLE,VALUE_SOURCE_VALUE,YES,CHARACTER VARYING,The source value associated with the content of the value_as_number or value_as_concept as stored in the source data. +STEM_TABLE,ANATOMIC_SITE_CONCEPT_ID,YES,INTEGER,A foreign key to a Standard Concept identifier for the anatomic location of specimen collection. +STEM_TABLE,DISEASE_STATUS_CONCEPT_ID,YES,INTEGER,A foreign key to a Standard Concept identifier for the Disease Status of specimen collection. +STEM_TABLE,SPECIMEN_SOURCE_ID,YES,INTEGER,The Specimen identifier as it appears in the source data. +STEM_TABLE,ANATOMIC_SITE_SOURCE_VALUE,YES,CHARACTER VARYING,The information about the anatomic site as detailed in the source. +STEM_TABLE,DISEASE_STATUS_SOURCE_VALUE,YES,CHARACTER VARYING,The information about the disease status as detailed in the source. +STEM_TABLE,CONDITION_STATUS_CONCEPT_ID,YES,CHARACTER VARYING,A foreign key to the predefined Concept identifier in the Standardized Vocabularies reflecting the condition_status. +STEM_TABLE,CONDITION_STATUS_SOURCE_VALUE,YES,INTEGER,The source code as it appears in the source data