RSS-246: Adjusted performing lab rule for scm, removed filename from scm function report
This commit is contained in:
parent
753223fcf8
commit
a8267e22c0
@ -277,7 +277,6 @@ public class ExcelReportGenerationService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void addSCMEntryRows(Sheet sheet, FileModel fileModel, ExcelModel excelModel) {
|
||||
|
||||
var scm = rSSPoc2Service.getRSS(fileModel.getDossierId(), fileModel.getId());
|
||||
@ -289,20 +288,17 @@ public class ExcelReportGenerationService {
|
||||
|
||||
for (Map.Entry<String, String> entry : scmResultMap.entrySet()) {
|
||||
|
||||
if(entry.getKey().equals("Study_Type_Number")){
|
||||
if (entry.getKey().equals("Study_Type_Number")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
sheet.createRow(rowIndex.get());
|
||||
excelModel.getWrittenRows().add(rowIndex.get());
|
||||
|
||||
Cell filenameCell = sheet.getRow(rowIndex.get()).createCell(0);
|
||||
filenameCell.setCellValue(fileModel.getFilename());
|
||||
|
||||
Cell keyCell = sheet.getRow(rowIndex.get()).createCell(1);
|
||||
Cell keyCell = sheet.getRow(rowIndex.get()).createCell(0);
|
||||
keyCell.setCellValue(oecd + "-" + entry.getKey().replaceAll("_", " "));
|
||||
|
||||
Cell valueCell = sheet.getRow(rowIndex.get()).createCell(2);
|
||||
Cell valueCell = sheet.getRow(rowIndex.get()).createCell(1);
|
||||
valueCell.setCellValue(entry.getValue());
|
||||
|
||||
rowIndex.getAndIncrement();
|
||||
|
||||
@ -484,12 +484,18 @@ public class RSSPoc2Service {
|
||||
}
|
||||
if (doseWithSmallestDistance == null) {
|
||||
doseWithSmallestDistance = dose;
|
||||
} else if(Math.abs(Math.round(mortality.getPositions().get(0).getTopLeft().getY()) - Math.round(dose.getPositions().get(0).getTopLeft().getY())) < Math.abs(Math.round(mortality.getPositions().get(0).getTopLeft().getY()) - Math.round(doseWithSmallestDistance.getPositions().get(0).getTopLeft().getY()))){
|
||||
} else if (Math.abs(Math.round(mortality.getPositions().get(0).getTopLeft().getY()) - Math.round(dose.getPositions()
|
||||
.get(0)
|
||||
.getTopLeft()
|
||||
.getY())) < Math.abs(Math.round(mortality.getPositions().get(0).getTopLeft().getY()) - Math.round(doseWithSmallestDistance.getPositions()
|
||||
.get(0)
|
||||
.getTopLeft()
|
||||
.getY()))) {
|
||||
doseWithSmallestDistance = dose;
|
||||
}
|
||||
}
|
||||
|
||||
if(doseWithSmallestDistance != null){
|
||||
if (doseWithSmallestDistance != null) {
|
||||
result.add(doseWithSmallestDistance.getValue() + ", " + mortality.getValue());
|
||||
} else {
|
||||
result.add(", " + mortality.getValue());
|
||||
@ -734,8 +740,6 @@ public class RSSPoc2Service {
|
||||
|
||||
private String getPerformingLaboratory(RedactionLog redactionLog) {
|
||||
|
||||
// LAB_NAME = "y": 418.50415 GERMANY_ "y": 390.90417 UNITED_K "y": 253.02429 --> GErmany, not unitedK
|
||||
|
||||
var laboratoryEntry = redactionLog.getRedactionLogEntry().stream().filter(r -> r.getType().equals("laboratory_name")).findFirst();
|
||||
if (!laboratoryEntry.isPresent()) {
|
||||
return "";
|
||||
@ -743,19 +747,33 @@ public class RSSPoc2Service {
|
||||
|
||||
var laboratoryCountry = redactionLog.getRedactionLogEntry()
|
||||
.stream()
|
||||
.filter(r -> r.getType().equals("laboratory_country") && laboratoryEntry.get().getPositions().get(0).getTopLeft().getY() - r.getPositions()
|
||||
.filter(r -> r.getType().equals("laboratory_country") && Math.abs(laboratoryEntry.get().getPositions().get(0).getTopLeft().getY() - r.getPositions()
|
||||
.get(0)
|
||||
.getTopLeft()
|
||||
.getY() < 80)
|
||||
.map(RedactionLogEntry::getValue)
|
||||
.findFirst();
|
||||
.getY()) < 80)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
RedactionLogEntry countryWithSmallestDistance = null;
|
||||
for (var entry : laboratoryCountry) {
|
||||
|
||||
if (countryWithSmallestDistance == null) {
|
||||
countryWithSmallestDistance = entry;
|
||||
} else if (Math.abs(laboratoryEntry.get().getPositions().get(0).getTopLeft().getY() - entry.getPositions().get(0).getTopLeft().getY()) < Math.abs(laboratoryEntry.get()
|
||||
.getPositions()
|
||||
.get(0)
|
||||
.getTopLeft()
|
||||
.getY() - countryWithSmallestDistance.getPositions().get(0).getTopLeft().getY())) {
|
||||
countryWithSmallestDistance = entry;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (laboratoryEntry.isPresent()) {
|
||||
sb.append(laboratoryEntry.get().getValue());
|
||||
}
|
||||
if (laboratoryCountry.isPresent()) {
|
||||
sb.append(", ").append(laboratoryCountry.get());
|
||||
if (countryWithSmallestDistance != null) {
|
||||
sb.append(", ").append(countryWithSmallestDistance.getValue());
|
||||
}
|
||||
|
||||
return sb.toString().trim();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user