Java Code Examples for ims.framework.controls.DynamicGridCell.setReadOnly()

The following are Jave code examples for showing how to use setReadOnly() of the ims.framework.controls.DynamicGridCell class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View Source Code Vote up 6 votes
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 2
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void createCloseCombobox()
{
	// Add two empty rows
	form.dyngrd().getRows().newRow();

	DynamicGridRow row = form.dyngrd().getRows().newRow();
	row.setReadOnly(false);
	row.setSelectable(false);
	
	DynamicGridCell enableCloseCell = row.getCells().newCell(form.dyngrd().getColumns().getByIdentifier(COLUMN_NAME), DynamicCellType.MULTISELECT);
	enableCloseCell.setWidth(100);
	
	enableCloseCell.setAutoPostBack(true);
	enableCloseCell.setReadOnly(false);
	
	DynamicGridCellItem item = enableCloseCell.getItems().newItem("Enable Close", "Enable Close");
	item.setIdentifier(ENABLE_CLOSE);
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
/**
 * 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 4
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
/**
 * 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 5
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void addDiagnoseRow(DynamicGridRow categoryRow, PatientDiagnosisApptDetailVo diagnose, Image rowImage, boolean isPrimary)
{
	if(categoryRow == null)
		return;
	
	if(diagnose == null)
		return;
	
	DynamicGridRow 	diagnoseRow = categoryRow.getRows().newRow();
	diagnoseRow.setSelectable(true);
	diagnoseRow.setExpandedImage(rowImage);
	diagnoseRow.setCollapsedImage(rowImage);
	diagnoseRow.setValue(diagnose);
	
	DynamicGridCell cellDiag = diagnoseRow.getCells().newCell(getCol(COL_TITLE_HIERARCHICAL), DynamicCellType.STRING);	
	String title = getTitleFromDiagnose(diagnose);
	String titleBold = title;
	
	if(isPrimary)
	{
		titleBold = "<b>" + title + "</b>";
	}
	
	cellDiag.setReadOnly(true);
	cellDiag.setTooltip(title);
	cellDiag.setValue(titleBold);
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void newConsultantCorrespondenceGridRow(DynamicGridRow parentRow, ConsultantAccessVo consultantAccess)
{
	if (parentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add consultant access row to a null row");
	
	if (consultantAccess == null)
		return;
	
	
	DynamicGridCell newCell;
	DynamicGridColumn column;

	// Create a new row
	DynamicGridRow newRow = parentRow.getRows().newRow();
	newRow.setValue(consultantAccess);
	
	// 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().Core.User);

	// Create the second cell in the row
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESS_CATEGORY);
	newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
	newCell.setValue(consultantAccess.getConsultant().getIHcpName());
	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(consultantAccess.getAccessRight());
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private DynamicGridRow newCategoryAssociationsGridRow(AssociationCategory association)
{
	if (association == null)
		throw new CodingRuntimeException("Major Logical Error - Can not create an associations category with null value");
	
	DynamicGridRow newRow;
	DynamicGridCell newCell;
	DynamicGridColumn column;
	
	// Create a new row in grid
	newRow = form.dyngrdAssociations().getRows().newRow();
	newRow.setBackColor(Color.Beige);
	newRow.setValue(association);
	
	// Create the fist cell in the row (IMAGE CATEGORY)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_IMAGE);
	newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
	switch (association)
	{
		case CLINICS:
			newCell.setValue(form.getImages().Admin.Clinic02);
			break;
			
		case CONSULTANTS:
			newCell.setValue(form.getImages().Core.Users);
			break;
			
		case SPECIALTY:
			newCell.setValue(form.getImages().Admin.Specialty02);
			break;
	}
	
	// Create the second cell in the row
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
	newCell.setValue(association.getStringName());
	newCell.setReadOnly(true);
	
	return newRow;
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void checkIfThereAreSameChannels(CommChannelVoCollection channelColl, DynamicGridRow parentRow, DynamicGridColumn column) 
{
	if(channelColl == null || channelColl.size() == 0 || parentRow == null)
		return;
	
	for(int j = channelColl.size() - 1; j>=0; j--)
	{
		if(channelColl.get(j) == null)
			continue;
		
		for(int i=0; i<parentRow.getRows().size(); i++)
		{
			if(parentRow.getRows().get(i).getValue().equals(channelColl.get(j).getChannelType()))
			{
				DynamicGridCell sourceChannelValue = parentRow.getRows().get(i).getCells().get(getColumn(COL_SOURCE_PATIENT));
				if(sourceChannelValue != null && sourceChannelValue.getValue() != null && sourceChannelValue.getValue().equals(channelColl.get(j).getCommValue()))
				{
					DynamicGridCell cellNew = parentRow.getRows().get(i).getCells().newCell(column, DynamicCellType.STRING);
					cellNew.setValue(channelColl.get(j).getCommValue());
					cellNew.setReadOnly(true);
					
					createMoveButtons(parentRow.getRows().get(i));
					removeMoveButtons(parentRow.getRows().get(i));
					
					channelColl.remove(j);
					break;
				}
			}
		}
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void addAssessmentsToGrid(DynamicGridRow row, WhiteBoardAssessmentConfigVoCollection collAssessments)
{
	if (collAssessments==null)
		return;
	
	for (int i=0;i<collAssessments.size();i++)
	{
		DynamicGridCell cellPain = row.getCells().newCell(getColumnByIdentifier(collAssessments.get(i)), DynamicCellType.INT);
		cellPain.setValue(i);
		cellPain.setTooltip(Integer.toString(i));
		cellPain.setReadOnly(true);
	}

}
 
Example 10
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void checkIfThereAreSameIdentifier(PatientIdCollection identifiers,	DynamicGridRow parentRow, DynamicGridColumn column) 
{
	if(identifiers == null || identifiers.size() == 0 || parentRow == null)
		return;
	
	for(int j = identifiers.size() - 1; j>=0; j--)
	{
		if(identifiers.get(j) == null)
			continue;
		
		for(int i=0; i<parentRow.getRows().size(); i++)
		{
			if(parentRow.getRows().get(i).getValue().equals(identifiers.get(j).getType()))
			{
				DynamicGridCell sourceIdentifierValueCell = parentRow.getRows().get(i).getCells().get(getColumn(COL_SOURCE_PATIENT));
				
				if(sourceIdentifierValueCell != null && sourceIdentifierValueCell.getValue() != null)
				{
					String destinationIdentifierValue = formatIdentifierValue(identifiers.get(j).getValue());
					
					if(sourceIdentifierValueCell.getValue().equals(destinationIdentifierValue))
					{
						DynamicGridCell cellNew = parentRow.getRows().get(i).getCells().newCell(column, DynamicCellType.STRING);
						cellNew.setValue(getColumn(COL_RESULT_DATA).equals(column) ? destinationIdentifierValue : identifiers.get(j).getValue());
						cellNew.setReadOnly(true);
					
						identifiers.remove(j);
						break;
					}
				}
			}
		}
	}
}
 
Example 11
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void enableActionedColumn()
{
	for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++)
	{
		DynamicGridRow parentRow = form.dyngrdCollect().getRows().get(i);
		for (int j = 0; j < parentRow.getRows().size(); j++)
		{
			DynamicGridRow row = parentRow.getRows().get(j);
			
			DynamicGridCell cell = row.getCells().get(getColumn(ACTIONED_COL));
			if (cell != null)
				cell.setReadOnly(false);
		}
	}
}
 
Example 12
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
/**
 * Addes the given GpToPracticesVo as the next row in the practices grid. 
 * @param GpToPracticesVo
 */
private void editPracticeRow(GpToPracticesVo voPractice, DynamicGridRow row)
{
	if (voPractice != null && row != null)
	{
		DynamicGridColumn nameColumn = form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getColumns().getByIdentifier(COL_PRACTICENAME);
		if(nameColumn == null)
			return;
		
		row.setBackColor(Color.Beige);
		row.setBold(true);
		
		DynamicGridCell cell = row.getCells().newCell(nameColumn, DynamicCellType.STRING);
		String name = ""; 
		if ( voPractice.getPracticeIsNotNull() && voPractice.getPractice().getNameIsNotNull())
			name = voPractice.getPractice().getName();
		
		cell.setValue(name);
		cell.setTooltip(name);
		cell.setWidth(300);
		cell.setReadOnly(true);
		
		cell = row.getCells().newCell(form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getColumns().getByIdentifier(COL_PASCODE), DynamicCellType.STRING);
		cell.setValue(voPractice.getGpCode());
		cell.setWidth(60);
		cell.setIntMaxLength(40);//WDEV-15431
		
		cell = row.getCells().newCell(form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getColumns().getByIdentifier(COL_PRIMARY), DynamicCellType.BOOL);
		cell.setValue(voPractice.getIsPrimaryPractice());
		cell.setAutoPostBack(true);
		cell.setWidth(60);
		
		cell = row.getCells().newCell(form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getColumns().getByIdentifier(COL_ADDRESS), DynamicCellType.STRING);
		cell.setReadOnly(true);//WDEV-15431
		if (voPractice.getPracticeIsNotNull() && voPractice.getPractice().getAddressIsNotNull() && voPractice.getPractice().getAddress() != null)
		{
			String strAddress = voPractice.getPractice().getAddress().toDisplayString();
			if(strAddress.endsWith(","))
			{
				strAddress = strAddress.substring(0,strAddress.length()-1);
			
			}
			
			
			cell.setValue(strAddress);
			cell.setTooltip(strAddress);
			cell.setWidth(-1);
		}		
		
		row.setCollapsedImage(form.getImages().Admin.Organisation);
		row.setExpandedImage(form.getImages().Admin.Organisation);
		
		// if the site is using surgeries, display them on screen. otherwise, skip.
		if (ConfigFlag.DOM.GP_USE_SURGERIES.getValue())
		{
			if (voPractice.getPracticeIsNotNull() && voPractice.getPractice().getLocationSitesIsNotNull())
			{
				voPractice.getPractice().getLocationSites().sort();
				for(int x = 0; x < voPractice.getPractice().getLocationSites().size(); x++)
				{
					populateSurgeries(voPractice.getPractice().getLocationSites().get(x), row);
				}
				row.setExpanded(true);
			}
		}
		
		row.setSelectable(true);
		row.setValue(voPractice);
	}
}
 
Example 13
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private DynamicGridRow addValueCondition(DynamicGridRow parentRow, boolean isNewValueCondition)
{
	DynamicGridRow row = parentRow.getRows().newRow();
	row.setSelectable(true);

	RuleConditionRowVo vo = (RuleConditionRowVo) row.getIdentifier();

	int count = 1;

	if (vo != null)
		count = vo.getNumberOfColumns();

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	DynamicGridCell ifCell = row.getCells().newCell(getColByIndex(count), DynamicCellType.HTMLVIEW);
	ifCell.setValue(" <b>IF</b> ");
	ifCell.setWidth(30);

	count++;

	DynamicGridColumn valueColl = getColByIndex(count);
	if (valueColl == null)
	{
		valueColl = createColumn("", count);
	}

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	DynamicGridCell valueCell = row.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	for (int i = 0; i < entities.size(); i++)
	{
		valueCell.getItems().newItem().setValue(entities.get(i).getName());
		valueCell.getItems().get(i).setIdentifier(entities.get(i));
	}
	valueCell.setValue(form.lyrRules().tabConditions().cmbRootEntity().getValue().getName());
	valueCell.setReadOnly(true);

	if (isNewValueCondition)
		onDyngrdConditionsCellValueChanged(valueCell);

	valueCell.setAutoPostBack(true);
	valueCell.setWidth(0);

	return row;
}
 
Example 14
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
/**
 * Function used to populate a Patient ICP Action to a row
 * @param phaseRow 
 */
protected void populateICPAction(PatientICPAction_PresentationVo action, HcpDisType discipline, DynamicGridRow phaseRow)
{
	// Check if the action matches the filter discipline
	if (action == null || (discipline != null && !action.getAction().getDiscipline().contains(discipline)))
		return;
	
	// Check for action not to be outside of the scope
	if (ICPActionStatus.NOTINSCOPE.equals(action.getCurrentStatus().getStatus()))
		return;
	
	
	// Create action row
	DynamicGridRow actionRow = phaseRow.getRows().newRow();
	
	// Set row attributes
	actionRow.setSelectable(true);
	
	actionRow.setCollapsedImage(form.getImages().ICP.Action);
	actionRow.setExpandedImage(form.getImages().ICP.Action);
	
	if (isActionEditatble(action, form.getLocalContext().getLoggedInUser()))
	{
		actionRow.setBackColor(InScopeColor);
	}
	
	// Fill in row cells
	
		// Name cell
   		DynamicGridCell cell = actionRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_PRESENTATION), DynamicCellType.STRING);
   		cell.setValue(action.getAction().getName());
   		cell.setTooltip(action.getAction().getName());
   		cell.setWidth(300);
   		cell.setReadOnly(true);

   		// Requires counter-signing cell
   		cell = actionRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_CONTER_SIGNATURE), DynamicCellType.IMAGE);
   		if (Boolean.TRUE.equals(action.getRequiresCounterSigning()))
   		{
   			cell.setValue(form.getImages().ICP.ACTION_OUTSANDING_ENABLED_16);
   			cell.setTooltip("Requires counter-signature.");
   		}
   		cell.setWidth(25);
   		cell.setReadOnly(true);
   		
   		// Status cell
   		cell = actionRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_STATUS), DynamicCellType.IMAGE);
   		cell.setValue(action.getCurrentStatus().getStatus().getImage());
   		cell.setTooltip(buildActionStatusTooltip(action));
   		cell.setWidth(40);
   		cell.setReadOnly(true);
   		
		cell = actionRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_ACTION_DETAILS), DynamicCellType.BUTTON);
   		cell.setTooltip("Action details.");
   		cell.setWidth(25);
   		cell.setAutoPostBack(true);
   		
   		// Help cell
   		if (action.getAction().getHelpURLIsNotNull() && action.getAction().getHelpURL().length() > 0)
   		{
   			cell = actionRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_HELP), DynamicCellType.IMAGEBUTTON);
   			cell.setValue(form.getImages().Core.InfoEnabled16);
   			cell.setTooltip(action.getAction().getHelpURL());
   			cell.setWidth(25);
   			cell.setAutoPostBack(true);
   		}
	
	// Set row value
	actionRow.setValue(action);
}
 
Example 15
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void addRowRecord(PatientDocumentVoCollection list, DynamicGridRow dynVirtualRow, int index) 
{
	if(list == null)
		return;
	
	DynamicGridRow dynParentRow = dynVirtualRow.getRows().newRow();
	dynParentRow.setIdentifier(list.get(index));

	PatientDocumentVo	patientDocument 	 = list.get(index) != null ?  list.get(index) : null;							
	DynamicGridCell 	nameChildCellVirtual = dynParentRow.getCells().newCell(getColumn(COLNAME), DynamicCellType.STRING);
	
	nameChildCellVirtual.setValue(patientDocument.getName());
	nameChildCellVirtual.setTooltip(patientDocument.getName());
	nameChildCellVirtual.setReadOnly(true);//WDEV-15010
	
	DynamicGridCell categoryChildCellVirtual = dynParentRow.getCells().newCell(getColumn(COLCATEGORY), DynamicCellType.STRING);
	categoryChildCellVirtual.setValue(patientDocument.getCategoryIsNotNull() ? patientDocument.getCategory().getIItemText() : null);
	categoryChildCellVirtual.setTooltip(patientDocument.getCategoryIsNotNull() ? patientDocument.getCategory().getIItemText() : null);
	categoryChildCellVirtual.setReadOnly(true);//WDEV-15010

	if (patientDocument.getCategory().equals(DocumentCategory.GPLETTER) && !isGPLetterSelected)
	{			
		isGPLetterCategory = true;			
	}
	
	DynamicGridCell typeChildCellVirtual = dynParentRow.getCells().newCell(getColumn(COLTYPE), DynamicCellType.STRING);
	typeChildCellVirtual.setValue(patientDocument.getCreationTypeIsNotNull() ? patientDocument.getCreationType().getIItemText() : null);
	typeChildCellVirtual.setTooltip(patientDocument.getCreationTypeIsNotNull() ? patientDocument.getCreationType().getIItemText() : null);
	typeChildCellVirtual.setReadOnly(true);//WDEV-15010
									
	
	DynamicGridCell userChildCellVirtual = dynParentRow.getCells().newCell(getColumn(COLUSER), DynamicCellType.STRING);
	if (patientDocument.getRecordingUserIsNotNull())
	{
		MemberOfStaffLiteVo recordingUser = domain.getMoS(patientDocument.getRecordingUser());
		userChildCellVirtual.setValue(recordingUser != null? (recordingUser.getNameIsNotNull() ? recordingUser.getName().toString() : null) : null );
		userChildCellVirtual.setTooltip(recordingUser != null? (recordingUser.getNameIsNotNull() ? recordingUser.getName().toString() : null) : null );
		userChildCellVirtual.setReadOnly(true);//WDEV-15010
	}
												
	DynamicGridCell dateTimeChildCellVirtual = dynParentRow.getCells().newCell(getColumn(COLDATETIME), DynamicCellType.STRING);
	dateTimeChildCellVirtual.setValue(patientDocument.getRecordingDateTimeIsNotNull() ? patientDocument.getRecordingDateTime().toString() : null);
	dateTimeChildCellVirtual.setTooltip(patientDocument.getRecordingDateTimeIsNotNull() ? patientDocument.getRecordingDateTime().toString() : null);
	dateTimeChildCellVirtual.setReadOnly(true);//WDEV-15010
	
	dynParentRow.setValue(patientDocument);				
}
 
Example 16
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void addDynGridRow(TumourGroupSiteTNMValueVo voTNM, boolean isActive)
{
	if (voTNM == null)
		return;

	DynamicGridRow dynRow = form.lyrConfig().tabTNM().lyrTNM().tabTNMValues().dynTNM().getRows().newRow();

	DynamicGridCell typeCell = dynRow.getCells().newCell(getColumn(COLTYPE), DynamicCellType.ANSWER);
	bindTNMTypeLookup(typeCell);
	if (voTNM.getTNMTypeIsNotNull())
	{
		typeCell.setValue(voTNM.getTNMType());
		typeCell.setReadOnly(true);
		if (isEditMode())
			typeCell.setBackColor(Color.LightGray);
	}

	DynamicGridCell tnmCell = dynRow.getCells().newCell(getColumn(COLTNM), DynamicCellType.STRING);
	if (voTNM.getTNMValueIsNotNull())
	{
		tnmCell.setValue(voTNM.getTNMValue());
		tnmCell.setReadOnly(true);
		if (isEditMode())
			tnmCell.setBackColor(Color.LightGray);
	}

	DynamicGridCell cpbCell = dynRow.getCells().newCell(getColumn(COLCPB), DynamicCellType.ENUMERATION);
	bindTNMClinicalpathologicalLookup(cpbCell);
	if (voTNM.getClinicalPathologicalIsNotNull())
	{
		cpbCell.setValue(voTNM.getClinicalPathological());
		cpbCell.setReadOnly(true);
		if (isEditMode())
			cpbCell.setBackColor(Color.LightGray);
	}

	DynamicGridCell descCell = dynRow.getCells().newCell(getColumn(COLTNMDESCRIPTION), DynamicCellType.STRING);
	if (voTNM.getTNMDescriptionIsNotNull())
	{
		descCell.setValue(voTNM.getTNMDescription());
	}
	// WDEV-7804 - Set cell maximum string limit to 500
	descCell.setStringMaxLength(500);

	if (!isActive)
	{
		DynamicGridCell activeCell = dynRow.getCells().newCell(getColumn(COLACTIVE), DynamicCellType.ANSWER);
		bindYesNoLookup(activeCell);
		if (voTNM.getIsActiveIsNotNull())
		{
			if (voTNM.getIsActive())
				activeCell.setValue(YesNo.YES);
			else
				activeCell.setValue(YesNo.NO);
		}
	}

	dynRow.setValue(voTNM);
}
 
Example 17
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void addGraphicQuestionRow(GraphicAssessmentQuestionVo question, PatientGraphicAssessmentQuestionAnswerVo voPatientGraphicAssessmentQuestionAnswer, boolean allowMultipleQuestion) throws PresentationLogicException
{
	checkDataIntegrity(question);

	DynamicGridColumn questionColumn = this.grid.getColumns().getByIdentifier(QUESTION_COLUMN);
	DynamicGridColumn buttonColumn = this.grid.getColumns().getByIdentifier(BUTTON_COLUMN);

	DynamicGridRow row = this.grid.getRows().newRow();

	Image rowQuestionImage = this.questionImage;
	if (question.getIsMandatoryIsNotNull() && question.getIsMandatory().booleanValue())
		rowQuestionImage = this.mandatoryQuestionImage;

	DynamicGridColumn imageColumn = this.grid.getColumns().getByIdentifier(IMAGE_COLUMN);
	if (imageColumn != null)
	{
		row.getCells().newCell(imageColumn, DynamicCellType.IMAGE).setValue(rowQuestionImage);
	}

	row.setIdentifier(question);
	row.setExpandedImage(rowQuestionImage);
	row.setCollapsedImage(rowQuestionImage);

	if (buttonColumn != null && allowMultipleQuestion)
	{
		DynamicGridCell buttonCell = row.getCells().newCell(buttonColumn, DynamicCellType.IMAGEBUTTON);
		buttonCell.setTooltip("Create new answer for this question");
		buttonCell.setValue(this.buttonAddImage);
		buttonCell.setIdentifier(BUTTON_ADD_ANSWER);
		buttonColumn.setWidth(DEFAULT_BUTTON_CELL_WIDTH);
	}

	DynamicGridCell questionCell = row.getCells().newCell(questionColumn, DynamicCellType.WRAPTEXT);
	questionCell.setValue(question.getQuestion().getShortText());
	questionCell.setTooltip(question.getQuestion().getText());
	questionCell.setReadOnly(true);

	questionCell.setIdentifier(voPatientGraphicAssessmentQuestionAnswer);

	if (question.getQuestion().getAnswerTypesIsNotNull())
	{
		for (int x = 0; x < question.getQuestion().getAnswerTypes().size(); x++)
		{
			if (question.getQuestion().getAnswerTypes().get(x).getActiveStatusIsNotNull() && question.getQuestion().getAnswerTypes().get(x).getActiveStatus().booleanValue())
			{
				addAnswerCell(row, getAnswerColumn(x), question.getQuestion().getAnswerTypes().get(x), getInstAnswerType(voPatientGraphicAssessmentQuestionAnswer.getPatientAnswers(), question.getQuestion().getAnswerTypes().get(x)));
			}
		}
	}
}
 
Example 18
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void populateMedicationRow(DynamicGridRow row, PatientMedicationVo medication)
	{
		if (medication == null)
			return;
		
		if (row == null)
			throw new CodingRuntimeException("Major logical error - can not populate to a null row parameter");
		
		// Fill row cells
		DynamicGridColumn column = form.dyngrdMedications().getColumns().getByIdentifier(COL_MEDICATION_NAME);
		DynamicGridCell cell = row.getCells().newCell(column, DynamicCellType.STRING);
		cell.setValue(medication.getMedicationIsNotNull() ? medication.getMedication().getMedicationName() : medication.getOtherMedicationText());
		cell.setReadOnly(true);
		
		column = form.dyngrdMedications().getColumns().getByIdentifier(COL_DOSE);
		cell = row.getCells().newCell(column, DynamicCellType.STRING);
		cell.setValue((medication.getPrescribedDosesIsNotNull() && medication.getPrescribedDoses().size() > 0) ? medication.getPrescribedDoses().get(0).getDose() : "");
		cell.setReadOnly(true);
		
		column = form.dyngrdMedications().getColumns().getByIdentifier(COL_FREQUENCY);
		cell = row.getCells().newCell(column, DynamicCellType.STRING);
		cell.setValue(medication.getFrequencyIsNotNull() ? medication.getFrequency().getText() : "");
		cell.setReadOnly(true);
		
		column = form.dyngrdMedications().getColumns().getByIdentifier(COL_ROUTE);
		cell = row.getCells().newCell(column, DynamicCellType.STRING);
		cell.setValue((medication.getPrescribedDosesIsNotNull() && medication.getPrescribedDoses().size() > 0) ? (medication.getPrescribedDoses().get(0).getAdminRouteIsNotNull() ? medication.getPrescribedDoses().get(0).getAdminRoute().getText() : "") : "");
		cell.setReadOnly(true);
		
//		column = form.dyngrdMedications().getColumns().getByIdentifier(COL_COMMENCED_BY);
//		cell = row.getCells().newCell(column, DynamicCellType.STRING);
//		cell.setValue(medication.getHcpCommencedIsNotNull() ? medication.getHcpCommenced().toString() : "");
//		cell.setReadOnly(true);

//		column = form.dyngrdMedications().getColumns().getByIdentifier(COL_COMMENCED_DATE);
//		cell = row.getCells().newCell(column, DynamicCellType.DATE);
//		cell.setValue(medication.getCommencedDate());
//		cell.setReadOnly(true);

		column = form.dyngrdMedications().getColumns().getByIdentifier(COL_SELECT);
		cell = row.getCells().newCell(column, DynamicCellType.BOOL);
		cell.setValue(Boolean.FALSE);
		cell.setReadOnly(false);
		
		// Set row value
		row.setValue(medication);
	}
 
Example 19
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void populateClinicalContacts(ClinicalContactShortVoCollection voCollclinicalContacts, DynamicGridRow careContextRow)
{
	if (voCollclinicalContacts != null && careContextRow != null)
	{
		voCollclinicalContacts.sort();
		DynamicGridRow clinicalContactRow = null;
		for (int i = 0; i < voCollclinicalContacts.size(); i++)
		{
			clinicalContactRow = careContextRow.getRows().newRow();

			DynamicGridCell cellStartEndDate = clinicalContactRow.getCells().newCell(getColumnById(COLUMN_STARTDATE_ENDDATE), DynamicCellType.STRING);
			cellStartEndDate.setValue(voCollclinicalContacts.get(i).createDisplayString());
			cellStartEndDate.setTooltip("Clinical Contact: " + voCollclinicalContacts.get(i).createDisplayString());
			cellStartEndDate.setReadOnly(true);
			
			DynamicGridCell cellSpecialty = clinicalContactRow.getCells().newCell(getColumnById(COLUMN_SPECIALTY), DynamicCellType.STRING);
			cellSpecialty.setValue(voCollclinicalContacts.get(i).getSpecialtyIsNotNull() ? INDENT + INDENT + INDENT + voCollclinicalContacts.get(i).getSpecialty().getText() : null);
			cellSpecialty.setTooltip("Clinical Contact: " + (voCollclinicalContacts.get(i).getSpecialtyIsNotNull() ? INDENT + INDENT + INDENT + voCollclinicalContacts.get(i).getSpecialty().getText() : ""));
			cellSpecialty.setReadOnly(true);
			
			DynamicGridCell cellContactType = clinicalContactRow.getCells().newCell(getColumnById(COLUMN_CONTACT_TYPE), DynamicCellType.STRING);
			cellSpecialty.setReadOnly(true);
			
			if (ConfigFlag.UI.DISPLAY_WORKLIST_CONTACT_TYPE_ON_PATIENT_SUMMARY.getValue() == true)
			{
				if (voCollclinicalContacts.get(i).getContactTypeIsNotNull())
				{
					WorklistContactType lkupWorklistContactType = domain.getWorklistContactTypeByExternalCode(voCollclinicalContacts.get(i).getContactType());
					if (lkupWorklistContactType != null)
					{
						cellContactType.setValue(lkupWorklistContactType.getText());
						cellContactType.setTooltip("Clinical Contact: " + lkupWorklistContactType.getText());
					}
					else
					{
						cellContactType.setValue(voCollclinicalContacts.get(i).getContactTypeIsNotNull() ? voCollclinicalContacts.get(i).getContactType().getText() : null);
						cellContactType.setTooltip("Clinical Contact: " + (voCollclinicalContacts.get(i).getContactTypeIsNotNull() ? voCollclinicalContacts.get(i).getContactType().getText() : ""));
					}
				}
			}
			else
			{
				cellContactType.setValue(voCollclinicalContacts.get(i).getContactTypeIsNotNull() ? voCollclinicalContacts.get(i).getContactType().getText() : null);
				cellContactType.setTooltip("Clinical Contact: " + (voCollclinicalContacts.get(i).getContactTypeIsNotNull() ? voCollclinicalContacts.get(i).getContactType().getText() : ""));
			}
			
			cellContactType.setReadOnly(Boolean.TRUE);

			DynamicGridCell cellRMO = clinicalContactRow.getCells().newCell(getColumnById(COLUMN_RMO), DynamicCellType.STRING);
			cellRMO.setValue(voCollclinicalContacts.get(i).getSeenByIsNotNull() ? INDENT + INDENT + INDENT + voCollclinicalContacts.get(i).getSeenBy().toString() : null);
			cellRMO.setTooltip("Clinical Contact: " + (voCollclinicalContacts.get(i).getSeenByIsNotNull() ? INDENT + INDENT + INDENT + voCollclinicalContacts.get(i).getSeenBy().toString() : ""));
			cellRMO.setReadOnly(true);
		
			clinicalContactRow.setCollapsedImage(form.getImages().Admin.MemberOfStaff);
			clinicalContactRow.setExpandedImage(form.getImages().Admin.MemberOfStaff);
		//	clinicalContactRow.setColumnHistoryEmpty(true); // wdev-13896

			// WDEV-13764
			if (voCollclinicalContacts.get(i).getCurrentStatusIsNotNull() && voCollclinicalContacts.get(i).getCurrentStatus().getStatusIsNotNull() && voCollclinicalContacts.get(i).getCurrentStatus().getStatus().equals(ClinicalContactStatus.CANCELLED))
				clinicalContactRow.setBackColor(ConfigFlag.UI.DISPLAY_COLOUR_FOR_CANCELLED_CLINICAL_CONTACTS.getValue());

			clinicalContactRow.setValue(voCollclinicalContacts.get(i));
		}
	}
}
 
Example 20
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void fillAccreditationForLocationSite(DynamicGridRow rowLocSiteOrLoc)
	{
		for (int i = 0; i < rowLocSiteOrLoc.getRows().size() ; i++)
		{
			DynamicGridRow row = rowLocSiteOrLoc.getRows().get(i);
			
			if (row.getValue() instanceof LocSiteVo)
			{
				DynamicGridCell cell2 = row.getCells().newCell(getColByIdentifier(COL_ACCREDITATION), DynamicCellType.ENUMERATION);
				
				if (cell2 != null)
				{
					for(int k = 0 ; k < form.getLocalContext().getCollAccreditation().size() ; k++) 
						cell2.getItems().newItem(form.getLocalContext().getCollAccreditation().get(k));
					
					cell2.setReadOnly(false);
					cell2.setTooltip("Please select an Accreditation");
					cell2.setWidth(-1);

				}

				if (ConfigFlag.UI.MANDATORY_MOS_ACCREDITATION_STATUS.getValue())
					rowLocSiteOrLoc.getCells().newCell(getColByIdentifier(COL_ACCREDITATION_CASETYPES), DynamicCellType.BUTTON);
				
				row.getCells().newCell(getColByIdentifier(COL_ACCREDITATION_ST_DATE), DynamicCellType.DATE);

				row.getCells().newCell(getColByIdentifier(COL_ACCREDITATION_END_DATE), DynamicCellType.DATE);

				fillAccreditationForLocationSite(row);
			}
/*			else if (row.getValue() instanceof LocMostVo)
			{
				DynamicGridCell cell2 = row.getCells().newCell(getColByIdentifier(COL_ACCREDITATION), DynamicCellType.EMPTY);
				if (cell2 != null)
				{
					cell2.setReadOnly(true);
					AccreditationLocationStatusCollection coll = LookupHelper.getAccreditationLocationStatus(domain.getLookupService());
					for(int k = 0 ; k < coll.size() ; k++) 
						cell2.getItems().newItem(coll.get(k));
					
					cell2.setReadOnly(false);
					cell2.setTooltip("Please select an Accreditation");
					cell2.setWidth(-1);
				}
			}
*/
		}
	}