public static ims.ocrr.orderingresults.domain.objects.OrderInvestigation extractOrderInvestigation( ims.domain.ILightweightDomainFactory domainFactory, ims.ocrr.vo.PathologyOrderVo valueObject, HashMap domMap) { if (null == valueObject) { return null; } Integer id = valueObject.getID_OrderInvestigation(); ims.ocrr.orderingresults.domain.objects.OrderInvestigation domainObject = null; if (null == id) { if (domMap.get(valueObject) != null) { return (ims.ocrr.orderingresults.domain.objects.OrderInvestigation) domMap.get(valueObject); } // ims.ocrr.vo.PathologyOrderVo ID_OrderInvestigation field is unknown domainObject = new ims.ocrr.orderingresults.domain.objects.OrderInvestigation(); domMap.put(valueObject, domainObject); } else { String key = (valueObject.getClass().getName() + "__" + valueObject.getID_OrderInvestigation()); if (domMap.get(key) != null) { return (ims.ocrr.orderingresults.domain.objects.OrderInvestigation) domMap.get(key); } domainObject = (ims.ocrr.orderingresults.domain.objects.OrderInvestigation) domainFactory.getDomainObject( ims.ocrr.orderingresults.domain.objects.OrderInvestigation.class, id); // TODO: Not sure how this should be handled. Effectively it must be a staleobject exception, // but maybe should be handled as that further up. if (domainObject == null) return null; domMap.put(key, domainObject); } domainObject.setVersion(valueObject.getVersion_OrderInvestigation()); domainObject.setInvestigation( ims.ocrr.vo.domain.InvestigationLiteVoAssembler.extractInvestigation( domainFactory, valueObject.getInvestigation(), domMap)); domainObject.setOrderDetails( ims.ocrr.vo.domain.OcsOrderShortVoAssembler.extractOcsOrderSession( domainFactory, valueObject.getOrderDetails(), domMap)); ims.framework.utils.DateTime dateTime3 = valueObject.getDisplayDateTime(); java.util.Date value3 = null; if (dateTime3 != null) { value3 = dateTime3.getJavaDate(); } domainObject.setDisplayDateTime(value3); domainObject.setSpecimen( ims.ocrr.vo.domain.OrderSpecimenPathologyVoAssembler.extractOrderSpecimenList( domainFactory, valueObject.getSpecimen(), domainObject.getSpecimen(), domMap)); return domainObject; }