/** * listResultHistory */ public ims.ocrr.vo.OrderResultHistoryVoCollection listResultHistory(ims.ocrr.orderingresults.vo.OrderInvestigationRefVo orderInv) { if(orderInv == null || orderInv.getID_OrderInvestigation() == null) throw new CodingRuntimeException("orderInv parameter is null in method listResultHistory"); DomainFactory factory = getDomainFactory(); OrderInvestigation doOrderInv = (OrderInvestigation) factory.getDomainObject(orderInv); InvType investigationType = LookupHelper.getInvTypeInstance(getLookupService(), doOrderInv.getInvestigation().getType().getId()); InvEventType investigationEventType = LookupHelper.getInvEventTypeInstance(getLookupService(), doOrderInv.getInvestigation().getEventType().getId()); boolean isDFT = isDFT(investigationEventType); OrderResultHistoryVoCollection voCollResult = OrderResultHistoryVoAssembler.createOrderResultHistoryVoCollectionFromOrderResultHistory(doOrderInv.getResultHistory()).sort(SortOrder.DESCENDING); //adding unmapped fields for(int i=0;i<voCollResult.size();i++) { if(doOrderInv.getInvestigation() != null && doOrderInv.getInvestigation().getInvestigationIndex() != null) voCollResult.get(i).setInvestigationName(doOrderInv.getInvestigation().getInvestigationIndex().getName()); if(doOrderInv.getInvestigation() != null && doOrderInv.getInvestigation().getInvestigationIndex() != null) voCollResult.get(i).setOrderAbility( LookupHelper.getInvestigationOrderabilityInstance(getLookupService(), doOrderInv.getInvestigation().getInvestigationIndex().getOrderability().getId())); if(doOrderInv.getRequestedLocation() != null) voCollResult.get(i).setRequestedLocation(LocationLiteVoAssembler.create(doOrderInv.getRequestedLocation())); if(isDFT)// WDEV-16232 { voCollResult.get(i).setSpecimen(buildOrderSpecimenCollection(voCollResult.get(i))); } else { if (doOrderInv.getSpecimen() != null)// WDEV-16232 { voCollResult.get(i).setSpecimen(SpecimenNameVoAssembler.createSpecimenNameVoCollectionFromOrderSpecimen(doOrderInv.getSpecimen())); } } if (doOrderInv.getResultSpecimenType() != null) voCollResult.get(i).setSpecimenType(new LookupInstVo(doOrderInv.getResultSpecimenType().getId(), doOrderInv.getResultSpecimenType().getText(), true)); if(doOrderInv.getInvestigation() != null && doOrderInv.getInvestigation().getType() != null) { voCollResult.get(i).setInvType(investigationType); } if(doOrderInv.getInvestigation() != null && doOrderInv.getInvestigation().getEventType() != null) { voCollResult.get(i).setInvEventType(investigationEventType); } } return voCollResult; }