Java Code Examples for ims.core.vo.AssessmentQuestionGroupVoCollection

The following are top voted examples for showing how to use ims.core.vo.AssessmentQuestionGroupVoCollection. 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   Source Code and License 6 votes vote down vote up
private void refreshGroupCellData(AssessmentQuestionGroupVoCollection voColl)
{
	for (int i = 0; i < form.lyrTabs().tabAssessments().dyngrdDetails().getRows().size(); i++)
	{
		DynamicGridRow row = form.lyrTabs().tabAssessments().dyngrdDetails().getRows().get(i);
		DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_GROUP));
		Object value = cell.getValue();
		
		cell.getItems().clear();
		for (int j = 0; voColl != null && j < voColl.size(); j++)
			cell.getItems().newItem(voColl.get(j));
		cell.setValue(value);
		if(value instanceof AssessmentQuestionVo)
			row.setValue(cell);
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 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: StructuredAssessmentsHelper.java   Source Code and License 6 votes vote down vote up
public AssessmentQuestionGroupVoCollection populateGrid(UserAssessmentVo assessment, DPPQuestionGroupVoCollection dppQuestionGroupColl)
{
	this.voDPPQuestionGroupColl = dppQuestionGroupColl;
	if(viewMode == MULTIPLE_GROUP_NO_FLAT)
	{
		populateMultipleGroupsNoFlat(assessment);
	}
	else if(viewMode == SINGLE_GROUP_FLAT)
	{
		populateSingleGroupFlat(assessment);
	}
	else if(viewMode == MULTIPLE_GROUP_FLAT)
	{
		populateMultipleGroupsFlat(assessment);
	}
	return contextHiddenGroups;
}
 
Example 4
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void refreshGroupCellData(AssessmentQuestionGroupVoCollection voColl)
{
	for (int i = 0; i < form.lyrTabs().tabAssessments().dyngrdDetails().getRows().size(); i++)
	{
		DynamicGridRow row = form.lyrTabs().tabAssessments().dyngrdDetails().getRows().get(i);
		DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_GROUP));
		Object value = cell.getValue();
		
		cell.getItems().clear();
		for (int j = 0; voColl != null && j < voColl.size(); j++)
			cell.getItems().newItem(voColl.get(j));
		cell.setValue(value);
		if(value instanceof AssessmentQuestionVo)
			row.setValue(cell);
	}
}
 
Example 5
Project: openMAXIMS   File: Logic.java   Source Code and License 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 6
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   Source Code and License 6 votes vote down vote up
public AssessmentQuestionGroupVoCollection populateGrid(UserAssessmentVo assessment, DPPQuestionGroupVoCollection dppQuestionGroupColl)
{
	this.voDPPQuestionGroupColl = dppQuestionGroupColl;
	if(viewMode == MULTIPLE_GROUP_NO_FLAT)
	{
		populateMultipleGroupsNoFlat(assessment);
	}
	else if(viewMode == SINGLE_GROUP_FLAT)
	{
		populateSingleGroupFlat(assessment);
	}
	else if(viewMode == MULTIPLE_GROUP_FLAT)
	{
		populateMultipleGroupsFlat(assessment);
	}
	return contextHiddenGroups;
}
 
Example 7
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void refreshGroupCellData(AssessmentQuestionGroupVoCollection voColl)
{
	for (int i = 0; i < form.lyrTabs().tabAssessments().dyngrdDetails().getRows().size(); i++)
	{
		DynamicGridRow row = form.lyrTabs().tabAssessments().dyngrdDetails().getRows().get(i);
		DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_GROUP));
		Object value = cell.getValue();
		
		cell.getItems().clear();
		for (int j = 0; voColl != null && j < voColl.size(); j++)
			cell.getItems().newItem(voColl.get(j));
		cell.setValue(value);
		if(value instanceof AssessmentQuestionVo)
			row.setValue(cell);
	}
}
 
Example 8
Project: openMAXIMS   File: Logic.java   Source Code and License 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 9
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   Source Code and License 6 votes vote down vote up
public AssessmentQuestionGroupVoCollection populateGrid(UserAssessmentVo assessment, DPPQuestionGroupVoCollection dppQuestionGroupColl)
{
	this.voDPPQuestionGroupColl = dppQuestionGroupColl;
	if(viewMode == MULTIPLE_GROUP_NO_FLAT)
	{
		populateMultipleGroupsNoFlat(assessment);
	}
	else if(viewMode == SINGLE_GROUP_FLAT)
	{
		populateSingleGroupFlat(assessment);
	}
	else if(viewMode == MULTIPLE_GROUP_FLAT)
	{
		populateMultipleGroupsFlat(assessment);
	}
	return contextHiddenGroups;
}
 
Example 10
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void refreshGroupCellData(AssessmentQuestionGroupVoCollection voColl)
{
	for (int i = 0; i < form.lyrTabs().tabAssessments().dyngrdDetails().getRows().size(); i++)
	{
		DynamicGridRow row = form.lyrTabs().tabAssessments().dyngrdDetails().getRows().get(i);
		DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_GROUP));
		Object value = cell.getValue();
		
		cell.getItems().clear();
		for (int j = 0; voColl != null && j < voColl.size(); j++)
			cell.getItems().newItem(voColl.get(j));
		cell.setValue(value);
		if(value instanceof AssessmentQuestionVo)
			row.setValue(cell);
	}
}
 
Example 11
Project: openmaxims-linux   File: Logic.java   Source Code and License 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 12
Project: openmaxims-linux   File: StructuredAssessmentsHelper.java   Source Code and License 6 votes vote down vote up
public AssessmentQuestionGroupVoCollection populateGrid(UserAssessmentVo assessment, DPPQuestionGroupVoCollection dppQuestionGroupColl)
{
	this.voDPPQuestionGroupColl = dppQuestionGroupColl;
	if(viewMode == MULTIPLE_GROUP_NO_FLAT)
	{
		populateMultipleGroupsNoFlat(assessment);
	}
	else if(viewMode == SINGLE_GROUP_FLAT)
	{
		populateSingleGroupFlat(assessment);
	}
	else if(viewMode == MULTIPLE_GROUP_FLAT)
	{
		populateMultipleGroupsFlat(assessment);
	}
	return contextHiddenGroups;
}
 
Example 13
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private StructuredAssessmentsHelper getHelper(DynamicGrid dynGrid, UserAssessmentVo voUserAssessment)
{
	int  gridType = StructuredAssessmentsHelper.DPP_GRID;
	int	viewMode 		= getViewMode(voUserAssessment);
	Image imageQuestion = form.getImages().Core.QuestionSmall;
	PreActiveActiveInactiveStatusCollection activeColl  = LookupHelper.getPreActiveActiveInactiveStatus(domain.getLookupService());
	PlanOfCareGroupingsCollection groupColl = ims.clinical.vo.lookups.LookupHelper.getPlanOfCareGroupings(domain.getLookupService());
	boolean displayActive = false;//form.chkDisplayActive().getValue();
	AssessmentQuestionGroupVoCollection contextHiddenGroups = null;//form.getLocalContext().getHiddenGroups();
	
	return new StructuredAssessmentsHelper(dynGrid, engine, viewMode, gridType, imageQuestion, activeColl, groupColl, displayActive, contextHiddenGroups);
}
 
Example 14
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private AssessmentQuestionGroupVoCollection buildExistingGroups(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if (data.getAnswerGroups() == null)
		return new AssessmentQuestionGroupVoCollection();
	checkDataIntegrity(data);

	AssessmentQuestionGroupVoCollection result = new AssessmentQuestionGroupVoCollection();

	for (int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		result.add(data.getAnswerGroups().get(x).getAssessmentQuestionGroup());
	}

	return result;
}
 
Example 15
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateQuestionsHierarchical(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if (data.getAnswerGroups() == null)
		return;
	checkDataIntegrity(data);
	boolean flatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean userCanAnswerToAllQuestion = checkUserRole(data.getUserAssessment());//wdev-3709

	AssessmentQuestionGroupVoCollection existingGroups = buildExistingGroups(data);

	for (int x = 0; x < existingGroups.size(); x++)
	{
		if (existingGroups.get(x) != null)
		{
			AssessmentQuestionVoCollection existingQuestions = buildExistingQuestions(data, existingGroups.get(x));

			if (flatView)
			{
				for (int y = 0; y < existingQuestions.size(); y++)
				{
					addQuestionRow(existingQuestions.get(y), existingGroups.get(x), getInstAnswer(data, existingGroups.get(x), existingQuestions.get(y)), userCanAnswerToAllQuestion);//wdev- 3709
				}
			}
			else
			{
				addGroupRow(existingGroups.get(x), existingQuestions, data, userCanAnswerToAllQuestion);//wdev-3709
			}
		}
	}
}
 
Example 16
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private AssessmentQuestionGroupVoCollection buildExistingGroups(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if(data.getAnswerGroups() == null)
		return new AssessmentQuestionGroupVoCollection();		
	checkDataIntegrity(data);
	
	AssessmentQuestionGroupVoCollection result = new AssessmentQuestionGroupVoCollection();
	
	for(int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		result.add(data.getAnswerGroups().get(x).getAssessmentQuestionGroup());
	}
	
	return result;
}
 
Example 17
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private void populateQuestionsHierarchical(PatientAssessmentDataVo data) throws PresentationLogicException 
{
	if(data.getAnswerGroups() == null)
		return;		
	checkDataIntegrity(data);		
	boolean flatView = data.getUserAssessment().getIsFlatView().booleanValue();
	
	AssessmentQuestionGroupVoCollection existingGroups = buildExistingGroups(data);
	
	for(int x = 0; x < existingGroups.size(); x++)
	{
		if(existingGroups.get(x) != null)
		{
			AssessmentQuestionVoCollection existingQuestions = buildExistingQuestions(data, existingGroups.get(x));
			
			if(flatView)
			{
				for(int y = 0; y < existingQuestions.size(); y++)
				{
					addQuestionRow(existingQuestions.get(y), existingGroups.get(x), getInstAnswer(data, existingGroups.get(x), existingQuestions.get(y)));						
				}
			}
			else
			{		
				addGroupRow(existingGroups.get(x), existingQuestions, data);
			}
		}
	}
}
 
Example 18
Project: AvoinApotti   File: StructuredAssessmentsHelper.java   Source Code and License 5 votes vote down vote up
public StructuredAssessmentsHelper(DynamicGrid dynGrid, UIEngine engine, int viewMode, int gridType, Image imgQuestionSmall, PreActiveActiveInactiveStatusCollection activeColl, PlanOfCareGroupingsCollection groupsColl, boolean displayActive, AssessmentQuestionGroupVoCollection contextHiddenGroups)
{
	this.dynGrid = dynGrid;
	this.engine = engine;
	this.viewMode = viewMode;
	this.gridType = gridType;
	this.imgQuestion = imgQuestionSmall;
	this.activeColl = activeColl;
	this.groupsColl = groupsColl; 
	this.displayActive = displayActive;
	this.contextHiddenGroups = contextHiddenGroups;
}
 
Example 19
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private StructuredAssessmentsHelper getHelper(DynamicGrid dynGrid, UserAssessmentVo voUserAssessment)
{
	int  gridType = StructuredAssessmentsHelper.DPP_GRID;
	int	viewMode 		= getViewMode(voUserAssessment);
	Image imageQuestion = form.getImages().Core.QuestionSmall;
	PreActiveActiveInactiveStatusCollection activeColl  = LookupHelper.getPreActiveActiveInactiveStatus(domain.getLookupService());
	PlanOfCareGroupingsCollection groupColl = ims.clinical.vo.lookups.LookupHelper.getPlanOfCareGroupings(domain.getLookupService());
	boolean displayActive = false;//form.chkDisplayActive().getValue();
	AssessmentQuestionGroupVoCollection contextHiddenGroups = null;//form.getLocalContext().getHiddenGroups();
	
	return new StructuredAssessmentsHelper(dynGrid, engine, viewMode, gridType, imageQuestion, activeColl, groupColl, displayActive, contextHiddenGroups);
}
 
Example 20
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private AssessmentQuestionGroupVoCollection buildExistingGroups(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if (data.getAnswerGroups() == null)
		return new AssessmentQuestionGroupVoCollection();
	checkDataIntegrity(data);

	AssessmentQuestionGroupVoCollection result = new AssessmentQuestionGroupVoCollection();

	for (int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		result.add(data.getAnswerGroups().get(x).getAssessmentQuestionGroup());
	}

	return result;
}
 
Example 21
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateQuestionsHierarchical(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if (data.getAnswerGroups() == null)
		return;
	checkDataIntegrity(data);
	boolean flatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean userCanAnswerToAllQuestion = checkUserRole(data.getUserAssessment());//wdev-3709

	AssessmentQuestionGroupVoCollection existingGroups = buildExistingGroups(data);

	for (int x = 0; x < existingGroups.size(); x++)
	{
		if (existingGroups.get(x) != null)
		{
			AssessmentQuestionVoCollection existingQuestions = buildExistingQuestions(data, existingGroups.get(x));

			if (flatView)
			{
				for (int y = 0; y < existingQuestions.size(); y++)
				{
					addQuestionRow(existingQuestions.get(y), existingGroups.get(x), getInstAnswer(data, existingGroups.get(x), existingQuestions.get(y)), userCanAnswerToAllQuestion);//wdev- 3709
				}
			}
			else
			{
				addGroupRow(existingGroups.get(x), existingQuestions, data, userCanAnswerToAllQuestion);//wdev-3709
			}
		}
	}
}
 
Example 22
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private AssessmentQuestionGroupVoCollection buildExistingGroups(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if(data.getAnswerGroups() == null)
		return new AssessmentQuestionGroupVoCollection();		
	checkDataIntegrity(data);
	
	AssessmentQuestionGroupVoCollection result = new AssessmentQuestionGroupVoCollection();
	
	for(int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		result.add(data.getAnswerGroups().get(x).getAssessmentQuestionGroup());
	}
	
	return result;
}
 
Example 23
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private void populateQuestionsHierarchical(PatientAssessmentDataVo data) throws PresentationLogicException 
{
	if(data.getAnswerGroups() == null)
		return;		
	checkDataIntegrity(data);		
	boolean flatView = data.getUserAssessment().getIsFlatView().booleanValue();
	
	AssessmentQuestionGroupVoCollection existingGroups = buildExistingGroups(data);
	
	for(int x = 0; x < existingGroups.size(); x++)
	{
		if(existingGroups.get(x) != null)
		{
			AssessmentQuestionVoCollection existingQuestions = buildExistingQuestions(data, existingGroups.get(x));
			
			if(flatView)
			{
				for(int y = 0; y < existingQuestions.size(); y++)
				{
					addQuestionRow(existingQuestions.get(y), existingGroups.get(x), getInstAnswer(data, existingGroups.get(x), existingQuestions.get(y)));						
				}
			}
			else
			{		
				addGroupRow(existingGroups.get(x), existingQuestions, data);
			}
		}
	}
}
 
Example 24
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   Source Code and License 5 votes vote down vote up
public StructuredAssessmentsHelper(DynamicGrid dynGrid, UIEngine engine, int viewMode, int gridType, Image imgQuestionSmall, PreActiveActiveInactiveStatusCollection activeColl, PlanOfCareGroupingsCollection groupsColl, boolean displayActive, AssessmentQuestionGroupVoCollection contextHiddenGroups)
{
	this.dynGrid = dynGrid;
	this.engine = engine;
	this.viewMode = viewMode;
	this.gridType = gridType;
	this.imgQuestion = imgQuestionSmall;
	this.activeColl = activeColl;
	this.groupsColl = groupsColl; 
	this.displayActive = displayActive;
	this.contextHiddenGroups = contextHiddenGroups;
}
 
Example 25
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private StructuredAssessmentsHelper getHelper(DynamicGrid dynGrid, UserAssessmentVo voUserAssessment)
{
	int  gridType = StructuredAssessmentsHelper.DPP_GRID;
	int	viewMode 		= getViewMode(voUserAssessment);
	Image imageQuestion = form.getImages().Core.QuestionSmall;
	PreActiveActiveInactiveStatusCollection activeColl  = LookupHelper.getPreActiveActiveInactiveStatus(domain.getLookupService());
	PlanOfCareGroupingsCollection groupColl = ims.clinical.vo.lookups.LookupHelper.getPlanOfCareGroupings(domain.getLookupService());
	boolean displayActive = false;//form.chkDisplayActive().getValue();
	AssessmentQuestionGroupVoCollection contextHiddenGroups = null;//form.getLocalContext().getHiddenGroups();
	
	return new StructuredAssessmentsHelper(dynGrid, engine, viewMode, gridType, imageQuestion, activeColl, groupColl, displayActive, contextHiddenGroups);
}
 
Example 26
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private AssessmentQuestionGroupVoCollection buildExistingGroups(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if (data.getAnswerGroups() == null)
		return new AssessmentQuestionGroupVoCollection();
	checkDataIntegrity(data);

	AssessmentQuestionGroupVoCollection result = new AssessmentQuestionGroupVoCollection();

	for (int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		result.add(data.getAnswerGroups().get(x).getAssessmentQuestionGroup());
	}

	return result;
}
 
Example 27
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateQuestionsHierarchical(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if (data.getAnswerGroups() == null)
		return;
	checkDataIntegrity(data);
	boolean flatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean userCanAnswerToAllQuestion = checkUserRole(data.getUserAssessment());//wdev-3709

	AssessmentQuestionGroupVoCollection existingGroups = buildExistingGroups(data);

	for (int x = 0; x < existingGroups.size(); x++)
	{
		if (existingGroups.get(x) != null)
		{
			AssessmentQuestionVoCollection existingQuestions = buildExistingQuestions(data, existingGroups.get(x));

			if (flatView)
			{
				for (int y = 0; y < existingQuestions.size(); y++)
				{
					addQuestionRow(existingQuestions.get(y), existingGroups.get(x), getInstAnswer(data, existingGroups.get(x), existingQuestions.get(y)), userCanAnswerToAllQuestion);//wdev- 3709
				}
			}
			else
			{
				addGroupRow(existingGroups.get(x), existingQuestions, data, userCanAnswerToAllQuestion);//wdev-3709
			}
		}
	}
}
 
Example 28
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private AssessmentQuestionGroupVoCollection buildExistingGroups(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if(data.getAnswerGroups() == null)
		return new AssessmentQuestionGroupVoCollection();		
	checkDataIntegrity(data);
	
	AssessmentQuestionGroupVoCollection result = new AssessmentQuestionGroupVoCollection();
	
	for(int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		result.add(data.getAnswerGroups().get(x).getAssessmentQuestionGroup());
	}
	
	return result;
}
 
Example 29
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private void populateQuestionsHierarchical(PatientAssessmentDataVo data) throws PresentationLogicException 
{
	if(data.getAnswerGroups() == null)
		return;		
	checkDataIntegrity(data);		
	boolean flatView = data.getUserAssessment().getIsFlatView().booleanValue();
	
	AssessmentQuestionGroupVoCollection existingGroups = buildExistingGroups(data);
	
	for(int x = 0; x < existingGroups.size(); x++)
	{
		if(existingGroups.get(x) != null)
		{
			AssessmentQuestionVoCollection existingQuestions = buildExistingQuestions(data, existingGroups.get(x));
			
			if(flatView)
			{
				for(int y = 0; y < existingQuestions.size(); y++)
				{
					addQuestionRow(existingQuestions.get(y), existingGroups.get(x), getInstAnswer(data, existingGroups.get(x), existingQuestions.get(y)));						
				}
			}
			else
			{		
				addGroupRow(existingGroups.get(x), existingQuestions, data);
			}
		}
	}
}
 
Example 30
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   Source Code and License 5 votes vote down vote up
public StructuredAssessmentsHelper(DynamicGrid dynGrid, UIEngine engine, int viewMode, int gridType, Image imgQuestionSmall, PreActiveActiveInactiveStatusCollection activeColl, PlanOfCareGroupingsCollection groupsColl, boolean displayActive, AssessmentQuestionGroupVoCollection contextHiddenGroups)
{
	this.dynGrid = dynGrid;
	this.engine = engine;
	this.viewMode = viewMode;
	this.gridType = gridType;
	this.imgQuestion = imgQuestionSmall;
	this.activeColl = activeColl;
	this.groupsColl = groupsColl; 
	this.displayActive = displayActive;
	this.contextHiddenGroups = contextHiddenGroups;
}
 
Example 31
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private StructuredAssessmentsHelper getHelper(DynamicGrid dynGrid, UserAssessmentVo voUserAssessment)
{
	int  gridType = StructuredAssessmentsHelper.DPP_GRID;
	int	viewMode 		= getViewMode(voUserAssessment);
	Image imageQuestion = form.getImages().Core.QuestionSmall;
	PreActiveActiveInactiveStatusCollection activeColl  = LookupHelper.getPreActiveActiveInactiveStatus(domain.getLookupService());
	PlanOfCareGroupingsCollection groupColl = ims.clinical.vo.lookups.LookupHelper.getPlanOfCareGroupings(domain.getLookupService());
	boolean displayActive = false;//form.chkDisplayActive().getValue();
	AssessmentQuestionGroupVoCollection contextHiddenGroups = null;//form.getLocalContext().getHiddenGroups();
	
	return new StructuredAssessmentsHelper(dynGrid, engine, viewMode, gridType, imageQuestion, activeColl, groupColl, displayActive, contextHiddenGroups);
}
 
Example 32
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private AssessmentQuestionGroupVoCollection buildExistingGroups(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if (data.getAnswerGroups() == null)
		return new AssessmentQuestionGroupVoCollection();
	checkDataIntegrity(data);

	AssessmentQuestionGroupVoCollection result = new AssessmentQuestionGroupVoCollection();

	for (int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		result.add(data.getAnswerGroups().get(x).getAssessmentQuestionGroup());
	}

	return result;
}
 
Example 33
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateQuestionsHierarchical(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if (data.getAnswerGroups() == null)
		return;
	checkDataIntegrity(data);
	boolean flatView = data.getUserAssessment().getIsFlatView().booleanValue();
	boolean userCanAnswerToAllQuestion = checkUserRole(data.getUserAssessment());//wdev-3709

	AssessmentQuestionGroupVoCollection existingGroups = buildExistingGroups(data);

	for (int x = 0; x < existingGroups.size(); x++)
	{
		if (existingGroups.get(x) != null)
		{
			AssessmentQuestionVoCollection existingQuestions = buildExistingQuestions(data, existingGroups.get(x));

			if (flatView)
			{
				for (int y = 0; y < existingQuestions.size(); y++)
				{
					addQuestionRow(existingQuestions.get(y), existingGroups.get(x), getInstAnswer(data, existingGroups.get(x), existingQuestions.get(y)), userCanAnswerToAllQuestion);//wdev- 3709
				}
			}
			else
			{
				addGroupRow(existingGroups.get(x), existingQuestions, data, userCanAnswerToAllQuestion);//wdev-3709
			}
		}
	}
}
 
Example 34
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private AssessmentQuestionGroupVoCollection buildExistingGroups(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if(data.getAnswerGroups() == null)
		return new AssessmentQuestionGroupVoCollection();		
	checkDataIntegrity(data);
	
	AssessmentQuestionGroupVoCollection result = new AssessmentQuestionGroupVoCollection();
	
	for(int x = 0; x < data.getAnswerGroups().size(); x++)
	{
		result.add(data.getAnswerGroups().get(x).getAssessmentQuestionGroup());
	}
	
	return result;
}
 
Example 35
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private void populateQuestionsHierarchical(PatientAssessmentDataVo data) throws PresentationLogicException 
{
	if(data.getAnswerGroups() == null)
		return;		
	checkDataIntegrity(data);		
	boolean flatView = data.getUserAssessment().getIsFlatView().booleanValue();
	
	AssessmentQuestionGroupVoCollection existingGroups = buildExistingGroups(data);
	
	for(int x = 0; x < existingGroups.size(); x++)
	{
		if(existingGroups.get(x) != null)
		{
			AssessmentQuestionVoCollection existingQuestions = buildExistingQuestions(data, existingGroups.get(x));
			
			if(flatView)
			{
				for(int y = 0; y < existingQuestions.size(); y++)
				{
					addQuestionRow(existingQuestions.get(y), existingGroups.get(x), getInstAnswer(data, existingGroups.get(x), existingQuestions.get(y)));						
				}
			}
			else
			{		
				addGroupRow(existingGroups.get(x), existingQuestions, data);
			}
		}
	}
}
 
Example 36
Project: openmaxims-linux   File: StructuredAssessmentsHelper.java   Source Code and License 5 votes vote down vote up
public StructuredAssessmentsHelper(DynamicGrid dynGrid, UIEngine engine, int viewMode, int gridType, Image imgQuestionSmall, PreActiveActiveInactiveStatusCollection activeColl, PlanOfCareGroupingsCollection groupsColl, boolean displayActive, AssessmentQuestionGroupVoCollection contextHiddenGroups)
{
	this.dynGrid = dynGrid;
	this.engine = engine;
	this.viewMode = viewMode;
	this.gridType = gridType;
	this.imgQuestion = imgQuestionSmall;
	this.activeColl = activeColl;
	this.groupsColl = groupsColl; 
	this.displayActive = displayActive;
	this.contextHiddenGroups = contextHiddenGroups;
}
 
Example 37
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private void populateSingleGroupFlat(UserAssessmentVo assessment, int viewMode)
{
	AssessmentQuestionGroupVoCollection hiddenGroups = new AssessmentQuestionGroupVoCollection();
	if(assessment.getQuestionGroupsIsNotNull() && assessment.getQuestionGroups().size() > 0)
		hiddenGroups.add(assessment.getQuestionGroups().get(0)); //we should only have 1 item
	
	form.getLocalContext().setHiddenGroups(hiddenGroups);
	
	if(assessment.getQuestionGroups().size() > 0)
	{
		for(int i = 0; i < assessment.getQuestionGroups().get(0).getQuestions().size(); i++)
		{
			AssessmentQuestionVo assessmentQuestionVo = assessment.getQuestionGroups().get(0).getQuestions().get(i);
			if(isNotActive(assessmentQuestionVo.getActiveStatus()))
				continue;
			
			if(assessmentQuestionVo.getQuestionIsNotNull() && isNotActive(assessmentQuestionVo.getQuestion().getStatus()))
				continue;
			
			DynamicGridRow row = form.lyrTabs().tabAssessments().dyngrdDetails().getRows().newRow();
			createRowCells(row, viewMode);
			
			//engine.populate(row.getCells().get(getGridColumn(COLUMN_STATUS)), ims.core.vo.lookups.LookupHelper.getPreActiveActiveInactiveStatus(this.domain.getLookupService()));
			PreActiveActiveInactiveStatusCollection lookupColl = ims.core.vo.lookups.LookupHelper.getPreActiveActiveInactiveStatus(this.domain.getLookupService());
			DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_STATUS));
			for (int j = 0; j < lookupColl.size(); j++)
			{
				PreActiveActiveInactiveStatus lkup = lookupColl.get(j);
				cell.getItems().newItem(lkup, lkup.getImage());
			}

			cell = row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP));
			cell.setReadOnly(true);
			cell.setValue(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getShortText() : "");
			cell.setTooltip(getQuestionTooltip(assessmentQuestionVo));
			cell = row.getCells().get(getGridColumn(COLUMN_MANDATORY));
			cell.setValue(assessmentQuestionVo.getIsMandatory());
			cell = row.getCells().get(getGridColumn(COLUMN_MULTIANSWERS));
			cell.setValue(assessmentQuestionVo.getAllowsMultipleAnswers());
			cell = row.getCells().get(getGridColumn(COLUMN_STATUS));
			cell.setValue(assessmentQuestionVo.getActiveStatus());
			
			if(isDpp())
			{
				DynamicGridColumn colNonStandard = getGridColumn(COLUMN_NONSTANDARD);
				if(colNonStandard != null)
				{
					DynamicGridCell cellNonStandard = row.getCells().get(colNonStandard);
					if(cellNonStandard != null)
					{
						cellNonStandard.setValue(assessmentQuestionVo.getIsNonStandard());
					}
				}
			}
			
			row.setValue(assessmentQuestionVo);
			// row tooltip no longer supported
			// row.setTooltip(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
		}
	}
}
 
Example 38
Project: AvoinApotti   File: StructuredAssessmentsHelper.java   Source Code and License 4 votes vote down vote up
public AssessmentQuestionGroupVoCollection populateGrid(UserAssessmentVo assessment)
{
	return populateGrid(assessment, null);
}
 
Example 39
Project: AvoinApotti   File: StructuredAssessmentsHelper.java   Source Code and License 4 votes vote down vote up
public void addQuestionToGrid(AssessmentQuestionVo assessmentQuestionVo, AssessmentQuestionGroupVoCollection groupColl)
{
	if(assessmentQuestionVo == null)
		return;
	
	DynamicGridRow row = null;
	switch (viewMode)
	{
		case MULTIPLE_GROUP_NO_FLAT :
			row = dynGrid.getSelectedRow();
			if(row != null)
				row = row.getRows().newRow();
		break;
		case MULTIPLE_GROUP_FLAT :
		case SINGLE_GROUP_FLAT :
			row = dynGrid.getRows().newRow();
		break;
		default :
		break;
	}
	
	createRowCells(row);
	
	row.setValue(assessmentQuestionVo);
	row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)).setValue(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
	row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)).setTooltip(getQuestionTooltip(assessmentQuestionVo));
	row.getCells().get(getGridColumn(COLUMN_MANDATORY)).setValue(assessmentQuestionVo.getIsMandatory());
	row.getCells().get(getGridColumn(COLUMN_MULTIANSWERS)).setValue(assessmentQuestionVo.getAllowsMultipleAnswers());
	engine.populate(row.getCells().get(getGridColumn(COLUMN_STATUS)), activeColl);
	row.getCells().get(getGridColumn(COLUMN_STATUS)).setValue(PreActiveActiveInactiveStatus.ACTIVE);
	
	if(viewMode == MULTIPLE_GROUP_FLAT)
	{
		DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_GROUP));

		for(int i = 0; groupColl != null && i < groupColl.size(); i++)
		{
			cell.getItems().newItem(groupColl.get(i));
		}
	}
	
	if(viewMode == MULTIPLE_GROUP_NO_FLAT)
	{
		row.setExpandedImage(imgQuestion);
		row.setCollapsedImage(imgQuestion);
	}
}
 
Example 40
Project: AvoinApotti   File: StructuredAssessmentsHelper.java   Source Code and License 4 votes vote down vote up
private void populateSingleGroupFlat(UserAssessmentVo assessment)
{
	AssessmentQuestionGroupVoCollection hiddenGroups = new AssessmentQuestionGroupVoCollection();
	if(assessment.getQuestionGroupsIsNotNull() && assessment.getQuestionGroups().size() > 0)
		hiddenGroups.add(assessment.getQuestionGroups().get(0)); //we should only have 1 item
	
	//TODO - check if the calling context gets updated
	contextHiddenGroups = hiddenGroups;
	
	if(assessment.getQuestionGroups().size() > 0)
	{
		for(int i = 0; i < assessment.getQuestionGroups().get(0).getQuestions().size(); i++)
		{
			AssessmentQuestionVo assessmentQuestionVo = assessment.getQuestionGroups().get(0).getQuestions().get(i);
			if(isNotActive(assessmentQuestionVo.getActiveStatus()))
				continue;
			
			if(assessmentQuestionVo.getQuestionIsNotNull() && isNotActive(assessmentQuestionVo.getQuestion().getStatus()))
				continue;
			
			DynamicGridRow row = dynGrid.getRows().newRow();
			createRowCells(row);
			
			DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP));
			cell.setReadOnly(true);
			cell.setValue(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
			cell.setTooltip(getQuestionTooltip(assessmentQuestionVo));
			
			if(isDppGrid())
			{
				cell = row.getCells().get(getGridColumn(COLUMN_DPPGROUP));
				engine.populate(cell, groupsColl);
				cell.setValue(getDppQuestionGroup(assessmentQuestionVo, assessment));
			}
			else
			{
				//engine.populate(row.getCells().get(getGridColumn(COLUMN_STATUS)), ims.core.vo.lookups.LookupHelper.getPreActiveActiveInactiveStatus(this.domain.getLookupService()));
				cell = row.getCells().get(getGridColumn(COLUMN_STATUS));
				for (int j = 0; j < activeColl.size(); j++)
				{
					PreActiveActiveInactiveStatus lkup = activeColl.get(j);
					cell.getItems().newItem(lkup, lkup.getImage());
				}
	
				cell = row.getCells().get(getGridColumn(COLUMN_MANDATORY));
				cell.setValue(assessmentQuestionVo.getIsMandatory());
				cell = row.getCells().get(getGridColumn(COLUMN_MULTIANSWERS));
				cell.setValue(assessmentQuestionVo.getAllowsMultipleAnswers());
				cell = row.getCells().get(getGridColumn(COLUMN_STATUS));
				cell.setValue(assessmentQuestionVo.getActiveStatus());
			}
			
			row.setValue(assessmentQuestionVo);
		}
	}
}
 
Example 41
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private void populateSingleGroupFlat(UserAssessmentVo assessment, int viewMode)
{
	AssessmentQuestionGroupVoCollection hiddenGroups = new AssessmentQuestionGroupVoCollection();
	if(assessment.getQuestionGroupsIsNotNull() && assessment.getQuestionGroups().size() > 0)
		hiddenGroups.add(assessment.getQuestionGroups().get(0)); //we should only have 1 item
	
	form.getLocalContext().setHiddenGroups(hiddenGroups);
	
	if(assessment.getQuestionGroups().size() > 0)
	{
		for(int i = 0; i < assessment.getQuestionGroups().get(0).getQuestions().size(); i++)
		{
			AssessmentQuestionVo assessmentQuestionVo = assessment.getQuestionGroups().get(0).getQuestions().get(i);
			if(isNotActive(assessmentQuestionVo.getActiveStatus()))
				continue;
			
			if(assessmentQuestionVo.getQuestionIsNotNull() && isNotActive(assessmentQuestionVo.getQuestion().getStatus()))
				continue;
			
			DynamicGridRow row = form.lyrTabs().tabAssessments().dyngrdDetails().getRows().newRow();
			createRowCells(row, viewMode);
			
			//engine.populate(row.getCells().get(getGridColumn(COLUMN_STATUS)), ims.core.vo.lookups.LookupHelper.getPreActiveActiveInactiveStatus(this.domain.getLookupService()));
			PreActiveActiveInactiveStatusCollection lookupColl = ims.core.vo.lookups.LookupHelper.getPreActiveActiveInactiveStatus(this.domain.getLookupService());
			DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_STATUS));
			for (int j = 0; j < lookupColl.size(); j++)
			{
				PreActiveActiveInactiveStatus lkup = lookupColl.get(j);
				cell.getItems().newItem(lkup, lkup.getImage());
			}

			cell = row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP));
			cell.setReadOnly(true);
			cell.setValue(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getShortText() : "");
			cell.setTooltip(getQuestionTooltip(assessmentQuestionVo));
			cell = row.getCells().get(getGridColumn(COLUMN_MANDATORY));
			cell.setValue(assessmentQuestionVo.getIsMandatory());
			cell = row.getCells().get(getGridColumn(COLUMN_MULTIANSWERS));
			cell.setValue(assessmentQuestionVo.getAllowsMultipleAnswers());
			cell = row.getCells().get(getGridColumn(COLUMN_STATUS));
			cell.setValue(assessmentQuestionVo.getActiveStatus());
			
			if(isDpp())
			{
				DynamicGridColumn colNonStandard = getGridColumn(COLUMN_NONSTANDARD);
				if(colNonStandard != null)
				{
					DynamicGridCell cellNonStandard = row.getCells().get(colNonStandard);
					if(cellNonStandard != null)
					{
						cellNonStandard.setValue(assessmentQuestionVo.getIsNonStandard());
					}
				}
			}
			
			row.setValue(assessmentQuestionVo);
			// row tooltip no longer supported
			// row.setTooltip(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
		}
	}
}
 
Example 42
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   Source Code and License 4 votes vote down vote up
public AssessmentQuestionGroupVoCollection populateGrid(UserAssessmentVo assessment)
{
	return populateGrid(assessment, null);
}
 
Example 43
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   Source Code and License 4 votes vote down vote up
public void addQuestionToGrid(AssessmentQuestionVo assessmentQuestionVo, AssessmentQuestionGroupVoCollection groupColl)
{
	if(assessmentQuestionVo == null)
		return;
	
	DynamicGridRow row = null;
	switch (viewMode)
	{
		case MULTIPLE_GROUP_NO_FLAT :
			row = dynGrid.getSelectedRow();
			if(row != null)
				row = row.getRows().newRow();
		break;
		case MULTIPLE_GROUP_FLAT :
		case SINGLE_GROUP_FLAT :
			row = dynGrid.getRows().newRow();
		break;
		default :
		break;
	}
	
	createRowCells(row);
	
	row.setValue(assessmentQuestionVo);
	row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)).setValue(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
	row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)).setTooltip(getQuestionTooltip(assessmentQuestionVo));
	row.getCells().get(getGridColumn(COLUMN_MANDATORY)).setValue(assessmentQuestionVo.getIsMandatory());
	row.getCells().get(getGridColumn(COLUMN_MULTIANSWERS)).setValue(assessmentQuestionVo.getAllowsMultipleAnswers());
	engine.populate(row.getCells().get(getGridColumn(COLUMN_STATUS)), activeColl);
	row.getCells().get(getGridColumn(COLUMN_STATUS)).setValue(PreActiveActiveInactiveStatus.ACTIVE);
	
	if(viewMode == MULTIPLE_GROUP_FLAT)
	{
		DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_GROUP));

		for(int i = 0; groupColl != null && i < groupColl.size(); i++)
		{
			cell.getItems().newItem(groupColl.get(i));
		}
	}
	
	if(viewMode == MULTIPLE_GROUP_NO_FLAT)
	{
		row.setExpandedImage(imgQuestion);
		row.setCollapsedImage(imgQuestion);
	}
}
 
Example 44
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   Source Code and License 4 votes vote down vote up
private void populateSingleGroupFlat(UserAssessmentVo assessment)
{
	AssessmentQuestionGroupVoCollection hiddenGroups = new AssessmentQuestionGroupVoCollection();
	if(assessment.getQuestionGroupsIsNotNull() && assessment.getQuestionGroups().size() > 0)
		hiddenGroups.add(assessment.getQuestionGroups().get(0)); //we should only have 1 item
	
	//TODO - check if the calling context gets updated
	contextHiddenGroups = hiddenGroups;
	
	if(assessment.getQuestionGroups().size() > 0)
	{
		for(int i = 0; i < assessment.getQuestionGroups().get(0).getQuestions().size(); i++)
		{
			AssessmentQuestionVo assessmentQuestionVo = assessment.getQuestionGroups().get(0).getQuestions().get(i);
			if(isNotActive(assessmentQuestionVo.getActiveStatus()))
				continue;
			
			if(assessmentQuestionVo.getQuestionIsNotNull() && isNotActive(assessmentQuestionVo.getQuestion().getStatus()))
				continue;
			
			DynamicGridRow row = dynGrid.getRows().newRow();
			createRowCells(row);
			
			DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP));
			cell.setReadOnly(true);
			cell.setValue(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
			cell.setTooltip(getQuestionTooltip(assessmentQuestionVo));
			
			if(isDppGrid())
			{
				cell = row.getCells().get(getGridColumn(COLUMN_DPPGROUP));
				engine.populate(cell, groupsColl);
				cell.setValue(getDppQuestionGroup(assessmentQuestionVo, assessment));
			}
			else
			{
				//engine.populate(row.getCells().get(getGridColumn(COLUMN_STATUS)), ims.core.vo.lookups.LookupHelper.getPreActiveActiveInactiveStatus(this.domain.getLookupService()));
				cell = row.getCells().get(getGridColumn(COLUMN_STATUS));
				for (int j = 0; j < activeColl.size(); j++)
				{
					PreActiveActiveInactiveStatus lkup = activeColl.get(j);
					cell.getItems().newItem(lkup, lkup.getImage());
				}
	
				cell = row.getCells().get(getGridColumn(COLUMN_MANDATORY));
				cell.setValue(assessmentQuestionVo.getIsMandatory());
				cell = row.getCells().get(getGridColumn(COLUMN_MULTIANSWERS));
				cell.setValue(assessmentQuestionVo.getAllowsMultipleAnswers());
				cell = row.getCells().get(getGridColumn(COLUMN_STATUS));
				cell.setValue(assessmentQuestionVo.getActiveStatus());
			}
			
			row.setValue(assessmentQuestionVo);
		}
	}
}
 
Example 45
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private void populateSingleGroupFlat(UserAssessmentVo assessment, int viewMode)
{
	AssessmentQuestionGroupVoCollection hiddenGroups = new AssessmentQuestionGroupVoCollection();
	if(assessment.getQuestionGroupsIsNotNull() && assessment.getQuestionGroups().size() > 0)
		hiddenGroups.add(assessment.getQuestionGroups().get(0)); //we should only have 1 item
	
	form.getLocalContext().setHiddenGroups(hiddenGroups);
	
	if(assessment.getQuestionGroups().size() > 0)
	{
		for(int i = 0; i < assessment.getQuestionGroups().get(0).getQuestions().size(); i++)
		{
			AssessmentQuestionVo assessmentQuestionVo = assessment.getQuestionGroups().get(0).getQuestions().get(i);
			if(isNotActive(assessmentQuestionVo.getActiveStatus()))
				continue;
			
			if(assessmentQuestionVo.getQuestionIsNotNull() && isNotActive(assessmentQuestionVo.getQuestion().getStatus()))
				continue;
			
			DynamicGridRow row = form.lyrTabs().tabAssessments().dyngrdDetails().getRows().newRow();
			createRowCells(row, viewMode);
			
			//engine.populate(row.getCells().get(getGridColumn(COLUMN_STATUS)), ims.core.vo.lookups.LookupHelper.getPreActiveActiveInactiveStatus(this.domain.getLookupService()));
			PreActiveActiveInactiveStatusCollection lookupColl = ims.core.vo.lookups.LookupHelper.getPreActiveActiveInactiveStatus(this.domain.getLookupService());
			DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_STATUS));
			for (int j = 0; j < lookupColl.size(); j++)
			{
				PreActiveActiveInactiveStatus lkup = lookupColl.get(j);
				cell.getItems().newItem(lkup, lkup.getImage());
			}

			cell = row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP));
			cell.setReadOnly(true);
			cell.setValue(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getShortText() : "");
			cell.setTooltip(getQuestionTooltip(assessmentQuestionVo));
			cell = row.getCells().get(getGridColumn(COLUMN_MANDATORY));
			cell.setValue(assessmentQuestionVo.getIsMandatory());
			cell = row.getCells().get(getGridColumn(COLUMN_MULTIANSWERS));
			cell.setValue(assessmentQuestionVo.getAllowsMultipleAnswers());
			cell = row.getCells().get(getGridColumn(COLUMN_STATUS));
			cell.setValue(assessmentQuestionVo.getActiveStatus());
			
			if(isDpp())
			{
				DynamicGridColumn colNonStandard = getGridColumn(COLUMN_NONSTANDARD);
				if(colNonStandard != null)
				{
					DynamicGridCell cellNonStandard = row.getCells().get(colNonStandard);
					if(cellNonStandard != null)
					{
						cellNonStandard.setValue(assessmentQuestionVo.getIsNonStandard());
					}
				}
			}
			
			row.setValue(assessmentQuestionVo);
			// row tooltip no longer supported
			// row.setTooltip(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
		}
	}
}
 
Example 46
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   Source Code and License 4 votes vote down vote up
public AssessmentQuestionGroupVoCollection populateGrid(UserAssessmentVo assessment)
{
	return populateGrid(assessment, null);
}
 
Example 47
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   Source Code and License 4 votes vote down vote up
public void addQuestionToGrid(AssessmentQuestionVo assessmentQuestionVo, AssessmentQuestionGroupVoCollection groupColl)
{
	if(assessmentQuestionVo == null)
		return;
	
	DynamicGridRow row = null;
	switch (viewMode)
	{
		case MULTIPLE_GROUP_NO_FLAT :
			row = dynGrid.getSelectedRow();
			if(row != null)
				row = row.getRows().newRow();
		break;
		case MULTIPLE_GROUP_FLAT :
		case SINGLE_GROUP_FLAT :
			row = dynGrid.getRows().newRow();
		break;
		default :
		break;
	}
	
	createRowCells(row);
	
	row.setValue(assessmentQuestionVo);
	row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)).setValue(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
	row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)).setTooltip(getQuestionTooltip(assessmentQuestionVo));
	row.getCells().get(getGridColumn(COLUMN_MANDATORY)).setValue(assessmentQuestionVo.getIsMandatory());
	row.getCells().get(getGridColumn(COLUMN_MULTIANSWERS)).setValue(assessmentQuestionVo.getAllowsMultipleAnswers());
	engine.populate(row.getCells().get(getGridColumn(COLUMN_STATUS)), activeColl);
	row.getCells().get(getGridColumn(COLUMN_STATUS)).setValue(PreActiveActiveInactiveStatus.ACTIVE);
	
	if(viewMode == MULTIPLE_GROUP_FLAT)
	{
		DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_GROUP));

		for(int i = 0; groupColl != null && i < groupColl.size(); i++)
		{
			cell.getItems().newItem(groupColl.get(i));
		}
	}
	
	if(viewMode == MULTIPLE_GROUP_NO_FLAT)
	{
		row.setExpandedImage(imgQuestion);
		row.setCollapsedImage(imgQuestion);
	}
}
 
Example 48
Project: openMAXIMS   File: StructuredAssessmentsHelper.java   Source Code and License 4 votes vote down vote up
private void populateSingleGroupFlat(UserAssessmentVo assessment)
{
	AssessmentQuestionGroupVoCollection hiddenGroups = new AssessmentQuestionGroupVoCollection();
	if(assessment.getQuestionGroupsIsNotNull() && assessment.getQuestionGroups().size() > 0)
		hiddenGroups.add(assessment.getQuestionGroups().get(0)); //we should only have 1 item
	
	//TODO - check if the calling context gets updated
	contextHiddenGroups = hiddenGroups;
	
	if(assessment.getQuestionGroups().size() > 0)
	{
		for(int i = 0; i < assessment.getQuestionGroups().get(0).getQuestions().size(); i++)
		{
			AssessmentQuestionVo assessmentQuestionVo = assessment.getQuestionGroups().get(0).getQuestions().get(i);
			if(isNotActive(assessmentQuestionVo.getActiveStatus()))
				continue;
			
			if(assessmentQuestionVo.getQuestionIsNotNull() && isNotActive(assessmentQuestionVo.getQuestion().getStatus()))
				continue;
			
			DynamicGridRow row = dynGrid.getRows().newRow();
			createRowCells(row);
			
			DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP));
			cell.setReadOnly(true);
			cell.setValue(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
			cell.setTooltip(getQuestionTooltip(assessmentQuestionVo));
			
			if(isDppGrid())
			{
				cell = row.getCells().get(getGridColumn(COLUMN_DPPGROUP));
				engine.populate(cell, groupsColl);
				cell.setValue(getDppQuestionGroup(assessmentQuestionVo, assessment));
			}
			else
			{
				//engine.populate(row.getCells().get(getGridColumn(COLUMN_STATUS)), ims.core.vo.lookups.LookupHelper.getPreActiveActiveInactiveStatus(this.domain.getLookupService()));
				cell = row.getCells().get(getGridColumn(COLUMN_STATUS));
				for (int j = 0; j < activeColl.size(); j++)
				{
					PreActiveActiveInactiveStatus lkup = activeColl.get(j);
					cell.getItems().newItem(lkup, lkup.getImage());
				}
	
				cell = row.getCells().get(getGridColumn(COLUMN_MANDATORY));
				cell.setValue(assessmentQuestionVo.getIsMandatory());
				cell = row.getCells().get(getGridColumn(COLUMN_MULTIANSWERS));
				cell.setValue(assessmentQuestionVo.getAllowsMultipleAnswers());
				cell = row.getCells().get(getGridColumn(COLUMN_STATUS));
				cell.setValue(assessmentQuestionVo.getActiveStatus());
			}
			
			row.setValue(assessmentQuestionVo);
		}
	}
}
 
Example 49
Project: openmaxims-linux   File: Logic.java   Source Code and License 4 votes vote down vote up
private void populateSingleGroupFlat(UserAssessmentVo assessment, int viewMode)
{
	AssessmentQuestionGroupVoCollection hiddenGroups = new AssessmentQuestionGroupVoCollection();
	if(assessment.getQuestionGroupsIsNotNull() && assessment.getQuestionGroups().size() > 0)
		hiddenGroups.add(assessment.getQuestionGroups().get(0)); //we should only have 1 item
	
	form.getLocalContext().setHiddenGroups(hiddenGroups);
	
	if(assessment.getQuestionGroups().size() > 0)
	{
		for(int i = 0; i < assessment.getQuestionGroups().get(0).getQuestions().size(); i++)
		{
			AssessmentQuestionVo assessmentQuestionVo = assessment.getQuestionGroups().get(0).getQuestions().get(i);
			if(isNotActive(assessmentQuestionVo.getActiveStatus()))
				continue;
			
			if(assessmentQuestionVo.getQuestionIsNotNull() && isNotActive(assessmentQuestionVo.getQuestion().getStatus()))
				continue;
			
			DynamicGridRow row = form.lyrTabs().tabAssessments().dyngrdDetails().getRows().newRow();
			createRowCells(row, viewMode);
			
			//engine.populate(row.getCells().get(getGridColumn(COLUMN_STATUS)), ims.core.vo.lookups.LookupHelper.getPreActiveActiveInactiveStatus(this.domain.getLookupService()));
			PreActiveActiveInactiveStatusCollection lookupColl = ims.core.vo.lookups.LookupHelper.getPreActiveActiveInactiveStatus(this.domain.getLookupService());
			DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_STATUS));
			for (int j = 0; j < lookupColl.size(); j++)
			{
				PreActiveActiveInactiveStatus lkup = lookupColl.get(j);
				cell.getItems().newItem(lkup, lkup.getImage());
			}

			cell = row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP));
			cell.setReadOnly(true);
			cell.setValue(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getShortText() : "");
			cell.setTooltip(getQuestionTooltip(assessmentQuestionVo));
			cell = row.getCells().get(getGridColumn(COLUMN_MANDATORY));
			cell.setValue(assessmentQuestionVo.getIsMandatory());
			cell = row.getCells().get(getGridColumn(COLUMN_MULTIANSWERS));
			cell.setValue(assessmentQuestionVo.getAllowsMultipleAnswers());
			cell = row.getCells().get(getGridColumn(COLUMN_STATUS));
			cell.setValue(assessmentQuestionVo.getActiveStatus());
			
			if(isDpp())
			{
				DynamicGridColumn colNonStandard = getGridColumn(COLUMN_NONSTANDARD);
				if(colNonStandard != null)
				{
					DynamicGridCell cellNonStandard = row.getCells().get(colNonStandard);
					if(cellNonStandard != null)
					{
						cellNonStandard.setValue(assessmentQuestionVo.getIsNonStandard());
					}
				}
			}
			
			row.setValue(assessmentQuestionVo);
			// row tooltip no longer supported
			// row.setTooltip(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
		}
	}
}
 
Example 50
Project: openmaxims-linux   File: StructuredAssessmentsHelper.java   Source Code and License 4 votes vote down vote up
public AssessmentQuestionGroupVoCollection populateGrid(UserAssessmentVo assessment)
{
	return populateGrid(assessment, null);
}
 
Example 51
Project: openmaxims-linux   File: StructuredAssessmentsHelper.java   Source Code and License 4 votes vote down vote up
public void addQuestionToGrid(AssessmentQuestionVo assessmentQuestionVo, AssessmentQuestionGroupVoCollection groupColl)
{
	if(assessmentQuestionVo == null)
		return;
	
	DynamicGridRow row = null;
	switch (viewMode)
	{
		case MULTIPLE_GROUP_NO_FLAT :
			row = dynGrid.getSelectedRow();
			if(row != null)
				row = row.getRows().newRow();
		break;
		case MULTIPLE_GROUP_FLAT :
		case SINGLE_GROUP_FLAT :
			row = dynGrid.getRows().newRow();
		break;
		default :
		break;
	}
	
	createRowCells(row);
	
	row.setValue(assessmentQuestionVo);
	row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)).setValue(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
	row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP)).setTooltip(getQuestionTooltip(assessmentQuestionVo));
	row.getCells().get(getGridColumn(COLUMN_MANDATORY)).setValue(assessmentQuestionVo.getIsMandatory());
	row.getCells().get(getGridColumn(COLUMN_MULTIANSWERS)).setValue(assessmentQuestionVo.getAllowsMultipleAnswers());
	engine.populate(row.getCells().get(getGridColumn(COLUMN_STATUS)), activeColl);
	row.getCells().get(getGridColumn(COLUMN_STATUS)).setValue(PreActiveActiveInactiveStatus.ACTIVE);
	
	if(viewMode == MULTIPLE_GROUP_FLAT)
	{
		DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_GROUP));

		for(int i = 0; groupColl != null && i < groupColl.size(); i++)
		{
			cell.getItems().newItem(groupColl.get(i));
		}
	}
	
	if(viewMode == MULTIPLE_GROUP_NO_FLAT)
	{
		row.setExpandedImage(imgQuestion);
		row.setCollapsedImage(imgQuestion);
	}
}
 
Example 52
Project: openmaxims-linux   File: StructuredAssessmentsHelper.java   Source Code and License 4 votes vote down vote up
private void populateSingleGroupFlat(UserAssessmentVo assessment)
{
	AssessmentQuestionGroupVoCollection hiddenGroups = new AssessmentQuestionGroupVoCollection();
	if(assessment.getQuestionGroupsIsNotNull() && assessment.getQuestionGroups().size() > 0)
		hiddenGroups.add(assessment.getQuestionGroups().get(0)); //we should only have 1 item
	
	//TODO - check if the calling context gets updated
	contextHiddenGroups = hiddenGroups;
	
	if(assessment.getQuestionGroups().size() > 0)
	{
		for(int i = 0; i < assessment.getQuestionGroups().get(0).getQuestions().size(); i++)
		{
			AssessmentQuestionVo assessmentQuestionVo = assessment.getQuestionGroups().get(0).getQuestions().get(i);
			if(isNotActive(assessmentQuestionVo.getActiveStatus()))
				continue;
			
			if(assessmentQuestionVo.getQuestionIsNotNull() && isNotActive(assessmentQuestionVo.getQuestion().getStatus()))
				continue;
			
			DynamicGridRow row = dynGrid.getRows().newRow();
			createRowCells(row);
			
			DynamicGridCell cell = row.getCells().get(getGridColumn(COLUMN_QUESTIONGROUP));
			cell.setReadOnly(true);
			cell.setValue(assessmentQuestionVo.getQuestionIsNotNull() ? assessmentQuestionVo.getQuestion().getText() : "");
			cell.setTooltip(getQuestionTooltip(assessmentQuestionVo));
			
			if(isDppGrid())
			{
				cell = row.getCells().get(getGridColumn(COLUMN_DPPGROUP));
				engine.populate(cell, groupsColl);
				cell.setValue(getDppQuestionGroup(assessmentQuestionVo, assessment));
			}
			else
			{
				//engine.populate(row.getCells().get(getGridColumn(COLUMN_STATUS)), ims.core.vo.lookups.LookupHelper.getPreActiveActiveInactiveStatus(this.domain.getLookupService()));
				cell = row.getCells().get(getGridColumn(COLUMN_STATUS));
				for (int j = 0; j < activeColl.size(); j++)
				{
					PreActiveActiveInactiveStatus lkup = activeColl.get(j);
					cell.getItems().newItem(lkup, lkup.getImage());
				}
	
				cell = row.getCells().get(getGridColumn(COLUMN_MANDATORY));
				cell.setValue(assessmentQuestionVo.getIsMandatory());
				cell = row.getCells().get(getGridColumn(COLUMN_MULTIANSWERS));
				cell.setValue(assessmentQuestionVo.getAllowsMultipleAnswers());
				cell = row.getCells().get(getGridColumn(COLUMN_STATUS));
				cell.setValue(assessmentQuestionVo.getActiveStatus());
			}
			
			row.setValue(assessmentQuestionVo);
		}
	}
}