Java Code Examples for ims.assessment.vo.PatientGraphicAssessmentFindingQuestionAnswerVo

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

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

	return new PatientGraphicAssessmentFindingQuestionAnswerVo();
}
 
Example 2
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
private ArrayList validateGraphicFindingAnswer(PatientGraphicAssessmentFindingQuestionAnswerVo answer, ArrayList errors)
{
	if(errors == null)
		errors = new ArrayList();	

	if(answer == null || answer.getGraphicFindingQuestion() == null || answer.getPatientAnswers() == null)
		return errors;
	
	QuestionInformationVo question = answer.getGraphicFindingQuestion().getQuestion();
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();
	
	validateAllAnswers(errors, question, patientAnswers, isMandatory);
	return errors;
}
 
Example 3
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientGraphicAssessmentFindingQuestionAnswerVo findOrCreateAnswer(PatientGraphicAssessmentFindingQuestionAnswerVoCollection answers, GraphicAssessmentFindingQuestionVo question)
{
	if(answers == null || question == null)
		return new PatientGraphicAssessmentFindingQuestionAnswerVo();
	
	for(int x = 0; x < answers.size(); x++)
	{
		PatientGraphicAssessmentFindingQuestionAnswerVo answer = answers.get(x);
		if(answer != null 
				&& answer.getGraphicFindingQuestionIsNotNull()
				&& answer.getGraphicFindingQuestion().equals(question))
		{
			return answer;
		}
	}
	
	return new PatientGraphicAssessmentFindingQuestionAnswerVo();
}
 
Example 4
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PatientGraphicAssessmentFindingQuestionAnswerVo findOrCreateAnswer(PatientGraphicAssessmentFindingQuestionAnswerVoCollection answers, GraphicAssessmentFindingQuestionVo question)
{
	if (answers == null || question == null)
		return new PatientGraphicAssessmentFindingQuestionAnswerVo();

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

	return new PatientGraphicAssessmentFindingQuestionAnswerVo();
}
 
Example 5
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
private ArrayList validateGraphicFindingAnswer(PatientGraphicAssessmentFindingQuestionAnswerVo answer, ArrayList errors)
{
	if(errors == null)
		errors = new ArrayList();	

	if(answer == null || answer.getGraphicFindingQuestion() == null || answer.getPatientAnswers() == null)
		return errors;
	
	QuestionInformationVo question = answer.getGraphicFindingQuestion().getQuestion();
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();
	
	validateAllAnswers(errors, question, patientAnswers, isMandatory);
	return errors;
}
 
Example 6
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientGraphicAssessmentFindingQuestionAnswerVo findOrCreateAnswer(PatientGraphicAssessmentFindingQuestionAnswerVoCollection answers, GraphicAssessmentFindingQuestionVo question)
{
	if(answers == null || question == null)
		return new PatientGraphicAssessmentFindingQuestionAnswerVo();
	
	for(int x = 0; x < answers.size(); x++)
	{
		PatientGraphicAssessmentFindingQuestionAnswerVo answer = answers.get(x);
		if(answer != null 
				&& answer.getGraphicFindingQuestionIsNotNull()
				&& answer.getGraphicFindingQuestion().equals(question))
		{
			return answer;
		}
	}
	
	return new PatientGraphicAssessmentFindingQuestionAnswerVo();
}
 
Example 7
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private PatientGraphicAssessmentFindingQuestionAnswerVo findOrCreateAnswer(PatientGraphicAssessmentFindingQuestionAnswerVoCollection answers, GraphicAssessmentFindingQuestionVo question)
{
	if (answers == null || question == null)
		return new PatientGraphicAssessmentFindingQuestionAnswerVo();

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

	return new PatientGraphicAssessmentFindingQuestionAnswerVo();
}
 
Example 8
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
private ArrayList validateGraphicFindingAnswer(PatientGraphicAssessmentFindingQuestionAnswerVo answer, ArrayList errors)
{
	if(errors == null)
		errors = new ArrayList();	

	if(answer == null || answer.getGraphicFindingQuestion() == null || answer.getPatientAnswers() == null)
		return errors;
	
	QuestionInformationVo question = answer.getGraphicFindingQuestion().getQuestion();
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();
	
	validateAllAnswers(errors, question, patientAnswers, isMandatory);
	return errors;
}
 
Example 9
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientGraphicAssessmentFindingQuestionAnswerVo findOrCreateAnswer(PatientGraphicAssessmentFindingQuestionAnswerVoCollection answers, GraphicAssessmentFindingQuestionVo question)
{
	if(answers == null || question == null)
		return new PatientGraphicAssessmentFindingQuestionAnswerVo();
	
	for(int x = 0; x < answers.size(); x++)
	{
		PatientGraphicAssessmentFindingQuestionAnswerVo answer = answers.get(x);
		if(answer != null 
				&& answer.getGraphicFindingQuestionIsNotNull()
				&& answer.getGraphicFindingQuestion().equals(question))
		{
			return answer;
		}
	}
	
	return new PatientGraphicAssessmentFindingQuestionAnswerVo();
}
 
Example 10
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private PatientGraphicAssessmentFindingQuestionAnswerVo findOrCreateAnswer(PatientGraphicAssessmentFindingQuestionAnswerVoCollection answers, GraphicAssessmentFindingQuestionVo question)
{
	if (answers == null || question == null)
		return new PatientGraphicAssessmentFindingQuestionAnswerVo();

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

	return new PatientGraphicAssessmentFindingQuestionAnswerVo();
}
 
Example 11
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
@SuppressWarnings("unchecked")
private ArrayList validateGraphicFindingAnswer(PatientGraphicAssessmentFindingQuestionAnswerVo answer, ArrayList errors)
{
	if(errors == null)
		errors = new ArrayList();	

	if(answer == null || answer.getGraphicFindingQuestion() == null || answer.getPatientAnswers() == null)
		return errors;
	
	QuestionInformationVo question = answer.getGraphicFindingQuestion().getQuestion();
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();
	
	validateAllAnswers(errors, question, patientAnswers, isMandatory);
	return errors;
}
 
Example 12
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private PatientGraphicAssessmentFindingQuestionAnswerVo findOrCreateAnswer(PatientGraphicAssessmentFindingQuestionAnswerVoCollection answers, GraphicAssessmentFindingQuestionVo question)
{
	if(answers == null || question == null)
		return new PatientGraphicAssessmentFindingQuestionAnswerVo();
	
	for(int x = 0; x < answers.size(); x++)
	{
		PatientGraphicAssessmentFindingQuestionAnswerVo answer = answers.get(x);
		if(answer != null 
				&& answer.getGraphicFindingQuestionIsNotNull()
				&& answer.getGraphicFindingQuestion().equals(question))
		{
			return answer;
		}
	}
	
	return new PatientGraphicAssessmentFindingQuestionAnswerVo();
}
 
Example 13
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private ArrayList<String> validateGraphicFindingAnswer(PatientGraphicAssessmentFindingQuestionAnswerVo answer, ArrayList<String> errors)
{
	if (errors == null)
		errors = new ArrayList<String>();

	if (answer == null || answer.getGraphicFindingQuestion() == null || answer.getPatientAnswers() == null)
		return errors;

	QuestionInformationVo question = answer.getGraphicFindingQuestion().getQuestion();
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();

	validateAllAnswers(errors, question, patientAnswers, isMandatory);
	return errors;
}
 
Example 14
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void setAnswersGraphicFindings(PatientGraphicalAssessmentStageVoCollection stages)
{
	if (stages == null || stages.size() <= 0)
		return;

	// we need annotated stage
	PatientGraphicalAssessmentStageVo annotatedStage = null;
	for (int i = 0; i < stages.size(); i++)
	{
		PatientGraphicalAssessmentStageVo stage = stages.get(i);

		if (stage.getStageIsNotNull() && stage.getStage().getAssessmentStageIsNotNull() && stage.getStage().getAssessmentStage().getIsAnnotatedIsNotNull() && stage.getStage().getAssessmentStage().getIsAnnotated().booleanValue())
		{
			annotatedStage = stage;
			break;
		}
	}

	if (annotatedStage == null)
	{
		// we should always have an annotated stage
		annotatedStage = stages.get(0);
	}
	else
	{
		if (annotatedStage.getFindingQuestionIsNotNull())
		{
			for (int x = 0; x < annotatedStage.getFindingQuestion().size(); x++)
			{
				PatientGraphicAssessmentFindingQuestionAnswerVo answerGraphicFinding = annotatedStage.getFindingQuestion().get(x);
				setQuestionFindingRowAnswer(answerGraphicFinding);
			}
		}
	}
}
 
Example 15
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void setAnswersGraphicFindings(PatientGraphicalAssessmentStageVo pgasVo)
{
	if (pgasVo == null)
		return;

	if (pgasVo.getFindingQuestionIsNotNull())
	{
		for (int x = 0; x < pgasVo.getFindingQuestion().size(); x++)
		{
			PatientGraphicAssessmentFindingQuestionAnswerVo answerGraphicFinding = pgasVo.getFindingQuestion().get(x);
			setQuestionFindingRowAnswer(answerGraphicFinding);
		}
	}
}
 
Example 16
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private DynamicGridRow getRowByIdentifier(PatientGraphicAssessmentFindingQuestionAnswerVo graphicFindingQuestionAnswer)
{
	if (graphicFindingQuestionAnswer == null)
		return null;

	for (int x = 0; x < this.grid.getRows().size(); x++)
	{
		PatientGraphicAssessmentFindingQuestionAnswerVo findingAnswer = (PatientGraphicAssessmentFindingQuestionAnswerVo) (this.grid.getRows().get(x).getCells().get(this.grid.getColumns().getByIdentifier(QUESTION_COLUMN)).getIdentifier());
		if (graphicFindingQuestionAnswer.equals(findingAnswer))
			return this.grid.getRows().get(x);
	}

	return null;
}
 
Example 17
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private boolean setQuestionFindingRowAnswer(PatientGraphicAssessmentFindingQuestionAnswerVo graphicAnswer)
{
	if (graphicAnswer == null || graphicAnswer.getPatientAnswers() == null)
		return false;

	DynamicGridRow initialQuestionRow = null;
	DynamicGridRow questionRow = getRowByIdentifier(graphicAnswer);
	if (questionRow == null)
		return false;

	for (int i = 0; i < graphicAnswer.getPatientAnswers().size(); i++)
	{
		PatientAssessmentAnswerVo answerDetail = graphicAnswer.getPatientAnswers().get(i);

		if (answerDetail != null)
		{
			if (i > 0)
			{
				if (initialQuestionRow == null)
					initialQuestionRow = questionRow;

				questionRow = duplicateQuestionRow(initialQuestionRow);
			}

			for (int x = 0; x < answerDetail.getAnswerDetails().size(); x++)
			{
				AnswerDetailsVo answer = answerDetail.getAnswerDetails().get(x);
				DynamicGridCell cell = findCell(questionRow, answer.getAnswerType());

				if (cell != null)
				{
					setCellAnswer(cell, answer);
				}
			}
		}
	}

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

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

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

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

	return sortedQuestions;
}
 
Example 19
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private Boolean isAnswered(PatientGraphicAssessmentFindingQuestionAnswerVo answer)
{
	if(answer == null || answer.getPatientAnswers() == null)
		return Boolean.FALSE;
	
	for (int i = 0; i < answer.getPatientAnswers().size(); i++)
	{
		if(isAnswered(answer.getPatientAnswers().get(i)))
			return Boolean.TRUE;
	}
		
	return Boolean.FALSE;
}
 
Example 20
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private void setAnswersGraphicFindings(PatientGraphicalAssessmentStageVoCollection stages)
{
	if(stages == null || stages.size() <= 0)
		return;

	//we need annotated stage
	PatientGraphicalAssessmentStageVo annotatedStage = null;
	for (int i = 0; i < stages.size(); i++)
	{
		PatientGraphicalAssessmentStageVo stage = stages.get(i);
		
		if(stage.getStageIsNotNull() 
				&& stage.getStage().getAssessmentStageIsNotNull() 
				&& stage.getStage().getAssessmentStage().getIsAnnotatedIsNotNull()
				&& stage.getStage().getAssessmentStage().getIsAnnotated().booleanValue())
		{
			annotatedStage = stage;
			break;
		}
	}
	
	if(annotatedStage == null)
	{
		//we should always have an annotated stage
		annotatedStage = stages.get(0);
	}
	//else
	{
		if(annotatedStage.getFindingQuestionIsNotNull())
		{
			for(int x = 0; x < annotatedStage.getFindingQuestion().size(); x++)
			{
				PatientGraphicAssessmentFindingQuestionAnswerVo answerGraphicFinding = annotatedStage.getFindingQuestion().get(x);
				setQuestionFindingRowAnswer(answerGraphicFinding);
			}
		}
	}
}
 
Example 21
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private void setAnswersGraphicFindings(PatientGraphicalAssessmentStageVo pgasVo)
{
	if(pgasVo == null)
		return;

	if(pgasVo.getFindingQuestionIsNotNull())
	{
		for(int x = 0; x < pgasVo.getFindingQuestion().size(); x++)
		{
			PatientGraphicAssessmentFindingQuestionAnswerVo answerGraphicFinding = pgasVo.getFindingQuestion().get(x);
			setQuestionFindingRowAnswer(answerGraphicFinding);
		}
	}
}
 
Example 22
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private DynamicGridRow getRowByIdentifier(PatientGraphicAssessmentFindingQuestionAnswerVo graphicFindingQuestionAnswer)
{
	if(graphicFindingQuestionAnswer == null)
		return null;

	for(int x = 0; x < this.grid.getRows().size(); x++)
	{	
		PatientGraphicAssessmentFindingQuestionAnswerVo findingAnswer = (PatientGraphicAssessmentFindingQuestionAnswerVo)(this.grid.getRows().get(x).getCells().get(this.grid.getColumns().getByIdentifier(QUESTION_COLUMN)).getIdentifier());
		if(graphicFindingQuestionAnswer.equals(findingAnswer))
			return this.grid.getRows().get(x);
	}
	
	return null;
}
 
Example 23
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private PatientGraphicAssessmentFindingQuestionAnswerVoCollection sortGraphicQuestionsByIndex(PatientGraphicAssessmentFindingQuestionAnswerVoCollection questionsToBeSorted)
{
	if(questionsToBeSorted == null)
		return new PatientGraphicAssessmentFindingQuestionAnswerVoCollection();

	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++)
		{
			PatientGraphicAssessmentFindingQuestionAnswerVo source = questionsToBeSorted.get(sorted[x]);
			PatientGraphicAssessmentFindingQuestionAnswerVo compare = questionsToBeSorted.get(sorted[y]);
				
			if(source.getGraphicFindingQuestionIsNotNull() && compare.getGraphicFindingQuestionIsNotNull())
			{
				if(source.getGraphicFindingQuestion().getSequenceIsNotNull())
				if(source.getGraphicFindingQuestion().getSequence().compareTo(compare.getGraphicFindingQuestion().getSequence()) < 0)
				{
					int temp = sorted[x]; 
					sorted[x] = sorted[y];
					sorted[y] = temp;	
				}
			}
		}
	}
	
	PatientGraphicAssessmentFindingQuestionAnswerVoCollection sortedQuestions = new PatientGraphicAssessmentFindingQuestionAnswerVoCollection();
	for(int x = 0; x < size; x++)
	{
		sortedQuestions.add(questionsToBeSorted.get(sorted[x]));
	}
	
	return sortedQuestions;
}
 
Example 24
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private ArrayList<String> validateGraphicFindingAnswer(PatientGraphicAssessmentFindingQuestionAnswerVo answer, ArrayList<String> errors)
{
	if (errors == null)
		errors = new ArrayList<String>();

	if (answer == null || answer.getGraphicFindingQuestion() == null || answer.getPatientAnswers() == null)
		return errors;

	QuestionInformationVo question = answer.getGraphicFindingQuestion().getQuestion();
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();

	validateAllAnswers(errors, question, patientAnswers, isMandatory);
	return errors;
}
 
Example 25
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void setAnswersGraphicFindings(PatientGraphicalAssessmentStageVoCollection stages)
{
	if (stages == null || stages.size() <= 0)
		return;

	// we need annotated stage
	PatientGraphicalAssessmentStageVo annotatedStage = null;
	for (int i = 0; i < stages.size(); i++)
	{
		PatientGraphicalAssessmentStageVo stage = stages.get(i);

		if (stage.getStageIsNotNull() && stage.getStage().getAssessmentStageIsNotNull() && stage.getStage().getAssessmentStage().getIsAnnotatedIsNotNull() && stage.getStage().getAssessmentStage().getIsAnnotated().booleanValue())
		{
			annotatedStage = stage;
			break;
		}
	}

	if (annotatedStage == null)
	{
		// we should always have an annotated stage
		annotatedStage = stages.get(0);
	}
	else
	{
		if (annotatedStage.getFindingQuestionIsNotNull())
		{
			for (int x = 0; x < annotatedStage.getFindingQuestion().size(); x++)
			{
				PatientGraphicAssessmentFindingQuestionAnswerVo answerGraphicFinding = annotatedStage.getFindingQuestion().get(x);
				setQuestionFindingRowAnswer(answerGraphicFinding);
			}
		}
	}
}
 
Example 26
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void setAnswersGraphicFindings(PatientGraphicalAssessmentStageVo pgasVo)
{
	if (pgasVo == null)
		return;

	if (pgasVo.getFindingQuestionIsNotNull())
	{
		for (int x = 0; x < pgasVo.getFindingQuestion().size(); x++)
		{
			PatientGraphicAssessmentFindingQuestionAnswerVo answerGraphicFinding = pgasVo.getFindingQuestion().get(x);
			setQuestionFindingRowAnswer(answerGraphicFinding);
		}
	}
}
 
Example 27
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private DynamicGridRow getRowByIdentifier(PatientGraphicAssessmentFindingQuestionAnswerVo graphicFindingQuestionAnswer)
{
	if (graphicFindingQuestionAnswer == null)
		return null;

	for (int x = 0; x < this.grid.getRows().size(); x++)
	{
		PatientGraphicAssessmentFindingQuestionAnswerVo findingAnswer = (PatientGraphicAssessmentFindingQuestionAnswerVo) (this.grid.getRows().get(x).getCells().get(this.grid.getColumns().getByIdentifier(QUESTION_COLUMN)).getIdentifier());
		if (graphicFindingQuestionAnswer.equals(findingAnswer))
			return this.grid.getRows().get(x);
	}

	return null;
}
 
Example 28
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private boolean setQuestionFindingRowAnswer(PatientGraphicAssessmentFindingQuestionAnswerVo graphicAnswer)
{
	if (graphicAnswer == null || graphicAnswer.getPatientAnswers() == null)
		return false;

	DynamicGridRow initialQuestionRow = null;
	DynamicGridRow questionRow = getRowByIdentifier(graphicAnswer);
	if (questionRow == null)
		return false;

	for (int i = 0; i < graphicAnswer.getPatientAnswers().size(); i++)
	{
		PatientAssessmentAnswerVo answerDetail = graphicAnswer.getPatientAnswers().get(i);

		if (answerDetail != null)
		{
			if (i > 0)
			{
				if (initialQuestionRow == null)
					initialQuestionRow = questionRow;

				questionRow = duplicateQuestionRow(initialQuestionRow);
			}

			for (int x = 0; x < answerDetail.getAnswerDetails().size(); x++)
			{
				AnswerDetailsVo answer = answerDetail.getAnswerDetails().get(x);
				DynamicGridCell cell = findCell(questionRow, answer.getAnswerType());

				if (cell != null)
				{
					setCellAnswer(cell, answer);
				}
			}
		}
	}

	return true;
}
 
Example 29
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private PatientGraphicAssessmentFindingQuestionAnswerVoCollection sortGraphicQuestionsByIndex(PatientGraphicAssessmentFindingQuestionAnswerVoCollection questionsToBeSorted)
{
	if (questionsToBeSorted == null)
		return new PatientGraphicAssessmentFindingQuestionAnswerVoCollection();

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

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

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

	return sortedQuestions;
}
 
Example 30
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private Boolean isAnswered(PatientGraphicAssessmentFindingQuestionAnswerVo answer)
{
	if(answer == null || answer.getPatientAnswers() == null)
		return Boolean.FALSE;
	
	for (int i = 0; i < answer.getPatientAnswers().size(); i++)
	{
		if(isAnswered(answer.getPatientAnswers().get(i)))
			return Boolean.TRUE;
	}
		
	return Boolean.FALSE;
}
 
Example 31
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private void setAnswersGraphicFindings(PatientGraphicalAssessmentStageVoCollection stages)
{
	if(stages == null || stages.size() <= 0)
		return;

	//we need annotated stage
	PatientGraphicalAssessmentStageVo annotatedStage = null;
	for (int i = 0; i < stages.size(); i++)
	{
		PatientGraphicalAssessmentStageVo stage = stages.get(i);
		
		if(stage.getStageIsNotNull() 
				&& stage.getStage().getAssessmentStageIsNotNull() 
				&& stage.getStage().getAssessmentStage().getIsAnnotatedIsNotNull()
				&& stage.getStage().getAssessmentStage().getIsAnnotated().booleanValue())
		{
			annotatedStage = stage;
			break;
		}
	}
	
	if(annotatedStage == null)
	{
		//we should always have an annotated stage
		annotatedStage = stages.get(0);
	}
	//else
	{
		if(annotatedStage.getFindingQuestionIsNotNull())
		{
			for(int x = 0; x < annotatedStage.getFindingQuestion().size(); x++)
			{
				PatientGraphicAssessmentFindingQuestionAnswerVo answerGraphicFinding = annotatedStage.getFindingQuestion().get(x);
				setQuestionFindingRowAnswer(answerGraphicFinding);
			}
		}
	}
}
 
Example 32
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private void setAnswersGraphicFindings(PatientGraphicalAssessmentStageVo pgasVo)
{
	if(pgasVo == null)
		return;

	if(pgasVo.getFindingQuestionIsNotNull())
	{
		for(int x = 0; x < pgasVo.getFindingQuestion().size(); x++)
		{
			PatientGraphicAssessmentFindingQuestionAnswerVo answerGraphicFinding = pgasVo.getFindingQuestion().get(x);
			setQuestionFindingRowAnswer(answerGraphicFinding);
		}
	}
}
 
Example 33
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private DynamicGridRow getRowByIdentifier(PatientGraphicAssessmentFindingQuestionAnswerVo graphicFindingQuestionAnswer)
{
	if(graphicFindingQuestionAnswer == null)
		return null;

	for(int x = 0; x < this.grid.getRows().size(); x++)
	{	
		PatientGraphicAssessmentFindingQuestionAnswerVo findingAnswer = (PatientGraphicAssessmentFindingQuestionAnswerVo)(this.grid.getRows().get(x).getCells().get(this.grid.getColumns().getByIdentifier(QUESTION_COLUMN)).getIdentifier());
		if(graphicFindingQuestionAnswer.equals(findingAnswer))
			return this.grid.getRows().get(x);
	}
	
	return null;
}
 
Example 34
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 5 votes vote down vote up
private PatientGraphicAssessmentFindingQuestionAnswerVoCollection sortGraphicQuestionsByIndex(PatientGraphicAssessmentFindingQuestionAnswerVoCollection questionsToBeSorted)
{
	if(questionsToBeSorted == null)
		return new PatientGraphicAssessmentFindingQuestionAnswerVoCollection();

	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++)
		{
			PatientGraphicAssessmentFindingQuestionAnswerVo source = questionsToBeSorted.get(sorted[x]);
			PatientGraphicAssessmentFindingQuestionAnswerVo compare = questionsToBeSorted.get(sorted[y]);
				
			if(source.getGraphicFindingQuestionIsNotNull() && compare.getGraphicFindingQuestionIsNotNull())
			{
				if(source.getGraphicFindingQuestion().getSequenceIsNotNull())
				if(source.getGraphicFindingQuestion().getSequence().compareTo(compare.getGraphicFindingQuestion().getSequence()) < 0)
				{
					int temp = sorted[x]; 
					sorted[x] = sorted[y];
					sorted[y] = temp;	
				}
			}
		}
	}
	
	PatientGraphicAssessmentFindingQuestionAnswerVoCollection sortedQuestions = new PatientGraphicAssessmentFindingQuestionAnswerVoCollection();
	for(int x = 0; x < size; x++)
	{
		sortedQuestions.add(questionsToBeSorted.get(sorted[x]));
	}
	
	return sortedQuestions;
}
 
Example 35
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private ArrayList<String> validateGraphicFindingAnswer(PatientGraphicAssessmentFindingQuestionAnswerVo answer, ArrayList<String> errors)
{
	if (errors == null)
		errors = new ArrayList<String>();

	if (answer == null || answer.getGraphicFindingQuestion() == null || answer.getPatientAnswers() == null)
		return errors;

	QuestionInformationVo question = answer.getGraphicFindingQuestion().getQuestion();
	PatientAssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	Boolean isMandatory = answer.getIsMandatory();

	validateAllAnswers(errors, question, patientAnswers, isMandatory);
	return errors;
}
 
Example 36
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void setAnswersGraphicFindings(PatientGraphicalAssessmentStageVoCollection stages)
{
	if (stages == null || stages.size() <= 0)
		return;

	// we need annotated stage
	PatientGraphicalAssessmentStageVo annotatedStage = null;
	for (int i = 0; i < stages.size(); i++)
	{
		PatientGraphicalAssessmentStageVo stage = stages.get(i);

		if (stage.getStageIsNotNull() && stage.getStage().getAssessmentStageIsNotNull() && stage.getStage().getAssessmentStage().getIsAnnotatedIsNotNull() && stage.getStage().getAssessmentStage().getIsAnnotated().booleanValue())
		{
			annotatedStage = stage;
			break;
		}
	}

	if (annotatedStage == null)
	{
		// we should always have an annotated stage
		annotatedStage = stages.get(0);
	}
	else
	{
		if (annotatedStage.getFindingQuestionIsNotNull())
		{
			for (int x = 0; x < annotatedStage.getFindingQuestion().size(); x++)
			{
				PatientGraphicAssessmentFindingQuestionAnswerVo answerGraphicFinding = annotatedStage.getFindingQuestion().get(x);
				setQuestionFindingRowAnswer(answerGraphicFinding);
			}
		}
	}
}
 
Example 37
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void setAnswersGraphicFindings(PatientGraphicalAssessmentStageVo pgasVo)
{
	if (pgasVo == null)
		return;

	if (pgasVo.getFindingQuestionIsNotNull())
	{
		for (int x = 0; x < pgasVo.getFindingQuestion().size(); x++)
		{
			PatientGraphicAssessmentFindingQuestionAnswerVo answerGraphicFinding = pgasVo.getFindingQuestion().get(x);
			setQuestionFindingRowAnswer(answerGraphicFinding);
		}
	}
}
 
Example 38
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private DynamicGridRow getRowByIdentifier(PatientGraphicAssessmentFindingQuestionAnswerVo graphicFindingQuestionAnswer)
{
	if (graphicFindingQuestionAnswer == null)
		return null;

	for (int x = 0; x < this.grid.getRows().size(); x++)
	{
		PatientGraphicAssessmentFindingQuestionAnswerVo findingAnswer = (PatientGraphicAssessmentFindingQuestionAnswerVo) (this.grid.getRows().get(x).getCells().get(this.grid.getColumns().getByIdentifier(QUESTION_COLUMN)).getIdentifier());
		if (graphicFindingQuestionAnswer.equals(findingAnswer))
			return this.grid.getRows().get(x);
	}

	return null;
}
 
Example 39
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private boolean setQuestionFindingRowAnswer(PatientGraphicAssessmentFindingQuestionAnswerVo graphicAnswer)
{
	if (graphicAnswer == null || graphicAnswer.getPatientAnswers() == null)
		return false;

	DynamicGridRow initialQuestionRow = null;
	DynamicGridRow questionRow = getRowByIdentifier(graphicAnswer);
	if (questionRow == null)
		return false;

	for (int i = 0; i < graphicAnswer.getPatientAnswers().size(); i++)
	{
		PatientAssessmentAnswerVo answerDetail = graphicAnswer.getPatientAnswers().get(i);

		if (answerDetail != null)
		{
			if (i > 0)
			{
				if (initialQuestionRow == null)
					initialQuestionRow = questionRow;

				questionRow = duplicateQuestionRow(initialQuestionRow);
			}

			for (int x = 0; x < answerDetail.getAnswerDetails().size(); x++)
			{
				AnswerDetailsVo answer = answerDetail.getAnswerDetails().get(x);
				DynamicGridCell cell = findCell(questionRow, answer.getAnswerType());

				if (cell != null)
				{
					setCellAnswer(cell, answer);
				}
			}
		}
	}

	return true;
}
 
Example 40
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private PatientGraphicAssessmentFindingQuestionAnswerVoCollection sortGraphicQuestionsByIndex(PatientGraphicAssessmentFindingQuestionAnswerVoCollection questionsToBeSorted)
{
	if (questionsToBeSorted == null)
		return new PatientGraphicAssessmentFindingQuestionAnswerVoCollection();

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

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

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

	return sortedQuestions;
}