DM-374: Return all entries if oecd nummber is missing for documine
This commit is contained in:
parent
0691cec892
commit
195563e40c
@ -3,15 +3,7 @@ package com.iqser.red.service.redaction.report.v1.server.service;
|
||||
import java.text.BreakIterator;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
@ -158,6 +150,14 @@ public class RSSPoc2Service {
|
||||
|
||||
redactionLog.getRedactionLogEntry().removeIf(r -> !r.isRedacted() || r.getChanges().get(r.getChanges().size() - 1).getType().equals(ChangeType.REMOVED));
|
||||
|
||||
if(oecd == null){
|
||||
resultMap.putAll(getAllEntities(redactionLog));
|
||||
setOverrideValues(dossierId, fileId, resultMap);
|
||||
rssFileResponses.add(new DetailedRSSFileResponse(file.getFilename(), resultMap));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
resultMap.put(STUDY_TITLE, getFirstEntryOrElse(redactionLog, "title", ""));
|
||||
resultMap.put(REPORT_NUMBER, getFirstEntryOrElse(redactionLog, "report_number", ""));
|
||||
resultMap.put(PERFORMING_LABORATORY, getPerformingLaboratory(redactionLog));
|
||||
@ -336,6 +336,22 @@ public class RSSPoc2Service {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private Map<String, SCMComponent> getAllEntities(RedactionLog redactionLog){
|
||||
Map<String, SCMComponent> resultMap = new HashMap<>();
|
||||
|
||||
Set<String> existingTypes = redactionLog.getRedactionLogEntry().stream().map(RedactionLogEntry::getType).collect(Collectors.toSet());
|
||||
|
||||
existingTypes.forEach(type -> {
|
||||
resultMap.put(type, getJoinedValues(redactionLog, type, " "));
|
||||
});
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public String getOecdNumber(FileModel file) {
|
||||
|
||||
var fileAttributesConfig = fileAttributesClient.getFileAttributeConfigs(file.getDossierTemplateId());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user