@Override protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException { HCGTestItemVo hCGTestItem = populateDataFromScreen(form.getGlobalContext().Clinical.getSelectedHCGTestItem()); String[] errors = hCGTestItem.validate(getUIErrors()); if (errors != null && errors.length > 0) { engine.showErrors(errors); return; } form.getGlobalContext().Clinical.setSelectedHCGTestItem(hCGTestItem); engine.close(DialogResult.OK); }
private void addRowToHCGGrid(HCGTestItemVo HCGTestItem) { if (HCGTestItem==null) return; grdHCgRow row = form.grdHCg().getRows().newRow(); row.setcolRecordingDate((HCGTestItem.getRecordingInformationIsNotNull() && HCGTestItem.getRecordingInformation().getRecordingDateTimeIsNotNull())?HCGTestItem.getRecordingInformation().getRecordingDateTime().toString():null); row.setTooltipForcolRecordingDate((HCGTestItem.getRecordingInformationIsNotNull() && HCGTestItem.getRecordingInformation().getRecordingDateTimeIsNotNull())?HCGTestItem.getRecordingInformation().getRecordingDateTime().toString():null); row.setcolRecordingHCP(HCGTestItem.getRecordingInformationIsNotNull() && HCGTestItem.getRecordingInformation().getRecordingUserIsNotNull()?HCGTestItem.getRecordingInformation().getRecordingUser().toString():null); row.setTooltipForcolRecordingHCP(HCGTestItem.getRecordingInformationIsNotNull() && HCGTestItem.getRecordingInformation().getRecordingUserIsNotNull()?HCGTestItem.getRecordingInformation().getRecordingUser().toString():null); row.setcolLotNumber(HCGTestItem.getLotNumberIsNotNull()?HCGTestItem.getLotNumber():null); row.setTooltipForcolLotNumber(HCGTestItem.getLotNumberIsNotNull()?HCGTestItem.getLotNumber():null); row.setcolUrineHCG(HCGTestItem.getUrineHCGIsNotNull()?HCGTestItem.getUrineHCG().toString():null); row.setTooltipForcolUrineHCG(HCGTestItem.getUrineHCGIsNotNull()?HCGTestItem.getUrineHCG().toString():null); row.setcolSerumHCG(HCGTestItem.getSerumHCGIsNotNull()?HCGTestItem.getSerumHCG().toString():null); row.setTooltipForcolSerumHCG(HCGTestItem.getSerumHCGIsNotNull()?HCGTestItem.getSerumHCG().toString():null); row.setValue(HCGTestItem); }
@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(); HCGTestItemVo HCGTestItem = form.getGlobalContext().Clinical.getSelectedHCGTestItem(); if (HCGTestItem != null) { populateScreenFromData(HCGTestItem); } else { initialize(); } }
private void populateScreenFromData(HCGTestItemVo hCGTestItem) { if (hCGTestItem == null) return; form.ccAuthoringInfo().setValue(hCGTestItem.getAuthoringInformationIsNotNull() ? hCGTestItem.getAuthoringInformation() : null); form.ccRecordingHcp().setValue(hCGTestItem.getRecordingInformationIsNotNull() && hCGTestItem.getRecordingInformation().getRecordingUserIsNotNull() ? hCGTestItem.getRecordingInformation().getRecordingUser() : null); form.dtimRecordingDateTime().setValue(hCGTestItem.getRecordingInformationIsNotNull() && hCGTestItem.getRecordingInformation().getRecordingDateTimeIsNotNull() ? hCGTestItem.getRecordingInformation().getRecordingDateTime() : null); form.txtLotNumber().setValue(hCGTestItem.getLotNumberIsNotNull() ? hCGTestItem.getLotNumber() : null); form.cmbUrineHCG().setValue(hCGTestItem.getUrineHCGIsNotNull() ? hCGTestItem.getUrineHCG() : null); form.cmbSerumHCG().setValue(hCGTestItem.getSerumHCGIsNotNull() ? hCGTestItem.getSerumHCG() : null); }
private void updateControlState() { form.getContextMenus().Clinical.getHCGMenuNEWItem().setVisible(Boolean.TRUE.equals(form.getLocalContext().getisEnabled())); form.getContextMenus().Clinical.getHCGMenuEDITItem().setVisible(Boolean.TRUE.equals(form.getLocalContext().getisEnabled()) && form.grdHCg().getValue() instanceof HCGTestItemVo); form.getContextMenus().Clinical.getHCGMenuVIEWItem().setVisible(Boolean.TRUE.equals(form.getLocalContext().getisEnabled()) && form.grdHCg().getValue() instanceof HCGTestItemVo); form.getContextMenus().Clinical.getHCGMenuRIEItem().setVisible(Boolean.TRUE.equals(form.getLocalContext().getisEnabled()) && form.grdHCg().getValue() instanceof HCGTestItemVo); }
public HCGTestItemVo saveItem(HCGTestItemVo hcgItemToSave) throws StaleObjectException { if (hcgItemToSave == null) throw new CodingRuntimeException("Cannot save null HCGItem "); if (!hcgItemToSave.isValidated()) throw new DomainRuntimeException("HCGItem Not Validated."); DomainFactory factory = getDomainFactory(); HCGTestItem domainHCGItem = HCGTestItemVoAssembler.extractHCGTestItem(factory, hcgItemToSave); factory.save(domainHCGItem); return HCGTestItemVoAssembler.create(domainHCGItem); }
public HCGTestItemVo getHCGItem(HCGTestItemRefVo hcgItemRef) { if (hcgItemRef == null || hcgItemRef.getID_HCGTestItem() == null) { throw new CodingRuntimeException("Cannot get HCGItem on null Id "); } DomainFactory factory = getDomainFactory(); HCGTestItem domainHCGItem = (HCGTestItem) factory.getDomainObject(HCGTestItem.class, hcgItemRef.getID_HCGTestItem()); return HCGTestItemVoAssembler.create(domainHCGItem); }