Commit fed1eea3 authored by jcorvi's avatar jcorvi
Browse files

Merge branch 'allevidence_2' into 'allevidence'

new version of tabs and bug fixes

See merge request !12
parents b829daf6 fe30117a
Pipeline #25780 passed with stage
in 2 seconds
......@@ -76,6 +76,12 @@ public class DocumentController {
return "true";
}
@RequestMapping("/documents/{id}/srFindingValidation/{srDomainId}/{status}")
public String setSRFindingValidation(@PathVariable(value="id") Long id, @PathVariable(value="srDomainId") Integer srDomainId, @PathVariable(value="status") String status) {
documentService.setValidationSRDomainFinding(id, srDomainId, status);
return "true";
}
@RequestMapping("/documents/{id}/findingValidation/{findingId}/{status}")
public String setFindingValidation(@PathVariable(value="id") Long id, @PathVariable(value="findingId") Integer findingId, @PathVariable(value="status") String status) {
documentService.setFindingValidation(id, findingId, status);
......
......@@ -40,6 +40,22 @@ public class SRDomainFinding implements Cloneable{
private String SRTRTEF="";
private String SRCOMNT="";
private Boolean export;
private Integer findingId;
private Integer srDomainId;
private String status="non_curated";
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getSrdomain_value() {
return SRDOMAIN_DESC + "(" + SRDOMAIN + ")";
}
......@@ -72,9 +88,7 @@ public class SRDomainFinding implements Cloneable{
return SRSPEC_DESC + "(" + SRSPEC + ")";
}
private Boolean export;
private Integer findingId;
private Integer srDomainId;
public String getSTUDYID() {
return STUDYID;
......
......@@ -36,6 +36,8 @@ public interface DocumentService {
Boolean setExportSRDomainFinding(Long id, Integer findingId, Boolean export_srdomain);
Boolean setValidationSRDomainFinding(Long id, Integer srDomainFindingId,String status);
Boolean setFindingValidation(Long id, Integer findingId,String status);
Status moveDocument(Long id, Status status);
......
......@@ -128,8 +128,34 @@ public class DocumentServiceImpl implements DocumentService {
return false;
}
@Override
public Boolean setValidationSRDomainFinding(Long id, Integer srDomainFindingId, String status) {
DocumentAnnotations documentAnnotations = this.findDocumentAnnotationsByDocumentId(id);
SRDomainFinding srDomainFindingelected = null;
for (Annotation annotation : documentAnnotations.getRelevantSentences()) {
for (Finding finding : annotation.getFindings()) {
for (SRDomainFinding srDomainFinding : finding.getSrDomainFindings()) {
if(srDomainFinding.getSrDomainId().equals(srDomainFindingId)) {
srDomainFindingelected = srDomainFinding;
break;
}
}
}
}
if(srDomainFindingelected!=null) {
//https://stackoverflow.com/questions/47699646/updating-replacing-a-deeply-nested-object-in-mongodb-with-spring-data-mongodb
srDomainFindingelected.setStatus(status);
documentAnnotationsRepository.save(documentAnnotations);
createTracking(id, "admin", Action.ACCEPT, srDomainFindingelected.getTrackingSummary());
return true;
}
return false;
}
@Override
public Boolean setExportSRDomainFinding(Long id, Integer srDomainId,Boolean export_srdomainfinding) {
System.out.println("Entra:"+srDomainId);
DocumentAnnotations documentAnnotations = this.findDocumentAnnotationsByDocumentId(id);
SRDomainFinding sRDomainFindingSelected = null;
for (Annotation annotation : documentAnnotations.getRelevantSentences()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment