Updates to spreadsheet generation
Added status code to results section
modified error handling
diff --git a/cda/plugins/org.eclipse.mdht.cda.xml.ui/src/org/eclipse/mdht/cda/xml/ui/handlers/GenerateCDADataHandler.java b/cda/plugins/org.eclipse.mdht.cda.xml.ui/src/org/eclipse/mdht/cda/xml/ui/handlers/GenerateCDADataHandler.java
index c08d8a0..fbd22ea 100644
--- a/cda/plugins/org.eclipse.mdht.cda.xml.ui/src/org/eclipse/mdht/cda/xml/ui/handlers/GenerateCDADataHandler.java
+++ b/cda/plugins/org.eclipse.mdht.cda.xml.ui/src/org/eclipse/mdht/cda/xml/ui/handlers/GenerateCDADataHandler.java
@@ -1561,14 +1561,16 @@
vr = new ValidationResult();
}
+ boolean loaded = false;
try {
clinicalDocument = CDAUtil.load(is, vr);
+ loaded = true;
} catch (Throwable e) {
ILog log = Activator.getDefault().getLog();
if (!omitValidation) {
try {
// attempt to load document with out validation
- clinicalDocument = CDAUtil.load(file.getContents());
+ clinicalDocument = CDAUtil.load(is);
// if we get here - we can load without validation. log initial error
log.log(
new Status(
@@ -1580,19 +1582,26 @@
new Status(
IStatus.ERROR, Activator.PLUGIN_ID, "XML Error loading " + file.getName(),
e));
- continue;
+ // continue;
}
} else {
// issue with XML skip
log.log(
new Status(
IStatus.ERROR, Activator.PLUGIN_ID, "XML Error loading " + file.getName(), e));
- continue;
+ // continue;
}
+ } finally {
+
}
console.println("End Load " + stopwatch.elapsed(TimeUnit.MILLISECONDS));
is.close();
+
+ if (!loaded) {
+ continue;
+ }
+
if (vr != null) {
if (!vr.getErrorDiagnostics().isEmpty()) {
for (Diagnostic diagnostic : vr.getErrorDiagnostics()) {
diff --git a/cda/plugins/org.eclipse.mdht.cda.xml.ui/src/org/eclipse/mdht/cda/xml/ui/handlers/SheetHeaderUtil.java b/cda/plugins/org.eclipse.mdht.cda.xml.ui/src/org/eclipse/mdht/cda/xml/ui/handlers/SheetHeaderUtil.java
index 7925784..75b2be1 100644
--- a/cda/plugins/org.eclipse.mdht.cda.xml.ui/src/org/eclipse/mdht/cda/xml/ui/handlers/SheetHeaderUtil.java
+++ b/cda/plugins/org.eclipse.mdht.cda.xml.ui/src/org/eclipse/mdht/cda/xml/ui/handlers/SheetHeaderUtil.java
@@ -53,7 +53,7 @@
/**
* @TODO
- * Added different columns and location for headers - make this user specified
+ * Added different columns and location for headers - make this user specified
* @param row2
* @param offset
* @return
@@ -175,6 +175,9 @@
row2.createCell(offset++).setCellValue(replaceSpace("Date"));
row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
+ row2.createCell(offset++).setCellValue(replaceSpace("Status"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
+ row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addCodeHeader(row2, offset, "Panel");
offset = addCodeHeader(row2, offset, "Specimen");
row2.createCell(offset++).setCellValue(replaceSpace("Organization"));
diff --git a/cda/plugins/org.eclipse.mdht.cda.xml.ui/src/org/eclipse/mdht/cda/xml/ui/handlers/SpreadsheetSerializer.java b/cda/plugins/org.eclipse.mdht.cda.xml.ui/src/org/eclipse/mdht/cda/xml/ui/handlers/SpreadsheetSerializer.java
index 28456e0..a6834a6 100644
--- a/cda/plugins/org.eclipse.mdht.cda.xml.ui/src/org/eclipse/mdht/cda/xml/ui/handlers/SpreadsheetSerializer.java
+++ b/cda/plugins/org.eclipse.mdht.cda.xml.ui/src/org/eclipse/mdht/cda/xml/ui/handlers/SpreadsheetSerializer.java
@@ -1340,6 +1340,15 @@
row.createCell(offset++).setCellValue(CDAUtil.getDomainPath(ivlts));
+ if (resultObservation.getStatusCode() != null &&
+ !StringUtils.isEmpty(resultObservation.getStatusCode().getCode())) {
+ row.createCell(offset++).setCellValue(resultObservation.getStatusCode().getCode());
+ row.createCell(offset++).setCellValue(CDAUtil.getDomainPath(resultObservation.getStatusCode()));
+ } else {
+ row.createCell(offset++).setCellValue("");
+ row.createCell(offset++).setCellValue("");
+ }
+
offset = SpreadsheetSerializer.appendCodeShowNullFlavor(
row, offset, resultObservation.getSection(), resultObservation.getCode(), resultObservation.getText());