Skip to content

Commit ea40fa8

Browse files
committed
fix: allow guideline import without PMID
- some new guidelines getting added to the DB don't have a PMID assigned yet
1 parent e1da869 commit ea40fa8

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/main/java/org/cpicpgx/importer/GuidelineImporter.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ void processWorkbook(WorkbookWrapper workbook) throws Exception {
6262
);
6363

6464
db.updateDrugs(url, parseArray(row.getText(GuidelineWorkbook.IDX_DRUGS)));
65-
db.updateLits(url, parseArray(row.getText(GuidelineWorkbook.IDX_PMIDS)));
65+
66+
String pmids = row.getNullableText(GuidelineWorkbook.IDX_PMIDS);
67+
if (pmids == null) {
68+
sf_logger.warn("No PMID specified for row {}", i + 1);
69+
}
70+
db.updateLits(url, parseArray(pmids));
6671
}
6772
db.cleanup();
6873
}
@@ -144,7 +149,7 @@ void updateLits(String url, String[] pmids) throws SQLException {
144149
}
145150

146151
void cleanup() {
147-
if (existingGuidelineMap.size() > 0) {
152+
if (!existingGuidelineMap.isEmpty()) {
148153
for (String key : existingGuidelineMap.keySet()) {
149154
sf_logger.warn("Existing guideline [{}] not covered in imported file, missing data?", existingGuidelineMap.get(key));
150155
}

0 commit comments

Comments
 (0)