Java Code Examples for ims.assessment.vo.PatientGraphicAssessmentQuestionAnswerVoCollection

The following are top voted examples for showing how to use ims.assessment.vo.PatientGraphicAssessmentQuestionAnswerVoCollection. 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
public String[] validateGraphicAnswers()
{
	PatientGraphicAssessmentQuestionAnswerVoCollection answers = getGraphicAnswers();
	if (answers == null)
		return null;

	ArrayList<String> errors = new ArrayList<String>();
	for (int i = 0; i < answers.size(); i++)
	{
		errors = validateGraphicAnswer(answers.get(i), errors);
	}

	if (errors.size() > 0)
	{
		String[] result = new String[errors.size()];
		errors.toArray(result);
		return result;
	}

	return null;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private PatientGraphicAssessmentQuestionAnswerVo findOrCreateAnswer(PatientGraphicAssessmentQuestionAnswerVoCollection answers, GraphicAssessmentQuestionVo question)
{
	if (answers == null || question == null)
		return new PatientGraphicAssessmentQuestionAnswerVo();

	for (int x = 0; x < answers.size(); x++)
	{
		PatientGraphicAssessmentQuestionAnswerVo answer = answers.get(x);
		if (answer != null && answer.getGraphicQuestionIsNotNull() && answer.getGraphicQuestion().equals(question))
		{
			return answer;
		}
	}

	return new PatientGraphicAssessmentQuestionAnswerVo();
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateGraphicQuestions(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if (data.getGraphicQuestion() == null)
		return;

	ims.assessment.vo.PatientGraphicAssessmentQuestionAnswerVoCollection voColl = null;
	for (int i = 0; i < data.getGraphicQuestion().size(); i++)
	{
		if (voColl == null)
			voColl = new ims.assessment.vo.PatientGraphicAssessmentQuestionAnswerVoCollection();
		voColl.add(data.getGraphicQuestion().get(i));
	}

	voColl = sortGraphicQuestionsByIndex(voColl);
	for (int i = 0; i < voColl.size(); i++)
	{
		addGraphicQuestionRow(voColl.get(i).getGraphicQuestion(), voColl.get(i), allowMutlipleAnswers(voColl.get(i).getGraphicQuestion()));
	}
}
 
Example 4
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("unchecked")
public String[] validateGraphicAnswers()
{
	PatientGraphicAssessmentQuestionAnswerVoCollection answers = getGraphicAnswers(null);
	if(answers == null)
		return null;
	
	ArrayList errors = new ArrayList();
	for (int i = 0; i < answers.size(); i++)
	{
		errors = validateGraphicAnswer(answers.get(i), errors);
	}
	
	if(errors.size() > 0)
	{
		String[] result = new String[errors.size()];
		errors.toArray(result);
		return result;
	}
	
	return null;
}
 
Example 5
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private PatientGraphicAssessmentQuestionAnswerVo findOrCreateAnswer(PatientGraphicAssessmentQuestionAnswerVoCollection answers, GraphicAssessmentQuestionVo question)
{
	if(answers == null || question == null)
		return new PatientGraphicAssessmentQuestionAnswerVo();
	
	for(int x = 0; x < answers.size(); x++)
	{
		PatientGraphicAssessmentQuestionAnswerVo answer = answers.get(x);
		if(answer != null 
				&& answer.getGraphicQuestionIsNotNull()
				&& answer.getGraphicQuestion().equals(question))
		{
			return answer;
		}
	}
	
	return new PatientGraphicAssessmentQuestionAnswerVo();
}
 
Example 6
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private void populateGraphicQuestions(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if(data.getGraphicQuestion() == null)
		return;

	ims.assessment.vo.PatientGraphicAssessmentQuestionAnswerVoCollection voColl = null;
	for(int i = 0; i < data.getGraphicQuestion().size(); i++)
	{
		if(voColl == null)
			voColl = new ims.assessment.vo.PatientGraphicAssessmentQuestionAnswerVoCollection();
		voColl.add(data.getGraphicQuestion().get(i));
	}
	
	voColl = sortGraphicQuestionsByIndex(voColl);
	for(int i = 0; i < voColl.size(); i++)
	{
		addGraphicQuestionRow(voColl.get(i).getGraphicQuestion(), voColl.get(i), allowMutlipleAnswers(voColl.get(i).getGraphicQuestion()));
	}
}
 
Example 7
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public String[] validateGraphicAnswers()
{
	PatientGraphicAssessmentQuestionAnswerVoCollection answers = getGraphicAnswers();
	if (answers == null)
		return null;

	ArrayList<String> errors = new ArrayList<String>();
	for (int i = 0; i < answers.size(); i++)
	{
		errors = validateGraphicAnswer(answers.get(i), errors);
	}

	if (errors.size() > 0)
	{
		String[] result = new String[errors.size()];
		errors.toArray(result);
		return result;
	}

	return null;
}
 
Example 8
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private PatientGraphicAssessmentQuestionAnswerVo findOrCreateAnswer(PatientGraphicAssessmentQuestionAnswerVoCollection answers, GraphicAssessmentQuestionVo question)
{
	if (answers == null || question == null)
		return new PatientGraphicAssessmentQuestionAnswerVo();

	for (int x = 0; x < answers.size(); x++)
	{
		PatientGraphicAssessmentQuestionAnswerVo answer = answers.get(x);
		if (answer != null && answer.getGraphicQuestionIsNotNull() && answer.getGraphicQuestion().equals(question))
		{
			return answer;
		}
	}

	return new PatientGraphicAssessmentQuestionAnswerVo();
}
 
Example 9
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateGraphicQuestions(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if (data.getGraphicQuestion() == null)
		return;

	ims.assessment.vo.PatientGraphicAssessmentQuestionAnswerVoCollection voColl = null;
	for (int i = 0; i < data.getGraphicQuestion().size(); i++)
	{
		if (voColl == null)
			voColl = new ims.assessment.vo.PatientGraphicAssessmentQuestionAnswerVoCollection();
		voColl.add(data.getGraphicQuestion().get(i));
	}

	voColl = sortGraphicQuestionsByIndex(voColl);
	for (int i = 0; i < voColl.size(); i++)
	{
		addGraphicQuestionRow(voColl.get(i).getGraphicQuestion(), voColl.get(i), allowMutlipleAnswers(voColl.get(i).getGraphicQuestion()));
	}
}
 
Example 10
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("unchecked")
public String[] validateGraphicAnswers()
{
	PatientGraphicAssessmentQuestionAnswerVoCollection answers = getGraphicAnswers(null);
	if(answers == null)
		return null;
	
	ArrayList errors = new ArrayList();
	for (int i = 0; i < answers.size(); i++)
	{
		errors = validateGraphicAnswer(answers.get(i), errors);
	}
	
	if(errors.size() > 0)
	{
		String[] result = new String[errors.size()];
		errors.toArray(result);
		return result;
	}
	
	return null;
}
 
Example 11
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private PatientGraphicAssessmentQuestionAnswerVo findOrCreateAnswer(PatientGraphicAssessmentQuestionAnswerVoCollection answers, GraphicAssessmentQuestionVo question)
{
	if(answers == null || question == null)
		return new PatientGraphicAssessmentQuestionAnswerVo();
	
	for(int x = 0; x < answers.size(); x++)
	{
		PatientGraphicAssessmentQuestionAnswerVo answer = answers.get(x);
		if(answer != null 
				&& answer.getGraphicQuestionIsNotNull()
				&& answer.getGraphicQuestion().equals(question))
		{
			return answer;
		}
	}
	
	return new PatientGraphicAssessmentQuestionAnswerVo();
}
 
Example 12
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private void populateGraphicQuestions(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if(data.getGraphicQuestion() == null)
		return;

	ims.assessment.vo.PatientGraphicAssessmentQuestionAnswerVoCollection voColl = null;
	for(int i = 0; i < data.getGraphicQuestion().size(); i++)
	{
		if(voColl == null)
			voColl = new ims.assessment.vo.PatientGraphicAssessmentQuestionAnswerVoCollection();
		voColl.add(data.getGraphicQuestion().get(i));
	}
	
	voColl = sortGraphicQuestionsByIndex(voColl);
	for(int i = 0; i < voColl.size(); i++)
	{
		addGraphicQuestionRow(voColl.get(i).getGraphicQuestion(), voColl.get(i), allowMutlipleAnswers(voColl.get(i).getGraphicQuestion()));
	}
}
 
Example 13
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public String[] validateGraphicAnswers()
{
	PatientGraphicAssessmentQuestionAnswerVoCollection answers = getGraphicAnswers();
	if (answers == null)
		return null;

	ArrayList<String> errors = new ArrayList<String>();
	for (int i = 0; i < answers.size(); i++)
	{
		errors = validateGraphicAnswer(answers.get(i), errors);
	}

	if (errors.size() > 0)
	{
		String[] result = new String[errors.size()];
		errors.toArray(result);
		return result;
	}

	return null;
}
 
Example 14
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private PatientGraphicAssessmentQuestionAnswerVo findOrCreateAnswer(PatientGraphicAssessmentQuestionAnswerVoCollection answers, GraphicAssessmentQuestionVo question)
{
	if (answers == null || question == null)
		return new PatientGraphicAssessmentQuestionAnswerVo();

	for (int x = 0; x < answers.size(); x++)
	{
		PatientGraphicAssessmentQuestionAnswerVo answer = answers.get(x);
		if (answer != null && answer.getGraphicQuestionIsNotNull() && answer.getGraphicQuestion().equals(question))
		{
			return answer;
		}
	}

	return new PatientGraphicAssessmentQuestionAnswerVo();
}
 
Example 15
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateGraphicQuestions(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if (data.getGraphicQuestion() == null)
		return;

	ims.assessment.vo.PatientGraphicAssessmentQuestionAnswerVoCollection voColl = null;
	for (int i = 0; i < data.getGraphicQuestion().size(); i++)
	{
		if (voColl == null)
			voColl = new ims.assessment.vo.PatientGraphicAssessmentQuestionAnswerVoCollection();
		voColl.add(data.getGraphicQuestion().get(i));
	}

	voColl = sortGraphicQuestionsByIndex(voColl);
	for (int i = 0; i < voColl.size(); i++)
	{
		addGraphicQuestionRow(voColl.get(i).getGraphicQuestion(), voColl.get(i), allowMutlipleAnswers(voColl.get(i).getGraphicQuestion()));
	}
}
 
Example 16
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("unchecked")
public String[] validateGraphicAnswers()
{
	PatientGraphicAssessmentQuestionAnswerVoCollection answers = getGraphicAnswers(null);
	if(answers == null)
		return null;
	
	ArrayList errors = new ArrayList();
	for (int i = 0; i < answers.size(); i++)
	{
		errors = validateGraphicAnswer(answers.get(i), errors);
	}
	
	if(errors.size() > 0)
	{
		String[] result = new String[errors.size()];
		errors.toArray(result);
		return result;
	}
	
	return null;
}
 
Example 17
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private PatientGraphicAssessmentQuestionAnswerVo findOrCreateAnswer(PatientGraphicAssessmentQuestionAnswerVoCollection answers, GraphicAssessmentQuestionVo question)
{
	if(answers == null || question == null)
		return new PatientGraphicAssessmentQuestionAnswerVo();
	
	for(int x = 0; x < answers.size(); x++)
	{
		PatientGraphicAssessmentQuestionAnswerVo answer = answers.get(x);
		if(answer != null 
				&& answer.getGraphicQuestionIsNotNull()
				&& answer.getGraphicQuestion().equals(question))
		{
			return answer;
		}
	}
	
	return new PatientGraphicAssessmentQuestionAnswerVo();
}
 
Example 18
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private void populateGraphicQuestions(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if(data.getGraphicQuestion() == null)
		return;

	ims.assessment.vo.PatientGraphicAssessmentQuestionAnswerVoCollection voColl = null;
	for(int i = 0; i < data.getGraphicQuestion().size(); i++)
	{
		if(voColl == null)
			voColl = new ims.assessment.vo.PatientGraphicAssessmentQuestionAnswerVoCollection();
		voColl.add(data.getGraphicQuestion().get(i));
	}
	
	voColl = sortGraphicQuestionsByIndex(voColl);
	for(int i = 0; i < voColl.size(); i++)
	{
		addGraphicQuestionRow(voColl.get(i).getGraphicQuestion(), voColl.get(i), allowMutlipleAnswers(voColl.get(i).getGraphicQuestion()));
	}
}
 
Example 19
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
public String[] validateGraphicAnswers()
{
	PatientGraphicAssessmentQuestionAnswerVoCollection answers = getGraphicAnswers();
	if (answers == null)
		return null;

	ArrayList<String> errors = new ArrayList<String>();
	for (int i = 0; i < answers.size(); i++)
	{
		errors = validateGraphicAnswer(answers.get(i), errors);
	}

	if (errors.size() > 0)
	{
		String[] result = new String[errors.size()];
		errors.toArray(result);
		return result;
	}

	return null;
}
 
Example 20
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private PatientGraphicAssessmentQuestionAnswerVo findOrCreateAnswer(PatientGraphicAssessmentQuestionAnswerVoCollection answers, GraphicAssessmentQuestionVo question)
{
	if (answers == null || question == null)
		return new PatientGraphicAssessmentQuestionAnswerVo();

	for (int x = 0; x < answers.size(); x++)
	{
		PatientGraphicAssessmentQuestionAnswerVo answer = answers.get(x);
		if (answer != null && answer.getGraphicQuestionIsNotNull() && answer.getGraphicQuestion().equals(question))
		{
			return answer;
		}
	}

	return new PatientGraphicAssessmentQuestionAnswerVo();
}
 
Example 21
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateGraphicQuestions(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if (data.getGraphicQuestion() == null)
		return;

	ims.assessment.vo.PatientGraphicAssessmentQuestionAnswerVoCollection voColl = null;
	for (int i = 0; i < data.getGraphicQuestion().size(); i++)
	{
		if (voColl == null)
			voColl = new ims.assessment.vo.PatientGraphicAssessmentQuestionAnswerVoCollection();
		voColl.add(data.getGraphicQuestion().get(i));
	}

	voColl = sortGraphicQuestionsByIndex(voColl);
	for (int i = 0; i < voColl.size(); i++)
	{
		addGraphicQuestionRow(voColl.get(i).getGraphicQuestion(), voColl.get(i), allowMutlipleAnswers(voColl.get(i).getGraphicQuestion()));
	}
}
 
Example 22
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("unchecked")
public String[] validateGraphicAnswers()
{
	PatientGraphicAssessmentQuestionAnswerVoCollection answers = getGraphicAnswers(null);
	if(answers == null)
		return null;
	
	ArrayList errors = new ArrayList();
	for (int i = 0; i < answers.size(); i++)
	{
		errors = validateGraphicAnswer(answers.get(i), errors);
	}
	
	if(errors.size() > 0)
	{
		String[] result = new String[errors.size()];
		errors.toArray(result);
		return result;
	}
	
	return null;
}
 
Example 23
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private PatientGraphicAssessmentQuestionAnswerVo findOrCreateAnswer(PatientGraphicAssessmentQuestionAnswerVoCollection answers, GraphicAssessmentQuestionVo question)
{
	if(answers == null || question == null)
		return new PatientGraphicAssessmentQuestionAnswerVo();
	
	for(int x = 0; x < answers.size(); x++)
	{
		PatientGraphicAssessmentQuestionAnswerVo answer = answers.get(x);
		if(answer != null 
				&& answer.getGraphicQuestionIsNotNull()
				&& answer.getGraphicQuestion().equals(question))
		{
			return answer;
		}
	}
	
	return new PatientGraphicAssessmentQuestionAnswerVo();
}
 
Example 24
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   Source Code and License 6 votes vote down vote up
private void populateGraphicQuestions(PatientAssessmentDataVo data) throws PresentationLogicException
{
	if(data.getGraphicQuestion() == null)
		return;

	ims.assessment.vo.PatientGraphicAssessmentQuestionAnswerVoCollection voColl = null;
	for(int i = 0; i < data.getGraphicQuestion().size(); i++)
	{
		if(voColl == null)
			voColl = new ims.assessment.vo.PatientGraphicAssessmentQuestionAnswerVoCollection();
		voColl.add(data.getGraphicQuestion().get(i));
	}
	
	voColl = sortGraphicQuestionsByIndex(voColl);
	for(int i = 0; i < voColl.size(); i++)
	{
		addGraphicQuestionRow(voColl.get(i).getGraphicQuestion(), voColl.get(i), allowMutlipleAnswers(voColl.get(i).getGraphicQuestion()));
	}
}
 
Example 25
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
public PatientGraphicAssessmentQuestionAnswerVoCollection getGraphicAnswers()
{
	PatientGraphicAssessmentQuestionAnswerVoCollection answers = new PatientGraphicAssessmentQuestionAnswerVoCollection();

	for (int x = 0; x < this.grid.getRows().size(); x++)
	{
		answers = updateGraphicQuestion(answers, this.grid.getRows().get(x));
	}

	return answers;
}
 
Example 26
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setAnswersGraphic(PatientGraphicAssessmentQuestionAnswerVoCollection answers)
{
	if (answers == null || answers.size() <= 0)
		return;

	for (int x = 0; x < answers.size(); x++)
	{
		PatientGraphicAssessmentQuestionAnswerVo answerGraphic = answers.get(x);
		setQuestionRowAnswer(answerGraphic, null);
	}
}
 
Example 27
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private PatientGraphicAssessmentQuestionAnswerVoCollection sortGraphicQuestionsByIndex(PatientGraphicAssessmentQuestionAnswerVoCollection questionsToBeSorted)
{
	if (questionsToBeSorted == null)
		return new PatientGraphicAssessmentQuestionAnswerVoCollection();

	int size = questionsToBeSorted.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++)
		{
			PatientGraphicAssessmentQuestionAnswerVo source = questionsToBeSorted.get(sorted[x]);
			PatientGraphicAssessmentQuestionAnswerVo compare = questionsToBeSorted.get(sorted[y]);

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

	PatientGraphicAssessmentQuestionAnswerVoCollection sortedQuestions = new PatientGraphicAssessmentQuestionAnswerVoCollection();
	for (int x = 0; x < size; x++)
	{
		sortedQuestions.add(questionsToBeSorted.get(sorted[x]));
	}

	return sortedQuestions;
}
 
Example 28
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private void setAnswersGraphic(PatientGraphicAssessmentQuestionAnswerVoCollection answers)
{
	if(answers == null || answers.size() <= 0)
		return;

	for(int x = 0; x < answers.size(); x++)
	{
		PatientGraphicAssessmentQuestionAnswerVo answerGraphic = answers.get(x);
		setQuestionRowAnswer(answerGraphic);
	}
}
 
Example 29
Project: AvoinApotti   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private PatientGraphicAssessmentQuestionAnswerVoCollection sortGraphicQuestionsByIndex(PatientGraphicAssessmentQuestionAnswerVoCollection questionsToBeSorted)
{
	if(questionsToBeSorted == null)
		return new PatientGraphicAssessmentQuestionAnswerVoCollection();

	int size = questionsToBeSorted.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++)
		{
			PatientGraphicAssessmentQuestionAnswerVo source = questionsToBeSorted.get(sorted[x]);
			PatientGraphicAssessmentQuestionAnswerVo compare = questionsToBeSorted.get(sorted[y]);
				
			if(source.getGraphicQuestionIsNotNull() && compare.getGraphicQuestionIsNotNull())
			{
				if(source.getGraphicQuestion().getSequenceIsNotNull())
				if(source.getGraphicQuestion().getSequence().compareTo(compare.getGraphicQuestion().getSequence()) < 0)
				{
					int temp = sorted[x]; 
					sorted[x] = sorted[y];
					sorted[y] = temp;	
				}
			}
		}
	}
	
	PatientGraphicAssessmentQuestionAnswerVoCollection sortedQuestions = new PatientGraphicAssessmentQuestionAnswerVoCollection();
	for(int x = 0; x < size; x++)
	{
		sortedQuestions.add(questionsToBeSorted.get(sorted[x]));
	}
	
	return sortedQuestions;
}
 
Example 30
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
public PatientGraphicAssessmentQuestionAnswerVoCollection getGraphicAnswers()
{
	PatientGraphicAssessmentQuestionAnswerVoCollection answers = new PatientGraphicAssessmentQuestionAnswerVoCollection();

	for (int x = 0; x < this.grid.getRows().size(); x++)
	{
		answers = updateGraphicQuestion(answers, this.grid.getRows().get(x));
	}

	return answers;
}
 
Example 31
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setAnswersGraphic(PatientGraphicAssessmentQuestionAnswerVoCollection answers)
{
	if (answers == null || answers.size() <= 0)
		return;

	for (int x = 0; x < answers.size(); x++)
	{
		PatientGraphicAssessmentQuestionAnswerVo answerGraphic = answers.get(x);
		setQuestionRowAnswer(answerGraphic, null);
	}
}
 
Example 32
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private PatientGraphicAssessmentQuestionAnswerVoCollection sortGraphicQuestionsByIndex(PatientGraphicAssessmentQuestionAnswerVoCollection questionsToBeSorted)
{
	if (questionsToBeSorted == null)
		return new PatientGraphicAssessmentQuestionAnswerVoCollection();

	int size = questionsToBeSorted.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++)
		{
			PatientGraphicAssessmentQuestionAnswerVo source = questionsToBeSorted.get(sorted[x]);
			PatientGraphicAssessmentQuestionAnswerVo compare = questionsToBeSorted.get(sorted[y]);

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

	PatientGraphicAssessmentQuestionAnswerVoCollection sortedQuestions = new PatientGraphicAssessmentQuestionAnswerVoCollection();
	for (int x = 0; x < size; x++)
	{
		sortedQuestions.add(questionsToBeSorted.get(sorted[x]));
	}

	return sortedQuestions;
}
 
Example 33
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private void setAnswersGraphic(PatientGraphicAssessmentQuestionAnswerVoCollection answers)
{
	if(answers == null || answers.size() <= 0)
		return;

	for(int x = 0; x < answers.size(); x++)
	{
		PatientGraphicAssessmentQuestionAnswerVo answerGraphic = answers.get(x);
		setQuestionRowAnswer(answerGraphic);
	}
}
 
Example 34
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private PatientGraphicAssessmentQuestionAnswerVoCollection sortGraphicQuestionsByIndex(PatientGraphicAssessmentQuestionAnswerVoCollection questionsToBeSorted)
{
	if(questionsToBeSorted == null)
		return new PatientGraphicAssessmentQuestionAnswerVoCollection();

	int size = questionsToBeSorted.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++)
		{
			PatientGraphicAssessmentQuestionAnswerVo source = questionsToBeSorted.get(sorted[x]);
			PatientGraphicAssessmentQuestionAnswerVo compare = questionsToBeSorted.get(sorted[y]);
				
			if(source.getGraphicQuestionIsNotNull() && compare.getGraphicQuestionIsNotNull())
			{
				if(source.getGraphicQuestion().getSequenceIsNotNull())
				if(source.getGraphicQuestion().getSequence().compareTo(compare.getGraphicQuestion().getSequence()) < 0)
				{
					int temp = sorted[x]; 
					sorted[x] = sorted[y];
					sorted[y] = temp;	
				}
			}
		}
	}
	
	PatientGraphicAssessmentQuestionAnswerVoCollection sortedQuestions = new PatientGraphicAssessmentQuestionAnswerVoCollection();
	for(int x = 0; x < size; x++)
	{
		sortedQuestions.add(questionsToBeSorted.get(sorted[x]));
	}
	
	return sortedQuestions;
}
 
Example 35
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
public PatientGraphicAssessmentQuestionAnswerVoCollection getGraphicAnswers()
{
	PatientGraphicAssessmentQuestionAnswerVoCollection answers = new PatientGraphicAssessmentQuestionAnswerVoCollection();

	for (int x = 0; x < this.grid.getRows().size(); x++)
	{
		answers = updateGraphicQuestion(answers, this.grid.getRows().get(x));
	}

	return answers;
}
 
Example 36
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setAnswersGraphic(PatientGraphicAssessmentQuestionAnswerVoCollection answers)
{
	if (answers == null || answers.size() <= 0)
		return;

	for (int x = 0; x < answers.size(); x++)
	{
		PatientGraphicAssessmentQuestionAnswerVo answerGraphic = answers.get(x);
		setQuestionRowAnswer(answerGraphic, null);
	}
}
 
Example 37
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private PatientGraphicAssessmentQuestionAnswerVoCollection sortGraphicQuestionsByIndex(PatientGraphicAssessmentQuestionAnswerVoCollection questionsToBeSorted)
{
	if (questionsToBeSorted == null)
		return new PatientGraphicAssessmentQuestionAnswerVoCollection();

	int size = questionsToBeSorted.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++)
		{
			PatientGraphicAssessmentQuestionAnswerVo source = questionsToBeSorted.get(sorted[x]);
			PatientGraphicAssessmentQuestionAnswerVo compare = questionsToBeSorted.get(sorted[y]);

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

	PatientGraphicAssessmentQuestionAnswerVoCollection sortedQuestions = new PatientGraphicAssessmentQuestionAnswerVoCollection();
	for (int x = 0; x < size; x++)
	{
		sortedQuestions.add(questionsToBeSorted.get(sorted[x]));
	}

	return sortedQuestions;
}
 
Example 38
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private void setAnswersGraphic(PatientGraphicAssessmentQuestionAnswerVoCollection answers)
{
	if(answers == null || answers.size() <= 0)
		return;

	for(int x = 0; x < answers.size(); x++)
	{
		PatientGraphicAssessmentQuestionAnswerVo answerGraphic = answers.get(x);
		setQuestionRowAnswer(answerGraphic);
	}
}
 
Example 39
Project: openMAXIMS   File: UserAssessmentInstHelper.java   Source Code and License 5 votes vote down vote up
private PatientGraphicAssessmentQuestionAnswerVoCollection sortGraphicQuestionsByIndex(PatientGraphicAssessmentQuestionAnswerVoCollection questionsToBeSorted)
{
	if(questionsToBeSorted == null)
		return new PatientGraphicAssessmentQuestionAnswerVoCollection();

	int size = questionsToBeSorted.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++)
		{
			PatientGraphicAssessmentQuestionAnswerVo source = questionsToBeSorted.get(sorted[x]);
			PatientGraphicAssessmentQuestionAnswerVo compare = questionsToBeSorted.get(sorted[y]);
				
			if(source.getGraphicQuestionIsNotNull() && compare.getGraphicQuestionIsNotNull())
			{
				if(source.getGraphicQuestion().getSequenceIsNotNull())
				if(source.getGraphicQuestion().getSequence().compareTo(compare.getGraphicQuestion().getSequence()) < 0)
				{
					int temp = sorted[x]; 
					sorted[x] = sorted[y];
					sorted[y] = temp;	
				}
			}
		}
	}
	
	PatientGraphicAssessmentQuestionAnswerVoCollection sortedQuestions = new PatientGraphicAssessmentQuestionAnswerVoCollection();
	for(int x = 0; x < size; x++)
	{
		sortedQuestions.add(questionsToBeSorted.get(sorted[x]));
	}
	
	return sortedQuestions;
}
 
Example 40
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
public PatientGraphicAssessmentQuestionAnswerVoCollection getGraphicAnswers()
{
	PatientGraphicAssessmentQuestionAnswerVoCollection answers = new PatientGraphicAssessmentQuestionAnswerVoCollection();

	for (int x = 0; x < this.grid.getRows().size(); x++)
	{
		answers = updateGraphicQuestion(answers, this.grid.getRows().get(x));
	}

	return answers;
}