RED-2167: null-values for textBefore and textAfter replaced with an empty string
This commit is contained in:
parent
f62ecdf3fa
commit
878535b326
@ -14,6 +14,7 @@ import com.iqser.red.service.redaction.v1.model.ChangeType;
|
||||
import com.iqser.red.service.redaction.v1.model.ManualRedactionType;
|
||||
import com.iqser.red.service.redaction.v1.model.Rectangle;
|
||||
import com.iqser.red.service.redaction.v1.model.RedactionLog;
|
||||
import com.iqser.red.service.redaction.v1.model.RedactionLogEntry;
|
||||
import com.iqser.red.service.redaction.v1.model.Status;
|
||||
|
||||
@Service
|
||||
@ -65,7 +66,7 @@ public class RedactionLogConverterService {
|
||||
.filter(lbm -> lbm.getReason().equalsIgnoreCase(entry.getLegalBasis()))
|
||||
.findAny()
|
||||
.map(LegalBasisMapping::getDescription)
|
||||
.orElse(""), entry.getTextBefore() + entry.getValue() + entry.getTextAfter()));
|
||||
.orElse(""), checkTextForNull(entry.getTextBefore()) + entry.getValue() + checkTextForNull(entry.getTextAfter())));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -85,4 +86,12 @@ public class RedactionLogConverterService {
|
||||
return reportEntries;
|
||||
}
|
||||
|
||||
private String checkTextForNull(String text) {
|
||||
if(text == null) {
|
||||
return "";
|
||||
}
|
||||
return text;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -308,12 +308,12 @@ public class RedactionReportIntegrationTest {
|
||||
|
||||
String dossierTemplateId = "dossierTemplateId";
|
||||
|
||||
ClassPathResource redactionLogResource = new ClassPathResource("files/Seite13log.json");
|
||||
ClassPathResource redactionLogResource = new ClassPathResource("files/S11RedactionLog.json");
|
||||
ClassPathResource imageResource = new ClassPathResource("files/exampleImage.jpg");
|
||||
|
||||
RedactionLog redactionLog = objectMapper.readValue(redactionLogResource.getInputStream(), RedactionLog.class);
|
||||
|
||||
ClassPathResource legalBasisMappingResource = new ClassPathResource("files/legal13.json");
|
||||
ClassPathResource legalBasisMappingResource = new ClassPathResource("files/S1116LegalBasis.json");
|
||||
|
||||
List<LegalBasisMapping> legalBasisMapping = objectMapper.readValue(legalBasisMappingResource.getInputStream(), new TypeReference<>() {
|
||||
});
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
[
|
||||
{
|
||||
"name": "1.1 personal data (incl. geolocation); Article 39(e)(1)",
|
||||
"description": "any other personal data except for\n a. the name and address of the applicant;\n b. the names of authors of published or publicly available studies supporting such requests; and the names of all participants and observers in meetings of the Scientific Committee and the Scientific Panels, their working groups and any other ad hoc group meeting on the subject matter.",
|
||||
"reason": "Article 39(e)(1) of Regulation (EC) No 178/2002"
|
||||
},
|
||||
{
|
||||
"name": "1.2 vertebrate study related personal data (incl. geolocation); Article 39(e)(2)",
|
||||
"description": "personal data (names and addresses) of individuals involved in testing on vertebrate studies or in obtaining toxicological information",
|
||||
"reason": "Article 39(e)(2) of Regulation (EC) No 178/2002"
|
||||
},
|
||||
{
|
||||
"name": "2. manufacturing or production process",
|
||||
"description": "the manufacturing or production process, including the method and innovative aspects thereof, as well as other technical and industrial specifications inherent to that process or method, except for information which is relevant to the assessment of safety",
|
||||
"reason": "Article 63(2)(a) of Regulation (EC) No 1107/2009 (making reference to Article 39 of Regulation EC No 178/2002)"
|
||||
},
|
||||
{
|
||||
"name": "3. links between a producer and applicant",
|
||||
"description": "commercial links between a producer or importer and the applicant or the authorisation holder, where applicable",
|
||||
"reason": "Article 63(2)(a) of Regulation (EC) No 1107/2009 (making reference to Article 39 of Regulation EC No 178/2002)"
|
||||
},
|
||||
{
|
||||
"name": "4. commercial information",
|
||||
"description": "commercial information revealing sourcing, market shares or business strategy of the applicant",
|
||||
"reason": "Article 63(2)(a) of Regulation (EC) No 1107/2009 (making reference to Article 39 of Regulation EC No 178/2002)"
|
||||
},
|
||||
{
|
||||
"name": "5. quantitative composition",
|
||||
"description": "quantitative composition of the subject matter of the request, except for information which is relevant to the assessment of safety",
|
||||
"reason": "Article 63(2)(a) of Regulation (EC) No 1107/2009 (making reference to Article 39 of Regulation EC No 178/2002)"
|
||||
},
|
||||
{
|
||||
"name": "6. specification of impurity",
|
||||
"description": "the specification of impurity of the active substance and the related methods of analysis for impurities in the active substance as manufactured, except for the impurities that are considered to be toxicologically, ecotoxicologically or environmentally relevant and the related methods of analysis for such impurities",
|
||||
"reason": "Article 63(2)(b) of Regulation (EC) No 1107/2009"
|
||||
},
|
||||
{
|
||||
"name": "7. results of production batches",
|
||||
"description": "results of production batches of the active substance including impurities",
|
||||
"reason": "Article 63(2)(c) of Regulation (EC) No 1107/2009"
|
||||
},
|
||||
{
|
||||
"name": "8. composition of a plant protection product",
|
||||
"description": "information on the complete composition of a plant protection product",
|
||||
"reason": "Article 63(2)(d) of Regulation (EC) No 1107/2009"
|
||||
}
|
||||
]
|
||||
@ -0,0 +1,275 @@
|
||||
{
|
||||
"analysisVersion": 1,
|
||||
"redactionLogEntry": [
|
||||
{
|
||||
"id": "c65033cf94d9d0011cbb45184225e2c6",
|
||||
"type": "CBI_address",
|
||||
"value": "Syngenta Crop Protection AG CH 4002 – Basel Switzerland",
|
||||
"reason": "Address found",
|
||||
"matchedRule": 3,
|
||||
"legalBasis": "Article 39(e)(1) of Regulation (EC) No 178/2002",
|
||||
"redacted": true,
|
||||
"section": "Table in: ",
|
||||
"color": [
|
||||
0.5764706,
|
||||
0.59607846,
|
||||
0.627451
|
||||
],
|
||||
"positions": [
|
||||
{
|
||||
"topLeft": {
|
||||
"x": 301.27,
|
||||
"y": 687.38
|
||||
},
|
||||
"width": 120.99826,
|
||||
"height": 10.526819,
|
||||
"page": 1
|
||||
},
|
||||
{
|
||||
"topLeft": {
|
||||
"x": 301.27,
|
||||
"y": 675.86
|
||||
},
|
||||
"width": 69.64087,
|
||||
"height": 10.526819,
|
||||
"page": 1
|
||||
},
|
||||
{
|
||||
"topLeft": {
|
||||
"x": 301.27,
|
||||
"y": 664.34
|
||||
},
|
||||
"width": 48.55905,
|
||||
"height": 10.526819,
|
||||
"page": 1
|
||||
}
|
||||
],
|
||||
"sectionNumber": 2,
|
||||
"manual": false,
|
||||
"status": null,
|
||||
"manualRedactionType": null,
|
||||
"manualRedactionUserId": null,
|
||||
"textBefore": null,
|
||||
"textAfter": null,
|
||||
"comments": null,
|
||||
"startOffset": 148,
|
||||
"endOffset": 203,
|
||||
"imageHasTransparency": false,
|
||||
"excluded": false,
|
||||
"recategorizationType": null,
|
||||
"legalBasisChangeValue": null,
|
||||
"changes": [
|
||||
{
|
||||
"type": "ADDED",
|
||||
"dateTime": "2021-09-20T15:30:11.024443Z"
|
||||
}
|
||||
],
|
||||
"engines": [
|
||||
"DICTIONARY"
|
||||
],
|
||||
"reference": [],
|
||||
"hint": false,
|
||||
"recommendation": false,
|
||||
"dictionaryEntry": true,
|
||||
"image": false,
|
||||
"dossierDictionaryEntry": false
|
||||
},
|
||||
{
|
||||
"id": "dbf366de6f9338b6246a1555058bf652",
|
||||
"type": "CBI_address",
|
||||
"value": "Syngenta Crop Protection AG Schwarzwaldalle 215 P.O. Box CH-4002 Basel Switzerland",
|
||||
"reason": "Address found",
|
||||
"matchedRule": 3,
|
||||
"legalBasis": "Article 39(e)(1) of Regulation (EC) No 178/2002",
|
||||
"redacted": true,
|
||||
"section": "Table in: ",
|
||||
"color": [
|
||||
0.5764706,
|
||||
0.59607846,
|
||||
0.627451
|
||||
],
|
||||
"positions": [
|
||||
{
|
||||
"topLeft": {
|
||||
"x": 301.27,
|
||||
"y": 745.34
|
||||
},
|
||||
"width": 120.99826,
|
||||
"height": 10.526819,
|
||||
"page": 1
|
||||
},
|
||||
{
|
||||
"topLeft": {
|
||||
"x": 301.27,
|
||||
"y": 733.82
|
||||
},
|
||||
"width": 86.676025,
|
||||
"height": 10.526819,
|
||||
"page": 1
|
||||
},
|
||||
{
|
||||
"topLeft": {
|
||||
"x": 301.27,
|
||||
"y": 722.3
|
||||
},
|
||||
"width": 37.971527,
|
||||
"height": 10.526819,
|
||||
"page": 1
|
||||
},
|
||||
{
|
||||
"topLeft": {
|
||||
"x": 301.27,
|
||||
"y": 710.9
|
||||
},
|
||||
"width": 62.99005,
|
||||
"height": 10.526819,
|
||||
"page": 1
|
||||
},
|
||||
{
|
||||
"topLeft": {
|
||||
"x": 301.27,
|
||||
"y": 699.38
|
||||
},
|
||||
"width": 48.55905,
|
||||
"height": 10.526819,
|
||||
"page": 1
|
||||
}
|
||||
],
|
||||
"sectionNumber": 2,
|
||||
"manual": false,
|
||||
"status": null,
|
||||
"manualRedactionType": null,
|
||||
"manualRedactionUserId": null,
|
||||
"textBefore": null,
|
||||
"textAfter": null,
|
||||
"comments": null,
|
||||
"startOffset": 17,
|
||||
"endOffset": 99,
|
||||
"imageHasTransparency": false,
|
||||
"excluded": false,
|
||||
"recategorizationType": null,
|
||||
"legalBasisChangeValue": null,
|
||||
"changes": [
|
||||
{
|
||||
"type": "ADDED",
|
||||
"dateTime": "2021-09-20T15:30:11.024476Z"
|
||||
}
|
||||
],
|
||||
"engines": [
|
||||
"DICTIONARY"
|
||||
],
|
||||
"reference": [],
|
||||
"hint": false,
|
||||
"recommendation": false,
|
||||
"dictionaryEntry": true,
|
||||
"image": false,
|
||||
"dossierDictionaryEntry": false
|
||||
},
|
||||
{
|
||||
"id": "c0ab0793f4bd54dc02e09606ad58583f",
|
||||
"type": "false_positive",
|
||||
"value": "Field",
|
||||
"reason": null,
|
||||
"matchedRule": 0,
|
||||
"legalBasis": null,
|
||||
"redacted": false,
|
||||
"section": "Table in: ",
|
||||
"color": [
|
||||
1,
|
||||
0.80784315,
|
||||
0.80784315
|
||||
],
|
||||
"positions": [
|
||||
{
|
||||
"topLeft": {
|
||||
"x": 105.14,
|
||||
"y": 405.23
|
||||
},
|
||||
"width": 24.537277,
|
||||
"height": 10.929359,
|
||||
"page": 1
|
||||
}
|
||||
],
|
||||
"sectionNumber": 2,
|
||||
"manual": false,
|
||||
"status": null,
|
||||
"manualRedactionType": null,
|
||||
"manualRedactionUserId": null,
|
||||
"textBefore": null,
|
||||
"textAfter": null,
|
||||
"comments": null,
|
||||
"startOffset": 868,
|
||||
"endOffset": 873,
|
||||
"imageHasTransparency": false,
|
||||
"excluded": false,
|
||||
"recategorizationType": null,
|
||||
"legalBasisChangeValue": null,
|
||||
"changes": [
|
||||
{
|
||||
"type": "ADDED",
|
||||
"dateTime": "2021-09-20T15:30:11.024482Z"
|
||||
}
|
||||
],
|
||||
"engines": [
|
||||
"DICTIONARY"
|
||||
],
|
||||
"reference": [],
|
||||
"hint": true,
|
||||
"recommendation": false,
|
||||
"dictionaryEntry": true,
|
||||
"image": false,
|
||||
"dossierDictionaryEntry": false
|
||||
}
|
||||
],
|
||||
"legalBasis": [
|
||||
{
|
||||
"name": "1.1 personal data (incl. geolocation); Article 39(e)(1)",
|
||||
"description": "any other personal data except for\n a. the name and address of the applicant;\n b. the names of authors of published or publicly available studies supporting such requests; and the names of all participants and observers in meetings of the Scientific Committee and the Scientific Panels, their working groups and any other ad hoc group meeting on the subject matter.",
|
||||
"reason": "Article 39(e)(1) of Regulation (EC) No 178/2002"
|
||||
},
|
||||
{
|
||||
"name": "1.2 vertebrate study related personal data (incl. geolocation); Article 39(e)(2)",
|
||||
"description": "personal data (names and addresses) of individuals involved in testing on vertebrate studies or in obtaining toxicological information",
|
||||
"reason": "Article 39(e)(2) of Regulation (EC) No 178/2002"
|
||||
},
|
||||
{
|
||||
"name": "2. manufacturing or production process",
|
||||
"description": "the manufacturing or production process, including the method and innovative aspects thereof, as well as other technical and industrial specifications inherent to that process or method, except for information which is relevant to the assessment of safety",
|
||||
"reason": "Article 63(2)(a) of Regulation (EC) No 1107/2009 (making reference to Article 39 of Regulation EC No 178/2002)"
|
||||
},
|
||||
{
|
||||
"name": "3. links between a producer and applicant",
|
||||
"description": "commercial links between a producer or importer and the applicant or the authorisation holder, where applicable",
|
||||
"reason": "Article 63(2)(a) of Regulation (EC) No 1107/2009 (making reference to Article 39 of Regulation EC No 178/2002)"
|
||||
},
|
||||
{
|
||||
"name": "4. commercial information",
|
||||
"description": "commercial information revealing sourcing, market shares or business strategy of the applicant",
|
||||
"reason": "Article 63(2)(a) of Regulation (EC) No 1107/2009 (making reference to Article 39 of Regulation EC No 178/2002)"
|
||||
},
|
||||
{
|
||||
"name": "5. quantitative composition",
|
||||
"description": "quantitative composition of the subject matter of the request, except for information which is relevant to the assessment of safety",
|
||||
"reason": "Article 63(2)(a) of Regulation (EC) No 1107/2009 (making reference to Article 39 of Regulation EC No 178/2002)"
|
||||
},
|
||||
{
|
||||
"name": "6. specification of impurity",
|
||||
"description": "the specification of impurity of the active substance and the related methods of analysis for impurities in the active substance as manufactured, except for the impurities that are considered to be toxicologically, ecotoxicologically or environmentally relevant and the related methods of analysis for such impurities",
|
||||
"reason": "Article 63(2)(b) of Regulation (EC) No 1107/2009"
|
||||
},
|
||||
{
|
||||
"name": "7. results of production batches",
|
||||
"description": "results of production batches of the active substance including impurities",
|
||||
"reason": "Article 63(2)(c) of Regulation (EC) No 1107/2009"
|
||||
},
|
||||
{
|
||||
"name": "8. composition of a plant protection product",
|
||||
"description": "information on the complete composition of a plant protection product",
|
||||
"reason": "Article 63(2)(d) of Regulation (EC) No 1107/2009"
|
||||
}
|
||||
],
|
||||
"dictionaryVersion": 24,
|
||||
"dossierDictionaryVersion": 1,
|
||||
"rulesVersion": 1,
|
||||
"legalBasisVersion": 1
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user