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

The following are Jave code examples for showing how to use getType() 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: Logic.java   View Source Code Vote up 6 votes
protected void onDyngrdAssociationsCellValueChanged(DynamicGridCell cell)
{
	if (cell.getType() != DynamicCellType.QUERYCOMBOBOX)
		return;
	
	if (!(cell.getRow().getParent().getValue() instanceof AssociationCategory))
		return;
	
	switch ((AssociationCategory) cell.getRow().getParent().getValue())
	{
		case CLINICS:
			updateClinicAssociationRowValue(cell.getRow());
			break;
			
		case CONSULTANTS:
			updateConsultantAssociationRowValue(cell.getRow());
			break;
			
		case SPECIALTY:
			updateSpecialtyAssociationRowValue(cell.getRow());
			break;
	}
	
	form.dyngrdAssociations().setSelectedRow(null);
	updateContextMenuState();
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
protected void onDyngrdAnswerTypesCellValueChanged(DynamicGridCell cell)
{
	if (cell.getType().equals(DynamicCellType.BOOL))
	{
		Object cellVal = cell.getValue();
		if (cellVal instanceof Boolean)
		{
			if (((Boolean) cellVal).booleanValue())
			{
				// Clear the checkboxes except the selected one
				for (int i = 0; i < form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getRows().size(); i++)
				{
					DynamicGridRow row = form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getRows().get(i);
					for (int j = 0; j < form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getColumns().size(); j++)
					{
						DynamicGridCell cellParent = row.getCells().get(form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getColumns().get(j));
						if (cellParent != null && cellParent.getType() == DynamicCellType.BOOL && cellParent.equals(cell) == false)
						{
							cellParent.setValue(new Boolean(false));
						}
					}
				}
			}
		}
	}
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void setDefaultDynamicGridCheckBox(QuestionAnswerTypeVo voAnswType, boolean selectFirst)
{
	if (selectFirst && countDynRowBoolean() > 1)
		return;

	if (isScoringAssessmentQuestion() && isSingleOrMultiSelect(voAnswType.getAnswerType()))
	{
		for (int i = 0; i < form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getRows().size(); i++)
		{
			DynamicGridRow row = form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getRows().get(i);
			for (int j = 0; j < form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getColumns().size(); j++)
			{
				DynamicGridCell cell = row.getCells().get(form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getColumns().get(j));
				if (cell != null && cell.getType() == DynamicCellType.BOOL)
				{
					cell.setValue(new Boolean(true));
					return;
				}
			}
		}
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private int countDynRowBoolean()
{
	int rowCount = 0;
	for (int i = 0; i < form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getRows().size(); i++)
	{
		DynamicGridRow row = form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getRows().get(i);
		for (int j = 0; j < form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getColumns().size(); j++)
		{
			DynamicGridCell cell = row.getCells().get(form.lyrTabs().tabNewQuestion().dyngrdAnswerTypes().getColumns().get(j));
			if (cell != null && cell.getType() == DynamicCellType.BOOL)
			{
				rowCount++;
			}
		}
	}
	return rowCount;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void save()
{
	PatientMedicationVoCollection voCopyColl = new PatientMedicationVoCollection(); 
	DynamicGridColumn colCopy = form.dyngrdMedicationOverView().getColumns().getByIdentifier(new Integer(9));
	for (int i = 0 ; i < form.dyngrdMedicationOverView().getRows().size() ; i++)
	{
		if (form.dyngrdMedicationOverView().getRows().get(i).getValue() instanceof PatientMedicationVo)
		{
			DynamicGridCell cellCopy = form.dyngrdMedicationOverView().getRows().get(i).getCells().get(colCopy);
			if (cellCopy != null && cellCopy.getType() == DynamicCellType.BOOL && ((Boolean)cellCopy.getValue()) == Boolean.TRUE )
				voCopyColl.add((PatientMedicationVo)form.dyngrdMedicationOverView().getRows().get(i).getValue());
		}
	}
	MedicationOverViewVo voMedOver = form.getGlobalContext().Clinical.getCurrentMedicationOverView();
	if (voCopyColl.size() > 0)
	{
		voMedOver.setMedication(voCopyColl);
		voMedOver.setCorrectness(form.cmbCorrectness().getValue());
		
		form.getGlobalContext().Clinical.setCurrentMedicationOverView(voMedOver);
	}
	else
		form.getGlobalContext().Clinical.setCurrentMedicationOverView(null);
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void updateClinicAssociationRowValue(DynamicGridRow row)
{
	if (row == null
		|| (row.getParent() == null)
		|| (!(row.getParent().getValue() instanceof AssociationCategory))
		|| (((AssociationCategory) row.getParent().getValue()) != AssociationCategory.CLINICS))
		throw new CodingRuntimeException("Major Logical Failure");
	
	if (row.getValue() == null)
		row.setValue(new ClinicLiteVo());
	
	if (!(row.getValue() instanceof ClinicLiteVo))
		throw new CodingRuntimeException("Major Logical Error - Clinic value expected");
	

	DynamicGridColumn column;
	DynamicGridCell cell;
	
	// Get the second cell value
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	cell = row.getCells().get(column);
	
	if (cell.getType() != DynamicCellType.STRING)
	{
		if (cell.getValue() == null)
		{
			row.setValue(null);
			cell.setTypedText(null);
		}
		else
			row.setValue((ClinicLiteVo) cell.getValue());
	}
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void updateConsultantAssociationRowValue(DynamicGridRow row)
{
	if (row == null
		|| row.getParent() == null
		|| (!(row.getParent().getValue() instanceof AssociationCategory))
		|| (((AssociationCategory) row.getParent().getValue()) != AssociationCategory.CONSULTANTS))
		throw new CodingRuntimeException("Major Logical Failure");
	
	if (row.getValue() == null)
		row.setValue(new MedicLiteVo());
	
	if (!(row.getValue() instanceof MedicLiteVo))
		throw new CodingRuntimeException("Major Logical Error - Consultant value expected");
	
	
	DynamicGridColumn column;
	DynamicGridCell cell;
	
	// Get the second cell value
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	cell = row.getCells().get(column);
	
	if (cell.getType() != DynamicCellType.STRING)
	{
		if (cell.getValue() == null)
		{
			row.setValue(null);
			cell.setTypedText(null);
		}
		else
		{
			row.setValue((MedicLiteVo) cell.getValue());
		}
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void updateSpecialtyAssociationRowValue(DynamicGridRow row)
{
	if (row == null
		|| row.getParent() == null
		|| (!(row.getParent().getValue() instanceof AssociationCategory))
		|| (((AssociationCategory) row.getParent().getValue()) != AssociationCategory.SPECIALTY))
		throw new CodingRuntimeException("Mojor Logical Failure");
	
	if (row.getValue() == null)
		row.setValue(new Specialty());
	
	if (!(row.getValue() instanceof Specialty))
		throw new CodingRuntimeException("Major Logical Error - Specialty value expected");
	
	
	DynamicGridColumn column;
	DynamicGridCell cell;
	
	// Get the second cell value
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	cell = row.getCells().get(column);
	
	if (cell.getType() != DynamicCellType.STRING)
	{
		if (cell.getValue() == null)
		{
			row.setValue(null);
			cell.setTypedText(null);
		}
		else
		{
			row.setValue((Specialty) cell.getValue());
		}
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
@Override
protected void onDyngrdDetailsCellValueChanged(DynamicGridCell cell)
{
	if (cell.getType() != DynamicCellType.QUERYCOMBOBOX)
		return;

	if (!(cell.getRow().getParent().getValue() instanceof AccessCategory))
		return;
	
	switch ((AccessCategory) cell.getRow().getParent().getValue())
	{
		case CLINICS:
			updateClinicAccessRowValue(cell.getRow());
			break;
			
		case CONSULTANTS:
			updateConsultantAccessRowValue(cell.getRow());
			break;
			
		case SPECIALTY:
			updateSpecialtyAccessRowValue(cell.getRow());
			break;
	}
	
	form.dyngrdDetails().setSelectedRow(null);
	updateControlsState();
}
 
Example 10
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void updateClinicAccessRowValue(DynamicGridRow row)
{
	DynamicGridColumn column;
	DynamicGridCell cell;
	
	if (row == null || (row.getParent() == null) || (!(row.getParent().getValue() instanceof AccessCategory)) || (((AccessCategory)row.getParent().getValue()) != AccessCategory.CLINICS))
		throw new CodingRuntimeException("Major Logical Error");
	
	if (row.getValue() == null)
		row.setValue(new ClinicAccessVo());
	
	if (!(row.getValue() instanceof ClinicAccessVo))
		throw new CodingRuntimeException("BUG");
	

	// Get second cell value
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESS_CATEGORY);
	cell = row.getCells().get(column);
	if (cell.getType() != DynamicCellType.STRING)
	{
		if (cell.getValue() == null)
		{
			((ClinicAccessVo) row.getValue()).setClinic(null);
			cell.setTypedText(null);
		}
		else
		{
			((ClinicAccessVo) row.getValue()).setClinic((ClinicLiteVo) cell.getValue());
		}
	}
	
	// Get third cell value
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESSRIGHTS);
	cell = row.getCells().get(column);
	cell.getValue();
	((ClinicAccessVo) row.getValue()).setAccessRight((Access) cell.getValue());
}
 
Example 11
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void updateConsultantAccessRowValue(DynamicGridRow row)
{
	if (row == null || (row.getParent() == null) || (!(row.getParent().getValue() instanceof AccessCategory)) || (((AccessCategory)row.getParent().getValue()) != AccessCategory.CONSULTANTS))
		throw new CodingRuntimeException("Major Logical Problem");
	
	if (row.getValue() == null)
		row.setValue(new ConsultantAccessVo());
	
	if (!(row.getValue() instanceof ConsultantAccessVo))
		throw new CodingRuntimeException("BUG");


	DynamicGridColumn column;
	DynamicGridCell cell;
	
	// Get second cell value
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESS_CATEGORY);
	cell = row.getCells().get(column);
	if (cell.getType() != DynamicCellType.STRING)
	{
		if (cell.getValue() == null)
		{
			((ConsultantAccessVo) row.getValue()).setConsultant(null);
			cell.setTypedText(null);
		}
		else
		{
			((ConsultantAccessVo) row.getValue()).setConsultant((MedicLiteVo) cell.getValue());
		}
	}
	
	// Get third cell value
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESSRIGHTS);
	cell = row.getCells().get(column);
	((ConsultantAccessVo) row.getValue()).setAccessRight((Access) cell.getValue());
}
 
Example 12
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void updateSpecialtyAccessRowValue(DynamicGridRow row)
{
	DynamicGridColumn column;
	DynamicGridCell cell;
	
	if (row == null || (row.getParent() == null) || (!(row.getParent().getValue() instanceof AccessCategory)) || (((AccessCategory)row.getParent().getValue()) != AccessCategory.SPECIALTY))
		throw new CodingRuntimeException("Major Logical Problem");
	
	if (row.getValue() == null)
		row.setValue(new SpecialtyAccessVo());
	
	if (!(row.getValue() instanceof SpecialtyAccessVo))
		throw new CodingRuntimeException("BUG");

	
	// Get second cell value
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESS_CATEGORY);
	cell = row.getCells().get(column);
	if (cell.getType() != DynamicCellType.STRING)
	{
		if (cell.getValue() == null)
		{
			cell.setTypedText(null);
			((SpecialtyAccessVo) row.getValue()).setSpecialty(null);
		}
		else
		{
			((SpecialtyAccessVo) row.getValue()).setSpecialty((Specialty) cell.getValue());
		}
	}
	
	// Get third cell value
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESSRIGHTS);
	cell = row.getCells().get(column);
	((SpecialtyAccessVo) row.getValue()).setAccessRight((Access) cell.getValue());
}
 
Example 13
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View Source Code Vote up 5 votes
private void setCellAnswerTooltip(DynamicGridCell cell, AnswerDetailsVo answer)
{
	if(cell == null || answer == null)
		return;
	
	else if(cell.getType() == DynamicCellType.COMMENT)
	{
		cell.setTooltip(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.DATE && answer.getDateAnswer() != null)
	{
		cell.setTooltip(answer.getDateAnswer().toString());
	}
	else if(cell.getType() == DynamicCellType.PARTIALDATE && answer.getPartialDate() != null)
	{
		cell.setTooltip(answer.getPartialDate().toString());
	}
	else if(cell.getType() == DynamicCellType.DECIMAL && answer.getDecimalAnswer() != null)
	{
		cell.setTooltip(answer.getDecimalAnswer().toString());
	}
	else if(cell.getType() == DynamicCellType.INT && answer.getIntegerAnswer() != null)
	{
		cell.setTooltip(answer.getIntegerAnswer().toString());
	}
	else if(cell.getType() == DynamicCellType.STRING)
	{
		cell.setTooltip(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.TIME && answer.getTimeAnswer() != null)
	{
		cell.setTooltip(answer.getTimeAnswer().toString());
	}
	else if(cell.getType() == DynamicCellType.WRAPTEXT)
	{
		cell.setTooltip(answer.getStringAnswer());
	}
	
}
 
Example 14
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void addThisRowsCarePlanInterventionAndOtherInterventionstoo(DynamicGridRow row) 
{
	// Check to see if the CarePlan is already in collection
	for (int i = 0 ; i < form.getLocalContext().getCarePlansToSave().size() ; i++)
	{
		if (form.getLocalContext().getCarePlansToSave().get(i).getID_CarePlan().equals(((CarePlan)row.getValue()).getID_CarePlan()))
			return;
	}
	
	CarePlan voRowCarePlan = ((CarePlan)row.getValue());
	
	//Look thru grid find rows for suppplied CarePlan - voRowCarePlan
	for (int iRow = 0 ; iRow < form.dyngrdInterventions().getRows().size() ; iRow++)
	{
		if (((CarePlan)form.dyngrdInterventions().getRows().get(iRow).getValue()).getID_CarePlan().equals(voRowCarePlan.getID_CarePlan()))
		{
			CarePlanInterventions voRowIntervention = (CarePlanInterventions)form.dyngrdInterventions().getRows().get(iRow).getIdentifier();

			// see if associated Intervention - Row is ticked
			DynamicGridCell cellComp = form.dyngrdInterventions().getRows().get(iRow).getCells().get(getColumn(COLCOMPLETED));
			if (cellComp != null 
				&& cellComp.getType() == DynamicCellType.BOOL
				&& (! cellComp.isReadOnly())
				&& ((Boolean) cellComp.getValue()) )
			{
				//look for matching intervention in CarePlan - and set Stpooed INfo
				for( int iInter = 0 ; iInter < voRowCarePlan.getInterventions().size() ; iInter++)
				{
					if (voRowCarePlan.getInterventions().get(iInter).getID_CarePlanIntervention().equals(voRowIntervention.getID_CarePlanIntervention()))
					{
						voRowCarePlan.getInterventions().get(iInter).setStopBy((HcpLiteVo)domain.getHcpLiteUser());
						voRowCarePlan.getInterventions().get(iInter).setStopDate(new Date());
						//WDEV-12155 
						voRowCarePlan.getInterventions().get(iInter).setActive(false);
					}
				}
			}
		}
	}
	form.getLocalContext().getCarePlansToSave().add(voRowCarePlan);
}
 
Example 15
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void setCellAnswer(DynamicGridCell cell, Answer_DetailsVo answer)
{
	if (cell == null)
		return;
	if (answer == null)
		return;
	Question_AnswerTypeVo answerType = null;
	if (cell.getIdentifier() instanceof Question_AnswerTypeVo)
		answerType = (Question_AnswerTypeVo) cell.getIdentifier();
	else if (cell.getIdentifier() instanceof Answer_CellData)
		answerType = ((Answer_CellData) cell.getIdentifier()).getConfigData();

	cell.setIdentifier(new Answer_CellData(answerType, answer));

	if (cell.getType() == DynamicCellType.ANSWER)
	{
		if (answer.getBoolValueAnswerIsNotNull())
			cell.setValue(answer.getBoolValueAnswer().booleanValue() ? this.optionYes : this.optionNo);
		else
			cell.setValue(null);
	}
	else if (cell.getType() == DynamicCellType.COMMENT)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if (cell.getType() == DynamicCellType.DATE)
	{
		cell.setValue(answer.getDateAnswer());
	}
	else if (cell.getType() == DynamicCellType.PARTIALDATE)
	{
		cell.setValue(answer.getPartialDate());
	}
	else if (cell.getType() == DynamicCellType.DECIMAL)
	{
		cell.setValue(answer.getDecimalAnswer());
	}
	else if (cell.getType() == DynamicCellType.ENUMERATION)
	{
		cell.setValue(answer.getPicklist());
	}
	else if (cell.getType() == DynamicCellType.INT)
	{
		cell.setValue(answer.getIntegerAnswer());
	}
	else if (cell.getType() == DynamicCellType.STRING)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if (cell.getType() == DynamicCellType.TIME)
	{
		cell.setValue(answer.getTimeAnswer());
	}
	else if (cell.getType() == DynamicCellType.WRAPTEXT)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if (cell.getType() == DynamicCellType.MULTISELECT)
	{
		setCellMultiAnswer(cell, answer.getMultiSelectAnswers());
	}
}
 
Example 16
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View Source Code Vote up 4 votes
private void setCellAnswer(DynamicGridCell cell, Answer_DetailsVo answer)
{
	if (cell == null)
		return;
	if (answer == null)
		return;

	Question_AnswerTypeVo answerType = null;

	if (cell.getIdentifier() instanceof Question_AnswerTypeVo)
		answerType = (Question_AnswerTypeVo) cell.getIdentifier();
	else if (cell.getIdentifier() instanceof AnswerCellData)
		answerType = ((Answer_CellData) cell.getIdentifier()).getConfigData();

	cell.setIdentifier(new Answer_CellData(answerType, answer));
	
	if(cell.getType() == DynamicCellType.ANSWER)
	{
		if(answer.getBoolValueAnswerIsNotNull())
			cell.setValue(answer.getBoolValueAnswer().booleanValue() ? this.optionYes : this.optionNo);
		else
			cell.setValue(null);
	}
	else if(cell.getType() == DynamicCellType.COMMENT)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.DATE)
	{
		cell.setValue(answer.getDateAnswer());
	}
	else if(cell.getType() == DynamicCellType.PARTIALDATE)
	{
		cell.setValue(answer.getPartialDate());
	}
	else if(cell.getType() == DynamicCellType.DECIMAL)
	{
		cell.setValue(answer.getDecimalAnswer());
	}
	else if(cell.getType() == DynamicCellType.ENUMERATION)
	{
		cell.setValue(answer.getPicklist());			
	}
	else if(cell.getType() == DynamicCellType.INT)
	{
		cell.setValue(answer.getIntegerAnswer());
	}
	else if(cell.getType() == DynamicCellType.STRING)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.TIME)
	{
		cell.setValue(answer.getTimeAnswer());
	}
	else if(cell.getType() == DynamicCellType.WRAPTEXT)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.MULTISELECT)
	{			
		setCellMultiAnswer(cell, answer.getMultiSelectAnswers());
	}
}
 
Example 17
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View Source Code Vote up 4 votes
public void setCellAnswer(DynamicGridCell cell, AnswerDetailsVo answer)
{
	if(cell == null)
		return;
	if(answer == null)
		return;
	
	if(cell.getType() == DynamicCellType.ANSWER)
	{
		if(answer.getBoolValueAnswerIsNotNull())
			cell.setValue(answer.getBoolValueAnswer().booleanValue() ? this.optionYes : this.optionNo);
		else
			cell.setValue(null);
	}
	else if(cell.getType() == DynamicCellType.COMMENT)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.DATE)
	{
		cell.setValue(answer.getDateAnswer());
	}
	else if(cell.getType() == DynamicCellType.PARTIALDATE)
	{
		cell.setValue(answer.getPartialDate());
	}
	else if(cell.getType() == DynamicCellType.DECIMAL)
	{
		cell.setValue(answer.getDecimalAnswer());
	}
	else if(cell.getType() == DynamicCellType.ENUMERATION)
	{
		cell.setValue(answer.getPicklist());			
	}
	else if(cell.getType() == DynamicCellType.INT)
	{
		cell.setValue(answer.getIntegerAnswer());
	}
	else if(cell.getType() == DynamicCellType.STRING)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.TIME)
	{
		cell.setValue(answer.getTimeAnswer());
	}
	else if(cell.getType() == DynamicCellType.WRAPTEXT)
	{
		cell.setValue(answer.getStringAnswer());
	}
	else if(cell.getType() == DynamicCellType.MULTISELECT)
	{			
		setCellMultiAnswer(cell, answer.getMultiSelectAnswers());
	}
}