@Override protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException { DrugToxicologyItemVo drugToxicology=populateDataFromScreen(form.getGlobalContext().Clinical.getSelectedDrugToxicologyItem()); String[] errors = drugToxicology.validate(getUIErrors()); if (errors != null && errors.length > 0) { engine.showErrors(errors); return; } form.getGlobalContext().Clinical.setSelectedDrugToxicologyItem(drugToxicology); engine.close(DialogResult.OK); }
private void addRowToUrineToxGrid(DrugToxicologyItemVo drugToxicologyItem) { if (drugToxicologyItem==null) return; grdUrineToxRow row = form.grdUrineTox().getRows().newRow(); row.setcolRecordingDate((drugToxicologyItem.getRecordingInformationIsNotNull() && drugToxicologyItem.getRecordingInformation().getRecordingDateTimeIsNotNull())?drugToxicologyItem.getRecordingInformation().getRecordingDateTime().toString():null); row.setTooltipForcolRecordingDate((drugToxicologyItem.getRecordingInformationIsNotNull() && drugToxicologyItem.getRecordingInformation().getRecordingDateTimeIsNotNull())?drugToxicologyItem.getRecordingInformation().getRecordingDateTime().toString():null); row.setcolRecordingHCP(drugToxicologyItem.getRecordingInformationIsNotNull() && drugToxicologyItem.getRecordingInformation().getRecordingUserIsNotNull()?drugToxicologyItem.getRecordingInformation().getRecordingUser().toString():null); row.setTooltipForcolRecordingHCP(drugToxicologyItem.getRecordingInformationIsNotNull() && drugToxicologyItem.getRecordingInformation().getRecordingUserIsNotNull()?drugToxicologyItem.getRecordingInformation().getRecordingUser().toString():null); row.setcolToxicologyType(drugToxicologyItem.getToxicologyTypeIsNotNull()?drugToxicologyItem.getToxicologyType().toString():null); row.setTooltipForcolToxicologyType(drugToxicologyItem.getToxicologyTypeIsNotNull()?drugToxicologyItem.getToxicologyType().toString():null); row.setcolToxicologyResult(drugToxicologyItem.getToxicologyResultIsNotNull()?drugToxicologyItem.getToxicologyResult().toString():null); row.setTooltipForcolToxicologyResult(drugToxicologyItem.getToxicologyResultIsNotNull()?drugToxicologyItem.getToxicologyResult().toString():null); row.setValue(drugToxicologyItem); }
@Override protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException { if(args != null ) { if( args.length == 1 && args[0] != null && args[0] instanceof FormMode ) { form.setMode((FormMode)args[0]); } else form.setMode(FormMode.EDIT); } else form.setMode(FormMode.EDIT); form.ccAuthoringInfo().setIsRequiredPropertyToControls(FormMode.EDIT.equals(form.getMode())); clear(); DrugToxicologyItemVo drugToxicologyItem = form.getGlobalContext().Clinical.getSelectedDrugToxicologyItem(); if (drugToxicologyItem!=null) { populateScreenFromData(drugToxicologyItem); } else { initialize(); } }
private void populateScreenFromData(DrugToxicologyItemVo drugToxicologyItem) { if (drugToxicologyItem==null) return; form.ccAuthoringInfo().setValue(drugToxicologyItem.getAuthoringInformationIsNotNull()?drugToxicologyItem.getAuthoringInformation():null); form.ccRecordingHCP().setValue(drugToxicologyItem.getRecordingInformationIsNotNull() && drugToxicologyItem.getRecordingInformation().getRecordingUserIsNotNull()?drugToxicologyItem.getRecordingInformation().getRecordingUser():null); form.dtimRecordingDateTime().setValue(drugToxicologyItem.getRecordingInformationIsNotNull() && drugToxicologyItem.getRecordingInformation().getRecordingDateTimeIsNotNull()?drugToxicologyItem.getRecordingInformation().getRecordingDateTime():null); form.cmbToxicologyResult().setValue(drugToxicologyItem.getToxicologyResultIsNotNull()?drugToxicologyItem.getToxicologyResult():null); form.cmbToxicologyType().setValue(drugToxicologyItem.getToxicologyTypeIsNotNull()?drugToxicologyItem.getToxicologyType():null); }
private void updateControlState() { form.getContextMenus().Clinical.getUrineToxMenuNEWItem().setVisible(Boolean.TRUE.equals(form.getLocalContext().getisEnabled())); form.getContextMenus().Clinical.getUrineToxMenuEDITItem().setVisible(Boolean.TRUE.equals(form.getLocalContext().getisEnabled()) && form.grdUrineTox().getValue() instanceof DrugToxicologyItemVo); form.getContextMenus().Clinical.getUrineToxMenuVIEWItem().setVisible(Boolean.TRUE.equals(form.getLocalContext().getisEnabled()) && form.grdUrineTox().getValue() instanceof DrugToxicologyItemVo); form.getContextMenus().Clinical.getUrineToxMenuRIEItem().setVisible(Boolean.TRUE.equals(form.getLocalContext().getisEnabled()) && form.grdUrineTox().getValue() instanceof DrugToxicologyItemVo); }
public DrugToxicologyItemVo saveItem(DrugToxicologyItemVo drugToxicologyItemToSave) throws ims.domain.exceptions.StaleObjectException { if (drugToxicologyItemToSave == null) throw new CodingRuntimeException("Cannot save null DrugToxicologyItem "); if (!drugToxicologyItemToSave.isValidated()) throw new DomainRuntimeException("DrugToxicologyItem Not Validated."); DomainFactory factory = getDomainFactory(); DrugToxicologyItem domainDrugToxicologyItem = DrugToxicologyItemVoAssembler.extractDrugToxicologyItem(factory, drugToxicologyItemToSave); factory.save(domainDrugToxicologyItem); return DrugToxicologyItemVoAssembler.create(domainDrugToxicologyItem); }
public DrugToxicologyItemVo getDrugToxicologyItem(DrugToxicologyItemRefVo drugToxicologyItemRef) { if (drugToxicologyItemRef == null || drugToxicologyItemRef.getID_DrugToxicologyItem() == null) { throw new CodingRuntimeException("Cannot get DrugToxicologyItem on null Id "); } DomainFactory factory = getDomainFactory(); DrugToxicologyItem domainDrugToxicologyItem = (DrugToxicologyItem) factory.getDomainObject(DrugToxicologyItem.class, drugToxicologyItemRef.getID_DrugToxicologyItem()); return DrugToxicologyItemVoAssembler.create(domainDrugToxicologyItem); }