Java Code Examples for ims.framework.controls.DynamicGridCell

The following are top voted examples for showing how to use ims.framework.controls.DynamicGridCell. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: ResultDisplayHelper.java   View source code 6 votes vote down vote up
private void addCommentsToResult(DynamicGridRow row, ResultComponentCommentsVoCollection resultComments)
{
	if (resultComments == null)
		return;
	for (int i = 0 ; i < resultComments.size() ; i++)
	{
		DynamicGridRow newRow = row.getRows().newRow();
		DynamicGridColumn colTest = grid.getColumns().getByIdentifier(ResultDisplayHelper.COL_TEST);
		DynamicGridCell cell = newRow.getCells().newCell(colTest,DynamicCellType.WRAPTEXT);
		cell.setReadOnly(true);//WDEV-16232
		cell.setValue(resultComments.get(i).getCmtText());
		colTest.setCanGrow(true);
		colTest.setDynamicWidthSupported(true);
		cell.setWidth(700);
	}
	
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onDynGrdPreTreatmentCellValueChanged(DynamicGridCell cell)
{
	if (cell.getValue() != null && !(cell.getValue() instanceof TumourGroupSiteOverallStagingVo) 
		&& (cell.getIdentifier() != STAGING) && cell.getValue() == null)
	{
		DynamicGridCell dynamicGridCell = getCellById(getColumn(COLTYPE_VALUE), OVERALL_VALUE);
		
		if (dynamicGridCell != null)
			dynamicGridCell.setValue(null);
	}
	else if (cell.getRow().getIdentifier() == null || !cell.getRow().getIdentifier().equals(OVERALL_VALUE))
	{
		calculateOverall();
	}
	else
	{
		cell.setValue(cell.getValue());
		cell.setIdentifier(cell.getIdentifier());
	}
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void addNoteRow(DynamicGridRow categoryRow, AppointmentClinicalNotesVo note, Image rowImage)
{
	if(categoryRow == null)
		return;
	
	DynamicGridRow 	noteRow = categoryRow.getRows().newRow();
	noteRow.setSelectable(true);
	noteRow.setExpandedImage(rowImage);
	noteRow.setCollapsedImage(rowImage);
	noteRow.setValue(note);
	
	DynamicGridCell cellNote = noteRow.getCells().newCell(getCol(COL_TITLE_HIERARCHICAL), DynamicCellType.STRING);	
	String title = getTitleFromNote(note);
	
	cellNote.setReadOnly(true);
	cellNote.setValue(title);
	cellNote.setTooltip(title);
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void fillAccreditationCombos()
{
	if (getColByIdentifier(COL_ACCREDITATION) != null)
	{
		form.getLocalContext().setCollAccreditation(LookupHelper.getAccreditationLocationStatus(domain.getLookupService()));
		
		for (int i = 0; i < form.dyngrdOrganisationLocation().getRows().size() ; i++)
		{
			DynamicGridRow row = form.dyngrdOrganisationLocation().getRows().get(i);
			
			if (row.getValue() instanceof OrganisationVo)
			{
				DynamicGridCell cell2 = row.getCells().newCell(getColByIdentifier(COL_ACCREDITATION), DynamicCellType.EMPTY);
				if (cell2 != null)
					cell2.setReadOnly(true);

				fillAccreditationForOrganisation(row);
			}
		}
	}		
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
public void add_OrRemoveAnswer(DynamicGridCell initiatorCell)
{
	if (initiatorCell == null || initiatorCell.getIdentifier() == null)
		return;
	if (!initiatorCell.getIdentifier().equals(BUTTON_ADD_ANSWER) && !initiatorCell.getIdentifier().equals(BUTTON_REMOVE_ANSWER))
		return;

	checkDataIntegrity(initiatorCell.getRow());

	if (initiatorCell.getIdentifier().equals(BUTTON_REMOVE_ANSWER))
	{
		if (initiatorCell.getRow().getParent() != null)
			initiatorCell.getRow().getParent().getRows().remove(initiatorCell.getRow());
		else
			this.grid.getRows().remove(initiatorCell.getRow());
	}
	else
	{
		duplicateQuestion_Row(initiatorCell.getRow());
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private SpecimenWorkListItemListVoCollection getWorkListItemsToprint()
{
	SpecimenWorkListItemListVoCollection voColl = new SpecimenWorkListItemListVoCollection();
	for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++)
	{
		for (int j = 0; j < form.dyngrdCollect().getRows().get(i).getRows().size(); j++)
		{
			for (int k = 0; k < form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().size(); k++)
			{
				DynamicGridCell printCell = form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k).getCells().get(getColumn(PRINT_COL));
				if (printCell != null && printCell.getValue() != null && printCell.getValue().equals(PrintStatus.FORPRINTING))
				{
					voColl.add((SpecimenWorkListItemListVo) form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k).getValue());
				}
			}
		}
	}

	return voColl;
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void populateQuerySpecialty(DynamicGridCell cell, String string) 
{
	cell.getItems().clear();
	
	LookupService lookup = domain.getLookupService();
	SpecialtyCollection collection = (SpecialtyCollection) lookup.getLookupCollection(Specialty.TYPE_ID,SpecialtyCollection.class, Specialty.class);
	
	if(collection != null)
	{
		for(int i=0; i<collection.size(); i++)
		{
			if(validTypedText(cell.getTypedText(), collection.get(i).getIItemText()) 
					&& specialtyNotOnScreen(collection.get(i), cell.getRow().getParent()))
			{
				DynamicGridCellItem newComboItem = cell.getItems().newItem(collection.get(i));
			}
		}
		if(collection.size() > 0)
		{
			cell.showOpened();
		}
	}	
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void createVariableCells(DynamicGridRow row, boolean bDefault)
{
	clearVariableCells(row);

	DynamicGridCell cell = row.getCells().newCell(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_LINETYPE), DynamicCellType.ENUMERATION);
	engine.populate(cell, LineType.getNegativeInstancesAsIItemCollection());
	cell.setReadOnly(false);
	if(bDefault)
	{
		cell.setValue(((DataSetTypeVo)row.getValue()).getDefaultLineType());
		cell.setReadOnly(true);
	}
	
	cell = row.getCells().newCell(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_COLOR_ICON), DynamicCellType.ENUMERATION);
	engine.populate(cell, LineColourPointIcon.getNegativeInstancesAsIItemCollection());
	cell.setReadOnly(false);
	if(bDefault)
	{
		cell.setValue(((DataSetTypeVo)row.getValue()).getDefLineColPtIcon());
		cell.setReadOnly(true);
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void EventTargetManagementAddTarget() 
{
	form.getLocalContext().setTargetConfigurationVoCollection(null);
	
	DynamicGrid dynGrid = form.lyrTargets().tabEventTargets().dyngrdEventTargetManagement();
	dynGrid.setEnabled(true);
	dynGrid.setReadOnly(false);
	DynamicGridRow dynParentRow = dynGrid.getRows().newRow();
	dynParentRow.setIdentifier(PARENT);
	dynParentRow.setReadOnly(false);

	DynamicGridCell cellTargetName = dynParentRow.getCells().newCell(getColumn(COLNAME), DynamicCellType.ENUMERATION);
	populateParentTargetNameCell(cellTargetName);

	DynamicGridCell cellSetToInScope = dynParentRow.getCells().newCell(getColumn(COLSETTOINSCOPE), DynamicCellType.BOOL);
	cellSetToInScope.setValue(Boolean.FALSE);
	cellSetToInScope.setAutoPostBack(true);
	
	DynamicGridCell cellJourneyTarget = dynParentRow.getCells().newCell(getColumn(COLJOURNEYTARGET), DynamicCellType.ENUMERATION);
	populateJourneyTargetCell(cellJourneyTarget);
	
	DynamicGridCell cellStatus = dynParentRow.getCells().newCell(getColumn(COLSTATUS), DynamicCellType.ENUMERATION);
	populateStatusCell(cellStatus, PreActiveActiveInactiveStatus.INACTIVE);
	
	dynGrid.setSelectedRow(dynParentRow);
}
 
Example 10
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void updateRowTemplateCategory(DynamicGridRow row, Header header) 
{
	DynamicGridColumn column = null;
	DynamicGridCell cell = null;
	
	column = form.dyngrdHeaders().getColumns().getByIdentifier(COL_HEADING);
	cell = row.getCells().newCell(column,(form.getMode().equals(FormMode.EDIT) ? DynamicCellType.QUERYCOMBOBOX : DynamicCellType.STRING ));
	if(form.getMode().equals(FormMode.EDIT))
	{
		DynamicGridCellItem newComboItem = cell.getItems().newItem(header);
		cell.setValue(header);
	}
	else if(form.getMode().equals(FormMode.VIEW))
	{
		cell.setValue(header.getIItemText());
	}
	cell.setReadOnly(!form.getMode().equals(FormMode.EDIT));
}
 
Example 11
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
/**
 * <b>WDEV-12569</b>
 * Function used to check for prognostic records not yet configured for the tumour group 
 */
private boolean hasUnconfiguredPrognostics()
{
	// Check for overall value (other values should be populated)
	for (int i = 0; i < form.dyngrdOverall().getRows().size(); i++)
	{
		DynamicGridColumn column = form.dyngrdOverall().getColumns().getByIdentifier(COL_OVERALL);
		DynamicGridRow row = form.dyngrdOverall().getRows().get(i);
		
		// If the row has an active overall value
		// Use the LiteVo version for value as this is the smallest type of VO
		if (row.getValue() instanceof OverallPrognosticGroupingLiteVo && ((OverallPrognosticGroupingLiteVo)row.getValue()).getIsActive())
		{
			DynamicGridCell cell = row.getCells().get(column);

			// If the value is null or TOBECONFIGURED then return as having stages not configured
			if (cell.getValue() == null || PrognosticGroup.TOBECONFIGURED.equals(cell.getValue()))
				return true;
		}
	}

	// All prognostic records are configured
	return false;
}
 
Example 12
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private DynamicGridRow createNewRow(DynamicGridRow beforeRow)
{

	DynamicGridRow newRow;
	if (beforeRow == null)
	{
		newRow = form.dyngrdComments().getRows().newRow();
	}
	else
	{
		newRow = form.dyngrdComments().getRows().newRowBefore(beforeRow);
	}
	newRow.setReadOnly(true);
	DynamicGridColumnCollection columns = form.dyngrdComments().getColumns();
	DynamicGridCell newCell = newRow.getCells().newCell(columns.getByIdentifier(COLUMN_AHCP), DynamicCellType.STRING);
	newCell.setReadOnly(true);
	newCell = newRow.getCells().newCell(columns.getByIdentifier(COLUMN_ADTE), DynamicCellType.DATETIME);
	newCell.setReadOnly(true);
	newCell = newRow.getCells().newCell(columns.getByIdentifier(COLUMN_COMMENTS), DynamicCellType.WRAPTEXT);
	newCell.setReadOnly(true);

	return newRow;
}
 
Example 13
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void addTemplates(ReportListVo voReportList, DynamicGridRow reportRow)
{
	for (int i = 0; voReportList.getTemplatesIsNotNull() && i < voReportList.getTemplates().size(); i++)
	{
		ReportTemplateLiteVo reportTemplateLiteVo = voReportList.getTemplates().get(i);

		if(reportTemplateLiteVo != null && Boolean.TRUE.equals(reportTemplateLiteVo.getIsActive()))
		{
			DynamicGridRow templateRow = reportRow.getRows().newRow();
			templateRow.setValue(reportTemplateLiteVo);
			templateRow.setCollapsedImage(form.getImages().Core.TemplateReport);
			templateRow.setExpandedImage(form.getImages().Core.TemplateReport);

			DynamicGridCell cellTemplateName = createCell(templateRow, getColumn(COLUMN_NAME));
			cellTemplateName.setValue(reportTemplateLiteVo.getName());

			//DynamicGridCell cellTemplateDescription = createCell(templateRow, getColumn(COLUMN_DESCRIPTION));
			//cellTemplateDescription.setValue(reportTemplateLiteVo.getDescription());
			
			if(voReportList.getImsIdIsNotNull() && voReportList.getImsId().intValue() > 0)
			{
				templateRow.setTextColor(Color.Blue);
			}
		}
	}
}
 
Example 14
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean atLeastOneRecordWasSelected()
{
	
	for (int i = 0; i < form.dyngrdList().getRows().size(); i++)
	{
		DynamicGridRow row = form.dyngrdList().getRows().get(i);
		
		DynamicGridCell cell = row.getCells().get(getColumnById(COLUMN_SELECT));
		
		if (cell != null && Boolean.TRUE.equals(cell.getValue()))
		{
			return true;
		}
	}
	
	return false;
}
 
Example 15
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onDyngrdResultsCellButtonClicked(DynamicGridCell cell) 
{
	if(isSTHKModeResultCheck())
	{
		if(cell.getIdentifier().equals(ResultDisplayHelper.BUTTON_CHKD))
		{
			form.getLocalContext().setPickValue(hasMarkResultAsCheckedRoleRight() ? ResultDisplayHelper.PICK_CHKD : ResultDisplayHelper.PICK_VIEWED);
			close();
		}
		else if(cell.getIdentifier().equals(ResultDisplayHelper.BUTTON_NEXT))
		{
			form.getLocalContext().setPickValue(hasMarkResultAsCheckedRoleRight() ? ResultDisplayHelper.PICK_CHKD : ResultDisplayHelper.PICK_VIEWED);
			move(true);
		}
		else if(cell.getIdentifier().equals(ResultDisplayHelper.BUTTON_PREVIEW))
		{
			form.getLocalContext().setPickValue(hasMarkResultAsCheckedRoleRight() ? ResultDisplayHelper.PICK_CHKD : ResultDisplayHelper.PICK_VIEWED);
			move(false);
		}
	}
	
	updateControlsState();
}
 
Example 16
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void addCategory(DynamicGridRow rowParent, ReportsCategoryListVo voCategory)
{
	if (voCategory == null)
		return;

	DynamicGridRow categoryRow = null;
	if (rowParent == null)
		categoryRow = form.dyngrdReports().getRows().newRow();
	else
		categoryRow = rowParent.getRows().newRow();

	categoryRow.setValue(voCategory);
	categoryRow.setSelectable(false);
	categoryRow.setCollapsedImage(form.getImages().Core.ReportCategory);
	categoryRow.setExpandedImage(form.getImages().Core.ReportCategory);

	DynamicGridCell cellName = createCell(categoryRow, getColumn(COLUMN_NAME));
	cellName.setValue(voCategory.getName());

	if (voCategory.getSubCategoriesIsNotNull() && voCategory.getSubCategories().size() > 0)
	{
		categoryRow.setExpanded(true);
		addSubcategories(categoryRow, voCategory.getSubCategories());
	}
}
 
Example 17
Project: AvoinApotti   File: OrderEntryTemplatePopulation.java   View source code 6 votes vote down vote up
void addSeparator(int columnIndex, int rowIndex, String dividerText, Color dividerColour, Boolean dividerIsBold) 
{
	if(dividerText != null && dividerText.trim().length() > 0)
	{
		String text = dividerText; 
		DynamicGridRow row = grid.getRows().get(rowIndex);
		DynamicGridColumn column = grid.getColumns().get(columnIndex);			
		DynamicGridCell cell = row.getCells().newCell(column, DynamicCellType.HTMLVIEW);
		
		if(dividerColour != null)
		{
			text = "<font color=\"" + dividerColour.getValue() + "\">" + text + "</font>";
		}			
		if(dividerIsBold != null && dividerIsBold.booleanValue())
		{
			text = "<b>" + text + "</b>";
		}
		
		cell.setValue(text);
	}
}
 
Example 18
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
protected void onDyngrdCollectCellTextSubmited(DynamicGridCell cell)
{
	if (cell.getColumn().equals(getColumn(QUERY_COL)))
	{
		cell.getItems().clear();
		String value = cell.getTypedText();
		PersonName name = new PersonName();
		MemberOfStaffShortVo filter = new MemberOfStaffShortVo();
		name.setSurname(value);
		filter.setIsActive(Boolean.TRUE);
		filter.setName(name);
		MemberOfStaffShortVoCollection voColl = domain.listMembersOfStaff(filter);
		for (int i = 0; i < voColl.size(); i++)
		{
			cell.getItems().newItem(voColl.get(i));
		}
		int cellItemSize = cell.getItems().size();
		if (cellItemSize > 0)
		{
			if (cellItemSize == 1)
				cell.setValue(cell.getItems().get(0));
			cell.showOpened();
		}
	}
}
 
Example 19
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
/**
 * WDEV-12569
 * Function used to check for stages not yet configured for the tumour site 
 */
private boolean hasUnconfiguredStages()
{
	// Check for overall value (other values should be populated)
	for (int i = 0; i < form.dyngrdOverall().getRows().size(); i++)
	{
		DynamicGridColumn column = form.dyngrdOverall().getColumns().getByIdentifier(COL_OVERALL);
		DynamicGridRow row = form.dyngrdOverall().getRows().get(i);

		// If the row has an active overall value
		// Use the LiteVo version for value as this is the smallest type of VO
		if (row.getValue() instanceof TumourGroupSiteOverallStagingLiteVo && ((TumourGroupSiteOverallStagingLiteVo)row.getValue()).getIsActive())
		{
			DynamicGridCell cell = row.getCells().get(column);

			// If the value is null or TOBECONFIGURED (-2151) then return as having stages not configured
			if (cell.getValue() == null || TumourOverallStage.TOBECONFIGURED.equals(cell.getValue()))
				return true;
		}
	}

	// All stages are configured
	return false;
}
 
Example 20
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void refreshGroupCellData(AssessmentQuestionGroupVoCollection voColl)
{
	for (int i = 0; i < form.lyrTabs().tabAssessments().dyngrdDetails().getRows().size(); i++)
	{
		DynamicGridRow row = form.lyrTabs().tabAssessments().dyngrdDetails().getRows().get(i);
		DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_GROUP));
		Object value = cell.getValue();
		
		cell.getItems().clear();
		for (int j = 0; voColl != null && j < voColl.size(); j++)
			cell.getItems().newItem(voColl.get(j));
		cell.setValue(value);
		if(value instanceof AssessmentQuestionVo)
			row.setValue(cell);
	}
}
 
Example 21
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
/**
 * function used to populate dynamic grid row with neuro motor area finding
 */
private void setDynamicGridMotorAreaFindingRow(DynamicGridRow row, NeuroMotorAreaFindingVo finding)
{
	if (finding == null)
		return;

	if (row == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add a finding to a null row");

	// Set the row
	DynamicGridColumn column;
	DynamicGridCell cell;

	column = form.dyngrdMotor().getColumns().getByIdentifier(COL_MOTOR_AREA);
	cell = row.getCells().newCell(column, DynamicCellType.HTMLVIEW);
	cell.setValue(finding.getMotorAreaIsNotNull() ? finding.getMotorArea().getMotorAreaDescription() : ""); // wdev-14406
	cell.setIdentifier(finding.getMotorArea());
	cell.setReadOnly(true);

	column = form.dyngrdMotor().getColumns().getByIdentifier(COL_RIGHT);
	cell = row.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(finding.getRightFinding() == null ? "" : (finding.getRightFinding() < 0 ? "N" : finding.getRightFinding().toString()));
	cell.setWidth(STANDARD_COLUMN_WIDTH);
	cell.setReadOnly(false);
	cell.setAutoPostBack(true);

	column = form.dyngrdMotor().getColumns().getByIdentifier(COL_LEFT);
	cell = row.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(finding.getLeftFinding() == null ? "" : (finding.getLeftFinding() < 0 ? "N" : finding.getLeftFinding().toString()));
	cell.setReadOnly(false);
	cell.setAutoPostBack(true);

	row.setValue(finding);
}
 
Example 22
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
/**
 * function used to populate dynamic grid row with root finding (backward
 * compatibility)
 */
private void setDynamicGridRootFindingRow(DynamicGridRow row, NeuroMotorRootValueVo finding)
{
	if (finding == null)
		return;

	if (row == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add a finding to a null row");

	// Set the row
	DynamicGridColumn column;
	DynamicGridCell cell;

	column = form.dyngrdMotor().getColumns().getByIdentifier(COL_MOTOR_AREA);
	cell = row.getCells().newCell(column, DynamicCellType.HTMLVIEW);
	cell.setValue(finding.getRootValue() != null ? finding.getRootValue().getDescription() : "");
	cell.setIdentifier(finding.getRootValue());
	cell.setReadOnly(true);

	column = form.dyngrdMotor().getColumns().getByIdentifier(COL_RIGHT);
	cell = row.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(finding.getRightFinding() == null ? "" : (finding.getRightFinding() < 0 ? "N" : finding.getRightFinding().toString()));
	cell.setWidth(STANDARD_COLUMN_WIDTH);
	cell.setReadOnly(false);
	cell.setAutoPostBack(true);

	column = form.dyngrdMotor().getColumns().getByIdentifier(COL_LEFT);
	cell = row.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(finding.getLeftFinding() == null ? "" : (finding.getLeftFinding() < 0 ? "N" : finding.getLeftFinding().toString()));
	cell.setReadOnly(false);
	cell.setAutoPostBack(true);

	row.setValue(finding);
}
 
Example 23
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
@Override
protected void onDyngrdPrognosticPreTreatmentCellValueChanged(DynamicGridCell cell)
{
	if (cell.getRow().getIdentifier() == null)
		throw new CodingRuntimeException("All rows on prognostic dyanmic grid must have an identifier set");
	
	// Execute only if the cell's column identifier is COLTYPE_VALUE
	// and it's not the Overall Prognostic that is changing
	if (!COLTYPE_VALUE.equals(cell.getColumn().getIdentifier()) || cell.getRow().getIdentifier().equals(ROW_IDENTIF_PROGNOSTIC_OVERALL_PROGNOSTIC))
		return;
	
	// Call function to bind Overall Prognostic values based on values on screen
	calculateOnScreenOverallPrognostic();
}
 
Example 24
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void populateOverall(TumourGroupSiteOverallStagingVo value)
{
	DynamicGridRow overallRow = form.lyrMain().tabTumourDetails().lyrPrognosticTNM().tabTNM().dynGrdPreTreatment().getRows().newRow();
	overallRow.setIdentifier(OVERALL_VALUE);
	DynamicGridCell typeNameCell = overallRow.getCells().newCell(getColumn(COLTYPE_NAME), DynamicCellType.HTMLVIEW);
	typeNameCell.setBackColor(Color.Gray);
	typeNameCell.setOptions(DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	typeNameCell.setValue("<b><p align=center>Overall Stage</p></b>");

	DynamicGridCell typeValueCell = overallRow.getCells().newCell(getColumn(COLTYPE_VALUE), DynamicCellType.ENUMERATION);
	if (value != null)
		typeValueCell.setIdentifier(value);
	else
		typeValueCell.setIdentifier(OVERALL_VALUE);

	typeValueCell.setAutoPostBack(true);
	if (value != null)
	{
		typeValueCell.getItems().newItem(value, value.toString());
		typeValueCell.setValue(value);
	}

	TNMCertaintyFactorCollection certaintyFactor = ims.oncology.vo.lookups.LookupHelper.getTNMCertaintyFactor(this.domain.getLookupService());

	DynamicGridCell certainNameCell = overallRow.getCells().newCell(getColumn(COLCERTAIN_NAME), DynamicCellType.HTMLVIEW);
	certainNameCell.setBackColor(Color.Gray);
	certainNameCell.setOptions(DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	certainNameCell.setValue("<b><p align=center>Overall Certainty</p></b>");

	DynamicGridCell certainValueCell = overallRow.getCells().newCell(getColumn(COLCERTAIN_VALUE), DynamicCellType.ENUMERATION);
	certainValueCell.setIdentifier(OVERALLCERTAIN_VALUE);
	bindCertaintyFactor(certaintyFactor, certainValueCell, form.getLocalContext().getSelectedRecordIsNotNull() && form.getLocalContext().getSelectedRecord().getID_PrimaryTumourDetailsIsNotNull() ? (form.getLocalContext().getSelectedRecord().getPreTreatmentOverAllCertIsNotNull() ? form.getLocalContext().getSelectedRecord().getPreTreatmentOverAllCert() : null) : null);
}
 
Example 25
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void removeCellByColumn(DynamicGridRow row, String colIdentifier)
{
	DynamicGridCell cell;
	cell = row.getCells().get(getColumn(colIdentifier));
	if (cell != null)
		row.getCells().remove(cell);
}
 
Example 26
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void populateStatusCell(DynamicGridCell status_cell)
{
	status_cell.getItems().clear();
	PatientAssessmentStatusReasonCollection voColl = LookupHelper.getPatientAssessmentStatusReason(domain.getLookupService());
	for(int i = 0; voColl != null && i < voColl.size(); i++)
	{
		if(voColl.get(i).getParent() == null)
			status_cell.getItems().newItem(voColl.get(i));
	}
}
 
Example 27
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void ListAwaitingTriageCounts(TrackingAreaVoCollection areas, ILocation currentLocation)
{
	DynamicGridRow row = form.dyngrdAreas().getRows().newRow();		
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_STATUS), DynamicCellType.STRING);
	cell.setWidth(140);
	cell.setValue("Awaiting Triage");
	cell.setBackColor(Color.fromRGB(198, 223, 242));
	
	int overall_sum=0;
	for(int i=0;i< areas.size();i++)
	{
		cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_AREA+areas.get(i).getID_TrackingArea()), DynamicCellType.STRING);
		cell.setWidth(150);
		String val=domain.getAwaitingTriageCounts(currentLocation, areas.get(i));								
		if(val!=null)
		{
			if(!val.equals("0")&& !val.equals(""))
			{
				cell.setValue(val);
				overall_sum=overall_sum+Integer.valueOf(val).intValue();					
			}	
			else
			{
				cell.setValue("-");
			}
		}
		else
		{
			cell.setValue("-");
		}
	}
	cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_OVERALL), DynamicCellType.HTMLVIEW);
	cell.setWidth(90);
	cell.setValue("<b>"+(overall_sum>0?String.valueOf(overall_sum):"-")+"<b>");
	cell.setBackColor(Color.Bisque);
}
 
Example 28
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
protected void viewAssociations()
{
	DynamicGridRow row = form.dyngrdProcedure().getSelectedRow();
	if (row == null)
		throw new CodingRuntimeException("No row selected");

	DynamicGridCell cell = row.getCells().get(getColByIdentifier(COL_ASSOCS));

	if ((cell != null) && (cell.getColumn().equals(getColumn(COL_ASSOCS))) && (cell.getRow() != null) && (cell.getRow().getValue() != null))
	{
		form.getGlobalContext().Clinical.setClinicalDIassociationsFormMode(FormMode.VIEW);
		form.getGlobalContext().Clinical.PatientSummary.setPrimaryAssociation((PatientProcedureShortListVo) cell.getRow().getValue());
		engine.open(form.getForms().Clinical.ClinicalDiAssociations);
	}
}
 
Example 29
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void listOrganisation(DynamicGridCell cell)
{
	if (cell == null)
		return;

	OrgShortVo filter = new OrgShortVo();
	filter.setName(cell.getTypedText());
	filter.setIsActive(Boolean.TRUE);

	populateCellItems(cell, domain.listOrganisationsShort(filter));
}
 
Example 30
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
@Override
protected void onChkSelectAllValueChanged() throws ims.framework.exceptions.PresentationLogicException
{
	for (int i = 0; i < form.dyngrdList().getRows().size(); i++)
	{
		DynamicGridRow row = form.dyngrdList().getRows().get(i);
		
		DynamicGridCell cell = row.getCells().get(getColumnById(COLUMN_SELECT));
		
		if (cell != null)
		{
			cell.setValue(form.chkSelectAll().getValue());
		}
	}
}
 
Example 31
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void ListUnallocated(ILocation currentLocation,TrackingAreaVoCollection areas)
{
	DynamicGridRow row = form.dyngrdAreas().getRows().newRow();
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_STATUS), DynamicCellType.STRING);
	cell.setWidth(150);
	cell.setValue("Unallocated");
	cell.setBackColor(Color.fromRGB(198, 223, 242));
	
	int overall_sum=0;
	for(int i=0;i< areas.size();i++)
	{
		cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_AREA+areas.get(i).getID_TrackingArea()), DynamicCellType.STRING);
		cell.setWidth(150);
		String val=domain.getUnallocated(currentLocation, areas.get(i));
		if(val!=null)
		{
			if(!val.equals("0")&& !val.equals(""))
			{
				cell.setValue(val);
				overall_sum=overall_sum+Integer.valueOf(val).intValue();					
			}	
			else
			{
				cell.setValue("-");
			}
		}
		else
		{
			cell.setValue("-");
		}
	}
	cell = row.getCells().newCell(form.dyngrdAreas().getColumns().getByIdentifier(COL_OVERALL), DynamicCellType.HTMLVIEW);
	cell.setWidth(90);
	cell.setValue("<b>"+(overall_sum>0?String.valueOf(overall_sum):"-")+"<b>");
	cell.setBackColor(Color.Bisque);
}
 
Example 32
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void setColNoteType(ClinicalNotesShortVo note, DynamicGridRow row)
{
	DynamicGridColumn col = getCol("Note Type");
	if (col == null)
		throw new DomainRuntimeException("No column for Identifier");

	DynamicGridCell disCell = row.getCells().newCell(col, DynamicCellType.STRING);
	disCell.setValue(note.getNoteClassificationIsNotNull() ? note.getNoteClassification().getText() : "");
}
 
Example 33
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void applyAll(DynamicGridColumn column) 
{
	for(int i = 0; i<form.dyngrdMerge().getRows().size(); i++)
	{
		DynamicGridCell sourceButton = form.dyngrdMerge().getRows().get(i).getCells().get(column);
		
		if(sourceButton != null)
		{
			populateResultCell(sourceButton, true);
		}
	}
}
 
Example 34
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void createCommonControls(DynamicGridRow row)
{
	if(row.getCells().get(getColumn(BTN_COL)) == null)
	{
		DynamicGridCell cell = row.getCells().newCell(getColumn(BTN_COL), DynamicCellType.IMAGEBUTTON, DynamicGridCellOptions.EDITABLE_DATA_CELL);
		cell.setValue(form.getImages().OCRR.SaveGrid);
		cell.setTooltip("Save");
	}
}
 
Example 35
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private DynamicGridCell getDayNoCell(DynamicGridRow row)
{
	DynamicGridCell cycleDayNoCell = row.getCells().get(getColumnByIdentifier(CYCLE_DAY_NO));
	if (cycleDayNoCell == null)
		cycleDayNoCell = row.getCells().newCell(getColumnByIdentifier(CYCLE_DAY_NO), DynamicCellType.STRING);
	return cycleDayNoCell;
}
 
Example 36
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void addGroupLegend(Assessment_QuestionGroupVo group)
{
	DynamicGridColumn questionColumn = this.grid.getColumns().getByIdentifier(QUESTION_COLUMN);
	DynamicGridRow row = this.grid.getRows().newRow();
	row.setSelectable(false);
	questionColumn.setDynamicWidthSupported(true);

	DynamicGridCell questionCell = row.getCells().newCell(questionColumn, DynamicCellType.HTMLVIEW);
	questionCell.setValue(group.getLegendText());
	questionCell.setWidth(DEFAULT_LEGEND_CELL_WIDTH);
	questionCell.setReadOnly(true);

}
 
Example 37
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
protected void onDyngrdAssociationsCellTextSubmited(DynamicGridCell cell)
{
	if (!(cell.getRow().getParent().getValue() instanceof AssociationCategory))
		return;
	
	if (cell.getTypedText() == null || cell.getTypedText().length() < 3)
	{
		engine.showMessage("Please enter at least 3 characters to search upon.");
		return;
	}
	
	try
	{
		switch ((AssociationCategory) cell.getRow().getParent().getValue())
		{
			case CLINICS:
				populateQueryComboboxClinics(cell, listClinicsByName(cell.getTypedText()));
				break;
				
			case CONSULTANTS:
				populateQueryComboboxConsultants(cell, listConsultantsByName(cell.getTypedText()));
				break;
				
			case SPECIALTY:
				populateQueryComboboxSpecialties(cell, listSpecialtyByName(cell.getTypedText()));
				break;
		}
	}
	catch (CodingRuntimeException exception)
	{	engine.showMessage(exception.getMessage());	}
	
	form.dyngrdAssociations().setSelectedRow(null);
	updateContextMenuState();
}
 
Example 38
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private void makeReaOnlyNACell(DynamicGridRow row, boolean value)
{
	if(row != null)
	{
		DynamicGridColumn naColumn = this.grid.getColumns().getByIdentifier(NOTAPPLICABLE_COLUMN);
		if(naColumn != null)
		{
			DynamicGridCell naCell = row.getCells().get(naColumn);
			if(naCell != null)
			{
				naCell.setReadOnly(value);
			}
		}
	}
}
 
Example 39
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void listLocSite(DynamicGridCell cell)
{
	if (cell == null)
		return;

	populateCellItems(cell, domain.listLocSite(cell.getTypedText()));
}
 
Example 40
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void newSpecialtyAssociationRow(DynamicGridRow parrentRow, Specialty specialty)
{
	if (parrentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add specialty association row to a null parrent row");
	
	if (specialty == null)
		return;
	
	
	DynamicGridCell newCell;
	DynamicGridColumn column;
	
	// Create a new row
	DynamicGridRow newRow = parrentRow.getRows().newRow();
	newRow.setValue(specialty);
	
	// Create the first cell in the row (IMAGE)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_IMAGE);
	newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
	newCell.setValue(form.getImages().Admin.Specialty01);
	
	// Create the second cell in the row (STRING)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
	newCell.setValue(specialty.getText());
	newCell.setReadOnly(true);
}