Commit f6c3b0f1 authored by javi's avatar javi
Browse files

error in export

parent 91c4a57c
Pipeline #22675 passed with stage
in 5 minutes and 37 seconds
......@@ -45,6 +45,8 @@ public class DocumentServiceImpl implements DocumentService {
@Autowired
public DocumentAnnotationsRepository documentAnnotationsRepository;
static final Map<String, String> ANNOTATION_CLASS_STYLE = createMap();
public List<Document> findAll() {
return documentRepository.findAllNamesByOrderByName();
}
......@@ -85,25 +87,7 @@ public class DocumentServiceImpl implements DocumentService {
documentRepository.findByDocumentId(id);
return documentRepository.findByDocumentId(id);
}
static final Map<String, String> ANNOTATION_CLASS_STYLE = createMap();
// @Override
// public String findTextSnippetByDocumentIdAndFindingId(Long id, Integer findingId) {
// Document document = this.findByDocumentId(id);
// Finding findingSelected = null;
// for (Finding finding : document.getFindings()) {
// if(finding.getFindingId().equals(findingId)) {
// findingSelected = finding;
// break;
// }
// }
// if(findingSelected!=null) {
// return this.generateFindingSnippet(document.getText(), findingSelected);
// }
// return "";
// }
@Override
public String findTextSnippetByDocumentIdAndFindingId2(Long id, Integer findingId) {
......@@ -111,12 +95,10 @@ public class DocumentServiceImpl implements DocumentService {
Document document = this.findByDocumentId(id);
Finding findingSelected = null;
for (Finding finding : documentAnnotations.getFindings()) {
if(finding.getSrDomainFindings()!=null) {
if(finding.getFindingId().equals(findingId)) {
if(finding.getFindingId().equals(findingId)) {
findingSelected = finding;
break;
}
}
}
if(findingSelected!=null) {
......@@ -270,84 +252,84 @@ public class DocumentServiceImpl implements DocumentService {
StringBuilder retStr = new StringBuilder("");
retStr.append("STUDYID|DOMAIN|SRSEQ|SRRISK|SPGRPCD|GRPLBL|SRGRPDOS|SRSEX|SRSTDY|SRSTPHSE|SROBSTDY|SRENDY|SRENPHSE|SROBENDY|SRDOMAIN|SRSPEC|SRTSTCD|SRFNDG|SRORES|SROBSV|SROBSQ|SRSEV|SRPCNT|SRSIGF|SRTRTEF|SRCOMNT");
retStr.append(System.getProperty("line.separator"));
for (Finding finding : documentAnnotations.getFindings()) {
if(finding.getSrDomainFindings()!=null) {
for (SRDomainFinding srDomainFinding : finding.getSrDomainFindings()) {
//STUDYID -- > Study Identifier
retStr.append(id);
retStr.append("|");
//DOMAIN -- > Domain Abbreviation, always SR
retStr.append("SR");
retStr.append("|");
//SRSEQ -- > Sequence number
retStr.append("");
retStr.append("|");
//SRRISK --> Effect Level Associated with a Group/Sex, NOEL, LOEL, NOAEL, LOAEL, HNSTD, STD, MTD
retStr.append(srDomainFinding.getSRRISK()==null?"":srDomainFinding.getSRRISK());
retStr.append("|");
//SPGRPCD --> Sponsor-defined Group Code, group 1 , A
retStr.append(srDomainFinding.getSPGRPCD()==null?"":srDomainFinding.getSPGRPCD());
retStr.append("|");
//GRPLBL --> Sponsor-defined Group Name, "low dose", "mid dose"
retStr.append(srDomainFinding.getGRPLBL()==null?"":srDomainFinding.getGRPLBL());
retStr.append("|");
//SRGRPDOS --> Group Dose Level, "20 mg/kg"
retStr.append(srDomainFinding.getSRGRPDOS()==null?"":srDomainFinding.getSRGRPDOS());
retStr.append("|");
//SRSEX -- > Sex
retStr.append(srDomainFinding.getSRSEX()==null?"":srDomainFinding.getSRSEX());
retStr.append("|");
//SRSTDY --> Study Day of Start of Finding
retStr.append("");
retStr.append("|");
//SRSTPHSE --> Study Phase of first Observation, “PRE-DOSING”, “DOSING”, “RECOVERY”
retStr.append("");
retStr.append("|");
//SROBSTDY --> Start Phase Day of Observation
retStr.append("");
retStr.append("|");
//SRENPHSE -->Study Phase of last Observation
retStr.append("");
retStr.append("|");
//SRDOMAIN --> Domain of Finding
retStr.append(srDomainFinding.getSRDOMAIN()==null?"":srDomainFinding.getSRDOMAIN());
retStr.append("|");
//SRSPEC --> Specimen of Finding
retStr.append(srDomainFinding.getSRSPEC()==null?"":srDomainFinding.getSRSPEC());
retStr.append("|");
//SRTSTCD --> Test Short Name
retStr.append(srDomainFinding.getSRTSTCD()==null?"":srDomainFinding.getSRTSTCD());
retStr.append("|");
//SRFNDG --> Finding
retStr.append(srDomainFinding.getSRFNDG()==null?"":srDomainFinding.getSRFNDG());
retStr.append("|");
//SRORES --> Observation (original result)
retStr.append(srDomainFinding.getSRORES()==null?"":srDomainFinding.getSRORES());
retStr.append("|");
//SROBSV --> Manifestation of Finding, “I” (Increase), “D” (Decrease), “P” (Present) or “A” (Absent)
retStr.append(srDomainFinding.getSROBSV()==null?"":srDomainFinding.getSROBSV());
retStr.append("|");
//SROBSQ --> Observation Qualifier, “R” (Reversible), “T” (Transient) or ‘none’
retStr.append(srDomainFinding.getSROBSQ()==null?"":srDomainFinding.getSROBSQ());
retStr.append("|");
//SRSEV --> Severity of Finding
retStr.append("");
retStr.append("|");
//SRPCNT --> Scale of this Finding
retStr.append("");
retStr.append("|");
//SRSIGF --> Statistical Significance
retStr.append(srDomainFinding.getSRSIGF()==null?"":srDomainFinding.getSRSIGF());
retStr.append("|");
//SRTRTEF --> Treatment-Related
retStr.append(srDomainFinding.getSRTRTEF()==null?"":srDomainFinding.getSRTRTEF());
retStr.append("|");
//SRCOMNT --> Comment
retStr.append("\n");
for (Annotation relevantSentences : documentAnnotations.getRelevantSentences()) {
for (Finding finding : relevantSentences.getFindings()) {
if(finding.getSrDomainFindings()!=null) {
for (SRDomainFinding srDomainFinding : finding.getSrDomainFindings()) {
//STUDYID -- > Study Identifier
retStr.append(id);
retStr.append("|");
//DOMAIN -- > Domain Abbreviation, always SR
retStr.append("SR");
retStr.append("|");
//SRSEQ -- > Sequence number
retStr.append("");
retStr.append("|");
//SRRISK --> Effect Level Associated with a Group/Sex, NOEL, LOEL, NOAEL, LOAEL, HNSTD, STD, MTD
retStr.append(srDomainFinding.getSRRISK()==null?"":srDomainFinding.getSRRISK());
retStr.append("|");
//SPGRPCD --> Sponsor-defined Group Code, group 1 , A
retStr.append(srDomainFinding.getSPGRPCD()==null?"":srDomainFinding.getSPGRPCD());
retStr.append("|");
//GRPLBL --> Sponsor-defined Group Name, "low dose", "mid dose"
retStr.append(srDomainFinding.getGRPLBL()==null?"":srDomainFinding.getGRPLBL());
retStr.append("|");
//SRGRPDOS --> Group Dose Level, "20 mg/kg"
retStr.append(srDomainFinding.getSRGRPDOS()==null?"":srDomainFinding.getSRGRPDOS());
retStr.append("|");
//SRSEX -- > Sex
retStr.append(srDomainFinding.getSRSEX()==null?"":srDomainFinding.getSRSEX());
retStr.append("|");
//SRSTDY --> Study Day of Start of Finding
retStr.append("");
retStr.append("|");
//SRSTPHSE --> Study Phase of first Observation, “PRE-DOSING”, “DOSING”, “RECOVERY”
retStr.append("");
retStr.append("|");
//SROBSTDY --> Start Phase Day of Observation
retStr.append("");
retStr.append("|");
//SRENPHSE -->Study Phase of last Observation
retStr.append("");
retStr.append("|");
//SRDOMAIN --> Domain of Finding
retStr.append(srDomainFinding.getSRDOMAIN()==null?"":srDomainFinding.getSRDOMAIN());
retStr.append("|");
//SRSPEC --> Specimen of Finding
retStr.append(srDomainFinding.getSRSPEC()==null?"":srDomainFinding.getSRSPEC());
retStr.append("|");
//SRTSTCD --> Test Short Name
retStr.append(srDomainFinding.getSRTSTCD()==null?"":srDomainFinding.getSRTSTCD());
retStr.append("|");
//SRFNDG --> Finding
retStr.append(srDomainFinding.getSRFNDG()==null?"":srDomainFinding.getSRFNDG());
retStr.append("|");
//SRORES --> Observation (original result)
retStr.append(srDomainFinding.getSRORES()==null?"":srDomainFinding.getSRORES());
retStr.append("|");
//SROBSV --> Manifestation of Finding, “I” (Increase), “D” (Decrease), “P” (Present) or “A” (Absent)
retStr.append(srDomainFinding.getSROBSV()==null?"":srDomainFinding.getSROBSV());
retStr.append("|");
//SROBSQ --> Observation Qualifier, “R” (Reversible), “T” (Transient) or ‘none’
retStr.append(srDomainFinding.getSROBSQ()==null?"":srDomainFinding.getSROBSQ());
retStr.append("|");
//SRSEV --> Severity of Finding
retStr.append("");
retStr.append("|");
//SRPCNT --> Scale of this Finding
retStr.append("");
retStr.append("|");
//SRSIGF --> Statistical Significance
retStr.append(srDomainFinding.getSRSIGF()==null?"":srDomainFinding.getSRSIGF());
retStr.append("|");
//SRTRTEF --> Treatment-Related
retStr.append(srDomainFinding.getSRTRTEF()==null?"":srDomainFinding.getSRTRTEF());
retStr.append("|");
//SRCOMNT --> Comment
retStr.append("\n");
}
}
}
}
return retStr.toString().getBytes(Charset.forName("UTF-8"));
}
......
Supports Markdown
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