Skip to content

Commit

Permalink
Merge pull request #574 from mozzy11/2.8
Browse files Browse the repository at this point in the history
more Work on IHC reports
  • Loading branch information
mozzy11 authored Oct 26, 2023
2 parents 281f838 + d7a9d07 commit 69c3390
Show file tree
Hide file tree
Showing 11 changed files with 629 additions and 285 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ function ImmunohistochemistryCaseView() {
herScore: "",
diagnosis: "",
molecularSubType: "",
conclusion : "",
ihcScore: "",
ihcRatio: "",
averageChrom: "",
averageHer2: "",
numberOfcancerNuclei: "",
toggled : false
},
});
Expand Down Expand Up @@ -427,7 +433,7 @@ function ImmunohistochemistryCaseView() {
}}
/>
</Column>
<Column lg={16} md={8} sm={4}>
<Column lg={16} md={8} sm={4}>
<div> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</Column>
<Column lg={3} md={8} sm={4}>
Expand Down Expand Up @@ -477,9 +483,160 @@ function ImmunohistochemistryCaseView() {
</>
);
case "DUAL_IN_SITU_HYBRIDISATION":
return <></>;
return <>

<Column lg={16} md={8} sm={4}>
<Grid fullWidth={true} className="gridBoundary">
<Column lg={3} md={8} sm={4}>
Number of Cancer nuclei
</Column>
<Column lg={5} md={8} sm={4}>
<TextInput
id={"nuclei_" + index}
labelText=""
hideLabel={true}
value={reportParams[index]?.numberOfcancerNuclei}
onChange={(e) => {
var params = { ...reportParams };
if (!params[index]) {
params[index] = {};
}
params[index].numberOfcancerNuclei = e.target.value;
setReportParams(params);
}}
/>
</Column>
<Column lg={16} md={8} sm={4}>
<div> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</Column>
<Column lg={3} md={8} sm={4}>
Average HER2 per nucleus
</Column>
<Column lg={5} md={8} sm={4}>
<TextInput
id={"her_" + index}
labelText=""
hideLabel={true}
value={reportParams[index]?.averageHer2}
onChange={(e) => {
var params = { ...reportParams };
if (!params[index]) {
params[index] = {};
}
params[index].averageHer2 = e.target.value;
var her2 = e.target.value;
var chrom = params[index].averageChrom;
if(chrom){
var ratio = her2/chrom ;
params[index].ihcRatio = ratio;
if (ratio >= 2.0) {
params[index].ihcScore = "AMPLIFICATION"
}else{
params[index].ihcScore = "NO_AMPLIFICATION"
}
}
setReportParams(params);
}}
/>
</Column>
<Column lg={16} md={8} sm={4}>
<div> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</Column>
<Column lg={3} md={8} sm={4}>
Average Chromozome 17 Sinals per nucleus
</Column>
<Column lg={5} md={8} sm={4}>
<TextInput
id={"her_" + index}
labelText=""
hideLabel={true}
value={reportParams[index]?.averageChrom}
onChange={(e) => {
var params = { ...reportParams };
if (!params[index]) {
params[index] = {};
}
params[index].averageChrom = e.target.value;
var her2 = params[index].averageHer2
var chrom = e.target.value;
if(her2){
var ratio = her2/chrom ;
params[index].ihcRatio = ratio;
if (ratio >= 2.0) {
params[index].ihcScore = "AMPLIFICATION"
}else{
params[index].ihcScore = "NO_AMPLIFICATION"
}
}
setReportParams(params);
}}
/>
</Column>
<Column lg={16} md={8} sm={4}>
<div> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</Column>
<Column lg={3} md={8} sm={4}>
Ratio of Her2/neu Signals to Chromozome 17
</Column>
<Column lg={5} md={8} sm={4}>
<TextInput
id={"her_" + index}
labelText=""
hideLabel={true}
disabled={true}
value={reportParams[index]?.ihcRatio}
/>
</Column>

<Column lg={16} md={8} sm={4}>
<div> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</Column>
<Column lg={3} md={8} sm={4}>
IHC (Cerb2 Scoer)
</Column>
<Column lg={5} md={8} sm={4}>
<TextInput
id={"her_" + index}
labelText=""
hideLabel={true}
disabled={true}
value={reportParams[index]?.ihcScore}
/>
</Column>

</Grid>
</Column>


</>;
case "IMMUNOHISTOCHEMISTRY":
return <></>;
return <>
<Column lg={16} md={8} sm={4}>
<Grid fullWidth={true} className="gridBoundary">
<Column lg={3} md={8} sm={4}>
Conlusion
</Column>
<Column lg={13} md={8} sm={4}>
<TextArea
id={"conclusion_" + index}
labelText=""
hideLabel={true}
value={reportParams[index]?.conclusion}
onChange={(e) => {
var params = { ...reportParams };
if (!params[index]) {
params[index] = {};
}
params[index].conclusion = e.target.value;
setReportParams(params);
}}
/>
</Column>


</Grid>
</Column>
</>;
}
}

Expand Down Expand Up @@ -962,6 +1119,12 @@ function ImmunohistochemistryCaseView() {
herScore: reportParams[index]?.herScore,
diagnosis: reportParams[index]?.diagnosis,
molecularSubType: reportParams[index]?.molecularSubType,
conclusion: reportParams[index]?.conclusion,
ihcScore: reportParams[index]?.ihcScore,
ihcRatio: reportParams[index]?.ihcRatio,
averageChrom: reportParams[index]?.averageChrom,
averageHer2: reportParams[index]?.averageHer2,
numberOfcancerNuclei: reportParams[index]?.numberOfcancerNuclei,
};
postToOpenElisServerFullResponse(
"/rest/ReportPrint",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
package org.openelisglobal.reports.action.implementation;

import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Set;

import org.openelisglobal.analysis.valueholder.Analysis;
import org.openelisglobal.program.service.ImmunohistochemistrySampleService;
import org.openelisglobal.program.valueholder.immunohistochemistry.ImmunohistochemistrySample;
import org.openelisglobal.reports.form.ReportForm;
import org.openelisglobal.result.valueholder.Result;
import org.openelisglobal.sample.valueholder.Sample;
import org.openelisglobal.spring.util.SpringContext;

import org.openelisglobal.test.valueholder.Test;

public class BreastCancerHormoneReceptorReport extends PatientProgramReport {

protected ImmunohistochemistrySampleService immunohistochemistrySampleService = SpringContext
private ImmunohistochemistrySampleService immunohistochemistrySampleService = SpringContext
.getBean(ImmunohistochemistrySampleService.class);

private ImmunohistochemistrySample immunohistochemistrySample;
Expand All @@ -20,9 +28,14 @@ protected String getReportName() {

@Override
protected void setAdditionalReportItems() {
data.setErResult("0.1");
data.setPrResult("0.2");
data.setMibResult("33");
Test erTest = testService.getActiveTestByLocalizedName("Anti-ER", Locale.ENGLISH);
data.setErResult(getResult(erTest));

Test prTest = testService.getActiveTestByLocalizedName("Anti-PR", Locale.ENGLISH);
data.setPrResult(getResult(prTest));

Test mibTest = testService.getActiveTestByLocalizedName("Anti-Ki67", Locale.ENGLISH);
data.setMibResult(getResult(mibTest));
}

@Override
Expand All @@ -47,4 +60,30 @@ protected void innitializeSample(ReportForm form) {
sample = immunohistochemistrySample.getSample();
}

private List<Analysis> getAnalysesByTestAndSampleAndStatus(Sample sample, Test test, Set<Integer> statusIdList) {
List<Integer> sampleIdList = new ArrayList<>();
sampleIdList.add(Integer.valueOf(sample.getId()));

List<Integer> testIdList = new ArrayList<>();
testIdList.add(Integer.valueOf(test.getId()));
List<Analysis> analyses = analysisService.getAnalysesBySampleIdTestIdAndStatusId(sampleIdList, testIdList,
new ArrayList<>(statusIdList));
return analyses != null ? analyses : new ArrayList<Analysis>();
}

private String getResult(Test test) {
String result = "";
if (test == null) {
return result;
}
List<Analysis> analyses = new ArrayList<>();
analyses = getAnalysesByTestAndSampleAndStatus(sample, test, analysisStatusIds);
if (!analyses.isEmpty()) {
List<Result> resultList = analysisService.getResults(analyses.get(0));
result = getAppropriateResults(resultList);
} else {
return result;
}
return result;
}
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
package org.openelisglobal.reports.action.implementation;

import org.openelisglobal.internationalization.MessageUtil;
import org.openelisglobal.program.service.ImmunohistochemistrySampleService;
import org.openelisglobal.program.valueholder.immunohistochemistry.ImmunohistochemistrySample;
import org.openelisglobal.reports.form.ReportForm;
import org.openelisglobal.spring.util.SpringContext;

public class DualInSituHybridizationReport extends PatientProgramReport{

public class DualInSituHybridizationReport extends PatientProgramReport {

private ImmunohistochemistrySampleService immunohistochemistrySampleService = SpringContext
.getBean(ImmunohistochemistrySampleService.class);

private ImmunohistochemistrySample immunohistochemistrySample;

@Override
protected String getReportName() {
return "DualInSituHybridizationReport";
}

@Override
protected void setAdditionalReportItems() {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'setAdditionalReportItems'");
String reportDetails = MessageUtil.getMessage("dualInSitu.report.details", new String[] {
form.getNumberOfcancerNuclei(), form.getAverageHer2(), form.getAverageChrom(), form.getIhcRatio() });
data.setIhcReportDetails(reportDetails);
if (form.getIhcScore().equals("AMPLIFICATION")) {
data.setIhcScore(MessageUtil.getMessage("dualInSitu.label.amp"));
} else {
data.setIhcScore(MessageUtil.getMessage("dualInSitu.label.noAmp"));
}
}

@Override
protected void innitializeSample(ReportForm form) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException("Unimplemented method 'innitializeSample'");
immunohistochemistrySample = immunohistochemistrySampleService.get(Integer.valueOf(form.getProgramSampleId()));
sample = immunohistochemistrySample.getSample();
}

}
Loading

0 comments on commit 69c3390

Please sign in to comment.