private AnalyteRefVoCollection getAnalytes(ChartResultVoCollection results) throws PresentationLogicException { if(results == null) return new AnalyteRefVoCollection(); AnalyteRefVoCollection analytes = new AnalyteRefVoCollection(); for(int x = 0; x < results.size(); x++) { ChartResultVo result = results.get(x); if(result.getAnalyte() == null || result.getAnalyte().getID_Analyte() == null) throw new PresentationLogicException("Invalid result analyte"); if(analytes.indexOf(result.getAnalyte()) < 0) analytes.add(result.getAnalyte()); } return analytes; }
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; }
private String getLabOrderNo(ChartResultVo chartResult) { if(chartResult == null || chartResult.getInvestigationData() == null || chartResult.getInvestigationData().getSpecimen() == null || chartResult.getInvestigationData().getSpecimen().size() == 0) return null; if(chartResult.getInvestigationData().getSpecimen().size() == 1 && chartResult.getInvestigationData().getSpecimen().get(0) != null) return chartResult.getInvestigationData().getSpecimen().get(0).getFillerOrdNum(); for(OrderSpecimenChartVo spec : chartResult.getInvestigationData().getSpecimen()) { if(chartResult.getSpecimenComments() != null && chartResult.getSpecimenComments().getID_OrderSpecimen().equals(spec.getID_OrderSpecimen())) { return spec.getFillerOrdNum(); } } return null; }
private ChartResultAnalyteVoCollection getAnalytes(ChartResultVoCollection results) throws PresentationLogicException { if(results == null) return new ChartResultAnalyteVoCollection(); ChartResultAnalyteVoCollection analytes = new ChartResultAnalyteVoCollection(); for(ChartResultVo result : results) { ChartResultAnalyteVo analyte = result.getAnalyte(); if(analyte == null || analyte.getID_Analyte() == null) throw new PresentationLogicException("Invalid result analyte"); analyte.setRefRange(result.getRefRange()); if(analytes.indexOf(analyte) < 0) analytes.add(analyte); } return analytes; }
private ChartResultVoCollection getResultsFromDFTOrderInvestigation(boolean isTabularView) { if(form.getLocalContext().getDFTOrderInvestigation() == null || form.getLocalContext().getDFTOrderInvestigation().getResultDetails() == null || form.getLocalContext().getDFTOrderInvestigation().getResultDetails().getPathologyResultDetails() == null) return null; OrderInvestigationChartVo oi = domain.getOrderInvestigation(form.getLocalContext().getDFTOrderInvestigation()); ChartResultVoCollection results = new ChartResultVoCollection(); for(PathologyResultDetailsForCumulateResultsVo pathResult : form.getLocalContext().getDFTOrderInvestigation().getResultDetails().getPathologyResultDetails()) { if(pathResult == null || pathResult.getResultComponents() == null) continue; for(ChartResultVo component : pathResult.getResultComponents()) { if(component == null) continue; if(ResultValueType.NM.equals(component.getResValType()) || (isTabularView && (ResultValueType.SN.equals(component.getResValType()) || ResultValueType.ST.equals(component.getResValType())))) { component.setInvestigationData(oi); component.setSpecimenComments(pathResult.getOrderSpecimen()); component.setPathologyResultId(pathResult.getID_PathResultDetails()); results.add(component); } } } return results; }