Skip to content

Commit

Permalink
Add coded conclusions to IHC report
Browse files Browse the repository at this point in the history
  • Loading branch information
mozzy11 committed Aug 27, 2024
1 parent eb4a17d commit d09a123
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ function ImmunohistochemistryCaseView() {
const [immunohistochemistrySampleInfo, setImmunohistochemistrySampleInfo] =
useState({ labNumber: "" });

const [pathologySampleInfo, setPathologySampleInfo] = useState({});
const [conclusions, setConclusions] = useState([]);

const [statuses, setStatuses] = useState([]);
Expand Down Expand Up @@ -88,6 +87,7 @@ function ImmunohistochemistryCaseView() {
diagnosis: "",
molecularSubType: "",
conclusion: "",
codedConclusions: [],
ihcScore: "",
ihcRatio: "",
averageChrom: "",
Expand Down Expand Up @@ -671,35 +671,44 @@ function ImmunohistochemistryCaseView() {
<Grid fullWidth={true} className="gridBoundary">
<Column lg={16} md={8} sm={4}>
<Grid fullWidth={true} className="gridBoundary">
<Column lg={3} md={8} sm={4}>
<FormattedMessage id="pathology.label.conclusion" />
</Column>
<Column lg={4} md={8} sm={4}>
<FilterableMultiSelect
id="conclusion"
titleText={
<FormattedMessage id="pathology.label.conclusion" />
}
titleText=""
items={conclusions}
itemToString={(item) => (item ? item.value : "")}
initialSelectedItems={pathologySampleInfo.conclusions}
initialSelectedItems={
reportParams[index]?.codedConclusions
}
onChange={(changes) => {
setPathologySampleInfo({
...pathologySampleInfo,
conclusions: changes.selectedItems,
});
var params = { ...reportParams };
if (!params[index]) {
params[index] = {};
}
params[index].codedConclusions =
changes.selectedItems;
setReportParams(params);
}}
selectionFeedback="top-after-reopen"
/>
</Column>
<Column lg={12} md={8} sm={4}>
{pathologySampleInfo.conclusions &&
pathologySampleInfo.conclusions.map(
(conclusion, index) => (
<Column lg={8} md={8} sm={4}>
{reportParams[index] &&
reportParams[index]?.codedConclusions.map(
(conclusion, conclusionIndex) => (
<Tag
key={index}
key={conclusionIndex}
filter
onClose={() => {
var info = { ...pathologySampleInfo };
info["conclusions"].splice(index, 1);
setPathologySampleInfo(info);
var params = { ...reportParams };
params[index]["codedConclusions"].splice(
conclusionIndex,
1,
);
setReportParams(params);
}}
>
{conclusion.value}
Expand All @@ -710,7 +719,7 @@ function ImmunohistochemistryCaseView() {
</Grid>
</Column>
<Column lg={3} md={8} sm={4}>
<FormattedMessage id="pathology.label.conclusion" />
<FormattedMessage id="pathology.label.textconclusion" />
</Column>
<Column lg={13} md={8} sm={4}>
<TextArea
Expand Down Expand Up @@ -1215,6 +1224,7 @@ function ImmunohistochemistryCaseView() {
averageHer2: reportParams[index]?.averageHer2,
numberOfcancerNuclei:
reportParams[index]?.numberOfcancerNuclei,
codedConclusions : reportParams[index]?.codedConclusions.map(conclusion => conclusion.id)
};
postToOpenElisServerForPDF(
"/rest/ReportPrint",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.util.ArrayList;
import java.util.List;

import java.util.stream.Collectors;
import org.openelisglobal.analysis.valueholder.Analysis;
import org.openelisglobal.program.service.ImmunohistochemistrySampleService;
import org.openelisglobal.program.valueholder.immunohistochemistry.ImmunohistochemistrySample;
Expand Down Expand Up @@ -36,6 +38,10 @@ protected void setAdditionalReportItems() {
resultsData.add(resultData);
});
data.setResults(resultsData);
if(form.getCodedConclusions() != null){
List<String> codedConclusions = form.getCodedConclusions().stream().map(e -> dictionaryService.get(e).getLocalizedName()).collect(Collectors.toList());
data.setCodedConclusion(codedConclusions);
}
data.setTextConclusion(form.getConclusion());
}

Expand Down
11 changes: 11 additions & 0 deletions src/main/java/org/openelisglobal/reports/form/ReportForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ public enum ReceptionTime {

private String numberOfcancerNuclei;

private List<String> codedConclusions;

// for display
private List<IdValuePair> priorityList;

Expand Down Expand Up @@ -846,4 +848,13 @@ public List<Organization> getArvOrganizationList() {
public void setArvOrganizationList(List<Organization> arvOrganizationList) {
this.arvOrganizationList = arvOrganizationList;
}

public List<String> getCodedConclusions() {
return codedConclusions;
}

public void setCodedConclusions(List<String> codedConclusions) {
this.codedConclusions = codedConclusions;
}

}
Binary file modified src/main/resources/reports/PatientImmunoChemistryReport.jasper
Binary file not shown.
30 changes: 26 additions & 4 deletions src/main/resources/reports/PatientImmunoChemistryReport.jrxml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<field name="labOrderType" class="java.lang.String"/>
<field name="results" class="java.util.List"/>
<field name="textConclusion" class="java.lang.String"/>
<field name="codedConclusion" class="java.util.List"/>
<field name="contactTracingIndexName" class="java.lang.String"/>
<field name="contactTracingIndexRecordNumber" class="java.lang.String"/>
<group name="person" isStartNewPage="true" isResetPageNumber="true" footerPosition="ForceAtBottom">
Expand Down Expand Up @@ -888,15 +889,15 @@
<subreportExpression class = "java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "PatientImmunoChemistryResults.jasper"]]></subreportExpression>
</subreport>
</band>
<band height="50" splitType="Prevent">
<band height="110" splitType="Prevent">
<rectangle>
<reportElement x="0" y="0" width="550" height="50" mode="Opaque"/>
<reportElement x="0" y="0" width="550" height="110" mode="Opaque"/>
<graphicElement>
<pen lineWidth="0.5" lineColor="#071e26"/>
</graphicElement>
</rectangle>
<textField>
<reportElement x="0" y="0" width="550" height="20" uuid="3f4df96a-83c1-4216-92a3-2018447ad5a0"/>
<reportElement x="0" y="0" width="550" height="20" uuid="4db3d469-99a4-414e-aaa6-129b2a5c5ff4"/>
<box leftPadding="5">
<topPen lineWidth="0.25" lineStyle="Solid"/>
<leftPen lineWidth="0.25" lineStyle="Solid"/>
Expand All @@ -908,8 +909,29 @@
</textElement>
<textFieldExpression><![CDATA[$R{pathology.label.conclusion}]]></textFieldExpression>
</textField>
<textField textAdjust="StretchHeight" isBlankWhenNull="true" isStretchWithOverflow="false">
<reportElement stretchType="RelativeToTallestObject" x="0" y="20" width="540" height="40" uuid="0287bf57-8501-4703-b420-e60f5aae8ead"/>
<textElement textAlignment="Left" verticalAlignment="Top" markup="styled">
<font fontName="SansSerif" size="9" isBold="false" isItalic="false" isUnderline="false" pdfFontName="Helvetica" isPdfEmbedded="true"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$F{codedConclusion}.stream().map(s -> "• " + s).collect(java.util.stream.Collectors.joining(" "))]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="60" width="550" height="20" uuid="3f4df96a-83c1-4216-92a3-2018447ad5a0"/>
<box leftPadding="5">
<topPen lineWidth="0.25" lineStyle="Solid"/>
<leftPen lineWidth="0.25" lineStyle="Solid"/>
<bottomPen lineWidth="0.25" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle" markup="styled">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{pathology.label.textconclusion}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="3" y="20" width="550" height="30" uuid="57152e13-27fb-4b80-a518-c3dd78d93fdf"/>
<reportElement stretchType="RelativeToTallestObject" x="3" y="80" width="550" height="30" uuid="57152e13-27fb-4b80-a518-c3dd78d93fdf"/>
<textElement textAlignment="Left" verticalAlignment="Middle" markup="styled">
<font fontName="SansSerif" size="9" isBold="false" isItalic="false" isUnderline="false" pdfFontName="Helvetica" isPdfEmbedded="true"/>
</textElement>
Expand Down

0 comments on commit d09a123

Please sign in to comment.