public IfOrderSpecimenVo updateNonResultableInvestigations(OrderSpecimenRefVo spc) throws StaleObjectException { // wdev-2748 27/03/2007 // For each investigation within the specimen, check whether it is // non resultable. If so, set the status to accepted (if it is currently sent) // and set the display datetime values DomainFactory factory = getDomainFactory(); OrderSpecimen domSpc = (OrderSpecimen)factory.getDomainObject(OrderSpecimen.class, spc.getID_OrderSpecimen().intValue()); Iterator it = domSpc.getInvestigations().iterator(); while (it.hasNext()) { OrderInvestigation ordInv = (OrderInvestigation) it.next(); if (ordInv.getOrdInvCurrentStatus().getOrdInvStatus().getId() == OrderInvStatus.SENT.getId() && ordInv.getInvestigation().getInvestigationIndex().getOrderability().getId() == InvestigationOrderability.ORDERONLY.getId()) { OrderedInvestigationStatus newStat = new OrderedInvestigationStatus(); newStat.setChangeDateTime(new java.util.Date()); newStat.setChangeUser("HL7InboundEngine"); newStat.setOrdInvStatus(getDomLookup(OrderInvStatus.ACCEPTED)); newStat.setStatusReason("Non-Resultable, set to accepted from related investigations"); ordInv.setOrdInvCurrentStatus(newStat); if (domSpc.getCollDateTimeFiller() != null) ordInv.setDisplayDateTime(domSpc.getCollDateTimeFiller()); else ordInv.setDisplayDateTime(domSpc.getCollDateTimePlacer()); ordInv.setDisplayFlag(getDomLookup(OcsDisplayFlag.SPEC_COLL)); } } factory.save(domSpc); return IfOrderSpecimenVoAssembler.create(domSpc); }