Pull request #196: RSS-230: Added component Dose(s) (mg/Kg bw) and empty strings for empty sentences components for scm

Merge in RED/redaction-report-service from RSS-230 to master

* commit 'cea9fa4634bc485ea89d270fe5a43e195237524e':
  RSS-230: Added component Dose(s) (mg/Kg bw) and empty strings for empty sentences components for scm
This commit is contained in:
Dominique Eiflaender 2022-11-23 14:55:40 +01:00
commit 9d33894b46
2 changed files with 28 additions and 2 deletions

View File

@ -300,7 +300,7 @@ public class ExcelReportGenerationService {
filenameCell.setCellValue(fileModel.getFilename());
Cell keyCell = sheet.getRow(rowIndex.get()).createCell(1);
keyCell.setCellValue(oecd + "-" + entry.getKey());
keyCell.setCellValue(oecd + "-" + entry.getKey().replaceAll("_", " "));
Cell valueCell = sheet.getRow(rowIndex.get()).createCell(2);
valueCell.setCellValue(entry.getValue());

View File

@ -72,6 +72,7 @@ public class RSSPoc2Service {
public static final String DOSE_MORTALITY_SENTENCE = "Dose_Mortality_";
public static final String RESULTS_MAIN_STUDY = "Results_Main_Study";
public static final String WHAT_WAS_THE_APPROACH_USED = "What_was_the_approach_used";
public static final String DOSES_MG_PER_KG_BW = "Doses_mg_per_kg_bw";
private final RedactionLogClient redactionLogClient;
private final FileStatusClient statusClient;
@ -159,6 +160,9 @@ public class RSSPoc2Service {
resultMap.put(DEVIATION_FROM_THE_GUIDELINE_SENTENCE + i, guidelineDeviationSentence);
i++;
}
if(guidelineDeviationSentences.isEmpty()){
resultMap.put(DEVIATION_FROM_THE_GUIDELINE_SENTENCE + 1, "");
}
}
if (oecdIn(oecd, Set.of("402", "403", "404", "405", "425", "429", "436", "471"))) {
@ -176,6 +180,7 @@ public class RSSPoc2Service {
if (oecdIn(oecd, Set.of("402"))) {
resultMap.put(NECROPSY_FINDINGS, getLongestBlock(redactionLog, "necropsy_findings"));
resultMap.put(DOSES_MG_PER_KG_BW, getAsOneBlock(redactionLog, "doses_(mg_kg_bw)"));
}
if (oecdIn(oecd, Set.of("403", "436"))) {
@ -186,6 +191,9 @@ public class RSSPoc2Service {
resultMap.put(NECROPSY_FINDINGS_SENTENCE + i, sentence);
i++;
}
if(sentences.isEmpty()){
resultMap.put(NECROPSY_FINDINGS_SENTENCE + 1, "");
}
}
if (oecdIn(oecd, Set.of("403", "436"))) {
@ -207,6 +215,9 @@ public class RSSPoc2Service {
resultMap.put(WEIGHT_BEHAVIOR_CHANGES_SENTENCE + i, sentence);
i++;
}
if(weightBehaviorChangesSentences.isEmpty()){
resultMap.put(WEIGHT_BEHAVIOR_CHANGES_SENTENCE + 1, "");
}
resultMap.put(MORTALITY_STATEMENT, getAsOneBlock(redactionLog, "mortality_statement"));
}
@ -230,6 +241,9 @@ public class RSSPoc2Service {
resultMap.put(CLINICAL_OBSERVATIONS_SENTENCE + i, sentence);
i++;
}
if(sentences.isEmpty()){
resultMap.put(CLINICAL_OBSERVATIONS_SENTENCE + 1, "");
}
sentences = getAsSentences(redactionLog, "bodyweight_changes");
i = 1;
@ -237,6 +251,9 @@ public class RSSPoc2Service {
resultMap.put(BODY_WEIGHT_CHANGES_SENTENCE + i, sentence);
i++;
}
if(sentences.isEmpty()){
resultMap.put(BODY_WEIGHT_CHANGES_SENTENCE + 1, "");
}
}
// if (oecdIn(oecd, Set.of("404"))) {
@ -261,6 +278,9 @@ public class RSSPoc2Service {
resultMap.put(CLINCAL_SIGNS_SENTENCE + i, clinicalSignsSentence);
i++;
}
if(clinicalSignsSentences.isEmpty()){
resultMap.put(CLINCAL_SIGNS_SENTENCE + 1, "");
}
var doseMortalitySentences = getDoseMortality(redactionLog);
i = 1;
@ -268,6 +288,9 @@ public class RSSPoc2Service {
resultMap.put(DOSE_MORTALITY_SENTENCE + i, sentence);
i++;
}
if(doseMortalitySentences.isEmpty()){
resultMap.put(DOSE_MORTALITY_SENTENCE + 1, "");
}
resultMap.put(MORTALITY, getAsOneBlock(redactionLog, "mortality"));
@ -281,6 +304,9 @@ public class RSSPoc2Service {
resultMap.put(PRELIMINARY_TEST_RESULTS_SENTENCE + i, sentence);
i++;
}
if(sentences.isEmpty()){
resultMap.put(PRELIMINARY_TEST_RESULTS_SENTENCE + 1, "");
}
resultMap.put(TEST_RESULTS, getAsOneBlock(redactionLog, "test_results"));
resultMap.put(WAS_THE_DEFINITIVE_STUDY_CONDUCTED_WITH_POSITIVE_CONTROL, getAsOneBlock(redactionLog, "positive_control"));
@ -349,7 +375,7 @@ public class RSSPoc2Service {
case "402":
resultMap.put(SPECIES, components.get(SPECIES));
resultMap.put(STRAIN, components.get(STRAIN));
// resultMap.put(D, components.get(STRAIN)); 402-Dose(s) (mg/Kg bw) TODO
resultMap.put(DOSES_MG_PER_KG_BW, components.get(DOSES_MG_PER_KG_BW));
resultMap.put(MORTALITY_STATEMENT, components.get(MORTALITY_STATEMENT));
resultMap.putAll(getKeyContains(components, WEIGHT_BEHAVIOR_CHANGES_SENTENCE));
resultMap.put(NECROPSY_FINDINGS, components.get(NECROPSY_FINDINGS));