private void updateRowRecord(PatientInvasiveDeviceVo record) { if(record == null) return; for(int j = 0; j < form.dyngrdDisplay().getRows().size(); j++) { PatientInvasiveDeviceShortVo existingRecord = (PatientInvasiveDeviceShortVo) (form.dyngrdDisplay().getRows().get(j).getValue()); if(existingRecord != null && existingRecord.equals(record)) { updateRowRecord(form.dyngrdDisplay().getRows().get(j), record); break; } } }
private boolean newVipScore() { Object obj = form.dyngrdDisplay().getSelectedRow().getValue(); if(obj instanceof PatientInvasiveDeviceShortVo) if (requireVip((PatientInvasiveDeviceShortVo) form.dyngrdDisplay().getSelectedRow().getValue()) != true) { return false; } form.setMode(FormMode.EDIT); form.ctnDetail().lyrDetails().showtabVIP(); form.ctnDetail().lyrDetails().tabDevice().setHeaderVisible(false); form.ctnDetail().lyrDetails().tabVIP().setHeaderVisible(true); clearTabVipInstanceControls() ; form.ctnDetail().lyrDetails().tabVIP().customVipAuthoringHCP().initializeComponent(); updateContextMenuState(); return true; }
protected void onDyngrdDisplayRowSelectionChanged(DynamicGridRow row) { Object obj = form.dyngrdDisplay().getSelectedRow().getIdentifier(); if(obj instanceof PatientInvasiveDeviceShortVo) { getAndDisplayRecordDevice(); } else if(obj instanceof PatientInvasiveDeviceVipVo) { getAndDisplayRecordVip(); form.getLocalContext().setEditedDeviceRecord(null); form.ctnDetail().setCollapsed(form.dyngrdDisplay().getSelectedRow() == null); } updateControlsState(); }
private void populateInvasiveDeviceGrid() { PatientInvasiveDeviceShortVoCollection voColl = domain.listCurrentPatientInvasiveDevice(form.getGlobalContext().Core.getCurrentCareContext()); for (int i = 0; voColl != null && i < voColl.size(); i++) { PatientInvasiveDeviceShortVo voInvasiveDev = voColl.get(i); grdInvasiveRow row = form.grdInvasive().getRows().newRow(); row.setColInvasive(voInvasiveDev.getInvasiveDeviceIsNotNull()?voInvasiveDev.getInvasiveDevice().getInvasiveDevice():""); row.setColInserted(voInvasiveDev.getInsertedDateTimeIsNotNull()?voInvasiveDev.getInsertedDateTime().toString():""); if (voInvasiveDev.getTargetRemovalDateTime().getDate().isLessOrEqualThan(new DateTime().getDate())) { row.setBackColor(ims.configuration.gen.ConfigFlag.UI.INVASIVE_DEVICE_REMOVAL_ROW_COLOR.getValue()); } } }
private boolean requireVip(PatientInvasiveDeviceShortVo record) { InvasiveDeviceConfigShortVo voInvasiveDeviceConfig = record.getInvasiveDevice(); if (voInvasiveDeviceConfig.getRequiresVIPIsNotNull() && voInvasiveDeviceConfig.getRequiresVIP().booleanValue() == false) return false; return true; }
protected void onFormModeChanged() { if(form.getMode().equals(FormMode.VIEW)) { form.dyngrdDisplay().setReadOnly(true); } if(form.getMode().equals(FormMode.EDIT)) { form.ctnDetail().lyrDetails().tabDevice().customInsertedHCP().setEnabledAuthoringHCP(Boolean.TRUE); form.ctnDetail().lyrDetails().tabDevice().customInsertedHCP().setEnabledDateTime(Boolean.TRUE); } if (form.dyngrdDisplay().getSelectedRow() != null) { Object obj = form.dyngrdDisplay().getSelectedRow().getIdentifier(); if(obj instanceof PatientInvasiveDeviceShortVo) { if (form.getLocalContext().getEditedDeviceRecordIsNotNull()) { getAndDisplayRecordDevice(form.getLocalContext().getEditedDeviceRecord()); } else { getAndDisplayRecordDevice((PatientInvasiveDeviceShortVo)form.dyngrdDisplay().getSelectedRow().getIdentifier()); } } if(obj instanceof PatientInvasiveDeviceVipVo) { getAndDisplayRecordVip(form.getLocalContext().getEditedVipRecord()); } } updateControlsState(); }
private void populateInvasiveDeviceGrid() { PatientInvasiveDeviceShortVoCollection voColl = domain.listCurrentPatientInvasiveDevice(form.getGlobalContext().Core.getCurrentCareContext()); for (int i = 0; voColl != null && i < voColl.size(); i++) { PatientInvasiveDeviceShortVo voInvasiveDev = voColl.get(i); grdDevicesRow row = form.grdDevices().getRows().newRow(); row.setColType(voInvasiveDev.getInvasiveDeviceIsNotNull()?voInvasiveDev.getInvasiveDevice().getInvasiveDevice():""); row.setColInserted(voInvasiveDev.getInsertedDateTimeIsNotNull()?voInvasiveDev.getInsertedDateTime().toString():""); if (voInvasiveDev.getTargetRemovalDateTime().getDate().isLessOrEqualThan(new DateTime().getDate())) { row.setBackColor(ims.configuration.gen.ConfigFlag.UI.INVASIVE_DEVICE_REMOVAL_ROW_COLOR.getValue()); } } }
private void addCurrentRowRecord(PatientInvasiveDeviceShortVo record) { if(record == null) return; DynamicGridRow dynRow = form.dyngrdDisplay().getRows().newRow(record.equals(form.getLocalContext().getEditedDeviceRecord())); dynRow.setIdentifier(record); PatientInvasiveDeviceVipVoCollection recordVip = record.getVIPScoreIsNotNull() ? record.getVIPScore() : null; InvasiveDeviceConfigShortVo recordDevice = record.getInvasiveDeviceIsNotNull() ? record.getInvasiveDevice() : null; DynamicGridCell deviceCell = dynRow.getCells().newCell(getColumn(COLDEVICE), DynamicCellType.STRING); deviceCell.setValue(recordDevice.getInvasiveDevice()); DynamicGridCell siteCell = dynRow.getCells().newCell(getColumn(COLSITE), DynamicCellType.STRING); siteCell.setValue(record.getSiteIsNotNull() ? record.getSite() : null); DynamicGridCell insDateCell = dynRow.getCells().newCell(getColumn(COLINSERTEDDATE), DynamicCellType.STRING); insDateCell.setValue(record.getInsertedDateTime().toString()); HcpLiteVo recordHCP = record.getInsertedHCPIsNotNull() ? record.getInsertedHCP() : null; DynamicGridCell insHcpCell = dynRow.getCells().newCell(getColumn(COLINSERTEDBY), DynamicCellType.STRING); insHcpCell.setValue(recordHCP.getMos().getName().toString()); if (record.getTargetRemovalDateTime().getDate().isLessOrEqualThan(new DateTime().getDate())) { dynRow.setBackColor(ims.configuration.gen.ConfigFlag.UI.INVASIVE_DEVICE_REMOVAL_ROW_COLOR.getValue()); } if (recordVip != null) { for(int x = 0; x < record.getVIPScore().size(); x++) { if(recordVip.get(x) != null) { DynamicGridRow childRow = dynRow.getRows().newRow(); DynamicGridCell vipCell = childRow.getCells().newCell(getColumn(COLDEVICE), DynamicCellType.STRING); vipCell.setValue("VIP="+record.getVIPScore().get(x).getVIPScale().toString()); childRow.setIdentifier(record.getVIPScore().get(x)); childRow.setValue(record.getVIPScore().get(x)); } } } dynRow.setValue(record); }
public void updateControlsState() { if(form.getMode().equals(FormMode.VIEW)) { form.btnNew().setVisible(true); form.btnUpdate().setVisible(true); if (form.cmbFilter().getValue().equals(FILTER_CURRENT)) { if (form.dyngrdDisplay().getSelectedRow() != null) { form.btnUpdate().setEnabled(true); Object obj = form.dyngrdDisplay().getSelectedRow().getIdentifier(); if(obj instanceof PatientInvasiveDeviceShortVo) { form.btnNew().setEnabled(true); form.ctnDetail().lyrDetails().showtabDevice(); form.ctnDetail().lyrDetails().tabDevice().setHeaderVisible(true); form.ctnDetail().lyrDetails().tabVIP().setHeaderVisible(false); } else if(obj instanceof PatientInvasiveDeviceVipVo) { form.btnNew().setEnabled(false); form.ctnDetail().lyrDetails().showtabVIP(); form.ctnDetail().lyrDetails().tabDevice().setHeaderVisible(false); form.ctnDetail().lyrDetails().tabVIP().setHeaderVisible(true); } } else { form.btnNew().setEnabled(true); form.btnUpdate().setEnabled(false); } } if (form.cmbFilter().getValue().equals(FILTER_HISTORIC)) { form.btnNew().setEnabled(false); form.btnUpdate().setEnabled(false); } } updateContextMenuState(); }
private PatientInvasiveDeviceVo getAndDisplayRecordDevice() { PatientInvasiveDeviceShortVo record = (PatientInvasiveDeviceShortVo)form.dyngrdDisplay().getSelectedRow().getIdentifier(); return getAndDisplayRecordDevice(record); }