/** * method will now get the template and filter any items that don't pass security checks WDEV-11071,WDEV-11109 */ public ims.ocrr.vo.OrderEntryTemplateVo getOrderEntryTemplate(ims.ocrr.vo.OrderEntryTemplateShortVo orderEntryTemplate, RoleDisciplineSecurityLevelLiteGCVo voSecurity) { OrderEntryTemplateVo voOrdTemplate = OrderEntryTemplateVoAssembler.create((OrderEntryTemplate)getDomainFactory().getDomainObject(OrderEntryTemplate.class, orderEntryTemplate.getID_OrderEntryTemplate())); //enforce Security here OrderEntryTemplateComponentShortVoCollection removableComponenets = new OrderEntryTemplateComponentShortVoCollection(); for(OrderEntryTemplateComponentShortVo comp : voOrdTemplate.getComponents()) { if(comp.getInvestigationIsNotNull()) { if(voSecurity != null) { SecurityLevelAndServiceCheckVo voSecLevelAndService = getSecurityLevelAndServiceForInvestigation(comp.getInvestigation().getInvestigationIndex().getID_InvestigationIndex()); if(voSecLevelAndService != null && voSecLevelAndService.getSecurityLevelIsNotNull() && voSecLevelAndService.getServiceIsNotNull()) { if(!voSecurity.doesInvPassSecurityCheck(voSecLevelAndService.getService(),voSecLevelAndService.getSecurityLevel(),true)) //WDEV-11622 { removableComponenets.add(comp); continue; } } } } } if(removableComponenets.size() > 0) { for(OrderEntryTemplateComponentShortVo compToRemove : removableComponenets) { voOrdTemplate.getComponents().remove(compToRemove); } } return voOrdTemplate; }