Java Code Examples for ims.framework.enumerations.DynamicCellType.BOOL

The following are Jave code examples for showing how to use BOOL of the ims.framework.enumerations.DynamicCellType class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   Source Code and License 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 2
Project: AvoinApotti   File: Logic.java   Source Code and License 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 3
Project: AvoinApotti   File: Logic.java   Source Code and License 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 4
Project: AvoinApotti   File: Logic.java   Source Code and License 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 5
Project: AvoinApotti   File: ReportSeedsHelper.java   Source Code and License Vote up 5 votes
public DynamicCellType getCellType(ReportSeedParsedVo voReportSeed)
{
	if (voReportSeed == null)
		return DynamicCellType.LABEL;

	String dataType = voReportSeed.getType();
	if (dataType == null)
		return DynamicCellType.LABEL;

	if (dataType.equals(INTEGER) || dataType.equals(BIG_INTEGER) || dataType.equals(SHORT) || dataType.equals(LONG))
	{
		DynamicCellType defaultType = DynamicCellType.INT;

		if (dataType.equals(INTEGER))
			defaultType = getBoReportType(voReportSeed);

		return defaultType;
	}

	if (dataType.equals(BOOOLEAN))
		return DynamicCellType.BOOL;

	if (dataType.equals(STRING))
		return DynamicCellType.STRING;

	if (dataType.equals(BIG_DECIMAL) || dataType.equals(FLOAT) || dataType.equals(DOUBLE))
		return DynamicCellType.DECIMAL;

	if (dataType.equals(SQL_DATE))
		return DynamicCellType.DATE;

	if (dataType.equals(UTIL_DATE))
		return DynamicCellType.DATETIME;
	
	if (dataType.equals(SQL_TIME))
		return DynamicCellType.TIME;

	return DynamicCellType.LABEL;
}
 
Example 6
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License Vote up 5 votes
private boolean addAnswers(DynamicGridRow row, DynamicGridColumn[] columns, GeneralQuestionAnswerVo question)
{
	if(row == null || question == null || question.getIQuestionTypeQuestion() == null ||  question.getIQuestionTypeQuestion().getAnswerTypes() == null  || question.getIQuestionTypeQuestion().getAnswerTypes().size() == 0)
		return false;
		
	for(int x = 0; x < question.getIQuestionTypeQuestion().getAnswerTypes().size(); x++)
	{
		QuestionAnswerTypeVo answer = question.getIQuestionTypeQuestion().getAnswerTypes().get(x);
		if(answer != null)
		{
			QuestionAnswerType type = answer.getAnswerType();
			DynamicCellType cellType = getQuestionAnswerType(type);
			DynamicGridCell answerCell = row.getCells().newCell(columns[x], getQuestionAnswerType(type));
			answerCell.setWidth(getAnswerCellWidth(cellType));
			answerCell.setReadOnly(false);
			
			setAnswerCellValue(answerCell, answer);
			
			if(cellType == DynamicCellType.DYNAMICLABEL || cellType == DynamicCellType.BOOL)
				answerCell.setDecoratorType(DynamicCellDecoratorMode.NEVER);
			else
				answerCell.setDecoratorType(DynamicCellDecoratorMode.ALWAYS);
			
			answerCell.setTooltip(getAnswerCellTooltip(cellType));
			answerCell.setIdentifier(answer);
			
			addAnswerData(row, question);
		}
	}
	
	return true;		
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 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);
}