Commit 0311cf7c authored by Javi Corvi's avatar Javi Corvi
Browse files

export to srdomain

parent 123f6d78
Pipeline #32038 passed with stage
in 6 minutes and 9 seconds
......@@ -8,6 +8,7 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -36,6 +37,11 @@ public class DocumentController {
return documentService.findDocumentAnnotationsByDocumentId(id);
}
@GetMapping(value = "/documents/srdomain/{id}")
public DocumentAnnotations findSRDomainDocument(@PathVariable(value="id") Long id) {
return documentService.findDocumentSRDomainByDocumentId(id);
}
@RequestMapping("/document_data/{id}")
public Document findDocument(@PathVariable(value="id") Long id) {
return documentService.findByDocumentId(id);
......
......@@ -25,6 +25,8 @@ public class DocumentAnnotations {
private List<SRDomainFinding> srdomainfindings;
private List<FindingSR> findingsSR;
private Status status;
public DocumentAnnotations() {}
......@@ -87,6 +89,15 @@ public class DocumentAnnotations {
this.status = status;
}
public List<FindingSR> getFindingsSR() {
return findingsSR;
}
public void setFindingsSR(List<FindingSR> findingsSR) {
this.findingsSR = findingsSR;
}
......
package es.bsc.inb.etransafe.pretox.rest.api.model;
public class FindingSR {
//SRSEQ -- > Sequence number
private Long id;
//SRGRPDOS --> Group Dose Level, "20 mg/kg"
private String dose="";
//SPGRPCD --> Sponsor-defined Group Code, group 1 , A
private String group="";
//GRPLBL --> Sponsor-defined Group Name, "low dose", "mid dose"
private String groupQualifier="";
//SRSEX -- > Sex
private String sex="";
//SRDOMAIN --> Domain of Finding
private String domain="";
//SROBSV --> Manifestation of Finding, “I” (Increase), “D” (Decrease), “P” (Present) or “A” (Absent)
private String manifestationFinding="";
//SRSPEC --> Specimen of Finding
private String specimen="";
//SRTSTCD --> Test Short Name
private String studyTestCD="";
//SRFNDG --> Finding
private String finding="";
//SRORES --> Observation (original result)
private String abnormalObservationFreeText="";
//SRTRTEF --> Treatment-Related
private String isTreatmentRelated="";
//SRRISK --> Effect Level Associated with a Group/Sex, NOEL, LOEL, NOAEL, LOAEL, HNSTD, STD, MTD
private String risk="";
//SROBSQ --> Observation Qualifier, “R” (Reversible), “T” (Transient) or ‘none’
private String observationQualifier="";
//SRSIGF --> Statistical Significance
private String statisticalSignificance="";
//SRCOMNT --> Comment
private String comment="";
//SRSEV --> Severity of Finding
private String severity="";
//SRSTDY
private String dayStartOfFinding="";
//SRSTPHSE --> Study Phase of first Observation, “PRE-DOSING”, “DOSING”, “RECOVERY”
private String phaseOfFirstObservation="";
//SRENPHSE -->Study Phase of last Observation
private String phaseOfLastObservation="";
//SROBSTDY --> Start Phase Day of Observation
private String startPhaseDayOfObservation="";
//SRENDY --> ??
//SROBENDY --> ??
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getRisk() {
return risk;
}
public void setRisk(String risk) {
this.risk = risk;
}
public String getDose() {
return dose;
}
public void setDose(String dose) {
this.dose = dose;
}
public String getGroup() {
return group;
}
public void setGroup(String group) {
this.group = group;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
public String getGroupQualifier() {
return groupQualifier;
}
public void setGroupQualifier(String groupQualifier) {
this.groupQualifier = groupQualifier;
}
public String getObservationQualifier() {
return observationQualifier;
}
public void setObservationQualifier(String observationQualifier) {
this.observationQualifier = observationQualifier;
}
public String getDayStartOfFinding() {
return dayStartOfFinding;
}
public void setDayStartOfFinding(String dayStartOfFinding) {
this.dayStartOfFinding = dayStartOfFinding;
}
public String getPhaseOfFirstObservation() {
return phaseOfFirstObservation;
}
public void setPhaseOfFirstObservation(String phaseOfFirstObservation) {
this.phaseOfFirstObservation = phaseOfFirstObservation;
}
public String getPhaseOfLastObservation() {
return phaseOfLastObservation;
}
public void setPhaseOfLastObservation(String phaseOfLastObservation) {
this.phaseOfLastObservation = phaseOfLastObservation;
}
public String getStartPhaseDayOfObservation() {
return startPhaseDayOfObservation;
}
public void setStartPhaseDayOfObservation(String startPhaseDayOfObservation) {
this.startPhaseDayOfObservation = startPhaseDayOfObservation;
}
public String getManifestationFinding() {
return manifestationFinding;
}
public void setManifestationFinding(String manifestationFinding) {
this.manifestationFinding = manifestationFinding;
}
public String getSpecimen() {
return specimen;
}
public void setSpecimen(String specimen) {
this.specimen = specimen;
}
public String getStudyTestCD() {
return studyTestCD;
}
public void setStudyTestCD(String studyTestCD) {
this.studyTestCD = studyTestCD;
}
public String getFinding() {
return finding;
}
public void setFinding(String finding) {
this.finding = finding;
}
public String getAbnormalObservationFreeText() {
return abnormalObservationFreeText;
}
public void setAbnormalObservationFreeText(String abnormalObservationFreeText) {
this.abnormalObservationFreeText = abnormalObservationFreeText;
}
public String getSeverity() {
return severity;
}
public void setSeverity(String severity) {
this.severity = severity;
}
public String getStatisticalSignificance() {
return statisticalSignificance;
}
public void setStatisticalSignificance(String statisticalSignificance) {
this.statisticalSignificance = statisticalSignificance;
}
public String getIsTreatmentRelated() {
return isTreatmentRelated;
}
public void setIsTreatmentRelated(String isTreatmentRelated) {
this.isTreatmentRelated = isTreatmentRelated;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
}
......@@ -29,6 +29,7 @@ import es.bsc.inb.etransafe.pretox.rest.api.model.Document;
import es.bsc.inb.etransafe.pretox.rest.api.model.DocumentAnnotations;
import es.bsc.inb.etransafe.pretox.rest.api.model.DocumentTracking;
import es.bsc.inb.etransafe.pretox.rest.api.model.Finding;
import es.bsc.inb.etransafe.pretox.rest.api.model.FindingSR;
import es.bsc.inb.etransafe.pretox.rest.api.model.RecordState;
import es.bsc.inb.etransafe.pretox.rest.api.model.SRDomainFinding;
import es.bsc.inb.etransafe.pretox.rest.api.model.Status;
......@@ -76,7 +77,7 @@ public class DocumentServiceImpl implements DocumentService {
return documentAnnotationsRepository.findByDocumentId(id);
}
public DocumentAnnotations findDocumentSRDomainByDocumentId(Long id) {
public DocumentAnnotations findDocumentSRDomainByDocumentIdDeprecated(Long id) {
DocumentAnnotations docAnno = documentAnnotationsRepository.findByDocumentId(id);
List<SRDomainFinding> srdomains = new ArrayList<SRDomainFinding>();
for (Annotation sentence : docAnno.getRelevantSentences()) {
......@@ -92,6 +93,31 @@ public class DocumentServiceImpl implements DocumentService {
return docAnno;
}
public DocumentAnnotations findDocumentSRDomainByDocumentId(Long id) {
DocumentAnnotations docAnno = documentAnnotationsRepository.findByDocumentId(id);
List<FindingSR> srdomains = new ArrayList<FindingSR>();
for (Annotation sentence : docAnno.getRelevantSentences()) {
for (Finding finding : sentence.getFindings()) {
for (SRDomainFinding sr : finding.getSrDomainFindings()) {
FindingSR f = new FindingSR();
f.setAbnormalObservationFreeText(sr.getSRORES());
f.setFinding(sr.getSRFNDG());
f.setSex(sr.getSRSEX());
f.setSpecimen(sr.getSRSPEC());
f.setStudyTestCD(sr.getSRTSTCD());
srdomains.add(f);
}
}
}
docAnno.setFindingsSR(srdomains);
docAnno.setRelevantSentences(null);
docAnno.setFindings(null);
return docAnno;
}
public Document findByDocumentId2(Long id) {
documentRepository.findByDocumentId(id);
return documentRepository.findByDocumentId(id);
......
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