RSS-195: Adjusted compontent names and removed unneeded components for SCM

This commit is contained in:
deiflaender 2022-11-17 13:16:53 +01:00
parent 2cfcd3789a
commit 9ebf735360

View File

@ -101,14 +101,14 @@ public class RSSPoc2Service {
resultMap.put("Study_Title", getTitle(redactionLog));
resultMap.put("Report_Number", getReportNumber(redactionLog));
resultMap.put("PERFORMING_LABORATORY", getPerformingLaboratory(redactionLog));
resultMap.put("Performing_Laboratory", getPerformingLaboratory(redactionLog));
resultMap.put("Experimental_Starting_Date", getExperimentalStartDate(redactionLog));
resultMap.put("Experimental_Completion_Date", getExperimentalEndDate(redactionLog));
resultMap.put("GLP_Study", getGlpStudy(redactionLog));
resultMap.put("Certificate_of_Analysis_Batch_Identification", getBatchNumber(redactionLog));
resultMap.put("TEST_GUIDELINES_1", getTestGuideline1(redactionLog));
resultMap.put("Test_Guideline_1", getTestGuideline1(redactionLog));
var testGuideline2 = getTestGuideline2(redactionLog);
resultMap.put("TEST_GUIDELINES_2", testGuideline2 == null ? "" : testGuideline2);
resultMap.put("Test_Guideline_2", testGuideline2 == null ? "" : testGuideline2);
if (oecdIn(oecd, Set.of("402", "403", "404", "405", "425", "429", "436", "471"))) {
@ -117,7 +117,7 @@ public class RSSPoc2Service {
var guidelineDeviationSentences = getAsSentences(redactionLog, "guideline_deviation");
int i = 1;
for (String guidelineDeviationSentence : guidelineDeviationSentences) {
resultMap.put("Deviation_from_the_Guideline_Study_Plan_" + i, guidelineDeviationSentence);
resultMap.put("Deviation_from_the_Guideline_" + i, guidelineDeviationSentence);
i++;
}
}
@ -129,21 +129,31 @@ public class RSSPoc2Service {
}
if (oecdIn(oecd, Set.of("402", "403", "425", "436"))) {
resultMap.put("Conclusion_LD50_mg_per_l", getLd50Value(redactionLog));
resultMap.put("Conclusion_LD50_mg_per_mg", getLd50Value(redactionLog));
resultMap.put("Conclusion_LD50_Greater_than", getLd50GreaterThan(redactionLog));
resultMap.put("Conclusion_Minimum_Confidence", getConfidenceMinimal(redactionLog));
resultMap.put("Conclusion_Maximum_Confidence", getConfidenceMaximal(redactionLog));
}
if (oecdIn(oecd, Set.of("402", "403", "436"))) {
resultMap.put("Necropsy_findings", getLongestBlock(redactionLog, "necropsy_findings"));
if (oecdIn(oecd, Set.of("402"))) {
resultMap.put("Necropsy_Findings", getLongestBlock(redactionLog, "necropsy_findings"));
}
if (oecdIn(oecd, Set.of("403", "436"))) {
resultMap.put("Conducted_with_4_hours_of_Exposure", getAsOneBlock(redactionLog, "4h_exposure"));
var sentences = getAsSentences(redactionLog, "necropsy_findings");
int i = 1;
for (String sentence : sentences) {
resultMap.put("Necropsy_findings_" + i, sentence);
i++;
}
}
if (oecdIn(oecd, Set.of("406", "428", "438", "439", "471", "474", "487"))) {
if (oecdIn(oecd, Set.of("403", "436"))) {
resultMap.put("Conducted_within_4_Hours_of_Exposure", getAsOneBlock(redactionLog, "4h_exposure"));
}
if (oecdIn(oecd, Set.of("404","405", "429" ,"406", "428", "438", "439", "474", "487"))) {
resultMap.put("Study_Design", getAsOneBlock(redactionLog, "study_design"));
}
@ -155,28 +165,28 @@ public class RSSPoc2Service {
var weightBehaviorChangesSentences = getAsSentences(redactionLog, "weight_behavior_changes");
int i = 1;
for (String sentence : weightBehaviorChangesSentences) {
resultMap.put("Weight_Behavior_Change_" + i, sentence);
resultMap.put("Weight_Behavior_Changes" + i, sentence);
i++;
}
resultMap.put("Mortality_statement", getAsOneBlock(redactionLog, "mortality_statement"));
resultMap.put("Mortality_Statement", getAsOneBlock(redactionLog, "mortality_statement"));
}
if (oecdIn(oecd, Set.of("403"))) {
// resultMap.put("MMAD", getMmad(redactionLog)); // Out of scope
// resultMap.put("GSD", getGsd(redactionLog)); // Out of scope
var effectiveConcentrations = getEffectiveConcentrations(redactionLog);
Iterator<String> effectiveConcentrationsIterator = effectiveConcentrations.iterator();
int i = 1;
while (effectiveConcentrationsIterator.hasNext()) {
String effectiveConcentration = effectiveConcentrationsIterator.next();
resultMap.put("Effective_Concentration_mg_per_l_of_air_" + i, effectiveConcentration);
i++;
}
// var effectiveConcentrations = getEffectiveConcentrations(redactionLog);
// Iterator<String> effectiveConcentrationsIterator = effectiveConcentrations.iterator();
// int i = 1;
// while (effectiveConcentrationsIterator.hasNext()) {
// String effectiveConcentration = effectiveConcentrationsIterator.next();
// resultMap.put("Effective_Concentration_mg_per_l_of_air_" + i, effectiveConcentration);
// i++;
// }
var sentences = getAsSentences(redactionLog, "clinical_observations");
i = 1;
int i = 1;
for (String sentence : sentences) {
resultMap.put("Clinical_Observations_" + i, sentence);
i++;
@ -185,18 +195,18 @@ public class RSSPoc2Service {
sentences = getAsSentences(redactionLog, "bodyweight_changes");
i = 1;
for (String sentence : sentences) {
resultMap.put("Body_weight_changes_" + i, sentence);
resultMap.put("Body_Weight_Changes_" + i, sentence);
i++;
}
}
if (oecdIn(oecd, Set.of("404"))) {
resultMap.put("Dose_ml_per_animal", getDoseMlPerAnimal(redactionLog));
// if (oecdIn(oecd, Set.of("404"))) {
// resultMap.put("Dose_ml_per_animal", getDoseMlPerAnimal(redactionLog)); // Removed with RSS-212
// resultMap.put("Was_there_dilution_of_the_test_substance?", getDilution(redactionLog)); // Out of scope.
}
// }
if (oecdIn(oecd, Set.of("404", "405"))) {
resultMap.put("Detailing_of_reported_changes", getAsOneBlock(redactionLog, "detailing"));
resultMap.put("Detailing_of_Reported_Changes", getAsOneBlock(redactionLog, "detailing"));
}
if (oecdIn(oecd, Set.of("405", "429"))) {
@ -213,12 +223,7 @@ public class RSSPoc2Service {
i++;
}
var mortalitySentences = getAsSentences(redactionLog, "mortality");
i = 1;
for (String mortalitySentence : mortalitySentences) {
resultMap.put("Mortality_" + i, mortalitySentence);
i++;
}
resultMap.put("Mortality", getAsOneBlock(redactionLog, "mortality"));
resultMap.put("Dosages", getDosages(redactionLog));
}
@ -227,11 +232,11 @@ public class RSSPoc2Service {
var sentences = getAsSentences(redactionLog, "preliminary_test_results");
int i = 1;
for (String sentence : sentences) {
resultMap.put("Preliminary_test_results" + i, sentence);
resultMap.put("Preliminary_Test_Results_" + i, sentence);
i++;
}
resultMap.put("Test_results", getAsOneBlock(redactionLog, "test_results"));
resultMap.put("Test_Results", getAsOneBlock(redactionLog, "test_results"));
resultMap.put("Was_the_definitive_study_conducted_with_positive_control", getAsOneBlock(redactionLog, "positive_control"));
}
@ -333,18 +338,18 @@ public class RSSPoc2Service {
}
private String getDoseMlPerAnimal(RedactionLog redactionLog) {
var doseMlPerAnimal = redactionLog.getRedactionLogEntry().stream().filter(r -> r.getType().equals("dose_(ml_per_animal)")).map(RedactionLogEntry::getValue).findFirst();
return doseMlPerAnimal.orElse("");
}
// private String getDoseMlPerAnimal(RedactionLog redactionLog) {
//
// var doseMlPerAnimal = redactionLog.getRedactionLogEntry().stream().filter(r -> r.getType().equals("dose_(ml_per_animal)")).map(RedactionLogEntry::getValue).findFirst();
//
// return doseMlPerAnimal.orElse("");
// }
private Set<String> getEffectiveConcentrations(RedactionLog redactionLog) {
return redactionLog.getRedactionLogEntry().stream().filter(r -> r.getType().equals("effective_concentration")).map(RedactionLogEntry::getValue).collect(Collectors.toSet());
}
// private Set<String> getEffectiveConcentrations(RedactionLog redactionLog) {
//
// return redactionLog.getRedactionLogEntry().stream().filter(r -> r.getType().equals("effective_concentration")).map(RedactionLogEntry::getValue).collect(Collectors.toSet());
// }
// private String getGsd(RedactionLog redactionLog) {
//