private PathResultDetailsCommentsVo getPathResultComments(ChartResultVo chartResult) { if(chartResult == null || chartResult.getInvestigationData() == null || chartResult.getInvestigationData().getResultDetails() == null || chartResult.getInvestigationData().getResultDetails().getPathologyResultDetails() == null || chartResult.getInvestigationData().getResultDetails().getPathologyResultDetails().size() == 0) return null; if(chartResult.getInvestigationData().getResultDetails().getPathologyResultDetails().size() == 1) return chartResult.getInvestigationData().getResultDetails().getPathologyResultDetails().get(0); if(chartResult.getPathologyResultId() == null) return null; for(PathResultDetailsCommentsVo pathR : chartResult.getInvestigationData().getResultDetails().getPathologyResultDetails()) { if(chartResult.getPathologyResultId().equals(pathR.getID_PathResultDetails())) return pathR; } return null; }