private void open() { if(form.getGlobalContext().OCRR.getSelectedOrderEntryTemplateIDIsNotNull()) { OrderEntryTemplateVo record = domain.getOrderEntryTemplate(form.getGlobalContext().OCRR.getSelectedOrderEntryTemplateID()); if(record != null) { form.getLocalContext().setEditedRecord(record); populateScreenFromData(record); processComponentColumns(); } else engine.showMessage("Order entry template not found"); } else { form.cmbStatus().setValue(PreActiveActiveInactiveStatus.PREACTIVE); loadLocations(); loadRoles(); processComponentColumns(); } }
private void preview() { if(!form.getLocalContext().getPreviewedItemIsNotNull()) { engine.showMessage("Unable to generate preview: order entry template not found."); return; } OrderEntryTemplateVo record = form.getLocalContext().getPreviewedItem(); if(!record.getColumnsIsNotNull()) { engine.showMessage("Unable to generate preview: order entry template columns not found."); return; } if(!record.getComponentsIsNotNull() || record.getComponents().size() == 0) { engine.showMessage("Unable to generate preview: no components found."); return; } new OrderEntryTemplatePopulation(form.dyngrdPreview(), form.getImages().OCRR.Investigation, form.getImages().OCRR.Profile, form.getImages().OCRR.OrderSet).populate(record); }
/** * 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; }
private void populateScreenFromData(ims.ocrr.vo.OrderEntryTemplateVo value) { clearScreen(); if(value == null) return; this.form.cmbCategory().setValue(value.getTemplateCategoryIsNotNull() ? value.getTemplateCategory() : null); this.form.txtDescription().setValue(value.getDescriptionIsNotNull() ? value.getDescription(): null); this.form.txtMenuName().setValue(value.getMenuNameIsNotNull() ? value.getMenuName(): null); this.form.txtFormName().setValue(value.getFormNameIsNotNull() ? value.getFormName(): null); this.form.cmbStatus().setValue(value.getActiveStatusIsNotNull() ? value.getActiveStatus() : null); this.form.lyrDetails().tabText().richFormText().setValue(value.getFormTextIsNotNull()? value.getFormText() : null); // ----- Start of grdComponents Grid -------------------------- ims.ocrr.vo.OrderEntryTemplateComponentShortVoCollection fieldgrdComponents = value.getComponentsIsNotNull() ? value.getComponents() : null; if(fieldgrdComponents != null) { fieldgrdComponents.sort(); for(int x = 0; x < fieldgrdComponents.size(); x++) { if(fieldgrdComponents.get(x) != null) { this.addComponent(fieldgrdComponents.get(x), false); } } } // ----- End of grdComponents Grid ---------------------------- // ----- Start of grdColumnNames Grid -------------------------- ims.ocrr.vo.OrderEntryTemplateColumnVoCollection fieldgrdColumnNames = value.getColumnsIsNotNull() ? value.getColumns() : null; if(fieldgrdColumnNames != null) { fieldgrdColumnNames.sort(); GenForm.lyrDetailsLayer.tabComponentsContainer.grdColumnNamesRow rowgrdColumnNames; for(int x = 0; x < fieldgrdColumnNames.size(); x++) { if(fieldgrdColumnNames.get(x) != null) { rowgrdColumnNames = this.form.lyrDetails().tabComponents().grdColumnNames().getRows().newRow(); rowgrdColumnNames.setcolImage(form.getImages().OCRR.ColumnSeparator); rowgrdColumnNames.setcolName(fieldgrdColumnNames.get(x).getColName()); } } } // ----- End of grdColumnNames Grid ---------------------------- // Start Locations -------------- loadLocations(); if(value.getTemplatesLocationsIsNotNull()) { for(int x = 0; x < value.getTemplatesLocations().size(); x++) { TemplateLocationShortVo tlItem = value.getTemplatesLocations().get(x); if(tlItem != null && tlItem.getIsActiveIsNotNull() && tlItem.getIsActive().booleanValue()) selectLocation(value.getTemplatesLocations().get(x).getLocation()); } } // End Locations ---------------- // Start Roles ------------------- loadRoles(); if(value.getTemplateRolesIsNotNull()) { for(int i = 0; i < value.getTemplateRoles().size(); i++) { TemplateRoleShortVo voTemplateShort = value.getTemplateRoles().get(i); if(voTemplateShort != null && voTemplateShort.getIsActiveIsNotNull() && voTemplateShort.getIsActive().booleanValue()) { selectRole(voTemplateShort.getAppRole()); } } } // End Roles --------------------- }
public void populate(OrderEntryTemplateVo record) { populate(record, new SelectedComponentFromSelectOrderVoCollection()); }
public OrderEntryTemplateVo getOrderEntryTemplate(Integer recordID) { OrderEntryTemplateEdit impl = (OrderEntryTemplateEdit)getDomainImpl(OrderEntryTemplateEditImpl.class); return impl.getOrderEntryTemplate(recordID); }