Java Code Examples for ims.assessment.vo.PatientAssessmentQuestionVoCollection

The following are top voted examples for showing how to use ims.assessment.vo.PatientAssessmentQuestionVoCollection. 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 PatientAssessmentQuestionVo findOrCreateAnswer(PatientAssessmentQuestionVoCollection assesmentQuestions, AssessmentQuestionVo question)
{
	if (assesmentQuestions == null || question == null)
		return new PatientAssessmentQuestionVo();

	for (int x = 0; x < assesmentQuestions.size(); x++)
	{
		PatientAssessmentQuestionVo assessmentQuestion = assesmentQuestions.get(x);
		if (assessmentQuestion != null && assessmentQuestion.getAssessmentQuestionIsNotNull() && assessmentQuestion.getAssessmentQuestion().equals(question))
		{
			return assessmentQuestion;
		}
	}

	return new PatientAssessmentQuestionVo();
}
 
Example 2
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 3
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo findOrCreateAnswer(PatientAssessmentQuestionVoCollection assesmentQuestions, AssessmentQuestionVo question)
{
	if(assesmentQuestions == null || question == null)
		return new PatientAssessmentQuestionVo();
	
	for(int x = 0; x < assesmentQuestions.size(); x++)
	{
		PatientAssessmentQuestionVo assessmentQuestion = assesmentQuestions.get(x);
		if(assessmentQuestion != null 
				&& assessmentQuestion.getAssessmentQuestionIsNotNull()
				&& assessmentQuestion.getAssessmentQuestion().equals(question))
		{
			return assessmentQuestion;
		}
	}
	
	return new PatientAssessmentQuestionVo();
}
 
Example 4
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 5
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo findOrCreateAnswer(PatientAssessmentQuestionVoCollection assesmentQuestions, AssessmentQuestionVo question)
{
	if (assesmentQuestions == null || question == null)
		return new PatientAssessmentQuestionVo();

	for (int x = 0; x < assesmentQuestions.size(); x++)
	{
		PatientAssessmentQuestionVo assessmentQuestion = assesmentQuestions.get(x);
		if (assessmentQuestion != null && assessmentQuestion.getAssessmentQuestionIsNotNull() && assessmentQuestion.getAssessmentQuestion().equals(question))
		{
			return assessmentQuestion;
		}
	}

	return new PatientAssessmentQuestionVo();
}
 
Example 6
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 7
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo findOrCreateAnswer(PatientAssessmentQuestionVoCollection assesmentQuestions, AssessmentQuestionVo question)
{
	if(assesmentQuestions == null || question == null)
		return new PatientAssessmentQuestionVo();
	
	for(int x = 0; x < assesmentQuestions.size(); x++)
	{
		PatientAssessmentQuestionVo assessmentQuestion = assesmentQuestions.get(x);
		if(assessmentQuestion != null 
				&& assessmentQuestion.getAssessmentQuestionIsNotNull()
				&& assessmentQuestion.getAssessmentQuestion().equals(question))
		{
			return assessmentQuestion;
		}
	}
	
	return new PatientAssessmentQuestionVo();
}
 
Example 8
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 9
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo findOrCreateAnswer(PatientAssessmentQuestionVoCollection assesmentQuestions, AssessmentQuestionVo question)
{
	if (assesmentQuestions == null || question == null)
		return new PatientAssessmentQuestionVo();

	for (int x = 0; x < assesmentQuestions.size(); x++)
	{
		PatientAssessmentQuestionVo assessmentQuestion = assesmentQuestions.get(x);
		if (assessmentQuestion != null && assessmentQuestion.getAssessmentQuestionIsNotNull() && assessmentQuestion.getAssessmentQuestion().equals(question))
		{
			return assessmentQuestion;
		}
	}

	return new PatientAssessmentQuestionVo();
}
 
Example 10
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 11
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo findOrCreateAnswer(PatientAssessmentQuestionVoCollection assesmentQuestions, AssessmentQuestionVo question)
{
	if(assesmentQuestions == null || question == null)
		return new PatientAssessmentQuestionVo();
	
	for(int x = 0; x < assesmentQuestions.size(); x++)
	{
		PatientAssessmentQuestionVo assessmentQuestion = assesmentQuestions.get(x);
		if(assessmentQuestion != null 
				&& assessmentQuestion.getAssessmentQuestionIsNotNull()
				&& assessmentQuestion.getAssessmentQuestion().equals(question))
		{
			return assessmentQuestion;
		}
	}
	
	return new PatientAssessmentQuestionVo();
}
 
Example 12
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 13
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo findOrCreateAnswer(PatientAssessmentQuestionVoCollection assesmentQuestions, AssessmentQuestionVo question)
{
	if (assesmentQuestions == null || question == null)
		return new PatientAssessmentQuestionVo();

	for (int x = 0; x < assesmentQuestions.size(); x++)
	{
		PatientAssessmentQuestionVo assessmentQuestion = assesmentQuestions.get(x);
		if (assessmentQuestion != null && assessmentQuestion.getAssessmentQuestionIsNotNull() && assessmentQuestion.getAssessmentQuestion().equals(question))
		{
			return assessmentQuestion;
		}
	}

	return new PatientAssessmentQuestionVo();
}
 
Example 14
Project: openmaxims-linux   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 15
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientAssessmentQuestionVo findOrCreateAnswer(PatientAssessmentQuestionVoCollection assesmentQuestions, AssessmentQuestionVo question)
{
	if(assesmentQuestions == null || question == null)
		return new PatientAssessmentQuestionVo();
	
	for(int x = 0; x < assesmentQuestions.size(); x++)
	{
		PatientAssessmentQuestionVo assessmentQuestion = assesmentQuestions.get(x);
		if(assessmentQuestion != null 
				&& assessmentQuestion.getAssessmentQuestionIsNotNull()
				&& assessmentQuestion.getAssessmentQuestion().equals(question))
		{
			return assessmentQuestion;
		}
	}
	
	return new PatientAssessmentQuestionVo();
}
 
Example 16
Project: openmaxims-linux   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 17
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private PatientAssessmentQuestionVoCollection getPatientAssessmentVoCollection(PatientAssessmentGroupVoCollection answers, AssessmentQuestionGroupVo questionGroup)
{
	for (int i = 0; answers != null && i < answers.size(); i++)
	{
		if (answers.get(i).getAssessmentQuestionGroupIsNotNull() && answers.get(i).getAssessmentQuestionGroup().equals(questionGroup))
			return answers.get(i).getAssessmentAnswers();
	}

	return new PatientAssessmentQuestionVoCollection();
}
 
Example 18
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private PatientAssessmentQuestionVoCollection sortAnswersBySequence(PatientAssessmentQuestionVoCollection answersToBeSorted)
{
	if (answersToBeSorted == null)
		return new PatientAssessmentQuestionVoCollection();

	int size = answersToBeSorted.size();
	int[] sorted = new int[size];
	for (int x = 0; x < size; x++)
	{
		sorted[x] = x;
	}

	for (int x = 0; x < size; x++)
	{
		for (int y = 0; y < size; y++)
		{
			PatientAssessmentQuestionVo source = answersToBeSorted.get(sorted[x]);
			PatientAssessmentQuestionVo compare = answersToBeSorted.get(sorted[y]);

			if (source.getSequenceIsNotNull() && compare.getSequenceIsNotNull())
			{
				if (source.getSequence().compareTo(compare.getSequence()) < 0)
				{
					int temp = sorted[x];
					sorted[x] = sorted[y];
					sorted[y] = temp;
				}
			}
		}
	}

	PatientAssessmentQuestionVoCollection sortedAnswers = new PatientAssessmentQuestionVoCollection();
	for (int x = 0; x < size; x++)
	{
		sortedAnswers.add(answersToBeSorted.get(sorted[x]));
	}

	return sortedAnswers;
}
 
Example 19
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private PatientAssessmentQuestionVoCollection getPatientAssessmentVoCollection(PatientAssessmentGroupVoCollection answers, AssessmentQuestionGroupVo questionGroup)
{
	for (int i = 0; answers != null && i < answers.size(); i++)
	{
		if(answers.get(i).getAssessmentQuestionGroupIsNotNull() && answers.get(i).getAssessmentQuestionGroup().equals(questionGroup))
			return answers.get(i).getAssessmentAnswers();
	}

	return new PatientAssessmentQuestionVoCollection();
}
 
Example 20
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private PatientAssessmentQuestionVoCollection sortAnswersBySequence(PatientAssessmentQuestionVoCollection answersToBeSorted)
{
	if(answersToBeSorted == null)
		return new PatientAssessmentQuestionVoCollection();
	
	int size = answersToBeSorted.size();
	int[] sorted = new int[size];
	for(int x = 0; x < size; x++)
	{
		sorted[x] = x;
	}
	
	for(int x = 0; x < size; x++)
	{
		for(int y = 0; y < size; y++)
		{
			PatientAssessmentQuestionVo source = answersToBeSorted.get(sorted[x]);
			PatientAssessmentQuestionVo compare = answersToBeSorted.get(sorted[y]);
				
			if(source.getSequenceIsNotNull() && compare.getSequenceIsNotNull())
			{
				if(source.getSequence().compareTo(compare.getSequence()) < 0)
				{
					int temp = sorted[x]; 
					sorted[x] = sorted[y];
					sorted[y] = temp;	
				}
			}
		}
	}
	
	PatientAssessmentQuestionVoCollection sortedAnswers = new PatientAssessmentQuestionVoCollection();
	for(int x = 0; x < size; x++)
	{
		sortedAnswers.add(answersToBeSorted.get(sorted[x]));
	}
	
	return sortedAnswers;
}
 
Example 21
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private PatientAssessmentQuestionVoCollection getPatientAssessmentVoCollection(PatientAssessmentGroupVoCollection answers, AssessmentQuestionGroupVo questionGroup)
{
	for (int i = 0; answers != null && i < answers.size(); i++)
	{
		if (answers.get(i).getAssessmentQuestionGroupIsNotNull() && answers.get(i).getAssessmentQuestionGroup().equals(questionGroup))
			return answers.get(i).getAssessmentAnswers();
	}

	return new PatientAssessmentQuestionVoCollection();
}
 
Example 22
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private PatientAssessmentQuestionVoCollection sortAnswersBySequence(PatientAssessmentQuestionVoCollection answersToBeSorted)
{
	if (answersToBeSorted == null)
		return new PatientAssessmentQuestionVoCollection();

	int size = answersToBeSorted.size();
	int[] sorted = new int[size];
	for (int x = 0; x < size; x++)
	{
		sorted[x] = x;
	}

	for (int x = 0; x < size; x++)
	{
		for (int y = 0; y < size; y++)
		{
			PatientAssessmentQuestionVo source = answersToBeSorted.get(sorted[x]);
			PatientAssessmentQuestionVo compare = answersToBeSorted.get(sorted[y]);

			if (source.getSequenceIsNotNull() && compare.getSequenceIsNotNull())
			{
				if (source.getSequence().compareTo(compare.getSequence()) < 0)
				{
					int temp = sorted[x];
					sorted[x] = sorted[y];
					sorted[y] = temp;
				}
			}
		}
	}

	PatientAssessmentQuestionVoCollection sortedAnswers = new PatientAssessmentQuestionVoCollection();
	for (int x = 0; x < size; x++)
	{
		sortedAnswers.add(answersToBeSorted.get(sorted[x]));
	}

	return sortedAnswers;
}
 
Example 23
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private PatientAssessmentQuestionVoCollection getPatientAssessmentVoCollection(PatientAssessmentGroupVoCollection answers, AssessmentQuestionGroupVo questionGroup)
{
	for (int i = 0; answers != null && i < answers.size(); i++)
	{
		if(answers.get(i).getAssessmentQuestionGroupIsNotNull() && answers.get(i).getAssessmentQuestionGroup().equals(questionGroup))
			return answers.get(i).getAssessmentAnswers();
	}

	return new PatientAssessmentQuestionVoCollection();
}
 
Example 24
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private PatientAssessmentQuestionVoCollection sortAnswersBySequence(PatientAssessmentQuestionVoCollection answersToBeSorted)
{
	if(answersToBeSorted == null)
		return new PatientAssessmentQuestionVoCollection();
	
	int size = answersToBeSorted.size();
	int[] sorted = new int[size];
	for(int x = 0; x < size; x++)
	{
		sorted[x] = x;
	}
	
	for(int x = 0; x < size; x++)
	{
		for(int y = 0; y < size; y++)
		{
			PatientAssessmentQuestionVo source = answersToBeSorted.get(sorted[x]);
			PatientAssessmentQuestionVo compare = answersToBeSorted.get(sorted[y]);
				
			if(source.getSequenceIsNotNull() && compare.getSequenceIsNotNull())
			{
				if(source.getSequence().compareTo(compare.getSequence()) < 0)
				{
					int temp = sorted[x]; 
					sorted[x] = sorted[y];
					sorted[y] = temp;	
				}
			}
		}
	}
	
	PatientAssessmentQuestionVoCollection sortedAnswers = new PatientAssessmentQuestionVoCollection();
	for(int x = 0; x < size; x++)
	{
		sortedAnswers.add(answersToBeSorted.get(sorted[x]));
	}
	
	return sortedAnswers;
}
 
Example 25
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private PatientAssessmentQuestionVoCollection getPatientAssessmentVoCollection(PatientAssessmentGroupVoCollection answers, AssessmentQuestionGroupVo questionGroup)
{
	for (int i = 0; answers != null && i < answers.size(); i++)
	{
		if (answers.get(i).getAssessmentQuestionGroupIsNotNull() && answers.get(i).getAssessmentQuestionGroup().equals(questionGroup))
			return answers.get(i).getAssessmentAnswers();
	}

	return new PatientAssessmentQuestionVoCollection();
}
 
Example 26
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private PatientAssessmentQuestionVoCollection sortAnswersBySequence(PatientAssessmentQuestionVoCollection answersToBeSorted)
{
	if (answersToBeSorted == null)
		return new PatientAssessmentQuestionVoCollection();

	int size = answersToBeSorted.size();
	int[] sorted = new int[size];
	for (int x = 0; x < size; x++)
	{
		sorted[x] = x;
	}

	for (int x = 0; x < size; x++)
	{
		for (int y = 0; y < size; y++)
		{
			PatientAssessmentQuestionVo source = answersToBeSorted.get(sorted[x]);
			PatientAssessmentQuestionVo compare = answersToBeSorted.get(sorted[y]);

			if (source.getSequenceIsNotNull() && compare.getSequenceIsNotNull())
			{
				if (source.getSequence().compareTo(compare.getSequence()) < 0)
				{
					int temp = sorted[x];
					sorted[x] = sorted[y];
					sorted[y] = temp;
				}
			}
		}
	}

	PatientAssessmentQuestionVoCollection sortedAnswers = new PatientAssessmentQuestionVoCollection();
	for (int x = 0; x < size; x++)
	{
		sortedAnswers.add(answersToBeSorted.get(sorted[x]));
	}

	return sortedAnswers;
}
 
Example 27
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private PatientAssessmentQuestionVoCollection getPatientAssessmentVoCollection(PatientAssessmentGroupVoCollection answers, AssessmentQuestionGroupVo questionGroup)
{
	for (int i = 0; answers != null && i < answers.size(); i++)
	{
		if(answers.get(i).getAssessmentQuestionGroupIsNotNull() && answers.get(i).getAssessmentQuestionGroup().equals(questionGroup))
			return answers.get(i).getAssessmentAnswers();
	}

	return new PatientAssessmentQuestionVoCollection();
}
 
Example 28
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private PatientAssessmentQuestionVoCollection sortAnswersBySequence(PatientAssessmentQuestionVoCollection answersToBeSorted)
{
	if(answersToBeSorted == null)
		return new PatientAssessmentQuestionVoCollection();
	
	int size = answersToBeSorted.size();
	int[] sorted = new int[size];
	for(int x = 0; x < size; x++)
	{
		sorted[x] = x;
	}
	
	for(int x = 0; x < size; x++)
	{
		for(int y = 0; y < size; y++)
		{
			PatientAssessmentQuestionVo source = answersToBeSorted.get(sorted[x]);
			PatientAssessmentQuestionVo compare = answersToBeSorted.get(sorted[y]);
				
			if(source.getSequenceIsNotNull() && compare.getSequenceIsNotNull())
			{
				if(source.getSequence().compareTo(compare.getSequence()) < 0)
				{
					int temp = sorted[x]; 
					sorted[x] = sorted[y];
					sorted[y] = temp;	
				}
			}
		}
	}
	
	PatientAssessmentQuestionVoCollection sortedAnswers = new PatientAssessmentQuestionVoCollection();
	for(int x = 0; x < size; x++)
	{
		sortedAnswers.add(answersToBeSorted.get(sorted[x]));
	}
	
	return sortedAnswers;
}
 
Example 29
Project: openmaxims-linux   File: Logic.java   View source code 5 votes vote down vote up
private PatientAssessmentQuestionVoCollection getPatientAssessmentVoCollection(PatientAssessmentGroupVoCollection answers, AssessmentQuestionGroupVo questionGroup)
{
	for (int i = 0; answers != null && i < answers.size(); i++)
	{
		if (answers.get(i).getAssessmentQuestionGroupIsNotNull() && answers.get(i).getAssessmentQuestionGroup().equals(questionGroup))
			return answers.get(i).getAssessmentAnswers();
	}

	return new PatientAssessmentQuestionVoCollection();
}
 
Example 30
Project: openmaxims-linux   File: Logic.java   View source code 5 votes vote down vote up
private PatientAssessmentQuestionVoCollection sortAnswersBySequence(PatientAssessmentQuestionVoCollection answersToBeSorted)
{
	if (answersToBeSorted == null)
		return new PatientAssessmentQuestionVoCollection();

	int size = answersToBeSorted.size();
	int[] sorted = new int[size];
	for (int x = 0; x < size; x++)
	{
		sorted[x] = x;
	}

	for (int x = 0; x < size; x++)
	{
		for (int y = 0; y < size; y++)
		{
			PatientAssessmentQuestionVo source = answersToBeSorted.get(sorted[x]);
			PatientAssessmentQuestionVo compare = answersToBeSorted.get(sorted[y]);

			if (source.getSequenceIsNotNull() && compare.getSequenceIsNotNull())
			{
				if (source.getSequence().compareTo(compare.getSequence()) < 0)
				{
					int temp = sorted[x];
					sorted[x] = sorted[y];
					sorted[y] = temp;
				}
			}
		}
	}

	PatientAssessmentQuestionVoCollection sortedAnswers = new PatientAssessmentQuestionVoCollection();
	for (int x = 0; x < size; x++)
	{
		sortedAnswers.add(answersToBeSorted.get(sorted[x]));
	}

	return sortedAnswers;
}
 
Example 31
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private PatientAssessmentQuestionVoCollection getPatientAssessmentVoCollection(PatientAssessmentGroupVoCollection answers, AssessmentQuestionGroupVo questionGroup)
{
	for (int i = 0; answers != null && i < answers.size(); i++)
	{
		if(answers.get(i).getAssessmentQuestionGroupIsNotNull() && answers.get(i).getAssessmentQuestionGroup().equals(questionGroup))
			return answers.get(i).getAssessmentAnswers();
	}

	return new PatientAssessmentQuestionVoCollection();
}
 
Example 32
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private PatientAssessmentQuestionVoCollection sortAnswersBySequence(PatientAssessmentQuestionVoCollection answersToBeSorted)
{
	if(answersToBeSorted == null)
		return new PatientAssessmentQuestionVoCollection();
	
	int size = answersToBeSorted.size();
	int[] sorted = new int[size];
	for(int x = 0; x < size; x++)
	{
		sorted[x] = x;
	}
	
	for(int x = 0; x < size; x++)
	{
		for(int y = 0; y < size; y++)
		{
			PatientAssessmentQuestionVo source = answersToBeSorted.get(sorted[x]);
			PatientAssessmentQuestionVo compare = answersToBeSorted.get(sorted[y]);
				
			if(source.getSequenceIsNotNull() && compare.getSequenceIsNotNull())
			{
				if(source.getSequence().compareTo(compare.getSequence()) < 0)
				{
					int temp = sorted[x]; 
					sorted[x] = sorted[y];
					sorted[y] = temp;	
				}
			}
		}
	}
	
	PatientAssessmentQuestionVoCollection sortedAnswers = new PatientAssessmentQuestionVoCollection();
	for(int x = 0; x < size; x++)
	{
		sortedAnswers.add(answersToBeSorted.get(sorted[x]));
	}
	
	return sortedAnswers;
}
 
Example 33
Project: AvoinApotti   File: DailyPatientProgressHelper.java   View source code 4 votes vote down vote up
private TotalScore calculateAnswersScore(PatientAssessmentQuestionVoCollection voColl, TotalScore totalScore)
{
	if(totalScore == null)
		totalScore = new TotalScore();

	for (int l = 0; voColl != null && l < voColl.size(); l++)
	{
		PatientAssessmentQuestionVo voPatAssessQuestion = voColl.get(l);

		if (voPatAssessQuestion == null || !isAnswered(voPatAssessQuestion) || !hasAnswers(voPatAssessQuestion))
			continue;

		int highestScore = -1;
		int partialTotalScore = 0;
		for (int i = 0; i < voPatAssessQuestion.getPatientAnswers().size(); i++)
		{
			PatientAssessmentAnswerVo voPatAssessAnswer = voPatAssessQuestion.getPatientAnswers().get(i);
			if (voPatAssessAnswer != null)
			{
				for (int j = 0; j < voPatAssessAnswer.getAnswerDetails().size(); j++)
				{
					AnswerDetailsVo voAnswerDetails = voPatAssessAnswer.getAnswerDetails().get(j);
					for (int k = 0; voAnswerDetails.getMultiSelectAnswersIsNotNull() && k < voAnswerDetails.getMultiSelectAnswers().size(); k++)
					{
						AnswerOptionVo voAnswerOption = voAnswerDetails.getMultiSelectAnswers().get(k);
						if (voAnswerOption.getScoreIsNotNull())
						{
							int score = voAnswerOption.getScore().intValue();
							if (score > 2)
								continue;
							partialTotalScore = partialTotalScore + score;
							if (score > highestScore)
								highestScore = score;
						}
					}
				}
			}
		}

		if(highestScore == GREEN_SCORE)
		{
			totalScore.addToGreenScore(1);
		}
		else if(highestScore == YELLOW_SCORE)
		{
			totalScore.addToYellowScore(1);
		}
		else if(highestScore == RED_SCORE)
		{
			totalScore.addToRedScore(1);
		}
		
		totalScore.addToTotalScore(partialTotalScore);
	}
	
	return totalScore;
}
 
Example 34
Project: openMAXIMS   File: DailyPatientProgressHelper.java   View source code 4 votes vote down vote up
private TotalScore calculateAnswersScore(PatientAssessmentQuestionVoCollection voColl, TotalScore totalScore)
{
	if(totalScore == null)
		totalScore = new TotalScore();

	for (int l = 0; voColl != null && l < voColl.size(); l++)
	{
		PatientAssessmentQuestionVo voPatAssessQuestion = voColl.get(l);

		if (voPatAssessQuestion == null || !isAnswered(voPatAssessQuestion) || !hasAnswers(voPatAssessQuestion))
			continue;

		int highestScore = -1;
		int partialTotalScore = 0;
		for (int i = 0; i < voPatAssessQuestion.getPatientAnswers().size(); i++)
		{
			PatientAssessmentAnswerVo voPatAssessAnswer = voPatAssessQuestion.getPatientAnswers().get(i);
			if (voPatAssessAnswer != null)
			{
				for (int j = 0; j < voPatAssessAnswer.getAnswerDetails().size(); j++)
				{
					AnswerDetailsVo voAnswerDetails = voPatAssessAnswer.getAnswerDetails().get(j);
					for (int k = 0; voAnswerDetails.getMultiSelectAnswersIsNotNull() && k < voAnswerDetails.getMultiSelectAnswers().size(); k++)
					{
						AnswerOptionVo voAnswerOption = voAnswerDetails.getMultiSelectAnswers().get(k);
						if (voAnswerOption.getScoreIsNotNull())
						{
							int score = voAnswerOption.getScore().intValue();
							if (score > 2)
								continue;
							partialTotalScore = partialTotalScore + score;
							if (score > highestScore)
								highestScore = score;
						}
					}
				}
			}
		}

		if(highestScore == GREEN_SCORE)
		{
			totalScore.addToGreenScore(1);
		}
		else if(highestScore == YELLOW_SCORE)
		{
			totalScore.addToYellowScore(1);
		}
		else if(highestScore == RED_SCORE)
		{
			totalScore.addToRedScore(1);
		}
		
		totalScore.addToTotalScore(partialTotalScore);
	}
	
	return totalScore;
}
 
Example 35
Project: openMAXIMS   File: DailyPatientProgressHelper.java   View source code 4 votes vote down vote up
private TotalScore calculateAnswersScore(PatientAssessmentQuestionVoCollection voColl, TotalScore totalScore)
{
	if(totalScore == null)
		totalScore = new TotalScore();

	for (int l = 0; voColl != null && l < voColl.size(); l++)
	{
		PatientAssessmentQuestionVo voPatAssessQuestion = voColl.get(l);

		if (voPatAssessQuestion == null || !isAnswered(voPatAssessQuestion) || !hasAnswers(voPatAssessQuestion))
			continue;

		int highestScore = -1;
		int partialTotalScore = 0;
		for (int i = 0; i < voPatAssessQuestion.getPatientAnswers().size(); i++)
		{
			PatientAssessmentAnswerVo voPatAssessAnswer = voPatAssessQuestion.getPatientAnswers().get(i);
			if (voPatAssessAnswer != null)
			{
				for (int j = 0; j < voPatAssessAnswer.getAnswerDetails().size(); j++)
				{
					AnswerDetailsVo voAnswerDetails = voPatAssessAnswer.getAnswerDetails().get(j);
					for (int k = 0; voAnswerDetails.getMultiSelectAnswersIsNotNull() && k < voAnswerDetails.getMultiSelectAnswers().size(); k++)
					{
						AnswerOptionVo voAnswerOption = voAnswerDetails.getMultiSelectAnswers().get(k);
						if (voAnswerOption.getScoreIsNotNull())
						{
							int score = voAnswerOption.getScore().intValue();
							if (score > 2)
								continue;
							partialTotalScore = partialTotalScore + score;
							if (score > highestScore)
								highestScore = score;
						}
					}
				}
			}
		}

		if(highestScore == GREEN_SCORE)
		{
			totalScore.addToGreenScore(1);
		}
		else if(highestScore == YELLOW_SCORE)
		{
			totalScore.addToYellowScore(1);
		}
		else if(highestScore == RED_SCORE)
		{
			totalScore.addToRedScore(1);
		}
		
		totalScore.addToTotalScore(partialTotalScore);
	}
	
	return totalScore;
}
 
Example 36
Project: openmaxims-linux   File: DailyPatientProgressHelper.java   View source code 4 votes vote down vote up
private TotalScore calculateAnswersScore(PatientAssessmentQuestionVoCollection voColl, TotalScore totalScore)
{
	if(totalScore == null)
		totalScore = new TotalScore();

	for (int l = 0; voColl != null && l < voColl.size(); l++)
	{
		PatientAssessmentQuestionVo voPatAssessQuestion = voColl.get(l);

		if (voPatAssessQuestion == null || !isAnswered(voPatAssessQuestion) || !hasAnswers(voPatAssessQuestion))
			continue;

		int highestScore = -1;
		int partialTotalScore = 0;
		for (int i = 0; i < voPatAssessQuestion.getPatientAnswers().size(); i++)
		{
			PatientAssessmentAnswerVo voPatAssessAnswer = voPatAssessQuestion.getPatientAnswers().get(i);
			if (voPatAssessAnswer != null)
			{
				for (int j = 0; j < voPatAssessAnswer.getAnswerDetails().size(); j++)
				{
					AnswerDetailsVo voAnswerDetails = voPatAssessAnswer.getAnswerDetails().get(j);
					for (int k = 0; voAnswerDetails.getMultiSelectAnswersIsNotNull() && k < voAnswerDetails.getMultiSelectAnswers().size(); k++)
					{
						AnswerOptionVo voAnswerOption = voAnswerDetails.getMultiSelectAnswers().get(k);
						if (voAnswerOption.getScoreIsNotNull())
						{
							int score = voAnswerOption.getScore().intValue();
							if (score > 2)
								continue;
							partialTotalScore = partialTotalScore + score;
							if (score > highestScore)
								highestScore = score;
						}
					}
				}
			}
		}

		if(highestScore == GREEN_SCORE)
		{
			totalScore.addToGreenScore(1);
		}
		else if(highestScore == YELLOW_SCORE)
		{
			totalScore.addToYellowScore(1);
		}
		else if(highestScore == RED_SCORE)
		{
			totalScore.addToRedScore(1);
		}
		
		totalScore.addToTotalScore(partialTotalScore);
	}
	
	return totalScore;
}