Java Code Examples for ims.framework.controls.DynamicGridColumn

The following are top voted examples for showing how to use ims.framework.controls.DynamicGridColumn. 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: Logic.java   Source Code and License 6 votes vote down vote up
private void createNotificationCells(DynamicGridRow row, RuleValueConditionEntry entry, int count) throws ParseException
{
	DynamicGridColumn valueColl = getColByIndexForActionGrid(count);
	if (valueColl == null)
	{
		valueColl = createColumnForActionGrid("", count);
	}
	setRowIdentifier(row, count, RuleConditionType.VALUE);

	DynamicGridCell preComparatorCell = row.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	for (int i = 0; i < entry.getField().getParentEntity().getFields().size(); i++)
	{
		preComparatorCell.getItems().newItem(entry.getField().getParentEntity().getFields().get(i).getName());
		preComparatorCell.getItems().get(i).setIdentifier(entry.getField().getParentEntity().getFields().get(i));
	}

	preComparatorCell.setAutoPostBack(true);
	preComparatorCell.setValue(entry.getField().getName());
	preComparatorCell.setIdentifier(entry.getField());
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * WDEV-12569
 * 
 * Function used to set the sort order for appropriate column
 * @param column
 */
private void setColumnSortOrder(DynamicGridColumn column)
{
	if (column != null && column.getIdentifier() == null)
		throw new CodingRuntimeException("Logical Error - All grid columns must have an identifier. Check grid initialization");
	
	// Toggle between ASCENDING and DESCENDING sort mode
	// In the case where sort mode has not been set then default to ASCENDING sort mode
	// Each line will toggle if the column matches, else the sort mode will be cleared (null)
	form.getLocalContext().setSortOrder_T(column != null && column.getIdentifier().equals(COL_T_VALUE) ? (SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrder_T()) ? SortOrder.DESCENDING : SortOrder.ASCENDING) : null);
	form.getLocalContext().setSortOrder_N(column != null && column.getIdentifier().equals(COL_N_VALUE) ? (SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrder_N()) ? SortOrder.DESCENDING : SortOrder.ASCENDING) : null);
	form.getLocalContext().setSortOrder_M(column != null && column.getIdentifier().equals(COL_M_VALUE) ? (SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrder_M()) ? SortOrder.DESCENDING : SortOrder.ASCENDING) : null);
	form.getLocalContext().setSortOrder_HisType(column != null && column.getIdentifier().equals(COL_HIST_TYPE) ? (SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrder_HisType()) ? SortOrder.DESCENDING : SortOrder.ASCENDING) : null);
	form.getLocalContext().setSortOrder_HisGrade(column != null && column.getIdentifier().equals(COL_HIST_GRADE) ? (SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrder_HisGrade()) ? SortOrder.DESCENDING : SortOrder.ASCENDING) : null);
	form.getLocalContext().setSortOrder_Serum(column != null && column.getIdentifier().equals(COL_SERUM) ? (SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrder_Serum()) ? SortOrder.DESCENDING : SortOrder.ASCENDING) : null);
	form.getLocalContext().setSortOrder_O45(column != null && column.getIdentifier().equals(COL_OVER_45) ? (SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrder_O45()) ? SortOrder.DESCENDING : SortOrder.ASCENDING) : null);
	form.getLocalContext().setSortOrder_Overall(column != null && column.getIdentifier().equals(COL_OVERALL) ? (SortOrder.ASCENDING.equals(form.getLocalContext().getSortOrder_Overall()) ? SortOrder.DESCENDING : SortOrder.ASCENDING) : null);
}
 
Example 3
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private void createStaticColumns(boolean isComplete)
{
	 if(this.questionImage != null && this.mandatoryQuestionImage != null)
		 createImageColumnWhenFlat();
	 
	DynamicGridColumn questionColumn = this.grid.getColumns().newColumn("Question", QUESTION_COLUMN);
	questionColumn.setCanGrow(false);
	questionColumn.setWidth(DEFAULT_GRAPHIC_QUESTION_COLUMN_WIDTH);	
			
	if(!isComplete)
	{
		DynamicGridColumn buttonColumn = this.grid.getColumns().newColumn("", BUTTON_COLUMN);
		buttonColumn.setAlignment(Alignment.CENTER);
		buttonColumn.setCanGrow(false);
		buttonColumn.setWidth(0);			
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void initializeDynamicGrid()
{
	form.dyngrdNotes().clear();
	form.dyngrdNotes().setSelectable(true);	
	
	DynamicGridColumn column;
	column = form.dyngrdNotes().getColumns().newColumn("HCP", COL_USER);
	column.setWidth(200);
	column.setCanGrow(true);
			
	column = form.dyngrdNotes().getColumns().newColumn("DateTime", COL_DATE);
	column.setWidth(100);		
	column.setCanGrow(false);				
			
	column = form.dyngrdNotes().getColumns().newColumn("Summary Note", COL_NOTES);
	column.setCanGrow(false);
	column.setWidth(480);
	
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void createdDynamicGridSpecialInterest()
{
	form.dyngrdSpecialInterest().getRows().clear();
	
	DynamicGridColumn columnName = form.dyngrdSpecialInterest().getColumns().newColumn("Category", COLUMN_SPECIALINTERESTCATEGORY);
	columnName.setWidth(155);
	columnName.setAlignment(Alignment.LEFT);
	columnName.setReadOnly(true);
	
	columnName = form.dyngrdSpecialInterest().getColumns().newColumn("Start Date", COLUMN_STARTDATE);
	columnName.setWidth(100);
	columnName.setReadOnly(true);
	
	columnName = form.dyngrdSpecialInterest().getColumns().newColumn("End Date", COLUMN_ENDDATE);
	columnName.setWidth(-1);
	columnName.setReadOnly(true);

}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setColStatus(ClinicalNotesShortVo note, DynamicGridRow row)
{
	DynamicGridColumn col = getCol("Status");
	if (col == null)
		throw new DomainRuntimeException("No column for Identifier");

	DynamicGridCell statusCell = row.getCells().newCell(col, DynamicCellType.STRING);
	statusCell.setValue(note.getCurrentStatus().getStatus().getText());
	
	StringBuffer sb = new StringBuffer();
	sb.append("Status set by : ");
	sb.append(note.getCurrentStatus().getMOSIsNotNull() ? note.getCurrentStatus().getMOS().getName() : "");
	sb.append(" on ");
	sb.append(note.getCurrentStatus().getDateTimeIsNotNull() ? note.getCurrentStatus().getDateTime().toString() : "");
	statusCell.setTooltip(sb.toString());
}
 
Example 7
Project: AvoinApotti   File: OrderEntryTemplatePopulation.java   Source Code and License 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 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public boolean isPocSelected(AssessmentQuestionRefVo voAssessmQuestion)
{
	for (int i = 0; i < grid.getRows().size(); i++)
	{
		DynamicGridRow row = grid.getRows().get(i);

		if (row.getIdentifier() instanceof AssessmentQuestionVo && row.getIdentifier().equals(voAssessmQuestion))
		{
			DynamicGridColumn column = this.grid.getColumns().getByIdentifier(POC_COLUMN);
			if (column != null)
			{
				DynamicGridCell cell = row.getCells().get(column);
				if (cell.getValue() instanceof Boolean)
					return ((Boolean) cell.getValue()).booleanValue();
			}
		}
	}

	return false;
}
 
Example 9
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private void createStaticColumns(boolean flatView, Integer questionColumnWidth, boolean isComplete) 
{
	if(flatView && this.questionImage != null && this.mandatoryQuestionImage != null)
		createImageColumnWhenFlat();
	
	DynamicGridColumn questionColumn = this.grid.getColumns().newColumn(flatView ? "Question" : "Group / Question", QUESTION_COLUMN);
	questionColumn.setCanGrow(false);
	questionColumn.setWidth(questionColumnWidth == null ? (isDPP ? DEFAULT_QUESTION_COLUMN_WIDTH - 240 : DEFAULT_QUESTION_COLUMN_WIDTH) : questionColumnWidth.intValue());	
			
	if(!isComplete)
	{
		DynamicGridColumn buttonColumn = this.grid.getColumns().newColumn("", BUTTON_COLUMN);
		buttonColumn.setAlignment(Alignment.CENTER);
		buttonColumn.setCanGrow(false);
		buttonColumn.setWidth(0);			
	}
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void initDynGrid()
{
	DynamicGridColumn newColumn = form.dyngrdTTA().getColumns().newColumn("TTA Record/MedicationName", NAME_IDENTIFIER);
	newColumn.setCanGrow(true);
	newColumn.setWidth(NAME_WIDTH);
	newColumn = form.dyngrdTTA().getColumns().newColumn("Form", FORM_IDENTIFIER);
	newColumn.setWidth(FORM_WIDTH);
	newColumn = form.dyngrdTTA().getColumns().newColumn("Route", ROUTE_IDENTIFIER);
	newColumn.setWidth(ROUTE_WIDTH);
	newColumn = form.dyngrdTTA().getColumns().newColumn("Dose", DOSE_IDENTIFIER);
	newColumn.setWidth(DOSE_WIDTH);
	newColumn = form.dyngrdTTA().getColumns().newColumn("Frequency", FREQUENCY_IDENTIFIER);
	newColumn.setWidth(FREQUENCY_WIDTH);
	newColumn = form.dyngrdTTA().getColumns().newColumn("Select", SELECT_IDENTIFIER);
	newColumn.setWidth(SELECT_WIDTH);
	newColumn.setDynamicWidthSupported(true);
}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setDefaultTimeValue(DynamicGridCell cell)
{
	DynamicGridRow parentRow = cell.getRow().getParent();
	//Get Previous row time and set it to the current row
	for (int i = 0; parentRow != null && i < parentRow.getRows().size(); i++)
	{
		if(i > 0 && parentRow.getRows().get(i).getValue().equals(cell.getRow().getValue()))
		{
			DynamicGridColumn column = getColumn(TIME_COL);
			if(column != null)
			{
				DynamicGridCell timCell = parentRow.getRows().get(i-1).getCells().get(column);
				if(timCell != null)
				{
					Object previousTime = timCell.getValue();
					if(previousTime instanceof Time)
						cell.setValue(previousTime); 
				}
			}
			
			break;
		}
	}
}
 
Example 12
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
public boolean isPocSelected(AssessmentQuestionRefVo voAssessmQuestion)
{
	for (int i = 0; i < grid.getRows().size(); i++)
	{
		DynamicGridRow row = grid.getRows().get(i);
		
		if(row.getIdentifier() instanceof AssessmentQuestionVo && row.getIdentifier().equals(voAssessmQuestion))
		{
			DynamicGridColumn column = this.grid.getColumns().getByIdentifier(POC_COLUMN);
			if(column != null)
			{
				DynamicGridCell cell = row.getCells().get(column);
				if(cell.getValue() instanceof Boolean)
					return ((Boolean)cell.getValue()).booleanValue();
			}
		}
	}
	
	return false;
}
 
Example 13
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private DynamicGridCell addAnswerCell(DynamicGridRow row, DynamicGridColumn column, QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer, boolean readOnly)  throws PresentationLogicException
{
	checkDataIntegrity(configAnswer);

	DynamicCellType cellAnswerType = getCellAnswerType(configAnswer.getAnswerType());
	DynamicGridCell cell = row.getCells().newCell(column, cellAnswerType);
	
	cell.setWidth(getCellAnswerWidth(configAnswer, instAnswer));
	cell.setDecoratorType(DynamicCellDecoratorMode.ALWAYS);
	cell.setIdentifier(configAnswer);
	cell.setReadOnly(readOnly);
	setAnswerCellValue(cell, configAnswer, instAnswer);
	setCellAnswer(cell, instAnswer);
	
	if (instAnswer == null)
	{
		setCellTooltip(cell, configAnswer);
	}
	else //WDEV-16927
	{
		setCellAnswerTooltip(cell, instAnswer);
	}
	
	return cell;
}
 
Example 14
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addAnaesthetisRow(LocalAnaestheticAdministeredVo localAnaestheticAdministeredVo)
{
	DynamicGridRow newRow = form.lyr1().tabDetails().ctn1().dyngrdAnaesthetis().getRows().newRow();
	newRow.setValue(localAnaestheticAdministeredVo);

	DynamicGridColumn column = null;
	DynamicGridCell cell = null;

	column = form.lyr1().tabDetails().ctn1().dyngrdAnaesthetis().getColumns().getByIdentifier(COL_DRUG);
	cell = newRow.getCells().newCell(column, DynamicCellType.ENUMERATION);

	populateLocalAnaesthetic(ims.clinical.vo.lookups.LookupHelper.getLocalAnaesthetic(domain.getLookupService()), cell);
	cell.setValue(localAnaestheticAdministeredVo != null ? localAnaestheticAdministeredVo.getLocalAnaesthetic() : null);
	cell.setAutoPostBack(true);
	updateCell(cell);

	column = form.lyr1().tabDetails().ctn1().dyngrdAnaesthetis().getColumns().getByIdentifier(COL_MLS);
	cell = newRow.getCells().newCell(column, DynamicCellType.DECIMAL);
	cell.setValue(localAnaestheticAdministeredVo != null ? localAnaestheticAdministeredVo.getMls() : null);
	form.lyr1().tabDetails().ctn1().dyngrdAnaesthetis().setSelectedRow(null);
}
 
Example 15
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void createStaticColumns(boolean flatView, Integer questionColumnWidth, boolean isComplete)
{
	if (flatView && this.questionImage != null && this.mandatoryQuestionImage != null)
		createImageColumnWhenFlat();

	DynamicGridColumn questionColumn = this.grid.getColumns().newColumn(flatView ? "Question" : "Group / Question", QUESTION_COLUMN);
	questionColumn.setCanGrow(false);
	questionColumn.setWidth(questionColumnWidth == null ? (isDPP ? DEFAULT_QUESTION_COLUMN_WIDTH - 50 : DEFAULT_QUESTION_COLUMN_WIDTH) : questionColumnWidth.intValue());

	if (!isComplete)
	{
		DynamicGridColumn buttonColumn = this.grid.getColumns().newColumn("", BUTTON_COLUMN);
		buttonColumn.setAlignment(Alignment.CENTER);
		buttonColumn.setCanGrow(false);
		buttonColumn.setWidth(0);
	}
}
 
Example 16
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private DynamicGridCell addAnswerCell(DynamicGridRow row, DynamicGridColumn column, Question_AnswerTypeVo configAnswer, Answer_DetailsVo instAnswer, boolean readOnly) throws PresentationLogicException 
{
	checkDataIntegrity(configAnswer);

	DynamicCellType cellAnswerType = getCellAnswerType(configAnswer.getAnswerType());
	DynamicGridCell cell = row.getCells().newCell(column, cellAnswerType);
	
	cell.setWidth(getCellAnswerWidth(configAnswer, instAnswer));
	cell.setDecoratorType(DynamicCellDecoratorMode.ALWAYS);
	cell.setIdentifier(configAnswer);
	cell.setReadOnly(readOnly);
	setAnswerCellValue(cell, configAnswer, instAnswer);				
	setCellTooltip(cell, configAnswer);
	if(isDPP && cellAnswerType != null && cellAnswerType.equals(DynamicCellType.MULTISELECT))
	{
		cell.setAutoPostBack(true);
	}
	
	return cell;
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License 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 18
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void initGridComments()
{
	form.dyngrdComments().clear();
	DynamicGridColumnCollection columns = form.dyngrdComments().getColumns();
	DynamicGridColumn newColumn = columns.newColumn("Authoring Date/Time", COLUMN_ADTE, true);
	newColumn.setWidth(COLUMN_ADTEWIDTH);

	newColumn = columns.newColumn("Authoring HCP", COLUMN_AHCP, true);
	newColumn.setWidth(COLUMN_AHCPWIDTH);

	newColumn = columns.newColumn("Comments", COLUMN_COMMENTS, true);
	newColumn.setWidth(COLUMN_COMMENTSWIDTH);
	newColumn.setCanGrow(true);

	form.dyngrdComments().setSelectable(true);
}
 
Example 19
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private DynamicGridCell addAnswerCell(DynamicGridRow row, DynamicGridColumn column, QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer, boolean readOnly) throws PresentationLogicException 
{
	checkDataIntegrity(configAnswer);

	DynamicCellType cellAnswerType = getCellAnswerType(configAnswer.getAnswerType());
	DynamicGridCell cell = row.getCells().newCell(column, cellAnswerType);
	
	cell.setWidth(getCellAnswerWidth(configAnswer, instAnswer));
	cell.setDecoratorType(DynamicCellDecoratorMode.ALWAYS);
	cell.setIdentifier(configAnswer);
	cell.setReadOnly(readOnly);
	setAnswerCellValue(cell, configAnswer, instAnswer);				
	setCellTooltip(cell, configAnswer);
	if(isDPP && cellAnswerType != null && cellAnswerType.equals(DynamicCellType.MULTISELECT))
	{
		cell.setAutoPostBack(true);
	}
	
	return cell;
}
 
Example 20
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setColAuthoringDetails(ClinicalNotesShortVoCollection voCollNotes, int i, DynamicGridRow row)
{
	DynamicGridColumn col = getCol("Authoring Details");
	
	if(col == null)
		throw new DomainRuntimeException("No column for Identifier");

	DynamicGridCell dateCell = row.getCells().newCell(col, DynamicCellType.WRAPTEXT);
	StringBuffer value = new StringBuffer();
	
	if(voCollNotes.get(i).getAuthoringInfo().getAuthoringHcpIsNotNull())
		value.append("HCP: " + voCollNotes.get(i).getAuthoringInfo().getAuthoringHcp().toString());
	
	if(voCollNotes.get(i).getAuthoringInfo().getAuthoringDateTimeIsNotNull())
	{
		if(value.length() > 0)
			value.append("\n");
		value.append("Date:" + voCollNotes.get(i).getAuthoringInfo().getAuthoringDateTime().toString());
	}
	
	dateCell.setValue(value.toString());
}
 
Example 21
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addLineSeparator()
{
	DynamicGridRow messageRow = form.lyrRules().tabActions().dyngrdActions().getSelectedRow();
	if (messageRow != null)
	{
		DynamicGridRow lineSeparatorInstanceRow = messageRow.getRows().newRow();
		DynamicGridColumn lineSeparatorInstanceColl = getColByIndexForActionGrid(0);
		if (lineSeparatorInstanceColl == null)
		{
			lineSeparatorInstanceColl = createColumnForActionGrid("", 0);
		}
		DynamicGridCell lineSeparatorInstanceCell = lineSeparatorInstanceRow.getCells().newCell(lineSeparatorInstanceColl, DynamicCellType.HTMLVIEW);
		lineSeparatorInstanceCell.setAutoPostBack(true);
		lineSeparatorInstanceCell.setWidth(250);
		lineSeparatorInstanceCell.setValue("--- Line Separator ---");
		lineSeparatorInstanceRow.setIdentifier(NOTIFICATION_LINE_SEPARATOR_INSTANCE);
	}
}
 
Example 22
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private DynamicGridRow getIdentifierRow(DynamicGridRow row, DynamicGridColumn column, PatientId identifier) 
{
	if(row == null)
		return null;
	
	for(int i=0; i<row.getRows().size(); i++)
	{
		if(row.getRows().get(i).getValue().equals(identifier.getType()) && (row.getRows().get(i).getCells().get(column) == null || (row.getRows().get(i).getCells().get(column) != null && row.getRows().get(i).getCells().get(column).getValue() == null)))
		{
			return row.getRows().get(i);
		}
	}
	
	DynamicGridRow childRow = row.getRows().newRow();
	
	DynamicGridCell cell = childRow.getCells().newCell(getColumn(COL_FIELD_NAME), DynamicCellType.STRING);
	cell.setValue("<b>" + identifier.getType().getText() + "</b>");
	cell.setReadOnly(true);
	
	childRow.setValue(identifier.getType());
	return childRow;
}
 
Example 23
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void initialiseDetailsGrid()
{
	DynamicGridColumn col1 = form.dyngrdDetails().getColumns().newColumn("Movement", MOVEMENT_COLUMN);
	col1.setWidth(250);

	DynamicGridColumn col2 = form.dyngrdDetails().getColumns().newColumn("Equipment", EQUIPMENT_COLUMN);
	col2.setWidth(150);

	DynamicGridColumn col3 = form.dyngrdDetails().getColumns().newColumn("Other Equipment", OTHEREQUIPMENT_COLUMN);
	col3.setWidth(100);

	DynamicGridColumn col4 = form.dyngrdDetails().getColumns().newColumn("No. of Staff", NOOFSTAFF_COLUMN);
	col4.setWidth(160);
	
	DynamicGridColumn col5 = form.dyngrdDetails().getColumns().newColumn("Details", DETAILS_COLUMN);
	col5.setWidth(150);
	
	form.dyngrdDetails().setReadOnly(true);
	
}
 
Example 24
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void initializeDynamicGrid()
{		
	form.lyrContract().tabContractChargeItems().dyngrdContractCharge().clear();
	form.lyrContract().tabContractChargeItems().dyngrdContractCharge().setSelectable(true);		
	
	DynamicGridColumn colCheck = form.lyrContract().tabContractChargeItems().dyngrdContractCharge().getColumns().newColumn(" ", COL_CHECK);
	colCheck.setWidth(60);
	
	DynamicGridColumn colName = form.lyrContract().tabContractChargeItems().dyngrdContractCharge().getColumns().newColumn("Name", COL_NAME);
	colName.setWidth(300);	

	DynamicGridColumn colCategory = form.lyrContract().tabContractChargeItems().dyngrdContractCharge().getColumns().newColumn("Cost Price", COL_COST);
	colCategory.setWidth(80);	

	DynamicGridColumn colType = form.lyrContract().tabContractChargeItems().dyngrdContractCharge().getColumns().newColumn("Base Price", COL_BASE);
	colType.setWidth(80);	
	
	DynamicGridColumn colUser = form.lyrContract().tabContractChargeItems().dyngrdContractCharge().getColumns().newColumn("MarkUp Price", COL_MARKUP);
	colUser.setWidth(80);	
}
 
Example 25
Project: AvoinApotti   File: ResultDisplayHelper.java   Source Code and License 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 26
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setColNeedReviewed(DynamicGridRow row, ClinicalNotesShortVoCollection voCollNotes, int i)
{
	DynamicGridColumn col = getCol("ICON");
	
	if(col == null)
		throw new DomainRuntimeException("No column for ICON");

	DynamicGridCell iconCell = row.getCells().newCell(col, DynamicCellType.IMAGE);

	StringBuffer value = new StringBuffer();

	if (voCollNotes.get(i).getForReviewDisciplineIsNotNull() &&
			voCollNotes.get(i).getSourceOfNoteIsNotNull())
	{
			value.append("Review Discipline: " + voCollNotes.get(i).getForReviewDiscipline().toString().toUpperCase());
	}
	
	iconCell.setTooltip(value.toString());
	iconCell.setValue(form.getImages().Admin.ClinicalTeam);
}
 
Example 27
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addQuestionLegend(Assessment_QuestionVo question, DynamicGridRow groupRow)
{
	DynamicGridColumn questionColumn = this.grid.getColumns().getByIdentifier(QUESTION_COLUMN);
	DynamicGridRow row;

	if (groupRow != null)
		row = groupRow.getRows().newRow();
	else
		row = this.grid.getRows().newRow();

	row.setSelectable(false);

	questionColumn.setDynamicWidthSupported(true);

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

}
 
Example 28
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setDefaultTimeValue(DynamicGridCell cell)
{
	DynamicGridRow parentRow = cell.getRow().getParent();
	//Get Previous row time and set it to the current row
	for (int i = 0; parentRow != null && i < parentRow.getRows().size(); i++)
	{
		if(i > 0 && parentRow.getRows().get(i).getValue().equals(cell.getRow().getValue()))
		{
			DynamicGridColumn column = getColumn(TIME_COL);
			if(column != null)
			{
				DynamicGridCell timCell = parentRow.getRows().get(i-1).getCells().get(column);
				if(timCell != null)
				{
					Object previousTime = timCell.getValue();
					if(previousTime instanceof Time)
						cell.setValue(previousTime);
				}
			}
			
			break;
		}
	}
	if (cell.getValue() == null)
		cell.setValue(new Time()); 

}
 
Example 29
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void createSeedColumns()
{
	form.dyngrdParameters().clear();
	DynamicGridColumn nameCol = form.dyngrdParameters().getColumns().newColumn("Name", NAME_COLUMN);
	nameCol.setWidth(250);
	nameCol.setBackColor(Color.Gray);
	nameCol.setReadOnly(true);

	DynamicGridColumn seedCol = form.dyngrdParameters().getColumns().newColumn("Value", VALUE_COLUMN);
	seedCol.setWidth(205);
	
	DynamicGridColumn mandatoryCol = form.dyngrdParameters().getColumns().newColumn("", MANDATORY_COLUMN);
	mandatoryCol.setWidth(-1);
	mandatoryCol.setAlignment(Alignment.CENTER);
}
 
Example 30
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initializeDynamicGrid()
{
	form.dyngrdPrescription().clear();
	form.dyngrdPrescription().setSelectable(true);	
	
	DynamicGridColumn column;
	column = form.dyngrdPrescription().getColumns().newColumn("", COL_DATE);
	column.setWidth(200);		
	column.setCanGrow(false);
	column.setReadOnly(true);
		
	column = form.dyngrdPrescription().getColumns().newColumn("", COL_USER);
	column.setWidth(200);
	column.setCanGrow(true);
			
	column = form.dyngrdPrescription().getColumns().newColumn("", COL_DRUG);
	column.setWidth(200);		
	column.setCanGrow(false);
	
	column = form.dyngrdPrescription().getColumns().newColumn("", COL_FREQUENCY);
	column.setWidth(100);
	column.setCanGrow(true);
	
	column = form.dyngrdPrescription().getColumns().newColumn("", COL_DAYS_SUPPLY);
	column.setWidth(60);
	column.setCanGrow(true);
}
 
Example 31
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * Function used to retrieve a column with given identifier from prognostic dyanmic grid
 */
private DynamicGridColumn getPrognosticColumnByIdentifier(Object identifer)
{
	if (identifer == null)
		return null;
	
	return form.lyrMain().tabTumourDetails().lyrPrognosticTNM().tabPrognosticTab().dyngrdPrognosticPreTreatment().getColumns().getByIdentifier(identifer);
}
 
Example 32
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * 
 */
private void initializeDynamicGrid()
{
	// Allow un-selection
	form.dyngrdRules().setUnselectable(true);

	// Set up the columns
	DynamicGridColumn column;

	column = form.dyngrdRules().getColumns().newColumn("", COL_IMAGE);
	column.setWidth(20);
	column.setAlignment(Alignment.RIGHT);
	column.setCanGrow(false);

	column = form.dyngrdRules().getColumns().newColumn("Name", COL_RULE_NAME);
	column.setWidth(300);
	column.setAlignment(Alignment.LEFT);
	column.setCanGrow(true);

	column = form.dyngrdRules().getColumns().newColumn("Category", COL_RULE_CATEGORY);
	column.setWidth(200);
	column.setCanGrow(true);

	column = form.dyngrdRules().getColumns().newColumn("Entity", COL_RULE_BUSINESS_OBJECT);
	column.setWidth(200);
	column.setCanGrow(true);

	column = form.dyngrdRules().getColumns().newColumn("Status", COL_RULE_STATUS);
	column.setWidth(60);
	column.setCanGrow(false);
}
 
Example 33
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initializeFlagsGrid()
{
	form.dyngrdFlags().clear();

	DynamicGridColumn col = form.dyngrdFlags().getColumns().newColumn("Group", COL_GROUP);
	col.setWidth(85);
	col.setCanGrow(Boolean.TRUE);
	col.setReadOnly(Boolean.TRUE);
	col.setSortMode(SortMode.AUTOMATIC);

	col = form.dyngrdFlags().getColumns().newColumn("Configuration Flag", COL_FLAG);
	col.setWidth(300);
	col.setCanGrow(Boolean.TRUE);
	col.setReadOnly(Boolean.TRUE);
	col.setSortMode(SortMode.AUTOMATIC);

	col = form.dyngrdFlags().getColumns().newColumn("Default Value",COL_DEFAULT);
	col.setWidth(175);
	col.setCanGrow(Boolean.TRUE);
	col.setReadOnly(Boolean.TRUE);

	col = form.dyngrdFlags().getColumns().newColumn("Current Value",COL_CURRENT);
	col.setWidth(200);
	col.setCanGrow(Boolean.TRUE);
	col.setReadOnly(Boolean.TRUE);

	col = form.dyngrdFlags().getColumns().newColumn("Last Updated Date/Time",COL_UPD_DATE);
	col.setWidth(-1);
	col.setCanGrow(Boolean.TRUE);
	col.setReadOnly(Boolean.TRUE);
	col.setSortMode(SortMode.MANUAL);
}
 
Example 34
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initializeDynamicGrid()
{
	form.dyngrdReasons().clear();
	form.dyngrdReasons().setSelectable(true);
	
	DynamicGridColumn reasonColumn = null;
	reasonColumn = form.dyngrdReasons().getColumns().newColumn(" ", false);				
	reasonColumn.setIdentifier("REASON");
	reasonColumn.setWidth(-1);
	reasonColumn.setSortMode(SortMode.AUTOMATIC);
}
 
Example 35
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
public void notifyFormModeChange(FormMode formMode)
{
	DynamicGridColumn buttonColumn = this.grid.getColumns().getByIdentifier(BUTTON_COLUMN);
	if(buttonColumn != null)
	{
		buttonColumn.setWidth(formMode == FormMode.EDIT ? DEFAULT_BUTTON_CELL_WIDTH : 0);
	}			
}
 
Example 36
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void newConsultantAssociationRow(DynamicGridRow parrentRow, MedicLiteVo medic)
{
	if (parrentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add consultant association row to a null parrent row");
	
	if (medic == null)
		return;

	
	DynamicGridCell newCell;
	DynamicGridColumn column;
	
	// Create a new row
	DynamicGridRow newRow = parrentRow.getRows().newRow();
	newRow.setValue(medic);
	
	// Create the fist cell in the row (IMAGE)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_IMAGE);
	newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
	newCell.setValue(form.getImages().Core.User);
	
	// Create the second cell in the row (STRING)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
	newCell.setValue(medic.getName().toString());
	newCell.setReadOnly(true);
}
 
Example 37
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DynamicGridColumn getColumn(String columnIdentifier)
{
	if (columnIdentifier == null)
		return null;

	return form.dyngrdParameters().getColumns().getByIdentifier(columnIdentifier);
}
 
Example 38
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initializeDynamicGrdMotor()
{
	form.dyngrdMotor().clear();
	DynamicGridColumn colMotor = form.dyngrdMotor().getColumns().newColumn("Area/Movements", MOTOR_COLUMN, true);
	colMotor.setWidth(600);

	DynamicGridColumn colRight = form.dyngrdMotor().getColumns().newColumn("Right", RIGHT_COLUMN, false);
	colRight.setWidth(100);
	
	DynamicGridColumn colLeft = form.dyngrdMotor().getColumns().newColumn("Left", LEFT_COLUMN, false);
	colLeft.setWidth(-1);
}
 
Example 39
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setColCorrect(DynamicGridRow row)
{
	DynamicGridColumn col = getCol("CORRECT");
	if (col == null)
		throw new DomainRuntimeException("No column for CORRECT");

	DynamicGridCell correctCell = row.getCells().newCell(col, DynamicCellType.IMAGE);
	correctCell.setValue(form.getImages().Core.CareSpell);
}
 
Example 40
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initDynAssessmentGrid()
{
	form.dyngrdAssessments().clear();
	
	DynamicGridColumn column_parent = form.dyngrdAssessments().getColumns().getByIdentifier(HEADER_COLUMN);
	if(column_parent == null)
		column_parent = form.dyngrdAssessments().getColumns().newColumn("Patient Assessment", HEADER_COLUMN);
	column_parent.setWidth(HEADER_COLUMN_WIDTH);
	column_parent.setCanGrow(true);
			
	DynamicGridColumn column_status = form.dyngrdAssessments().getColumns().getByIdentifier(STATUS_COLUMN);
	if(column_status == null)
		column_status = form.dyngrdAssessments().getColumns().newColumn("Status", STATUS_COLUMN);
	column_status.setWidth(STATUS_COLUMN_WIDTH);
	column_status.setCanGrow(false);
					
	DynamicGridColumn column_reason = form.dyngrdAssessments().getColumns().getByIdentifier(REASON_COLUMN);
	if(column_reason == null)
		column_reason = form.dyngrdAssessments().getColumns().newColumn("Reason", REASON_COLUMN);
	column_reason.setWidth(REASON_COLUMN_WIDTH);
	column_reason.setCanGrow(false);
			
	DynamicGridColumn column_url_help = form.dyngrdAssessments().getColumns().getByIdentifier(HELP_URL_COLUMN);
	if(column_url_help == null)
		column_url_help = form.dyngrdAssessments().getColumns().newColumn("URL", HELP_URL_COLUMN);
	column_url_help.setWidth(HELP_URL_COLUMN_WIDTH);
	column_url_help.setCanGrow(false);
	column_url_help.setHeaderAlignment(Alignment.CENTER);
	column_url_help.setAlignment(Alignment.CENTER);
	
	DynamicGridColumn column_authoring = form.dyngrdAssessments().getColumns().getByIdentifier(AUTHORING_COLUMN);
	if(column_authoring == null)
		column_authoring = form.dyngrdAssessments().getColumns().newColumn("Authoring Information", AUTHORING_COLUMN);
	column_authoring.setWidth(AUTHORING_COLUMN_WIDTH);
	column_authoring.setCanGrow(false);
}
 
Example 41
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
public PatientAssessmentVo updateQuestionStatusToAnswered(PatientAssessmentVo voPatientAssessment, AnswerStatus status)
{
	for(int x = 0; x < this.grid.getRows().size(); x++)
	{
		DynamicGridRow row = this.grid.getRows().get(x);
	
		AssessmentQuestionVo question = (AssessmentQuestionVo)row.getIdentifier();
		PatientAssessmentQuestionVo answer = findAnswer(voPatientAssessment.getAssessmentData().getAnswerGroups(), question);
		if(answer == null)
			throw new CodingRuntimeException("Unable to find an answer for '" + question.getQuestion().getText() + "' question.");
		if(status == null)
			throw new CodingRuntimeException("No status provided for '" + question.getQuestion().getText() + "' question.");
		//Change the status from Non Applicable to Answered
		if(isAnswerStatus(answer, status))
		{
			DynamicGridColumn columnNASelect = this.grid.getColumns().getByIdentifier(SELECT_NA_COLUMN);
			if(columnNASelect != null)
			{
				DynamicGridCell cellNASelect = row.getCells().get(columnNASelect);
				if(cellNASelect.getValue() instanceof Boolean && ((Boolean)cellNASelect.getValue()).booleanValue())
					answer.setIsAnswered(AnswerStatus.ANSWERED);
			}
		}
	}
	
	return voPatientAssessment;
}
 
Example 42
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialiseMergeGrid() 
{
	form.dyngrdMerge().clear();
	
	DynamicGridColumn column = form.dyngrdMerge().getColumns().newColumn("Field Name", COL_FIELD_NAME);
	column.setWidth(200);
	column.setCanGrow(true);

	column = form.dyngrdMerge().getColumns().newColumn("Source Patient", COL_SOURCE_PATIENT);
	column.setWidth(190);
	column.setCanGrow(true);
	
	column = form.dyngrdMerge().getColumns().newColumn("Destination Patient", COL_DESTINATION_PATIENT);
	column.setWidth(190);
	column.setCanGrow(true);
	
	column = form.dyngrdMerge().getColumns().newColumn("", COL_SOURCE_BUTTONS);
	column.setWidth(30);
	column.setCanGrow(false);
	
	column = form.dyngrdMerge().getColumns().newColumn("", COL_DESTINATION_BUTTONS);
	column.setWidth(30);
	column.setCanGrow(false);
	
	column = form.dyngrdMerge().getColumns().newColumn("", COL_WAS_MODIFIED);
	column.setWidth(0);
	column.setCanGrow(false);
	
	column = form.dyngrdMerge().getColumns().newColumn("Result Data", COL_RESULT_DATA);
	column.setWidth(-1);
	column.setCanGrow(true);
}
 
Example 43
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DynamicGridCell addAnswerCell(DynamicGridRow row, DynamicGridColumn column, Question_AnswerTypeVo configAnswer, Answer_DetailsVo instAnswer, boolean readOnly, boolean readOnlyBecauseUserHasNoRoles) throws PresentationLogicException
{
	checkDataIntegrity(configAnswer);

	DynamicGridCell cell = row.getCells().newCell(column, getCellAnswerType(configAnswer.getAnswerType()));

	cell.setWidth(getCellAnswerWidth(configAnswer, instAnswer));
	cell.setDecoratorType(DynamicCellDecoratorMode.ALWAYS);
	cell.setIdentifier(configAnswer);
	cell.setReadOnly(readOnly);
	setAnswerCellValue(cell, configAnswer, instAnswer);
	setCellTooltip(cell, configAnswer, readOnlyBecauseUserHasNoRoles);//wdev-3709

	return cell;
}
 
Example 44
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DynamicGridColumn getColumn(String columnIdentifier)
{
	if (columnIdentifier == null)
		return null;

	return form.ctnParams().dyngrdParams().getColumns().getByIdentifier(columnIdentifier);
}
 
Example 45
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
public OverallStagingComapartor(DynamicGridColumn column, SortOrder order)
{
	if (column != null && column.getIdentifier() == null)
		throw new CodingRuntimeException("Logical error - All columns in the grid must have an identifier. Check grid initialization");

  		this.column = column != null ? (Integer) column.getIdentifier() : null;
  		
  		this.direction = SortOrder.DESCENDING.equals(order) ? -1 : 1;
}
 
Example 46
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void newSpecialtyCorrespondenceGridRow(DynamicGridRow parentRow, SpecialtyAccessVo specialtyAccess)
{
	if (parentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add specialty access row to a null row");
	
	if (specialtyAccess == null)
		return;
	
	
	DynamicGridCell newCell;
	DynamicGridColumn column;

	// Create a new row
	DynamicGridRow newRow = parentRow.getRows().newRow();
	newRow.setValue(specialtyAccess);
	
	// Create the first cell in the row
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_IMAGE);
	newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
	newCell.setValue(form.getImages().Admin.Specialty2);

	// Create the second cell in the row
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESS_CATEGORY);
	newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
	newCell.setValue(specialtyAccess.getSpecialty().getText());
	newCell.setReadOnly(true);
	
	// Create the third cell in the row
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESSRIGHTS);
	newCell = newRow.getCells().newCell(column, DynamicCellType.ANSWER);
	engine.populate(newCell, Access.getNegativeInstancesAsIItemCollection());
	newCell.setValue(specialtyAccess.getAccessRight());
}
 
Example 47
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void createDynamicGridColumns()
{
	DynamicGridColumn columnName = form.dyngrdReports().getColumns().newColumn("Name", COLUMN_NAME);
	columnName.setWidth(-1);

	//DynamicGridColumn columnDescription = form.dyngrdReports().getColumns().newColumn("Description", COLUMN_DESCRIPTION);
	//columnDescription.setWidth(-1);
}
 
Example 48
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void newConsultantCorrespondece(DynamicGridRow parrentRow)
{
	if (parrentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add a CONSULTANT correspondence to a null parrent row");

	if (!(parrentRow.getValue() instanceof AccessCategory) || (((AccessCategory) parrentRow.getValue()) != AccessCategory.CONSULTANTS))
		throw new CodingRuntimeException("Logical Error - Function must be called from CONSULTANTS category row only");
	
	parrentRow.setExpanded(true);
	
	// Create a new row
	DynamicGridRow newRow = parrentRow.getRows().newRow(true);
	newRow.setValue(new ConsultantAccessVo());
	form.dyngrdDetails().resetScrollPosition();
	
	// Declare a new cell
	DynamicGridCell newCell;
	// Column identifier
	DynamicGridColumn column;
	
	
	// Create the first cell
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_IMAGE);
	newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
	newCell.setValue(form.getImages().Core.User);

	// Create the second cell
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESS_CATEGORY);
	newCell = newRow.getCells().newCell(column, DynamicCellType.QUERYCOMBOBOX);
	newCell.setAutoPostBack(true);
	
	// Create the third cell
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESSRIGHTS);
	newCell = newRow.getCells().newCell(column, DynamicCellType.ANSWER);
	engine.populate(newCell, Access.getNegativeInstancesAsIItemCollection());
	newCell.setAutoPostBack(true);
}
 
Example 49
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void newSpecialtyCorrespondece(DynamicGridRow parrentRow)
{
	if (parrentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add a SPECIALTY correspondence to a null parrent row");

	if (!(parrentRow.getValue() instanceof AccessCategory) || (((AccessCategory) parrentRow.getValue()) != AccessCategory.SPECIALTY))
		throw new CodingRuntimeException("Logical Error - Function must be called from SPECIALTY category row only");
	
	parrentRow.setExpanded(true);
	
	// Create a new row
	DynamicGridRow newRow = parrentRow.getRows().newRow(true);
	newRow.setValue(new SpecialtyAccessVo());
	form.dyngrdDetails().resetScrollPosition();
	
	// Declare a new cell
	DynamicGridCell newCell;
	// Column identifier
	DynamicGridColumn column;
	
	
	// Create the first cell
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_IMAGE);
	newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
	newCell.setValue(form.getImages().Admin.Specialty2);

	// Create the second cell
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESS_CATEGORY);
	newCell = newRow.getCells().newCell(column, DynamicCellType.QUERYCOMBOBOX);
	newCell.setAutoPostBack(true);
	
	// Create the third cell
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESSRIGHTS);
	newCell = newRow.getCells().newCell(column, DynamicCellType.ANSWER);
	engine.populate(newCell, Access.getNegativeInstancesAsIItemCollection());
	newCell.setAutoPostBack(true);
}
 
Example 50
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
public OverallStagingComapartor(DynamicGridColumn column, SortOrder order)
{
	if (column != null && column.getIdentifier() == null)
		throw new CodingRuntimeException("Logical error - All columns in the grid must have an identifier. Check grid initialization");

  		this.column = column != null ? (Integer) column.getIdentifier() : null;
  		
  		this.direction = SortOrder.DESCENDING.equals(order) ? -1 : 1;
}
 
Example 51
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void applyDefaultsToPhlebGrid(SpecimenCollectionSettings settings)
{
	if (settings == null)
		throw new CodingRuntimeException("settings parameter in applyToPhlebGrid method is null");

	// go through phleb grid setting defaults according to settings
	DynamicGrid dynGridPhleb = settings.getSpecimenCollectionMethod().equals(SpecimenCollectionMethod.INPATIENT) ? form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dyngrdInpat() : form.lyrDetails().tabPathDetails().lyrPathology().tabPhlebotomy().dyngrdOutPat();

	for (int i = 0; i < dynGridPhleb.getRows().size(); i++)
	{
		if (settings.getSpecimenCollectionMethod().equals(SpecimenCollectionMethod.INPATIENT))
		{
			DynamicGridColumn colDate = dynGridPhleb.getColumns().getByIdentifier(DYN_COLDATE);
			DynamicGridColumn colTime = dynGridPhleb.getColumns().getByIdentifier(DYN_COLTIME);

			for (int p = 0; p < dynGridPhleb.getRows().get(i).getRows().size(); p++)
			{
				refreshGridDataForCollectionInfoInpatient(dynGridPhleb.getRows().get(i).getRows().get(p), colDate, colTime, settings);
				dynGridPhleb.getRows().get(i).getRows().get(p).getCells().get(dynGridPhleb.getColumns().getByIdentifier(QTY_COLUMN)).setWidth(80);
			}
		}
		else if (settings.getSpecimenCollectionMethod().equals(SpecimenCollectionMethod.OUTPATIENT))
		{
			DynamicGridColumn colAt = dynGridPhleb.getColumns().getByIdentifier(DYN_COLAT);
			DynamicGridColumn colDuration = dynGridPhleb.getColumns().getByIdentifier(DYN_COLDURATION);

			for (int p = 0; p < dynGridPhleb.getRows().get(i).getRows().size(); p++)
			{
				refreshGridDataForCollectionInfoOutpatient(dynGridPhleb.getRows().get(i).getRows().get(p), colAt, colDuration, settings);
				dynGridPhleb.getRows().get(i).getRows().get(p).getCells().get(dynGridPhleb.getColumns().getByIdentifier(QTY_COLUMN)).setWidth(80);
			}
		}
	}
}
 
Example 52
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private DynamicGridColumn createAnswerColumn(int answerIndex) 
{
	DynamicGridColumn column = this.grid.getColumns().newColumn("");
	column.setDynamicWidthSupported(isDPP?false:true);
	column.setIdentifier(new Integer(answerIndex));
	column.setWidth(isDPP?DEFAULT_MULTISELECT_ANSWER_CELL_WIDTH + 190 : 100);				
	return column;
}
 
Example 53
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addNonStandardColumn(DynamicGrid dynGrid)
{
	DynamicGridColumn newColumn = dynGrid.getColumns().newColumn("Is Non Standard", COLUMN_NONSTANDARD);
	newColumn.setWidth(-1);
	newColumn.setAlignment(Alignment.CENTER);
	newColumn.setHeaderAlignment(Alignment.CENTER);		
}
 
Example 54
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateGlossaryProfile(DynamicGridRow glossaryRow, DynamicGridRow profileRow, Image img) 
{
	if(glossaryRow == null || profileRow == null)
		return;
	
	GlossaryProfileVoCollection glossaryProfileList = domain.listGlossaryProfile((GlossaryVo) glossaryRow.getValue(), (ProfileType) profileRow.getValue());
	
	if(glossaryProfileList == null)
		return;
	
	profileRow.getRows().clear();
	
	for(int i = 0; i < glossaryProfileList.size(); i++)
	{
		ICspTypeSpecifier cellValue = domain.getMedicOrSpec((ProfileType) profileRow.getValue(), glossaryProfileList.get(i).getSpecifierID());
		
		if(cellValue != null)
		{
			DynamicGridRow childRow = profileRow.getRows().newRow();
			DynamicGridColumn column = null;
			DynamicGridCell cell = null;
			
			column = form.dyngrdGlossary().getColumns().getByIdentifier(COL_IMAGE);
			cell = childRow.getCells().newCell(column, DynamicCellType.IMAGE);
			cell.setValue(img);
			
			column = form.dyngrdGlossary().getColumns().getByIdentifier(COL_HEADING);
			cell = childRow.getCells().newCell(column, DynamicCellType.STRING);
			cell.setValue(cellValue.getIGenericItemInfoName());
			cell.setReadOnly(true);
			childRow.setValue(cellValue);
		}
	}
}
 
Example 55
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setDefaultTimeValue(DynamicGridCell cell)
{
	DynamicGridRow parentRow = cell.getRow().getParent();
	//Get Previous row time and set it to the current row
	for (int i = 0; parentRow != null && i < parentRow.getRows().size(); i++)
	{
		if(i > 0 && parentRow.getRows().get(i).getValue().equals(cell.getRow().getValue()))
		{
			DynamicGridColumn column = getColumn(TIME_COL);
			if(column != null)
			{
				DynamicGridCell timCell = parentRow.getRows().get(i-1).getCells().get(column);
				if(timCell != null)
				{
					Object previousTime = timCell.getValue();
					if(previousTime instanceof Time)
						cell.setValue(previousTime); 
				}
			}
			
			break;
		}
	}
	if (cell.getValue() == null)
		cell.setValue(new Time()); 

}
 
Example 56
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initDynGrid()
{
	form.dyngrdActions().clear();
	boolean isCcoSpecific = ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().equals("CCO");
	
	boolean onlyActive = form.cbFilter().getValue().equals("0");
	
	DynamicGridColumnCollection columns = form.dyngrdActions().getColumns();
	DynamicGridColumn newColumn = null;
	if (!isCcoSpecific)
	{
		newColumn = columns.newColumn("Selected", SELECTED_COLUMN_INDENTIFIER);
		newColumn.setWidth(SELECTED_COLUMN_WIDTH);
	}
	newColumn = columns.newColumn("Care Plan Actions", ACTION_COLUMN_INDENTIFIER);
	newColumn.setWidth(ACTION_COLUMN_WIDTHS[isCcoSpecific?(onlyActive?2:3):(onlyActive?0:1)]);
	newColumn = columns.newColumn("Start Date",STARTD_COLUMN_INDENTIFIER);
	newColumn.setWidth(STARTD_COLUMN_WIDTH);
	newColumn = columns.newColumn("By",STARTB_COLUMN_INDENTIFIER);
	newColumn.setWidth(STARTB_COLUMN_WIDTH[isCcoSpecific || !onlyActive?1:0]);
	
	if (!onlyActive)
	{
		newColumn = columns.newColumn("Stop Date",STOPD_COLUMN_INDENTIFIER);
		newColumn.setWidth(STOPD_COLUMN_WIDTH);
		
		newColumn = columns.newColumn("By",STOPB_COLUMN_INDENTIFIER);
		newColumn.setWidth(STOPB_COLUMN_WIDTH[isCcoSpecific?1:0]);
		
	}
	
	if (isCcoSpecific)
	{
		newColumn = columns.newColumn("Additional Info", NOTES_COLUMN_INDENTIFIER);
		newColumn.setWidth(NOTES_COLUMN_WIDTH);
	}
	
}
 
Example 57
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initializeDynamicGridColumns()
{
	DynamicGridColumn cabType = form.dyngrdClinInfo().getColumns().newColumn("Clinical Info", COLTYPE);
	cabType.setWidth(300);
	cabType.setReadOnly(true);

	DynamicGridColumn recAwait = form.dyngrdClinInfo().getColumns().newColumn("Awaiting", COLAWAIT);
	recAwait.setWidth(60);
	recAwait.setAlignment(Alignment.CENTER);

	DynamicGridColumn colRecieve = form.dyngrdClinInfo().getColumns().newColumn("Received", COLREC);
	colRecieve.setWidth(-1);
	colRecieve.setAlignment(Alignment.CENTER);
}
 
Example 58
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialiseHistoricDynamicGrid()
{
	form.dyngrdDisplay().clear();
	
	clearTabDeviceInstanceControls();
	clearTabVipInstanceControls();	
	
	form.ctnDetail().lyrDetails().showtabDevice();
	form.ctnDetail().lyrDetails().tabVIP().setHeaderVisible(false);
	form.ctnDetail().lyrDetails().tabDevice().setHeaderVisible(true);
		
	DynamicGridColumn colDevice = null;
	DynamicGridColumn colVip = null;
	DynamicGridColumn colSite = null;
	DynamicGridColumn colInsertedDate = null;
	DynamicGridColumn colInsertedBy	= null;
	DynamicGridColumn colRemovalDate	= null;
	DynamicGridColumn colRemovalBy	= null;
	
	colDevice = form.dyngrdDisplay().getColumns().newColumn("Device", COLDEVICE);
	colVip = form.dyngrdDisplay().getColumns().newColumn("VIP Score", COLVIP);
	colSite = form.dyngrdDisplay().getColumns().newColumn("Site", COLSITE);
	colInsertedDate = form.dyngrdDisplay().getColumns().newColumn("Inserted Date", COLINSERTEDDATE);
	colInsertedBy = form.dyngrdDisplay().getColumns().newColumn("Inserted By", COLINSERTEDBY);
	colRemovalDate = form.dyngrdDisplay().getColumns().newColumn("Removal Date", COLREMOVALDATE);
	colRemovalBy = form.dyngrdDisplay().getColumns().newColumn("Removal By", COLREMOVALBY);
	
	colDevice.setWidth(200);
	colVip.setWidth(100);
	colSite.setWidth(100);
	colInsertedDate.setWidth(120);
	colInsertedBy.setWidth(170);
	colRemovalDate.setWidth(120);
	colRemovalBy.setWidth(170);
	
	colDevice.setCanGrow(false);
}
 
Example 59
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void createDynamicGridColumns()
{
	DynamicGridColumn columnName = form.dyngrdReports().getColumns().newColumn("Name", COLUMN_NAME);
	columnName.setWidth(450);

	DynamicGridColumn columnDescription = form.dyngrdReports().getColumns().newColumn("Description", COLUMN_DESCRIPTION);
	columnDescription.setWidth(-1);
}
 
Example 60
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initializeConsultantDynamicGrid()
{
	form.lyr1().tabConsultant().dyngrdConsultant().getRows().clear();
	DynamicGridColumn actionsColumn = form.lyr1().tabConsultant().dyngrdConsultant().getColumns().newColumn("", true);
	actionsColumn.setIdentifier("ACTIONS_CONSULTANT");
	actionsColumn.setWidth(430);	
	
	DynamicGridColumn valueColumn = form.lyr1().tabConsultant().dyngrdConsultant().getColumns().newColumn("", true);
	valueColumn.setIdentifier("VALUES");
	valueColumn.setWidth(430);
}