@Override protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException { if (args != null && args.length > 0) { if (args.length >= 3 && args[2] instanceof FormMode) { form.setMode((FormMode) args[2]); if (((FormMode) args[2]).equals(FormMode.VIEW) && args.length >= 2 && args[1] instanceof Boolean && ((Boolean)args[1]).equals(Boolean.TRUE)) { form.chkPrescriberContacted().setEnabled(false); } } if (args.length >= 1 && args[0] instanceof EDischargeMedsContextMenu) { form.getLocalContext().setFormMode((EDischargeMedsContextMenu) args[0]); initialize(); //clear(); open(); form.ccMedication().setFocus(); } if (args.length >= 2 && args[1] instanceof Boolean) { form.lblPrescriberContacted().setVisible(((Boolean) args[1]).booleanValue()); form.chkPrescriberContacted().setVisible(((Boolean) args[1]).booleanValue()); } } }
protected void onContextMenuItemClick(int menuItemID, Control sender) throws PresentationLogicException { switch (menuItemID) { case GenForm.ContextMenus.ClinicalNamespace.EDischargeMedsSthkMenu.New: { form.getGlobalContext().Clinical.setEDischargeMeds(null); engine.open(form.getForms().Clinical.EDischargeMedsSthkDialog, new Object[]{EDischargeMedsContextMenu.NEW, new Boolean(true)}); } break; case GenForm.ContextMenus.ClinicalNamespace.EDischargeMedsSthkMenu.Edit: { form.getGlobalContext().Clinical.setEDischargeMeds(form.getLocalContext().getEditedMedicalRecord()); engine.open(form.getForms().Clinical.EDischargeMedsSthkDialog, new Object[]{EDischargeMedsContextMenu.EDIT, new Boolean(true)}); } break; case GenForm.ContextMenus.ClinicalNamespace.EDischargeMedsSthkMenu.Remove: { TTAMedicationAndPharmacyVo currentRecord = form.getLocalContext().getEditedRecord(); if(currentRecord != null && currentRecord.getTTAMedicationsIsNotNull()) { TTAMedicationDetailVoCollection medColl = currentRecord.getTTAMedications(); medColl.remove((TTAMedicationDetailVo)form.dyngrdMedication().getSelectedRow().getValue()); currentRecord.setTTAMedications(medColl); form.getLocalContext().setEditedRecord(currentRecord); } form.dyngrdMedication().getRows().remove(form.dyngrdMedication().getSelectedRow()); // Update the 'Last Updating Pharmacist' field // - will only be updated if the current user is a HCP updateLastUpdatingPharmacist(); updateContextMenuStatus(); } break; case GenForm.ContextMenus.ClinicalNamespace.EDischargeMedsSthkMenu.View: { form.getGlobalContext().Clinical.setEDischargeMeds(form.getLocalContext().getEditedMedicalRecord()); engine.open(form.getForms().Clinical.EDischargeMedsSthkDialog, new Object[]{EDischargeMedsContextMenu.EDIT, new Boolean(true), FormMode.VIEW}); } break; } }
@Override protected void onContextMenuItemClick(int menuItemID, Control sender) throws PresentationLogicException { switch (menuItemID) { case GenForm.ContextMenus.ClinicalNamespace.EDischargeMedsSthkMenu.New: { form.getGlobalContext().Clinical.setEDischargeMeds(null); engine.open(form.getForms().Clinical.EDischargeMedsSthkDialog, new Object[]{EDischargeMedsContextMenu.NEW, new Boolean(false), FormMode.EDIT}); } break; case GenForm.ContextMenus.ClinicalNamespace.EDischargeMedsSthkMenu.Edit: { form.getGlobalContext().Clinical.setEDischargeMeds(form.getLocalContext().getEditedMedicalRecord()); engine.open(form.getForms().Clinical.EDischargeMedsSthkDialog, new Object[]{EDischargeMedsContextMenu.EDIT, new Boolean(false), FormMode.EDIT}); } break; case GenForm.ContextMenus.ClinicalNamespace.EDischargeMedsSthkMenu.Remove: { TTAMedicationAndPharmacyVo currentRecord = form.getLocalContext().getEditedRecord(); if(currentRecord != null && currentRecord.getTTAMedicationsIsNotNull()) { TTAMedicationDetailVoCollection medColl = currentRecord.getTTAMedications(); medColl.remove(form.grdOrderDischMedication().getSelectedRow().getValue()); currentRecord.setTTAMedications(medColl); form.getLocalContext().setEditedRecord(currentRecord); } form.grdOrderDischMedication().getRows().remove(form.grdOrderDischMedication().getSelectedRowIndex()); updateContextMenuStatus(); } break; case GenForm.ContextMenus.ClinicalNamespace.EDischargeMedsSthkMenu.View: { form.getGlobalContext().Clinical.setEDischargeMeds(form.getLocalContext().getEditedMedicalRecord()); engine.open(form.getForms().Clinical.EDischargeMedsSthkDialog, new Object[]{EDischargeMedsContextMenu.EDIT, new Boolean(false), FormMode.VIEW}); } break; case GenForm.ContextMenus.ClinicalNamespace.EDischargeMedsSthkMenu.ViewPrevious://WDEV-11849 { engine.open(form.getForms().Clinical.TTAHistoryDialog,new Object[]{form.getLocalContext().getEditedRecord()});//WDEV-11849 } break; } }