-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
2,148 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/main/java/org/openelisglobal/reports/action/implementation/PatientPathologyReport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.openelisglobal.reports.action.implementation; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
import java.util.stream.Collectors; | ||
|
||
import org.openelisglobal.program.service.PathologyDisplayService; | ||
import org.openelisglobal.program.valueholder.pathology.PathologyConclusion; | ||
import org.openelisglobal.program.valueholder.pathology.PathologyConclusion.ConclusionType; | ||
import org.openelisglobal.program.valueholder.pathology.PathologySample; | ||
import org.openelisglobal.reports.form.ReportForm; | ||
import org.openelisglobal.spring.util.SpringContext; | ||
|
||
public class PatientPathologyReport extends PatientProgramReport{ | ||
protected PathologyDisplayService pathologyDisplayService = SpringContext.getBean(PathologyDisplayService.class); | ||
|
||
private PathologySample pathologySample; | ||
|
||
@Override | ||
protected String getReportName() { | ||
return "PatientPathologyReport"; | ||
} | ||
|
||
@Override | ||
protected void setAdditionalReportItems() { | ||
data.setGrossExam(pathologySample.getGrossExam()); | ||
data.setMicroExam(pathologySample.getMicroscopyExam()); | ||
pathologySample.getConclusions().size(); | ||
Optional<PathologyConclusion> conclusion = pathologySample.getConclusions().stream() | ||
.filter(e -> e.getType() == ConclusionType.TEXT).findFirst(); | ||
data.setTextConclusion(conclusion.get().getValue()); | ||
|
||
List<String> codedConclusions = pathologySample.getConclusions().stream().filter(e -> e.getType() == ConclusionType.DICTIONARY) | ||
.map(e -> dictionaryService.get(e.getValue()).getLocalizedName()) | ||
.collect(Collectors.toList()); | ||
String commaSeparatedString = String.join(", ", codedConclusions); | ||
data.setCodedConclusion(commaSeparatedString); | ||
} | ||
|
||
@Override | ||
protected void innitializeSample(ReportForm form) { | ||
pathologySample = pathologyDisplayService.getPathologySampleWithLoadedAtttributes(Integer.valueOf(form.getProgramSampleId())); | ||
sample = pathologySample.getSample(); | ||
} | ||
|
||
} |
Oops, something went wrong.