Updates to spreadsheet
updates to payers
updated headers
diff --git a/cda/plugins/org.eclipse.mdht.cda.xml.ui/src/org/eclipse/mdht/cda/xml/ui/handlers/SectionSwitch.java b/cda/plugins/org.eclipse.mdht.cda.xml.ui/src/org/eclipse/mdht/cda/xml/ui/handlers/SectionSwitch.java
index 4fa1bf7..12ae92c 100644
--- a/cda/plugins/org.eclipse.mdht.cda.xml.ui/src/org/eclipse/mdht/cda/xml/ui/handlers/SectionSwitch.java
+++ b/cda/plugins/org.eclipse.mdht.cda.xml.ui/src/org/eclipse/mdht/cda/xml/ui/handlers/SectionSwitch.java
@@ -331,7 +331,7 @@
int offset = SheetHeaderUtil.createPatientHeader(row1, row2, 0);
offset = SheetHeaderUtil.createEncounterIDHeader(row1, row2, offset);
- offset = SheetHeaderUtil.createProblemHeader(row1, row2, offset);
+ offset = SheetHeaderUtil.createAdvanceDirectivesHeader(row1, row2, offset);
emptySectionOffset.put(sheet, offset);
}
@@ -363,7 +363,7 @@
int offset = SheetHeaderUtil.createPatientHeader(row1, row2, 0);
offset = SheetHeaderUtil.createEncounterIDHeader(row1, row2, offset);
- offset = SheetHeaderUtil.createAllergyHeader(row1, row2, offset);
+ offset = SheetHeaderUtil.createPayersHeader(row1, row2, offset);
emptySectionOffset.put(sheet, offset);
}
@@ -1382,7 +1382,7 @@
offset = SpreadsheetSerializer.serializeEnounterID(row, offset, sa, encounters);
- offset = SpreadsheetSerializer.serializeClinicalStatement(row, offset, sa);
+ offset = SpreadsheetSerializer.serializeCoverageActivity(row, offset, sa);
SpreadsheetSerializer.serializeSectionAndFileName(row, offset, sa.getSection(), fileName);
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 f764cbb..a2f1088 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
@@ -1,12 +1,3 @@
-/*******************************************************************************
- *
- * Copyright (c) 2018 michaelcgood
- * https://github.com/michaelcgood/HTML-to-Apache-POI-RichTextString/blob/master/LICENSE.
- *
- * Contributors:
- * michaelcgood - initial API and implementation
- *
- *******************************************************************************/
package org.eclipse.mdht.cda.xml.ui.handlers;
import org.apache.poi.ss.usermodel.Row;
@@ -19,22 +10,27 @@
static boolean hideColumns = false;
+ static String replaceSpace(String input) {
+ return input.replaceAll(" ", "_");
+ }
+
static int createAllergyHeader(Row row1, Row row2, int offset) {
// All Des Verify Date Event Type Reaction Severity Source
// int firstColumn = offset;
- // undo to go back to two rows for headers // undo to go back to two rows for headers row1.createCell(firstColumn).setCellValue("Allergy");
- row2.createCell(offset++).setCellValue("Allergy ID");
- row2.createCell(offset++).setCellValue("Status");
- row2.createCell(offset++).setCellValue("Verify Date");
- row2.createCell(offset++).setCellValue("Location");
+ // undo to go back to two rows for headers // undo to go back to two rows for headers
+ // row1.createCell(firstColumn).setCellValue(replaceSpace("Allergy"));
+ row2.createCell(offset++).setCellValue(replaceSpace(replaceSpace("Allergy ID")));
+ row2.createCell(offset++).setCellValue(replaceSpace("Status"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Verify Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
- row2.createCell(offset++).setCellValue("No Known Flag");
+ row2.createCell(offset++).setCellValue(replaceSpace("No Known Flag"));
offset = addCodeHeader(row2, offset, "Allergy ");
offset = addCodeHeader(row2, offset, "Substance ");
offset = addCodeHeader(row2, offset, "Reaction ");
offset = addCodeHeader(row2, offset, "Severity ");
- row2.createCell(offset++).setCellValue("Organization");
- row2.createCell(offset++).setCellValue("Author");
+ row2.createCell(offset++).setCellValue(replaceSpace("Organization"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Author"));
offset = addSectionHeader(row2, offset);
// undo to go back to two rows for headers // undo to go back to two rows for headers row1.getSheet().addMergedRegion(new CellRangeAddress(0,
// 0, firstColumn, offset));
@@ -43,14 +39,14 @@
}
static int createDemographicsHeader(Row row1, Row row2, int offset) {
- row2.createCell(offset++).setCellValue("Name");
- row2.createCell(offset++).setCellValue("Address");
+ row2.createCell(offset++).setCellValue(replaceSpace("Name"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Address"));
offset = addCodeHeader(row2, offset, "Race");
offset = addCodeHeader(row2, offset, "Ethnicity");
offset = addCodeHeader(row2, offset, "Gender");
offset = addCodeHeader(row2, offset, "Marital Status");
offset = addCodeHeader(row2, offset, "Langauge");
- row2.createCell(offset++).setCellValue("Telephone");
+ row2.createCell(offset++).setCellValue(replaceSpace("Telephone"));
return offset;
}
@@ -67,69 +63,69 @@
static int createDocumentMedadataHeadder(Row row2, int offset, boolean fileName) {
if (fileName) {
- row2.createCell(offset++).setCellValue("File Name");
- row2.createCell(offset++).setCellValue("Document ID");
+ row2.createCell(offset++).setCellValue(replaceSpace("File Name"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Document ID"));
}
- row2.createCell(offset++).setCellValue("CDA Specification");
- row2.createCell(offset++).setCellValue("CDA Document Type");
- row2.createCell(offset++).setCellValue("Organization");
- row2.createCell(offset++).setCellValue("Software");
- row2.createCell(offset++).setCellValue("Document Date");
- row2.createCell(offset++).setCellValue("PCP Name");
- row2.createCell(offset++).setCellValue("PCP Address");
+ row2.createCell(offset++).setCellValue(replaceSpace("CDA Specification"));
+ row2.createCell(offset++).setCellValue(replaceSpace("CDA Document Type"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Organization"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Software"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Document Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("PCP Name"));
+ row2.createCell(offset++).setCellValue(replaceSpace("PCP Address"));
return offset;
}
static int createEncounterHeader(Row row1, Row row2, int offset) {
- row2.createCell(offset++).setCellValue("ID");
- row2.createCell(offset++).setCellValue("Date");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addCodeHeader(row2, offset, "Encounter");
- row2.createCell(offset++).setCellValue("Organization");
- row2.createCell(offset++).setCellValue("Author");
+ row2.createCell(offset++).setCellValue(replaceSpace("Organization"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Author"));
offset = addSectionHeader(row2, offset);
return offset;
}
static int createEncounterIDHeader(Row row1, Row row2, int offset) {
- row2.createCell(offset++).setCellValue("Encounter ID");
- row2.createCell(offset++).setCellValue("Encounter Match");
+ row2.createCell(offset++).setCellValue(replaceSpace("Encounter ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Encounter Match"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
return offset;
}
static int createPatientHeader(Row row1, Row row2, int offset) {
- row2.createCell(offset++).setCellValue("Record");
- row2.createCell(offset++).setCellValue("File Name");
- row2.createCell(offset++).setCellValue("Document ID");
- row2.createCell(offset++).setCellValue("Patient ID");
+ row2.createCell(offset++).setCellValue(replaceSpace("Record"));
+ row2.createCell(offset++).setCellValue(replaceSpace("File Name"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Document ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Patient ID"));
if (!GenerateCDADataHandler.omitDOB) {
- row2.createCell(offset++).setCellValue("Complete ID");
- row2.createCell(offset++).setCellValue("Patient Name");
+ row2.createCell(offset++).setCellValue(replaceSpace("Complete ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Patient Name"));
if (!"Documents".equals(row2.getSheet().getSheetName())) {
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
}
- row2.createCell(offset++).setCellValue("DOB");
+ row2.createCell(offset++).setCellValue(replaceSpace("DOB"));
}
offset = createDocumentMedadataHeadder(row2, offset, false);
return offset;
}
static int createPatientHeader2(Row row1, Row row2, int offset) {
- row2.createCell(offset++).setCellValue("Recipient Name");
- row2.createCell(offset++).setCellValue("Recipient Organization");
- row2.createCell(offset++).setCellValue("Order Id");
- row2.createCell(offset++).setCellValue("File Name");
+ row2.createCell(offset++).setCellValue(replaceSpace("Recipient Name"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Recipient Organization"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Order Id"));
+ row2.createCell(offset++).setCellValue(replaceSpace("File Name"));
return offset;
}
static int createProblemHeader(Row row1, Row row2, int offset) {
- row2.createCell(offset++).setCellValue("ID");
- row2.createCell(offset++).setCellValue("Date");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addCodeHeader(row2, offset, "Problem");
offset = createProblemObservationHeader(row1, row2, offset);
@@ -138,13 +134,13 @@
}
static int createProblemObservationHeader(Row row1, Row row2, int offset) {
- row2.createCell(offset++).setCellValue("ID");
- row2.createCell(offset++).setCellValue("Date");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addCodeHeader(row2, offset, "Problem");
- row2.createCell(offset++).setCellValue("Organization");
- row2.createCell(offset++).setCellValue("Author");
+ row2.createCell(offset++).setCellValue(replaceSpace("Organization"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Author"));
offset = addSectionHeader(row2, offset);
return offset;
@@ -156,146 +152,133 @@
* @param offset
*/
static int createProcedureHeader(Row row1, Row row2, int offset) {
- row2.createCell(offset++).setCellValue("ID");
- row2.createCell(offset++).setCellValue("Date");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addCodeHeader(row2, offset, "Procedure");
- row2.createCell(offset++).setCellValue("Performer");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Performer"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
- row2.createCell(offset++).setCellValue("Organization");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Organization"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
- row2.createCell(offset++).setCellValue("Section Title");
- row2.createCell(offset++).setCellValue("File Name");
+ row2.createCell(offset++).setCellValue(replaceSpace("Section Title"));
+ row2.createCell(offset++).setCellValue(replaceSpace("File Name"));
return offset;
}
static int createResultsHeader(Row row1, Row row2, int offset) {
- row2.createCell(offset++).setCellValue("Panel ID");
- row2.createCell(offset++).setCellValue("Date");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Panel ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ 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("Organization");
- row2.createCell(offset++).setCellValue("Author");
- row2.createCell(offset++).setCellValue("ID");
- row2.createCell(offset++).setCellValue("Date");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Organization"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Author"));
+ row2.createCell(offset++).setCellValue(replaceSpace("ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addCodeHeader(row2, offset, "Test");
- row2.createCell(offset++).setCellValue("Result");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Result"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
- row2.createCell(offset++).setCellValue("Range");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Range"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addSectionHeader(row2, offset);
return offset;
}
static int createSocialHistoryHeader(Row row1, Row row2, int offset) {
- row2.createCell(offset++).setCellValue("ID");
- row2.createCell(offset++).setCellValue("Date");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addCodeHeader(row2, offset, "Observation");
- row2.createCell(offset++).setCellValue("Value");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Value"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
+ row2.getSheet().setColumnHidden(offset - 1, hideColumns);
+ offset = addSectionHeader(row2, offset);
+ return offset;
+ }
+
+ static int createAdvanceDirectivesHeader(Row row1, Row row2, int offset) {
+ row2.createCell(offset++).setCellValue(replaceSpace("ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
+ row2.getSheet().setColumnHidden(offset - 1, hideColumns);
+ offset = addCodeHeader(row2, offset, "Advance Directive");
+ row2.createCell(offset++).setCellValue(replaceSpace("Value"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addSectionHeader(row2, offset);
return offset;
}
static int createSubstanceAdministrationHeader(Row row1, Row row2, int offset, String type) {
- row2.createCell(offset++).setCellValue("ID");
+ row2.createCell(offset++).setCellValue(replaceSpace("ID"));
offset = addCodeHeader(row2, offset, type);
- row2.createCell(offset++).setCellValue("Status");
- row2.createCell(offset++).setCellValue("Quantity");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Status"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Quantity"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
- row2.createCell(offset++).setCellValue("Expiration");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Expiration"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
- row2.createCell(offset++).setCellValue("Prescription");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Prescription"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
- row2.createCell(offset++).setCellValue("Organization");
- row2.createCell(offset++).setCellValue("Author");
+ row2.createCell(offset++).setCellValue(replaceSpace("Organization"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Author"));
offset = addSectionHeader(row2, offset);
return offset;
}
- // static void appendToSubstanceAdministrationSheet(Query query, Sheet sheet, DocumentMetadata organizationAndSoftware,
- // PatientRole patientRole, ServiceEvent serviceEvent, List<Encounter> encounters, String fileName) {
- //
- // // Because we were getting class cast exception - copy results to EList
- // EList<SubstanceAdministration> elist = new BasicEList<SubstanceAdministration>();
- //
- // elist.addAll(query.getEObjects(org.openhealthtools.mdht.uml.cda.consol.MedicationActivity.class));
- //
- // appendToSubstanceAdministrationSheet(
- // query, sheet, organizationAndSoftware, patientRole, serviceEvent, encounters, elist, fileName);
- //
- // }
-
static int addCodeHeader(Row row1, int offset, String prefix) {
- row1.createCell(offset++).setCellValue(prefix + " Text");
- row1.createCell(offset++).setCellValue(prefix + " Display Name");
- row1.createCell(offset++).setCellValue(prefix + " Code");
+ row1.createCell(offset++).setCellValue(replaceSpace(prefix + " Text"));
+ row1.createCell(offset++).setCellValue(replaceSpace(prefix + " Display Name"));
+ row1.createCell(offset++).setCellValue(replaceSpace(prefix + " Code"));
row1.getSheet().setColumnHidden(offset - 1, hideColumns);
- row1.createCell(offset++).setCellValue(prefix + " Code System");
+ row1.createCell(offset++).setCellValue(replaceSpace(prefix + " Code System"));
row1.getSheet().setColumnHidden(offset - 1, hideColumns);
- row1.createCell(offset++).setCellValue(prefix + " Code System Name");
+ row1.createCell(offset++).setCellValue(replaceSpace(prefix + " Code System Name"));
row1.getSheet().setColumnHidden(offset - 1, hideColumns);
- row1.createCell(offset++).setCellValue(prefix + " Location");
+ row1.createCell(offset++).setCellValue(replaceSpace(prefix + " Location"));
row1.getSheet().setColumnHidden(offset - 1, hideColumns);
return offset;
}
- // static int addCodeHeader2(Row row1, int offset, String prefix) {
- // row1.createCell(offset++).setCellValue(prefix + " Text");
- // row1.createCell(offset++).setCellValue("Code");
- // row1.getSheet().setColumnHidden(offset - 1, hideColumns);
- // row1.createCell(offset++).setCellValue("Code System");
- // row1.getSheet().setColumnHidden(offset - 1, hideColumns);
- // row1.createCell(offset++).setCellValue("Code System Name");
- // row1.getSheet().setColumnHidden(offset - 1, hideColumns);
- // row1.createCell(offset++).setCellValue("Location");
- // row1.getSheet().setColumnHidden(offset - 1, hideColumns);
- // return offset;
- // }
-
static int addSectionHeader(Row row1, int offset) {
- row1.createCell(offset++).setCellValue("Section Title");
- row1.createCell(offset++).setCellValue("File Name");
- row1.createCell(offset++).setCellValue("Narrative");
+ row1.createCell(offset++).setCellValue(replaceSpace("Section Title"));
+ row1.createCell(offset++).setCellValue(replaceSpace("File Name"));
+ row1.createCell(offset++).setCellValue(replaceSpace("Narrative"));
return offset;
}
public static int createCarePlanHeader(Row row1, Row row2, int offset) {
- row2.createCell(offset++).setCellValue("Panel ID");
- row2.createCell(offset++).setCellValue("Date");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Panel ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addCodeHeader(row2, offset, "Panel");
- row2.createCell(offset++).setCellValue("Organization");
- row2.createCell(offset++).setCellValue("Author");
- row2.createCell(offset++).setCellValue("Vital Sign ID");
- row2.createCell(offset++).setCellValue("Date");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Organization"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Author"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Vital Sign ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addCodeHeader(row2, offset, "Vital Sign");
- row2.createCell(offset++).setCellValue("Result");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Result"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
- row2.createCell(offset++).setCellValue("Range");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Range"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addSectionHeader(row2, offset);
return offset;
@@ -309,29 +292,29 @@
* @return
*/
public static int createClinicalStatmentHeader(Row row1, Row row2, int offset) {
- row2.createCell(offset++).setCellValue("ID");
- row2.createCell(offset++).setCellValue("Date");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addCodeHeader(row2, offset, "Code");
- row2.createCell(offset++).setCellValue("Performer");
- row2.createCell(offset++).setCellValue("Organization");
- row2.createCell(offset++).setCellValue("Section Title");
- row2.createCell(offset++).setCellValue("File Name");
+ row2.createCell(offset++).setCellValue(replaceSpace("Performer"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Organization"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Section Title"));
+ row2.createCell(offset++).setCellValue(replaceSpace("File Name"));
return offset;
}
public static int createFamilyHistoryHeader(Row row1, Row row2, int offset) {
- row2.createCell(offset++).setCellValue("Organizer ID");
- row2.createCell(offset++).setCellValue("Date");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Organizer ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addCodeHeader(row2, offset, "Description");
- row2.createCell(offset++).setCellValue("Organization");
- row2.createCell(offset++).setCellValue("Author");
- row2.createCell(offset++).setCellValue("Observation ID");
- row2.createCell(offset++).setCellValue("Date");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Organization"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Author"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Observation ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addCodeHeader(row2, offset, "Value");
offset = addSectionHeader(row2, offset);
@@ -339,14 +322,14 @@
}
public static int createGoalsSectionHeader(Row row1, Row row2, int offset) {
- // row2.createCell(offset++).setCellValue("Organizer ID");
- // row2.createCell(offset++).setCellValue("Date");
+ // row2.createCell(offset++).setCellValue(replaceSpace("Organizer ID"));
+ // row2.createCell(offset++).setCellValue(replaceSpace("Date"));
offset = addCodeHeader(row2, offset, "Description");
- row2.createCell(offset++).setCellValue("Organization");
- row2.createCell(offset++).setCellValue("Author");
- row2.createCell(offset++).setCellValue("Observation ID");
- row2.createCell(offset++).setCellValue("Date");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Organization"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Author"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Observation ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addCodeHeader(row2, offset, "Value");
offset = addSectionHeader(row2, offset);
@@ -360,23 +343,23 @@
*/
public static int createVitalSignsHeader(Row row1, Row row2, int offset) {
- row2.createCell(offset++).setCellValue("Panel ID");
- row2.createCell(offset++).setCellValue("Date");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Panel ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addCodeHeader(row2, offset, "Panel");
- row2.createCell(offset++).setCellValue("Organization");
- row2.createCell(offset++).setCellValue("Author");
- row2.createCell(offset++).setCellValue("Vital Sign ID");
- row2.createCell(offset++).setCellValue("Date");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Organization"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Author"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Vital Sign ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addCodeHeader(row2, offset, "Vital Sign");
- row2.createCell(offset++).setCellValue("Result");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Result"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
- row2.createCell(offset++).setCellValue("Range");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Range"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addSectionHeader(row2, offset);
return offset;
@@ -390,16 +373,16 @@
* @return
*/
public static int createPlanOfCareActivityObservationHeader(Row row1, Row row2, int offset) {
- row2.createCell(offset++).setCellValue("ID");
- row2.createCell(offset++).setCellValue("Date");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addCodeHeader(row2, offset, "Observation");
- row2.createCell(offset++).setCellValue("Value");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Value"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
- row2.createCell(offset++).setCellValue("Range");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("Range"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addSectionHeader(row2, offset);
return offset;
@@ -412,15 +395,15 @@
* @return
*/
public static int createInstructionsHeader(Row row1, Row row2, int offset) {
- row2.createCell(offset++).setCellValue("ID");
- row2.createCell(offset++).setCellValue("Date");
- row2.createCell(offset++).setCellValue("Location");
+ row2.createCell(offset++).setCellValue(replaceSpace("ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
row2.getSheet().setColumnHidden(offset - 1, hideColumns);
offset = addCodeHeader(row2, offset, "Code");
- row2.createCell(offset++).setCellValue("Performer");
- row2.createCell(offset++).setCellValue("Organization");
- row2.createCell(offset++).setCellValue("Section Title");
- row2.createCell(offset++).setCellValue("File Name");
+ row2.createCell(offset++).setCellValue(replaceSpace("Performer"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Organization"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Section Title"));
+ row2.createCell(offset++).setCellValue(replaceSpace("File Name"));
return offset;
}
@@ -431,9 +414,33 @@
* @return
*/
public static int createNarrativeHeader(Row row1, Row row2, int offset) {
- row2.createCell(offset++).setCellValue("Narrative");
- row2.createCell(offset++).setCellValue("Section Title");
- row2.createCell(offset++).setCellValue("File Name");
+ row2.createCell(offset++).setCellValue(replaceSpace("Narrative"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Section Title"));
+ row2.createCell(offset++).setCellValue(replaceSpace("File Name"));
+ return offset;
+ }
+
+ /**
+ * @param row1
+ * @param row2
+ * @param offset
+ * @return
+ */
+ public static int createPayersHeader(Row row1, Row row2, int offset) {
+ row2.createCell(offset++).setCellValue(replaceSpace("ID"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Date"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Location"));
+ offset = addCodeHeader(row2, offset, "Policy Activity");
+ row2.createCell(offset++).setCellValue(replaceSpace("Organization"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Author"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Payer Name"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Payer Organization"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Guarantor Name"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Guarantor Organization"));
+ row2.createCell(offset++).setCellValue(replaceSpace("Coverage Name"));
+ offset = addCodeHeader(row2, offset, "Coverage Relationship");
+ row2.createCell(offset++).setCellValue(replaceSpace("Holder Name"));
+ offset = addSectionHeader(row2, offset);
return offset;
}
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 dad2f91..9442637 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
@@ -44,6 +44,7 @@
import org.eclipse.mdht.uml.cda.Observation;
import org.eclipse.mdht.uml.cda.Organization;
import org.eclipse.mdht.uml.cda.Organizer;
+import org.eclipse.mdht.uml.cda.Participant2;
import org.eclipse.mdht.uml.cda.Patient;
import org.eclipse.mdht.uml.cda.PatientRole;
import org.eclipse.mdht.uml.cda.Performer1;
@@ -69,7 +70,9 @@
import org.eclipse.mdht.uml.hl7.datatypes.ON;
import org.eclipse.mdht.uml.hl7.datatypes.PN;
import org.eclipse.mdht.uml.hl7.datatypes.SXCM_TS;
+import org.openhealthtools.mdht.uml.cda.consol.CoverageActivity;
import org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints;
+import org.openhealthtools.mdht.uml.cda.consol.PolicyActivity;
/**
* @author seanmuir
@@ -79,7 +82,7 @@
/**
* @param query
- * @param demographicsSheet
+ * @param demographicsShe
* @param patientRole
* @param ir
* @param iffo
@@ -2082,4 +2085,210 @@
}
+ /**
+ * @param row
+ * @param offset
+ * @param sa
+ * @return
+ */
+ public static int serializeCoverageActivity(Row row, int offset, CoverageActivity coverageActivity) {
+
+ for (PolicyActivity policyActivity : coverageActivity.getPolicyActivities()) {
+
+ StringBuffer sb = new StringBuffer();
+
+ for (II ii : policyActivity.getIds()) {
+ sb.append(CDAValueUtil.getKey2(ii));
+ }
+
+ row.createCell(offset++).setCellValue(sb.toString());
+
+ Date d = CDAValueUtil.getDate(CDAValueUtil.getValueAsString(policyActivity.getEffectiveTime()));
+ if (d != null) {
+
+ row.createCell(offset++).setCellValue(CDAValueUtil.DATE_PRETTY.format(d));
+ row.createCell(offset++).setCellValue(CDAUtil.getDomainPath(policyActivity.getEffectiveTime()));
+ } else {
+ row.createCell(offset++).setCellValue("");
+ row.createCell(offset++).setCellValue("");
+ }
+
+ offset = SpreadsheetSerializer.appendCode(
+ row, offset, coverageActivity.getSection(), policyActivity.getCode(), policyActivity.getText());
+
+ offset = SpreadsheetSerializer.appendOrganizationAndAuthor(row, offset, policyActivity.getAuthors());
+
+ String payerorganizationValue = "";
+ String payerpersonValue = "";
+
+ String guarantororganizationvalue = "";
+ String guarantorpersonValue = "";
+ String coverageorganizationvalue = "";
+ String coveragepersonValue = "";
+ CD coverageRelationshipCode = null;
+
+ // String holderorganizationvalue = "";
+ String holderpersonValue = "";
+ // CD holderRelationshipCode = null;
+
+ for (Performer2 performer : policyActivity.getPerformers()) {
+ for (II ii : performer.getTemplateIds()) {
+
+ // Payer Template Id
+ if ("2.16.840.1.113883.10.20.22.4.87".equals(ii.getRoot())) {
+ // for (Performer2 performer : act.getPerformers()) {
+
+ if (performer.getAssignedEntity() != null) {
+ for (Organization organization : performer.getAssignedEntity().getRepresentedOrganizations()) {
+ for (ON on : organization.getNames()) {
+ payerorganizationValue = payerorganizationValue + CDAValueUtil.getValues(on);
+ }
+ }
+ if (performer.getAssignedEntity().getAssignedPerson() != null) {
+ for (PN pn : performer.getAssignedEntity().getAssignedPerson().getNames()) {
+ payerpersonValue = CDAValueUtil.getValues(pn);
+ }
+ }
+ }
+ break;
+ }
+
+ // Guarantor Template Id
+ if ("2.16.840.1.113883.10.20.22.4.88".equals(ii.getRoot())) {
+
+ if (performer.getAssignedEntity() != null) {
+ for (Organization organization : performer.getAssignedEntity().getRepresentedOrganizations()) {
+ for (ON on : organization.getNames()) {
+ guarantororganizationvalue = guarantororganizationvalue +
+ CDAValueUtil.getValues(on);
+ }
+ }
+ if (performer.getAssignedEntity().getAssignedPerson() != null) {
+ for (PN pn : performer.getAssignedEntity().getAssignedPerson().getNames()) {
+ guarantorpersonValue = CDAValueUtil.getValues(pn);
+ }
+ }
+ }
+ break;
+ }
+
+ //
+ // if ("2.16.840.1.113883.10.20.22.4.89".equals(ii.getRoot())) {
+ //
+ // if (performer.getAssignedEntity() != null) {
+ // for (Organization organization : performer.getAssignedEntity().getRepresentedOrganizations()) {
+ // for (ON on : organization.getNames()) {
+ // coverageorganizationvalue = coverageorganizationvalue + CDAValueUtil.getValues(on);
+ // }
+ // }
+ // if (performer.getAssignedEntity().getAssignedPerson() != null) {
+ // for (PN pn : performer.getAssignedEntity().getAssignedPerson().getNames()) {
+ // coveragepersonValue = CDAValueUtil.getValues(pn);
+ // }
+ // }
+ // }
+ // }
+ // if ("2.16.840.1.113883.10.20.22.4.90".equals(ii.getRoot())) {
+ //
+ // if (performer.getAssignedEntity() != null) {
+ // for (Organization organization : performer.getAssignedEntity().getRepresentedOrganizations()) {
+ // for (ON on : organization.getNames()) {
+ // holderorganizationvalue = holderorganizationvalue + CDAValueUtil.getValues(on);
+ // }
+ // }
+ // if (performer.getAssignedEntity().getAssignedPerson() != null) {
+ // for (PN pn : performer.getAssignedEntity().getAssignedPerson().getNames()) {
+ // holderpersonValue = CDAValueUtil.getValues(pn);
+ // }
+ // }
+ // }
+ // }
+
+ }
+ }
+
+ for (Participant2 participant : policyActivity.getParticipants()) {
+ for (II ii : participant.getTemplateIds()) {
+
+ if ("2.16.840.1.113883.10.20.22.4.89".equals(ii.getRoot())) {
+
+ if (participant.getParticipantRole() != null &&
+ participant.getParticipantRole().getPlayingEntity() != null) {
+
+ coverageRelationshipCode = participant.getParticipantRole().getCode();
+ if (participant.getParticipantRole().getPlayingEntity() != null) {
+ for (PN pn : participant.getParticipantRole().getPlayingEntity().getNames()) {
+ coveragepersonValue = CDAValueUtil.getValues(pn);
+ }
+ }
+ }
+ break;
+ }
+
+ if ("2.16.840.1.113883.10.20.22.4.90".equals(ii.getRoot())) {
+
+ if (participant.getParticipantRole() != null &&
+ participant.getParticipantRole().getPlayingEntity() != null) {
+
+ // holderRelationshipCode = participant.getParticipantRole().getCode();
+ if (participant.getParticipantRole().getPlayingEntity() != null) {
+ for (PN pn : participant.getParticipantRole().getPlayingEntity().getNames()) {
+ holderpersonValue = CDAValueUtil.getValues(pn);
+ }
+ }
+ }
+ break;
+ }
+
+ // if ("2.16.840.1.113883.10.20.22.4.90".equals(ii.getRoot())) {
+ //
+ // if (performer.getAssignedEntity() != null) {
+ // for (Organization organization : performer.getAssignedEntity().getRepresentedOrganizations()) {
+ // for (ON on : organization.getNames()) {
+ // holderorganizationvalue = holderorganizationvalue + CDAValueUtil.getValues(on);
+ // }
+ // }
+ // if (performer.getAssignedEntity().getAssignedPerson() != null) {
+ // for (PN pn : performer.getAssignedEntity().getAssignedPerson().getNames()) {
+ // holderpersonValue = CDAValueUtil.getValues(pn);
+ // }
+ // }
+ // }
+ // }
+
+ }
+ }
+
+ row.createCell(offset++).setCellValue(payerpersonValue);
+ row.createCell(offset++).setCellValue(payerorganizationValue);
+
+ row.createCell(offset++).setCellValue(guarantorpersonValue);
+ row.createCell(offset++).setCellValue(guarantororganizationvalue);
+
+ row.createCell(offset++).setCellValue(coveragepersonValue);
+ // row.createCell(offset++).setCellValue(coverageorganizationvalue);
+
+ offset = SpreadsheetSerializer.appendCode(
+ row, offset, coverageActivity.getSection(), coverageRelationshipCode, null);
+
+ row.createCell(offset++).setCellValue(holderpersonValue);
+ // row.createCell(offset++).setCellValue(holderorganizationvalue);
+
+ }
+
+ // for (Participant2 participant : coverageActivity.getParticipants()) {
+ // // if (participant instanceof ) {
+ // //
+ // // }
+ //
+ // }
+ //
+ // for (Performer2 performer : coverageActivity.getPerformers()) {
+ //
+ // }
+
+ // TODO Auto-generated method stub
+ return offset;
+ }
+
}