Skip to content

Commit

Permalink
Merge pull request #154 from clairblacketer/master
Browse files Browse the repository at this point in the history
Added support for CDM v6.0
  • Loading branch information
schuemie authored May 17, 2019
2 parents ec1d1fa + bdd9065 commit 9b87e6e
Show file tree
Hide file tree
Showing 7 changed files with 598 additions and 47 deletions.
13 changes: 11 additions & 2 deletions src/org/ohdsi/rabbitInAHat/RabbitInAHatMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public class RabbitInAHatMain implements ResizeListener, ActionListener {
public final static String ACTION_SET_TARGET_V520 = "CDM v5.2.0";
public final static String ACTION_SET_TARGET_V530 = "CDM v5.3.0";
public final static String ACTION_SET_TARGET_V531 = "CDM v5.3.1";
public final static String ACTION_SET_TARGET_V60 = "CDM v6.0";
public final static String ACTION_ADD_STEM_TABLE = "Add stem table";
public final static String ACTION_SET_TARGET_CUSTOM = "Load Custom...";
public final static String ACTION_MARK_COMPLETED = "Mark Highlighted As Complete";
Expand Down Expand Up @@ -142,7 +143,7 @@ public void windowClosing(WindowEvent e) {
frame.setJMenuBar(createMenuBar());

ETL etl = new ETL();
etl.setTargetDatabase(Database.generateCDMModel(CDMVersion.CDMV531));
etl.setTargetDatabase(Database.generateCDMModel(CDMVersion.CDMV60));

ObjectExchange.etl = etl;

Expand Down Expand Up @@ -296,9 +297,13 @@ private JMenuBar createMenuBar() {
targetCDMV530.addActionListener(this);
setTarget.add(targetCDMV530);

JRadioButtonMenuItem targetCDMV531 = new JRadioButtonMenuItem(ACTION_SET_TARGET_V531, true);
JRadioButtonMenuItem targetCDMV531 = new JRadioButtonMenuItem(ACTION_SET_TARGET_V531);
targetCDMV531.addActionListener(this);
setTarget.add(targetCDMV531);

JRadioButtonMenuItem targetCDMV60 = new JRadioButtonMenuItem(ACTION_SET_TARGET_V60, true);
targetCDMV60.addActionListener(this);
setTarget.add(targetCDMV60);

JRadioButtonMenuItem loadTarget = new JRadioButtonMenuItem(ACTION_SET_TARGET_CUSTOM);
loadTarget.addActionListener(this);
Expand All @@ -313,6 +318,7 @@ private JMenuBar createMenuBar() {
targetGroup.add(targetCDMV520);
targetGroup.add(targetCDMV530);
targetGroup.add(targetCDMV531);
targetGroup.add(targetCDMV60);
targetGroup.add(loadTarget);

JMenuItem addStemTable = new JMenuItem(ACTION_ADD_STEM_TABLE);
Expand Down Expand Up @@ -486,6 +492,9 @@ public void actionPerformed(ActionEvent event) {
case ACTION_SET_TARGET_V531:
doSetTargetCDM(CDMVersion.CDMV531);
break;
case ACTION_SET_TARGET_V60:
doSetTargetCDM(CDMVersion.CDMV60);
break;
case ACTION_SET_TARGET_CUSTOM:
doSetTargetCustom(chooseOpenPath(FILE_FILTER_CSV));
break;
Expand Down
367 changes: 367 additions & 0 deletions src/org/ohdsi/rabbitInAHat/dataModel/CDMV6.0.csv

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/org/ohdsi/rabbitInAHat/dataModel/Database.java
Original file line number Diff line number Diff line change
Expand Up @@ -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"), CDMV531("CDMV5.3.1.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"), CDMV60("CDMV6.0.csv");

private final String fileName;

Expand Down
3 changes: 3 additions & 0 deletions src/org/ohdsi/rabbitInAHat/dataModel/StemTableAdd.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public static void addStemTable(ETL etl) {
} 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 if (targetDatabase.getDbName().toLowerCase().equals("cdmv6.0")) {
tableStream = StemTableAdd.class.getResourceAsStream("StemTableV6.0.csv");
mappingStream = StemTableAdd.class.getResourceAsStream("StemTableDefaultMappingV6.0.csv");
} else {
JOptionPane.showMessageDialog(null, "No stem table definition available for " + targetDatabase.getDbName(), "Error", JOptionPane.ERROR_MESSAGE);
return;
Expand Down
124 changes: 124 additions & 0 deletions src/org/ohdsi/rabbitInAHat/dataModel/StemTableDefaultMappingV6.0.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
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,VISIT_DETAIL_ID,CONDITION_OCCURRENCE,VISIT_DETAIL_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,VERBATIM_END_DATE,DRUG_EXPOSURE,VERBATIM_END_DATE
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,VISIT_DETAIL_ID,DRUG_EXPOSURE,VISIT_DETAIL_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,VISIT_DETAIL_ID,DEVICE_EXPOSURE,VISIT_DETAIL_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,VISIT_DETAIL_ID,MEASUREMENT,VISIT_DETAIL_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,VISIT_DETAIL_ID,OBSERVATION,VISIT_DETAIL_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,EVENT_ID,OBSERVATION,OBSERVATION_EVENT_ID
STEM_TABLE,EVENT_FIELD_CONCEPT_ID,OBSERVATION,OBS_EVENT_FIELD_CONCEPT_ID
STEM_TABLE,VALUE_AS_DATETIME,OBSERVATION,VALUE_AS_DATETIME
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,VISIT_DETAIL_ID,PROCEDURE_OCCURRENCE,VISIT_DETAIL_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
Loading

0 comments on commit 9b87e6e

Please sign in to comment.