DM-578 - Implement new excel report for documine

This commit is contained in:
Andrei Isvoran 2023-11-16 14:02:38 +01:00
parent 06db0c5393
commit 8d1d68b293
13 changed files with 8045 additions and 111 deletions

View File

@ -28,7 +28,7 @@ public class ExcelModel {
private boolean rssPlaceholdersPresent;
private boolean placeholderInFirstRow;
private boolean firstRowWritten;
private boolean scmFunctionPlaceholderPresent;
private boolean skippedPlaceholderPresent;
private boolean fileAttributesPlaceholderPresent;
}

View File

@ -0,0 +1,15 @@
package com.iqser.red.service.redaction.report.v1.server.model;
import org.apache.poi.ss.usermodel.Cell;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class FileAttributeModel {
private String id;
private Cell cell;
}

View File

@ -1,81 +0,0 @@
package com.iqser.red.service.redaction.report.v1.server.service;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.springframework.stereotype.Service;
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.componentlog.ComponentLog;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.FileAttributeConfig;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.FileModel;
import com.iqser.red.service.redaction.report.v1.server.client.ComponentClient;
import com.iqser.red.service.redaction.report.v1.server.client.FileAttributesConfigClient;
import com.iqser.red.service.redaction.report.v1.server.model.ExcelModel;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
@Service
@RequiredArgsConstructor
@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
public class ComponentRowsReportService {
ComponentClient componentResource;
FileAttributesConfigClient fileAttributesClient;
@SuppressWarnings("checkstyle:all")
static int COMPONENT_NAME_COL = 0;
static int COMPONENT_VALUE_STARTING_COL = 1;
public void addComponentRows(Sheet sheet, FileModel fileModel, ExcelModel excelModel) {
ComponentLog componentLog = componentResource.getComponentLog(fileModel.getDossierId(), fileModel.getId(), true);
AtomicInteger rowIndex = new AtomicInteger(excelModel.getRedactionPlaceholderRow());
String oecd = getOecdNumber(fileModel);
componentLog.getComponentLogEntries().forEach(componentLogEntry -> {
if (componentLogEntry.getComponentValues().isEmpty()) {
return;
}
int componentRowIdx = rowIndex.getAndIncrement();
Row componentRow = sheet.createRow(componentRowIdx);
excelModel.getWrittenRows().add(componentRowIdx);
Cell componentNameCell = componentRow.createCell(COMPONENT_NAME_COL);
componentNameCell.setCellValue(oecd + "-" + componentLogEntry.getName().replaceAll("_", " "));
for (int valueIdx = 0; valueIdx < componentLogEntry.getComponentValues().size(); valueIdx++) {
String value = componentLogEntry.getComponentValues().get(valueIdx).getValue();
componentRow.createCell(COMPONENT_VALUE_STARTING_COL + valueIdx).setCellValue(value);
}
});
sheet.createRow(rowIndex.get());
excelModel.getWrittenRows().add(rowIndex.get());
excelModel.setRedactionPlaceholderRow(rowIndex.getAndIncrement());
}
private String getOecdNumber(FileModel file) {
return fileAttributesClient.getFileAttributeConfigs(file.getDossierTemplateId())
.stream()
.filter(f -> f.getLabel().equals("OECD Number"))
.map(FileAttributeConfig::getId)
.findFirst()
.map(oecd -> file.getFileAttributes().get(oecd))
.orElse(null);
}
}

View File

@ -1,8 +1,10 @@
package com.iqser.red.service.redaction.report.v1.server.service;
import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.COMPONENT_PLACEHOLDER;
import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.DOSSIER_ATTRIBUTE_PLACEHOLDER_BASE;
import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.DOSSIER_NAME_PLACEHOLDER;
import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.EXCERPT_PLACEHOLDER;
import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.FILE_ATTRIBUTES_PLACEHOLDER;
import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.FILE_ATTRIBUTE_PLACEHOLDER_BASE;
import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.FILE_NAME_PLACEHOLDER;
import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.FORMAT_DATE_ENG;
@ -13,6 +15,7 @@ import static com.iqser.red.service.redaction.report.v1.server.service.Placehold
import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.FORMAT_DATE_ISO_PLACEHOLDER;
import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.FORMAT_TIME_ISO;
import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.FORMAT_TIME_ISO_PLACEHOLDER;
import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.INDEX_PLACEHOLDER;
import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.JUSTIFICATION_LEGAL_BASIS_PLACEHOLDER;
import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.JUSTIFICATION_PARAGRAPH_PLACEHOLDER;
import static com.iqser.red.service.redaction.report.v1.server.service.PlaceholderService.JUSTIFICATION_PLACEHOLDER;
@ -52,13 +55,16 @@ import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.ClientAnchor;
import org.apache.poi.ss.usermodel.CreationHelper;
import org.apache.poi.ss.usermodel.Drawing;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.Picture;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.springframework.stereotype.Service;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.FileAttributeConfig;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.FileModel;
import com.iqser.red.service.redaction.report.v1.server.client.FileAttributesConfigClient;
import com.iqser.red.service.redaction.report.v1.server.model.CellIdentifier;
import com.iqser.red.service.redaction.report.v1.server.model.ExcelModel;
import com.iqser.red.service.redaction.report.v1.server.model.ImagePlaceholder;
@ -92,9 +98,13 @@ public class ExcelReportGenerationService {
SEEDS_FUNCTION_JUSTIFICATION_PLACEHOLDER,
REDACTION_ENTITY_DISPLAY_NAME_PLACEHOLDER,
SCM_FUNCTION_PLACEHOLDER,
SKIPPED_PLACEHOLDER);
private final ComponentRowsReportService componentRowsReportService;
SKIPPED_PLACEHOLDER,
FILE_ATTRIBUTES_PLACEHOLDER,
INDEX_PLACEHOLDER,
COMPONENT_PLACEHOLDER);
private final ScmReportService componentReportService;
private final FileAttributesConfigClient fileAttributesConfigClient;
@Timed("redactmanager_generateExcelReport")
@ -137,12 +147,12 @@ public class ExcelReportGenerationService {
}
}
if (!excelModel.isRssPlaceholdersPresent() && !excelModel.isScmFunctionPlaceholderPresent()) {
if (!excelModel.isRssPlaceholdersPresent() && !excelModel.isFileAttributesPlaceholderPresent()) {
addRedactionEntryRows(sheet, reportEntries, fileModel.getFilename(), excelModel, placeholderModel);
}
if (excelModel.isScmFunctionPlaceholderPresent()) {
componentRowsReportService.addComponentRows(sheet, fileModel, excelModel);
if (excelModel.isFileAttributesPlaceholderPresent()) {
componentReportService.addScmRows(sheet, fileModel, excelModel);
}
if (isLastFile) {
@ -228,7 +238,7 @@ public class ExcelReportGenerationService {
excelModel.getWrittenRows().add(rowIndex.get());
for (Map.Entry<Integer, Function<PlaceholderInput, String>> entry1 : placeholderCellPos.entrySet()) {
Cell cell = sheet.getRow(rowIndex.get()).createCell(entry1.getKey());
cell.setCellValue(entry1.getValue().apply(new PlaceholderInput(filename, entry, placeholderModel, null)));
cell.setCellValue(entry1.getValue().apply(new PlaceholderInput(filename, entry, placeholderModel, null)) == null ? "" : entry1.getValue().apply(new PlaceholderInput(filename, entry, placeholderModel, null)));
}
rowIndex.getAndIncrement();
});
@ -360,25 +370,32 @@ public class ExcelReportGenerationService {
@Timed("redactmanager_calculateExcelModel")
public ExcelModel calculateExcelModel(Sheet sheet) {
@SuppressWarnings("checkstyle:all")
public ExcelModel calculateExcelModel(Sheet sheet, String dossierTemplateId) {
long start = System.currentTimeMillis();
Map<Integer, Function<PlaceholderInput, String>> placeholderCellPos = new HashMap<>();
Map<Integer, Integer> columnWidths = new HashMap<>();
Map<CellIdentifier, Cell> cellsToCopyBeforePlaceholderRow = new HashMap<>();
Map<CellIdentifier, Cell> cellsToCopyAfterPlaceholderRow = new HashMap<>();
Map<CellIdentifier, Cell> cellsToCopyInPlaceholderRow = new HashMap<>();
boolean hasRssPlaceHolders = false;
boolean hasScmFunctionPlaceholder = false;
boolean hasSkippedPlaceholder = false;
int placeholderRow = -1;
boolean placeholderInFirstRow = false;
boolean fileAttributesPlaceholder = false;
for (int j = 0; j < sheet.getLastRowNum() + 1; j++) {
Row actualRow = sheet.getRow(j);
if (actualRow != null) {
for (int i = 0; i < actualRow.getLastCellNum(); i++) {
int lastCellIndex = actualRow.getLastCellNum();
for (int i = 0; i < lastCellIndex; i++) {
Cell cell = sheet.getRow(j).getCell(i);
if (cell != null) {
boolean skipCopy = false;
int columnWidth = sheet.getColumnWidth(i);
columnWidths.put(i, columnWidth);
String cellStringValue = cell.getStringCellValue();
@ -391,22 +408,54 @@ public class ExcelReportGenerationService {
hasRssPlaceHolders = true;
}
if (cellStringValue.contains(SCM_FUNCTION_PLACEHOLDER)) {
hasScmFunctionPlaceholder = true;
if (cellStringValue.contains(FILE_ATTRIBUTES_PLACEHOLDER)) {
fileAttributesPlaceholder = true;
// For each file attribute we have to replace the column header with the corresponding file attribute.
List<FileAttributeConfig> fileAttributeConfigs = fileAttributesConfigClient.getFileAttributeConfigs(dossierTemplateId);
var iterator = fileAttributeConfigs.iterator();
while (iterator.hasNext()) {
cell = sheet.getRow(j).getCell(i);
// If there is more than one file attribute, starting from the 2nd one we won't find a cell in the given index so we have to create it.
if (cell == null) {
cell = sheet.getRow(j).createCell(i);
CellStyle cellStyle = sheet.getRow(j).getCell(i-1).getCellStyle();
cellStyle.setAlignment(HorizontalAlignment.CENTER);
cell.setCellStyle(cellStyle);
}
cell.setCellValue(iterator.next().getLabel());
cellsToCopyBeforePlaceholderRow.put(new CellIdentifier(j, i), cell);
// If there is more than one file attribute we have to insert a new column, so we shift all columns to the right by 1
// and increase the current and last cell index.
if (iterator.hasNext()) {
lastCellIndex += 1;
i += 1;
sheet.shiftColumns(i, lastCellIndex, 1);
}
}
skipCopy = true;
}
if (isRedactionPlaceholder(cellStringValue)) {
if (cellStringValue.equals(SKIPPED_PLACEHOLDER)) {
hasSkippedPlaceholder = true;
}
placeholderCellPos.put(i, getFunctionForPlaceHolder(cellStringValue));
placeholderRow = j;
cellsToCopyInPlaceholderRow.put(new CellIdentifier(j, i), cell);
} else {
if (placeholderRow == -1) {
cellsToCopyBeforePlaceholderRow.put(new CellIdentifier(j, i), cell);
if (!skipCopy) {
if (isRedactionPlaceholder(cellStringValue)) {
if (cellStringValue.equals(SKIPPED_PLACEHOLDER)) {
hasSkippedPlaceholder = true;
}
placeholderCellPos.put(i, getFunctionForPlaceHolder(cellStringValue));
placeholderRow = j;
cellsToCopyInPlaceholderRow.put(new CellIdentifier(j, i), cell);
} else {
cellsToCopyAfterPlaceholderRow.put(new CellIdentifier(j, i), cell);
if (placeholderRow == -1) {
cellsToCopyBeforePlaceholderRow.put(new CellIdentifier(j, i), cell);
} else {
cellsToCopyAfterPlaceholderRow.put(new CellIdentifier(j, i), cell);
}
}
}
}
@ -431,8 +480,8 @@ public class ExcelReportGenerationService {
hasRssPlaceHolders,
placeholderInFirstRow,
false,
hasScmFunctionPlaceholder,
hasSkippedPlaceholder);
hasSkippedPlaceholder,
fileAttributesPlaceholder);
}

View File

@ -53,6 +53,9 @@ public class PlaceholderService {
public static final String FILE_ATTRIBUTE_PLACEHOLDER_BASE = "{{file.attribute.";
public static final String DOSSIER_ATTRIBUTE_PLACEHOLDER_BASE = "{{dossier.attribute.";
public static final String RSS_PLACEHOLDER_BASE = "{{component.";
public static final String COMPONENT_PLACEHOLDER = "{{component}}";
public static final String FILE_ATTRIBUTES_PLACEHOLDER = "{{file.attributes}}";
public static final String INDEX_PLACEHOLDER = "{{index}}";
public static final DateTimeFormatter FORMAT_DATE_ISO = DateTimeFormatter.ofPattern("yyyy-MM-dd");
public static final DateTimeFormatter FORMAT_DATE_GER = DateTimeFormatter.ofPattern("dd.MM.yyyy");

View File

@ -136,7 +136,7 @@ public class ReportGenerationService {
writeWorkbook,
templateId,
reportTemplate.getFileName(),
excelTemplateReportGenerationService.calculateExcelModel(readWorkbook.getSheetAt(0)));
excelTemplateReportGenerationService.calculateExcelModel(readWorkbook.getSheetAt(0), reportMessage.getDossierTemplateId()));
reportTemplates.multiFileWorkbookReportTemplates.add(multiFileWorkbook);
} catch (IOException e) {
throw new RuntimeException("Could not generate multifile excel report.");
@ -257,7 +257,7 @@ public class ReportGenerationService {
for (Sheet sheet : readWorkbook) {
writeWorkbook.createSheet(sheet.getSheetName());
}
var excelModel = excelTemplateReportGenerationService.calculateExcelModel(readWorkbook.getSheetAt(0));
var excelModel = excelTemplateReportGenerationService.calculateExcelModel(readWorkbook.getSheetAt(0), dossier.getDossierTemplateId());
if (excelModel.isRssPlaceholdersPresent()) {
generatePlaceholderService.resolveRssValues(fileStatus, placeholderModel);
}

View File

@ -0,0 +1,201 @@
package com.iqser.red.service.redaction.report.v1.server.service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.util.CellUtil;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.springframework.stereotype.Service;
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.componentlog.ComponentLog;
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.componentlog.ComponentLogEntry;
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.componentlog.ComponentLogEntryValue;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.FileModel;
import com.iqser.red.service.redaction.report.v1.server.client.ComponentClient;
import com.iqser.red.service.redaction.report.v1.server.client.FileAttributesConfigClient;
import com.iqser.red.service.redaction.report.v1.server.model.ExcelModel;
import com.iqser.red.service.redaction.report.v1.server.model.FileAttributeModel;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
@Service
@RequiredArgsConstructor
@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
@SuppressWarnings("checkstyle:all")
public class ScmReportService {
ComponentClient componentResource;
FileAttributesConfigClient fileAttributesClient;
public void addScmRows(Sheet sheet, FileModel fileModel, ExcelModel excelModel) {
var firstRow = sheet.getRow(0);
int fileColumnIndex = 0;
int textColumnIndex = firstRow.getLastCellNum() - 1;
int valueIndexColumn = firstRow.getLastCellNum() - 2;
int componentColumnIndex = firstRow.getLastCellNum() - 3;
CellUtil.setAlignment(firstRow.getCell(textColumnIndex), HorizontalAlignment.LEFT);
ComponentLog componentLog = componentResource.getComponentLog(fileModel.getDossierId(), fileModel.getId(), true);
AtomicInteger rowIndex = new AtomicInteger(excelModel.getRedactionPlaceholderRow());
Map<String, Integer> componentIndexMap = new HashMap<>();
componentLog.getComponentLogEntries().forEach(componentLogEntry -> {
if (componentLogEntry.getComponentValues().isEmpty()) {
return;
}
int rowIndexAndIncrement = rowIndex.getAndIncrement();
Row row = sheet.createRow(rowIndexAndIncrement);
excelModel.getWrittenRows().add(rowIndexAndIncrement);
// Filename cell
Cell fileNameCell = row.createCell(fileColumnIndex);
fileNameCell.setCellValue(fileModel.getFilename() == null ? "" : fileModel.getFilename());
CellUtil.setVerticalAlignment(fileNameCell, VerticalAlignment.TOP);
// Component, file attributes and index cell
addOtherCells(sheet, excelModel, rowIndex, componentIndexMap, componentLogEntry, row, fileModel, firstRow, componentColumnIndex, textColumnIndex, valueIndexColumn);
});
// Autosize all cells besides the last column because the extracted text should be multiline
if (sheet instanceof SXSSFSheet) {
((SXSSFSheet) sheet).trackAllColumnsForAutoSizing();
for (int i = 0; i < firstRow.getLastCellNum()-1; i++) {
sheet.autoSizeColumn(i);
}
}
sheet.createRow(rowIndex.get());
excelModel.getWrittenRows().add(rowIndex.get());
excelModel.setRedactionPlaceholderRow(rowIndex.getAndIncrement());
}
private void addOtherCells(Sheet sheet,
ExcelModel excelModel,
AtomicInteger rowIndex,
Map<String, Integer> componentIndexMap,
ComponentLogEntry componentLogEntry,
Row row,
FileModel fileModel,
Row firstRow,
int componentColumnIndex,
int textColumnIndex,
int valueIndexColumn) {
int rowIndexAndIncrement;
Cell componentNameCell = row.createCell(componentColumnIndex);
String componentValue = componentLogEntry.getName().replaceAll("_", " ");
componentNameCell.setCellValue(componentValue);
List<FileAttributeModel> fileAttributeModels = buildFileAttributeModels(fileModel, firstRow);
// FileAttributes cells
addFileAttribute(row, fileModel, fileAttributeModels);
var iterator = componentLogEntry.getComponentValues().iterator();
while (iterator.hasNext()) {
ComponentLogEntryValue componentLogEntryValue = iterator.next();
Cell indexCell = row.createCell(valueIndexColumn);
Cell textExtractionCell = row.createCell(textColumnIndex);
addTextExtraction(componentLogEntryValue, textExtractionCell);
if (componentIndexMap.containsKey(componentValue)) {
int indexValue = componentIndexMap.get(componentValue);
indexCell.setCellValue(indexValue + 1);
Cell componentCell = row.createCell(componentColumnIndex);
componentCell.setCellValue(componentValue);
Cell fileNameCell = row.createCell(0);
fileNameCell.setCellValue(fileModel.getFilename());
addFileAttribute(row, fileModel, fileAttributeModels);
componentIndexMap.put(componentValue, indexValue + 1);
} else {
componentIndexMap.put(componentValue, 1);
indexCell.setCellValue(1);
}
CellUtil.setAlignment(indexCell, HorizontalAlignment.CENTER);
CellUtil.setVerticalAlignment(componentNameCell, VerticalAlignment.TOP);
CellUtil.setVerticalAlignment(indexCell, VerticalAlignment.TOP);
if (iterator.hasNext()) {
rowIndexAndIncrement = rowIndex.getAndIncrement();
row = sheet.createRow(rowIndexAndIncrement);
excelModel.getWrittenRows().add(rowIndexAndIncrement);
}
}
}
private void addTextExtraction(ComponentLogEntryValue componentLogEntryValue, Cell textExtractionCell) {
textExtractionCell.setCellValue(componentLogEntryValue.getValue() == null ? "" : componentLogEntryValue.getValue());
CellStyle cellStyle = textExtractionCell.getCellStyle();
cellStyle.setWrapText(true);
textExtractionCell.setCellStyle(cellStyle);
}
private void addFileAttribute(Row row, FileModel fileModel, List<FileAttributeModel> fileAttributeModels) {
for (FileAttributeModel fileAttributeModel : fileAttributeModels) {
Cell fileAttributeCell = row.createCell(fileAttributeModel.getCell().getColumnIndex());
String cellValue = fileModel.getFileAttributes().get(fileAttributeModel.getId());
fileAttributeCell.setCellValue(cellValue == null ? "" : cellValue);
CellUtil.setAlignment(fileAttributeCell, HorizontalAlignment.CENTER);
CellUtil.setVerticalAlignment(fileAttributeCell, VerticalAlignment.TOP);
}
}
private Map<String, String> getAllFileAttributes(FileModel file) {
Map<String, String> fileAttributes = new HashMap<>();
fileAttributesClient.getFileAttributeConfigs(file.getDossierTemplateId())
.forEach(fileAttributeConfig -> {
fileAttributes.put(fileAttributeConfig.getLabel(), fileAttributeConfig.getId());
});
return fileAttributes;
}
private List<FileAttributeModel> buildFileAttributeModels(FileModel file, Row firstRow) {
List<FileAttributeModel> fileAttributeModels = new ArrayList<>();
Map<String, String> fileAttributes = getAllFileAttributes(file);
var iterator = firstRow.cellIterator();
while (iterator.hasNext()) {
Cell cell = iterator.next();
String cellValue = cell.getStringCellValue();
if (fileAttributes.containsKey(cellValue)) {
fileAttributeModels.add(FileAttributeModel.builder().id(fileAttributes.get(cellValue)).cell(cell).build());
}
}
return fileAttributeModels;
}
}

View File

@ -48,11 +48,14 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
import com.amazonaws.services.s3.AmazonS3;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.componentlog.ComponentLog;
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntityLog;
import com.iqser.red.service.persistence.service.v1.api.shared.model.analysislog.entitylog.EntityLogLegalBasis;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.Dossier;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.FileAttributeConfig;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.dossier.file.FileModel;
import com.iqser.red.service.persistence.service.v1.api.shared.model.dossiertemplate.type.Type;
import com.iqser.red.service.redaction.report.v1.server.client.ComponentClient;
import com.iqser.red.service.redaction.report.v1.server.client.DictionaryClient;
import com.iqser.red.service.redaction.report.v1.server.client.DossierAttributesClient;
import com.iqser.red.service.redaction.report.v1.server.client.DossierAttributesConfigClient;
@ -132,6 +135,9 @@ public class RedactionReportIntegrationTest {
@MockBean
private DossierClient dossierClient;
@MockBean
private ComponentClient componentClient;
@SneakyThrows
private Dossier prepareDossier() {
@ -400,7 +406,7 @@ public class RedactionReportIntegrationTest {
var placeholders = buildPlaceHolderModel(new HashMap<>(), new HashMap<>(), List.of());
XSSFWorkbook readWorkbook = new XSSFWorkbook(templateResource.getInputStream());
var excelModel = excelTemplateReportGenerationService.calculateExcelModel(readWorkbook.getSheetAt(0));
var excelModel = excelTemplateReportGenerationService.calculateExcelModel(readWorkbook.getSheetAt(0), dossier.getDossierTemplateId());
SXSSFWorkbook writeWorkbook = new SXSSFWorkbook();
writeWorkbook.createSheet("Sheet1");
excelTemplateReportGenerationService.generateExcelReport(reportEntries, placeholders, "test", writeWorkbook, dossier.getDossierName(), fileModel, excelModel, true);
@ -431,7 +437,7 @@ public class RedactionReportIntegrationTest {
var placeholders = buildPlaceHolderModel(new HashMap<>(), new HashMap<>(), List.of());
XSSFWorkbook readWorkbook = new XSSFWorkbook(templateResource.getInputStream());
var excelModel = excelTemplateReportGenerationService.calculateExcelModel(readWorkbook.getSheetAt(0));
var excelModel = excelTemplateReportGenerationService.calculateExcelModel(readWorkbook.getSheetAt(0), dossier.getDossierTemplateId());
SXSSFWorkbook writeWorkbook = new SXSSFWorkbook();
writeWorkbook.createSheet("Sheet1");
excelTemplateReportGenerationService.generateExcelReport(reportEntries, placeholders, "test", writeWorkbook, "dossierName", fileModel, excelModel, false);
@ -478,7 +484,7 @@ public class RedactionReportIntegrationTest {
List.of(new ImagePlaceholder("{{dossier.attribute.Signature}}", IOUtils.toByteArray(imageResource.getInputStream()))));
XSSFWorkbook readWorkbook = new XSSFWorkbook(templateResource.getInputStream());
var excelModel = excelTemplateReportGenerationService.calculateExcelModel(readWorkbook.getSheetAt(0));
var excelModel = excelTemplateReportGenerationService.calculateExcelModel(readWorkbook.getSheetAt(0), dossier.getDossierTemplateId());
SXSSFWorkbook writeWorkbook = new SXSSFWorkbook();
writeWorkbook.createSheet("Sheet1");
excelTemplateReportGenerationService.generateExcelReport(reportEntries, placeholders, "test", writeWorkbook, "dossierName", fileModel, excelModel, true);
@ -489,6 +495,44 @@ public class RedactionReportIntegrationTest {
}
}
@Test
@SneakyThrows
public void testScmReport() {
Dossier dossier = prepareDossier();
FileModel fileModel = FileModel.builder().filename("filename")
.dossierId(dossier.getDossierId())
.dossierTemplateId(dossier.getDossierTemplateId())
.fileAttributes(Map.of("TestAttribute", "Lorem Ipsum", "1b5ebe26-34f2-4c3b-983d-c0f0a010302c", "402"))
.build();
EntityLog entityLog = objectMapper.readValue(new ClassPathResource("files/scm/entityLog.json").getInputStream(), EntityLog.class);
List<EntityLogLegalBasis> legalBasisMapping = objectMapper.readValue(new ClassPathResource("files/scm/legalBasisMapping.json").getInputStream(), new TypeReference<>() {});
ComponentLog componentLog = objectMapper.readValue(new ClassPathResource("files/scm/componentLog.json").getInputStream(), ComponentLog.class);
List<FileAttributeConfig> fileAttributeConfigs = objectMapper.readValue(new ClassPathResource("files/scm/fileAttributes.json").getInputStream(), new TypeReference<>() {});
Map<String, String> mapOfEntityDisplayName = createEntityDisplayNames(entityLog);
List<ReportRedactionEntry> reportEntries = entityLogConverterService.convertAndSort(entityLog, legalBasisMapping, mapOfEntityDisplayName);
when(componentClient.getComponentLog(dossier.getDossierId(), fileModel.getId(), true)).thenReturn(componentLog);
when(fileAttributesConfigClient.getFileAttributeConfigs(dossier.getDossierTemplateId())).thenReturn(fileAttributeConfigs);
ClassPathResource templateResource = new ClassPathResource("templates/scm_report.xlsx");
var placeholders = buildPlaceHolderModel(new HashMap<>(), Map.of("{{file.attribute.placeholder}}", "OECD Number"), List.of());
XSSFWorkbook readWorkbook = new XSSFWorkbook(templateResource.getInputStream());
var excelModel = excelTemplateReportGenerationService.calculateExcelModel(readWorkbook.getSheetAt(0), dossier.getDossierTemplateId());
SXSSFWorkbook writeWorkbook = new SXSSFWorkbook();
writeWorkbook.createSheet("Sheet1");
excelTemplateReportGenerationService.generateExcelReport(reportEntries, placeholders, "test", writeWorkbook, dossier.getDossierName(), fileModel, excelModel, true);
byte[] excelTemplateReport3 = excelTemplateReportGenerationService.toByteArray(writeWorkbook);
try (FileOutputStream fileOutputStream = new FileOutputStream(getTemporaryDirectory() + "/scm_report.xlsx")) {
fileOutputStream.write(excelTemplateReport3);
}
System.out.println(getTemporaryDirectory() + "/scm_report.xlsx");
}
private Map<String, String> createEntityDisplayNames(EntityLog entityLog) {

View File

@ -0,0 +1,859 @@
{
"analysisNumber": 2,
"componentRulesVersion": 1,
"componentLogEntries": [
{
"name": "Study_Title",
"componentValues": [
{
"value": "SYN545192 EC (A15457H) - Acute Dermal Toxicity Study in Rats",
"originalValue": "SYN545192 EC (A15457H) - Acute Dermal Toxicity Study in Rats",
"valueDescription": "First found value of type title or else ''",
"componentRuleId": "StudyTitle.0.0",
"componentLogEntityReferences": [
{
"id": "fdc33ec238d48f3f5c9611ea4ba3ae1b",
"type": "title",
"entityRuleId": "DOC.6.1",
"page": 1
}
]
}
]
},
{
"name": "Performing_Laboratory",
"componentValues": [
{
"value": "CiToxLAB Hungary Ltd., Hungary",
"originalValue": "CiToxLAB Hungary Ltd., Hungary",
"valueDescription": "Laboratory name and country found!",
"componentRuleId": "PerformingLaboratory.1.0",
"componentLogEntityReferences": [
{
"id": "f872738237a85170cb073b6220b98e65",
"type": "laboratory_name",
"entityRuleId": "DOC.7.2",
"page": 1
},
{
"id": "1c6dade9e8ea1a6f5e1b83da05f11368",
"type": "laboratory_country",
"entityRuleId": "DOC.7.2",
"page": 1
}
]
}
]
},
{
"name": "Report_Number",
"componentValues": [
{
"value": "12/063-002P",
"originalValue": "12/063-002P",
"valueDescription": "First found value of type report_number or else ''",
"componentRuleId": "ReportNumber.0.0",
"componentLogEntityReferences": [
{
"id": "8ac7d1ad2d1614527bbb055cebb3824f",
"type": "report_number",
"entityRuleId": "DOC.2.0",
"page": 1
}
]
}
]
},
{
"name": "GLP_Study",
"componentValues": [
{
"value": "Yes",
"originalValue": "Yes",
"valueDescription": "Yes if present, No if not",
"componentRuleId": "GLPStudy.0.0",
"componentLogEntityReferences": [
{
"id": "23cacb7ae621b9cdf987f50e3bdd115b",
"type": "glp_study",
"entityRuleId": "DOC.8.0",
"page": 3
},
{
"id": "fcd231292774563c812cddcf4d78c1f5",
"type": "glp_study",
"entityRuleId": "DOC.8.0",
"page": 25
}
]
}
]
},
{
"name": "Test_Guidelines_1",
"componentValues": [
{
"value": "Nº 402: Acute Dermal Toxicity (24/02/1987)",
"originalValue": "Nº 402: Acute Dermal Toxicity (24/02/1987)",
"valueDescription": "OECD Number and guideline year mapped!",
"componentRuleId": "TestGuideline.0.0",
"componentLogEntityReferences": [
{
"id": "911e8b6737c9529a40590dbf6778c24b",
"type": "oecd_guideline_number",
"entityRuleId": "DOC.1.0",
"page": 1
},
{
"id": "962c4942cd62f0103b1bf5759e2e1b1a",
"type": "oecd_guideline_year",
"entityRuleId": "DOC.1.0",
"page": 1
}
]
}
]
},
{
"name": "Test_Guidelines_2",
"componentValues": [
{
"value": "EPA OPPTS 870.1200 (1998), EC 440/2008 (2008)",
"originalValue": "EPA OPPTS 870.1200 (1998), EC 440/2008 (2008)",
"valueDescription": "Joining all values of type ec_guideline, epa_guideline with ', '",
"componentRuleId": "TestGuideline.2.0",
"componentLogEntityReferences": [
{
"id": "506ef85dd4dcb0a2df24d203ad21d220",
"type": "epa_guideline",
"entityRuleId": "DOC.1.0",
"page": 1
},
{
"id": "09c476952cbc59e3661b03cd38d463e7",
"type": "ec_guideline",
"entityRuleId": "DOC.1.0",
"page": 1
}
]
}
]
},
{
"name": "Experimental_Starting_Date",
"componentValues": [
{
"value": "21/03/2012",
"originalValue": "21/03/2012",
"valueDescription": "Convert values of type 'experimental_start_date' to dd/MM/yyyy joined with ', '",
"componentRuleId": "StartDate.0.0",
"componentLogEntityReferences": [
{
"id": "decf41962064ede79b213035f34862b3",
"type": "experimental_start_date",
"entityRuleId": "DOC.3.0",
"page": 7
}
]
}
]
},
{
"name": "Experimental_Completion_Date",
"componentValues": [
{
"value": "04/04/2012",
"originalValue": "04/04/2012",
"valueDescription": "Convert values of type 'experimental_end_date' to dd/MM/yyyy joined with ', '",
"componentRuleId": "CompletionDate.0.0",
"componentLogEntityReferences": [
{
"id": "346a5ce1bd59081c74885078af715284",
"type": "experimental_end_date",
"entityRuleId": "DOC.4.0",
"page": 7
}
]
}
]
},
{
"name": "Certificate_of_Analysis_Batch_Identification",
"componentValues": [
{
"value": "SMU1LP001",
"originalValue": "SMU1LP001",
"valueDescription": "Joining all unique values of type batch_number with ', '",
"componentRuleId": "AnalysisCertificate.0.0",
"componentLogEntityReferences": [
{
"id": "93b7180cb815e41a53a3f1340776dcf2",
"type": "batch_number",
"entityRuleId": "DOC.9.1",
"page": 12
},
{
"id": "e0cb8bec3a8568335eae3d8776237c8f",
"type": "batch_number",
"entityRuleId": "DOC.9.0",
"page": 23
}
]
}
]
},
{
"name": "Species",
"componentValues": [
{
"value": "rats",
"originalValue": "rats",
"valueDescription": "First found value of type species or else ''",
"componentRuleId": "Species.0.0",
"componentLogEntityReferences": [
{
"id": "b897fbedc847ea1d23f349e5350bc8f1",
"type": "species",
"entityRuleId": "DOC.5.2",
"page": 14
},
{
"id": "f5d80ce83f739506f95420a375c8effa",
"type": "species",
"entityRuleId": "DOC.5.2",
"page": 14
},
{
"id": "4f8b024892a7ee7826a7638833ed0de2",
"type": "species",
"entityRuleId": "DOC.5.2",
"page": 14
}
]
}
]
},
{
"name": "Strain",
"componentValues": [
{
"value": "CRL:(WI)",
"originalValue": "CRL:(WI)",
"valueDescription": "First found value of type strain or else ''",
"componentRuleId": "Strain.0.0",
"componentLogEntityReferences": [
{
"id": "b9784d1fa897ade518e807b3e371b275",
"type": "strain",
"entityRuleId": "DOC.5.3",
"page": 14
}
]
}
]
},
{
"name": "Doses_mg_per_kg_bw",
"componentValues": [
{
"value": "A single administration of SYN545192 EC (A15457H) at a dose of 2000 mg/kg body weight was applied dermally to 5 male and 5 female CRL:(WI) rats, followed by a 14-day observation period. The test item was applied as supplied by the Sponsor. The application period was 24 hours. Clinical observations were assessed in all animals at 1 and 5 hours after dosing and daily for 14 days thereafter. Body weight was measured prior to dosing on Day 0 and on Days 7 and 14. All animals were euthanized and subjected to a gross macroscopic examination at the end of the 14-day observation period (Day 14). 14",
"originalValue": "A single administration of SYN545192 EC (A15457H) at a dose of 2000 mg/kg body weight was applied dermally to 5 male and 5 female CRL:(WI) rats, followed by a 14-day observation period. The test item was applied as supplied by the Sponsor. The application period was 24 hours. Clinical observations were assessed in all animals at 1 and 5 hours after dosing and daily for 14 days thereafter. Body weight was measured prior to dosing on Day 0 and on Days 7 and 14. All animals were euthanized and subjected to a gross macroscopic examination at the end of the 14-day observation period (Day 14). 14",
"valueDescription": "Joining all values of type doses_(mg_kg_bw) with ' '",
"componentRuleId": "Necropsy.1.0",
"componentLogEntityReferences": [
{
"id": "c1bf6261c8dc8f8f6aa0d6fe5c6553bd",
"type": "doses_(mg_kg_bw)",
"entityRuleId": "DOC.35.0",
"page": 10
},
{
"id": "ede065ea1725687b77490a484aa2d9e8",
"type": "doses_(mg_kg_bw)",
"entityRuleId": "DOC.35.0",
"page": 10
},
{
"id": "1210a0f7ffd1c0d558d330a09241bc7d",
"type": "doses_(mg_kg_bw)",
"entityRuleId": "DOC.35.0",
"page": 10
}
]
}
]
},
{
"name": "Mortality_Statement",
"componentValues": [
{
"value": "No mortality occurred on the study. 35",
"originalValue": "No mortality occurred on the study. 35",
"valueDescription": "Joining all values of type mortality_statement with ' '",
"componentRuleId": "MortalityStatement.0.0",
"componentLogEntityReferences": [
{
"id": "0ae4b2b53905f238cf17c20df26f209d",
"type": "mortality_statement",
"entityRuleId": "DOC.32.0",
"page": 16
},
{
"id": "849e9e6c36d5c510225587c21d66b18d",
"type": "mortality_statement",
"entityRuleId": "DOC.32.0",
"page": 16
}
]
}
]
},
{
"name": "Weight_Behavior_Changes",
"componentValues": [
{
"value": "No mortality occurred during the study.\nNo adverse clinical signs were observed after treatment with the test item during the 14 day observation period. Erythema was noted in all animals (10/10) on Day 1 only. All animals were symptom free from 2 days after the treatment.\nThere were no treatment related effects on body weight or body weight gain during the observation period.\nThere was no evidence of the test item-related observations at a dose level of 2000 mg/kg bw at necropsy.\n15",
"originalValue": "No mortality occurred during the study.\nNo adverse clinical signs were observed after treatment with the test item during the 14 day observation period. Erythema was noted in all animals (10/10) on Day 1 only. All animals were symptom free from 2 days after the treatment.\nThere were no treatment related effects on body weight or body weight gain during the observation period.\nThere was no evidence of the test item-related observations at a dose level of 2000 mg/kg bw at necropsy.\n15",
"valueDescription": "Joining all values of type weight_behavior_changes with '\n'",
"componentRuleId": "WeightBehavior.0.0",
"componentLogEntityReferences": [
{
"id": "952c0822930bf5b8e2026f96cd7d9b37",
"type": "weight_behavior_changes",
"entityRuleId": "DOC.16.0",
"page": 10
},
{
"id": "6ce01344b447329c1afa3f1f846173f0",
"type": "weight_behavior_changes",
"entityRuleId": "DOC.16.0",
"page": 10
},
{
"id": "8ffd807ffd5ca21c759c78f54cd87f4f",
"type": "weight_behavior_changes",
"entityRuleId": "DOC.16.0",
"page": 10
},
{
"id": "9eeb75725d19bc1f13330aa9cdaa3fdc",
"type": "weight_behavior_changes",
"entityRuleId": "DOC.16.0",
"page": 10
},
{
"id": "a74be4f45046f442315f472490e39e59",
"type": "weight_behavior_changes",
"entityRuleId": "DOC.16.0",
"page": 10
}
]
}
]
},
{
"name": "Necropsy_Findings",
"componentValues": [
{
"value": "No treatment related macroscopic findings were observed. There was no evidence of the test item-related observations at a dose level of 2000 mg/kg bw at necropsy. 39",
"originalValue": "No treatment related macroscopic findings were observed. There was no evidence of the test item-related observations at a dose level of 2000 mg/kg bw at necropsy. 39",
"valueDescription": "Joining all values of type necropsy_findings with ' '",
"componentRuleId": "Necropsy.0.0",
"componentLogEntityReferences": [
{
"id": "c0c22ea4e6dda938468d4be3102334ae",
"type": "necropsy_findings",
"entityRuleId": "DOC.17.0",
"page": 16
},
{
"id": "799d19b6a371f575c77e988ba7e23063",
"type": "necropsy_findings",
"entityRuleId": "DOC.17.0",
"page": 16
},
{
"id": "24edc84baf21ef6bb37c5b20801d5e84",
"type": "necropsy_findings",
"entityRuleId": "DOC.17.0",
"page": 16
}
]
}
]
},
{
"name": "Deviation_from_the_Guideline",
"componentValues": [
{
"value": "",
"originalValue": "",
"valueDescription": "Joining all values of type with '\n'",
"componentRuleId": "GuidelineDeviation.0.0",
"componentLogEntityReferences": []
}
]
},
{
"name": "Conclusion_LD50_Greater_than",
"componentValues": [
{
"value": "Greater than",
"originalValue": "Greater than",
"valueDescription": "Entity of type 'ld50_greater' found",
"componentRuleId": "Conclusion.1.0",
"componentLogEntityReferences": [
{
"id": "311a441f815daaffc20453a79712a684",
"type": "ld50_greater",
"entityRuleId": "DOC.10.0",
"page": 10
},
{
"id": "107db9f46656e13234c90b9a3a57b694",
"type": "ld50_greater",
"entityRuleId": "DOC.10.0",
"page": 11
},
{
"id": "2c788c7a7118ef9bb18edf7d5e7dbc7b",
"type": "ld50_greater",
"entityRuleId": "DOC.10.0",
"page": 16
}
]
}
]
},
{
"name": "Conclusion_LD50_mg_per_kg",
"componentValues": [
{
"value": "2000",
"originalValue": "2000",
"valueDescription": "Joining all unique values of type ld50_value with ', '",
"componentRuleId": "Conclusion.0.0",
"componentLogEntityReferences": [
{
"id": "fff9617f8d11bd678e1d17ee330d0eef",
"type": "ld50_value",
"entityRuleId": "DOC.10.0",
"page": 10
},
{
"id": "2ef271bd35871a6266f456a7c4360042",
"type": "ld50_value",
"entityRuleId": "DOC.10.0",
"page": 16
}
]
}
]
},
{
"name": "Conclusion_Minimum_Confidence",
"componentValues": [
{
"value": "",
"originalValue": "",
"valueDescription": "Joining all unique values of type with ', '",
"componentRuleId": "Conclusion.2.0",
"componentLogEntityReferences": []
}
]
},
{
"name": "Conclusion_Maximum_Confidence",
"componentValues": [
{
"value": "",
"originalValue": "",
"valueDescription": "Joining all unique values of type with ', '",
"componentRuleId": "Conclusion.3.0",
"componentLogEntityReferences": []
}
]
},
{
"name": "Study_Conclusion",
"componentValues": [
{
"value": "The median lethal dose of SYN545192 EC (A15457H) after a single dermal administration was found to be greater than 2000 mg/kg bw in male and female CRL:(WI) rats.",
"originalValue": "The median lethal dose of SYN545192 EC (A15457H) after a single dermal administration was found to be greater than 2000 mg/kg bw in male and female CRL:(WI) rats.",
"valueDescription": "Joining all values of type study_conclusion with ' '",
"componentRuleId": "StudyConclusion.0.0",
"componentLogEntityReferences": [
{
"id": "2fd7f1df547bbea6932344ded3d0a7bb",
"type": "study_conclusion",
"entityRuleId": "DOC.15.0",
"page": 10
}
]
}
]
},
{
"name": "laboratory_country",
"componentValues": [
{
"value": "Hungary",
"originalValue": "Hungary",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "d469a79eedff7c52b006ae34b36a7ff8",
"type": "laboratory_country",
"entityRuleId": "DOC.7.2",
"page": 1
}
]
},
{
"value": "Hungary",
"originalValue": "Hungary",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "9593a204d3530a8bb90cab1921cf57c1",
"type": "laboratory_country",
"entityRuleId": "DOC.7.2",
"page": 1
}
]
},
{
"value": "United Kingdom",
"originalValue": "United Kingdom",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "1b968e9b5ce3e90e4158c5353facb78f",
"type": "laboratory_country",
"entityRuleId": "DOC.7.1",
"page": 1
}
]
}
]
},
{
"name": "oecd_guideline",
"componentValues": [
{
"value": "OECD 402 (1987)",
"originalValue": "OECD 402 (1987)",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "0adce062717031fcb3130cb4b5121220",
"type": "oecd_guideline",
"entityRuleId": "DOC.1.0",
"page": 1
}
]
}
]
},
{
"name": "study_conclusion",
"componentValues": [
{
"value": "The median lethal dose of SYN545192 EC (A15457H) after a single dermal administration was found to be greater than 2000 mg/kg bw in male and female CRL:(WI) rats.",
"originalValue": "The median lethal dose of SYN545192 EC (A15457H) after a single dermal administration was found to be greater than 2000 mg/kg bw in male and female CRL:(WI) rats.",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "f55749c2ff48055d2c2fa7dd08adde62",
"type": "study_conclusion",
"entityRuleId": "DOC.15.0",
"page": 16
}
]
}
]
},
{
"name": "study_design",
"componentValues": [
{
"value": "A single administration of SYN545192 EC (A15457H) at a dose of 2000 mg/kg body weight was applied dermally to 5 male and 5 female CRL:(WI) rats, followed by a 14-day observation period. The test item was applied as supplied by the Sponsor. The application period was 24 hours.",
"originalValue": "A single administration of SYN545192 EC (A15457H) at a dose of 2000 mg/kg body weight was applied dermally to 5 male and 5 female CRL:(WI) rats, followed by a 14-day observation period. The test item was applied as supplied by the Sponsor. The application period was 24 hours.",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "5da351be47fa414cfb7f833d3ca87f5e",
"type": "study_design",
"entityRuleId": "DOC.20.0",
"page": 10
}
]
},
{
"value": "Clinical observations were assessed in all animals at 1 and 5 hours after dosing and daily for 14 days thereafter. Body weight was measured prior to dosing on Day 0 and on Days 7 and 14. All animals were euthanized and subjected to a gross macroscopic examination at the end of the 14-day observation period (Day 14).",
"originalValue": "Clinical observations were assessed in all animals at 1 and 5 hours after dosing and daily for 14 days thereafter. Body weight was measured prior to dosing on Day 0 and on Days 7 and 14. All animals were euthanized and subjected to a gross macroscopic examination at the end of the 14-day observation period (Day 14).",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "a7c111ff4a0456cb14456e27df5b155b",
"type": "study_design",
"entityRuleId": "DOC.20.0",
"page": 10
}
]
},
{
"value": "14",
"originalValue": "14",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "aee5552913b8d2b1fb3a57c84d82649b",
"type": "study_design",
"entityRuleId": "DOC.20.0",
"page": 10
}
]
}
]
},
{
"name": "test_results",
"componentValues": [
{
"value": "Study Title: SYN545192 EC (A15457H) - Acute Dermal Toxicity Study in Rats",
"originalValue": "Study Title: SYN545192 EC (A15457H) - Acute Dermal Toxicity Study in Rats",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "15c7b4591b08cb8b9eae17b1e048ed62",
"type": "test_results",
"entityRuleId": "DOC.24.1",
"page": 5
}
]
},
{
"value": "Test Item: SYN545192 EC (A15457H)",
"originalValue": "Test Item: SYN545192 EC (A15457H)",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "bd2f28162667f5307980dcbefceb7b55",
"type": "test_results",
"entityRuleId": "DOC.24.1",
"page": 5
}
]
},
{
"value": "This study has been inspected, and this report audited by the Quality Assurance Unit in compliance with the Principles of Good Laboratory Practice. As far as it can be reasonably established the methods described and the results incorporated in this report accurately reflect the raw data produced during this study.",
"originalValue": "This study has been inspected, and this report audited by the Quality Assurance Unit in compliance with the Principles of Good Laboratory Practice. As far as it can be reasonably established the methods described and the results incorporated in this report accurately reflect the raw data produced during this study.",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "8dd6465f6585320429690c8dfec02013",
"type": "test_results",
"entityRuleId": "DOC.24.1",
"page": 5
}
]
},
{
"value": "All inspections, data reviews and the report audit were reported in written form to the study director and to management. The dates of such inspections and of the report audit are given below:",
"originalValue": "All inspections, data reviews and the report audit were reported in written form to the study director and to management. The dates of such inspections and of the report audit are given below:",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "142b22eb9e0c50104a33a939a1a7b3cf",
"type": "test_results",
"entityRuleId": "DOC.24.1",
"page": 5
}
]
},
{
"value": "4.2",
"originalValue": "4.2",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "4280bb81c5a58bedf7f2578ffbac9482",
"type": "test_results",
"entityRuleId": "DOC.24.1",
"page": 5
}
]
},
{
"value": "No mortality occurred on the study.",
"originalValue": "No mortality occurred on the study.",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "ac4cf632670c1e6b9f29a36a2f3a1545",
"type": "test_results",
"entityRuleId": "DOC.24.1",
"page": 16
}
]
},
{
"value": "35",
"originalValue": "35",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "7ef3c9a644f708038fd627ce289b6fec",
"type": "test_results",
"entityRuleId": "DOC.24.1",
"page": 16
}
]
},
{
"value": "There were no adverse clinical signs noted in any animals throughout the study.",
"originalValue": "There were no adverse clinical signs noted in any animals throughout the study.",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "c6988066e4ea1b9fca609f2d04bc68ee",
"type": "test_results",
"entityRuleId": "DOC.24.1",
"page": 16
}
]
},
{
"value": "36",
"originalValue": "36",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "41e6e61eb69d675d15ad0510a58e5ac8",
"type": "test_results",
"entityRuleId": "DOC.24.1",
"page": 16
}
]
},
{
"value": "Erythema was noted in all animals (10/10) on Day 1. All animals were symptom free from 2 days after the treatment.",
"originalValue": "Erythema was noted in all animals (10/10) on Day 1. All animals were symptom free from 2 days after the treatment.",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "29fa49dda60b8e8a243e2f46a9a9b66a",
"type": "test_results",
"entityRuleId": "DOC.24.1",
"page": 16
}
]
},
{
"value": "37",
"originalValue": "37",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "a49264ce0b7d01cb9e5ac6c439fc21b9",
"type": "test_results",
"entityRuleId": "DOC.24.1",
"page": 16
}
]
},
{
"value": "There were no effects on either body weight or body weight gain in any animal.",
"originalValue": "There were no effects on either body weight or body weight gain in any animal.",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "89500fb07a64791681bc4e93edf5f950",
"type": "test_results",
"entityRuleId": "DOC.24.1",
"page": 16
}
]
},
{
"value": "38",
"originalValue": "38",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "f0cd5807ab584affe57e44d8744256ef",
"type": "test_results",
"entityRuleId": "DOC.24.1",
"page": 16
}
]
},
{
"value": "No treatment related macroscopic findings were observed.",
"originalValue": "No treatment related macroscopic findings were observed.",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "aee6af989b1c6da3cc371929fe92b707",
"type": "test_results",
"entityRuleId": "DOC.24.1",
"page": 16
}
]
},
{
"value": "There was no evidence of the test item-related observations at a dose level of 2000 mg/kg bw at necropsy.",
"originalValue": "There was no evidence of the test item-related observations at a dose level of 2000 mg/kg bw at necropsy.",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "971796cd69839b6715ef11dadff12960",
"type": "test_results",
"entityRuleId": "DOC.24.1",
"page": 16
}
]
},
{
"value": "39",
"originalValue": "39",
"valueDescription": "Unmapped Entity",
"componentRuleId": "DefaultComponents.999.0",
"componentLogEntityReferences": [
{
"id": "a3957a14b4e31bcfe42ba11e85cce322",
"type": "test_results",
"entityRuleId": "DOC.24.1",
"page": 16
}
]
}
]
}
]
}

View File

@ -0,0 +1,26 @@
[
{
"id": "1b5ebe26-34f2-4c3b-983d-c0f0a010302c",
"csvColumnHeader": "OECD Number",
"label": "OECD Number",
"primaryAttribute": false,
"editable": true,
"filterable": true,
"displayedInFileList": true,
"placeholder": "{{file.attribute.OecdNumber}}",
"type": "TEXT",
"dossierTemplateId": null
},
{
"id": "9ed79d77-2ea6-4270-a76d-5d4797c1cd28",
"csvColumnHeader": "test_attribute",
"label": "Test attribute",
"primaryAttribute": false,
"editable": true,
"filterable": true,
"displayedInFileList": true,
"placeholder": "{{file.attribute.TestAttribute}}",
"type": "TEXT",
"dossierTemplateId": null
}
]

View File

@ -0,0 +1,7 @@
[
{
"name": "n-a.",
"description": "n-a.",
"reason": "n-a."
}
]