Java Code Examples for ims.core.vo.AssessmentQuestionGroupVo

The following are top voted examples for showing how to use ims.core.vo.AssessmentQuestionGroupVo. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private String getGroupTooltip(AssessmentQuestionGroupVo group)
{
	StringBuffer sb = new StringBuffer();
	
	sb.append("<b>Name: </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"); 
	sb.append(group.getName());
	sb.append(CR);
	sb.append("<b>Description: </b>&nbsp;"); 
	sb.append(group.getDescriptionIsNotNull() ? group.getDescription() :"");
	sb.append(CR);
	sb.append("<b>Status: </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	sb.append(group.getActiveStatusIsNotNull() ? group.getActiveStatus().getText() : "");
	sb.append(CR);
	sb.append("<b>Score:</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	sb.append(group.getGroupScoreIsNotNull() ? group.getGroupScore().toString() : "");
	
	return sb.toString();
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void refreshGroupGrid()
{
	form.lyrTabs().tabGroups().grdGroups().getRows().clear();
	AssessmentQuestionGroupVoCollection voColl = form.getLocalContext().getHiddenGroups();
	for (int i = 0; voColl != null && i < voColl.size(); i++)
	{
		AssessmentQuestionGroupVo voAssessQGroup = voColl.get(i);
		GenForm.lyrTabsLayer.tabGroupsContainer.grdGroupsRow row = form.lyrTabs().tabGroups().grdGroups().getRows().newRow();

		row.setcolName(voAssessQGroup.getName());
		row.setcolDescription(voAssessQGroup.getDescription());
		row.setcolStatus(voAssessQGroup.getActiveStatus());
		row.setcolScore(voAssessQGroup.getGroupScoreIsNotNull() ? voAssessQGroup.getGroupScore().toString() : "");
		row.setValue(voAssessQGroup);
	}
	
	refreshGroupContextMenu();
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private DynamicGridRow findRow(AssessmentQuestionGroupVo assessmentQuestionGroup)
{
	if (assessmentQuestionGroup == null)
		return null;

	for (int x = 0; x < this.grid.getRows().size(); x++)
	{
		DynamicGridRow row = this.grid.getRows().get(x);
		if (row.getIdentifier() != null)
		{
			if (row.getIdentifier() instanceof AssessmentQuestionGroupVo)
			{
				if (row.getIdentifier().equals(assessmentQuestionGroup))
					return row;
			}
			else if (row.getIdentifier() instanceof GroupRowData)
			{
				if (((GroupRowData) row.getIdentifier()).getConfigGroup().equals(assessmentQuestionGroup))
					return row;
			}
		}
	}

	return null;
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo getInstAnswer(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup, AssessmentQuestionVo configQuestion)
{
	if (data == null || configGroup == null || configQuestion == null)
		return null;

	PatientAssessmentGroupVo instGroup = getInstGroup(data, configGroup);
	if (instGroup == null)
		return null;

	for (int x = 0; x < instGroup.getAssessmentAnswers().size(); x++)
	{
		if (instGroup.getAssessmentAnswers().get(x) != null && instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion() != null && instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion().equals(configQuestion))
		{
			return instGroup.getAssessmentAnswers().get(x);
		}
	}

	return null;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private AssessmentQuestionVoCollection buildExistingQuestions(PatientAssessmentDataVo data, AssessmentQuestionGroupVo group) throws PresentationLogicException
{
	if (data.getAnswerGroups() == null || group == null)
		return new AssessmentQuestionVoCollection();
	checkDataIntegrity(data);

	AssessmentQuestionVoCollection result = new AssessmentQuestionVoCollection();

	for (int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		if (data.getAnswerGroups().get(x).getAssessmentQuestionGroup() != null && data.getAnswerGroups().get(x).getAssessmentQuestionGroup().equals(group))
		{
			PatientAssessmentQuestionVoCollection answers = sortAnswersBySequence(data.getAnswerGroups().get(x).getAssessmentAnswers());
			for (int y = 0; y < answers.size(); y++)
			{
				result.add(data.getAnswerGroups().get(x).getAssessmentAnswers().get(y).getAssessmentQuestion());
			}
		}
	}

	return result;
}
 
Example 6
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private DynamicGridRow findRow(AssessmentQuestionGroupVo assessmentQuestionGroup)
{
	if(assessmentQuestionGroup == null)
		return null;
	
	for(int x = 0; x < this.grid.getRows().size(); x++)
	{
		DynamicGridRow row = this.grid.getRows().get(x);
			if(row.getIdentifier() != null)
			{
				if(row.getIdentifier() instanceof AssessmentQuestionGroupVo)
		{
			if(row.getIdentifier().equals(assessmentQuestionGroup))
				return row;
		}
				else if(row.getIdentifier() instanceof GroupRowData)
				{
					if(((GroupRowData)row.getIdentifier()).getConfigGroup().equals(assessmentQuestionGroup))
						return row; 
				}
			}
	}
	
	return null;
}
 
Example 7
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientAssessmentGroupVo getInstGroup(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup)
{
	if(data == null || configGroup == null)
		return null;
	
	for(int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		if(data.getAnswerGroups().get(x) != null
				&& data.getAnswerGroups().get(x).getAssessmentQuestionGroup() != null
				&& data.getAnswerGroups().get(x).getAssessmentQuestionGroup().equals(configGroup))
		{
			return data.getAnswerGroups().get(x);
		}
	}
	
	return null;
}
 
Example 8
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo getInstAnswer(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup, AssessmentQuestionVo configQuestion)
{
	if(data == null || configGroup == null || configQuestion == null)
		return null; 
	
	PatientAssessmentGroupVo instGroup = getInstGroup(data, configGroup);
	if(instGroup == null)
		return null;
	
	for(int x = 0; x < instGroup.getAssessmentAnswers().size(); x++)
	{
		if(instGroup.getAssessmentAnswers().get(x) != null
				&& instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion() != null
				&& instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion().equals(configQuestion))
		{
			return instGroup.getAssessmentAnswers().get(x);
		}				
	}
	
	return null;
}
 
Example 9
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private AssessmentQuestionVoCollection buildExistingQuestions(PatientAssessmentDataVo data, AssessmentQuestionGroupVo group) throws PresentationLogicException
{
	if(data.getAnswerGroups() == null || group == null)
		return new AssessmentQuestionVoCollection();
	checkDataIntegrity(data);		
	
	AssessmentQuestionVoCollection result = new AssessmentQuestionVoCollection();
	
	for(int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		if(data.getAnswerGroups().get(x).getAssessmentQuestionGroup() != null
				&& data.getAnswerGroups().get(x).getAssessmentQuestionGroup().equals(group))
		{
			PatientAssessmentQuestionVoCollection answers = sortAnswersBySequence(data.getAnswerGroups().get(x).getAssessmentAnswers()); 
			for(int y = 0; y < answers.size(); y++)
			{
				result.add(data.getAnswerGroups().get(x).getAssessmentAnswers().get(y).getAssessmentQuestion());
			}
		}
	}
	
	return result;
}
 
Example 10
Project: AvoinApotti   File: StructuredAssessmentsHelper.java   View source code 6 votes vote down vote up
public void updateGroupRow(AssessmentQuestionGroupVo group, DynamicGridRow row, boolean createNewQuestionGroupCell)
{
	if(group == null || row == null)
		return;
	
	if(createNewQuestionGroupCell)
		row.getCells().newCell(getGridColumn(COLUMN_QUESTIONGROUP), DynamicCellType.STRING);
	row.setValue(group);
	row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)).setValue(group.getName());
	row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)).setReadOnly(true);
	createToolTip(row, getGridColumn(COLUMN_QUESTIONGROUP), getGroupTooltip(group));
	row.setBold(true);
	row.setBackColor(Color.Beige);
	row.setExpanded(true);
	
	dynGrid.setValue(row.getValue());
}
 
Example 11
Project: AvoinApotti   File: StructuredAssessmentsHelper.java   View source code 6 votes vote down vote up
private String getGroupTooltip(AssessmentQuestionGroupVo group)
{
	StringBuffer sb = new StringBuffer();

	sb.append("<b>Name: </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	sb.append(group.getName());
	sb.append(CR);
	sb.append("<b>Description: </b>&nbsp;");
	sb.append(group.getDescription());
	sb.append(CR);
	sb.append("<b>Status: </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	sb.append(group.getActiveStatusIsNotNull() ? group.getActiveStatus().getText() : "");
	sb.append(CR);
	sb.append("<b>Score:</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	sb.append(group.getGroupScoreIsNotNull() ? group.getGroupScore().toString() : "");

	return sb.toString();
}
 
Example 12
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private String getGroupTooltip(AssessmentQuestionGroupVo group)
{
	StringBuffer sb = new StringBuffer();
	
	sb.append("<b>Name: </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"); 
	sb.append(group.getName());
	sb.append(CR);
	sb.append("<b>Description: </b>&nbsp;"); 
	sb.append(group.getDescriptionIsNotNull() ? group.getDescription() :"");
	sb.append(CR);
	sb.append("<b>Status: </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	sb.append(group.getActiveStatusIsNotNull() ? group.getActiveStatus().getText() : "");
	sb.append(CR);
	sb.append("<b>Score:</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	sb.append(group.getGroupScoreIsNotNull() ? group.getGroupScore().toString() : "");
	
	return sb.toString();
}
 
Example 13
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo getInstAnswer(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup, AssessmentQuestionVo configQuestion)
{
	if (data == null || configGroup == null || configQuestion == null)
		return null;

	PatientAssessmentGroupVo instGroup = getInstGroup(data, configGroup);
	if (instGroup == null)
		return null;

	for (int x = 0; x < instGroup.getAssessmentAnswers().size(); x++)
	{
		if (instGroup.getAssessmentAnswers().get(x) != null && instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion() != null && instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion().equals(configQuestion))
		{
			return instGroup.getAssessmentAnswers().get(x);
		}
	}

	return null;
}
 
Example 14
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void refreshGroupGrid()
{
	form.lyrTabs().tabGroups().grdGroups().getRows().clear();
	AssessmentQuestionGroupVoCollection voColl = form.getLocalContext().getHiddenGroups();
	for (int i = 0; voColl != null && i < voColl.size(); i++)
	{
		AssessmentQuestionGroupVo voAssessQGroup = voColl.get(i);
		GenForm.lyrTabsLayer.tabGroupsContainer.grdGroupsRow row = form.lyrTabs().tabGroups().grdGroups().getRows().newRow();

		row.setcolName(voAssessQGroup.getName());
		row.setcolDescription(voAssessQGroup.getDescription());
		row.setcolStatus(voAssessQGroup.getActiveStatus());
		row.setcolScore(voAssessQGroup.getGroupScoreIsNotNull() ? voAssessQGroup.getGroupScore().toString() : "");
		row.setValue(voAssessQGroup);
	}
	
	refreshGroupContextMenu();
}
 
Example 15
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private DynamicGridRow findRow(AssessmentQuestionGroupVo assessmentQuestionGroup)
{
	if (assessmentQuestionGroup == null)
		return null;

	for (int x = 0; x < this.grid.getRows().size(); x++)
	{
		DynamicGridRow row = this.grid.getRows().get(x);
		if (row.getIdentifier() != null)
		{
			if (row.getIdentifier() instanceof AssessmentQuestionGroupVo)
			{
				if (row.getIdentifier().equals(assessmentQuestionGroup))
					return row;
			}
			else if (row.getIdentifier() instanceof GroupRowData)
			{
				if (((GroupRowData) row.getIdentifier()).getConfigGroup().equals(assessmentQuestionGroup))
					return row;
			}
		}
	}

	return null;
}
 
Example 16
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo getInstAnswer(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup, AssessmentQuestionVo configQuestion)
{
	if (data == null || configGroup == null || configQuestion == null)
		return null;

	PatientAssessmentGroupVo instGroup = getInstGroup(data, configGroup);
	if (instGroup == null)
		return null;

	for (int x = 0; x < instGroup.getAssessmentAnswers().size(); x++)
	{
		if (instGroup.getAssessmentAnswers().get(x) != null && instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion() != null && instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion().equals(configQuestion))
		{
			return instGroup.getAssessmentAnswers().get(x);
		}
	}

	return null;
}
 
Example 17
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private AssessmentQuestionVoCollection buildExistingQuestions(PatientAssessmentDataVo data, AssessmentQuestionGroupVo group) throws PresentationLogicException
{
	if (data.getAnswerGroups() == null || group == null)
		return new AssessmentQuestionVoCollection();
	checkDataIntegrity(data);

	AssessmentQuestionVoCollection result = new AssessmentQuestionVoCollection();

	for (int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		if (data.getAnswerGroups().get(x).getAssessmentQuestionGroup() != null && data.getAnswerGroups().get(x).getAssessmentQuestionGroup().equals(group))
		{
			PatientAssessmentQuestionVoCollection answers = sortAnswersBySequence(data.getAnswerGroups().get(x).getAssessmentAnswers());
			for (int y = 0; y < answers.size(); y++)
			{
				result.add(data.getAnswerGroups().get(x).getAssessmentAnswers().get(y).getAssessmentQuestion());
			}
		}
	}

	return result;
}
 
Example 18
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientAssessmentGroupVo getInstGroup(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup)
{
	if(data == null || configGroup == null)
		return null;
	
	for(int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		if(data.getAnswerGroups().get(x) != null
				&& data.getAnswerGroups().get(x).getAssessmentQuestionGroup() != null
				&& data.getAnswerGroups().get(x).getAssessmentQuestionGroup().equals(configGroup))
		{
			return data.getAnswerGroups().get(x);
		}
	}
	
	return null;
}
 
Example 19
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private AssessmentQuestionVoCollection buildExistingQuestions(PatientAssessmentDataVo data, AssessmentQuestionGroupVo group) throws PresentationLogicException
{
	if(data.getAnswerGroups() == null || group == null)
		return new AssessmentQuestionVoCollection();
	checkDataIntegrity(data);		
	
	AssessmentQuestionVoCollection result = new AssessmentQuestionVoCollection();
	
	for(int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		if(data.getAnswerGroups().get(x).getAssessmentQuestionGroup() != null
				&& data.getAnswerGroups().get(x).getAssessmentQuestionGroup().equals(group))
		{
			PatientAssessmentQuestionVoCollection answers = sortAnswersBySequence(data.getAnswerGroups().get(x).getAssessmentAnswers()); 
			for(int y = 0; y < answers.size(); y++)
			{
				result.add(data.getAnswerGroups().get(x).getAssessmentAnswers().get(y).getAssessmentQuestion());
			}
		}
	}
	
	return result;
}
 
Example 20
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   View source code 6 votes vote down vote up
public void updateGroupRow(AssessmentQuestionGroupVo group, DynamicGridRow row, boolean createNewQuestionGroupCell)
{
	if(group == null || row == null)
		return;
	
	if(createNewQuestionGroupCell)
		row.getCells().newCell(getGridColumn(COLUMN_QUESTIONGROUP), DynamicCellType.STRING);
	row.setValue(group);
	row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)).setValue(group.getName());
	row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)).setReadOnly(true);
	createToolTip(row, getGridColumn(COLUMN_QUESTIONGROUP), getGroupTooltip(group));
	row.setBold(true);
	row.setBackColor(Color.Beige);
	row.setExpanded(true);
	
	dynGrid.setValue(row.getValue());
}
 
Example 21
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   View source code 6 votes vote down vote up
private String getGroupTooltip(AssessmentQuestionGroupVo group)
{
	StringBuffer sb = new StringBuffer();

	sb.append("<b>Name: </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	sb.append(group.getName());
	sb.append(CR);
	sb.append("<b>Description: </b>&nbsp;");
	sb.append(group.getDescription());
	sb.append(CR);
	sb.append("<b>Status: </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	sb.append(group.getActiveStatusIsNotNull() ? group.getActiveStatus().getText() : "");
	sb.append(CR);
	sb.append("<b>Score:</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	sb.append(group.getGroupScoreIsNotNull() ? group.getGroupScore().toString() : "");

	return sb.toString();
}
 
Example 22
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private String getGroupTooltip(AssessmentQuestionGroupVo group)
{
	StringBuffer sb = new StringBuffer();
	
	sb.append("<b>Name: </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"); 
	sb.append(group.getName());
	sb.append(CR);
	sb.append("<b>Description: </b>&nbsp;"); 
	sb.append(group.getDescriptionIsNotNull() ? group.getDescription() :"");
	sb.append(CR);
	sb.append("<b>Status: </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	sb.append(group.getActiveStatusIsNotNull() ? group.getActiveStatus().getText() : "");
	sb.append(CR);
	sb.append("<b>Score:</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	sb.append(group.getGroupScoreIsNotNull() ? group.getGroupScore().toString() : "");
	
	return sb.toString();
}
 
Example 23
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private String getGroupTooltip(AssessmentQuestionGroupVo group)
{
	StringBuffer sb = new StringBuffer();
	
	sb.append("<b>Name: </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"); 
	sb.append(group.getName());
	sb.append(CR);
	sb.append("<b>Description: </b>&nbsp;"); 
	sb.append(group.getDescriptionIsNotNull() ? group.getDescription() :"");
	sb.append(CR);
	sb.append("<b>Status: </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	sb.append(group.getActiveStatusIsNotNull() ? group.getActiveStatus().getText() : "");
	sb.append(CR);
	sb.append("<b>Score:</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	sb.append(group.getGroupScoreIsNotNull() ? group.getGroupScore().toString() : "");
	
	return sb.toString();
}
 
Example 24
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void refreshGroupGrid()
{
	form.lyrTabs().tabGroups().grdGroups().getRows().clear();
	AssessmentQuestionGroupVoCollection voColl = form.getLocalContext().getHiddenGroups();
	for (int i = 0; voColl != null && i < voColl.size(); i++)
	{
		AssessmentQuestionGroupVo voAssessQGroup = voColl.get(i);
		GenForm.lyrTabsLayer.tabGroupsContainer.grdGroupsRow row = form.lyrTabs().tabGroups().grdGroups().getRows().newRow();

		row.setcolName(voAssessQGroup.getName());
		row.setcolDescription(voAssessQGroup.getDescription());
		row.setcolStatus(voAssessQGroup.getActiveStatus());
		row.setcolScore(voAssessQGroup.getGroupScoreIsNotNull() ? voAssessQGroup.getGroupScore().toString() : "");
		row.setValue(voAssessQGroup);
	}
	
	refreshGroupContextMenu();
}
 
Example 25
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private DynamicGridRow findRow(AssessmentQuestionGroupVo assessmentQuestionGroup)
{
	if (assessmentQuestionGroup == null)
		return null;

	for (int x = 0; x < this.grid.getRows().size(); x++)
	{
		DynamicGridRow row = this.grid.getRows().get(x);
		if (row.getIdentifier() != null)
		{
			if (row.getIdentifier() instanceof AssessmentQuestionGroupVo)
			{
				if (row.getIdentifier().equals(assessmentQuestionGroup))
					return row;
			}
			else if (row.getIdentifier() instanceof GroupRowData)
			{
				if (((GroupRowData) row.getIdentifier()).getConfigGroup().equals(assessmentQuestionGroup))
					return row;
			}
		}
	}

	return null;
}
 
Example 26
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo getInstAnswer(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup, AssessmentQuestionVo configQuestion)
{
	if (data == null || configGroup == null || configQuestion == null)
		return null;

	PatientAssessmentGroupVo instGroup = getInstGroup(data, configGroup);
	if (instGroup == null)
		return null;

	for (int x = 0; x < instGroup.getAssessmentAnswers().size(); x++)
	{
		if (instGroup.getAssessmentAnswers().get(x) != null && instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion() != null && instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion().equals(configQuestion))
		{
			return instGroup.getAssessmentAnswers().get(x);
		}
	}

	return null;
}
 
Example 27
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private AssessmentQuestionVoCollection buildExistingQuestions(PatientAssessmentDataVo data, AssessmentQuestionGroupVo group) throws PresentationLogicException
{
	if (data.getAnswerGroups() == null || group == null)
		return new AssessmentQuestionVoCollection();
	checkDataIntegrity(data);

	AssessmentQuestionVoCollection result = new AssessmentQuestionVoCollection();

	for (int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		if (data.getAnswerGroups().get(x).getAssessmentQuestionGroup() != null && data.getAnswerGroups().get(x).getAssessmentQuestionGroup().equals(group))
		{
			PatientAssessmentQuestionVoCollection answers = sortAnswersBySequence(data.getAnswerGroups().get(x).getAssessmentAnswers());
			for (int y = 0; y < answers.size(); y++)
			{
				result.add(data.getAnswerGroups().get(x).getAssessmentAnswers().get(y).getAssessmentQuestion());
			}
		}
	}

	return result;
}
 
Example 28
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientAssessmentGroupVo getInstGroup(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup)
{
	if(data == null || configGroup == null)
		return null;
	
	for(int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		if(data.getAnswerGroups().get(x) != null
				&& data.getAnswerGroups().get(x).getAssessmentQuestionGroup() != null
				&& data.getAnswerGroups().get(x).getAssessmentQuestionGroup().equals(configGroup))
		{
			return data.getAnswerGroups().get(x);
		}
	}
	
	return null;
}
 
Example 29
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo getInstAnswer(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup, AssessmentQuestionVo configQuestion)
{
	if(data == null || configGroup == null || configQuestion == null)
		return null; 
	
	PatientAssessmentGroupVo instGroup = getInstGroup(data, configGroup);
	if(instGroup == null)
		return null;
	
	for(int x = 0; x < instGroup.getAssessmentAnswers().size(); x++)
	{
		if(instGroup.getAssessmentAnswers().get(x) != null
				&& instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion() != null
				&& instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion().equals(configQuestion))
		{
			return instGroup.getAssessmentAnswers().get(x);
		}				
	}
	
	return null;
}
 
Example 30
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private AssessmentQuestionVoCollection buildExistingQuestions(PatientAssessmentDataVo data, AssessmentQuestionGroupVo group) throws PresentationLogicException
{
	if(data.getAnswerGroups() == null || group == null)
		return new AssessmentQuestionVoCollection();
	checkDataIntegrity(data);		
	
	AssessmentQuestionVoCollection result = new AssessmentQuestionVoCollection();
	
	for(int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		if(data.getAnswerGroups().get(x).getAssessmentQuestionGroup() != null
				&& data.getAnswerGroups().get(x).getAssessmentQuestionGroup().equals(group))
		{
			PatientAssessmentQuestionVoCollection answers = sortAnswersBySequence(data.getAnswerGroups().get(x).getAssessmentAnswers()); 
			for(int y = 0; y < answers.size(); y++)
			{
				result.add(data.getAnswerGroups().get(x).getAssessmentAnswers().get(y).getAssessmentQuestion());
			}
		}
	}
	
	return result;
}
 
Example 31
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo getInstAnswer(PatientAssessmentDataVo data, AssessmentQuestionGroupVo configGroup, AssessmentQuestionVo configQuestion)
{
	if(data == null || configGroup == null || configQuestion == null)
		return null; 
	
	PatientAssessmentGroupVo instGroup = getInstGroup(data, configGroup);
	if(instGroup == null)
		return null;
	
	for(int x = 0; x < instGroup.getAssessmentAnswers().size(); x++)
	{
		if(instGroup.getAssessmentAnswers().get(x) != null
				&& instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion() != null
				&& instGroup.getAssessmentAnswers().get(x).getAssessmentQuestion().equals(configQuestion))
		{
			return instGroup.getAssessmentAnswers().get(x);
		}				
	}
	
	return null;
}
 
Example 32
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   View source code 6 votes vote down vote up
public void updateGroupRow(AssessmentQuestionGroupVo group, DynamicGridRow row, boolean createNewQuestionGroupCell)
{
	if(group == null || row == null)
		return;
	
	if(createNewQuestionGroupCell)
		row.getCells().newCell(getGridColumn(COLUMN_QUESTIONGROUP), DynamicCellType.STRING);
	row.setValue(group);
	row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)).setValue(group.getName());
	row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)).setReadOnly(true);
	createToolTip(row, getGridColumn(COLUMN_QUESTIONGROUP), getGroupTooltip(group));
	row.setBold(true);
	row.setBackColor(Color.Beige);
	row.setExpanded(true);
	
	dynGrid.setValue(row.getValue());
}
 
Example 33
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void refreshGroupGrid()
{
	form.lyrTabs().tabGroups().grdGroups().getRows().clear();
	AssessmentQuestionGroupVoCollection voColl = form.getLocalContext().getHiddenGroups();
	for (int i = 0; voColl != null && i < voColl.size(); i++)
	{
		AssessmentQuestionGroupVo voAssessQGroup = voColl.get(i);
		GenForm.lyrTabsLayer.tabGroupsContainer.grdGroupsRow row = form.lyrTabs().tabGroups().grdGroups().getRows().newRow();

		row.setcolName(voAssessQGroup.getName());
		row.setcolDescription(voAssessQGroup.getDescription());
		row.setcolStatus(voAssessQGroup.getActiveStatus());
		row.setcolScore(voAssessQGroup.getGroupScoreIsNotNull() ? voAssessQGroup.getGroupScore().toString() : "");
		row.setValue(voAssessQGroup);
	}
	
	refreshGroupContextMenu();
}
 
Example 34
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   View source code 6 votes vote down vote up
private String getGroupTooltip(AssessmentQuestionGroupVo group)
{
	StringBuffer sb = new StringBuffer();

	sb.append("<b>Name: </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	sb.append(group.getName());
	sb.append(CR);
	sb.append("<b>Description: </b>&nbsp;");
	sb.append(group.getDescription());
	sb.append(CR);
	sb.append("<b>Status: </b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	sb.append(group.getActiveStatusIsNotNull() ? group.getActiveStatus().getText() : "");
	sb.append(CR);
	sb.append("<b>Score:</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
	sb.append(group.getGroupScoreIsNotNull() ? group.getGroupScore().toString() : "");

	return sb.toString();
}
 
Example 35
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void open()
{
	super.clearScreen();
	AssessmentQuestionGroupVo group = form.getGlobalContext().Core.getSelectedQuestionGroup();

	if(group != null)
	{
		super.populateScreenFromData(group);
	}
	else
	{
		//WDEV-1751 - when adding a new group can we default the 'status combobox' to active. 
		form.cmbStatus().setValue(ims.core.vo.lookups.PreActiveActiveInactiveStatus.ACTIVE);
	}
}
 
Example 36
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private UserAssessmentVo getFilteredOnRoleUserAssessment(UserAssessmentVo voUserAssesmentOriginal, AssessmentRoleVo voAssessmentRole)
{
	if(voUserAssesmentOriginal == null)
		return voUserAssesmentOriginal;
	
	UserAssessmentVo voUserAssesment = (UserAssessmentVo) voUserAssesmentOriginal.clone();
	if (voUserAssesment != null && voAssessmentRole != null && voUserAssesment.getAssessmentRoles().size() > 0)
	{
		for (int i = 0; voUserAssesment.getQuestionGroupsIsNotNull() && i < voUserAssesment.getQuestionGroups().size(); i++)
		{
			boolean deleted = true;
			while (deleted)
			{
				deleted = false;
				AssessmentQuestionGroupVo voAssessQuestion = voUserAssesment.getQuestionGroups().get(i);
				for (int j = 0; j < voAssessQuestion.getQuestions().size(); j++)
				{
					AssessmentQuestionVo assessmentQuestionVo = voAssessQuestion.getQuestions().get(j);
					boolean found = isRoleAdded(voAssessmentRole, assessmentQuestionVo);

					if (found == false)
					{
						voAssessQuestion.getQuestions().remove(j);
						deleted = true;
						break;
					}
				}
			}
		}
	}

	return voUserAssesment;
}
 
Example 37
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void updateGroupRow(AssessmentQuestionGroupVo group, DynamicGridRow row)
{
	row.setValue(group);
	row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)).setValue(group.getName());
	row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)).setReadOnly(true);
	//createToolTip(row, getGridColumn(COLUMN_QUESTIONGROUP), "Description: " + group.getDescription() + CR + "Status: " + (group.getActiveStatusIsNotNull() ? group.getActiveStatus().getText() : "") + CR + "Score: " + (group.getGroupScoreIsNotNull() ? group.getGroupScore().toString() : ""));
	createToolTip(row, getGridColumn(COLUMN_QUESTIONGROUP), getGroupTooltip(group));
	row.setBold(true);
	row.setBackColor(Color.Beige);
	row.setExpanded(true);
	
	form.lyrTabs().tabAssessments().dyngrdDetails().setValue(row.getValue());
}
 
Example 38
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private boolean populateGroupCollectionFromScreenMultipleGroupNoFlat(UserAssessmentVo assessment)
{
	assessment.getQuestionGroups().clear();
	int seqNo = 1;
	for(int i = 0; i < form.lyrTabs().tabAssessments().dyngrdDetails().getRows().size(); i++)
	{
		DynamicGridRow row = form.lyrTabs().tabAssessments().dyngrdDetails().getRows().get(i);
		
		AssessmentQuestionGroupVo assessmentQuestionGroupVo = (AssessmentQuestionGroupVo) row.getValue();
		if(assessmentQuestionGroupVo.getQuestionsIsNotNull())
			assessmentQuestionGroupVo.getQuestions().clear();
		else
			assessmentQuestionGroupVo.setQuestions(new AssessmentQuestionVoCollection());
		
		for (int j = 0; j < row.getRows().size(); j++)
		{
			DynamicGridRow childRow = row.getRows().get(j);
			
			if(childRow.getValue() instanceof AssessmentQuestionVo)
			{
				AssessmentQuestionVo value = (AssessmentQuestionVo) childRow.getValue();
				value.setIsMandatory((Boolean) childRow.getCells().get(getGridColumn(COLUMN_MANDATORY)).getValue());
				if(value.getIsMandatory() == null)
					value.setIsMandatory(Boolean.FALSE);
				value.setAllowsMultipleAnswers((Boolean) childRow.getCells().get(getGridColumn(COLUMN_MULTIANSWERS)).getValue());
				if(value.getAllowsMultipleAnswers() == null)
					value.setAllowsMultipleAnswers(Boolean.FALSE);
				value.setActiveStatus( (PreActiveActiveInactiveStatus) childRow.getCells().get(getGridColumn(COLUMN_STATUS)).getValue());
				value.setSequence(new Integer(seqNo++));
				value.setAssessmentAnswerRole(getQuestionRole(value));
				assessmentQuestionGroupVo.getQuestions().add(value);
			}
		}
		
		if(assessment.getQuestionGroups().contains(assessmentQuestionGroupVo) == false)
			assessment.getQuestionGroups().add(assessmentQuestionGroupVo);
	}
	
	return true;
}
 
Example 39
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private AssessmentQuestionGroupVo getGroupByQuestion(AssessmentQuestionVo assessmentQuestionVo, UserAssessmentVo assessment)
{
	for(int i = 0; i < assessment.getQuestionGroups().size(); i++)
	{
		AssessmentQuestionGroupVo group = assessment.getQuestionGroups().get(i);
		
		for (int j = 0; j < group.getQuestions().size(); j++)
		{
			if(group.getQuestions().get(j).equals(assessmentQuestionVo))//getID_AssessmentQuestionIsNotNull() && group.getQuestions().get(j).getID_AssessmentQuestion().equals(assessmentQuestionVo.getID_AssessmentQuestion()))
				return group;
		}
	}
	
	return null;
}
 
Example 40
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void editGroup()
{
	if (isAssessmentTabSelected())
		form.getGlobalContext().Core.setSelectedQuestionGroup((AssessmentQuestionGroupVo) form.lyrTabs().tabAssessments().dyngrdDetails().getValue());
	if (isGroupTabSelected())
		form.getGlobalContext().Core.setSelectedQuestionGroup(form.lyrTabs().tabGroups().grdGroups().getValue());
	form.getGlobalContext().Core.setUserAssessmentAction("E");
	engine.open(form.getForms().Assessment.GroupSelectNew, "Edit Group");
}