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   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 2
Project: AvoinApotti   File: Logic.java   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   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 18
Project: AvoinApotti   File: Logic.java   Source Code and License 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   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 20
Project: AvoinApotti   File: Logic.java   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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);
}
 
Example 41
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void applyDefaultsToOtherGrid(SpecimenCollectionMethod type, Date date, Time time)
{
	DynamicGrid dynGridOther = form.lyrDetails().tabPathDetails().lyrPathology().tabOther().dyngrdOther();

	for (int i = 0; i < dynGridOther.getRows().size(); i++)
	{
		DynamicGridCell cell = dynGridOther.getRows().get(i).getCells().get(dynGridOther.getColumns().getByIdentifier(PATTYPE_COLUMN));
		cell.setValue(type);

		DynamicGridColumn colDate = dynGridOther.getColumns().getByIdentifier(DYN_COLDATE);
		colDate.setDynamicWidthSupported(true);
		colDate.setWidth(0);

		DynamicGridColumn colTime = dynGridOther.getColumns().getByIdentifier(DYN_COLTIME);
		colTime.setDynamicWidthSupported(true);
		colTime.setWidth(0);

		if (dynGridOther.getRows().get(i).getRows().size() > 0)
		{
			for (int childRowsIndex = 0; childRowsIndex < dynGridOther.getRows().get(i).getRows().size(); childRowsIndex++)
			{
   				DynamicGridRow cRow = dynGridOther.getRows().get(i).getRows().get(childRowsIndex);
   				
   				DynamicGridCell cellDate = cRow.getCells().get(colDate);
   				if (cellDate != null)
   					cellDate.setValue(date);
   
   				DynamicGridCell cellTime = cRow.getCells().get(colTime);
   				if (cellTime != null)
   					cellTime.setValue(time);
			}
		}

		for (int p = 0; p < dynGridOther.getRows().get(i).getRows().size(); p++)
			dynGridOther.getRows().get(i).getRows().get(p).getCells().get(dynGridOther.getColumns().getByIdentifier(QTY_COLUMN)).setWidth(90);
	}
}
 
Example 42
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DynamicGridRow addParentRow(TreeMap map, String element) 
{	
	DynamicGridRow dynRow = form.dyngrdDisplay().getRows().newRow();
	DynamicGridCell deviceCellVirtual = dynRow.getCells().newCell(getColumn(COLDEVICE), DynamicCellType.STRING);
	deviceCellVirtual.setValue(element + " (" + map.get(element) + ")");
	dynRow.setSelectable(false);
	
	return dynRow;
}
 
Example 43
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DynamicGridCell createCell(DynamicGridRow row, DynamicGridColumn column)
{
	DynamicGridCell cell = row.getCells().get(column);
	if (cell == null)
	{
		cell = row.getCells().newCell(column, DynamicCellType.STRING);
		cell.setReadOnly(true);
	}

	return cell;
}
 
Example 44
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addProcedureRow(DynamicGridRow categoryRow, PatientProcedureApptDetailVo procedure, Image rowImage)
{
	if(categoryRow == null)
		return;
	
	if(procedure == null)
		return;
	
	DynamicGridRow 	diagnoseRow = categoryRow.getRows().newRow();
	diagnoseRow.setSelectable(true);
	diagnoseRow.setExpandedImage(rowImage);
	diagnoseRow.setCollapsedImage(rowImage);
	diagnoseRow.setValue(procedure);
	
	DynamicGridCell cellProc = diagnoseRow.getCells().newCell(getCol(COL_TITLE_HIERARCHICAL), DynamicCellType.STRING);	
	String title = getTitleFromProcedure(procedure);
	
	String titleBold = title;
	
	if(Boolean.TRUE.equals(procedure.getIsPrimaryProcedure()))
	{
		titleBold = "<b>" + title + "</b>";
	}
	
	cellProc.setReadOnly(true);
	//WDEV-14980
	String tooltip=getTooltipFromProcedure(procedure);
	cellProc.setTooltip(tooltip);
	
	cellProc.setValue(titleBold);
}
 
Example 45
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DynamicGridColumn getValueColumn(DateTime valueDateTime, int groupIndex, LookupInstVo labSpecimenType, SpecimenType orderSpecimenType) 
{
	for(int i = 0; i < form.dyngrd().getColumns().size(); i++)
	{
		DynamicGridColumn column = form.dyngrd().getColumns().get(i);
		
		if(column.getIdentifier() instanceof ColumnIdentifierValue)
		{
			ColumnIdentifierValue columnIndentifier = (ColumnIdentifierValue) column.getIdentifier();
			
			boolean labSpecimenMatch = columnIndentifier.getLabSpecimen() != null && labSpecimenType != null && columnIndentifier.getLabSpecimen().equals(labSpecimenType);
			boolean orderSpecimenMatch = columnIndentifier.getLabSpecimen() == null && labSpecimenType == null && columnIndentifier.getOrderSpecimen() != null && orderSpecimenType != null && columnIndentifier.getOrderSpecimen().equals(orderSpecimenType);
			boolean noOrderOrLabSpecimen = columnIndentifier.getLabSpecimen() == null && columnIndentifier.getOrderSpecimen() == null && labSpecimenType == null && orderSpecimenType == null;
			
			if (columnIndentifier.getDate().equals(valueDateTime) && (labSpecimenMatch || orderSpecimenMatch || noOrderOrLabSpecimen))
			{
				DynamicGridRow row = form.dyngrd().getRows().get(groupIndex);
				DynamicGridCell cell = row.getCells().get(column);
				
				if(cell == null || cell.getValue() == null)
					return column;
			}
		}
	}
	
	return null;
}
 
Example 46
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DynamicGridCell createCell(DynamicGridRow row, DynamicGridColumn column)
{
	if(row == null || column == null)
		return null;
	
	DynamicGridCell cell = row.getCells().get(column);
	if (cell == null)
	{
		cell = row.getCells().newCell(column, DynamicCellType.STRING);
		cell.setReadOnly(true);
	}

	return cell;
}
 
Example 47
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setDefaultMosValue(DynamicGridCell cell)
{
	MemberOfStaffShortVo mos = (MemberOfStaffShortVo) domain.getMosUser();
	if (mos != null && mos.getNameIsNotNull())
	{
		cell.getItems().newItem(mos);
		cell.setValue(mos);
	}
}
 
Example 48
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isPrimaryPracticeMarked()
{
	DynamicGridRow pRow;
	for(int i = 0;i < form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getRows().size(); i++)
	{
		pRow = form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getRows().get(i);
		DynamicGridCell cell = pRow.getCells().get(form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getColumns().getByIdentifier(COL_PRIMARY));
		if (cell != null && cell.getValue() != null && cell.getValue().equals(Boolean.TRUE))
			return true; 
	}
	return false;
}
 
Example 49
Project: AvoinApotti   File: Logic.java   Source Code and License 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 50
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void removeCellByColumn(DynamicGridRow row, Integer colIdentifier)
{
	DynamicGridCell cell;
	cell = row.getCells().get(form.dyngrdCollect().getColumns().getByIdentifier(colIdentifier));
	if(cell != null)
		row.getCells().remove(cell);
}
 
Example 51
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateRowTemplate(DynamicGridRow row, ReportTemplateVo reportTemplate) 
{
	DynamicGridColumn column = null;
	DynamicGridCell cell = null;
	
	column = form.dyngrdHeaders().getColumns().getByIdentifier(COL_HEADING);
	cell = row.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(reportTemplate.getName());
	cell.setReadOnly(true);
	
	populateRowTemplate(row, reportTemplate);
}
 
Example 52
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DynamicGridRow addRow(DynamicGridRow parent,LookupInstVo look, int depth)
{
	if (look == null)
		throw new CodingRuntimeException("Trying to add null value lookup instance");
	DynamicGridRow result ;
	if (parent == null)
		result =  form.dyngrdLookup().getRows().newRow();
	else
		result = parent.getRows().newRow();
	
	result.setSelectable(isSingleSelect());
	result.setCollapsedImage(null);
	result.setExpandedImage(null);
	DynamicGridCell nCell;
	if (!isSingleSelect())
	{
		DynamicGridColumn colSel = getColumn(COL_SELECT);
		if (colSel.getWidth() < depth * SELECT_WIDTH_N)
			colSel.setWidth(depth * SELECT_WIDTH_N);
		nCell = result.getCells().newCell(colSel,DynamicCellType.BOOL);
		nCell.setAutoPostBack(false);
		nCell.setReadOnly(false);
	}
	
	nCell = result.getCells().newCell(getColumn(COL_TXT), DynamicCellType.STRING);
	nCell.setAutoPostBack(false);
	nCell.setReadOnly(true);
	nCell.setValue(look.getText());
	
	result.setValue(look);
	
	return result;
}
 
Example 53
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onDyngrdMappsCellValueChanged(DynamicGridCell cell)
{
	if (SPECIALTY_ROW_IDENTIFIER.equals(cell.getRow().getIdentifier()))
	{
		rebindCombos(cell.getRow().getParent());
	}
	updateControlsState();
}
 
Example 54
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addTemplate(TemplateForPatientDocumentVo template, DynamicGridRow reportRow, DynamicGrid dynamicGrid, boolean showCheck)
{
	if (template == null || reportRow == null)
		return;

	DynamicGridRow templateRow = reportRow.getRows().newRow();
	templateRow.setValue(template);
	templateRow.setCollapsedImage(form.getImages().Core.TemplateReport);
	templateRow.setExpandedImage(form.getImages().Core.TemplateReport);
	templateRow.setSelectable(!showCheck);
	DynamicGridCell cell;
	if (showCheck)
	{
		cell = templateRow.getCells().newCell(getColumn(dynamicGrid, COLUMN_SELECT), DynamicCellType.BOOL);
		cell.setReadOnly(false);
		cell.setAutoPostBack(true);
	}

	cell = templateRow.getCells().newCell(getColumn(dynamicGrid, COLUMN_NAME), DynamicCellType.LABEL);
	cell.setValue(template.getName());

	if (template.getReport().getImsIdIsNotNull() && template.getReport().getImsId().intValue() > 0)
	{
		templateRow.setTextColor(Color.Blue);
	}

}
 
Example 55
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void listGps(DynamicGridCell cell)
{
	if (cell == null)
		return;

	populateCellItems(cell, domain.listGPsBySurname(cell.getTypedText()));
}
 
Example 56
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addQueryComboRowTodyngrdInvitees(Class classType)
{
	DynamicGridRow row = form.ctnDetails().dyngrdInvitees().getRows().newRow();
	DynamicGridCell cellReportTo = row.getCells().newCell(form.ctnDetails().dyngrdInvitees().getColumns().getByIdentifier(INVITEE_COLUMN), DynamicCellType.QUERYCOMBOBOX);
	cellReportTo.setWidth(100);
	cellReportTo.setAutoPostBack(true);
	cellReportTo.setReadOnly(false);
	cellReportTo.setIdentifier(classType);
	if (classType.equals(HcpLiteVo.class))
		cellReportTo.setTooltip("Please search for a Member Of Staff");
	else
		cellReportTo.setTooltip("Please search for a GP");

	//Show a Label cell
	DynamicGridCell cellStatus = row.getCells().newCell(getColByIdentifier(STATUS_COLUMN), DynamicCellType.ENUMERATION);
	cellStatus.setReadOnly(false);
	cellStatus.setWidth(100);
	cellStatus.setTooltip("Please select a status");

	AttendanceStatusCollection collAttendStatus = ims.clinical.vo.lookups.LookupHelper.getAttendanceStatus(domain.getLookupService());
	for(int k = 0 ; k < collAttendStatus.size() ; k++) 
		cellStatus.getItems().newItem(collAttendStatus.get(k));

	DynamicGridCell cellNote = row.getCells().newCell(form.ctnDetails().dyngrdInvitees().getColumns().getByIdentifier(NOTE_COLUMN), DynamicCellType.STRING);
	cellNote.setWidth(-1);
	cellNote.setStringMaxLength(255);
	cellNote.setReadOnly(false);
	cellNote.setTooltip("Please add a note");
}
 
Example 57
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void listMOS(DynamicGridCell cell)
{
	MemberOfStaffShortVo filter = new MemberOfStaffShortVo();
	PersonName personName = new PersonName();
	personName.setSurname(cell.getTypedText());
	filter.setName(personName);
	filter.setIsActive(Boolean.TRUE);

	populateCellItems(cell, domain.listMembersOfStaff(filter));
}
 
Example 58
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void newClinicCorrespondence(DynamicGridRow parrentRow)
{
	if (parrentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add a CLINIC correspondence to a null parrent row");
	
	if (!(parrentRow.getValue() instanceof AccessCategory) || (((AccessCategory) parrentRow.getValue()) != AccessCategory.CLINICS))
		throw new CodingRuntimeException("Logical Error - Function must be called from CLINICS category row only");
	
	parrentRow.setExpanded(true);

	// Create a new row
	DynamicGridRow newRow = parrentRow.getRows().newRow(true);
	newRow.setValue(new ClinicAccessVo());
	form.dyngrdDetails().resetScrollPosition();
	
	// Declare a new cell
	DynamicGridCell newCell;
	// Column identifier
	DynamicGridColumn column;
	
	// Create the first cell of the row
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_IMAGE);
	newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
	newCell.setValue(form.getImages().Admin.Clinic);
	
	// Create the second cell of the row
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESS_CATEGORY);
	newCell = newRow.getCells().newCell(column, DynamicCellType.QUERYCOMBOBOX);
	newCell.setAutoPostBack(true);
	
	// Create the third cell of the row
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESSRIGHTS);		
	newCell = newRow.getCells().newCell(column, DynamicCellType.ANSWER);		
	engine.populate(newCell, Access.getNegativeInstancesAsIItemCollection());
	newCell.setAutoPostBack(true);
}
 
Example 59
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 60
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void createCollectorsCommentsCell(DynamicGridCell cell)
{
	if (cell.getRow().getValue() instanceof SpecimenWorkListItemListVo)
	{
		SpecimenWorkListItemListVo item = (SpecimenWorkListItemListVo) cell.getRow().getValue();

		if (item != null && item.getSpecimen() != null && item.getSpecimen().getCollectorComment() != null && item.getSpecimen().getCollectorComment().length() > 0)
		{
			DynamicGridCell cellText = cell.getRow().getCells().newCell(form.dyngrdCollect().getColumns().getByIdentifier(TEXT_COL), DynamicCellType.STRING);
			cellText.setValue(item.getSpecimen().getCollectorComment());
			cellText.setTooltip(item.getSpecimen().getCollectorComment());
			cellText.setReadOnly(true);
		}
	}
}