private void newParentInstance() { //form.getLocalContext().setUpdatingParent(new Boolean(true)); ClinicalTeamVo voNewParent = new ClinicalTeamVo(); voNewParent.setTeamMembers(new ClinicalTeamMemberVoCollection()); form.getLocalContext().setSelectedParentInstance(voNewParent); newParentNode(voNewParent); clearParentInstanceControls(); // Box the selected node offside if (form.grdHierarchy().getValue() instanceof ClinicalTeamVo ) form.getLocalContext().setUpdatedParent((ClinicalTeamVo) form.grdHierarchy().getValue()); else if (form.grdHierarchy().getValue() instanceof ClinicalTeamMemberVo ) form.getLocalContext().setUpdatedChild((ClinicalTeamMemberVo) form.grdHierarchy().getValue()); form.getLocalContext().setSelectedChildInstance(new ClinicalTeamMemberVo()); form.ctnDetails().setCollapsed(false); form.setMode(FormMode.EDIT); }
/** * Invoked when the user clicks OK to add a new element to the child array * Basically we update the hierarchy grid with the newly added details clearing the control * to facilitate new input. We then update the local context variable with the new child * */ private void newChildNode(ClinicalTeamMemberVo voClinicalTeamMember) throws PresentationLogicException { if (voClinicalTeamMember.countFieldsWithValue() > 1) { String strErrors[] = voClinicalTeamMember.validate(validateUIRules()); if(strErrors != null && strErrors.length > 0) { StringBuffer sErr = new StringBuffer("Clinical team promote failed for the following reason(s) : "); for (int i=0; i < strErrors.length; i++) sErr.append(strErrors[i] + " "); throw new PresentationLogicException(sErr.toString()); } promoteChild(voClinicalTeamMember); clearChildInstanceControls(false); } }
private void populateChildNode(grdHierarchyRow childRow, ClinicalTeamMemberVo voClinicalTeamMember) { if (childRow == null || voClinicalTeamMember == null) return; childRow.setcolHcp(voClinicalTeamMember.getHCP() != null ? voClinicalTeamMember.getHCP().getMos().getName().toString() : null); if(voClinicalTeamMember.getStartDateIsNotNull()) childRow.setcolStartDate(voClinicalTeamMember.getStartDate().toString()); if(voClinicalTeamMember.getEndDateIsNotNull()) childRow.setcolEndDate(voClinicalTeamMember.getEndDate().toString()); childRow.setValue(voClinicalTeamMember); childRow.setCollapsedImage(form.getImages().Admin.NCHAD); childRow.setExpandedImage(form.getImages().Admin.NCHAD); if (voClinicalTeamMember.getID_ClinicalTeamMember() == null) childRow.setTextColor(Color.Red); }
private void updateContextMenusState() { boolean bViewMode = form.getMode().equals(FormMode.VIEW); form.getContextMenus().getClinicalTeamNEW_TEAMItem().setVisible(bViewMode && form.getLocalContext().getSelectedParentInstance() == null); boolean bCanUpdateParent = bViewMode && form.getLocalContext().getSelectedParentInstance() != null && form.getLocalContext().getSelectedParentInstance().getID_ClinicalTeam() != null; form.getContextMenus().getClinicalTeamUPDATE_TEAMItem().setVisible(bCanUpdateParent); form.getContextMenus().getClinicalTeamNEW_MEMBERSItem().setVisible(bCanUpdateParent); form.getContextMenus().getClinicalTeamREMOVE_MEMBERItem().setVisible(form.getLocalContext().getSelectedChildInstance() != null && form.grdHierarchy().getSelectedRow() != null && form.grdHierarchy().getSelectedRow().getValue() instanceof ClinicalTeamMemberVo); form.getContextMenus().getClinicalTeamUPDATE_MEMBERItem().setVisible(form.getLocalContext().getSelectedChildInstance() != null && bViewMode && form.getLocalContext().getSelectedChildInstance().getID_ClinicalTeamMember() != null); }
private void populateChildCollectionFromGrid(ClinicalTeamVo voClinicalTeam) { if (form.grdHierarchy().getValue() == null) return; if (voClinicalTeam.getTeamMembers() == null) voClinicalTeam.setTeamMembers(new ClinicalTeamMemberVoCollection()); GenForm.grdHierarchyRow parentRow = form.grdHierarchy().getValue() instanceof ClinicalTeamVo ? form.grdHierarchy().getSelectedRow() : form.grdHierarchy().getSelectedRow().getParentRow(); if (parentRow.getRows().size() >= 0 ) voClinicalTeam.getTeamMembers().clear(); for (int i=0; i < parentRow.getRows().size(); i++) voClinicalTeam.getTeamMembers().add((ClinicalTeamMemberVo) parentRow.getRows().get(i).getValue()); }
private void populateChildInstanceData(ClinicalTeamMemberVo voClinicalTeamMember) { if (voClinicalTeamMember.getID_ClinicalTeamMember() != null) { if(form.ctnDetails().lyrDetails().tabMemberDisplay().dteDisplayStart()!=null) voClinicalTeamMember.setStartDate(form.ctnDetails().lyrDetails().tabMemberDisplay().dteDisplayStart().getValue()); if(form.ctnDetails().lyrDetails().tabMemberDisplay().dteDisplayEnd()!=null) voClinicalTeamMember.setEndDate(form.ctnDetails().lyrDetails().tabMemberDisplay().dteDisplayEnd().getValue()); voClinicalTeamMember.setIsActive(new Boolean(form.ctnDetails().lyrDetails().tabMemberDisplay().chkDisplayIsActive().getValue())); } else { if(form.ctnDetails().lyrDetails().tabDetailsMembers().grdTeamMembers().getSelectedRow()!=null) voClinicalTeamMember.setHCP(form.ctnDetails().lyrDetails().tabDetailsMembers().grdTeamMembers().getSelectedRow().getValue()); if(form.ctnDetails().lyrDetails().tabDetailsMembers().dteStart()!=null) voClinicalTeamMember.setStartDate(form.ctnDetails().lyrDetails().tabDetailsMembers().dteStart().getValue()); if(form.ctnDetails().lyrDetails().tabDetailsMembers().dteEnd()!=null) voClinicalTeamMember.setEndDate(form.ctnDetails().lyrDetails().tabDetailsMembers().dteEnd().getValue()); voClinicalTeamMember.setIsActive(new Boolean(form.ctnDetails().lyrDetails().tabDetailsMembers().chkActive().getValue())); } }
protected void onBtnOkClick() throws ims.framework.exceptions.PresentationLogicException { //go through list and add to vo GenForm.grdTeamMemberRow row; ClinicalTeamMemberVoCollection collTeamMemberVo = new ClinicalTeamMemberVoCollection(); for(int i=0;i<form.grdTeamMember().getRows().size();i++) { row = form.grdTeamMember().getRows().get(i); if (row.getcolAttending() == true) { ClinicalTeamMemberVo voTeamMember = new ClinicalTeamMemberVo(); voTeamMember = row.getValue(); collTeamMemberVo.add(voTeamMember); } } form.getGlobalContext().Clinical.setTeamMemberSelection(collTeamMemberVo); engine.close(DialogResult.OK); }
private void selectionChanged() { // In update mode we can select nodes without displaying anything but the context // menus can change based on what's selected so we need to update them if (form.getMode().equals(FormMode.EDIT)) { updateContextMenusState(); return; } //expand the selected parent if(form.grdHierarchy().getValue() instanceof ClinicalTeamVo) { form.getLocalContext().setSelectedParentInstance((ClinicalTeamVo) form.grdHierarchy().getValue()); populateParentInstanceControls(form.getLocalContext().getSelectedParentInstance()); form.getLocalContext().setSelectedChildInstance(null); clearChildInstanceControls(true); } else if(form.grdHierarchy().getValue() instanceof ClinicalTeamMemberVo) { form.getLocalContext().setSelectedChildInstance((ClinicalTeamMemberVo) form.grdHierarchy().getValue()); populateChildInstanceControls(form.getLocalContext().getSelectedChildInstance()); form.getLocalContext().setSelectedParentInstance((ClinicalTeamVo) form.grdHierarchy().getSelectedRow().getParentRow().getValue()); populateParentInstanceControls(form.getLocalContext().getSelectedParentInstance()); } updateControlsState(); }
private void newChildInstance() { form.getLocalContext().setUpdatingParent(new Boolean(false)); clearChildInstanceControls(true); form.getLocalContext().setSelectedChildInstance(new ClinicalTeamMemberVo()); form.ctnDetails().lyrDetails().tabDetailsMembers().customControlSearchHCPs().initializeComponent(Boolean.TRUE); form.setMode(FormMode.EDIT); }
private void populateChildInstanceControls(ClinicalTeamMemberVo voClinicalTeamMember) { if (voClinicalTeamMember == null) return; form.ctnDetails().lyrDetails().tabMemberDisplay().dteDisplayStart().setValue(voClinicalTeamMember.getStartDate() != null ? voClinicalTeamMember.getStartDate() : null); form.ctnDetails().lyrDetails().tabMemberDisplay().dteDisplayEnd().setValue(voClinicalTeamMember.getEndDate() != null ? voClinicalTeamMember.getEndDate() : null); form.ctnDetails().lyrDetails().tabMemberDisplay().chkDisplayIsActive().setValue(voClinicalTeamMember.getIsActive() == null ? false: voClinicalTeamMember.getIsActive().booleanValue() ); if (voClinicalTeamMember.getHCP() != null) form.ctnDetails().lyrDetails().tabMemberDisplay().txtDisplayMemberName().setValue(voClinicalTeamMember.getHCP().getMos().getName().toShortForm()); }
private void checkForUnsavedChild() throws PresentationLogicException { if (form.getLocalContext().getUpdatingParent().booleanValue() == false) { if (form.getLocalContext().getSelectedChildInstance() == null || (form.getLocalContext().getSelectedChildInstance() != null && form.getLocalContext().getSelectedChildInstance().getID_ClinicalTeamMember() == null)) { ClinicalTeamMemberVo voClinicalTeamMember = new ClinicalTeamMemberVo(); populateChildInstanceData(voClinicalTeamMember); newChildNode(voClinicalTeamMember); } } }
private void setUpdatedItem() { if (form.getLocalContext().getUpdatingParent().equals(Boolean.TRUE)) { if (form.getLocalContext().getSelectedParentInstance() != null && form.getLocalContext().getSelectedParentInstance().getID_ClinicalTeam() != null) { form.getLocalContext().setUpdatedParent(form.getLocalContext().getSelectedParentInstance()); return; } } if (form.grdHierarchy().getValue() instanceof ClinicalTeamVo) { form.getLocalContext().setUpdatedParent((ClinicalTeamVo) form.grdHierarchy().getValue()); } else if (form.grdHierarchy().getValue() instanceof ClinicalTeamMemberVo) { form.getLocalContext().setUpdatedChild((ClinicalTeamMemberVo) form.grdHierarchy().getValue()); } else { // Find the most recently added child if (form.getLocalContext().getUpdatingParent().equals(Boolean.FALSE)) { if (form.getLocalContext().getSelectedParentInstance() != null && form.getLocalContext().getSelectedParentInstance().getTeamMembers() != null && form.getLocalContext().getSelectedParentInstance().getTeamMembers().size() > 0) { form.getLocalContext().getSelectedParentInstance().getTeamMembers().sort(); form.getLocalContext().setUpdatedChild(form.getLocalContext().getSelectedParentInstance().getTeamMembers().get( form.getLocalContext().getSelectedParentInstance().getTeamMembers().size() - 1)); } } } }
private void promoteChild(ClinicalTeamMemberVo voClinicalTeamMember) { if (voClinicalTeamMember == null) return; if (form.grdHierarchy().getSelectedRow() != null) form.grdHierarchy().getSelectedRow().setExpanded(true); GenForm.grdHierarchyRow childRow = form.grdHierarchy().getSelectedRow().getRows().newRow(); populateChildNode(childRow, voClinicalTeamMember); form.ctnDetails().lyrDetails().tabDetailsMembers().grdTeamMembers().removeSelectedRow(); }
private void setAddApplyCaption() { form.ctnDetails().lyrDetails().tabDetailsMembers().btnOK().setText("Add"); if (form.getLocalContext().getSelectedChildInstance() == null && (form.grdHierarchy().getValue() instanceof ClinicalTeamMemberVo)) form.ctnDetails().lyrDetails().tabDetailsMembers().btnOK().setText("Apply"); }
private void chooseTab() { if (form.getMode().equals(FormMode.VIEW)) { if (form.getLocalContext().getSelectedParentInstance() == null) form.ctnDetails().lyrDetails().showtabNoDetailSelected(); // In view mode just show the selected node if (form.grdHierarchy().getValue() instanceof ClinicalTeamVo) form.ctnDetails().lyrDetails().showtabDetailsTeam(); else if (form.grdHierarchy().getValue() instanceof ClinicalTeamMemberVo) form.ctnDetails().lyrDetails().showtabMemberDisplay(); } else { boolean bNewParent = form.getLocalContext().getSelectedParentInstanceIsNotNull() && form.getLocalContext().getSelectedParentInstance().getID_ClinicalTeam() == null; if (form.getLocalContext().getUpdatingParent().equals(Boolean.TRUE) || bNewParent) form.ctnDetails().lyrDetails().showtabDetailsTeam(); else { if (form.getLocalContext().getSelectedChildInstance() == null || form.getLocalContext().getSelectedChildInstance().getID_ClinicalTeamMember() == null) form.ctnDetails().lyrDetails().showtabDetailsMembers(); else form.ctnDetails().lyrDetails().showtabMemberDisplay(); } } }
private void populateScreen(ClinicalTeamVoCollection collClinicalTeamVo) { form.cmbTeamLead().newRow(form.getLocalContext().getIHcp(), form.getLocalContext().getIHcp().toString()); form.cmbTeamLead().setValue(form.getLocalContext().getIHcp()); ClinicalTeamMemberVoCollection voTeamMemberColl = new ClinicalTeamMemberVoCollection(); if (collClinicalTeamVo != null) { form.grdTeamMember().getRows().clear(); GenForm.grdTeamMemberRow tempRow; for (int i=0; i < collClinicalTeamVo.size(); i++) { ClinicalTeamVo voClinicalTeam = collClinicalTeamVo.get(i); voTeamMemberColl = voClinicalTeam.getTeamMembers(); for (int x=0; x < voTeamMemberColl.size(); x++) { ClinicalTeamMemberVo voTeamMember = voTeamMemberColl.get(x); tempRow = form.grdTeamMember().getRows().newRow(); tempRow.setValue(voTeamMember); if(voTeamMember.getHCPIsNotNull()) tempRow.setcolTeamMember(voTeamMember.getHCP().toString()); } } } }