From 5dc41d1cafcdb0c29c7aa2a9c901c6a387abdf46 Mon Sep 17 00:00:00 2001 From: schuemie Date: Tue, 11 Jun 2019 15:10:14 +0200 Subject: [PATCH] Adding field comments to markdown report. Fixes #157 --- .../ohdsi/rabbitInAHat/ETLMarkupDocumentGenerator.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rabbitinahat/src/main/java/org/ohdsi/rabbitInAHat/ETLMarkupDocumentGenerator.java b/rabbitinahat/src/main/java/org/ohdsi/rabbitInAHat/ETLMarkupDocumentGenerator.java index eb418fdb..48a4ab36 100644 --- a/rabbitinahat/src/main/java/org/ohdsi/rabbitInAHat/ETLMarkupDocumentGenerator.java +++ b/rabbitinahat/src/main/java/org/ohdsi/rabbitInAHat/ETLMarkupDocumentGenerator.java @@ -133,11 +133,20 @@ private void addTargetTableSection(Table targetTable) throws InvalidFormatExcept comment.append(fieldToFieldMap.getComment().trim()); } } + for (Field field : targetTable.getFields()) { + if (field.getName().equals(targetField.getName())) { + if (comment.length() != 0) + comment.append("\n"); + comment.append(field.getComment().trim()); + } + } row.add("Source field", source.toString().trim()); row.add("Logic", logic.toString().trim()); row.add("Comment field", comment.toString().trim()); rows.add(row); } + + document.addTable(rows); } }